repo
stringclasses
235 values
path
stringlengths
11
168
func_name
stringlengths
12
143
original_string
stringlengths
83
6.91k
language
stringclasses
1 value
code
stringlengths
83
6.91k
code_tokens
listlengths
15
1.01k
docstring
stringlengths
5
25.7k
docstring_tokens
listlengths
1
427
sha
stringclasses
235 values
url
stringlengths
99
268
partition
stringclasses
1 value
summary
stringlengths
7
202
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
Azure/azure-sdk-for-ruby
management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb
Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.list_for_subscription_next
def list_for_subscription_next(next_page_link, custom_headers:nil) response = list_for_subscription_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_for_subscription_next(next_page_link, custom_headers:nil) response = list_for_subscription_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_for_subscription_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_for_subscription_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "body", "unless...
Gets all remediations for the subscription. @param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [RemediationListResult] operation results.
[ "Gets", "all", "remediations", "for", "the", "subscription", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L2621-L2624
train
Gets the list of the elastic advisors.
[ 30522, 13366, 2862, 1035, 2005, 1035, 15002, 1035, 2279, 1006, 2279, 1035, 3931, 1035, 4957, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 2005, 1035, 15002, 1035, 2279, 1035, 2004, 6038, 2278, 1006, 2279, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
boazsegev/combine_pdf
lib/combine_pdf/filter.rb
CombinePDF.PDFFilter.inflate_object
def inflate_object(object = nil) return false unless object.is_a?(Hash) filter_array = object[:Filter] if filter_array.is_a?(Hash) && filter_array[:is_reference_only] filter_array = filter_array[:referenced_object] end filter_array = [filter_array] if filter_array.is_a?(Symbol) filter_array = [] if filter_array.nil? params_array = object[:DecodeParms] if params_array.is_a?(Hash) && params_array[:is_reference_only] params_array = params_array[:referenced_object] end params_array = [params_array] unless params_array.is_a?(Array) object[:Filter] = filter_array object[:DecodeParms] = params_array while filter_array[0] case filter_array[0] when :FlateDecode raise_unsupported_error params_array[0] unless params_array[0].nil? if params_array[0] && params_array[0][:Predictor].to_i > 1 predictor = params_array[0][:Predictor].to_i # bits = params_array[0][:BitsPerComponent] || 8 # columns = params_array[0][:Columns] || 1 if (2..9).cover? predictor #### # prepare TIFF group raise_unsupported_error params_array[0] elsif (10..15).cover? predictor #### # prepare PNG group raise_unsupported_error params_array[0] end else inflator = Zlib::Inflate.new object[:raw_stream_content] = inflator.inflate object[:raw_stream_content] begin inflator.finish rescue end inflator.close object[:Length] = object[:raw_stream_content].bytesize end when nil true else return false end params_array.shift filter_array.shift end object.delete :Filter object.delete :DecodeParms true end
ruby
def inflate_object(object = nil) return false unless object.is_a?(Hash) filter_array = object[:Filter] if filter_array.is_a?(Hash) && filter_array[:is_reference_only] filter_array = filter_array[:referenced_object] end filter_array = [filter_array] if filter_array.is_a?(Symbol) filter_array = [] if filter_array.nil? params_array = object[:DecodeParms] if params_array.is_a?(Hash) && params_array[:is_reference_only] params_array = params_array[:referenced_object] end params_array = [params_array] unless params_array.is_a?(Array) object[:Filter] = filter_array object[:DecodeParms] = params_array while filter_array[0] case filter_array[0] when :FlateDecode raise_unsupported_error params_array[0] unless params_array[0].nil? if params_array[0] && params_array[0][:Predictor].to_i > 1 predictor = params_array[0][:Predictor].to_i # bits = params_array[0][:BitsPerComponent] || 8 # columns = params_array[0][:Columns] || 1 if (2..9).cover? predictor #### # prepare TIFF group raise_unsupported_error params_array[0] elsif (10..15).cover? predictor #### # prepare PNG group raise_unsupported_error params_array[0] end else inflator = Zlib::Inflate.new object[:raw_stream_content] = inflator.inflate object[:raw_stream_content] begin inflator.finish rescue end inflator.close object[:Length] = object[:raw_stream_content].bytesize end when nil true else return false end params_array.shift filter_array.shift end object.delete :Filter object.delete :DecodeParms true end
[ "def", "inflate_object", "(", "object", "=", "nil", ")", "return", "false", "unless", "object", ".", "is_a?", "(", "Hash", ")", "filter_array", "=", "object", "[", ":Filter", "]", "if", "filter_array", ".", "is_a?", "(", "Hash", ")", "&&", "filter_array", ...
inflate / decompress an object object:: object to decompress.
[ "inflate", "/", "decompress", "an", "object" ]
09054051019c069f551f3e60be789577c0f93900
https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/filter.rb#L34-L88
train
Inflate the object
[ 30522, 13366, 1999, 10258, 3686, 1035, 4874, 1006, 4874, 1027, 9152, 2140, 1007, 2709, 6270, 4983, 4874, 1012, 2003, 1035, 1037, 1029, 1006, 23325, 1007, 11307, 1035, 9140, 1027, 4874, 1031, 1024, 11307, 1033, 2065, 11307, 1035, 9140, 1012,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_recovery_services_backup/lib/2016-12-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb
Azure::RecoveryServicesBackup::Mgmt::V2016_12_01.ProtectionContainers.unregister
def unregister(vault_name, resource_group_name, fabric_name, container_name, custom_headers:nil) response = unregister_async(vault_name, resource_group_name, fabric_name, container_name, custom_headers:custom_headers).value! nil end
ruby
def unregister(vault_name, resource_group_name, fabric_name, container_name, custom_headers:nil) response = unregister_async(vault_name, resource_group_name, fabric_name, container_name, custom_headers:custom_headers).value! nil end
[ "def", "unregister", "(", "vault_name", ",", "resource_group_name", ",", "fabric_name", ",", "container_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "unregister_async", "(", "vault_name", ",", "resource_group_name", ",", "fabric_name", ",", "conta...
Unregisters the given container from your Recovery Services Vault. This is an asynchronous operation. To determine whether the backend service has finished processing the request, call Get Container Operation Result API. @param vault_name [String] The name of the recovery services vault. @param resource_group_name [String] The name of the resource group where the recovery services vault is present. @param fabric_name [String] Name of the fabric where the container belongs. @param container_name [String] Name of the container which needs to be unregistered from the Recovery Services Vault. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Unregisters", "the", "given", "container", "from", "your", "Recovery", "Services", "Vault", ".", "This", "is", "an", "asynchronous", "operation", ".", "To", "determine", "whether", "the", "backend", "service", "has", "finished", "processing", "the", "request", ...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_backup/lib/2016-12-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb#L276-L279
train
Unregisters the specified container from the specified vault.
[ 30522, 13366, 4895, 2890, 24063, 2121, 1006, 11632, 1035, 2171, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 8313, 1035, 2171, 1010, 11661, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4895, 2890, 24063, 2121,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
grpc/grpc
src/ruby/lib/grpc/generic/bidi_call.rb
GRPC.BidiCall.run_on_server
def run_on_server(gen_each_reply, requests) replies = nil # Pass in the optional call object parameter if possible if gen_each_reply.arity == 1 replies = gen_each_reply.call(requests) elsif gen_each_reply.arity == 2 replies = gen_each_reply.call(requests, @req_view) else fail 'Illegal arity of reply generator' end write_loop(replies, is_client: false) end
ruby
def run_on_server(gen_each_reply, requests) replies = nil # Pass in the optional call object parameter if possible if gen_each_reply.arity == 1 replies = gen_each_reply.call(requests) elsif gen_each_reply.arity == 2 replies = gen_each_reply.call(requests, @req_view) else fail 'Illegal arity of reply generator' end write_loop(replies, is_client: false) end
[ "def", "run_on_server", "(", "gen_each_reply", ",", "requests", ")", "replies", "=", "nil", "# Pass in the optional call object parameter if possible", "if", "gen_each_reply", ".", "arity", "==", "1", "replies", "=", "gen_each_reply", ".", "call", "(", "requests", ")"...
Begins orchestration of the Bidi stream for a server generating replies. N.B. gen_each_reply is a func(Enumerable<Requests>) It takes an enumerable of requests as an arg, in case there is a relationship between the stream of requests and the stream of replies. This does not mean that must necessarily be one. E.g, the replies produced by gen_each_reply could ignore the received_msgs @param [Proc] gen_each_reply generates the BiDi stream replies. @param [Enumerable] requests The enumerable of requests to run
[ "Begins", "orchestration", "of", "the", "Bidi", "stream", "for", "a", "server", "generating", "replies", "." ]
f3937f0e55227a4ef3a23f895d3b204a947610f8
https://github.com/grpc/grpc/blob/f3937f0e55227a4ef3a23f895d3b204a947610f8/src/ruby/lib/grpc/generic/bidi_call.rb#L92-L105
train
Run the reply generator on the server
[ 30522, 13366, 2448, 1035, 2006, 1035, 8241, 1006, 8991, 1035, 2169, 1035, 7514, 1010, 11186, 1007, 14054, 1027, 9152, 2140, 1001, 3413, 1999, 1996, 11887, 2655, 4874, 16381, 2065, 2825, 2065, 8991, 1035, 2169, 1035, 7514, 1012, 10488, 3723,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
magnusvk/counter_culture
lib/counter_culture/counter.rb
CounterCulture.Counter.relation_klass
def relation_klass(relation, source: nil, was: false) reflect = relation_reflect(relation) if reflect.options.key?(:polymorphic) raise "Can't work out relation's class without being passed object (relation: #{relation}, reflect: #{reflect})" if source.nil? raise "Can't work out polymorhpic relation's class with multiple relations yet" unless (relation.is_a?(Symbol) || relation.length == 1) # this is the column that stores the polymorphic type, aka the class name type_column = reflect.foreign_type.to_sym # so now turn that into the class that we're looking for here if was attribute_was(source, type_column).try(:constantize) else source.public_send(type_column).try(:constantize) end else reflect.klass end end
ruby
def relation_klass(relation, source: nil, was: false) reflect = relation_reflect(relation) if reflect.options.key?(:polymorphic) raise "Can't work out relation's class without being passed object (relation: #{relation}, reflect: #{reflect})" if source.nil? raise "Can't work out polymorhpic relation's class with multiple relations yet" unless (relation.is_a?(Symbol) || relation.length == 1) # this is the column that stores the polymorphic type, aka the class name type_column = reflect.foreign_type.to_sym # so now turn that into the class that we're looking for here if was attribute_was(source, type_column).try(:constantize) else source.public_send(type_column).try(:constantize) end else reflect.klass end end
[ "def", "relation_klass", "(", "relation", ",", "source", ":", "nil", ",", "was", ":", "false", ")", "reflect", "=", "relation_reflect", "(", "relation", ")", "if", "reflect", ".", "options", ".", "key?", "(", ":polymorphic", ")", "raise", "\"Can't work out r...
gets the class of the given relation relation: a symbol or array of symbols; specifies the relation that has the counter cache column source [optional]: the source object, only needed for polymorphic associations, probably only works with a single relation (symbol, or array of 1 symbol) was: boolean we're actually looking for the old value -- only can change for polymorphic relations
[ "gets", "the", "class", "of", "the", "given", "relation" ]
6b5bd4d6e1ee4f10f262ace7cfed5776af9520ba
https://github.com/magnusvk/counter_culture/blob/6b5bd4d6e1ee4f10f262ace7cfed5776af9520ba/lib/counter_culture/counter.rb#L188-L204
train
Returns the class of the relation that is being used for the relation.
[ 30522, 13366, 7189, 1035, 1047, 27102, 1006, 7189, 1010, 3120, 1024, 9152, 2140, 1010, 2001, 1024, 6270, 1007, 8339, 1027, 7189, 1035, 8339, 1006, 7189, 1007, 2065, 8339, 1012, 7047, 1012, 3145, 1029, 1006, 1024, 26572, 18078, 1007, 5333, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rails/rails
actionview/lib/action_view/routing_url_for.rb
ActionView.RoutingUrlFor.url_for
def url_for(options = nil) case options when String options when nil super(only_path: _generate_paths_by_default) when Hash options = options.symbolize_keys ensure_only_path_option(options) super(options) when ActionController::Parameters ensure_only_path_option(options) super(options) when :back _back_url when Array components = options.dup options = components.extract_options! ensure_only_path_option(options) if options[:only_path] polymorphic_path(components, options) else polymorphic_url(components, options) end else method = _generate_paths_by_default ? :path : :url builder = ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder.send(method) case options when Symbol builder.handle_string_call(self, options) when Class builder.handle_class_call(self, options) else builder.handle_model_call(self, options) end end end
ruby
def url_for(options = nil) case options when String options when nil super(only_path: _generate_paths_by_default) when Hash options = options.symbolize_keys ensure_only_path_option(options) super(options) when ActionController::Parameters ensure_only_path_option(options) super(options) when :back _back_url when Array components = options.dup options = components.extract_options! ensure_only_path_option(options) if options[:only_path] polymorphic_path(components, options) else polymorphic_url(components, options) end else method = _generate_paths_by_default ? :path : :url builder = ActionDispatch::Routing::PolymorphicRoutes::HelperMethodBuilder.send(method) case options when Symbol builder.handle_string_call(self, options) when Class builder.handle_class_call(self, options) else builder.handle_model_call(self, options) end end end
[ "def", "url_for", "(", "options", "=", "nil", ")", "case", "options", "when", "String", "options", "when", "nil", "super", "(", "only_path", ":", "_generate_paths_by_default", ")", "when", "Hash", "options", "=", "options", ".", "symbolize_keys", "ensure_only_pa...
Returns the URL for the set of +options+ provided. This takes the same options as +url_for+ in Action Controller (see the documentation for <tt>ActionController::Base#url_for</tt>). Note that by default <tt>:only_path</tt> is <tt>true</tt> so you'll get the relative "/controller/action" instead of the fully qualified URL like "http://example.com/controller/action". ==== Options * <tt>:anchor</tt> - Specifies the anchor name to be appended to the path. * <tt>:only_path</tt> - If true, returns the relative URL (omitting the protocol, host name, and port) (<tt>true</tt> by default unless <tt>:host</tt> is specified). * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in "/archive/2005/". Note that this is currently not recommended since it breaks caching. * <tt>:host</tt> - Overrides the default (current) host if provided. * <tt>:protocol</tt> - Overrides the default (current) protocol if provided. * <tt>:user</tt> - Inline HTTP authentication (only plucked out if <tt>:password</tt> is also present). * <tt>:password</tt> - Inline HTTP authentication (only plucked out if <tt>:user</tt> is also present). ==== Relying on named routes Passing a record (like an Active Record) instead of a hash as the options parameter will trigger the named route for that record. The lookup will happen on the name of the class. So passing a Workshop object will attempt to use the +workshop_path+ route. If you have a nested route, such as +admin_workshop_path+ you'll have to call that explicitly (it's impossible for +url_for+ to guess that route). ==== Implicit Controller Namespacing Controllers passed in using the +:controller+ option will retain their namespace unless it is an absolute one. ==== Examples <%= url_for(action: 'index') %> # => /blogs/ <%= url_for(action: 'find', controller: 'books') %> # => /books/find <%= url_for(action: 'login', controller: 'members', only_path: false, protocol: 'https') %> # => https://www.example.com/members/login/ <%= url_for(action: 'play', anchor: 'player') %> # => /messages/play/#player <%= url_for(action: 'jump', anchor: 'tax&ship') %> # => /testing/jump/#tax&ship <%= url_for(Workshop.new) %> # relies on Workshop answering a persisted? call (and in this case returning false) # => /workshops <%= url_for(@workshop) %> # calls @workshop.to_param which by default returns the id # => /workshops/5 # to_param can be re-defined in a model to provide different URL names: # => /workshops/1-workshop-name <%= url_for("http://www.example.com") %> # => http://www.example.com <%= url_for(:back) %> # if request.env["HTTP_REFERER"] is set to "http://www.example.com" # => http://www.example.com <%= url_for(:back) %> # if request.env["HTTP_REFERER"] is not set or is blank # => javascript:history.back() <%= url_for(action: 'index', controller: 'users') %> # Assuming an "admin" namespace # => /admin/users <%= url_for(action: 'index', controller: '/users') %> # Specify absolute path with beginning slash # => /users
[ "Returns", "the", "URL", "for", "the", "set", "of", "+", "options", "+", "provided", ".", "This", "takes", "the", "same", "options", "as", "+", "url_for", "+", "in", "Action", "Controller", "(", "see", "the", "documentation", "for", "<tt", ">", "ActionCo...
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/routing_url_for.rb#L79-L119
train
Returns the url for the current route
[ 30522, 13366, 24471, 2140, 1035, 2005, 1006, 7047, 1027, 9152, 2140, 1007, 2553, 7047, 2043, 5164, 7047, 2043, 9152, 2140, 3565, 1006, 2069, 1035, 4130, 1024, 1035, 9699, 1035, 10425, 1035, 2011, 1035, 12398, 1007, 2043, 23325, 7047, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb
Azure::StorSimple8000Series::Mgmt::V2017_06_01.Devices.list_failover_sets
def list_failover_sets(device_name, resource_group_name, manager_name, custom_headers:nil) response = list_failover_sets_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_failover_sets(device_name, resource_group_name, manager_name, custom_headers:nil) response = list_failover_sets_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_failover_sets", "(", "device_name", ",", "resource_group_name", ",", "manager_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_failover_sets_async", "(", "device_name", ",", "resource_group_name", ",", "manager_name", ",", "custom_heade...
Returns all failover sets for a given device and their eligibility for participating in a failover. A failover set refers to a set of volume containers that need to be failed-over as a single unit to maintain data integrity. @param device_name [String] The device name @param resource_group_name [String] The resource group name @param manager_name [String] The manager name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [FailoverSetsList] operation results.
[ "Returns", "all", "failover", "sets", "for", "a", "given", "device", "and", "their", "eligibility", "for", "participating", "in", "a", "failover", ".", "A", "failover", "set", "refers", "to", "a", "set", "of", "volume", "containers", "that", "need", "to", ...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb#L608-L611
train
Gets the number of failover sets for the device.
[ 30522, 13366, 2862, 1035, 8246, 7840, 1035, 4520, 1006, 5080, 1035, 2171, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 3208, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 8246, 7840, 1035, 4520, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
etewiah/property_web_builder
app/controllers/pwb/api/v1/translations_controller.rb
Pwb.Api::V1::TranslationsController.delete_translation_values
def delete_translation_values field_key = FieldKey.find_by_global_key(params[:i18n_key]) field_key.visible = false # not convinced it makes sense to delete the associated translations # phrases = I18n::Backend::ActiveRecord::Translation.where(:key => params[:i18n_key]) # phrases.destroy_all field_key.save! render json: { success: true } end
ruby
def delete_translation_values field_key = FieldKey.find_by_global_key(params[:i18n_key]) field_key.visible = false # not convinced it makes sense to delete the associated translations # phrases = I18n::Backend::ActiveRecord::Translation.where(:key => params[:i18n_key]) # phrases.destroy_all field_key.save! render json: { success: true } end
[ "def", "delete_translation_values", "field_key", "=", "FieldKey", ".", "find_by_global_key", "(", "params", "[", ":i18n_key", "]", ")", "field_key", ".", "visible", "=", "false", "# not convinced it makes sense to delete the associated translations", "# phrases = I18n::Backend:...
deletes the field_key referencing the translation
[ "deletes", "the", "field_key", "referencing", "the", "translation" ]
fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21
https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/controllers/pwb/api/v1/translations_controller.rb#L49-L59
train
delete all translation values
[ 30522, 13366, 3972, 12870, 1035, 5449, 1035, 5300, 2492, 1035, 3145, 1027, 2492, 14839, 1012, 2424, 1035, 2011, 1035, 3795, 1035, 3145, 1006, 11498, 5244, 1031, 1024, 1045, 15136, 2078, 1035, 3145, 1033, 1007, 2492, 1035, 3145, 1012, 5710, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb
Aws::IAM.Policy.attached_users
def attached_users(options = {}) batches = Enumerator.new do |y| options = options.merge( policy_arn: @arn, entity_filter: "User" ) resp = @client.list_entities_for_policy(options) resp.each_page do |page| batch = [] page.data.policy_users.each do |p| batch << User.new( name: p.user_name, data: p, client: @client ) end y.yield(batch) end end User::Collection.new(batches) end
ruby
def attached_users(options = {}) batches = Enumerator.new do |y| options = options.merge( policy_arn: @arn, entity_filter: "User" ) resp = @client.list_entities_for_policy(options) resp.each_page do |page| batch = [] page.data.policy_users.each do |p| batch << User.new( name: p.user_name, data: p, client: @client ) end y.yield(batch) end end User::Collection.new(batches) end
[ "def", "attached_users", "(", "options", "=", "{", "}", ")", "batches", "=", "Enumerator", ".", "new", "do", "|", "y", "|", "options", "=", "options", ".", "merge", "(", "policy_arn", ":", "@arn", ",", "entity_filter", ":", "\"User\"", ")", "resp", "="...
@example Request syntax with placeholder values attached_users = policy.attached_users({ path_prefix: "pathType", policy_usage_filter: "PermissionsPolicy", # accepts PermissionsPolicy, PermissionsBoundary }) @param [Hash] options ({}) @option options [String] :path_prefix The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities. This parameter allows (through its [regex pattern][1]) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\\u0021) through the DEL character (\\u007F), including most punctuation characters, digits, and upper and lowercased letters. [1]: http://wikipedia.org/wiki/regex @option options [String] :policy_usage_filter The policy usage method to use for filtering the results. To list only permissions policies, set `PolicyUsageFilter` to `PermissionsPolicy`. To list only the policies used to set permissions boundaries, set the value to `PermissionsBoundary`. This parameter is optional. If it is not included, all policies are returned. @return [User::Collection]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb#L624-L644
train
Returns an array of all users attached to this policy
[ 30522, 13366, 4987, 1035, 5198, 1006, 7047, 1027, 1063, 1065, 1007, 14108, 2229, 1027, 4372, 17897, 16259, 1012, 2047, 2079, 1064, 1061, 1064, 7047, 1027, 7047, 1012, 13590, 1006, 3343, 1035, 12098, 2078, 1024, 1030, 12098, 2078, 1010, 9178...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mongodb/mongo-ruby-driver
lib/mongo/client.rb
Mongo.Client.reconnect
def reconnect addresses = cluster.addresses.map(&:to_s) @cluster.disconnect! rescue nil @cluster = Cluster.new(addresses, monitoring, cluster_options) true end
ruby
def reconnect addresses = cluster.addresses.map(&:to_s) @cluster.disconnect! rescue nil @cluster = Cluster.new(addresses, monitoring, cluster_options) true end
[ "def", "reconnect", "addresses", "=", "cluster", ".", "addresses", ".", "map", "(", ":to_s", ")", "@cluster", ".", "disconnect!", "rescue", "nil", "@cluster", "=", "Cluster", ".", "new", "(", "addresses", ",", "monitoring", ",", "cluster_options", ")", "true...
Reconnect the client. @example Reconnect the client. client.reconnect @return [ true ] Always true. @since 2.1.0
[ "Reconnect", "the", "client", "." ]
dca26d0870cb3386fad9ccc1d17228097c1fe1c8
https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/client.rb#L575-L582
train
Reconnects to the cluster
[ 30522, 13366, 28667, 18256, 6593, 11596, 1027, 9324, 1012, 11596, 1012, 4949, 1006, 1004, 1024, 2000, 1035, 1055, 1007, 1030, 9324, 1012, 12532, 10087, 6593, 999, 5343, 9152, 2140, 1030, 9324, 1027, 9324, 1012, 2047, 1006, 11596, 1010, 8822...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sensu/sensu
lib/sensu/daemon.rb
Sensu.Daemon.load_extensions
def load_extensions(options={}) extensions_options = options.merge(:extensions => @settings[:extensions]) @extensions = Extensions.get(extensions_options) log_notices(@extensions.warnings) extension_settings = @settings.to_hash.dup @extensions.all.each do |extension| extension.logger = @logger extension.settings = extension_settings end end
ruby
def load_extensions(options={}) extensions_options = options.merge(:extensions => @settings[:extensions]) @extensions = Extensions.get(extensions_options) log_notices(@extensions.warnings) extension_settings = @settings.to_hash.dup @extensions.all.each do |extension| extension.logger = @logger extension.settings = extension_settings end end
[ "def", "load_extensions", "(", "options", "=", "{", "}", ")", "extensions_options", "=", "options", ".", "merge", "(", ":extensions", "=>", "@settings", "[", ":extensions", "]", ")", "@extensions", "=", "Extensions", ".", "get", "(", "extensions_options", ")",...
Load Sensu extensions and log any notices. Set the logger and settings for each extension instance. This method creates the extensions instance variable: `@extensions`. https://github.com/sensu/sensu-extensions https://github.com/sensu/sensu-extension @param options [Hash]
[ "Load", "Sensu", "extensions", "and", "log", "any", "notices", ".", "Set", "the", "logger", "and", "settings", "for", "each", "extension", "instance", ".", "This", "method", "creates", "the", "extensions", "instance", "variable", ":", "@extensions", "." ]
51319e4b58c8d9986f101ad71ff729aa3e51e951
https://github.com/sensu/sensu/blob/51319e4b58c8d9986f101ad71ff729aa3e51e951/lib/sensu/daemon.rb#L186-L195
train
Load all extensions
[ 30522, 13366, 7170, 1035, 14305, 1006, 7047, 1027, 1063, 1065, 1007, 14305, 1035, 7047, 1027, 7047, 1012, 13590, 1006, 1024, 14305, 1027, 1028, 1030, 10906, 1031, 1024, 14305, 1033, 1007, 1030, 14305, 1027, 14305, 1012, 2131, 1006, 14305, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
boazsegev/combine_pdf
lib/combine_pdf/page_methods.rb
CombinePDF.Page_Methods.orientation
def orientation(force = nil, clockwise = true) a = page_size return (a[2] - a[0] > a[3] - a[1]) ? :landscape : :portrait unless force unless orientation == force || (a[2] - a[0] == a[3] - a[1]) self[:Rotate] = 0 clockwise ? rotate_right : rotate_left end self end
ruby
def orientation(force = nil, clockwise = true) a = page_size return (a[2] - a[0] > a[3] - a[1]) ? :landscape : :portrait unless force unless orientation == force || (a[2] - a[0] == a[3] - a[1]) self[:Rotate] = 0 clockwise ? rotate_right : rotate_left end self end
[ "def", "orientation", "(", "force", "=", "nil", ",", "clockwise", "=", "true", ")", "a", "=", "page_size", "return", "(", "a", "[", "2", "]", "-", "a", "[", "0", "]", ">", "a", "[", "3", "]", "-", "a", "[", "1", "]", ")", "?", ":landscape", ...
get or set (by clockwise rotation) the page's data orientation. note that the data's orientation is the way data is oriented on the page. The display orientati0n (which might different) is controlled by the `:Rotate` property. see {#fix_orientation} for more details. accepts one optional parameter: force:: to get the orientation, pass nil. to set the orientatiom, set fource to either :portrait or :landscape. defaults to nil (get orientation). clockwise:: sets the rotation directions. defaults to true (clockwise rotation). returns the current orientation (:portrait or :landscape) if used to get the orientation. otherwise, if used to set the orientation, returns the page object to allow method chaining. * Notice: a square page always returns the :portrait value and is ignored when trying to set the orientation.
[ "get", "or", "set", "(", "by", "clockwise", "rotation", ")", "the", "page", "s", "data", "orientation", "." ]
09054051019c069f551f3e60be789577c0f93900
https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/page_methods.rb#L525-L533
train
Returns the orientation of the page.
[ 30522, 13366, 10296, 1006, 2486, 1027, 9152, 2140, 1010, 22839, 1027, 2995, 1007, 1037, 1027, 3931, 1035, 2946, 2709, 1006, 1037, 1031, 1016, 1033, 1011, 1037, 1031, 1014, 1033, 1028, 1037, 1031, 1017, 1033, 1011, 1037, 1031, 1015, 1033, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
david942j/one_gadget
lib/one_gadget/cli.rb
OneGadget.CLI.display_gadgets
def display_gadgets(gadgets, raw) if raw show(gadgets.map(&:offset).join(' ')) else show(gadgets.map(&:inspect).join("\n")) end end
ruby
def display_gadgets(gadgets, raw) if raw show(gadgets.map(&:offset).join(' ')) else show(gadgets.map(&:inspect).join("\n")) end end
[ "def", "display_gadgets", "(", "gadgets", ",", "raw", ")", "if", "raw", "show", "(", "gadgets", ".", "map", "(", ":offset", ")", ".", "join", "(", "' '", ")", ")", "else", "show", "(", "gadgets", ".", "map", "(", ":inspect", ")", ".", "join", "(", ...
Writes gadgets to stdout. @param [Array<OneGadget::Gadget::Gadget>] gadgets @param [Boolean] raw In raw mode, only the offset of gadgets are printed. @return [true]
[ "Writes", "gadgets", "to", "stdout", "." ]
ff6ef04541e83441bfe3c2664a6febd1640f4263
https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/cli.rb#L177-L183
train
displays the gadgets
[ 30522, 13366, 4653, 1035, 11721, 28682, 1006, 11721, 28682, 1010, 6315, 1007, 2065, 6315, 2265, 1006, 11721, 28682, 1012, 4949, 1006, 1004, 1024, 16396, 1007, 1012, 3693, 1006, 1005, 1005, 1007, 1007, 2842, 2265, 1006, 11721, 28682, 1012, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-iam/lib/aws-sdk-iam/user.rb
Aws::IAM.User.remove_group
def remove_group(options = {}) options = options.merge(user_name: @name) resp = @client.remove_user_from_group(options) resp.data end
ruby
def remove_group(options = {}) options = options.merge(user_name: @name) resp = @client.remove_user_from_group(options) resp.data end
[ "def", "remove_group", "(", "options", "=", "{", "}", ")", "options", "=", "options", ".", "merge", "(", "user_name", ":", "@name", ")", "resp", "=", "@client", ".", "remove_user_from_group", "(", "options", ")", "resp", ".", "data", "end" ]
@example Request syntax with placeholder values user.remove_group({ group_name: "groupNameType", # required }) @param [Hash] options ({}) @option options [required, String] :group_name The name of the group to update. This parameter allows (through its [regex pattern][1]) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: \_+=,.@- [1]: http://wikipedia.org/wiki/regex @return [EmptyStructure]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/user.rb#L616-L620
train
Remove the user from a group
[ 30522, 13366, 6366, 1035, 2177, 1006, 7047, 1027, 1063, 1065, 1007, 7047, 1027, 7047, 1012, 13590, 1006, 5310, 1035, 2171, 1024, 1030, 2171, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 6366, 1035, 5310, 1035, 2013, 1035, 2177, 1006, 7047, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/connection_monitors.rb
Azure::Network::Mgmt::V2018_10_01.ConnectionMonitors.begin_start
def begin_start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = begin_start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! nil end
ruby
def begin_start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) response = begin_start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! nil end
[ "def", "begin_start", "(", "resource_group_name", ",", "network_watcher_name", ",", "connection_monitor_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_start_async", "(", "resource_group_name", ",", "network_watcher_name", ",", "connection_monitor_nam...
Starts the specified connection monitor. @param resource_group_name [String] The name of the resource group containing Network Watcher. @param network_watcher_name [String] The name of the Network Watcher resource. @param connection_monitor_name [String] The name of the connection monitor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Starts", "the", "specified", "connection", "monitor", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/connection_monitors.rb#L778-L781
train
Starts a connection monitor.
[ 30522, 13366, 4088, 1035, 2707, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2897, 1035, 3422, 2121, 1035, 2171, 1010, 4434, 1035, 8080, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 2707, 1035, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/recovery_points.rb
Azure::RecoveryServicesSiteRecovery::Mgmt::V2016_08_10.RecoveryPoints.list_by_replication_protected_items_as_lazy
def list_by_replication_protected_items_as_lazy(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:nil) response = list_by_replication_protected_items_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_replication_protected_items_next_async(next_page_link, custom_headers:custom_headers) end page end end
ruby
def list_by_replication_protected_items_as_lazy(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:nil) response = list_by_replication_protected_items_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_replication_protected_items_next_async(next_page_link, custom_headers:custom_headers) end page end end
[ "def", "list_by_replication_protected_items_as_lazy", "(", "fabric_name", ",", "protection_container_name", ",", "replicated_protected_item_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_by_replication_protected_items_async", "(", "fabric_name", ",", "pro...
Get recovery points for a replication protected item. Lists the available recovery points for a replication protected item. @param fabric_name [String] The fabric name. @param protection_container_name [String] The protection container name. @param replicated_protected_item_name [String] The replication protected item's name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [RecoveryPointCollection] which provide lazy access to pages of the response.
[ "Get", "recovery", "points", "for", "a", "replication", "protected", "item", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/recovery_points.rb#L351-L360
train
Gets all the protected items in the specified fabric.
[ 30522, 13366, 2862, 1035, 2011, 1035, 21647, 1035, 5123, 1035, 5167, 1035, 2004, 1035, 13971, 1006, 8313, 1035, 2171, 1010, 3860, 1035, 11661, 1035, 2171, 1010, 28024, 2094, 1035, 5123, 1035, 8875, 1035, 2171, 1010, 7661, 1035, 20346, 2015,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/hybrid_runbook_worker_group_operations.rb
Azure::Automation::Mgmt::V2015_10_31.HybridRunbookWorkerGroupOperations.update_with_http_info
def update_with_http_info(resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, parameters, custom_headers:nil) update_async(resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, parameters, custom_headers:custom_headers).value! end
ruby
def update_with_http_info(resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, parameters, custom_headers:nil) update_async(resource_group_name, automation_account_name, hybrid_runbook_worker_group_name, parameters, custom_headers:custom_headers).value! end
[ "def", "update_with_http_info", "(", "resource_group_name", ",", "automation_account_name", ",", "hybrid_runbook_worker_group_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "update_async", "(", "resource_group_name", ",", "automation_account_name", ",", "...
Update a hybrid runbook worker group. @param resource_group_name [String] Name of an Azure Resource group. @param automation_account_name [String] The name of the automation account. @param hybrid_runbook_worker_group_name [String] The hybrid runbook worker group name @param parameters [HybridRunbookWorkerGroupUpdateParameters] The hybrid runbook worker group @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Update", "a", "hybrid", "runbook", "worker", "group", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/hybrid_runbook_worker_group_operations.rb#L250-L252
train
Updates a hybrid runbook worker group.
[ 30522, 13366, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 19309, 1035, 4070, 1035, 2171, 1010, 8893, 1035, 2448, 8654, 1035, 7309, 1035, 2177, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
square/connect-ruby-sdk
lib/square_connect/api/catalog_api.rb
SquareConnect.CatalogApi.upsert_catalog_object
def upsert_catalog_object(body, opts = {}) data, _status_code, _headers = upsert_catalog_object_with_http_info(body, opts) return data end
ruby
def upsert_catalog_object(body, opts = {}) data, _status_code, _headers = upsert_catalog_object_with_http_info(body, opts) return data end
[ "def", "upsert_catalog_object", "(", "body", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "upsert_catalog_object_with_http_info", "(", "body", ",", "opts", ")", "return", "data", "end" ]
UpsertCatalogObject Creates or updates the target [CatalogObject](#type-catalogobject). @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [UpsertCatalogObjectResponse]
[ "UpsertCatalogObject", "Creates", "or", "updates", "the", "target", "[", "CatalogObject", "]", "(", "#type", "-", "catalogobject", ")", "." ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/catalog_api.rb#L576-L579
train
Upserts a catalog object
[ 30522, 13366, 11139, 8743, 1035, 12105, 1035, 4874, 1006, 2303, 1010, 23569, 2015, 1027, 1063, 1065, 1007, 2951, 1010, 1035, 3570, 1035, 3642, 1010, 1035, 20346, 2015, 1027, 11139, 8743, 1035, 12105, 1035, 4874, 1035, 2007, 1035, 8299, 1035...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mongodb/mongoid
lib/mongoid/criteria.rb
Mongoid.Criteria.where
def where(expression) if expression.is_a?(::String) && embedded? raise Errors::UnsupportedJavascript.new(klass, expression) end super end
ruby
def where(expression) if expression.is_a?(::String) && embedded? raise Errors::UnsupportedJavascript.new(klass, expression) end super end
[ "def", "where", "(", "expression", ")", "if", "expression", ".", "is_a?", "(", "::", "String", ")", "&&", "embedded?", "raise", "Errors", "::", "UnsupportedJavascript", ".", "new", "(", "klass", ",", "expression", ")", "end", "super", "end" ]
This is the general entry point for most MongoDB queries. This either creates a standard field: value selection, and expanded selection with the use of hash methods, or a $where selection if a string is provided. @example Add a standard selection. criteria.where(name: "syd") @example Add a javascript selection. criteria.where("this.name == 'syd'") @param [ String, Hash ] expression The javascript or standard selection. @raise [ UnsupportedJavascript ] If provided a string and the criteria is embedded. @return [ Criteria ] The cloned selectable. @since 1.0.0
[ "This", "is", "the", "general", "entry", "point", "for", "most", "MongoDB", "queries", ".", "This", "either", "creates", "a", "standard", "field", ":", "value", "selection", "and", "expanded", "selection", "with", "the", "use", "of", "hash", "methods", "or",...
56976e32610f4c2450882b0bfe14da099f0703f4
https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/criteria.rb#L402-L407
train
Returns the result of the where statement.
[ 30522, 13366, 2073, 1006, 3670, 1007, 2065, 3670, 1012, 2003, 1035, 1037, 1029, 1006, 1024, 1024, 5164, 1007, 1004, 1004, 11157, 1029, 5333, 10697, 1024, 1024, 4895, 6342, 9397, 15613, 3900, 12044, 23235, 1012, 2047, 1006, 1047, 27102, 1010...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
randym/axlsx
lib/axlsx/workbook/worksheet/worksheet.rb
Axlsx.Worksheet.outline_level_rows
def outline_level_rows(start_index, end_index, level = 1, collapsed = true) outline rows, (start_index..end_index), level, collapsed end
ruby
def outline_level_rows(start_index, end_index, level = 1, collapsed = true) outline rows, (start_index..end_index), level, collapsed end
[ "def", "outline_level_rows", "(", "start_index", ",", "end_index", ",", "level", "=", "1", ",", "collapsed", "=", "true", ")", "outline", "rows", ",", "(", "start_index", "..", "end_index", ")", ",", "level", ",", "collapsed", "end" ]
shortcut level to specify the outline level for a series of rows Oulining is what lets you add collapse and expand to a data set. @param [Integer] start_index The zero based index of the first row of outlining. @param [Integer] end_index The zero based index of the last row to be outlined @param [integer] level The level of outline to apply @param [Integer] collapsed The initial collapsed state of the outline group
[ "shortcut", "level", "to", "specify", "the", "outline", "level", "for", "a", "series", "of", "rows", "Oulining", "is", "what", "lets", "you", "add", "collapse", "and", "expand", "to", "a", "data", "set", "." ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/worksheet.rb#L627-L629
train
Returns the outline rows for the specified range of rows
[ 30522, 13366, 12685, 1035, 2504, 1035, 10281, 1006, 2707, 1035, 5950, 1010, 2203, 1035, 5950, 1010, 2504, 1027, 1015, 1010, 7798, 1027, 2995, 1007, 12685, 10281, 1010, 1006, 2707, 1035, 5950, 1012, 1012, 2203, 1035, 5950, 1007, 1010, 2504, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
deivid-rodriguez/byebug
lib/byebug/runner.rb
Byebug.Runner.run
def run Byebug.mode = :standalone option_parser.order!($ARGV) return if non_script_option? || error_in_script? $PROGRAM_NAME = program Byebug.run_init_script if init_script loop do debug_program break if quit ControlProcessor.new(nil, interface).process_commands end end
ruby
def run Byebug.mode = :standalone option_parser.order!($ARGV) return if non_script_option? || error_in_script? $PROGRAM_NAME = program Byebug.run_init_script if init_script loop do debug_program break if quit ControlProcessor.new(nil, interface).process_commands end end
[ "def", "run", "Byebug", ".", "mode", "=", ":standalone", "option_parser", ".", "order!", "(", "$ARGV", ")", "return", "if", "non_script_option?", "||", "error_in_script?", "$PROGRAM_NAME", "=", "program", "Byebug", ".", "run_init_script", "if", "init_script", "loo...
Starts byebug to debug a program.
[ "Starts", "byebug", "to", "debug", "a", "program", "." ]
bf41a63858a648baa7fb621600d6451786d1572a
https://github.com/deivid-rodriguez/byebug/blob/bf41a63858a648baa7fb621600d6451786d1572a/lib/byebug/runner.rb#L92-L109
train
Run the program
[ 30522, 13366, 2448, 9061, 8569, 2290, 1012, 5549, 1027, 1024, 26609, 5724, 1035, 11968, 8043, 1012, 2344, 999, 1006, 1002, 12098, 2290, 2615, 1007, 2709, 2065, 2512, 1035, 5896, 1035, 5724, 1029, 1064, 1064, 7561, 1035, 1999, 1035, 5896, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_policy.rb
Azure::ApiManagement::Mgmt::V2018_01_01.ProductPolicy.get_entity_tag_with_http_info
def get_entity_tag_with_http_info(resource_group_name, service_name, product_id, custom_headers:nil) get_entity_tag_async(resource_group_name, service_name, product_id, custom_headers:custom_headers).value! end
ruby
def get_entity_tag_with_http_info(resource_group_name, service_name, product_id, custom_headers:nil) get_entity_tag_async(resource_group_name, service_name, product_id, custom_headers:custom_headers).value! end
[ "def", "get_entity_tag_with_http_info", "(", "resource_group_name", ",", "service_name", ",", "product_id", ",", "custom_headers", ":", "nil", ")", "get_entity_tag_async", "(", "resource_group_name", ",", "service_name", ",", "product_id", ",", "custom_headers", ":custom_...
Get the ETag of the policy configuration at the Product level. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param product_id [String] Product identifier. Must be unique in the current API Management service instance. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Get", "the", "ETag", "of", "the", "policy", "configuration", "at", "the", "Product", "level", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/product_policy.rb#L157-L159
train
Gets the entity tag for the specified product.
[ 30522, 13366, 2131, 1035, 9178, 1035, 6415, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 4031, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, 9178, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hashicorp/vault-ruby
lib/vault/api/approle.rb
Vault.AppRole.role
def role(name) json = client.get("/v1/auth/approle/role/#{encode_path(name)}") return Secret.decode(json) rescue HTTPError => e return nil if e.code == 404 raise end
ruby
def role(name) json = client.get("/v1/auth/approle/role/#{encode_path(name)}") return Secret.decode(json) rescue HTTPError => e return nil if e.code == 404 raise end
[ "def", "role", "(", "name", ")", "json", "=", "client", ".", "get", "(", "\"/v1/auth/approle/role/#{encode_path(name)}\"", ")", "return", "Secret", ".", "decode", "(", "json", ")", "rescue", "HTTPError", "=>", "e", "return", "nil", "if", "e", ".", "code", ...
Gets the AppRole by the given name. If an AppRole does not exist by that name, +nil+ is returned. @example Vault.approle.role("testrole") #=> #<Vault::Secret lease_id="..."> @return [Secret, nil]
[ "Gets", "the", "AppRole", "by", "the", "given", "name", ".", "If", "an", "AppRole", "does", "not", "exist", "by", "that", "name", "+", "nil", "+", "is", "returned", "." ]
02f0532a802ba1a2a0d8703a4585dab76eb9d864
https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/approle.rb#L72-L78
train
Get the role for the given name.
[ 30522, 13366, 2535, 1006, 2171, 1007, 1046, 3385, 1027, 7396, 1012, 2131, 1006, 1000, 1013, 1058, 2487, 1013, 8740, 2705, 1013, 10439, 13153, 2063, 1013, 2535, 1013, 1001, 1063, 4372, 16044, 1035, 4130, 1006, 2171, 1007, 1065, 1000, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_videosearch/lib/1.0/generated/azure_cognitiveservices_videosearch/videos_operations.rb
Azure::CognitiveServices::VideoSearch::V1_0.VideosOperations.details_with_http_info
def details_with_http_info(query, accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, id:nil, modules:nil, market:nil, resolution:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil) details_async(query, accept_language:accept_language, user_agent:user_agent, client_id:client_id, client_ip:client_ip, location:location, country_code:country_code, id:id, modules:modules, market:market, resolution:resolution, safe_search:safe_search, set_lang:set_lang, text_decorations:text_decorations, text_format:text_format, custom_headers:custom_headers).value! end
ruby
def details_with_http_info(query, accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, id:nil, modules:nil, market:nil, resolution:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil) details_async(query, accept_language:accept_language, user_agent:user_agent, client_id:client_id, client_ip:client_ip, location:location, country_code:country_code, id:id, modules:modules, market:market, resolution:resolution, safe_search:safe_search, set_lang:set_lang, text_decorations:text_decorations, text_format:text_format, custom_headers:custom_headers).value! end
[ "def", "details_with_http_info", "(", "query", ",", "accept_language", ":", "nil", ",", "user_agent", ":", "nil", ",", "client_id", ":", "nil", ",", "client_ip", ":", "nil", ",", "location", ":", "nil", ",", "country_code", ":", "nil", ",", "id", ":", "n...
The Video Detail Search API lets you search on Bing and get back insights about a video, such as related videos. This section provides technical details about the query parameters and headers that you use to request insights of videos and the JSON response objects that contain them. For examples that show how to make requests, see [Searching the Web for Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/search-the-web). @param query [String] The user's search query string. The query string cannot be empty. The query string may contain [Bing Advanced Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to limit videos to a specific domain, use the [site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this parameter only with the Video Search API. Do not specify this parameter when calling the Trending Videos API. @param accept_language [String] A comma-delimited list of one or more languages to use for user interface strings. The list is in decreasing order of preference. For additional information, including expected format, see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlang) query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc) query parameter. To determine the market to return results for, Bing uses the first supported language it finds from the list and combines it with the cc parameter value. If the list does not include a supported language, Bing finds the closest language and market that supports the request or it uses an aggregated or default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use this header and the cc query parameter only if you specify multiple languages. Otherwise, use the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#mkt) and [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlang) query parameters. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Any links to Bing.com properties in the response objects apply the specified language. @param user_agent [String] The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are encouraged to always specify this header. The user-agent should be the same string that any commonly used browser sends. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The following are examples of user-agent strings. Windows Phone: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53 @param client_id [String] Bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights new features and improvements, and it uses the client ID as a key for assigning traffic on different flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an inconsistent user experience. For example, if the second request has a different flight assignment than the first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that client ID’s search history, providing a richer experience for the user. Bing also uses this header to help improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client ID across multiple requests for the same end user and device combination enables 1) the API consumer to receive a consistent user experience, and 2) higher click-through rates via better quality of results from the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client ID. If you do not include this header in the request, Bing generates an ID and returns it in the X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the first time the user uses your app on that device. Use the client ID for each Bing API request that your app makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses your app on that device, get the client ID that you persisted. Bing responses may or may not include this header. If the response includes this header, capture the client ID and use it for all subsequent Bing requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in the request. @param client_ip [String] The IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing uses the location information to determine safe search behavior. Although optional, you are encouraged to always specify this header and the X-Search-Location header. Do not obfuscate the address (for example, by changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the device's actual location, which may result in Bing serving erroneous results. @param location [String] A semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses the location information to determine safe search behavior and to return relevant local content. Specify the key/value pair as <key>:<value>. The following are the keys that you use to specify the user's location. lat (required): The latitude of the client's location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and positive values indicate northern latitudes. long (required): The longitude of the client's location, in degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values indicate eastern longitudes. re (required): The radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since January 1, 1970.) head (optional): The client's relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this key only if the sp key is nonzero. sp (optional): The horizontal velocity (speed), in meters per second, that the client device is traveling. alt (optional): The altitude of the client device, in meters. are (optional): The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key only if you specify the alt key. Although many of the keys are optional, the more information that you provide, the more accurate the location results are. Although optional, you are encouraged to always specify the user's geographical location. Providing the location is especially important if the client's IP address does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal results, you should include this header and the X-MSEdge-ClientIP header, but at a minimum, you should include this header. @param country_code [String] A 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language header. Bing uses the first supported language it finds from the languages list, and combine that language with the country code that you specify to determine the market to return results for. If the languages list does not include a supported language, Bing finds the closest language and market that supports the request, or it may use an aggregated or default market for the results instead of a specified one. You should use this query parameter and the Accept-Language query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. This parameter and the mkt query parameter are mutually exclusive—do not specify both. @param id [String] An ID that uniquely identifies a video. The [Video](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#video) object's videoId field contains the ID that you set this parameter to. You use this parameter to identify the video to get insights of. @param modules [Array<VideoInsightModule>] A comma-delimited list of insights to request. The following are the possible case-insensitive values. All: Return all available insights. RelatedVideos: Return a list of videos that are similar to the video specified by the id query parameter. VideoResult: Return the video that you're requesting insights of (this is the video that you set the id query parameter to in your insights request). If you specify an insight and there is no data for it, the response object does not include the related field. For example, if you specify RelatedVideos and none exist, the response does not include the relatedVideos field. Although the user's query term is not required, you should always include it because it helps to improve relevance and the results. @param market [String] The market where the results come from. Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. For a list of possible market values, see [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-codes). NOTE: If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in [Market Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-codes), Bing uses a best fit market code based on an internal mapping that is subject to change. This parameter and the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc) query parameter are mutually exclusive—do not specify both. @param resolution [VideoResolution] Filter videos by the following resolutions: SD480p: Return videos with a 480p or higher resolution. HD720p: Return videos with a 720p or higher resolution. HD1080p: Return videos with a 1080p or higher resolution. All: Do not filter by resolution.Specifying this value is the same as not specifying the resolution parameter. Possible values include: 'All', 'SD480p', 'HD720p', 'HD1080p' @param safe_search [SafeSearch] Filter videos for adult content. The following are the possible filter values. Off: If the request is through the Video Search API, the response includes adult videos and the thumbnail images of the videos are clear (non-fuzzy). If the request is through the Web Search API, the response includes adult videos but the thumbnail images of the videos are pixelated (fuzzy). Moderate: If the request is through the Video Search API, the response does not include videos with adult content. If the request is through the Web Search API, the response may include videos with adult content but the thumbnail images of the videos are pixelated (fuzzy). Strict: Does not return videos with adult content. The default is Moderate. If the request comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value and uses Strict. If you use the site: query operator, there is the chance that the response may contain adult content regardless of what the safeSearch query parameter is set to. Use site: only if you are aware of the content on the site and your scenario supports the possibility of adult content. Possible values include: 'Off', 'Moderate', 'Strict' @param set_lang [String] The language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language code. For example, the language code for English is EN. The default is EN (English). Although optional, you should always specify the language. Typically, you set setLang to the same language specified by mkt unless the user wants the user interface strings displayed in a different language. This parameter and the [Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#acceptlanguage) header are mutually exclusive; do not specify both. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Also, any links to Bing.com properties in the response objects apply the specified language. @param text_decorations [Boolean] A Boolean value that determines whether display strings contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false. To specify whether to use Unicode characters or HTML tags as the markers, see the [textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#textformat) query parameter. For information about hit highlighting, see [Hit Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting). @param text_format [TextFormat] The type of markers to use for text decorations (see the textDecorations query parameter). Possible values are Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting. HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings. The default is Raw. For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;). Possible values include: 'Raw', 'Html' @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "The", "Video", "Detail", "Search", "API", "lets", "you", "search", "on", "Bing", "and", "get", "back", "insights", "about", "a", "video", "such", "as", "related", "videos", ".", "This", "section", "provides", "technical", "details", "about", "the", "query",...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_videosearch/lib/1.0/generated/azure_cognitiveservices_videosearch/videos_operations.rb#L1311-L1313
train
Gets the details of a specific language.
[ 30522, 13366, 4751, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 23032, 1010, 5138, 1035, 2653, 1024, 9152, 2140, 1010, 5310, 1035, 4005, 1024, 9152, 2140, 1010, 7396, 1035, 8909, 1024, 9152, 2140, 1010, 7396, 1035, 12997, 1024, 9152, 2140, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/vpn_sites.rb
Azure::Network::Mgmt::V2018_10_01.VpnSites.create_or_update
def create_or_update(resource_group_name, vpn_site_name, vpn_site_parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, vpn_site_name, vpn_site_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def create_or_update(resource_group_name, vpn_site_name, vpn_site_parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, vpn_site_name, vpn_site_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "create_or_update", "(", "resource_group_name", ",", "vpn_site_name", ",", "vpn_site_parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "create_or_update_async", "(", "resource_group_name", ",", "vpn_site_name", ",", "vpn_site_parameters", ",", ...
Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. @param resource_group_name [String] The resource group name of the VpnSite. @param vpn_site_name [String] The name of the VpnSite being created or updated. @param vpn_site_parameters [VpnSite] Parameters supplied to create or update VpnSite. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [VpnSite] operation results.
[ "Creates", "a", "VpnSite", "resource", "if", "it", "doesn", "t", "exist", "else", "updates", "the", "existing", "VpnSite", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/vpn_sites.rb#L130-L133
train
Creates or updates a virtual network site.
[ 30522, 13366, 3443, 1035, 2030, 1035, 10651, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 21210, 2078, 1035, 2609, 1035, 2171, 1010, 21210, 2078, 1035, 2609, 1035, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 3443,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb
Azure::StorSimple8000Series::Mgmt::V2017_06_01.Devices.scan_for_updates
def scan_for_updates(device_name, resource_group_name, manager_name, custom_headers:nil) response = scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value! nil end
ruby
def scan_for_updates(device_name, resource_group_name, manager_name, custom_headers:nil) response = scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value! nil end
[ "def", "scan_for_updates", "(", "device_name", ",", "resource_group_name", ",", "manager_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "scan_for_updates_async", "(", "device_name", ",", "resource_group_name", ",", "manager_name", ",", "custom_headers",...
Scans for updates on the device. @param device_name [String] The device name @param resource_group_name [String] The resource group name @param manager_name [String] The manager name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Scans", "for", "updates", "on", "the", "device", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb#L911-L914
train
Scans the device for updates.
[ 30522, 13366, 13594, 1035, 2005, 1035, 14409, 1006, 5080, 1035, 2171, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 3208, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 30524, 6038, 2278, 1006, 5080, 1035, 2171, 1010, 7692, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb
Aws::IAM.Policy.detach_user
def detach_user(options = {}) options = options.merge(policy_arn: @arn) resp = @client.detach_user_policy(options) resp.data end
ruby
def detach_user(options = {}) options = options.merge(policy_arn: @arn) resp = @client.detach_user_policy(options) resp.data end
[ "def", "detach_user", "(", "options", "=", "{", "}", ")", "options", "=", "options", ".", "merge", "(", "policy_arn", ":", "@arn", ")", "resp", "=", "@client", ".", "detach_user_policy", "(", "options", ")", "resp", ".", "data", "end" ]
@example Request syntax with placeholder values policy.detach_user({ user_name: "userNameType", # required }) @param [Hash] options ({}) @option options [required, String] :user_name The name (friendly name, not ARN) of the IAM user to detach the policy from. This parameter allows (through its [regex pattern][1]) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: \_+=,.@- [1]: http://wikipedia.org/wiki/regex @return [EmptyStructure]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb#L473-L477
train
Detaches the user from the policy
[ 30522, 13366, 20010, 6776, 1035, 5310, 1006, 7047, 1027, 1063, 1065, 1007, 7047, 1027, 7047, 1012, 13590, 1006, 3343, 1035, 12098, 2078, 1024, 1030, 12098, 2078, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 20010, 6776, 1035, 5310, 1035, 3343...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/registered_servers.rb
Azure::StorageSync::Mgmt::V2018_07_01.RegisteredServers.begin_create
def begin_create(resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers:nil) response = begin_create_async(resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_create(resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers:nil) response = begin_create_async(resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_create", "(", "resource_group_name", ",", "storage_sync_service_name", ",", "server_id", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_create_async", "(", "resource_group_name", ",", "storage_sync_service_name", ",", "s...
Add a new registered server. @param resource_group_name [String] The name of the resource group. The name is case insensitive. @param storage_sync_service_name [String] Name of Storage Sync Service resource. @param server_id [String] GUID identifying the on-premises server. @param parameters [RegisteredServerCreateParameters] Body of Registered Server object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [RegisteredServer] operation results.
[ "Add", "a", "new", "registered", "server", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/registered_servers.rb#L391-L394
train
Creates a new cluster.
[ 30522, 13366, 4088, 1035, 3443, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 5527, 1035, 26351, 1035, 2326, 1035, 2171, 1010, 8241, 1035, 8909, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 30524, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/snapshots.rb
Azure::Compute::Mgmt::V2018_04_01.Snapshots.begin_revoke_access
def begin_revoke_access(resource_group_name, snapshot_name, custom_headers:nil) response = begin_revoke_access_async(resource_group_name, snapshot_name, custom_headers:custom_headers).value! nil end
ruby
def begin_revoke_access(resource_group_name, snapshot_name, custom_headers:nil) response = begin_revoke_access_async(resource_group_name, snapshot_name, custom_headers:custom_headers).value! nil end
[ "def", "begin_revoke_access", "(", "resource_group_name", ",", "snapshot_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_revoke_access_async", "(", "resource_group_name", ",", "snapshot_name", ",", "custom_headers", ":custom_headers", ")", ".", "v...
Revokes access to a snapshot. @param resource_group_name [String] The name of the resource group. @param snapshot_name [String] The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Revokes", "access", "to", "a", "snapshot", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/snapshots.rb#L982-L985
train
Revokes access to a snapshot.
[ 30522, 13366, 4088, 1035, 7065, 11045, 1035, 3229, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 20057, 12326, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 7065, 11045, 1035, 3229, 1035, 2004, 6038,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hashicorp/vagrant
lib/vagrant/box.rb
Vagrant.Box.repackage
def repackage(path) @logger.debug("Repackaging box '#{@name}' to: #{path}") Util::SafeChdir.safe_chdir(@directory) do # Find all the files in our current directory and tar it up! files = Dir.glob(File.join(".", "**", "*")).select { |f| File.file?(f) } # Package! Util::Subprocess.execute("bsdtar", "-czf", path.to_s, *files) end @logger.info("Repackaged box '#{@name}' successfully: #{path}") true end
ruby
def repackage(path) @logger.debug("Repackaging box '#{@name}' to: #{path}") Util::SafeChdir.safe_chdir(@directory) do # Find all the files in our current directory and tar it up! files = Dir.glob(File.join(".", "**", "*")).select { |f| File.file?(f) } # Package! Util::Subprocess.execute("bsdtar", "-czf", path.to_s, *files) end @logger.info("Repackaged box '#{@name}' successfully: #{path}") true end
[ "def", "repackage", "(", "path", ")", "@logger", ".", "debug", "(", "\"Repackaging box '#{@name}' to: #{path}\"", ")", "Util", "::", "SafeChdir", ".", "safe_chdir", "(", "@directory", ")", "do", "# Find all the files in our current directory and tar it up!", "files", "=",...
This repackages this box and outputs it to the given path. @param [Pathname] path The full path (filename included) of where to output this box. @return [Boolean] true if this succeeds.
[ "This", "repackages", "this", "box", "and", "outputs", "it", "to", "the", "given", "path", "." ]
c22a145c59790c098f95d50141d9afb48e1ef55f
https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/box.rb#L199-L213
train
Repack the box
[ 30522, 13366, 16360, 8684, 4270, 1006, 4130, 1007, 1030, 8833, 4590, 1012, 2139, 8569, 2290, 1006, 1000, 16360, 8684, 16594, 3482, 1005, 1001, 1063, 1030, 2171, 1065, 1005, 2000, 1024, 1001, 1063, 4130, 1065, 1000, 1007, 21183, 4014, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ruby/rake
lib/rake/file_list.rb
Rake.FileList.gsub!
def gsub!(pat, rep) each_with_index { |fn, i| self[i] = fn.gsub(pat, rep) } self end
ruby
def gsub!(pat, rep) each_with_index { |fn, i| self[i] = fn.gsub(pat, rep) } self end
[ "def", "gsub!", "(", "pat", ",", "rep", ")", "each_with_index", "{", "|", "fn", ",", "i", "|", "self", "[", "i", "]", "=", "fn", ".", "gsub", "(", "pat", ",", "rep", ")", "}", "self", "end" ]
Same as +gsub+ except that the original file list is modified.
[ "Same", "as", "+", "gsub", "+", "except", "that", "the", "original", "file", "list", "is", "modified", "." ]
1c22b490ee6cb8bd614fa8d0d6145f671466206b
https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/file_list.rb#L264-L267
train
Replace all occurrences of a pattern with a replacement.
[ 30522, 13366, 28177, 12083, 999, 1006, 6986, 1010, 16360, 1007, 2169, 1035, 2007, 1035, 5950, 1063, 1064, 1042, 2078, 1010, 1045, 1064, 2969, 1031, 1045, 1033, 1027, 1042, 2078, 1012, 28177, 12083, 1006, 6986, 1010, 16360, 1007, 1065, 2969,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
heroku/legacy-cli
lib/heroku/command/addons.rb
Heroku::Command.Addons.create
def create if current_command == "addons:add" deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:create` instead.") end requires_preauth service_plan = expand_hpg_shorthand(args.shift) raise CommandFailed.new("Missing requested service or plan") if service_plan.nil? || %w{--fork --follow --rollback}.include?(service_plan) config = parse_options(args) raise CommandFailed.new("Unexpected arguments: #{args.join(' ')}") unless args.empty? addon = request( :body => json_encode({ "attachment" => { "name" => options[:as] }, "config" => config, "name" => options[:name], "confirm" => options[:confirm], "plan" => { "name" => service_plan } }), :headers => { # Temporary hack for getting provider messages while a cleaner # endpoint is designed to communicate this data. # # WARNING: Do not depend on this having any effect permanently. "Accept-Expansion" => "plan", "X-Heroku-Legacy-Provider-Messages" => "true" }, :expects => 201, :method => :post, :path => "/apps/#{app}/addons" ) @status = "(#{format_price addon['plan']['price']})" if addon['plan'].has_key?('price') action("Creating #{addon['name'].downcase}") {} action("Adding #{addon['name'].downcase} to #{app}") {} if addon['config_vars'].any? action("Setting #{addon['config_vars'].join(', ')} and restarting #{app}") do @status = api.get_release(app, 'current').body['name'] end end display addon['provision_message'] unless addon['provision_message'].to_s.strip == "" display("Use `heroku addons:docs #{addon['addon_service']['name']}` to view documentation.") end
ruby
def create if current_command == "addons:add" deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:create` instead.") end requires_preauth service_plan = expand_hpg_shorthand(args.shift) raise CommandFailed.new("Missing requested service or plan") if service_plan.nil? || %w{--fork --follow --rollback}.include?(service_plan) config = parse_options(args) raise CommandFailed.new("Unexpected arguments: #{args.join(' ')}") unless args.empty? addon = request( :body => json_encode({ "attachment" => { "name" => options[:as] }, "config" => config, "name" => options[:name], "confirm" => options[:confirm], "plan" => { "name" => service_plan } }), :headers => { # Temporary hack for getting provider messages while a cleaner # endpoint is designed to communicate this data. # # WARNING: Do not depend on this having any effect permanently. "Accept-Expansion" => "plan", "X-Heroku-Legacy-Provider-Messages" => "true" }, :expects => 201, :method => :post, :path => "/apps/#{app}/addons" ) @status = "(#{format_price addon['plan']['price']})" if addon['plan'].has_key?('price') action("Creating #{addon['name'].downcase}") {} action("Adding #{addon['name'].downcase} to #{app}") {} if addon['config_vars'].any? action("Setting #{addon['config_vars'].join(', ')} and restarting #{app}") do @status = api.get_release(app, 'current').body['name'] end end display addon['provision_message'] unless addon['provision_message'].to_s.strip == "" display("Use `heroku addons:docs #{addon['addon_service']['name']}` to view documentation.") end
[ "def", "create", "if", "current_command", "==", "\"addons:add\"", "deprecate", "(", "\"`heroku #{current_command}` has been deprecated. Please use `heroku addons:create` instead.\"", ")", "end", "requires_preauth", "service_plan", "=", "expand_hpg_shorthand", "(", "args", ".", "s...
addons:create SERVICE:PLAN create an add-on resource --name ADDON_NAME # (optional) name for the add-on resource --as ATTACHMENT_NAME # (optional) name for the initial add-on attachment --confirm APP_NAME # (optional) ovewrite existing config vars or existing add-on attachments
[ "addons", ":", "create", "SERVICE", ":", "PLAN" ]
6f18521a258394bfb79e6b36f7160ad8559a8e16
https://github.com/heroku/legacy-cli/blob/6f18521a258394bfb79e6b36f7160ad8559a8e16/lib/heroku/command/addons.rb#L100-L148
train
Create an addon
[ 30522, 13366, 3443, 2065, 2783, 1035, 3094, 1027, 1027, 1000, 5587, 5644, 1024, 5587, 1000, 2139, 28139, 16280, 1006, 1000, 1036, 5394, 5283, 1001, 1063, 2783, 1035, 3094, 1065, 1036, 2038, 2042, 2139, 28139, 12921, 1012, 3531, 2224, 1036, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_service_bus/lib/2017-04-01/generated/azure_mgmt_service_bus/disaster_recovery_configs.rb
Azure::ServiceBus::Mgmt::V2017_04_01.DisasterRecoveryConfigs.break_pairing_with_http_info
def break_pairing_with_http_info(resource_group_name, namespace_name, alias_parameter, custom_headers:nil) break_pairing_async(resource_group_name, namespace_name, alias_parameter, custom_headers:custom_headers).value! end
ruby
def break_pairing_with_http_info(resource_group_name, namespace_name, alias_parameter, custom_headers:nil) break_pairing_async(resource_group_name, namespace_name, alias_parameter, custom_headers:custom_headers).value! end
[ "def", "break_pairing_with_http_info", "(", "resource_group_name", ",", "namespace_name", ",", "alias_parameter", ",", "custom_headers", ":", "nil", ")", "break_pairing_async", "(", "resource_group_name", ",", "namespace_name", ",", "alias_parameter", ",", "custom_headers",...
This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces @param resource_group_name [String] Name of the Resource group within the Azure subscription. @param namespace_name [String] The namespace name @param alias_parameter [String] The Disaster Recovery configuration name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "This", "operation", "disables", "the", "Disaster", "Recovery", "and", "stops", "replicating", "changes", "from", "primary", "to", "secondary", "namespaces" ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_bus/lib/2017-04-01/generated/azure_mgmt_service_bus/disaster_recovery_configs.rb#L587-L589
train
Break a pairing of namespace and alias.
[ 30522, 13366, 3338, 1035, 22778, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 3415, 15327, 1035, 2171, 1010, 14593, 1035, 16381, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3338, 1035, 22778, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb
Azure::Labservices::Mgmt::V2018_10_15.Labs.register_with_http_info
def register_with_http_info(resource_group_name, lab_account_name, lab_name, custom_headers:nil) register_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value! end
ruby
def register_with_http_info(resource_group_name, lab_account_name, lab_name, custom_headers:nil) register_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value! end
[ "def", "register_with_http_info", "(", "resource_group_name", ",", "lab_account_name", ",", "lab_name", ",", "custom_headers", ":", "nil", ")", "register_async", "(", "resource_group_name", ",", "lab_account_name", ",", "lab_name", ",", "custom_headers", ":custom_headers"...
Register to managed lab. @param resource_group_name [String] The name of the resource group. @param lab_account_name [String] The name of the lab Account. @param lab_name [String] The name of the lab. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Register", "to", "managed", "lab", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb#L628-L630
train
Registers a new lab in the specified resource group.
[ 30522, 13366, 4236, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 6845, 1035, 4070, 1035, 2171, 1010, 6845, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 4236, 1035, 2004, 6038, 2278, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb
Azure::ContainerRegistry::Mgmt::V2018_09_01.Tasks.begin_create
def begin_create(resource_group_name, registry_name, task_name, task_create_parameters, custom_headers:nil) response = begin_create_async(resource_group_name, registry_name, task_name, task_create_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_create(resource_group_name, registry_name, task_name, task_create_parameters, custom_headers:nil) response = begin_create_async(resource_group_name, registry_name, task_name, task_create_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_create", "(", "resource_group_name", ",", "registry_name", ",", "task_name", ",", "task_create_parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_create_async", "(", "resource_group_name", ",", "registry_name", ",", "task_name", ...
Creates a task for a container registry with the specified parameters. @param resource_group_name [String] The name of the resource group to which the container registry belongs. @param registry_name [String] The name of the container registry. @param task_name [String] The name of the container registry task. @param task_create_parameters [Task] The parameters for creating a task. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Task] operation results.
[ "Creates", "a", "task", "for", "a", "container", "registry", "with", "the", "specified", "parameters", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb#L488-L491
train
Creates a task in a container registry.
[ 30522, 13366, 4088, 1035, 3443, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 15584, 1035, 2171, 1010, 4708, 1035, 2171, 1010, 4708, 1035, 3443, 1035, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 3443, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_application_health
def get_application_health(application_id, events_health_state_filter:0, deployed_applications_health_state_filter:0, services_health_state_filter:0, exclude_health_statistics:false, timeout:60, custom_headers:nil) response = get_application_health_async(application_id, events_health_state_filter:events_health_state_filter, deployed_applications_health_state_filter:deployed_applications_health_state_filter, services_health_state_filter:services_health_state_filter, exclude_health_statistics:exclude_health_statistics, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_application_health(application_id, events_health_state_filter:0, deployed_applications_health_state_filter:0, services_health_state_filter:0, exclude_health_statistics:false, timeout:60, custom_headers:nil) response = get_application_health_async(application_id, events_health_state_filter:events_health_state_filter, deployed_applications_health_state_filter:deployed_applications_health_state_filter, services_health_state_filter:services_health_state_filter, exclude_health_statistics:exclude_health_statistics, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_application_health", "(", "application_id", ",", "events_health_state_filter", ":", "0", ",", "deployed_applications_health_state_filter", ":", "0", ",", "services_health_state_filter", ":", "0", ",", "exclude_health_statistics", ":", "false", ",", "timeout", ...
Gets the health of the service fabric application. Returns the heath state of the service fabric application. The response reports either Ok, Error or Warning health state. If the entity is not found in the health store, it will return Error. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. @param events_health_state_filter [Integer] Allows filtering the collection of HealthEvent objects returned based on health state. The possible values for this parameter include integer value of one of the following health states. Only events that match the filter are returned. All events are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param deployed_applications_health_state_filter [Integer] Allows filtering of the deployed applications health state objects returned in the result of application health query based on their health state. The possible values for this parameter include integer value of one of the following health states. Only deployed applications that match the filter will be returned. All deployed applications are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of deployed applications with HealthState value of OK (2) and Warning (4) are returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param services_health_state_filter [Integer] Allows filtering of the services health state objects returned in the result of services health query based on their health state. The possible values for this parameter include integer value of one of the following health states. Only services that match the filter are returned. All services are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services with HealthState value of OK (2) and Warning (4) will be returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param exclude_health_statistics [Boolean] Indicates whether the health statistics should be returned as part of the query result. False by default. The statistics show the number of children entities in health state Ok, Warning, and Error. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ApplicationHealth] operation results.
[ "Gets", "the", "health", "of", "the", "service", "fabric", "application", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L6882-L6885
train
Gets the health of the specified application.
[ 30522, 13366, 2131, 1035, 4646, 1035, 2740, 1006, 4646, 1035, 8909, 1010, 2824, 1035, 2740, 1035, 2110, 1035, 11307, 1024, 1014, 1010, 7333, 1035, 5097, 1035, 2740, 1035, 2110, 1035, 11307, 1024, 1014, 1010, 2578, 1035, 2740, 1035, 2110, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb
Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_worker_pool_skus_as_lazy
def list_worker_pool_skus_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:nil) response = list_worker_pool_skus_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_worker_pool_skus_next_async(next_page_link, custom_headers:custom_headers) end page end end
ruby
def list_worker_pool_skus_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:nil) response = list_worker_pool_skus_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_worker_pool_skus_next_async(next_page_link, custom_headers:custom_headers) end page end end
[ "def", "list_worker_pool_skus_as_lazy", "(", "resource_group_name", ",", "name", ",", "worker_pool_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_worker_pool_skus_async", "(", "resource_group_name", ",", "name", ",", "worker_pool_name", ",", "cust...
Get available SKUs for scaling a worker pool. Get available SKUs for scaling a worker pool. @param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [SkuInfoCollection] which provide lazy access to pages of the response.
[ "Get", "available", "SKUs", "for", "scaling", "a", "worker", "pool", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L7976-L7985
train
Gets the list of skus of a worker pool.
[ 30522, 13366, 2862, 1035, 7309, 1035, 4770, 1035, 15315, 2271, 1035, 2004, 1035, 13971, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2171, 1010, 7309, 1035, 4770, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
samvera/hyrax
app/models/concerns/hyrax/ability.rb
Hyrax.Ability.download_users
def download_users(id) doc = permissions_doc(id) return [] if doc.nil? users = Array(doc[self.class.read_user_field]) + Array(doc[self.class.edit_user_field]) Rails.logger.debug("[CANCAN] download_users: #{users.inspect}") users end
ruby
def download_users(id) doc = permissions_doc(id) return [] if doc.nil? users = Array(doc[self.class.read_user_field]) + Array(doc[self.class.edit_user_field]) Rails.logger.debug("[CANCAN] download_users: #{users.inspect}") users end
[ "def", "download_users", "(", "id", ")", "doc", "=", "permissions_doc", "(", "id", ")", "return", "[", "]", "if", "doc", ".", "nil?", "users", "=", "Array", "(", "doc", "[", "self", ".", "class", ".", "read_user_field", "]", ")", "+", "Array", "(", ...
Grant all users with read or edit access permission to download
[ "Grant", "all", "users", "with", "read", "or", "edit", "access", "permission", "to", "download" ]
e2b4f56e829a53b1f11296324736e9d5b8c9ee5f
https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/models/concerns/hyrax/ability.rb#L47-L53
train
Get the users that have been read or edit
[ 30522, 13366, 8816, 1035, 5198, 1006, 8909, 1007, 9986, 1027, 6656, 2015, 1035, 9986, 1006, 8909, 1007, 2709, 1031, 1033, 2065, 9986, 1012, 9152, 2140, 1029, 5198, 1027, 9140, 1006, 9986, 1031, 2969, 1012, 2465, 1012, 3191, 1035, 5310, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_cdn/lib/2016-04-02/generated/azure_mgmt_cdn/profiles.rb
Azure::CDN::Mgmt::V2016_04_02.Profiles.begin_update_with_http_info
def begin_update_with_http_info(profile_name, profile_properties, resource_group_name, custom_headers:nil) begin_update_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers).value! end
ruby
def begin_update_with_http_info(profile_name, profile_properties, resource_group_name, custom_headers:nil) begin_update_async(profile_name, profile_properties, resource_group_name, custom_headers:custom_headers).value! end
[ "def", "begin_update_with_http_info", "(", "profile_name", ",", "profile_properties", ",", "resource_group_name", ",", "custom_headers", ":", "nil", ")", "begin_update_async", "(", "profile_name", ",", "profile_properties", ",", "resource_group_name", ",", "custom_headers",...
Updates an existing CDN profile with the specified parameters. @param profile_name [String] Name of the CDN profile within the resource group. @param profile_properties [ProfileUpdateParameters] Profile properties needed for update. @param resource_group_name [String] Name of the resource group within the Azure subscription. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Updates", "an", "existing", "CDN", "profile", "with", "the", "specified", "parameters", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2016-04-02/generated/azure_mgmt_cdn/profiles.rb#L716-L718
train
Updates a profile s covering specification.
[ 30522, 13366, 4088, 1035, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 6337, 1035, 2171, 1010, 6337, 1035, 5144, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 4088, 1035, 10651, 1035, 2004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
meew0/discordrb
lib/discordrb/data/server.rb
Discordrb.Server.process_chunk
def process_chunk(members) process_members(members) @processed_chunk_members += members.length LOGGER.debug("Processed one chunk on server #{@id} - length #{members.length}") # Don't bother with the rest of the method if it's not truly the last packet return unless @processed_chunk_members == @member_count LOGGER.debug("Finished chunking server #{@id}") # Reset everything to normal @chunked = true @processed_chunk_members = 0 end
ruby
def process_chunk(members) process_members(members) @processed_chunk_members += members.length LOGGER.debug("Processed one chunk on server #{@id} - length #{members.length}") # Don't bother with the rest of the method if it's not truly the last packet return unless @processed_chunk_members == @member_count LOGGER.debug("Finished chunking server #{@id}") # Reset everything to normal @chunked = true @processed_chunk_members = 0 end
[ "def", "process_chunk", "(", "members", ")", "process_members", "(", "members", ")", "@processed_chunk_members", "+=", "members", ".", "length", "LOGGER", ".", "debug", "(", "\"Processed one chunk on server #{@id} - length #{members.length}\"", ")", "# Don't bother with the r...
Processes a GUILD_MEMBERS_CHUNK packet, specifically the members field @note For internal use only @!visibility private
[ "Processes", "a", "GUILD_MEMBERS_CHUNK", "packet", "specifically", "the", "members", "field" ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/server.rb#L747-L760
train
Process a single chunk of members
[ 30522, 13366, 2832, 1035, 20000, 1006, 2372, 1007, 2832, 1035, 2372, 1006, 2372, 1007, 1030, 13995, 1035, 20000, 1035, 2372, 1009, 1027, 2372, 1012, 3091, 8833, 4590, 1012, 2139, 8569, 2290, 1006, 1000, 13995, 2028, 20000, 2006, 8241, 1001,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/origins.rb
Azure::CDN::Mgmt::V2017_04_02.Origins.update
def update(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:nil) response = update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def update(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:nil) response = update_async(resource_group_name, profile_name, endpoint_name, origin_name, origin_update_properties, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "update", "(", "resource_group_name", ",", "profile_name", ",", "endpoint_name", ",", "origin_name", ",", "origin_update_properties", ",", "custom_headers", ":", "nil", ")", "response", "=", "update_async", "(", "resource_group_name", ",", "profile_name", ",", ...
Updates an existing origin within an endpoint. @param resource_group_name [String] Name of the Resource group within the Azure subscription. @param profile_name [String] Name of the CDN profile which is unique within the resource group. @param endpoint_name [String] Name of the endpoint under the profile which is unique globally. @param origin_name [String] Name of the origin which is unique within the endpoint. @param origin_update_properties [OriginUpdateParameters] Origin properties @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Origin] operation results.
[ "Updates", "an", "existing", "origin", "within", "an", "endpoint", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/origins.rb#L266-L269
train
Updates an existing CDN origin.
[ 30522, 13366, 10651, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 6337, 1035, 2171, 1010, 2203, 8400, 1035, 2171, 1010, 30524, 1035, 2177, 1035, 2171, 1010, 6337, 1035, 2171, 1010, 2203, 8400, 1035, 2171, 1010, 4761, 1035, 2171, 1010, 4761, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
meew0/discordrb
lib/discordrb/gateway.rb
Discordrb.Gateway.obtain_socket
def obtain_socket(uri) socket = TCPSocket.new(uri.host, uri.port || socket_port(uri)) if secure_uri?(uri) ctx = OpenSSL::SSL::SSLContext.new if ENV['DISCORDRB_SSL_VERIFY_NONE'] ctx.ssl_version = 'SSLv23' ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE # use VERIFY_PEER for verification cert_store = OpenSSL::X509::Store.new cert_store.set_default_paths ctx.cert_store = cert_store else ctx.set_params ssl_version: :TLSv1_2 end socket = OpenSSL::SSL::SSLSocket.new(socket, ctx) socket.connect end socket end
ruby
def obtain_socket(uri) socket = TCPSocket.new(uri.host, uri.port || socket_port(uri)) if secure_uri?(uri) ctx = OpenSSL::SSL::SSLContext.new if ENV['DISCORDRB_SSL_VERIFY_NONE'] ctx.ssl_version = 'SSLv23' ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE # use VERIFY_PEER for verification cert_store = OpenSSL::X509::Store.new cert_store.set_default_paths ctx.cert_store = cert_store else ctx.set_params ssl_version: :TLSv1_2 end socket = OpenSSL::SSL::SSLSocket.new(socket, ctx) socket.connect end socket end
[ "def", "obtain_socket", "(", "uri", ")", "socket", "=", "TCPSocket", ".", "new", "(", "uri", ".", "host", ",", "uri", ".", "port", "||", "socket_port", "(", "uri", ")", ")", "if", "secure_uri?", "(", "uri", ")", "ctx", "=", "OpenSSL", "::", "SSL", ...
Create and connect a socket using a URI
[ "Create", "and", "connect", "a", "socket", "using", "a", "URI" ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/gateway.rb#L489-L511
train
Returns a TCPSocket object for the given URI.
[ 30522, 13366, 6855, 1035, 22278, 1006, 24471, 2072, 1007, 22278, 1027, 22975, 4523, 7432, 3388, 1012, 2047, 1006, 24471, 2072, 1012, 3677, 1010, 24471, 2072, 1012, 3417, 1064, 1064, 22278, 1035, 3417, 1006, 24471, 2072, 1007, 1007, 2065, 58...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sds/haml-lint
lib/haml_lint/rake_task.rb
HamlLint.RakeTask.run_cli
def run_cli(task_args) cli_args = parse_args logger = quiet ? HamlLint::Logger.silent : HamlLint::Logger.new(STDOUT) result = HamlLint::CLI.new(logger).run(Array(cli_args) + files_to_lint(task_args)) fail "#{HamlLint::APP_NAME} failed with exit code #{result}" unless result == 0 end
ruby
def run_cli(task_args) cli_args = parse_args logger = quiet ? HamlLint::Logger.silent : HamlLint::Logger.new(STDOUT) result = HamlLint::CLI.new(logger).run(Array(cli_args) + files_to_lint(task_args)) fail "#{HamlLint::APP_NAME} failed with exit code #{result}" unless result == 0 end
[ "def", "run_cli", "(", "task_args", ")", "cli_args", "=", "parse_args", "logger", "=", "quiet", "?", "HamlLint", "::", "Logger", ".", "silent", ":", "HamlLint", "::", "Logger", ".", "new", "(", "STDOUT", ")", "result", "=", "HamlLint", "::", "CLI", ".", ...
Executes the CLI given the specified task arguments. @param task_args [Rake::TaskArguments]
[ "Executes", "the", "CLI", "given", "the", "specified", "task", "arguments", "." ]
024c773667e54cf88db938c2b368977005d70ee8
https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/rake_task.rb#L105-L111
train
Run the CLI
[ 30522, 13366, 2448, 1035, 18856, 2072, 1006, 4708, 1035, 12098, 5620, 1007, 18856, 2072, 1035, 12098, 5620, 1027, 11968, 3366, 1035, 12098, 5620, 8833, 4590, 1027, 4251, 1029, 10654, 21202, 2102, 1024, 1024, 8833, 4590, 1012, 4333, 1024, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jch/html-pipeline
lib/html/pipeline.rb
HTML.Pipeline.instrument
def instrument(event, payload = nil) payload ||= default_payload return yield(payload) unless instrumentation_service instrumentation_service.instrument event, payload do |payload| yield payload end end
ruby
def instrument(event, payload = nil) payload ||= default_payload return yield(payload) unless instrumentation_service instrumentation_service.instrument event, payload do |payload| yield payload end end
[ "def", "instrument", "(", "event", ",", "payload", "=", "nil", ")", "payload", "||=", "default_payload", "return", "yield", "(", "payload", ")", "unless", "instrumentation_service", "instrumentation_service", ".", "instrument", "event", ",", "payload", "do", "|", ...
Internal: if the `instrumentation_service` object is set, instruments the block, otherwise the block is ran without instrumentation. Returns the result of the provided block.
[ "Internal", ":", "if", "the", "instrumentation_service", "object", "is", "set", "instruments", "the", "block", "otherwise", "the", "block", "is", "ran", "without", "instrumentation", "." ]
f1bbce4858876dc2619c61a8b18637b5d3321b1c
https://github.com/jch/html-pipeline/blob/f1bbce4858876dc2619c61a8b18637b5d3321b1c/lib/html/pipeline.rb#L167-L173
train
Instruments an event with the given payload.
[ 30522, 13366, 6602, 1006, 2724, 1010, 18093, 1027, 9152, 2140, 1007, 18093, 1064, 1064, 1027, 12398, 1035, 18093, 2709, 10750, 1006, 18093, 1007, 4983, 16015, 1035, 2326, 16015, 1035, 2326, 1012, 6602, 2724, 1010, 18093, 2079, 1064, 18093, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
commander-rb/commander
lib/commander/user_interaction.rb
Commander.UI.io
def io(input = nil, output = nil, &block) $stdin = File.new(input) if input $stdout = File.new(output, 'r+') if output return unless block yield reset_io end
ruby
def io(input = nil, output = nil, &block) $stdin = File.new(input) if input $stdout = File.new(output, 'r+') if output return unless block yield reset_io end
[ "def", "io", "(", "input", "=", "nil", ",", "output", "=", "nil", ",", "&", "block", ")", "$stdin", "=", "File", ".", "new", "(", "input", ")", "if", "input", "$stdout", "=", "File", ".", "new", "(", "output", ",", "'r+'", ")", "if", "output", ...
Normalize IO streams, allowing for redirection of +input+ and/or +output+, for example: $ foo # => read from terminal I/O $ foo in # => read from 'in' file, output to terminal output stream $ foo in out # => read from 'in' file, output to 'out' file $ foo < in > out # => equivalent to above (essentially) Optionally a +block+ may be supplied, in which case IO will be reset once the block has executed. === Examples command :foo do |c| c.syntax = 'foo [input] [output]' c.when_called do |args, options| # or io(args.shift, args.shift) io *args str = $stdin.gets puts 'input was: ' + str.inspect end end
[ "Normalize", "IO", "streams", "allowing", "for", "redirection", "of", "+", "input", "+", "and", "/", "or", "+", "output", "+", "for", "example", ":" ]
332047c14948225462fe60042eed23adfb996d68
https://github.com/commander-rb/commander/blob/332047c14948225462fe60042eed23adfb996d68/lib/commander/user_interaction.rb#L220-L226
train
IO method for reading and writing files
[ 30522, 13366, 22834, 1006, 7953, 1027, 9152, 2140, 1010, 6434, 1027, 9152, 2140, 1010, 1004, 3796, 1007, 1002, 2358, 8718, 1027, 5371, 1012, 2047, 1006, 7953, 1007, 2065, 7953, 1002, 2358, 26797, 2102, 1027, 5371, 1012, 2047, 1006, 6434, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/group_user.rb
Azure::ApiManagement::Mgmt::V2019_01_01.GroupUser.check_entity_exists_with_http_info
def check_entity_exists_with_http_info(resource_group_name, service_name, group_id, user_id, custom_headers:nil) check_entity_exists_async(resource_group_name, service_name, group_id, user_id, custom_headers:custom_headers).value! end
ruby
def check_entity_exists_with_http_info(resource_group_name, service_name, group_id, user_id, custom_headers:nil) check_entity_exists_async(resource_group_name, service_name, group_id, user_id, custom_headers:custom_headers).value! end
[ "def", "check_entity_exists_with_http_info", "(", "resource_group_name", ",", "service_name", ",", "group_id", ",", "user_id", ",", "custom_headers", ":", "nil", ")", "check_entity_exists_async", "(", "resource_group_name", ",", "service_name", ",", "group_id", ",", "us...
Checks that user entity specified by identifier is associated with the group entity. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param group_id [String] Group identifier. Must be unique in the current API Management service instance. @param user_id [String] User identifier. Must be unique in the current API Management service instance. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Checks", "that", "user", "entity", "specified", "by", "identifier", "is", "associated", "with", "the", "group", "entity", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/group_user.rb#L205-L207
train
Checks if the entity with the specified identifier already exists.
[ 30522, 13366, 4638, 1035, 9178, 1035, 6526, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 2177, 1035, 8909, 1010, 5310, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb
Azure::CDN::Mgmt::V2017_04_02.CustomDomains.begin_delete
def begin_delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:nil) response = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_delete(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:nil) response = begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_delete", "(", "resource_group_name", ",", "profile_name", ",", "endpoint_name", ",", "custom_domain_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_delete_async", "(", "resource_group_name", ",", "profile_name", ",", "endpoint_name",...
Deletes an existing custom domain within an endpoint. @param resource_group_name [String] Name of the Resource group within the Azure subscription. @param profile_name [String] Name of the CDN profile which is unique within the resource group. @param endpoint_name [String] Name of the endpoint under the profile which is unique globally. @param custom_domain_name [String] Name of the custom domain within an endpoint. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [CustomDomain] operation results.
[ "Deletes", "an", "existing", "custom", "domain", "within", "an", "endpoint", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb#L756-L759
train
Deletes a domain in an endpoint.
[ 30522, 13366, 4088, 1035, 3972, 12870, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 6337, 1035, 2171, 1010, 2203, 8400, 1035, 2171, 1010, 7661, 1035, 5884, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
castwide/solargraph
lib/solargraph/library.rb
Solargraph.Library.read
def read filename return @current if @current && @current.filename == filename raise FileNotFoundError, "File not found: #{filename}" unless workspace.has_file?(filename) workspace.source(filename) end
ruby
def read filename return @current if @current && @current.filename == filename raise FileNotFoundError, "File not found: #{filename}" unless workspace.has_file?(filename) workspace.source(filename) end
[ "def", "read", "filename", "return", "@current", "if", "@current", "&&", "@current", ".", "filename", "==", "filename", "raise", "FileNotFoundError", ",", "\"File not found: #{filename}\"", "unless", "workspace", ".", "has_file?", "(", "filename", ")", "workspace", ...
Get the source for an open file or create a new source if the file exists on disk. Sources created from disk are not added to the open workspace files, i.e., the version on disk remains the authoritative version. @raise [FileNotFoundError] if the file does not exist @param filename [String] @return [Solargraph::Source]
[ "Get", "the", "source", "for", "an", "open", "file", "or", "create", "a", "new", "source", "if", "the", "file", "exists", "on", "disk", ".", "Sources", "created", "from", "disk", "are", "not", "added", "to", "the", "open", "workspace", "files", "i", "....
47badb5d151aca775ccbe6c470236089eae7839d
https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/library.rb#L415-L419
train
Read the file from the workspace.
[ 30522, 13366, 3191, 5371, 18442, 2709, 1030, 2783, 2065, 1030, 2783, 1004, 1004, 1030, 2783, 1012, 5371, 18442, 1027, 1027, 5371, 18442, 5333, 5371, 17048, 14876, 20824, 29165, 1010, 1000, 5371, 2025, 2179, 1024, 1001, 1063, 5371, 18442, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
square/connect-ruby-sdk
lib/square_connect/api/o_auth_api.rb
SquareConnect.OAuthApi.obtain_token
def obtain_token(body, opts = {}) data, _status_code, _headers = obtain_token_with_http_info(body, opts) return data end
ruby
def obtain_token(body, opts = {}) data, _status_code, _headers = obtain_token_with_http_info(body, opts) return data end
[ "def", "obtain_token", "(", "body", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "obtain_token_with_http_info", "(", "body", ",", "opts", ")", "return", "data", "end" ]
ObtainToken Returns an OAuth access token. The endpoint supports distinct methods of obtaining OAuth access tokens. Applications specify a method by adding the `grant_type` parameter in the request and also provide relevant information. For more information, see [OAuth access token management](/authz/oauth/how-it-works#oauth-access-token-management). __Note:__ Regardless of the method application specified, the endpoint always returns two items; an OAuth access token and a refresh token in the response. By default, the OAuth API lets up to 500 Square accounts authorize your application. Please [contact support](https://squareup.com/help/us/en/contact?prefill=developer_api) if you are developing an application for a larger audience. __OAuth tokens should only live on secure servers. Application clients should never interact directly with OAuth tokens__. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [ObtainTokenResponse]
[ "ObtainToken", "Returns", "an", "OAuth", "access", "token", ".", "The", "endpoint", "supports", "distinct", "methods", "of", "obtaining", "OAuth", "access", "tokens", ".", "Applications", "specify", "a", "method", "by", "adding", "the", "grant_type", "parameter", ...
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/o_auth_api.rb#L25-L28
train
Returns a token based on the body
[ 30522, 13366, 6855, 1035, 19204, 1006, 2303, 1010, 23569, 2015, 1027, 1063, 1065, 1007, 2951, 1010, 1035, 3570, 1035, 3642, 1010, 1035, 20346, 2015, 1027, 6855, 1035, 19204, 1035, 2007, 1035, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
puppetlabs/puppet
lib/puppet/util/inifile.rb
Puppet::Util::IniConfig.Section.format
def format if @destroy text = "" else text = "[#{name}]\n" @entries.each do |entry| if entry.is_a?(Array) key, value = entry text << "#{key}=#{value}\n" unless value.nil? else text << entry end end end text end
ruby
def format if @destroy text = "" else text = "[#{name}]\n" @entries.each do |entry| if entry.is_a?(Array) key, value = entry text << "#{key}=#{value}\n" unless value.nil? else text << entry end end end text end
[ "def", "format", "if", "@destroy", "text", "=", "\"\"", "else", "text", "=", "\"[#{name}]\\n\"", "@entries", ".", "each", "do", "|", "entry", "|", "if", "entry", ".", "is_a?", "(", "Array", ")", "key", ",", "value", "=", "entry", "text", "<<", "\"#{key...
Format the section as text in the way it should be written to file
[ "Format", "the", "section", "as", "text", "in", "the", "way", "it", "should", "be", "written", "to", "file" ]
4baeed97cbb7571ddc6635f0a24debe2e8b22cd3
https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/inifile.rb#L79-L94
train
Format the array of entries in the array
[ 30522, 13366, 4289, 2065, 1030, 6033, 3793, 1027, 1000, 1000, 2842, 3793, 1027, 1000, 1031, 1001, 1063, 2171, 1065, 1033, 1032, 1050, 1000, 1030, 10445, 1012, 2169, 2079, 1064, 4443, 1064, 2065, 4443, 1012, 2003, 1035, 1037, 1029, 1006, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mongodb/mongoid
lib/mongoid/config.rb
Mongoid.Config.truncate!
def truncate! Clients.default.database.collections.each do |collection| collection.find.delete_many end and true end
ruby
def truncate! Clients.default.database.collections.each do |collection| collection.find.delete_many end and true end
[ "def", "truncate!", "Clients", ".", "default", ".", "database", ".", "collections", ".", "each", "do", "|", "collection", "|", "collection", ".", "find", ".", "delete_many", "end", "and", "true", "end" ]
Truncate all data in all collections, but not the indexes. @example Truncate all collection data. Mongoid::Config.truncate! @note This will be slower than purge! @return [ true ] true. @since 2.0.2
[ "Truncate", "all", "data", "in", "all", "collections", "but", "not", "the", "indexes", "." ]
56976e32610f4c2450882b0bfe14da099f0703f4
https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/config.rb#L202-L206
train
Truncate the collection
[ 30522, 13366, 19817, 4609, 16280, 999, 7846, 1012, 12398, 1012, 7809, 1012, 6407, 1012, 2169, 2079, 1064, 3074, 1064, 3074, 1012, 2424, 1012, 3972, 12870, 1035, 2116, 2203, 1998, 2995, 2203, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-01-01/generated/azure_mgmt_network/inbound_nat_rules.rb
Azure::Network::Mgmt::V2018_01_01.InboundNatRules.begin_create_or_update_with_http_info
def begin_create_or_update_with_http_info(resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers:nil) begin_create_or_update_async(resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers:custom_headers).value! end
ruby
def begin_create_or_update_with_http_info(resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers:nil) begin_create_or_update_async(resource_group_name, load_balancer_name, inbound_nat_rule_name, inbound_nat_rule_parameters, custom_headers:custom_headers).value! end
[ "def", "begin_create_or_update_with_http_info", "(", "resource_group_name", ",", "load_balancer_name", ",", "inbound_nat_rule_name", ",", "inbound_nat_rule_parameters", ",", "custom_headers", ":", "nil", ")", "begin_create_or_update_async", "(", "resource_group_name", ",", "loa...
Creates or updates a load balancer inbound nat rule. @param resource_group_name [String] The name of the resource group. @param load_balancer_name [String] The name of the load balancer. @param inbound_nat_rule_name [String] The name of the inbound nat rule. @param inbound_nat_rule_parameters [InboundNatRule] Parameters supplied to the create or update inbound nat rule operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Creates", "or", "updates", "a", "load", "balancer", "inbound", "nat", "rule", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-01-01/generated/azure_mgmt_network/inbound_nat_rules.rb#L419-L421
train
Creates or updates a load balancer inbound nat rule.
[ 30522, 13366, 4088, 1035, 3443, 1035, 2030, 1035, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 7170, 1035, 5703, 2099, 1035, 2171, 1010, 1999, 15494, 1035, 14085, 1035, 3627, 1035, 2171, 1010, 1999, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sferik/twitter
lib/twitter/configuration.rb
Twitter.Configuration.photo_sizes
def photo_sizes @attrs.fetch(:photo_sizes, []).each_with_object({}) do |(key, value), object| object[key] = Size.new(value) end end
ruby
def photo_sizes @attrs.fetch(:photo_sizes, []).each_with_object({}) do |(key, value), object| object[key] = Size.new(value) end end
[ "def", "photo_sizes", "@attrs", ".", "fetch", "(", ":photo_sizes", ",", "[", "]", ")", ".", "each_with_object", "(", "{", "}", ")", "do", "|", "(", "key", ",", "value", ")", ",", "object", "|", "object", "[", "key", "]", "=", "Size", ".", "new", ...
Returns an array of photo sizes @return [Array<Twitter::Size>]
[ "Returns", "an", "array", "of", "photo", "sizes" ]
844818cad07ce490ccb9d8542ebb6b4fc7a61cb4
https://github.com/sferik/twitter/blob/844818cad07ce490ccb9d8542ebb6b4fc7a61cb4/lib/twitter/configuration.rb#L20-L24
train
Returns the array of the image sizes that are used to generate the image.
[ 30522, 13366, 6302, 1035, 10826, 1030, 2012, 16344, 2015, 1012, 18584, 1006, 1024, 6302, 1035, 10826, 1010, 1031, 1033, 1007, 1012, 2169, 1035, 2007, 1035, 4874, 1006, 1063, 1065, 1007, 2079, 1064, 1006, 3145, 1010, 3643, 1007, 1010, 4874, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb
Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.reimage_all_async
def reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil) # Send request promise = begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
ruby
def reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil) # Send request promise = begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
[ "def", "reimage_all_async", "(", "resource_group_name", ",", "vm_scale_set_name", ",", "vm_instance_ids", ":", "nil", ",", "custom_headers", ":", "nil", ")", "# Send request", "promise", "=", "begin_reimage_all_async", "(", "resource_group_name", ",", "vm_scale_set_name",...
@param resource_group_name [String] The name of the resource group. @param vm_scale_set_name [String] The name of the VM scale set. @param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of virtual machine instance IDs from the VM scale set. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Concurrent::Promise] promise which provides async access to http response.
[ "@param", "resource_group_name", "[", "String", "]", "The", "name", "of", "the", "resource", "group", ".", "@param", "vm_scale_set_name", "[", "String", "]", "The", "name", "of", "the", "VM", "scale", "set", ".", "@param", "vm_instance_ids", "[", "VirtualMachi...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1120-L1134
train
Reimage all virtual machines in a VM scale set.
[ 30522, 13366, 24964, 26860, 1035, 2035, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 1058, 2213, 1035, 4094, 1035, 2275, 1035, 2171, 1010, 1058, 2213, 1035, 6013, 1035, 8909, 2015, 1024, 9152, 2140, 1010, 7661, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
oauth-xx/oauth2
spec/spec_helpers/stubbed_env.rb
StubbedEnv.Helpers.add_stubbed_value
def add_stubbed_value(key, value) allow(ENV).to receive(:[]).with(key).and_return(value) allow(ENV).to receive(:fetch).with(key).and_return(value) allow(ENV).to receive(:fetch).with(key, anything) do |_, default_val| value || default_val end end
ruby
def add_stubbed_value(key, value) allow(ENV).to receive(:[]).with(key).and_return(value) allow(ENV).to receive(:fetch).with(key).and_return(value) allow(ENV).to receive(:fetch).with(key, anything) do |_, default_val| value || default_val end end
[ "def", "add_stubbed_value", "(", "key", ",", "value", ")", "allow", "(", "ENV", ")", ".", "to", "receive", "(", ":[]", ")", ".", "with", "(", "key", ")", ".", "and_return", "(", "value", ")", "allow", "(", "ENV", ")", ".", "to", "receive", "(", "...
rubocop:disable Metrics/AbcSize
[ "rubocop", ":", "disable", "Metrics", "/", "AbcSize" ]
f08ff9da169136ab133aa2faab0d74a4407deffb
https://github.com/oauth-xx/oauth2/blob/f08ff9da169136ab133aa2faab0d74a4407deffb/spec/spec_helpers/stubbed_env.rb#L17-L23
train
Add a stubbed value to the current object.
[ 30522, 13366, 5587, 1035, 24646, 15499, 1035, 3643, 1006, 3145, 1010, 3643, 1007, 3499, 1006, 4372, 2615, 1007, 1012, 2000, 4374, 1006, 1024, 1031, 1033, 1007, 1012, 2007, 1006, 3145, 1007, 1012, 1998, 1035, 2709, 1006, 3643, 1007, 3499, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-04-01/generated/azure_mgmt_network/express_route_cross_connections.rb
Azure::Network::Mgmt::V2018_04_01.ExpressRouteCrossConnections.begin_update_tags
def begin_update_tags(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil) response = begin_update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_update_tags(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:nil) response = begin_update_tags_async(resource_group_name, cross_connection_name, cross_connection_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_update_tags", "(", "resource_group_name", ",", "cross_connection_name", ",", "cross_connection_parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_update_tags_async", "(", "resource_group_name", ",", "cross_connection_name", ",", "cros...
Updates an express route cross connection tags. @param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the cross connection. @param cross_connection_parameters [TagsObject] Parameters supplied to update express route cross connection tags. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ExpressRouteCrossConnection] operation results.
[ "Updates", "an", "express", "route", "cross", "connection", "tags", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-04-01/generated/azure_mgmt_network/express_route_cross_connections.rb#L657-L660
train
Updates the tags on the specified ExpressRouteCrossConnection.
[ 30522, 13366, 4088, 1035, 10651, 1035, 22073, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2892, 1035, 4434, 1035, 2171, 1010, 2892, 1035, 4434, 1035, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 10651,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rails/rails
actionpack/lib/action_controller/metal/redirecting.rb
ActionController.Redirecting.redirect_back
def redirect_back(fallback_location:, allow_other_host: true, **args) referer = request.headers["Referer"] redirect_to_referer = referer && (allow_other_host || _url_host_allowed?(referer)) redirect_to redirect_to_referer ? referer : fallback_location, **args end
ruby
def redirect_back(fallback_location:, allow_other_host: true, **args) referer = request.headers["Referer"] redirect_to_referer = referer && (allow_other_host || _url_host_allowed?(referer)) redirect_to redirect_to_referer ? referer : fallback_location, **args end
[ "def", "redirect_back", "(", "fallback_location", ":", ",", "allow_other_host", ":", "true", ",", "**", "args", ")", "referer", "=", "request", ".", "headers", "[", "\"Referer\"", "]", "redirect_to_referer", "=", "referer", "&&", "(", "allow_other_host", "||", ...
Redirects the browser to the page that issued the request (the referrer) if possible, otherwise redirects to the provided default fallback location. The referrer information is pulled from the HTTP +Referer+ (sic) header on the request. This is an optional header and its presence on the request is subject to browser security settings and user preferences. If the request is missing this header, the <tt>fallback_location</tt> will be used. redirect_back fallback_location: { action: "show", id: 5 } redirect_back fallback_location: @post redirect_back fallback_location: "http://www.rubyonrails.org" redirect_back fallback_location: "/images/screenshot.jpg" redirect_back fallback_location: posts_url redirect_back fallback_location: proc { edit_post_url(@post) } redirect_back fallback_location: '/', allow_other_host: false ==== Options * <tt>:fallback_location</tt> - The default fallback location that will be used on missing +Referer+ header. * <tt>:allow_other_host</tt> - Allow or disallow redirection to the host that is different to the current host, defaults to true. All other options that can be passed to <tt>redirect_to</tt> are accepted as options and the behavior is identical.
[ "Redirects", "the", "browser", "to", "the", "page", "that", "issued", "the", "request", "(", "the", "referrer", ")", "if", "possible", "otherwise", "redirects", "to", "the", "provided", "default", "fallback", "location", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_controller/metal/redirecting.rb#L90-L94
train
Redirect to the back to the given fallback location
[ 30522, 13366, 2417, 7442, 6593, 1035, 2067, 1006, 2991, 5963, 1035, 3295, 1024, 1010, 3499, 1035, 2060, 1035, 3677, 1024, 2995, 1010, 1008, 1008, 12098, 5620, 1007, 6523, 2121, 1027, 5227, 1012, 20346, 2015, 1031, 1000, 6523, 2121, 1000, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
plaid/plaid-ruby
lib/plaid/client.rb
Plaid.Client.post_with_auth
def post_with_auth(path, payload) @connection.post( path, payload.merge(client_id: @client_id, secret: @secret) ).body end
ruby
def post_with_auth(path, payload) @connection.post( path, payload.merge(client_id: @client_id, secret: @secret) ).body end
[ "def", "post_with_auth", "(", "path", ",", "payload", ")", "@connection", ".", "post", "(", "path", ",", "payload", ".", "merge", "(", "client_id", ":", "@client_id", ",", "secret", ":", "@secret", ")", ")", ".", "body", "end" ]
Public: Make a post request with appended authentication fields path - Path or URL to make the request to payload - The payload or data to post Returns the resulting parsed JSON of the request
[ "Public", ":", "Make", "a", "post", "request", "with", "appended", "authentication", "fields" ]
ce3da1c5559c739de88c5f59e54eef875f296673
https://github.com/plaid/plaid-ruby/blob/ce3da1c5559c739de88c5f59e54eef875f296673/lib/plaid/client.rb#L111-L116
train
POST with auth
[ 30522, 13366, 2695, 1035, 2007, 1035, 8740, 2705, 1006, 4130, 1010, 18093, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
markdownlint/markdownlint
lib/mdl/doc.rb
MarkdownLint.Doc.list_style
def list_style(item) if item.type != :li raise "list_style called with non-list element" end line = element_line(item).strip if line.start_with?('*') :asterisk elsif line.start_with?('+') :plus elsif line.start_with?('-') :dash elsif line.match('[0-9]+\.') :ordered elsif line.match('[0-9]+\)') :ordered_paren else :unknown end end
ruby
def list_style(item) if item.type != :li raise "list_style called with non-list element" end line = element_line(item).strip if line.start_with?('*') :asterisk elsif line.start_with?('+') :plus elsif line.start_with?('-') :dash elsif line.match('[0-9]+\.') :ordered elsif line.match('[0-9]+\)') :ordered_paren else :unknown end end
[ "def", "list_style", "(", "item", ")", "if", "item", ".", "type", "!=", ":li", "raise", "\"list_style called with non-list element\"", "end", "line", "=", "element_line", "(", "item", ")", ".", "strip", "if", "line", ".", "start_with?", "(", "'*'", ")", ":as...
Returns the list style for a list: :asterisk, :plus, :dash, :ordered or :ordered_paren depending on which symbol is used to denote the list item. You can pass in either the element itself or an options hash here.
[ "Returns", "the", "list", "style", "for", "a", "list", ":", ":", "asterisk", ":", "plus", ":", "dash", ":", "ordered", "or", ":", "ordered_paren", "depending", "on", "which", "symbol", "is", "used", "to", "denote", "the", "list", "item", ".", "You", "c...
a9e80fcf3989d73b654b00bb2225a00be53983e8
https://github.com/markdownlint/markdownlint/blob/a9e80fcf3989d73b654b00bb2225a00be53983e8/lib/mdl/doc.rb#L189-L207
train
Returns the list style for the given item.
[ 30522, 13366, 2862, 1035, 2806, 1006, 8875, 1007, 2065, 8875, 1012, 2828, 999, 1027, 1024, 5622, 5333, 1000, 2862, 1035, 2806, 2170, 2007, 2512, 1011, 2862, 5783, 1000, 2203, 2240, 1027, 5783, 1035, 2240, 1006, 8875, 1007, 1012, 6167, 206...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mongodb/mongoid
lib/mongoid/changeable.rb
Mongoid.Changeable.attribute_was
def attribute_was(attr) attr = database_field_name(attr) attribute_changed?(attr) ? changed_attributes[attr] : attributes[attr] end
ruby
def attribute_was(attr) attr = database_field_name(attr) attribute_changed?(attr) ? changed_attributes[attr] : attributes[attr] end
[ "def", "attribute_was", "(", "attr", ")", "attr", "=", "database_field_name", "(", "attr", ")", "attribute_changed?", "(", "attr", ")", "?", "changed_attributes", "[", "attr", "]", ":", "attributes", "[", "attr", "]", "end" ]
Get the previous value for the attribute. @example Get the previous value. model.attribute_was("name") @param [ String ] attr The attribute name. @since 2.4.0
[ "Get", "the", "previous", "value", "for", "the", "attribute", "." ]
56976e32610f4c2450882b0bfe14da099f0703f4
https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/changeable.rb#L214-L217
train
Returns the value of the attribute that was changed.
[ 30522, 13366, 17961, 1035, 2001, 1006, 2012, 16344, 1007, 2012, 30524, 1024, 12332, 1031, 2012, 16344, 1033, 2203, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
CocoaPods/Xcodeproj
lib/xcodeproj/config.rb
Xcodeproj.Config.extract_hash
def extract_hash(argument) if argument.respond_to? :read @filepath = Pathname.new(argument.to_path) hash_from_file_content(argument.read) elsif File.readable?(argument.to_s) @filepath = Pathname.new(argument.to_s) hash_from_file_content(File.read(argument)) else argument end end
ruby
def extract_hash(argument) if argument.respond_to? :read @filepath = Pathname.new(argument.to_path) hash_from_file_content(argument.read) elsif File.readable?(argument.to_s) @filepath = Pathname.new(argument.to_s) hash_from_file_content(File.read(argument)) else argument end end
[ "def", "extract_hash", "(", "argument", ")", "if", "argument", ".", "respond_to?", ":read", "@filepath", "=", "Pathname", ".", "new", "(", "argument", ".", "to_path", ")", "hash_from_file_content", "(", "argument", ".", "read", ")", "elsif", "File", ".", "re...
@!group Private Helpers Returns a hash from the given argument reading it from disk if necessary. @param [String, Pathname, Hash] argument The source from where the hash should be extracted. @return [Hash]
[ "@!group", "Private", "Helpers", "Returns", "a", "hash", "from", "the", "given", "argument", "reading", "it", "from", "disk", "if", "necessary", "." ]
3be1684437a6f8e69c7836ad4c85a2b78663272f
https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/lib/xcodeproj/config.rb#L254-L264
train
Extract the hash from the given argument
[ 30522, 13366, 14817, 1035, 23325, 1006, 6685, 1007, 2065, 6685, 1012, 6869, 1035, 2000, 1029, 1024, 3191, 1030, 5371, 15069, 1027, 4130, 18442, 1012, 2047, 1006, 6685, 1012, 2000, 1035, 4130, 1007, 23325, 1035, 2013, 1035, 5371, 1035, 4180,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
square/connect-ruby-sdk
lib/square_connect/models/v1_fee.rb
SquareConnect.V1Fee.adjustment_type=
def adjustment_type=(adjustment_type) validator = EnumAttributeValidator.new('String', ["TAX"]) unless validator.valid?(adjustment_type) fail ArgumentError, "invalid value for 'adjustment_type', must be one of #{validator.allowable_values}." end @adjustment_type = adjustment_type end
ruby
def adjustment_type=(adjustment_type) validator = EnumAttributeValidator.new('String', ["TAX"]) unless validator.valid?(adjustment_type) fail ArgumentError, "invalid value for 'adjustment_type', must be one of #{validator.allowable_values}." end @adjustment_type = adjustment_type end
[ "def", "adjustment_type", "=", "(", "adjustment_type", ")", "validator", "=", "EnumAttributeValidator", ".", "new", "(", "'String'", ",", "[", "\"TAX\"", "]", ")", "unless", "validator", ".", "valid?", "(", "adjustment_type", ")", "fail", "ArgumentError", ",", ...
Custom attribute writer method checking allowed values (enum). @param [Object] adjustment_type Object to be assigned
[ "Custom", "attribute", "writer", "method", "checking", "allowed", "values", "(", "enum", ")", "." ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/v1_fee.rb#L182-L188
train
Set the adjustment type of the resource.
[ 30522, 13366, 19037, 1035, 2828, 1027, 1006, 19037, 1035, 2828, 1007, 9398, 8844, 1027, 4372, 12248, 4779, 3089, 8569, 2618, 10175, 8524, 4263, 1012, 2047, 1006, 1005, 5164, 1005, 1010, 1031, 1000, 4171, 1000, 1033, 1007, 4983, 9398, 8844, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
fastlane/fastlane
fastlane/lib/fastlane/fast_file.rb
Fastlane.FastFile.say
def say(value) # Overwrite this, since there is already a 'say' method defined in the Ruby standard library value ||= yield value = { text: value } if value.kind_of?(String) || value.kind_of?(Array) self.runner.trigger_action_by_name(:say, nil, false, value) end
ruby
def say(value) # Overwrite this, since there is already a 'say' method defined in the Ruby standard library value ||= yield value = { text: value } if value.kind_of?(String) || value.kind_of?(Array) self.runner.trigger_action_by_name(:say, nil, false, value) end
[ "def", "say", "(", "value", ")", "# Overwrite this, since there is already a 'say' method defined in the Ruby standard library", "value", "||=", "yield", "value", "=", "{", "text", ":", "value", "}", "if", "value", ".", "kind_of?", "(", "String", ")", "||", "value", ...
@!group Overwriting Ruby methods Speak out loud
[ "@!group", "Overwriting", "Ruby", "methods" ]
457c5d647c77f0e078dafa5129da616914e002c5
https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/fast_file.rb#L314-L320
train
Called by the runner when a message is sent to the user.
[ 30522, 13366, 2360, 1006, 3643, 1007, 1001, 2058, 26373, 2023, 1010, 2144, 2045, 2003, 2525, 1037, 1005, 2360, 1005, 4118, 4225, 1999, 1996, 10090, 3115, 3075, 3643, 1064, 1064, 1027, 10750, 3643, 1027, 1063, 3793, 1024, 3643, 1065, 2065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
piotrmurach/github
lib/github_api/client/repos/hooks.rb
Github.Client::Repos::Hooks.edit
def edit(*args) arguments(args, required: [:user, :repo, :id]) do permit VALID_HOOK_PARAM_NAMES, recursive: false assert_required REQUIRED_PARAMS end patch_request("/repos/#{arguments.user}/#{arguments.repo}/hooks/#{arguments.id}", arguments.params) end
ruby
def edit(*args) arguments(args, required: [:user, :repo, :id]) do permit VALID_HOOK_PARAM_NAMES, recursive: false assert_required REQUIRED_PARAMS end patch_request("/repos/#{arguments.user}/#{arguments.repo}/hooks/#{arguments.id}", arguments.params) end
[ "def", "edit", "(", "*", "args", ")", "arguments", "(", "args", ",", "required", ":", "[", ":user", ",", ":repo", ",", ":id", "]", ")", "do", "permit", "VALID_HOOK_PARAM_NAMES", ",", "recursive", ":", "false", "assert_required", "REQUIRED_PARAMS", "end", "...
Edit a hook @param [Hash] params @input params [Hash] :config Required. Key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repository. Booleans are stored internally as “1” for true, and “0” for false. Any JSON true/false values will be converted automatically. @input params [Array] :events Determines what events the hook is triggered for. Default: ["push"] @input params [Array] :add_events Determines a list of events to be added to the list of events that the Hook triggers for. @input params [Array] :remove_events Determines a list of events to be removed from the list of events that the Hook triggers for. @input params [Boolean] :active Determines whether the hook is actually triggered on pushes. @example github = Github.new github.repos.hooks.edit 'user-name', 'repo-name', 'hook-id', "name" => "campfire", "active" => true, "config" => { "subdomain" => "github", "room" => "Commits", "token" => "abc123" } @api public
[ "Edit", "a", "hook" ]
8702452c66bea33c9388550aed9e9974f76aaef1
https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/repos/hooks.rb#L159-L166
train
Edit a hook
[ 30522, 13366, 10086, 1006, 1008, 12098, 5620, 1007, 9918, 1006, 12098, 5620, 1010, 3223, 1024, 1031, 1024, 5310, 1010, 1024, 16360, 2080, 1010, 1024, 8909, 1033, 1007, 2079, 9146, 9398, 1035, 8103, 1035, 11498, 2213, 1035, 3415, 1010, 28667...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_policy/lib/2017-06-01-preview/generated/azure_mgmt_policy/policy_set_definitions.rb
Azure::Policy::Mgmt::V2017_06_01_preview.PolicySetDefinitions.delete_at_management_group
def delete_at_management_group(policy_set_definition_name, management_group_id, custom_headers:nil) response = delete_at_management_group_async(policy_set_definition_name, management_group_id, custom_headers:custom_headers).value! nil end
ruby
def delete_at_management_group(policy_set_definition_name, management_group_id, custom_headers:nil) response = delete_at_management_group_async(policy_set_definition_name, management_group_id, custom_headers:custom_headers).value! nil end
[ "def", "delete_at_management_group", "(", "policy_set_definition_name", ",", "management_group_id", ",", "custom_headers", ":", "nil", ")", "response", "=", "delete_at_management_group_async", "(", "policy_set_definition_name", ",", "management_group_id", ",", "custom_headers",...
Deletes a policy set definition at management group level. @param policy_set_definition_name [String] The name of the policy set definition to delete. @param management_group_id [String] The ID of the management group. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Deletes", "a", "policy", "set", "definition", "at", "management", "group", "level", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy/lib/2017-06-01-preview/generated/azure_mgmt_policy/policy_set_definitions.rb#L689-L692
train
Deletes the policy set definition at management group level.
[ 30522, 13366, 3972, 12870, 1035, 2012, 1035, 2968, 1035, 2177, 1006, 3343, 1035, 2275, 1035, 6210, 1035, 2171, 1010, 2968, 1035, 2177, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 3972, 12870, 1035, 2012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_extensions.rb
Azure::Compute::Mgmt::V2018_04_01.VirtualMachineExtensions.update
def update(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers:nil) response = update_async(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def update(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers:nil) response = update_async(resource_group_name, vm_name, vm_extension_name, extension_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "update", "(", "resource_group_name", ",", "vm_name", ",", "vm_extension_name", ",", "extension_parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "update_async", "(", "resource_group_name", ",", "vm_name", ",", "vm_extension_name", ",", "e...
The operation to update the extension. @param resource_group_name [String] The name of the resource group. @param vm_name [String] The name of the virtual machine where the extension should be updated. @param vm_extension_name [String] The name of the virtual machine extension. @param extension_parameters [VirtualMachineExtensionUpdate] Parameters supplied to the Update Virtual Machine Extension operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [VirtualMachineExtension] operation results.
[ "The", "operation", "to", "update", "the", "extension", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_extensions.rb#L88-L91
train
Updates an extension.
[ 30522, 13366, 10651, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 1058, 2213, 1035, 2171, 1010, 1058, 2213, 1035, 5331, 1035, 2171, 1010, 5331, 1035, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 10651, 1035, 2004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hashicorp/vagrant
lib/vagrant/machine.rb
Vagrant.Machine.reload
def reload old_id = @id @id = nil if @data_dir # Read the id file from the data directory if it exists as the # ID for the pre-existing physical representation of this machine. id_file = @data_dir.join("id") id_content = id_file.read.strip if id_file.file? if !id_content.to_s.empty? @id = id_content end end if @id != old_id && @provider # It changed, notify the provider @provider.machine_id_changed end @id end
ruby
def reload old_id = @id @id = nil if @data_dir # Read the id file from the data directory if it exists as the # ID for the pre-existing physical representation of this machine. id_file = @data_dir.join("id") id_content = id_file.read.strip if id_file.file? if !id_content.to_s.empty? @id = id_content end end if @id != old_id && @provider # It changed, notify the provider @provider.machine_id_changed end @id end
[ "def", "reload", "old_id", "=", "@id", "@id", "=", "nil", "if", "@data_dir", "# Read the id file from the data directory if it exists as the", "# ID for the pre-existing physical representation of this machine.", "id_file", "=", "@data_dir", ".", "join", "(", "\"id\"", ")", "...
This reloads the ID of the underlying machine.
[ "This", "reloads", "the", "ID", "of", "the", "underlying", "machine", "." ]
c22a145c59790c098f95d50141d9afb48e1ef55f
https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/machine.rb#L394-L414
train
Reload the id file from the data directory if it exists.
[ 30522, 13366, 2128, 11066, 2214, 1035, 8909, 1027, 1030, 8909, 1030, 8909, 1027, 9152, 2140, 2065, 1030, 2951, 1035, 30524, 4493, 3558, 6630, 1997, 2023, 3698, 1012, 8909, 1035, 5371, 1027, 1030, 2951, 1035, 16101, 1012, 3693, 1006, 1000, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb
Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_metrics_next
def list_metrics_next(next_page_link, custom_headers:nil) response = list_metrics_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_metrics_next(next_page_link, custom_headers:nil) response = list_metrics_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_metrics_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_metrics_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "body", "unless", "response", ...
Get global metrics of an App Service Environment. Get global metrics of an App Service Environment. @param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ResourceMetricCollection] operation results.
[ "Get", "global", "metrics", "of", "an", "App", "Service", "Environment", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L5326-L5329
train
Gets metrics for a given resource group.
[ 30522, 13366, 2862, 1035, 12046, 2015, 1035, 2279, 1006, 2279, 1035, 3931, 1035, 4957, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 12046, 2015, 1035, 2279, 1035, 2004, 6038, 2278, 1006, 2279, 1035, 3931, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
decidim/decidim
decidim-core/app/helpers/decidim/amendments_helper.rb
Decidim.AmendmentsHelper.allowed_to_promote?
def allowed_to_promote?(emendation) return unless emendation.amendment.rejected? && emendation.created_by?(current_user) return if promoted?(emendation) true end
ruby
def allowed_to_promote?(emendation) return unless emendation.amendment.rejected? && emendation.created_by?(current_user) return if promoted?(emendation) true end
[ "def", "allowed_to_promote?", "(", "emendation", ")", "return", "unless", "emendation", ".", "amendment", ".", "rejected?", "&&", "emendation", ".", "created_by?", "(", "current_user", ")", "return", "if", "promoted?", "(", "emendation", ")", "true", "end" ]
Checks if the user can promote the emendation
[ "Checks", "if", "the", "user", "can", "promote", "the", "emendation" ]
6e2b14e559a63088669904e3c5c49a5180700cf7
https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/amendments_helper.rb#L90-L95
train
Returns true if the given emendation is allowed to be promoted to the current user.
[ 30522, 13366, 3039, 1035, 2000, 1035, 5326, 1029, 1006, 7861, 10497, 3370, 1007, 2709, 4983, 7861, 10497, 3370, 1012, 7450, 1012, 5837, 1029, 1004, 1004, 7861, 10497, 3370, 1012, 2580, 1035, 2011, 1029, 1006, 2783, 1035, 5310, 1007, 2709, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
github/licensed
lib/licensed/dependency.rb
Licensed.Dependency.license_contents
def license_contents matched_files.reject { |f| f == package_file } .group_by(&:content) .map { |content, files| { "sources" => license_content_sources(files), "text" => content } } end
ruby
def license_contents matched_files.reject { |f| f == package_file } .group_by(&:content) .map { |content, files| { "sources" => license_content_sources(files), "text" => content } } end
[ "def", "license_contents", "matched_files", ".", "reject", "{", "|", "f", "|", "f", "==", "package_file", "}", ".", "group_by", "(", ":content", ")", ".", "map", "{", "|", "content", ",", "files", "|", "{", "\"sources\"", "=>", "license_content_sources", "...
Returns the license text content from all matched sources except the package file, which doesn't contain license text.
[ "Returns", "the", "license", "text", "content", "from", "all", "matched", "sources", "except", "the", "package", "file", "which", "doesn", "t", "contain", "license", "text", "." ]
afba288df344e001d43e94ad9217635a011b79c2
https://github.com/github/licensed/blob/afba288df344e001d43e94ad9217635a011b79c2/lib/licensed/dependency.rb#L74-L78
train
returns an array of the license contents
[ 30522, 13366, 6105, 1035, 8417, 10349, 1035, 6764, 1012, 15454, 1063, 1064, 1042, 1064, 1042, 1027, 1027, 7427, 1035, 5371, 1065, 1012, 2177, 1035, 2011, 1006, 1004, 1024, 4180, 1007, 1012, 4949, 1063, 1064, 4180, 1010, 6764, 1064, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ruby2d/ruby2d
lib/ruby2d/line.rb
Ruby2D.Line.points_distance
def points_distance(x1, y1, x2, y2) Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) end
ruby
def points_distance(x1, y1, x2, y2) Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2) end
[ "def", "points_distance", "(", "x1", ",", "y1", ",", "x2", ",", "y2", ")", "Math", ".", "sqrt", "(", "(", "x1", "-", "x2", ")", "**", "2", "+", "(", "y1", "-", "y2", ")", "**", "2", ")", "end" ]
Calculate the distance between two points
[ "Calculate", "the", "distance", "between", "two", "points" ]
43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4
https://github.com/ruby2d/ruby2d/blob/43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4/lib/ruby2d/line.rb#L44-L46
train
Calculate the distance between two points
[ 30522, 13366, 2685, 1035, 3292, 1006, 1060, 2487, 1010, 1061, 2487, 1010, 1060, 2475, 1010, 1061, 2475, 1007, 8785, 1012, 5490, 5339, 1006, 1006, 1060, 2487, 1011, 1060, 2475, 1007, 1008, 1008, 1016, 1009, 1006, 1061, 2487, 1011, 1061, 24...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
lostisland/faraday
lib/faraday/rack_builder.rb
Faraday.RackBuilder.build_env
def build_env(connection, request) exclusive_url = connection.build_exclusive_url( request.path, request.params, request.options.params_encoder ) Env.new(request.method, request.body, exclusive_url, request.options, request.headers, connection.ssl, connection.parallel_manager) end
ruby
def build_env(connection, request) exclusive_url = connection.build_exclusive_url( request.path, request.params, request.options.params_encoder ) Env.new(request.method, request.body, exclusive_url, request.options, request.headers, connection.ssl, connection.parallel_manager) end
[ "def", "build_env", "(", "connection", ",", "request", ")", "exclusive_url", "=", "connection", ".", "build_exclusive_url", "(", "request", ".", "path", ",", "request", ".", "params", ",", "request", ".", "options", ".", "params_encoder", ")", "Env", ".", "n...
ENV Keys :method - a symbolized request method (:get, :post) :body - the request body that will eventually be converted to a string. :url - URI instance for the current request. :status - HTTP response status code :request_headers - hash of HTTP Headers to be sent to the server :response_headers - Hash of HTTP headers from the server :parallel_manager - sent if the connection is in parallel mode :request - Hash of options for configuring the request. :timeout - open/read timeout Integer in seconds :open_timeout - read timeout Integer in seconds :proxy - Hash of proxy options :uri - Proxy Server URI :user - Proxy server username :password - Proxy server password :ssl - Hash of options for configuring SSL requests.
[ "ENV", "Keys", ":", "method", "-", "a", "symbolized", "request", "method", "(", ":", "get", ":", "post", ")", ":", "body", "-", "the", "request", "body", "that", "will", "eventually", "be", "converted", "to", "a", "string", ".", ":", "url", "-", "URI...
3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70
https://github.com/lostisland/faraday/blob/3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70/lib/faraday/rack_builder.rb#L204-L213
train
Build an environment object from the request
[ 30522, 13366, 3857, 1035, 4372, 2615, 1006, 4434, 1010, 30524, 3857, 1035, 7262, 1035, 24471, 2140, 1006, 5227, 1012, 4130, 1010, 5227, 1012, 11498, 5244, 1010, 5227, 1012, 7047, 1012, 11498, 5244, 1035, 4372, 16044, 2099, 1007, 4372, 2615,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb
Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.reboot
def reboot(resource_group_name, name, custom_headers:nil) response = reboot_async(resource_group_name, name, custom_headers:custom_headers).value! nil end
ruby
def reboot(resource_group_name, name, custom_headers:nil) response = reboot_async(resource_group_name, name, custom_headers:custom_headers).value! nil end
[ "def", "reboot", "(", "resource_group_name", ",", "name", ",", "custom_headers", ":", "nil", ")", "response", "=", "reboot_async", "(", "resource_group_name", ",", "name", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "nil", "end" ]
Reboot all machines in an App Service Environment. Reboot all machines in an App Service Environment. @param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Reboot", "all", "machines", "in", "an", "App", "Service", "Environment", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L2481-L2484
train
Reboots the specified container group.
[ 30522, 13366, 2128, 27927, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2128, 27927, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2171, 1010, 7661, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb
Azure::Locks::Mgmt::V2015_01_01.ManagementLocks.list_at_subscription_level_next
def list_at_subscription_level_next(next_page_link, custom_headers:nil) response = list_at_subscription_level_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_at_subscription_level_next(next_page_link, custom_headers:nil) response = list_at_subscription_level_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_at_subscription_level_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_at_subscription_level_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "body",...
Gets all the management locks of a subscription. @param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ManagementLockListResult] operation results.
[ "Gets", "all", "the", "management", "locks", "of", "a", "subscription", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb#L1314-L1317
train
Gets the list of the elastic advisors.
[ 30522, 13366, 2862, 1035, 2012, 1035, 15002, 1035, 2504, 1035, 2279, 1006, 2279, 1035, 3931, 1035, 4957, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 2012, 1035, 15002, 1035, 2504, 1035, 2279, 1035, 2004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
daddyz/phonelib
lib/phonelib/phone_analyzer_helper.rb
Phonelib.PhoneAnalyzerHelper.passed_country
def passed_country(country) code = country_prefix(country) if Core::PLUS_SIGN == @original[0] && code && !sanitized.start_with?(code) # in case number passed with + but it doesn't start with passed # country prefix country = nil end country end
ruby
def passed_country(country) code = country_prefix(country) if Core::PLUS_SIGN == @original[0] && code && !sanitized.start_with?(code) # in case number passed with + but it doesn't start with passed # country prefix country = nil end country end
[ "def", "passed_country", "(", "country", ")", "code", "=", "country_prefix", "(", "country", ")", "if", "Core", "::", "PLUS_SIGN", "==", "@original", "[", "0", "]", "&&", "code", "&&", "!", "sanitized", ".", "start_with?", "(", "code", ")", "# in case numb...
defines if to validate against single country or not
[ "defines", "if", "to", "validate", "against", "single", "country", "or", "not" ]
aa0023eab7c896b71275bf342bc7f49735cbdbbf
https://github.com/daddyz/phonelib/blob/aa0023eab7c896b71275bf342bc7f49735cbdbbf/lib/phonelib/phone_analyzer_helper.rb#L25-L33
train
Returns the passed country
[ 30522, 13366, 2979, 1035, 2406, 1006, 2406, 1007, 3642, 1027, 2406, 1035, 17576, 1006, 2406, 1007, 2065, 4563, 1024, 1024, 4606, 1035, 3696, 1027, 1027, 1030, 2434, 1031, 1014, 1033, 1004, 1004, 3642, 1004, 1004, 999, 2624, 25090, 5422, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_wans.rb
Azure::Network::Mgmt::V2018_07_01.VirtualWANs.update_tags_async
def update_tags_async(resource_group_name, virtual_wanname, wanparameters, custom_headers:nil) # Send request promise = begin_update_tags_async(resource_group_name, virtual_wanname, wanparameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_07_01::Models::VirtualWAN.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
ruby
def update_tags_async(resource_group_name, virtual_wanname, wanparameters, custom_headers:nil) # Send request promise = begin_update_tags_async(resource_group_name, virtual_wanname, wanparameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_07_01::Models::VirtualWAN.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
[ "def", "update_tags_async", "(", "resource_group_name", ",", "virtual_wanname", ",", "wanparameters", ",", "custom_headers", ":", "nil", ")", "# Send request", "promise", "=", "begin_update_tags_async", "(", "resource_group_name", ",", "virtual_wanname", ",", "wanparamete...
@param resource_group_name [String] The resource group name of the VirtualWan. @param virtual_wanname [String] The name of the VirtualWAN being updated. @param wanparameters [TagsObject] Parameters supplied to Update VirtualWAN tags. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Concurrent::Promise] promise which provides async access to http response.
[ "@param", "resource_group_name", "[", "String", "]", "The", "resource", "group", "name", "of", "the", "VirtualWan", ".", "@param", "virtual_wanname", "[", "String", "]", "The", "name", "of", "the", "VirtualWAN", "being", "updated", ".", "@param", "wanparameters"...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_wans.rb#L200-L216
train
Updates a virtual wan s tags.
[ 30522, 13366, 10651, 1035, 22073, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 7484, 1035, 10587, 4168, 1010, 14071, 28689, 22828, 2015, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 1001, 4604, 5227, 4872, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.delete_name
def delete_name(name_id, timeout:60, custom_headers:nil) response = delete_name_async(name_id, timeout:timeout, custom_headers:custom_headers).value! nil end
ruby
def delete_name(name_id, timeout:60, custom_headers:nil) response = delete_name_async(name_id, timeout:timeout, custom_headers:custom_headers).value! nil end
[ "def", "delete_name", "(", "name_id", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "response", "=", "delete_name_async", "(", "name_id", ",", "timeout", ":", "timeout", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "nil", ...
Deletes a Service Fabric name. Deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a name with child properties will fail. @param name_id [String] The Service Fabric name, without the 'fabric:' URI scheme. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Deletes", "a", "Service", "Fabric", "name", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L26328-L26331
train
Deletes a name from the specified HDInsight domain.
[ 30522, 13366, 3972, 12870, 1035, 2171, 1006, 2171, 1035, 8909, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 3972, 12870, 1035, 2171, 1035, 2004, 6038, 2278, 1006, 2171, 1035, 8909, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rubocop-hq/rubocop
lib/rubocop/token.rb
RuboCop.Token.space_before?
def space_before? position = begin_pos.zero? ? begin_pos : begin_pos - 1 pos.source_buffer.source.match(/\G\s/, position) end
ruby
def space_before? position = begin_pos.zero? ? begin_pos : begin_pos - 1 pos.source_buffer.source.match(/\G\s/, position) end
[ "def", "space_before?", "position", "=", "begin_pos", ".", "zero?", "?", "begin_pos", ":", "begin_pos", "-", "1", "pos", ".", "source_buffer", ".", "source", ".", "match", "(", "/", "\\G", "\\s", "/", ",", "position", ")", "end" ]
Checks if there is whitespace before token
[ "Checks", "if", "there", "is", "whitespace", "before", "token" ]
2a4f4f0fdac4e1bb25891fc312af2ea60c6aa2f0
https://github.com/rubocop-hq/rubocop/blob/2a4f4f0fdac4e1bb25891fc312af2ea60c6aa2f0/lib/rubocop/token.rb#L47-L50
train
Returns true if the position is before the current position.
[ 30522, 13366, 2686, 1035, 2077, 1029, 2597, 1027, 4088, 1035, 13433, 2015, 1012, 5717, 1029, 1029, 4088, 1035, 13433, 2015, 1024, 4088, 1035, 13433, 2015, 1011, 1015, 13433, 2015, 1012, 3120, 1035, 17698, 1012, 3120, 1012, 2674, 1006, 1013,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
square/connect-ruby-sdk
lib/square_connect/models/create_order_request_tax.rb
SquareConnect.CreateOrderRequestTax.valid?
def valid? return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192 return false if !@name.nil? && @name.to_s.length > 255 type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"]) return false unless type_validator.valid?(@type) return false if !@percentage.nil? && @percentage.to_s.length > 10 return true end
ruby
def valid? return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192 return false if !@name.nil? && @name.to_s.length > 255 type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"]) return false unless type_validator.valid?(@type) return false if !@percentage.nil? && @percentage.to_s.length > 10 return true end
[ "def", "valid?", "return", "false", "if", "!", "@catalog_object_id", ".", "nil?", "&&", "@catalog_object_id", ".", "to_s", ".", "length", ">", "192", "return", "false", "if", "!", "@name", ".", "nil?", "&&", "@name", ".", "to_s", ".", "length", ">", "255...
Check to see if the all the properties in the model are valid @return true if the model is valid
[ "Check", "to", "see", "if", "the", "all", "the", "properties", "in", "the", "model", "are", "valid" ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/create_order_request_tax.rb#L116-L123
train
Returns true if the object is valid for the given object ID.
[ 30522, 13366, 9398, 1029, 2709, 6270, 2065, 999, 1030, 12105, 1035, 4874, 1035, 8909, 1012, 9152, 2140, 1029, 1004, 1004, 1030, 12105, 1035, 4874, 1035, 8909, 1012, 2000, 1035, 1055, 1012, 3091, 1028, 17613, 2709, 6270, 2065, 999, 1030, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_triggers.rb
Azure::Logic::Mgmt::V2016_06_01.WorkflowTriggers.list_callback_url_with_http_info
def list_callback_url_with_http_info(resource_group_name, workflow_name, trigger_name, custom_headers:nil) list_callback_url_async(resource_group_name, workflow_name, trigger_name, custom_headers:custom_headers).value! end
ruby
def list_callback_url_with_http_info(resource_group_name, workflow_name, trigger_name, custom_headers:nil) list_callback_url_async(resource_group_name, workflow_name, trigger_name, custom_headers:custom_headers).value! end
[ "def", "list_callback_url_with_http_info", "(", "resource_group_name", ",", "workflow_name", ",", "trigger_name", ",", "custom_headers", ":", "nil", ")", "list_callback_url_async", "(", "resource_group_name", ",", "workflow_name", ",", "trigger_name", ",", "custom_headers",...
Get the callback URL for a workflow trigger. @param resource_group_name [String] The resource group name. @param workflow_name [String] The workflow name. @param trigger_name [String] The workflow trigger name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Get", "the", "callback", "URL", "for", "a", "workflow", "trigger", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_triggers.rb#L611-L613
train
Gets the callback URL for the specified workflow trigger.
[ 30522, 13366, 2862, 1035, 2655, 5963, 1035, 24471, 2140, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2147, 12314, 1035, 2171, 1010, 9495, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb
Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.get_image_region_proposals
def get_image_region_proposals(project_id, image_id, custom_headers:nil) response = get_image_region_proposals_async(project_id, image_id, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_image_region_proposals(project_id, image_id, custom_headers:nil) response = get_image_region_proposals_async(project_id, image_id, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_image_region_proposals", "(", "project_id", ",", "image_id", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_image_region_proposals_async", "(", "project_id", ",", "image_id", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "res...
Get region proposals for an image. Returns empty array if no proposals are found. This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found. @param project_id The project id. @param image_id The image id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ImageRegionProposal] operation results.
[ "Get", "region", "proposals", "for", "an", "image", ".", "Returns", "empty", "array", "if", "no", "proposals", "are", "found", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb#L1919-L1922
train
Gets region proposals for an image.
[ 30522, 13366, 2131, 1035, 3746, 1035, 2555, 1035, 10340, 1006, 2622, 1035, 8909, 1010, 3746, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
seejohnrun/ice_cube
lib/ice_cube/validations/fixed_value.rb
IceCube.Validations::FixedValue.validate_interval_lock
def validate_interval_lock(time, start_time) t0 = starting_unit(start_time) t1 = time.send(type) t0 >= t1 ? t0 - t1 : INTERVALS[type] - t1 + t0 end
ruby
def validate_interval_lock(time, start_time) t0 = starting_unit(start_time) t1 = time.send(type) t0 >= t1 ? t0 - t1 : INTERVALS[type] - t1 + t0 end
[ "def", "validate_interval_lock", "(", "time", ",", "start_time", ")", "t0", "=", "starting_unit", "(", "start_time", ")", "t1", "=", "time", ".", "send", "(", "type", ")", "t0", ">=", "t1", "?", "t0", "-", "t1", ":", "INTERVALS", "[", "type", "]", "-...
Validate if the current time unit matches the same unit from the schedule start time, returning the difference to the interval
[ "Validate", "if", "the", "current", "time", "unit", "matches", "the", "same", "unit", "from", "the", "schedule", "start", "time", "returning", "the", "difference", "to", "the", "interval" ]
fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd
https://github.com/seejohnrun/ice_cube/blob/fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd/lib/ice_cube/validations/fixed_value.rb#L28-L32
train
Validate the interval lock
[ 30522, 13366, 9398, 3686, 1035, 13483, 1035, 5843, 1006, 2051, 1010, 2707, 1035, 2051, 1007, 1056, 2692, 1027, 3225, 1035, 3131, 1006, 2707, 1035, 2051, 1007, 1056, 2487, 1027, 2051, 1012, 4604, 1006, 2828, 1007, 1056, 2692, 1028, 1027, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/nat_gateways.rb
Azure::Network::Mgmt::V2019_02_01.NatGateways.begin_delete
def begin_delete(resource_group_name, nat_gateway_name, custom_headers:nil) response = begin_delete_async(resource_group_name, nat_gateway_name, custom_headers:custom_headers).value! nil end
ruby
def begin_delete(resource_group_name, nat_gateway_name, custom_headers:nil) response = begin_delete_async(resource_group_name, nat_gateway_name, custom_headers:custom_headers).value! nil end
[ "def", "begin_delete", "(", "resource_group_name", ",", "nat_gateway_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_delete_async", "(", "resource_group_name", ",", "nat_gateway_name", ",", "custom_headers", ":custom_headers", ")", ".", "value!", ...
Deletes the specified nat gateway. @param resource_group_name [String] The name of the resource group. @param nat_gateway_name [String] The name of the nat gateway. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Deletes", "the", "specified", "nat", "gateway", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/nat_gateways.rb#L490-L493
train
Deletes a nat gateway.
[ 30522, 13366, 4088, 1035, 3972, 12870, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 14085, 1035, 11909, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 3972, 12870, 1035, 2004, 6038, 2278, 1006, 7692,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_textanalytics/lib/v2.1/generated/azure_cognitiveservices_textanalytics/text_analytics_client.rb
Azure::CognitiveServices::TextAnalytics::V2_1.TextAnalyticsClient.detect_language
def detect_language(show_stats:nil, language_batch_input:nil, custom_headers:nil) response = detect_language_async(show_stats:show_stats, language_batch_input:language_batch_input, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def detect_language(show_stats:nil, language_batch_input:nil, custom_headers:nil) response = detect_language_async(show_stats:show_stats, language_batch_input:language_batch_input, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "detect_language", "(", "show_stats", ":", "nil", ",", "language_batch_input", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "detect_language_async", "(", "show_stats", ":show_stats", ",", "language_batch_input", ":language_batch_input", ...
The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. A total of 120 languages are supported. @param show_stats [Boolean] (optional) if set to true, response will contain input and document level statistics. @param language_batch_input [LanguageBatchInput] Collection of documents to analyze. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [LanguageBatchResult] operation results.
[ "The", "API", "returns", "the", "detected", "language", "and", "a", "numeric", "score", "between", "0", "and", "1", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_textanalytics/lib/v2.1/generated/azure_cognitiveservices_textanalytics/text_analytics_client.rb#L131-L134
train
Detects the language.
[ 30522, 13366, 11487, 1035, 2653, 1006, 2265, 1035, 26319, 1024, 9152, 2140, 30524, 1035, 20346, 2015, 1024, 7661, 1035, 20346, 2015, 1007, 1012, 3643, 999, 3433, 1012, 2303, 4983, 3433, 1012, 9152, 2140, 1029, 2203, 102, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
gocardless/hutch
lib/hutch/cli.rb
Hutch.CLI.start_work_loop
def start_work_loop Hutch.connect @worker = Hutch::Worker.new(Hutch.broker, Hutch.consumers, Hutch::Config.setup_procs) @worker.run :success rescue ConnectionError, AuthenticationError, WorkerSetupError => ex Hutch::Config[:error_handlers].each do |backend| backend.handle_setup_exception(ex) end logger.fatal ex.message :error end
ruby
def start_work_loop Hutch.connect @worker = Hutch::Worker.new(Hutch.broker, Hutch.consumers, Hutch::Config.setup_procs) @worker.run :success rescue ConnectionError, AuthenticationError, WorkerSetupError => ex Hutch::Config[:error_handlers].each do |backend| backend.handle_setup_exception(ex) end logger.fatal ex.message :error end
[ "def", "start_work_loop", "Hutch", ".", "connect", "@worker", "=", "Hutch", "::", "Worker", ".", "new", "(", "Hutch", ".", "broker", ",", "Hutch", ".", "consumers", ",", "Hutch", "::", "Config", ".", "setup_procs", ")", "@worker", ".", "run", ":success", ...
Kick off the work loop. This method returns when the worker is shut down gracefully (with a SIGQUIT, SIGTERM or SIGINT).
[ "Kick", "off", "the", "work", "loop", ".", "This", "method", "returns", "when", "the", "worker", "is", "shut", "down", "gracefully", "(", "with", "a", "SIGQUIT", "SIGTERM", "or", "SIGINT", ")", "." ]
9314b3b8c84abeb78170730757f3eb8ccc4f54c5
https://github.com/gocardless/hutch/blob/9314b3b8c84abeb78170730757f3eb8ccc4f54c5/lib/hutch/cli.rb#L87-L98
train
Start the work loop
[ 30522, 13366, 2707, 1035, 2147, 1035, 7077, 12570, 2818, 1012, 7532, 1030, 7309, 1027, 12570, 2818, 1024, 1024, 7309, 1012, 2047, 1006, 12570, 2818, 1012, 20138, 1010, 12570, 2818, 1012, 10390, 1010, 12570, 2818, 1024, 1024, 9530, 8873, 229...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_machine_learning_services/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/workspaces.rb
Azure::MachineLearningServices::Mgmt::V2018_03_01_preview.Workspaces.create_or_update
def create_or_update(resource_group_name, workspace_name, parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def create_or_update(resource_group_name, workspace_name, parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "create_or_update", "(", "resource_group_name", ",", "workspace_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "create_or_update_async", "(", "resource_group_name", ",", "workspace_name", ",", "parameters", ",", "custom_headers...
Creates or updates a workspace with the specified parameters. @param resource_group_name [String] Name of the resource group in which workspace is located. @param workspace_name [String] Name of Azure Machine Learning workspace. @param parameters [Workspace] The parameters for creating or updating a machine learning workspace. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Workspace] operation results.
[ "Creates", "or", "updates", "a", "workspace", "with", "the", "specified", "parameters", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_machine_learning_services/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/workspaces.rb#L133-L136
train
Creates or updates a managed cluster.
[ 30522, 13366, 3443, 1035, 2030, 1035, 10651, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2573, 15327, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 3443, 1035, 2030, 1035, 10651, 1035, 2004, 6038,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
github/linguist
lib/linguist/classifier.rb
Linguist.Classifier.debug_dump_all_tokens
def debug_dump_all_tokens(tokens, languages) maxlen = tokens.map { |tok| tok.size }.max printf "%#{maxlen}s", "" puts " #" + languages.map { |lang| sprintf("%10s", lang) }.join token_map = Hash.new(0) tokens.each { |tok| token_map[tok] += 1 } token_map.sort.each { |tok, count| arr = languages.map { |lang| [lang, token_probability(tok, lang)] } min = arr.map { |a,b| b }.min minlog = Math.log(min) if !arr.inject(true) { |result, n| result && n[1] == arr[0][1] } printf "%#{maxlen}s%5d", tok, count puts arr.map { |ent| ent[1] == min ? " -" : sprintf("%10.3f", count * (Math.log(ent[1]) - minlog)) }.join end } end
ruby
def debug_dump_all_tokens(tokens, languages) maxlen = tokens.map { |tok| tok.size }.max printf "%#{maxlen}s", "" puts " #" + languages.map { |lang| sprintf("%10s", lang) }.join token_map = Hash.new(0) tokens.each { |tok| token_map[tok] += 1 } token_map.sort.each { |tok, count| arr = languages.map { |lang| [lang, token_probability(tok, lang)] } min = arr.map { |a,b| b }.min minlog = Math.log(min) if !arr.inject(true) { |result, n| result && n[1] == arr[0][1] } printf "%#{maxlen}s%5d", tok, count puts arr.map { |ent| ent[1] == min ? " -" : sprintf("%10.3f", count * (Math.log(ent[1]) - minlog)) }.join end } end
[ "def", "debug_dump_all_tokens", "(", "tokens", ",", "languages", ")", "maxlen", "=", "tokens", ".", "map", "{", "|", "tok", "|", "tok", ".", "size", "}", ".", "max", "printf", "\"%#{maxlen}s\"", ",", "\"\"", "puts", "\" #\"", "+", "languages", ".", "m...
Internal: show a table of probabilities for each <token,language> pair. The number in each table entry is the number of "points" that each token contributes toward the belief that the file under test is a particular language. Points are additive. Points are the number of times a token appears in the file, times how much more likely (log of probability ratio) that token is to appear in one language vs. the least-likely language. Dashes indicate the least-likely language (and zero points) for each token.
[ "Internal", ":", "show", "a", "table", "of", "probabilities", "for", "each", "<token", "language", ">", "pair", "." ]
9116c90fcbb82ac03b4b33c58cfbde1fcf745e99
https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/classifier.rb#L169-L190
train
Dump all tokens and languages
[ 30522, 13366, 2139, 8569, 2290, 1035, 15653, 1035, 2035, 1035, 19204, 2015, 1006, 19204, 2015, 1010, 4155, 1007, 4098, 7770, 1027, 19204, 2015, 1012, 4949, 1063, 1064, 2000, 2243, 1064, 2000, 2243, 1012, 2946, 1065, 1012, 4098, 6140, 2546, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_apis.rb
Azure::ApiManagement::Mgmt::V2016_07_07.ProductApis.remove
def remove(resource_group_name, service_name, product_id, api_id, custom_headers:nil) response = remove_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! nil end
ruby
def remove(resource_group_name, service_name, product_id, api_id, custom_headers:nil) response = remove_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value! nil end
[ "def", "remove", "(", "resource_group_name", ",", "service_name", ",", "product_id", ",", "api_id", ",", "custom_headers", ":", "nil", ")", "response", "=", "remove_async", "(", "resource_group_name", ",", "service_name", ",", "product_id", ",", "api_id", ",", "...
Deletes the specified API from the specified product. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param product_id [String] Product identifier. Must be unique in the current API Management service instance. @param api_id [String] API identifier. Must be unique in the current API Management service instance. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Deletes", "the", "specified", "API", "from", "the", "specified", "product", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/product_apis.rb#L296-L299
train
Remove a product from the list of products.
[ 30522, 13366, 6366, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 4031, 1035, 8909, 1010, 17928, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 6366, 1035, 2004, 6038, 2278, 1006, 7692, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb
Azure::StorSimple8000Series::Mgmt::V2017_06_01.DeviceSettings.update_network_settings_async
def update_network_settings_async(device_name, parameters, resource_group_name, manager_name, custom_headers:nil) # Send request promise = begin_update_network_settings_async(device_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::StorSimple8000Series::Mgmt::V2017_06_01::Models::NetworkSettings.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
ruby
def update_network_settings_async(device_name, parameters, resource_group_name, manager_name, custom_headers:nil) # Send request promise = begin_update_network_settings_async(device_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::StorSimple8000Series::Mgmt::V2017_06_01::Models::NetworkSettings.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
[ "def", "update_network_settings_async", "(", "device_name", ",", "parameters", ",", "resource_group_name", ",", "manager_name", ",", "custom_headers", ":", "nil", ")", "# Send request", "promise", "=", "begin_update_network_settings_async", "(", "device_name", ",", "param...
@param device_name [String] The device name @param parameters [NetworkSettingsPatch] The network settings to be updated. @param resource_group_name [String] The resource group name @param manager_name [String] The manager name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Concurrent::Promise] promise which provides async access to http response.
[ "@param", "device_name", "[", "String", "]", "The", "device", "name", "@param", "parameters", "[", "NetworkSettingsPatch", "]", "The", "network", "settings", "to", "be", "updated", ".", "@param", "resource_group_name", "[", "String", "]", "The", "resource", "gro...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb#L294-L310
train
Updates network settings of the specified device.
[ 30522, 13366, 10651, 1035, 2897, 1035, 10906, 1035, 2004, 6038, 2278, 1006, 5080, 1035, 2171, 1010, 11709, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 3208, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 1001, 4604, 5227, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
tongueroo/jets
lib/jets/controller/rack/adapter.rb
Jets::Controller::Rack.Adapter.adjust_for_elb
def adjust_for_elb(resp) return resp unless from_elb? # ELB requires statusCode to be an Integer whereas API Gateway requires statusCode to be a String status = resp["statusCode"] = resp["statusCode"].to_i # ELB also requires statusDescription attribute status_desc = Rack::Utils::HTTP_STATUS_CODES[status] status_desc = status_desc.nil? ? status.to_s : "#{status} #{status_desc}" resp["statusDescription"] = status_desc resp end
ruby
def adjust_for_elb(resp) return resp unless from_elb? # ELB requires statusCode to be an Integer whereas API Gateway requires statusCode to be a String status = resp["statusCode"] = resp["statusCode"].to_i # ELB also requires statusDescription attribute status_desc = Rack::Utils::HTTP_STATUS_CODES[status] status_desc = status_desc.nil? ? status.to_s : "#{status} #{status_desc}" resp["statusDescription"] = status_desc resp end
[ "def", "adjust_for_elb", "(", "resp", ")", "return", "resp", "unless", "from_elb?", "# ELB requires statusCode to be an Integer whereas API Gateway requires statusCode to be a String", "status", "=", "resp", "[", "\"statusCode\"", "]", "=", "resp", "[", "\"statusCode\"", "]",...
Note: ELB is not officially support. This is just in case users wish to manually connect ELBs to the functions created by Jets.
[ "Note", ":", "ELB", "is", "not", "officially", "support", ".", "This", "is", "just", "in", "case", "users", "wish", "to", "manually", "connect", "ELBs", "to", "the", "functions", "created", "by", "Jets", "." ]
46943a519224067e58aa3e2d5656e3ca083150f9
https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/controller/rack/adapter.rb#L49-L61
train
Adjust the response object for ELB
[ 30522, 13366, 14171, 1035, 2005, 1035, 3449, 2497, 1006, 24501, 2361, 1007, 2709, 24501, 2361, 4983, 2013, 1035, 3449, 2497, 1029, 1001, 3449, 2497, 5942, 3570, 16044, 2000, 2022, 2019, 16109, 6168, 17928, 11909, 5942, 3570, 16044, 2000, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_operations.rb
Azure::SQL::Mgmt::V2017_03_01_preview.DatabaseOperations.cancel_with_http_info
def cancel_with_http_info(resource_group_name, server_name, database_name, operation_id, custom_headers:nil) cancel_async(resource_group_name, server_name, database_name, operation_id, custom_headers:custom_headers).value! end
ruby
def cancel_with_http_info(resource_group_name, server_name, database_name, operation_id, custom_headers:nil) cancel_async(resource_group_name, server_name, database_name, operation_id, custom_headers:custom_headers).value! end
[ "def", "cancel_with_http_info", "(", "resource_group_name", ",", "server_name", ",", "database_name", ",", "operation_id", ",", "custom_headers", ":", "nil", ")", "cancel_async", "(", "resource_group_name", ",", "server_name", ",", "database_name", ",", "operation_id", ...
Cancels the asynchronous operation on the database. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param server_name [String] The name of the server. @param database_name [String] The name of the database. @param operation_id The operation identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Cancels", "the", "asynchronous", "operation", "on", "the", "database", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/database_operations.rb#L59-L61
train
Cancels a database operation.
[ 30522, 13366, 17542, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 8241, 1035, 2171, 1010, 7809, 1035, 2171, 1010, 3169, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 17542, 1035, 2004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.submit_property_batch_with_http_info
def submit_property_batch_with_http_info(name_id, property_batch_description_list, timeout:60, custom_headers:nil) submit_property_batch_async(name_id, property_batch_description_list, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def submit_property_batch_with_http_info(name_id, property_batch_description_list, timeout:60, custom_headers:nil) submit_property_batch_async(name_id, property_batch_description_list, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "submit_property_batch_with_http_info", "(", "name_id", ",", "property_batch_description_list", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "submit_property_batch_async", "(", "name_id", ",", "property_batch_description_list", ",", "timeout", ...
Submits a property batch. Submits a batch of property operations. Either all or none of the operations will be committed. @param name_id [String] The Service Fabric name, without the 'fabric:' URI scheme. @param property_batch_description_list [PropertyBatchDescriptionList] Describes the property batch operations to be submitted. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Submits", "a", "property", "batch", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L27090-L27092
train
Submit a property batch of properties to a given resource group.
[ 30522, 13366, 12040, 1035, 3200, 1035, 14108, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 2171, 1035, 8909, 1010, 3200, 1035, 14108, 1035, 6412, 1035, 2862, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb
Azure::KeyVault::V2016_10_01.KeyVaultClient.get_deleted_secrets_as_lazy_with_http_info
def get_deleted_secrets_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
ruby
def get_deleted_secrets_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil) get_deleted_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value! end
[ "def", "get_deleted_secrets_as_lazy_with_http_info", "(", "vault_base_url", ",", "maxresults", ":", "nil", ",", "custom_headers", ":", "nil", ")", "get_deleted_secrets_as_lazy_async", "(", "vault_base_url", ",", "maxresults", ":", "maxresults", ",", "custom_headers", ":cu...
Lists deleted secrets for the specified vault. The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This operation requires the secrets/list permission. @param vault_base_url [String] The vault name, for example https://myvault.vault.azure.net. @param maxresults [Integer] Maximum number of results to return in a page. If not specified the service will return up to 25 results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Lists", "deleted", "secrets", "for", "the", "specified", "vault", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L10038-L10040
train
Gets the deleted secrets as lazy.
[ 30522, 13366, 2131, 1035, 17159, 1035, 7800, 1035, 2004, 1035, 13971, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 11632, 1035, 2918, 1035, 24471, 2140, 1010, 4098, 6072, 11314, 2015, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 915...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
resque/resque
lib/resque/worker.rb
Resque.Worker.new_kill_child
def new_kill_child if @child unless child_already_exited? if pre_shutdown_timeout && pre_shutdown_timeout > 0.0 log_with_severity :debug, "Waiting #{pre_shutdown_timeout.to_f}s for child process to exit" return if wait_for_child_exit(pre_shutdown_timeout) end log_with_severity :debug, "Sending TERM signal to child #{@child}" Process.kill("TERM", @child) if wait_for_child_exit(term_timeout) return else log_with_severity :debug, "Sending KILL signal to child #{@child}" Process.kill("KILL", @child) end else log_with_severity :debug, "Child #{@child} already quit." end end rescue SystemCallError log_with_severity :error, "Child #{@child} already quit and reaped." end
ruby
def new_kill_child if @child unless child_already_exited? if pre_shutdown_timeout && pre_shutdown_timeout > 0.0 log_with_severity :debug, "Waiting #{pre_shutdown_timeout.to_f}s for child process to exit" return if wait_for_child_exit(pre_shutdown_timeout) end log_with_severity :debug, "Sending TERM signal to child #{@child}" Process.kill("TERM", @child) if wait_for_child_exit(term_timeout) return else log_with_severity :debug, "Sending KILL signal to child #{@child}" Process.kill("KILL", @child) end else log_with_severity :debug, "Child #{@child} already quit." end end rescue SystemCallError log_with_severity :error, "Child #{@child} already quit and reaped." end
[ "def", "new_kill_child", "if", "@child", "unless", "child_already_exited?", "if", "pre_shutdown_timeout", "&&", "pre_shutdown_timeout", ">", "0.0", "log_with_severity", ":debug", ",", "\"Waiting #{pre_shutdown_timeout.to_f}s for child process to exit\"", "return", "if", "wait_for...
Kills the forked child immediately with minimal remorse. The job it is processing will not be completed. Send the child a TERM signal, wait <term_timeout> seconds, and then a KILL signal if it has not quit If pre_shutdown_timeout has been set to a positive number, it will allow the child that many seconds before sending the aforementioned TERM and KILL.
[ "Kills", "the", "forked", "child", "immediately", "with", "minimal", "remorse", ".", "The", "job", "it", "is", "processing", "will", "not", "be", "completed", ".", "Send", "the", "child", "a", "TERM", "signal", "wait", "<term_timeout", ">", "seconds", "and",...
adb633a0f6b98b1eb5a5a85bb36ebac9309978fd
https://github.com/resque/resque/blob/adb633a0f6b98b1eb5a5a85bb36ebac9309978fd/lib/resque/worker.rb#L527-L550
train
This method is called when a child process is being killed.
[ 30522, 13366, 2047, 1035, 3102, 1035, 2775, 2065, 1030, 2775, 4983, 2775, 1035, 2525, 1035, 15284, 1029, 2065, 3653, 1035, 3844, 7698, 1035, 2051, 5833, 1004, 1004, 3653, 1035, 3844, 7698, 1035, 2051, 5833, 1028, 1014, 1012, 1014, 8833, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
cloudfoundry/bosh
src/bosh-director/lib/bosh/director/agent_client.rb
Bosh::Director.AgentClient.inject_compile_log
def inject_compile_log(response) if response['value'] && response['value'].is_a?(Hash) && response['value']['result'].is_a?(Hash) && blob_id = response['value']['result']['compile_log_id'] compile_log = download_and_delete_blob(blob_id) response['value']['result']['compile_log'] = compile_log end end
ruby
def inject_compile_log(response) if response['value'] && response['value'].is_a?(Hash) && response['value']['result'].is_a?(Hash) && blob_id = response['value']['result']['compile_log_id'] compile_log = download_and_delete_blob(blob_id) response['value']['result']['compile_log'] = compile_log end end
[ "def", "inject_compile_log", "(", "response", ")", "if", "response", "[", "'value'", "]", "&&", "response", "[", "'value'", "]", ".", "is_a?", "(", "Hash", ")", "&&", "response", "[", "'value'", "]", "[", "'result'", "]", ".", "is_a?", "(", "Hash", ")"...
the blob is removed from the blobstore once we have fetched it, but if there is a crash before it is injected into the response and then logged, there is a chance that we lose it
[ "the", "blob", "is", "removed", "from", "the", "blobstore", "once", "we", "have", "fetched", "it", "but", "if", "there", "is", "a", "crash", "before", "it", "is", "injected", "into", "the", "response", "and", "then", "logged", "there", "is", "a", "chance...
2eaa7100879ddd20cd909cd698514746195e28b7
https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/agent_client.rb#L311-L318
train
injects compile log into the response
[ 30522, 13366, 1999, 20614, 1035, 4012, 22090, 1035, 8833, 1006, 3433, 1007, 2065, 3433, 1031, 1005, 3643, 1005, 1033, 1004, 1004, 3433, 1031, 1005, 3643, 1005, 1033, 1012, 2003, 1035, 1037, 1029, 1006, 23325, 1007, 1004, 1004, 3433, 1031, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/express_route_ports.rb
Azure::Network::Mgmt::V2019_02_01.ExpressRoutePorts.begin_delete
def begin_delete(resource_group_name, express_route_port_name, custom_headers:nil) response = begin_delete_async(resource_group_name, express_route_port_name, custom_headers:custom_headers).value! nil end
ruby
def begin_delete(resource_group_name, express_route_port_name, custom_headers:nil) response = begin_delete_async(resource_group_name, express_route_port_name, custom_headers:custom_headers).value! nil end
[ "def", "begin_delete", "(", "resource_group_name", ",", "express_route_port_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_delete_async", "(", "resource_group_name", ",", "express_route_port_name", ",", "custom_headers", ":custom_headers", ")", "."...
Deletes the specified ExpressRoutePort resource. @param resource_group_name [String] The name of the resource group. @param express_route_port_name [String] The name of the ExpressRoutePort resource. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Deletes", "the", "specified", "ExpressRoutePort", "resource", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/express_route_ports.rb#L434-L437
train
Deletes the specified ExpressRoutePort.
[ 30522, 13366, 4088, 1035, 3972, 12870, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4671, 1035, 2799, 1035, 3417, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 3972, 12870, 1035, 2004, 6038, 2278, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
watir/watir
lib/watir/window.rb
Watir.Window.resize_to
def resize_to(width, height) Selenium::WebDriver::Dimension.new(Integer(width), Integer(height)).tap do |dimension| use { @driver.manage.window.size = dimension } end end
ruby
def resize_to(width, height) Selenium::WebDriver::Dimension.new(Integer(width), Integer(height)).tap do |dimension| use { @driver.manage.window.size = dimension } end end
[ "def", "resize_to", "(", "width", ",", "height", ")", "Selenium", "::", "WebDriver", "::", "Dimension", ".", "new", "(", "Integer", "(", "width", ")", ",", "Integer", "(", "height", ")", ")", ".", "tap", "do", "|", "dimension", "|", "use", "{", "@dri...
Resizes window to given width and height. @example browser.window.resize_to 1600, 1200 @param [Integer] width @param [Integer] height
[ "Resizes", "window", "to", "given", "width", "and", "height", "." ]
2d8db09811c6221ae401b85b2f61f5fa66e463a3
https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/window.rb#L63-L67
train
Resize the current window to the specified width and height.
[ 30522, 13366, 24501, 4697, 1035, 2000, 1006, 9381, 1010, 4578, 1007, 7367, 7770, 5007, 1024, 1024, 4773, 23663, 2099, 1024, 1024, 9812, 1012, 2047, 1006, 16109, 1006, 9381, 1007, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb
Azure::KeyVault::V2016_10_01.KeyVaultClient.update_certificate_operation
def update_certificate_operation(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil) response = update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def update_certificate_operation(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil) response = update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "update_certificate_operation", "(", "vault_base_url", ",", "certificate_name", ",", "cancellation_requested", ",", "custom_headers", ":", "nil", ")", "response", "=", "update_certificate_operation_async", "(", "vault_base_url", ",", "certificate_name", ",", "cancell...
Updates a certificate operation. Updates a certificate creation operation that is already in progress. This operation requires the certificates/update permission. @param vault_base_url [String] The vault name, for example https://myvault.vault.azure.net. @param certificate_name [String] The name of the certificate. @param cancellation_requested [Boolean] Indicates if cancellation was requested on the certificate operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [CertificateOperation] operation results.
[ "Updates", "a", "certificate", "operation", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L6054-L6057
train
Updates the certificate operation.
[ 30522, 13366, 10651, 1035, 8196, 1035, 3169, 1006, 11632, 1035, 2918, 1035, 24471, 2140, 1010, 8196, 1035, 2171, 1010, 16990, 1035, 7303, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 10651, 1035, 8196, 1035, 3169, 1035...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.cancel_repair_task
def cancel_repair_task(repair_task_cancel_description, custom_headers:nil) response = cancel_repair_task_async(repair_task_cancel_description, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def cancel_repair_task(repair_task_cancel_description, custom_headers:nil) response = cancel_repair_task_async(repair_task_cancel_description, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "cancel_repair_task", "(", "repair_task_cancel_description", ",", "custom_headers", ":", "nil", ")", "response", "=", "cancel_repair_task_async", "(", "repair_task_cancel_description", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "...
Requests the cancellation of the given repair task. This API supports the Service Fabric platform; it is not meant to be used directly from your code. @param repair_task_cancel_description [RepairTaskCancelDescription] Describes the repair task to be cancelled. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [RepairTaskUpdateInfo] operation results.
[ "Requests", "the", "cancellation", "of", "the", "given", "repair", "task", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L13776-L13779
train
Cancels a repair task.
[ 30522, 13366, 17542, 1035, 7192, 1035, 4708, 1006, 7192, 1035, 4708, 1035, 17542, 1035, 6412, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 17542, 1035, 7192, 1035, 4708, 1035, 2004, 6038, 2278, 1006, 7192, 1035, 4708, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
watir/watir
lib/watir/legacy_wait.rb
Watir.EventuallyPresent.when_enabled
def when_enabled(timeout = nil) msg = '#when_enabled' repl_msg = 'wait_until(&:enabled?)' Watir.logger.deprecate msg, repl_msg, ids: [:when_enabled] timeout ||= Watir.default_timeout message = "waiting for #{selector_string} to become enabled" if block_given? Wait.until(timeout, message) { enabled? } yield self else WhenEnabledDecorator.new(self, timeout, message) end end
ruby
def when_enabled(timeout = nil) msg = '#when_enabled' repl_msg = 'wait_until(&:enabled?)' Watir.logger.deprecate msg, repl_msg, ids: [:when_enabled] timeout ||= Watir.default_timeout message = "waiting for #{selector_string} to become enabled" if block_given? Wait.until(timeout, message) { enabled? } yield self else WhenEnabledDecorator.new(self, timeout, message) end end
[ "def", "when_enabled", "(", "timeout", "=", "nil", ")", "msg", "=", "'#when_enabled'", "repl_msg", "=", "'wait_until(&:enabled?)'", "Watir", ".", "logger", ".", "deprecate", "msg", ",", "repl_msg", ",", "ids", ":", "[", ":when_enabled", "]", "timeout", "||=", ...
Waits until the element is enabled. @example browser.button(name: "new_user_button_2").when_enabled.click @param [Integer] timeout seconds to wait before timing out @see Watir::Wait @see Watir::Element#enabled?
[ "Waits", "until", "the", "element", "is", "enabled", "." ]
2d8db09811c6221ae401b85b2f61f5fa66e463a3
https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/legacy_wait.rb#L107-L121
train
Returns the result of the when_enabled decorator.
[ 30522, 13366, 2043, 1035, 9124, 1006, 2051, 5833, 1027, 9152, 2140, 1007, 5796, 2290, 1027, 1005, 1001, 2043, 1035, 9124, 1005, 16360, 2140, 1035, 5796, 2290, 1027, 1005, 3524, 1035, 2127, 1006, 1004, 1024, 9124, 1029, 1007, 1005, 28194, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...