repo stringclasses 237 values | path stringlengths 11 168 | func_name stringlengths 10 147 | original_string stringlengths 79 124k | language stringclasses 1 value | code stringlengths 79 124k | code_tokens listlengths 16 45.3k | docstring stringlengths 4 23.5k | docstring_tokens listlengths 1 452 | sha stringclasses 237 values | url stringlengths 95 268 | partition stringclasses 1 value | summary stringlengths 8 229 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
puppetlabs/pdk | lib/pdk/answer_file.rb | PDK.AnswerFile.update! | def update!(new_answers = {})
unless new_answers.is_a?(Hash)
raise PDK::CLI::FatalError, _('Answer file can be updated only with a Hash')
end
answers.merge!(new_answers)
save_to_disk
end | ruby | def update!(new_answers = {})
unless new_answers.is_a?(Hash)
raise PDK::CLI::FatalError, _('Answer file can be updated only with a Hash')
end
answers.merge!(new_answers)
save_to_disk
end | [
"def",
"update!",
"(",
"new_answers",
"=",
"{",
"}",
")",
"unless",
"new_answers",
".",
"is_a?",
"(",
"Hash",
")",
"raise",
"PDK",
"::",
"CLI",
"::",
"FatalError",
",",
"_",
"(",
"'Answer file can be updated only with a Hash'",
")",
"end",
"answers",
".",
"m... | Update the stored answers in memory and then save them to disk.
@param new_answers [Hash{String => Object}] The new questions and answers
to be merged into the existing answers.
@raise [PDK::CLI::FatalError] if the new answers are not provided as
a Hash.
@raise (see #save_to_disk) | [
"Update",
"the",
"stored",
"answers",
"in",
"memory",
"and",
"then",
"save",
"them",
"to",
"disk",
"."
] | 0d864aff62ffef04b5104addf399d0476afd71e7 | https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/answer_file.rb#L57-L65 | train | Updates the answers hash | [
30522,
13366,
10651,
999,
1006,
2047,
1035,
6998,
1027,
1063,
1065,
1007,
4983,
2047,
1035,
6998,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
5333,
22851,
2243,
1024,
1024,
18856,
2072,
1024,
1024,
10611,
2121,
29165,
1010,
1035,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-sns/lib/aws-sdk-sns/resource.rb | Aws::SNS.Resource.create_topic | def create_topic(options = {})
resp = @client.create_topic(options)
Topic.new(
arn: resp.data.topic_arn,
client: @client
)
end | ruby | def create_topic(options = {})
resp = @client.create_topic(options)
Topic.new(
arn: resp.data.topic_arn,
client: @client
)
end | [
"def",
"create_topic",
"(",
"options",
"=",
"{",
"}",
")",
"resp",
"=",
"@client",
".",
"create_topic",
"(",
"options",
")",
"Topic",
".",
"new",
"(",
"arn",
":",
"resp",
".",
"data",
".",
"topic_arn",
",",
"client",
":",
"@client",
")",
"end"
] | @example Request syntax with placeholder values
topic = sns.create_topic({
name: "topicName", # required
attributes: {
"attributeName" => "attributeValue",
},
tags: [
{
key: "TagKey", # required
value: "TagValue", # required
},
],
})
@param [Hash] options ({})
@option options [required, String] :name
The name of the topic you want to create.
Constraints: Topic names must be made up of only uppercase and
lowercase ASCII letters, numbers, underscores, and hyphens, and must
be between 1 and 256 characters long.
@option options [Hash<String,String>] :attributes
A map of attributes with their corresponding values.
The following lists the names, descriptions, and values of the special
request parameters that the `CreateTopic` action uses:
* `DeliveryPolicy` – The policy that defines how Amazon SNS retries
failed deliveries to HTTP/S endpoints.
* `DisplayName` – The display name to use for a topic with SMS
subscriptions.
* `Policy` – The policy that defines who can access your topic. By
default, only the topic owner can publish or subscribe to the topic.
The following attribute applies only to [server-side-encryption][1]\:
* `KmsMasterKeyId` - The ID of an AWS-managed customer master key
(CMK) for Amazon SNS or a custom CMK. For more information, see [Key
Terms][2]. For more examples, see [KeyId][3] in the *AWS Key
Management Service API Reference*.
^
[1]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html
[2]: https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms
[3]: https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
@option options [Array<Types::Tag>] :tags
The list of tags to add to a new topic.
@return [Topic] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-sns/lib/aws-sdk-sns/resource.rb#L110-L116 | train | Create a topic | [
30522,
13366,
3443,
1035,
8476,
1006,
7047,
1027,
1063,
1065,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3443,
1035,
8476,
1006,
7047,
1007,
8476,
1012,
2047,
1006,
12098,
2078,
1024,
24501,
2361,
1012,
2951,
1012,
8476,
1035,
12098,
2078,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/2017-06-01-preview/generated/azure_mgmt_container_registry/replications.rb | Azure::ContainerRegistry::Mgmt::V2017_06_01_preview.Replications.create | def create(resource_group_name, registry_name, replication_name, replication, custom_headers:nil)
response = create_async(resource_group_name, registry_name, replication_name, replication, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create(resource_group_name, registry_name, replication_name, replication, custom_headers:nil)
response = create_async(resource_group_name, registry_name, replication_name, replication, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create",
"(",
"resource_group_name",
",",
"registry_name",
",",
"replication_name",
",",
"replication",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"replication_name",
",",
"... | Creates a replication 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 replication_name [String] The name of the replication.
@param replication [Replication] The parameters for creating a replication.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Replication] operation results. | [
"Creates",
"a",
"replication",
"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/2017-06-01-preview/generated/azure_mgmt_container_registry/replications.rb#L142-L145 | train | Creates a new cluster replication. | [
30522,
13366,
3443,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
21647,
1035,
2171,
1010,
21647,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/overcommit | lib/overcommit/configuration.rb | Overcommit.Configuration.all_plugin_hook_configs | def all_plugin_hook_configs
hook_configs = {}
Overcommit::Utils.supported_hook_types.each do |hook_type|
hook_type_class_name = Overcommit::Utils.camel_case(hook_type)
directory = File.join(plugin_directory, hook_type.tr('-', '_'))
plugin_paths = Dir[File.join(directory, '*.rb')].sort
hook_names = plugin_paths.map do |path|
Overcommit::Utils.camel_case(File.basename(path, '.rb'))
end
hook_configs[hook_type_class_name] = Hash[
hook_names.map do |hook_name|
[hook_name, for_hook(hook_name, Overcommit::Utils.camel_case(hook_type))]
end
]
end
hook_configs
end | ruby | def all_plugin_hook_configs
hook_configs = {}
Overcommit::Utils.supported_hook_types.each do |hook_type|
hook_type_class_name = Overcommit::Utils.camel_case(hook_type)
directory = File.join(plugin_directory, hook_type.tr('-', '_'))
plugin_paths = Dir[File.join(directory, '*.rb')].sort
hook_names = plugin_paths.map do |path|
Overcommit::Utils.camel_case(File.basename(path, '.rb'))
end
hook_configs[hook_type_class_name] = Hash[
hook_names.map do |hook_name|
[hook_name, for_hook(hook_name, Overcommit::Utils.camel_case(hook_type))]
end
]
end
hook_configs
end | [
"def",
"all_plugin_hook_configs",
"hook_configs",
"=",
"{",
"}",
"Overcommit",
"::",
"Utils",
".",
"supported_hook_types",
".",
"each",
"do",
"|",
"hook_type",
"|",
"hook_type_class_name",
"=",
"Overcommit",
"::",
"Utils",
".",
"camel_case",
"(",
"hook_type",
")",... | Returns configuration for all plugin hooks in each hook type.
@return [Hash] | [
"Returns",
"configuration",
"for",
"all",
"plugin",
"hooks",
"in",
"each",
"hook",
"type",
"."
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/configuration.rb#L91-L112 | train | Returns a Hash of all hook configs | [
30522,
13366,
2035,
1035,
13354,
2378,
1035,
8103,
1035,
9530,
8873,
5620,
8103,
1035,
9530,
8873,
5620,
1027,
1063,
1065,
2058,
9006,
22930,
1024,
1024,
21183,
12146,
1012,
3569,
1035,
8103,
1035,
4127,
1012,
2169,
2079,
1064,
8103,
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... |
troessner/reek | samples/smelly_source/inline.rb | Inline.C.build | def build
so_name = self.so_name
so_exists = File.file? so_name
unless so_exists and File.mtime(rb_file) < File.mtime(so_name) then
unless File.directory? Inline.directory then
warn "NOTE: creating #{Inline.directory} for RubyInline" if $DEBUG
Dir.mkdir Inline.directory, 0700
end
src_name = "#{Inline.directory}/#{module_name}.c"
old_src_name = "#{src_name}.old"
should_compare = File.write_with_backup(src_name) do |io|
if @include_ruby_first
@inc.unshift "#include \"ruby.h\""
else
@inc.push "#include \"ruby.h\""
end
io.puts
io.puts @inc.join("\n")
io.puts
io.puts @src.join("\n\n")
io.puts
io.puts
io.puts "#ifdef __cplusplus"
io.puts "extern \"C\" {"
io.puts "#endif"
io.puts " __declspec(dllexport)" if WINDOZE
io.puts " void Init_#{module_name}() {"
io.puts " VALUE c = rb_cObject;"
# TODO: use rb_class2path
# io.puts " VALUE c = rb_path2class(#{@mod.name.inspect});"
io.puts @mod.name.split("::").map { |n|
" c = rb_const_get(c,rb_intern(\"#{n}\"));"
}.join("\n")
@sig.keys.sort.each do |name|
arity, singleton, method_name = @sig[name]
if singleton then
io.print " rb_define_singleton_method(c, \"#{method_name}\", "
else
io.print " rb_define_method(c, \"#{method_name}\", "
end
io.puts "(VALUE(*)(ANYARGS))#{name}, #{arity});"
end
io.puts @init_extra.join("\n") unless @init_extra.empty?
io.puts
io.puts " }"
io.puts "#ifdef __cplusplus"
io.puts "}"
io.puts "#endif"
io.puts
end
# recompile only if the files are different
recompile = true
if so_exists and should_compare and
FileUtils.compare_file(old_src_name, src_name) then
recompile = false
# Updates the timestamps on all the generated/compiled files.
# Prevents us from entering this conditional unless the source
# file changes again.
t = Time.now
File.utime(t, t, src_name, old_src_name, so_name)
end
if recompile then
hdrdir = %w(srcdir archdir rubyhdrdir).map { |name|
Config::CONFIG[name]
}.find { |dir|
dir and File.exist? File.join(dir, "/ruby.h")
} or abort "ERROR: Can't find header dir for ruby. Exiting..."
flags = @flags.join(' ')
libs = @libs.join(' ')
config_hdrdir = if RUBY_VERSION > '1.9' then
"-I #{File.join hdrdir, RbConfig::CONFIG['arch']}"
else
nil
end
cmd = [ Config::CONFIG['LDSHARED'],
flags,
Config::CONFIG['CCDLFLAGS'],
Config::CONFIG['CFLAGS'],
'-I', hdrdir,
config_hdrdir,
'-I', Config::CONFIG['includedir'],
"-L#{Config::CONFIG['libdir']}",
'-o', so_name.inspect,
File.expand_path(src_name).inspect,
libs,
crap_for_windoze ].join(' ')
# TODO: remove after osx 10.5.2
cmd += ' -flat_namespace -undefined suppress' if
RUBY_PLATFORM =~ /darwin9\.[01]/
cmd += " 2> #{DEV_NULL}" if $TESTING and not $DEBUG
warn "Building #{so_name} with '#{cmd}'" if $DEBUG
result = `#{cmd}`
warn "Output:\n#{result}" if $DEBUG
if $? != 0 then
bad_src_name = src_name + ".bad"
File.rename src_name, bad_src_name
raise CompilationError, "error executing #{cmd.inspect}: #{$?}\nRenamed #{src_name} to #{bad_src_name}"
end
# NOTE: manifest embedding is only required when using VC8 ruby
# build or compiler.
# Errors from this point should be ignored if Config::CONFIG['arch']
# (RUBY_PLATFORM) matches 'i386-mswin32_80'
if WINDOZE and RUBY_PLATFORM =~ /_80$/ then
Dir.chdir Inline.directory do
cmd = "mt /manifest lib.so.manifest /outputresource:so.dll;#2"
warn "Embedding manifest with '#{cmd}'" if $DEBUG
result = `#{cmd}`
warn "Output:\n#{result}" if $DEBUG
if $? != 0 then
raise CompilationError, "error executing #{cmd}: #{$?}"
end
end
end
warn "Built successfully" if $DEBUG
end
else
warn "#{so_name} is up to date" if $DEBUG
end # unless (file is out of date)
end | ruby | def build
so_name = self.so_name
so_exists = File.file? so_name
unless so_exists and File.mtime(rb_file) < File.mtime(so_name) then
unless File.directory? Inline.directory then
warn "NOTE: creating #{Inline.directory} for RubyInline" if $DEBUG
Dir.mkdir Inline.directory, 0700
end
src_name = "#{Inline.directory}/#{module_name}.c"
old_src_name = "#{src_name}.old"
should_compare = File.write_with_backup(src_name) do |io|
if @include_ruby_first
@inc.unshift "#include \"ruby.h\""
else
@inc.push "#include \"ruby.h\""
end
io.puts
io.puts @inc.join("\n")
io.puts
io.puts @src.join("\n\n")
io.puts
io.puts
io.puts "#ifdef __cplusplus"
io.puts "extern \"C\" {"
io.puts "#endif"
io.puts " __declspec(dllexport)" if WINDOZE
io.puts " void Init_#{module_name}() {"
io.puts " VALUE c = rb_cObject;"
# TODO: use rb_class2path
# io.puts " VALUE c = rb_path2class(#{@mod.name.inspect});"
io.puts @mod.name.split("::").map { |n|
" c = rb_const_get(c,rb_intern(\"#{n}\"));"
}.join("\n")
@sig.keys.sort.each do |name|
arity, singleton, method_name = @sig[name]
if singleton then
io.print " rb_define_singleton_method(c, \"#{method_name}\", "
else
io.print " rb_define_method(c, \"#{method_name}\", "
end
io.puts "(VALUE(*)(ANYARGS))#{name}, #{arity});"
end
io.puts @init_extra.join("\n") unless @init_extra.empty?
io.puts
io.puts " }"
io.puts "#ifdef __cplusplus"
io.puts "}"
io.puts "#endif"
io.puts
end
# recompile only if the files are different
recompile = true
if so_exists and should_compare and
FileUtils.compare_file(old_src_name, src_name) then
recompile = false
# Updates the timestamps on all the generated/compiled files.
# Prevents us from entering this conditional unless the source
# file changes again.
t = Time.now
File.utime(t, t, src_name, old_src_name, so_name)
end
if recompile then
hdrdir = %w(srcdir archdir rubyhdrdir).map { |name|
Config::CONFIG[name]
}.find { |dir|
dir and File.exist? File.join(dir, "/ruby.h")
} or abort "ERROR: Can't find header dir for ruby. Exiting..."
flags = @flags.join(' ')
libs = @libs.join(' ')
config_hdrdir = if RUBY_VERSION > '1.9' then
"-I #{File.join hdrdir, RbConfig::CONFIG['arch']}"
else
nil
end
cmd = [ Config::CONFIG['LDSHARED'],
flags,
Config::CONFIG['CCDLFLAGS'],
Config::CONFIG['CFLAGS'],
'-I', hdrdir,
config_hdrdir,
'-I', Config::CONFIG['includedir'],
"-L#{Config::CONFIG['libdir']}",
'-o', so_name.inspect,
File.expand_path(src_name).inspect,
libs,
crap_for_windoze ].join(' ')
# TODO: remove after osx 10.5.2
cmd += ' -flat_namespace -undefined suppress' if
RUBY_PLATFORM =~ /darwin9\.[01]/
cmd += " 2> #{DEV_NULL}" if $TESTING and not $DEBUG
warn "Building #{so_name} with '#{cmd}'" if $DEBUG
result = `#{cmd}`
warn "Output:\n#{result}" if $DEBUG
if $? != 0 then
bad_src_name = src_name + ".bad"
File.rename src_name, bad_src_name
raise CompilationError, "error executing #{cmd.inspect}: #{$?}\nRenamed #{src_name} to #{bad_src_name}"
end
# NOTE: manifest embedding is only required when using VC8 ruby
# build or compiler.
# Errors from this point should be ignored if Config::CONFIG['arch']
# (RUBY_PLATFORM) matches 'i386-mswin32_80'
if WINDOZE and RUBY_PLATFORM =~ /_80$/ then
Dir.chdir Inline.directory do
cmd = "mt /manifest lib.so.manifest /outputresource:so.dll;#2"
warn "Embedding manifest with '#{cmd}'" if $DEBUG
result = `#{cmd}`
warn "Output:\n#{result}" if $DEBUG
if $? != 0 then
raise CompilationError, "error executing #{cmd}: #{$?}"
end
end
end
warn "Built successfully" if $DEBUG
end
else
warn "#{so_name} is up to date" if $DEBUG
end # unless (file is out of date)
end | [
"def",
"build",
"so_name",
"=",
"self",
".",
"so_name",
"so_exists",
"=",
"File",
".",
"file?",
"so_name",
"unless",
"so_exists",
"and",
"File",
".",
"mtime",
"(",
"rb_file",
")",
"<",
"File",
".",
"mtime",
"(",
"so_name",
")",
"then",
"unless",
"File",
... | Builds the source file, if needed, and attempts to compile it. | [
"Builds",
"the",
"source",
"file",
"if",
"needed",
"and",
"attempts",
"to",
"compile",
"it",
"."
] | 8c6b5c0c6228a6981ab48543457889f9ea984054 | https://github.com/troessner/reek/blob/8c6b5c0c6228a6981ab48543457889f9ea984054/samples/smelly_source/inline.rb#L338-L474 | train | Build the RubyInline object | [
30522,
13366,
3857,
2061,
1035,
2171,
1027,
2969,
1012,
2061,
1035,
2171,
2061,
1035,
6526,
1027,
5371,
1012,
5371,
1029,
2061,
1035,
2171,
4983,
2061,
1035,
6526,
1998,
5371,
1012,
11047,
14428,
1006,
21144,
1035,
5371,
1007,
1026,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/pdk | lib/pdk/util.rb | PDK.Util.module_root | def module_root
metadata_path = find_upwards('metadata.json')
if metadata_path
File.dirname(metadata_path)
elsif in_module_root?
Dir.pwd
else
nil
end
end | ruby | def module_root
metadata_path = find_upwards('metadata.json')
if metadata_path
File.dirname(metadata_path)
elsif in_module_root?
Dir.pwd
else
nil
end
end | [
"def",
"module_root",
"metadata_path",
"=",
"find_upwards",
"(",
"'metadata.json'",
")",
"if",
"metadata_path",
"File",
".",
"dirname",
"(",
"metadata_path",
")",
"elsif",
"in_module_root?",
"Dir",
".",
"pwd",
"else",
"nil",
"end",
"end"
] | Returns path to the root of the module being worked on.
@return [String, nil] Fully qualified base path to module, or nil if
the current working dir does not appear to be within a module. | [
"Returns",
"path",
"to",
"the",
"root",
"of",
"the",
"module",
"being",
"worked",
"on",
"."
] | 0d864aff62ffef04b5104addf399d0476afd71e7 | https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/util.rb#L113-L122 | train | Returns the root of the module. | [
30522,
13366,
11336,
1035,
7117,
27425,
1035,
4130,
1027,
2424,
1035,
14873,
1006,
1005,
27425,
1012,
1046,
3385,
1005,
1007,
2065,
27425,
1035,
4130,
5371,
1012,
16101,
18442,
1006,
27425,
1035,
4130,
1007,
3449,
5332,
2546,
1999,
1035,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_cognitive_services/lib/2017-04-18/generated/azure_mgmt_cognitive_services/check_sku_availability.rb | Azure::CognitiveServices::Mgmt::V2017_04_18.CheckSkuAvailability.list_with_http_info | def list_with_http_info(location, skus, kind, type, custom_headers:nil)
list_async(location, skus, kind, type, custom_headers:custom_headers).value!
end | ruby | def list_with_http_info(location, skus, kind, type, custom_headers:nil)
list_async(location, skus, kind, type, custom_headers:custom_headers).value!
end | [
"def",
"list_with_http_info",
"(",
"location",
",",
"skus",
",",
"kind",
",",
"type",
",",
"custom_headers",
":",
"nil",
")",
"list_async",
"(",
"location",
",",
"skus",
",",
"kind",
",",
"type",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Check available SKUs.
@param location [String] Resource location.
@param skus [Array<String>] The SKU of the resource.
@param kind [String] The Kind of the resource.
@param type [String] The Type of the resource.
@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. | [
"Check",
"available",
"SKUs",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cognitive_services/lib/2017-04-18/generated/azure_mgmt_cognitive_services/check_sku_availability.rb#L53-L55 | train | Gets the list of the available VulnerabilityAssessment documents. | [
30522,
13366,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
3295,
1010,
15315,
2271,
1010,
2785,
1010,
2828,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
1035,
2004,
6038,
2278,
1006,
3295,
1010,
15315,
2271,
1010,
2785,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-ec2/lib/aws-sdk-ec2/resource.rb | Aws::EC2.Resource.register_image | def register_image(options = {})
resp = @client.register_image(options)
Image.new(
id: resp.data.image_id,
client: @client
)
end | ruby | def register_image(options = {})
resp = @client.register_image(options)
Image.new(
id: resp.data.image_id,
client: @client
)
end | [
"def",
"register_image",
"(",
"options",
"=",
"{",
"}",
")",
"resp",
"=",
"@client",
".",
"register_image",
"(",
"options",
")",
"Image",
".",
"new",
"(",
"id",
":",
"resp",
".",
"data",
".",
"image_id",
",",
"client",
":",
"@client",
")",
"end"
] | @example Request syntax with placeholder values
image = ec2.register_image({
image_location: "String",
architecture: "i386", # accepts i386, x86_64, arm64
block_device_mappings: [
{
device_name: "String",
virtual_name: "String",
ebs: {
delete_on_termination: false,
iops: 1,
snapshot_id: "String",
volume_size: 1,
volume_type: "standard", # accepts standard, io1, gp2, sc1, st1
encrypted: false,
kms_key_id: "String",
},
no_device: "String",
},
],
description: "String",
dry_run: false,
ena_support: false,
kernel_id: "String",
name: "String", # required
billing_products: ["String"],
ramdisk_id: "String",
root_device_name: "String",
sriov_net_support: "String",
virtualization_type: "String",
})
@param [Hash] options ({})
@option options [String] :image_location
The full path to your AMI manifest in Amazon S3 storage.
@option options [String] :architecture
The architecture of the AMI.
Default: For Amazon EBS-backed AMIs, `i386`. For instance store-backed
AMIs, the architecture specified in the manifest file.
@option options [Array<Types::BlockDeviceMapping>] :block_device_mappings
The block device mapping entries.
@option options [String] :description
A description for your AMI.
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@option options [Boolean] :ena_support
Set to `true` to enable enhanced networking with ENA for the AMI and
any instances that you launch from the AMI.
This option is supported only for HVM AMIs. Specifying this option
with a PV AMI can make instances launched from the AMI unreachable.
@option options [String] :kernel_id
The ID of the kernel.
@option options [required, String] :name
A name for your AMI.
Constraints: 3-128 alphanumeric characters, parentheses (()), square
brackets (\[\]), spaces ( ), periods (.), slashes (/), dashes (-),
single quotes ('), at-signs (@), or underscores(\_)
@option options [Array<String>] :billing_products
The billing product codes. Your account must be authorized to specify
billing product codes. Otherwise, you can use the AWS Marketplace to
bill for the use of an AMI.
@option options [String] :ramdisk_id
The ID of the RAM disk.
@option options [String] :root_device_name
The device name of the root device volume (for example, `/dev/sda1`).
@option options [String] :sriov_net_support
Set to `simple` to enable enhanced networking with the Intel 82599
Virtual Function interface for the AMI and any instances that you
launch from the AMI.
There is no way to disable `sriovNetSupport` at this time.
This option is supported only for HVM AMIs. Specifying this option
with a PV AMI can make instances launched from the AMI unreachable.
@option options [String] :virtualization_type
The type of virtualization (`hvm` \| `paravirtual`).
Default: `paravirtual`
@return [Image] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/resource.rb#L1186-L1192 | train | Register an image with the specified options. | [
30522,
13366,
4236,
1035,
3746,
1006,
7047,
1027,
1063,
1065,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
4236,
1035,
3746,
1006,
7047,
1007,
3746,
1012,
2047,
1006,
8909,
1024,
24501,
2361,
1012,
2951,
1012,
3746,
1035,
8909,
1010,
7396,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_batch/lib/2017-09-01/generated/azure_mgmt_batch/certificate_operations.rb | Azure::Batch::Mgmt::V2017_09_01.CertificateOperations.cancel_deletion | def cancel_deletion(resource_group_name, account_name, certificate_name, custom_headers:nil)
response = cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def cancel_deletion(resource_group_name, account_name, certificate_name, custom_headers:nil)
response = cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"cancel_deletion",
"(",
"resource_group_name",
",",
"account_name",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"cancel_deletion_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"certificate_name",
",",
"custom_h... | Cancels a failed deletion of a certificate from the specified account.
If you try to delete a certificate that is being used by a pool or compute
node, the status of the certificate changes to deleteFailed. If you decide
that you want to continue using the certificate, you can use this operation
to set the status of the certificate back to active. If you intend to delete
the certificate, you do not need to run this operation after the deletion
failed. You must make sure that the certificate is not being used by any
resources, and then you can try again to delete the certificate.
@param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param certificate_name [String] The identifier for the certificate. This
must be made up of algorithm and thumbprint separated by a dash, and must
match the certificate data in the request. For example SHA1-a3d1c5.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Certificate] operation results. | [
"Cancels",
"a",
"failed",
"deletion",
"of",
"a",
"certificate",
"from",
"the",
"specified",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/certificate_operations.rb#L528-L531 | train | Cancels deletion of a certificate. | [
30522,
13366,
17542,
1035,
3972,
20624,
2239,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
8196,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
17542,
1035,
3972,
20624,
2239,
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 | management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb | Azure::ApiManagement::Mgmt::V2016_10_10.ApiManagementServices.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"parameters",
",",
"custom_headers",
":custom_head... | Updates an existing API Management service.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param parameters [ApiManagementServiceUpdateParameters] Parameters supplied
to the CreateOrUpdate API Management service 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. | [
"Updates",
"an",
"existing",
"API",
"Management",
"service",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb#L1474-L1476 | train | Updates a service s covering specification. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
10651,
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/cookies.rb | Watir.Cookies.to_a | def to_a
@control.all_cookies.map do |e|
e.merge(expires: e[:expires] ? e[:expires].to_time : nil)
end
end | ruby | def to_a
@control.all_cookies.map do |e|
e.merge(expires: e[:expires] ? e[:expires].to_time : nil)
end
end | [
"def",
"to_a",
"@control",
".",
"all_cookies",
".",
"map",
"do",
"|",
"e",
"|",
"e",
".",
"merge",
"(",
"expires",
":",
"e",
"[",
":expires",
"]",
"?",
"e",
"[",
":expires",
"]",
".",
"to_time",
":",
"nil",
")",
"end",
"end"
] | Returns array of cookies.
@example
browser.cookies.to_a
#=> {:name=>"my_session", :value=>"BAh7B0kiD3Nlc3Npb25faWQGOgZFRkk", :domain=>"mysite.com"}
@return [Array<Hash>] | [
"Returns",
"array",
"of",
"cookies",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/cookies.rb#L19-L23 | train | Returns a list of all the cookies that are in the cache | [
30522,
13366,
2000,
1035,
1037,
1030,
2491,
1012,
2035,
1035,
16324,
1012,
4949,
2079,
1064,
1041,
1064,
1041,
1012,
13590,
1006,
4654,
20781,
2015,
1024,
1041,
1031,
1024,
4654,
20781,
2015,
1033,
1029,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/scss-lint | lib/scss_lint/selector_visitor.rb | SCSSLint.SelectorVisitor.selector_node_name | def selector_node_name(node)
if node.class.class_variable_defined?(:@@snake_case_name)
return node.class.class_variable_get(:@@snake_case_name)
end
rindex = node.class.name.rindex('::')
name = node.class.name[(rindex + 2)..-1]
name.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
name.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
name.downcase!
node.class.class_variable_set(:@@snake_case_name, name)
end | ruby | def selector_node_name(node)
if node.class.class_variable_defined?(:@@snake_case_name)
return node.class.class_variable_get(:@@snake_case_name)
end
rindex = node.class.name.rindex('::')
name = node.class.name[(rindex + 2)..-1]
name.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
name.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
name.downcase!
node.class.class_variable_set(:@@snake_case_name, name)
end | [
"def",
"selector_node_name",
"(",
"node",
")",
"if",
"node",
".",
"class",
".",
"class_variable_defined?",
"(",
":@@snake_case_name",
")",
"return",
"node",
".",
"class",
".",
"class_variable_get",
"(",
":@@snake_case_name",
")",
"end",
"rindex",
"=",
"node",
".... | The class name of a node, in snake_case form, e.g.
`Sass::Selector::SimpleSequence` -> `simple_sequence`.
The name is memoized as a class variable on the node itself. | [
"The",
"class",
"name",
"of",
"a",
"node",
"in",
"snake_case",
"form",
"e",
".",
"g",
".",
"Sass",
"::",
"Selector",
"::",
"SimpleSequence",
"-",
">",
"simple_sequence",
"."
] | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/selector_visitor.rb#L29-L40 | train | Returns the name of the given node. | [
30522,
13366,
27000,
1035,
13045,
1035,
2171,
1006,
13045,
1007,
2065,
13045,
1012,
2465,
1012,
2465,
1035,
8023,
1035,
4225,
1029,
1006,
1024,
1030,
1030,
7488,
1035,
2553,
1035,
2171,
1007,
2709,
13045,
1012,
2465,
1012,
2465,
1035,
8023,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/nats_rpc.rb | Bosh::Director.NatsRpc.subscribe_inbox | def subscribe_inbox
# double-check locking to reduce synchronization
if @subject_id.nil?
# nats lazy-load needs to be outside the synchronized block
client = nats
@lock.synchronize do
if @subject_id.nil?
@subject_id = client.subscribe("#{@inbox_name}.>") do |message, _, subject|
@handled_response = true
handle_response(message, subject)
end
end
end
end
end | ruby | def subscribe_inbox
# double-check locking to reduce synchronization
if @subject_id.nil?
# nats lazy-load needs to be outside the synchronized block
client = nats
@lock.synchronize do
if @subject_id.nil?
@subject_id = client.subscribe("#{@inbox_name}.>") do |message, _, subject|
@handled_response = true
handle_response(message, subject)
end
end
end
end
end | [
"def",
"subscribe_inbox",
"# double-check locking to reduce synchronization",
"if",
"@subject_id",
".",
"nil?",
"# nats lazy-load needs to be outside the synchronized block",
"client",
"=",
"nats",
"@lock",
".",
"synchronize",
"do",
"if",
"@subject_id",
".",
"nil?",
"@subject_i... | subscribe to an inbox, if not already subscribed | [
"subscribe",
"to",
"an",
"inbox",
"if",
"not",
"already",
"subscribed"
] | 2eaa7100879ddd20cd909cd698514746195e28b7 | https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/nats_rpc.rb#L114-L128 | train | Subscribe to the inbox | [
30522,
13366,
4942,
29234,
1035,
1999,
8758,
1001,
3313,
1011,
4638,
14889,
2000,
5547,
26351,
8093,
10698,
9276,
2065,
1030,
3395,
1035,
8909,
1012,
9152,
2140,
1029,
1001,
14085,
2015,
13971,
1011,
7170,
3791,
2000,
2022,
2648,
1996,
2554... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_custom_entity_role_with_http_info | def delete_custom_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
delete_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end | ruby | def delete_custom_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
delete_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end | [
"def",
"delete_custom_entity_role_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"delete_custom_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
... | Delete a role for a given prebuilt entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity ID.
@param role_id The entity role Id.
@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. | [
"Delete",
"a",
"role",
"for",
"a",
"given",
"prebuilt",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L11196-L11198 | train | Deletes a role from an existing entity. | [
30522,
13366,
3972,
12870,
1035,
7661,
1035,
9178,
1035,
2535,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
7661,
1035,
20346,
30524,
9178,
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... |
alexreisner/geocoder | lib/geocoder/calculations.rb | Geocoder.Calculations.endpoint | def endpoint(start, heading, distance, options = {})
radius = earth_radius(options[:units])
start = extract_coordinates(start)
# convert degrees to radians
start = to_radians(start)
lat = start[0]
lon = start[1]
heading = to_radians(heading)
distance = distance.to_f
end_lat = Math.asin(Math.sin(lat)*Math.cos(distance/radius) +
Math.cos(lat)*Math.sin(distance/radius)*Math.cos(heading))
end_lon = lon+Math.atan2(Math.sin(heading)*Math.sin(distance/radius)*Math.cos(lat),
Math.cos(distance/radius)-Math.sin(lat)*Math.sin(end_lat))
to_degrees [end_lat, end_lon]
end | ruby | def endpoint(start, heading, distance, options = {})
radius = earth_radius(options[:units])
start = extract_coordinates(start)
# convert degrees to radians
start = to_radians(start)
lat = start[0]
lon = start[1]
heading = to_radians(heading)
distance = distance.to_f
end_lat = Math.asin(Math.sin(lat)*Math.cos(distance/radius) +
Math.cos(lat)*Math.sin(distance/radius)*Math.cos(heading))
end_lon = lon+Math.atan2(Math.sin(heading)*Math.sin(distance/radius)*Math.cos(lat),
Math.cos(distance/radius)-Math.sin(lat)*Math.sin(end_lat))
to_degrees [end_lat, end_lon]
end | [
"def",
"endpoint",
"(",
"start",
",",
"heading",
",",
"distance",
",",
"options",
"=",
"{",
"}",
")",
"radius",
"=",
"earth_radius",
"(",
"options",
"[",
":units",
"]",
")",
"start",
"=",
"extract_coordinates",
"(",
"start",
")",
"# convert degrees to radian... | Given a start point, heading (in degrees), and distance, provides
an endpoint.
The starting point is given in the same way that points are given to all
Geocoder methods that accept points as arguments. It can be:
* an array of coordinates ([lat,lon])
* a geocodable address (string)
* a geocoded object (one which implements a +to_coordinates+ method
which returns a [lat,lon] array | [
"Given",
"a",
"start",
"point",
"heading",
"(",
"in",
"degrees",
")",
"and",
"distance",
"provides",
"an",
"endpoint",
".",
"The",
"starting",
"point",
"is",
"given",
"in",
"the",
"same",
"way",
"that",
"points",
"are",
"given",
"to",
"all",
"Geocoder",
... | e087dc2759264ee6f307b926bb2de4ec2406859e | https://github.com/alexreisner/geocoder/blob/e087dc2759264ee6f307b926bb2de4ec2406859e/lib/geocoder/calculations.rb#L269-L289 | train | Returns the endpoint of the given start and heading | [
30522,
13366,
2203,
8400,
1006,
2707,
1010,
5825,
1010,
3292,
1010,
7047,
1027,
1063,
1065,
1007,
12177,
1027,
3011,
1035,
12177,
1006,
7047,
1031,
1024,
3197,
1033,
1007,
2707,
1027,
14817,
1035,
12093,
1006,
2707,
1007,
1001,
10463,
5445,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | railties/lib/rails/source_annotation_extractor.rb | Rails.SourceAnnotationExtractor.find | def find(dirs)
dirs.inject({}) { |h, dir| h.update(find_in(dir)) }
end | ruby | def find(dirs)
dirs.inject({}) { |h, dir| h.update(find_in(dir)) }
end | [
"def",
"find",
"(",
"dirs",
")",
"dirs",
".",
"inject",
"(",
"{",
"}",
")",
"{",
"|",
"h",
",",
"dir",
"|",
"h",
".",
"update",
"(",
"find_in",
"(",
"dir",
")",
")",
"}",
"end"
] | Returns a hash that maps filenames under +dirs+ (recursively) to arrays
with their annotations. | [
"Returns",
"a",
"hash",
"that",
"maps",
"filenames",
"under",
"+",
"dirs",
"+",
"(",
"recursively",
")",
"to",
"arrays",
"with",
"their",
"annotations",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/railties/lib/rails/source_annotation_extractor.rb#L105-L107 | train | Find the first file in the given directories. | [
30522,
13366,
2424,
1006,
16101,
2015,
1007,
16101,
2015,
1012,
1999,
20614,
1006,
1063,
1065,
1007,
1063,
1064,
1044,
1010,
16101,
1064,
1044,
1012,
10651,
1006,
2424,
1035,
1999,
1006,
16101,
1007,
1007,
1065,
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... |
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.update_worker_pool_with_http_info | def update_worker_pool_with_http_info(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
end | ruby | def update_worker_pool_with_http_info(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
end | [
"def",
"update_worker_pool_with_http_info",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"worker_pool_envelope",
",",
"custom_headers",
":",
"nil",
")",
"update_worker_pool_async",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
... | Create or update a worker pool.
Create or update 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 worker_pool_envelope [WorkerPoolResource] Properties of the worker
pool.
@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. | [
"Create",
"or",
"update",
"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#L3332-L3334 | train | Updates a worker pool. | [
30522,
13366,
10651,
1035,
7309,
1035,
4770,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7309,
1035,
4770,
1035,
2171,
1010,
7309,
1035,
4770,
1035,
11255,
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... |
vcr/vcr | lib/vcr/configuration.rb | VCR.Configuration.around_http_request | def around_http_request(*filters, &block)
unless VCR.fibers_available?
raise Errors::NotSupportedError.new \
"VCR::Configuration#around_http_request requires fibers, " +
"which are not available on your ruby intepreter."
end
fibers = {}
fiber_errors = {}
hook_allowed, hook_declaration = false, caller.first
before_http_request(*filters) do |request|
hook_allowed = true
start_new_fiber_for(request, fibers, fiber_errors, hook_declaration, block)
end
after_http_request(lambda { hook_allowed }) do |request, response|
fiber = fibers.delete(Thread.current)
resume_fiber(fiber, fiber_errors, response, hook_declaration)
end
end | ruby | def around_http_request(*filters, &block)
unless VCR.fibers_available?
raise Errors::NotSupportedError.new \
"VCR::Configuration#around_http_request requires fibers, " +
"which are not available on your ruby intepreter."
end
fibers = {}
fiber_errors = {}
hook_allowed, hook_declaration = false, caller.first
before_http_request(*filters) do |request|
hook_allowed = true
start_new_fiber_for(request, fibers, fiber_errors, hook_declaration, block)
end
after_http_request(lambda { hook_allowed }) do |request, response|
fiber = fibers.delete(Thread.current)
resume_fiber(fiber, fiber_errors, response, hook_declaration)
end
end | [
"def",
"around_http_request",
"(",
"*",
"filters",
",",
"&",
"block",
")",
"unless",
"VCR",
".",
"fibers_available?",
"raise",
"Errors",
"::",
"NotSupportedError",
".",
"new",
"\"VCR::Configuration#around_http_request requires fibers, \"",
"+",
"\"which are not available on... | Adds a callback that will be executed around each HTTP request.
@example
VCR.configure do |c|
c.around_http_request(lambda {|r| r.uri =~ /api.geocoder.com/}) do |request|
# extract an address like "1700 E Pine St, Seattle, WA"
# from a query like "address=1700+E+Pine+St%2C+Seattle%2C+WA"
address = CGI.unescape(URI(request.uri).query.split('=').last)
VCR.use_cassette("geocoding/#{address}", &request)
end
end
@yield the callback
@yieldparam request [VCR::Request::FiberAware] the request that is being made
@raise [VCR::Errors::NotSupportedError] if the fiber library cannot be loaded.
@param filters [optional splat of #to_proc] one or more filters to apply.
The objects provided will be converted to procs using `#to_proc`. If provided,
the callback will only be invoked if these procs all return `true`.
@note This method can only be used on ruby interpreters that support
fibers (i.e. 1.9+). On 1.8 you can use separate `before_http_request` and
`after_http_request` hooks.
@note You _must_ call `request.proceed` or pass the request as a proc on to a
method that yields to a block (i.e. `some_method(&request)`).
@see #before_http_request
@see #after_http_request | [
"Adds",
"a",
"callback",
"that",
"will",
"be",
"executed",
"around",
"each",
"HTTP",
"request",
"."
] | 945ca793a4b25c7ffc406b9fd7da1e94cbbb8141 | https://github.com/vcr/vcr/blob/945ca793a4b25c7ffc406b9fd7da1e94cbbb8141/lib/vcr/configuration.rb#L395-L414 | train | A wrapper around the HTTP request. | [
30522,
13366,
2105,
1035,
8299,
1035,
5227,
1006,
1008,
17736,
1010,
1004,
3796,
1007,
4983,
18315,
2099,
1012,
16662,
1035,
2800,
1029,
5333,
10697,
1024,
1024,
2025,
6342,
9397,
15613,
2121,
29165,
1012,
2047,
1032,
1000,
18315,
2099,
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 | management/azure_mgmt_compute/lib/2018-09-30/generated/azure_mgmt_compute/disks.rb | Azure::Compute::Mgmt::V2018_09_30.Disks.create_or_update_async | def create_or_update_async(resource_group_name, disk_name, disk, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Compute::Mgmt::V2018_09_30::Models::Disk.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 create_or_update_async(resource_group_name, disk_name, disk, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Compute::Mgmt::V2018_09_30::Models::Disk.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",
"create_or_update_async",
"(",
"resource_group_name",
",",
"disk_name",
",",
"disk",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"disk_name",
",",
"disk",
",",
"custo... | @param resource_group_name [String] The name of the resource group.
@param disk_name [String] The name of the managed disk that is being created.
The name can't be changed after the disk is created. Supported characters for
the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param disk [Disk] Disk object supplied in the body of the Put disk
operation.
@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",
"disk_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"managed",
"disk",
"that",
"is",
"being",
"created",
".",
"The",
"name",
"can"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-09-30/generated/azure_mgmt_compute/disks.rb#L56-L72 | train | Creates or updates a disk in the specified resource group. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9785,
1035,
2171,
1010,
9785,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
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... |
puppetlabs/puppet | lib/puppet/functions.rb | Puppet::Functions.DispatcherBuilder.block_param | def block_param(*type_and_name)
case type_and_name.size
when 0
type = @all_callables
name = :block
when 1
type = @all_callables
name = type_and_name[0]
when 2
type, name = type_and_name
type = Puppet::Pops::Types::TypeParser.singleton.parse(type, loader) unless type.is_a?(Puppet::Pops::Types::PAnyType)
else
raise ArgumentError, _("block_param accepts max 2 arguments (type, name), got %{size}.") % { size: type_and_name.size }
end
unless Puppet::Pops::Types::TypeCalculator.is_kind_of_callable?(type, false)
raise ArgumentError, _("Expected PCallableType or PVariantType thereof, got %{type_class}") % { type_class: type.class }
end
unless name.is_a?(Symbol)
raise ArgumentError, _("Expected block_param name to be a Symbol, got %{name_class}") % { name_class: name.class }
end
if @block_type.nil?
@block_type = type
@block_name = name
else
raise ArgumentError, _('Attempt to redefine block')
end
end | ruby | def block_param(*type_and_name)
case type_and_name.size
when 0
type = @all_callables
name = :block
when 1
type = @all_callables
name = type_and_name[0]
when 2
type, name = type_and_name
type = Puppet::Pops::Types::TypeParser.singleton.parse(type, loader) unless type.is_a?(Puppet::Pops::Types::PAnyType)
else
raise ArgumentError, _("block_param accepts max 2 arguments (type, name), got %{size}.") % { size: type_and_name.size }
end
unless Puppet::Pops::Types::TypeCalculator.is_kind_of_callable?(type, false)
raise ArgumentError, _("Expected PCallableType or PVariantType thereof, got %{type_class}") % { type_class: type.class }
end
unless name.is_a?(Symbol)
raise ArgumentError, _("Expected block_param name to be a Symbol, got %{name_class}") % { name_class: name.class }
end
if @block_type.nil?
@block_type = type
@block_name = name
else
raise ArgumentError, _('Attempt to redefine block')
end
end | [
"def",
"block_param",
"(",
"*",
"type_and_name",
")",
"case",
"type_and_name",
".",
"size",
"when",
"0",
"type",
"=",
"@all_callables",
"name",
"=",
":block",
"when",
"1",
"type",
"=",
"@all_callables",
"name",
"=",
"type_and_name",
"[",
"0",
"]",
"when",
... | Defines one required block parameter that may appear last. If type and name is missing the
default type is "Callable", and the name is "block". If only one
parameter is given, then that is the name and the type is "Callable".
@api public | [
"Defines",
"one",
"required",
"block",
"parameter",
"that",
"may",
"appear",
"last",
".",
"If",
"type",
"and",
"name",
"is",
"missing",
"the",
"default",
"type",
"is",
"Callable",
"and",
"the",
"name",
"is",
"block",
".",
"If",
"only",
"one",
"parameter",
... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/functions.rb#L473-L502 | train | Returns the block parameter for the given type and name. | [
30522,
13366,
3796,
1035,
11498,
2213,
1006,
1008,
2828,
1035,
1998,
1035,
2171,
1007,
2553,
2828,
1035,
1998,
1035,
2171,
1012,
2946,
2043,
1014,
2828,
1027,
1030,
2035,
1035,
2655,
3085,
2015,
2171,
1027,
1024,
3796,
2043,
1015,
2828,
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... |
piotrmurach/github | lib/github_api/client/repos/deployments.rb | Github.Client::Repos::Deployments.create_status | def create_status(*args)
arguments(args, required: [:user, :repo, :id]) do
assert_required %w[ state ]
permit VALID_STATUS_OPTIONS
end
params = arguments.params
params['accept'] ||= PREVIEW_MEDIA
post_request("repos/#{arguments.user}/#{arguments.repo}/deployments/#{arguments.id}/statuses", params)
end | ruby | def create_status(*args)
arguments(args, required: [:user, :repo, :id]) do
assert_required %w[ state ]
permit VALID_STATUS_OPTIONS
end
params = arguments.params
params['accept'] ||= PREVIEW_MEDIA
post_request("repos/#{arguments.user}/#{arguments.repo}/deployments/#{arguments.id}/statuses", params)
end | [
"def",
"create_status",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
",",
":id",
"]",
")",
"do",
"assert_required",
"%w[",
"state",
"]",
"permit",
"VALID_STATUS_OPTIONS",
"end",
"params",
"=",
"argument... | Create a deployment status
@param [Hash] params
@option params [String] :id
Required string. Id of the deployment being referenced.
@option params [String] :state
Required string. State of the deployment. Can be one of:
pending, success, error, or failure.
@option params [String] :target_url
Optional string. The URL associated with the status.
@option params [String] :description
Optional string. A short description of the status.
@example
github = Github.new
github.repos.deployments.create_status 'user-name', 'repo-name', DEPLOYMENT_ID, state: '...'
@api public | [
"Create",
"a",
"deployment",
"status"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/repos/deployments.rb#L127-L136 | train | Create a status of a deployment | [
30522,
13366,
3443,
1035,
3570,
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,
20865,
1035,
3223,
1003,
1059,
1031,
2110,
1033,
9146,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
GetStream/stream-rails | lib/stream_rails/utils/view_helpers.rb | StreamRails.ViewHelpers.render_activities | def render_activities(activities, options = {})
activities.map { |activity| Renderable.render(activity, self, options.dup) }.join.html_safe
end | ruby | def render_activities(activities, options = {})
activities.map { |activity| Renderable.render(activity, self, options.dup) }.join.html_safe
end | [
"def",
"render_activities",
"(",
"activities",
",",
"options",
"=",
"{",
"}",
")",
"activities",
".",
"map",
"{",
"|",
"activity",
"|",
"Renderable",
".",
"render",
"(",
"activity",
",",
"self",
",",
"options",
".",
"dup",
")",
"}",
".",
"join",
".",
... | View helper for rendering many activities | [
"View",
"helper",
"for",
"rendering",
"many",
"activities"
] | 8ffa4f144169f1f31465c83f0401bad473630994 | https://github.com/GetStream/stream-rails/blob/8ffa4f144169f1f31465c83f0401bad473630994/lib/stream_rails/utils/view_helpers.rb#L11-L13 | train | Renders the given list of activities. | [
30522,
13366,
17552,
1035,
3450,
1006,
3450,
1010,
7047,
1027,
1063,
1065,
1007,
3450,
1012,
4949,
1063,
1064,
4023,
1064,
17552,
3085,
1012,
17552,
1006,
4023,
1010,
2969,
1010,
7047,
1012,
4241,
2361,
1007,
1065,
1012,
3693,
1012,
16129,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/channel.rb | Discordrb.Channel.create_group | def create_group(user_ids)
raise 'Attempted to create group channel on a non-pm channel!' unless pm?
response = API::Channel.create_group(@bot.token, @id, user_ids.shift)
channel = Channel.new(JSON.parse(response), @bot)
channel.add_group_users(user_ids)
end | ruby | def create_group(user_ids)
raise 'Attempted to create group channel on a non-pm channel!' unless pm?
response = API::Channel.create_group(@bot.token, @id, user_ids.shift)
channel = Channel.new(JSON.parse(response), @bot)
channel.add_group_users(user_ids)
end | [
"def",
"create_group",
"(",
"user_ids",
")",
"raise",
"'Attempted to create group channel on a non-pm channel!'",
"unless",
"pm?",
"response",
"=",
"API",
"::",
"Channel",
".",
"create_group",
"(",
"@bot",
".",
"token",
",",
"@id",
",",
"user_ids",
".",
"shift",
"... | Creates a Group channel
@param user_ids [Array<Integer>] Array of user IDs to add to the new group channel (Excluding
the recipient of the PM channel).
@return [Channel] the created channel. | [
"Creates",
"a",
"Group",
"channel"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/channel.rb#L653-L659 | train | Creates a group channel on this channel. | [
30522,
13366,
3443,
1035,
2177,
1006,
5310,
1035,
8909,
2015,
1007,
5333,
1005,
4692,
2000,
3443,
2177,
3149,
2006,
1037,
2512,
1011,
7610,
3149,
999,
1005,
4983,
7610,
1029,
3433,
1027,
17928,
1024,
1024,
3149,
1012,
3443,
1035,
2177,
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... |
david942j/one_gadget | lib/one_gadget/helper.rb | OneGadget.Helper.url_request | def url_request(url)
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = ::OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
raise ArgumentError, "Fail to get response of #{url}" unless %w[200 302].include?(response.code)
response.code == '302' ? response['location'] : response.body
rescue NoMethodError, SocketError, ArgumentError => e
OneGadget::Logger.error(e.message)
nil
end | ruby | def url_request(url)
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = ::OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
raise ArgumentError, "Fail to get response of #{url}" unless %w[200 302].include?(response.code)
response.code == '302' ? response['location'] : response.body
rescue NoMethodError, SocketError, ArgumentError => e
OneGadget::Logger.error(e.message)
nil
end | [
"def",
"url_request",
"(",
"url",
")",
"uri",
"=",
"URI",
".",
"parse",
"(",
"url",
")",
"http",
"=",
"Net",
"::",
"HTTP",
".",
"new",
"(",
"uri",
".",
"host",
",",
"uri",
".",
"port",
")",
"http",
".",
"use_ssl",
"=",
"true",
"http",
".",
"ver... | Get request.
@param [String] url The url.
@return [String]
The request response body.
If the response is +302 Found+, returns the location in header. | [
"Get",
"request",
"."
] | ff6ef04541e83441bfe3c2664a6febd1640f4263 | https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/helper.rb#L173-L188 | train | Get the response of a URL | [
30522,
13366,
24471,
2140,
1035,
5227,
1006,
24471,
2140,
1007,
24471,
2072,
1027,
24471,
2072,
1012,
11968,
3366,
1006,
24471,
2140,
1007,
8299,
1027,
5658,
1024,
1024,
8299,
1012,
2047,
1006,
24471,
2072,
1012,
3677,
1010,
24471,
2072,
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... |
puppetlabs/bolt | lib/bolt/pal.rb | Bolt.PAL.in_bolt_compiler | def in_bolt_compiler
r = Puppet::Pal.in_tmp_environment('bolt', modulepath: @modulepath, facts: {}) do |pal|
pal.with_script_compiler do |compiler|
alias_types(compiler)
begin
Puppet.override(yaml_plan_instantiator: Bolt::PAL::YamlPlan::Loader) do
yield compiler
end
rescue Bolt::Error => e
e
rescue Puppet::PreformattedError => e
PALError.from_preformatted_error(e)
rescue StandardError => e
PALError.from_preformatted_error(e)
end
end
end
# Plans may return PuppetError but nothing should be throwing them
if r.is_a?(StandardError) && !r.is_a?(Bolt::PuppetError)
raise r
end
r
end | ruby | def in_bolt_compiler
r = Puppet::Pal.in_tmp_environment('bolt', modulepath: @modulepath, facts: {}) do |pal|
pal.with_script_compiler do |compiler|
alias_types(compiler)
begin
Puppet.override(yaml_plan_instantiator: Bolt::PAL::YamlPlan::Loader) do
yield compiler
end
rescue Bolt::Error => e
e
rescue Puppet::PreformattedError => e
PALError.from_preformatted_error(e)
rescue StandardError => e
PALError.from_preformatted_error(e)
end
end
end
# Plans may return PuppetError but nothing should be throwing them
if r.is_a?(StandardError) && !r.is_a?(Bolt::PuppetError)
raise r
end
r
end | [
"def",
"in_bolt_compiler",
"r",
"=",
"Puppet",
"::",
"Pal",
".",
"in_tmp_environment",
"(",
"'bolt'",
",",
"modulepath",
":",
"@modulepath",
",",
"facts",
":",
"{",
"}",
")",
"do",
"|",
"pal",
"|",
"pal",
".",
"with_script_compiler",
"do",
"|",
"compiler",... | Runs a block in a PAL script compiler configured for Bolt. Catches
exceptions thrown by the block and re-raises them ensuring they are
Bolt::Errors since the script compiler block will squash all exceptions. | [
"Runs",
"a",
"block",
"in",
"a",
"PAL",
"script",
"compiler",
"configured",
"for",
"Bolt",
".",
"Catches",
"exceptions",
"thrown",
"by",
"the",
"block",
"and",
"re",
"-",
"raises",
"them",
"ensuring",
"they",
"are",
"Bolt",
"::",
"Errors",
"since",
"the",
... | 50689a33699939d262ea7c822a4b24fd8c4f8d8a | https://github.com/puppetlabs/bolt/blob/50689a33699939d262ea7c822a4b24fd8c4f8d8a/lib/bolt/pal.rb#L106-L129 | train | Returns the result of the in_bolt_compiler method. | [
30522,
13366,
1999,
1035,
10053,
1035,
21624,
1054,
1027,
13997,
1024,
1024,
14412,
1012,
1999,
1035,
1056,
8737,
1035,
4044,
1006,
1005,
10053,
1005,
1010,
11336,
15069,
1024,
1030,
11336,
15069,
1010,
8866,
1024,
1063,
1065,
1007,
2079,
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_compute/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machines.rb | Azure::Compute::Mgmt::V2017_12_01.VirtualMachines.instance_view | def instance_view(resource_group_name, vm_name, custom_headers:nil)
response = instance_view_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def instance_view(resource_group_name, vm_name, custom_headers:nil)
response = instance_view_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"instance_view",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"instance_view_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
... | Retrieves information about the run-time state of a virtual machine.
@param resource_group_name [String] The name of the resource group.
@param vm_name [String] The name of the virtual machine.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VirtualMachineInstanceView] operation results. | [
"Retrieves",
"information",
"about",
"the",
"run",
"-",
"time",
"state",
"of",
"a",
"virtual",
"machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machines.rb#L509-L512 | train | Gets the index of the virtual machine in a resource group. | [
30522,
13366,
6013,
1035,
3193,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
6013,
1035,
3193,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
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... |
deivid-rodriguez/byebug | lib/byebug/interface.rb | Byebug.Interface.read_input | def read_input(prompt, save_hist = true)
line = prepare_input(prompt)
return unless line
history.push(line) if save_hist
command_queue.concat(split_commands(line))
command_queue.shift
end | ruby | def read_input(prompt, save_hist = true)
line = prepare_input(prompt)
return unless line
history.push(line) if save_hist
command_queue.concat(split_commands(line))
command_queue.shift
end | [
"def",
"read_input",
"(",
"prompt",
",",
"save_hist",
"=",
"true",
")",
"line",
"=",
"prepare_input",
"(",
"prompt",
")",
"return",
"unless",
"line",
"history",
".",
"push",
"(",
"line",
")",
"if",
"save_hist",
"command_queue",
".",
"concat",
"(",
"split_c... | Reads a new line from the interface's input stream, parses it into
commands and saves it to history.
@return [String] Representing something to be run by the debugger. | [
"Reads",
"a",
"new",
"line",
"from",
"the",
"interface",
"s",
"input",
"stream",
"parses",
"it",
"into",
"commands",
"and",
"saves",
"it",
"to",
"history",
"."
] | bf41a63858a648baa7fb621600d6451786d1572a | https://github.com/deivid-rodriguez/byebug/blob/bf41a63858a648baa7fb621600d6451786d1572a/lib/byebug/interface.rb#L54-L62 | train | Read input from the command line | [
30522,
13366,
3191,
1035,
7953,
1006,
25732,
1010,
3828,
1035,
2010,
2102,
1027,
2995,
1007,
2240,
1027,
7374,
1035,
7953,
1006,
25732,
1007,
2709,
4983,
2240,
2381,
1012,
5245,
1006,
2240,
1007,
2065,
3828,
1035,
2010,
2102,
3094,
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... |
magnusvk/counter_culture | lib/counter_culture/counter.rb | CounterCulture.Counter.first_level_relation_foreign_key | def first_level_relation_foreign_key
first_relation = relation.first if relation.is_a?(Enumerable)
relation_reflect(first_relation).foreign_key
end | ruby | def first_level_relation_foreign_key
first_relation = relation.first if relation.is_a?(Enumerable)
relation_reflect(first_relation).foreign_key
end | [
"def",
"first_level_relation_foreign_key",
"first_relation",
"=",
"relation",
".",
"first",
"if",
"relation",
".",
"is_a?",
"(",
"Enumerable",
")",
"relation_reflect",
"(",
"first_relation",
")",
".",
"foreign_key",
"end"
] | gets the foreign key name of the relation. will look at the first
level only -- i.e., if passed an array will consider only its
first element
relation: a symbol or array of symbols; specifies the relation
that has the counter cache column | [
"gets",
"the",
"foreign",
"key",
"name",
"of",
"the",
"relation",
".",
"will",
"look",
"at",
"the",
"first",
"level",
"only",
"--",
"i",
".",
"e",
".",
"if",
"passed",
"an",
"array",
"will",
"consider",
"only",
"its",
"first",
"element"
] | 6b5bd4d6e1ee4f10f262ace7cfed5776af9520ba | https://github.com/magnusvk/counter_culture/blob/6b5bd4d6e1ee4f10f262ace7cfed5776af9520ba/lib/counter_culture/counter.rb#L264-L267 | train | Returns the foreign key of the first level relation | [
30522,
13366,
2034,
1035,
2504,
1035,
7189,
1035,
3097,
1035,
3145,
2034,
1035,
7189,
1027,
7189,
1012,
2034,
2065,
7189,
1012,
2003,
1035,
1037,
1029,
1006,
4372,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_create_or_update | def begin_create_or_update(resource_group_name, snapshot_name, snapshot, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, snapshot_name, snapshot, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create_or_update(resource_group_name, snapshot_name, snapshot, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, snapshot_name, snapshot, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create_or_update",
"(",
"resource_group_name",
",",
"snapshot_name",
",",
"snapshot",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"snapshot_name",
",",
"snapshot",
",",
"custom_h... | Creates or updates 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 snapshot [Snapshot] Snapshot object supplied in the body of the Put
disk operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Snapshot] operation results. | [
"Creates",
"or",
"updates",
"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#L542-L545 | train | Creates or updates a snapshot. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
20057,
12326,
1035,
2171,
1010,
20057,
12326,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3443,
1035,
2030... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.check_name_availability_method | def check_name_availability_method(resource_group_name, namespace_name, parameters, custom_headers:nil)
response = check_name_availability_method_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def check_name_availability_method(resource_group_name, namespace_name, parameters, custom_headers:nil)
response = check_name_availability_method_async(resource_group_name, namespace_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"check_name_availability_method",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"check_name_availability_method_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"parameter... | Check the give namespace name availability.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The namespace name
@param parameters [CheckNameAvailability] Parameters to check availability of
the given namespace name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CheckNameAvailabilityResult] operation results. | [
"Check",
"the",
"give",
"namespace",
"name",
"availability",
"."
] | 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#L37-L40 | train | Check the name availability of the namespace. | [
30522,
13366,
4638,
1035,
2171,
1035,
11343,
1035,
4118,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
30524,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
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... |
kpumuk/meta-tags | lib/meta_tags/renderer.rb | MetaTags.Renderer.render_hashes | def render_hashes(tags, **opts)
meta_tags.meta_tags.each_key do |property|
render_hash(tags, property, **opts)
end
end | ruby | def render_hashes(tags, **opts)
meta_tags.meta_tags.each_key do |property|
render_hash(tags, property, **opts)
end
end | [
"def",
"render_hashes",
"(",
"tags",
",",
"**",
"opts",
")",
"meta_tags",
".",
"meta_tags",
".",
"each_key",
"do",
"|",
"property",
"|",
"render_hash",
"(",
"tags",
",",
"property",
",",
"**",
"opts",
")",
"end",
"end"
] | Renders complex hash objects.
@param [Array<Tag>] tags a buffer object to store tag in. | [
"Renders",
"complex",
"hash",
"objects",
"."
] | 03585f95edf96cd17024c5c155ce46ec8bc47232 | https://github.com/kpumuk/meta-tags/blob/03585f95edf96cd17024c5c155ce46ec8bc47232/lib/meta_tags/renderer.rb#L166-L170 | train | Render the hash of the meta tags | [
30522,
13366,
17552,
1035,
23325,
2229,
1006,
22073,
1010,
1008,
1008,
23569,
2015,
1007,
18804,
1035,
22073,
1012,
18804,
1035,
22073,
1012,
2169,
1035,
3145,
2079,
1064,
3200,
1064,
17552,
1035,
23325,
1006,
22073,
1010,
3200,
1010,
1008,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachines.begin_redeploy | def begin_redeploy(resource_group_name, vm_name, custom_headers:nil)
response = begin_redeploy_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_redeploy(resource_group_name, vm_name, custom_headers:nil)
response = begin_redeploy_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_redeploy",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_redeploy_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
... | The operation to redeploy a virtual machine.
@param resource_group_name [String] The name of the resource group.
@param vm_name [String] The name of the virtual machine.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusResponse] operation results. | [
"The",
"operation",
"to",
"redeploy",
"a",
"virtual",
"machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb#L1778-L1781 | train | Redeploy a virtual machine. | [
30522,
13366,
4088,
1035,
2417,
13699,
4135,
2100,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
2417,
13699,
4135,
2100,
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... |
rails/rails | activerecord/lib/active_record/attribute_methods.rb | ActiveRecord.AttributeMethods.respond_to? | def respond_to?(name, include_private = false)
return false unless super
# If the result is true then check for the select case.
# For queries selecting a subset of columns, return false for unselected columns.
# We check defined?(@attributes) not to issue warnings if called on objects that
# have been allocated but not yet initialized.
if defined?(@attributes)
if name = self.class.symbol_column_to_string(name.to_sym)
return has_attribute?(name)
end
end
true
end | ruby | def respond_to?(name, include_private = false)
return false unless super
# If the result is true then check for the select case.
# For queries selecting a subset of columns, return false for unselected columns.
# We check defined?(@attributes) not to issue warnings if called on objects that
# have been allocated but not yet initialized.
if defined?(@attributes)
if name = self.class.symbol_column_to_string(name.to_sym)
return has_attribute?(name)
end
end
true
end | [
"def",
"respond_to?",
"(",
"name",
",",
"include_private",
"=",
"false",
")",
"return",
"false",
"unless",
"super",
"# If the result is true then check for the select case.",
"# For queries selecting a subset of columns, return false for unselected columns.",
"# We check defined?(@attr... | A Person object with a name attribute can ask <tt>person.respond_to?(:name)</tt>,
<tt>person.respond_to?(:name=)</tt>, and <tt>person.respond_to?(:name?)</tt>
which will all return +true+. It also defines the attribute methods if they have
not been generated.
class Person < ActiveRecord::Base
end
person = Person.new
person.respond_to?(:name) # => true
person.respond_to?(:name=) # => true
person.respond_to?(:name?) # => true
person.respond_to?('age') # => true
person.respond_to?('age=') # => true
person.respond_to?('age?') # => true
person.respond_to?(:nothing) # => false | [
"A",
"Person",
"object",
"with",
"a",
"name",
"attribute",
"can",
"ask",
"<tt",
">",
"person",
".",
"respond_to?",
"(",
":",
"name",
")",
"<",
"/",
"tt",
">",
"<tt",
">",
"person",
".",
"respond_to?",
"(",
":",
"name",
"=",
")",
"<",
"/",
"tt",
"... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/attribute_methods.rb#L262-L276 | train | Returns true if the object respond to the given column. | [
30522,
13366,
6869,
1035,
2000,
1029,
1006,
2171,
1010,
2421,
1035,
2797,
1027,
6270,
1007,
2709,
6270,
4983,
3565,
1001,
2065,
1996,
2765,
2003,
2995,
2059,
4638,
2005,
1996,
7276,
2553,
1012,
1001,
2005,
10861,
5134,
17739,
1037,
16745,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb | Azure::CognitiveServices::Face::V1_0.LargePersonGroupPerson.delete_face_with_http_info | def delete_face_with_http_info(large_person_group_id, person_id, persisted_face_id, custom_headers:nil)
delete_face_async(large_person_group_id, person_id, persisted_face_id, custom_headers:custom_headers).value!
end | ruby | def delete_face_with_http_info(large_person_group_id, person_id, persisted_face_id, custom_headers:nil)
delete_face_async(large_person_group_id, person_id, persisted_face_id, custom_headers:custom_headers).value!
end | [
"def",
"delete_face_with_http_info",
"(",
"large_person_group_id",
",",
"person_id",
",",
"persisted_face_id",
",",
"custom_headers",
":",
"nil",
")",
"delete_face_async",
"(",
"large_person_group_id",
",",
"person_id",
",",
"persisted_face_id",
",",
"custom_headers",
":c... | Delete a face from a person. Relative feature for the persisted face will
also be deleted.
@param large_person_group_id [String] Id referencing a particular large
person group.
@param person_id Id referencing a particular person.
@param persisted_face_id Id referencing a particular persistedFaceId of an
existing face.
@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. | [
"Delete",
"a",
"face",
"from",
"a",
"person",
".",
"Relative",
"feature",
"for",
"the",
"persisted",
"face",
"will",
"also",
"be",
"deleted",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb#L589-L591 | train | Deletes a persisted face from a person. | [
30522,
13366,
3972,
12870,
1035,
2227,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2312,
1035,
2711,
1035,
2177,
1035,
8909,
1010,
2711,
1035,
8909,
1010,
19035,
30524,
9152,
2140,
1007,
3972,
12870,
1035,
2227,
1035,
2004,
6038,
2278,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/bot.rb | Discordrb.Bot.process_token | def process_token(type, token)
# Remove the "Bot " prefix if it exists
token = token[4..-1] if token.start_with? 'Bot '
token = 'Bot ' + token unless type == :user
token
end | ruby | def process_token(type, token)
# Remove the "Bot " prefix if it exists
token = token[4..-1] if token.start_with? 'Bot '
token = 'Bot ' + token unless type == :user
token
end | [
"def",
"process_token",
"(",
"type",
",",
"token",
")",
"# Remove the \"Bot \" prefix if it exists",
"token",
"=",
"token",
"[",
"4",
"..",
"-",
"1",
"]",
"if",
"token",
".",
"start_with?",
"'Bot '",
"token",
"=",
"'Bot '",
"+",
"token",
"unless",
"type",
"=... | ####### ###### #### ##
## ## ## ## ## ###
## ## ## ## ####
## ## ## #### ## ## ##
## ## ## ## ## ##
## ## ## ## ## ##
####### ###### #### ## | [
"#######",
"######",
"####",
"##",
"##",
"##",
"##",
"##",
"##",
"###",
"##",
"##",
"##",
"##",
"####",
"##",
"##",
"##",
"####",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"##",
"#######",
"######",
"##... | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L984-L990 | train | Process the token | [
30522,
13366,
2832,
1035,
19204,
1006,
2828,
1010,
19204,
1007,
1001,
6366,
1996,
1000,
28516,
1000,
17576,
2065,
2009,
6526,
19204,
1027,
19204,
1031,
1018,
1012,
1012,
1011,
1015,
1033,
2065,
19204,
1012,
2707,
1035,
2007,
1029,
1005,
285... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
libgit2/rugged | lib/rugged/submodule_collection.rb | Rugged.SubmoduleCollection.add | def add(url, path, options = {})
submodule = setup_add(url, path, options)
clone_submodule(submodule.repository, options)
submodule.finalize_add
end | ruby | def add(url, path, options = {})
submodule = setup_add(url, path, options)
clone_submodule(submodule.repository, options)
submodule.finalize_add
end | [
"def",
"add",
"(",
"url",
",",
"path",
",",
"options",
"=",
"{",
"}",
")",
"submodule",
"=",
"setup_add",
"(",
"url",
",",
"path",
",",
"options",
")",
"clone_submodule",
"(",
"submodule",
".",
"repository",
",",
"options",
")",
"submodule",
".",
"fina... | call-seq:
submodules.setup_add(url, path[, options]) -> submodule
Add a new +submodule+.
This does <tt>"git submodule add"</tt> incuding fetch and checkout of the
submodule contents.
- +url+: URL for the submodule's remote
- +path+: path at which the submodule should be created
The +options+ hash accepts all options supported by Rugged::Remote#fetch
and the following:
:gitlink ::
(defaults to +true+) should workdir contain a
gitlink to the repository in +.git/modules+ vs. repository
directly in workdir.
Returns the newly created +submodule+ | [
"call",
"-",
"seq",
":",
"submodules",
".",
"setup_add",
"(",
"url",
"path",
"[",
"options",
"]",
")",
"-",
">",
"submodule"
] | 33873e5df2bd38501814182ff79609ed4bd88012 | https://github.com/libgit2/rugged/blob/33873e5df2bd38501814182ff79609ed4bd88012/lib/rugged/submodule_collection.rb#L28-L32 | train | Add a submodule to the repository | [
30522,
13366,
5587,
1006,
24471,
2140,
1010,
4130,
1010,
7047,
1027,
1063,
1065,
1007,
4942,
5302,
8566,
2571,
1027,
16437,
1035,
5587,
1006,
24471,
2140,
1010,
4130,
1010,
7047,
1007,
17598,
1035,
4942,
5302,
8566,
2571,
1006,
4942,
5302,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
libgit2/rugged | lib/rugged/commit.rb | Rugged.Commit.diff | def diff(*args)
args.unshift(parents.first) if args.size == 1 && args.first.is_a?(Hash)
self.tree.diff(*args)
end | ruby | def diff(*args)
args.unshift(parents.first) if args.size == 1 && args.first.is_a?(Hash)
self.tree.diff(*args)
end | [
"def",
"diff",
"(",
"*",
"args",
")",
"args",
".",
"unshift",
"(",
"parents",
".",
"first",
")",
"if",
"args",
".",
"size",
"==",
"1",
"&&",
"args",
".",
"first",
".",
"is_a?",
"(",
"Hash",
")",
"self",
".",
"tree",
".",
"diff",
"(",
"args",
")... | Return a diff between this commit and its first parent or another commit or tree.
See Rugged::Tree#diff for more details. | [
"Return",
"a",
"diff",
"between",
"this",
"commit",
"and",
"its",
"first",
"parent",
"or",
"another",
"commit",
"or",
"tree",
"."
] | 33873e5df2bd38501814182ff79609ed4bd88012 | https://github.com/libgit2/rugged/blob/33873e5df2bd38501814182ff79609ed4bd88012/lib/rugged/commit.rb#L24-L27 | train | Returns the diff of the current object and its parents. | [
30522,
13366,
4487,
4246,
1006,
1008,
12098,
5620,
1007,
12098,
5620,
1012,
4895,
6182,
6199,
1006,
3008,
1012,
2034,
1007,
2065,
12098,
5620,
1012,
2946,
1027,
1027,
1015,
1004,
1004,
12098,
5620,
1012,
2034,
1012,
2003,
1035,
1037,
1029,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.reset_attribute! | def reset_attribute!(attr)
attr = database_field_name(attr)
attributes[attr] = changed_attributes.delete(attr) if attribute_changed?(attr)
end | ruby | def reset_attribute!(attr)
attr = database_field_name(attr)
attributes[attr] = changed_attributes.delete(attr) if attribute_changed?(attr)
end | [
"def",
"reset_attribute!",
"(",
"attr",
")",
"attr",
"=",
"database_field_name",
"(",
"attr",
")",
"attributes",
"[",
"attr",
"]",
"=",
"changed_attributes",
".",
"delete",
"(",
"attr",
")",
"if",
"attribute_changed?",
"(",
"attr",
")",
"end"
] | Set the attribute back to its old value.
@example Reset the attribute.
model.reset_attribute!("name")
@param [ String ] attr The name of the attribute.
@return [ Object ] The old value.
@since 2.4.0 | [
"Set",
"the",
"attribute",
"back",
"to",
"its",
"old",
"value",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/changeable.rb#L245-L248 | train | Reset the attribute to the original value | [
30522,
13366,
25141,
1035,
17961,
999,
1006,
2012,
16344,
1007,
2012,
16344,
1027,
7809,
1035,
2492,
1035,
2171,
1006,
2012,
16344,
1007,
12332,
1031,
2012,
16344,
1033,
1027,
2904,
1035,
12332,
1012,
3972,
12870,
1006,
2012,
16344,
1007,
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... |
danger/danger | lib/danger/danger_core/plugins/dangerfile_messaging_plugin.rb | Danger.DangerfileMessagingPlugin.message | def message(*messages, **options)
sticky = options.fetch(:sticky, false)
file = options.fetch(:file, nil)
line = options.fetch(:line, nil)
messages.flatten.each do |message|
@messages << Violation.new(message, sticky, file, line) if message
end
end | ruby | def message(*messages, **options)
sticky = options.fetch(:sticky, false)
file = options.fetch(:file, nil)
line = options.fetch(:line, nil)
messages.flatten.each do |message|
@messages << Violation.new(message, sticky, file, line) if message
end
end | [
"def",
"message",
"(",
"*",
"messages",
",",
"**",
"options",
")",
"sticky",
"=",
"options",
".",
"fetch",
"(",
":sticky",
",",
"false",
")",
"file",
"=",
"options",
".",
"fetch",
"(",
":file",
",",
"nil",
")",
"line",
"=",
"options",
".",
"fetch",
... | @!group Core
Print out a generate message on the PR
@param [String, Array<String>] message
The message to present to the user
@param [Boolean] sticky
Whether the message should be kept after it was fixed,
defaults to `false`.
@param [String] file
Optional. Path to the file that the message is for.
@param [String] line
Optional. The line in the file to present the message in.
@return [void] | [
"@!group",
"Core",
"Print",
"out",
"a",
"generate",
"message",
"on",
"the",
"PR"
] | 0d6d09f2d949c287fe75202d947374042b0679f4 | https://github.com/danger/danger/blob/0d6d09f2d949c287fe75202d947374042b0679f4/lib/danger/danger_core/plugins/dangerfile_messaging_plugin.rb#L121-L129 | train | Add a message to the message list. | [
30522,
13366,
4471,
1006,
1008,
7696,
1010,
1008,
1008,
7047,
1007,
15875,
1027,
7047,
1012,
18584,
1006,
1024,
15875,
1010,
6270,
1007,
5371,
1027,
7047,
1012,
18584,
1006,
1024,
5371,
1010,
9152,
2140,
1007,
2240,
1027,
7047,
1012,
18584,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/tag.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Tag.get_by_operation | def get_by_operation(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers:nil)
response = get_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_operation(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers:nil)
response = get_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_operation",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"operation_id",
",",
"tag_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_operation_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"a... | Get tag associated with the Operation.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param api_id [String] API revision identifier. Must be unique in the current
API Management service instance. Non-current revision has ;rev=n as a suffix
where n is the revision number.
@param operation_id [String] Operation identifier within an API. Must be
unique in the current API Management service instance.
@param tag_id [String] Tag 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 [TagContract] operation results. | [
"Get",
"tag",
"associated",
"with",
"the",
"Operation",
"."
] | 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/tag.rb#L1608-L1611 | train | Gets the tag for the specified API. | [
30522,
13366,
2131,
1035,
2011,
1035,
3169,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
17928,
1035,
8909,
1010,
3169,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replicationv_centers.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationvCenters.create | def create(fabric_name, v_center_name, add_vcenter_request, custom_headers:nil)
response = create_async(fabric_name, v_center_name, add_vcenter_request, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create(fabric_name, v_center_name, add_vcenter_request, custom_headers:nil)
response = create_async(fabric_name, v_center_name, add_vcenter_request, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create",
"(",
"fabric_name",
",",
"v_center_name",
",",
"add_vcenter_request",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_async",
"(",
"fabric_name",
",",
"v_center_name",
",",
"add_vcenter_request",
",",
"custom_headers",
":custom_header... | Add vCenter.
The operation to create a vCenter object..
@param fabric_name [String] Fabric name.
@param v_center_name [String] vCenter name.
@param add_vcenter_request [AddVCenterRequest] The input to the add vCenter
operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VCenter] operation results. | [
"Add",
"vCenter",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replicationv_centers.rb#L234-L237 | train | Creates a virtual network vCenter. | [
30522,
13366,
3443,
1006,
8313,
1035,
2171,
1010,
1058,
1035,
2415,
1035,
2171,
1010,
5587,
1035,
18315,
29110,
1035,
5227,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2004,
6038,
2278,
1006,
8313,
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 | management/azure_mgmt_resources_management/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/management_groups.rb | Azure::ResourcesManagement::Mgmt::V2018_03_01_preview.ManagementGroups.delete | def delete(group_id, cache_control:'no-cache', custom_headers:nil)
response = delete_async(group_id, cache_control:cache_control, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete(group_id, cache_control:'no-cache', custom_headers:nil)
response = delete_async(group_id, cache_control:cache_control, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete",
"(",
"group_id",
",",
"cache_control",
":",
"'no-cache'",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"group_id",
",",
"cache_control",
":cache_control",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!... | Delete management group. If a management group contains child resources, the
request will fail.
@param group_id [String] Management Group ID.
@param cache_control [String] Indicates that the request shouldn't utilize
any caches.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationResults] operation results. | [
"Delete",
"management",
"group",
".",
"If",
"a",
"management",
"group",
"contains",
"child",
"resources",
"the",
"request",
"will",
"fail",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources_management/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/management_groups.rb#L423-L426 | train | Deletes the specified group. | [
30522,
13366,
3972,
12870,
1006,
2177,
1035,
8909,
1010,
17053,
1035,
2491,
1024,
1005,
2053,
1011,
17053,
1005,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
2177,
1035,
8909,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.begin_scan_for_updates | def begin_scan_for_updates(device_name, resource_group_name, manager_name, custom_headers:nil)
response = begin_scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_scan_for_updates(device_name, resource_group_name, manager_name, custom_headers:nil)
response = begin_scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_scan_for_updates",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_scan_for_updates_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"cust... | 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#L1576-L1579 | train | Gets the list of all the available Azure Central Hubs and the associated Azure Central Hubs. | [
30522,
13366,
4088,
1035,
13594,
1035,
2005,
1035,
14409,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
30524,
13594,
1035,
2005,
1035,
14409,
1035,
2004,
6038,
2278,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
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... |
mikel/mail | lib/mail/message.rb | Mail.Message.add_part | def add_part(part)
if !body.multipart? && !Utilities.blank?(self.body.decoded)
@text_part = Mail::Part.new('Content-Type: text/plain;')
@text_part.body = body.decoded
self.body << @text_part
add_multipart_alternate_header
end
add_boundary
self.body << part
end | ruby | def add_part(part)
if !body.multipart? && !Utilities.blank?(self.body.decoded)
@text_part = Mail::Part.new('Content-Type: text/plain;')
@text_part.body = body.decoded
self.body << @text_part
add_multipart_alternate_header
end
add_boundary
self.body << part
end | [
"def",
"add_part",
"(",
"part",
")",
"if",
"!",
"body",
".",
"multipart?",
"&&",
"!",
"Utilities",
".",
"blank?",
"(",
"self",
".",
"body",
".",
"decoded",
")",
"@text_part",
"=",
"Mail",
"::",
"Part",
".",
"new",
"(",
"'Content-Type: text/plain;'",
")",... | Adds a part to the parts list or creates the part list | [
"Adds",
"a",
"part",
"to",
"the",
"parts",
"list",
"or",
"creates",
"the",
"part",
"list"
] | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/message.rb#L1699-L1708 | train | Add a part to the message. | [
30522,
13366,
5587,
1035,
2112,
1006,
2112,
1007,
2065,
999,
2303,
1012,
4800,
19362,
2102,
1029,
1004,
1004,
999,
16548,
1012,
8744,
1029,
1006,
2969,
1012,
2303,
1012,
21933,
5732,
1007,
1030,
3793,
1035,
2112,
1027,
5653,
1024,
1024,
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... |
puppetlabs/puppet | lib/puppet/module_tool/metadata.rb | Puppet::ModuleTool.Metadata.add_dependency | def add_dependency(name, version_requirement=nil, repository=nil)
validate_name(name)
validate_version_range(version_requirement) if version_requirement
if dup = @data['dependencies'].find { |d| d.full_module_name == name && d.version_requirement != version_requirement }
raise ArgumentError, _("Dependency conflict for %{module_name}: Dependency %{name} was given conflicting version requirements %{version_requirement} and %{dup_version}. Verify that there are no duplicates in the metadata.json.") % { module_name: full_module_name, name: name, version_requirement: version_requirement, dup_version: dup.version_requirement }
end
dep = Dependency.new(name, version_requirement, repository)
@data['dependencies'].add(dep)
dep
end | ruby | def add_dependency(name, version_requirement=nil, repository=nil)
validate_name(name)
validate_version_range(version_requirement) if version_requirement
if dup = @data['dependencies'].find { |d| d.full_module_name == name && d.version_requirement != version_requirement }
raise ArgumentError, _("Dependency conflict for %{module_name}: Dependency %{name} was given conflicting version requirements %{version_requirement} and %{dup_version}. Verify that there are no duplicates in the metadata.json.") % { module_name: full_module_name, name: name, version_requirement: version_requirement, dup_version: dup.version_requirement }
end
dep = Dependency.new(name, version_requirement, repository)
@data['dependencies'].add(dep)
dep
end | [
"def",
"add_dependency",
"(",
"name",
",",
"version_requirement",
"=",
"nil",
",",
"repository",
"=",
"nil",
")",
"validate_name",
"(",
"name",
")",
"validate_version_range",
"(",
"version_requirement",
")",
"if",
"version_requirement",
"if",
"dup",
"=",
"@data",
... | Validates the name and version_requirement for a dependency, then creates
the Dependency and adds it.
Returns the Dependency that was added. | [
"Validates",
"the",
"name",
"and",
"version_requirement",
"for",
"a",
"dependency",
"then",
"creates",
"the",
"Dependency",
"and",
"adds",
"it",
".",
"Returns",
"the",
"Dependency",
"that",
"was",
"added",
"."
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/module_tool/metadata.rb#L65-L77 | train | Add a dependency to the metadata. json | [
30522,
13366,
5587,
1035,
24394,
1006,
2171,
1010,
2544,
1035,
9095,
1027,
9152,
2140,
1010,
22409,
1027,
9152,
2140,
1007,
9398,
3686,
1035,
2171,
1006,
2171,
1007,
9398,
3686,
1035,
2544,
1035,
2846,
1006,
2544,
1035,
9095,
1007,
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... |
sporkmonger/addressable | lib/addressable/template.rb | Addressable.Template.partial_expand | def partial_expand(mapping, processor=nil, normalize_values=true)
result = self.pattern.dup
mapping = normalize_keys(mapping)
result.gsub!( EXPRESSION ) do |capture|
transform_partial_capture(mapping, capture, processor, normalize_values)
end
return Addressable::Template.new(result)
end | ruby | def partial_expand(mapping, processor=nil, normalize_values=true)
result = self.pattern.dup
mapping = normalize_keys(mapping)
result.gsub!( EXPRESSION ) do |capture|
transform_partial_capture(mapping, capture, processor, normalize_values)
end
return Addressable::Template.new(result)
end | [
"def",
"partial_expand",
"(",
"mapping",
",",
"processor",
"=",
"nil",
",",
"normalize_values",
"=",
"true",
")",
"result",
"=",
"self",
".",
"pattern",
".",
"dup",
"mapping",
"=",
"normalize_keys",
"(",
"mapping",
")",
"result",
".",
"gsub!",
"(",
"EXPRES... | Expands a URI template into another URI template.
@param [Hash] mapping The mapping that corresponds to the pattern.
@param [#validate, #transform] processor
An optional processor object may be supplied.
@param [Boolean] normalize_values
Optional flag to enable/disable unicode normalization. Default: true
The object should respond to either the <tt>validate</tt> or
<tt>transform</tt> messages or both. Both the <tt>validate</tt> and
<tt>transform</tt> methods should take two parameters: <tt>name</tt> and
<tt>value</tt>. The <tt>validate</tt> method should return <tt>true</tt>
or <tt>false</tt>; <tt>true</tt> if the value of the variable is valid,
<tt>false</tt> otherwise. An <tt>InvalidTemplateValueError</tt>
exception will be raised if the value is invalid. The <tt>transform</tt>
method should return the transformed variable value as a <tt>String</tt>.
If a <tt>transform</tt> method is used, the value will not be percent
encoded automatically. Unicode normalization will be performed both
before and after sending the value to the transform method.
@return [Addressable::Template] The partially expanded URI template.
@example
Addressable::Template.new(
"http://example.com/{one}/{two}/"
).partial_expand({"one" => "1"}).pattern
#=> "http://example.com/1/{two}/"
Addressable::Template.new(
"http://example.com/{?one,two}/"
).partial_expand({"one" => "1"}).pattern
#=> "http://example.com/?one=1{&two}/"
Addressable::Template.new(
"http://example.com/{?one,two,three}/"
).partial_expand({"one" => "1", "three" => 3}).pattern
#=> "http://example.com/?one=1{&two}&three=3" | [
"Expands",
"a",
"URI",
"template",
"into",
"another",
"URI",
"template",
"."
] | 5894c95a7768435cb46d1355954611dbd194832e | https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/template.rb#L525-L532 | train | Expand a partial template | [
30522,
13366,
7704,
1035,
7818,
1006,
12375,
1010,
13151,
1027,
9152,
2140,
1010,
3671,
4697,
1035,
5300,
1027,
2995,
1007,
2765,
1027,
2969,
1012,
5418,
1012,
4241,
2361,
12375,
1027,
3671,
4697,
1035,
6309,
1006,
12375,
1007,
2765,
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... |
interagent/committee | lib/committee/drivers/hyper_schema.rb | Committee::Drivers.HyperSchema.parse | def parse(schema)
# Really we'd like to only have data hashes passed into drivers these
# days, but here we handle a JsonSchema::Schema for now to maintain
# backward compatibility (this library used to be hyper-schema only).
if schema.is_a?(JsonSchema::Schema)
hyper_schema = schema
else
hyper_schema = JsonSchema.parse!(schema)
hyper_schema.expand_references!
end
schema = Schema.new
schema.driver = self
schema.routes = build_routes(hyper_schema)
schema
end | ruby | def parse(schema)
# Really we'd like to only have data hashes passed into drivers these
# days, but here we handle a JsonSchema::Schema for now to maintain
# backward compatibility (this library used to be hyper-schema only).
if schema.is_a?(JsonSchema::Schema)
hyper_schema = schema
else
hyper_schema = JsonSchema.parse!(schema)
hyper_schema.expand_references!
end
schema = Schema.new
schema.driver = self
schema.routes = build_routes(hyper_schema)
schema
end | [
"def",
"parse",
"(",
"schema",
")",
"# Really we'd like to only have data hashes passed into drivers these",
"# days, but here we handle a JsonSchema::Schema for now to maintain",
"# backward compatibility (this library used to be hyper-schema only).",
"if",
"schema",
".",
"is_a?",
"(",
"J... | Parses an API schema and builds a set of route definitions for use with
Committee.
The expected input format is a data hash with keys as strings (as opposed
to symbols) like the kind produced by JSON.parse or YAML.load. | [
"Parses",
"an",
"API",
"schema",
"and",
"builds",
"a",
"set",
"of",
"route",
"definitions",
"for",
"use",
"with",
"Committee",
"."
] | 810fadcea1bc1c529627d47325c1008b5c33b0a4 | https://github.com/interagent/committee/blob/810fadcea1bc1c529627d47325c1008b5c33b0a4/lib/committee/drivers/hyper_schema.rb#L41-L56 | train | Parse a schema and return a new schema object. | [
30522,
30524,
2069,
2031,
2951,
23325,
2229,
2979,
2046,
6853,
2122,
1001,
2420,
1010,
2021,
2182,
2057,
5047,
1037,
1046,
23345,
5403,
2863,
1024,
1024,
8040,
28433,
2005,
2085,
2000,
5441,
1001,
8848,
21778,
1006,
2023,
3075,
2109,
2000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_rule_baselines.rb | Azure::SQL::Mgmt::V2017_10_01_preview.ManagedDatabaseVulnerabilityAssessmentRuleBaselines.delete_with_http_info | def delete_with_http_info(resource_group_name, managed_instance_name, database_name, rule_id, baseline_name, custom_headers:nil)
delete_async(resource_group_name, managed_instance_name, database_name, rule_id, baseline_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, managed_instance_name, database_name, rule_id, baseline_name, custom_headers:nil)
delete_async(resource_group_name, managed_instance_name, database_name, rule_id, baseline_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"database_name",
",",
"rule_id",
",",
"baseline_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"... | Removes the database's vulnerability assessment rule baseline.
@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 managed_instance_name [String] The name of the managed instance.
@param database_name [String] The name of the database for which the
vulnerability assessment rule baseline is defined.
@param rule_id [String] The vulnerability assessment rule ID.
@param baseline_name [VulnerabilityAssessmentPolicyBaselineName] The name of
the vulnerability assessment rule baseline (default implies a baseline on a
database level rule and master for server level rule). Possible values
include: 'master', 'default'
@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. | [
"Removes",
"the",
"database",
"s",
"vulnerability",
"assessment",
"rule",
"baseline",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_rule_baselines.rb#L329-L331 | train | Deletes a rule from the managed database. | [
30522,
13366,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
6013,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
3627,
1035,
8909,
1010,
26163,
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... |
fastlane/fastlane | spaceship/lib/spaceship/client.rb | Spaceship.Client.login | def login(user = nil, password = nil)
if user.to_s.empty? || password.to_s.empty?
require 'credentials_manager/account_manager'
puts("Reading keychain entry, because either user or password were empty") if Spaceship::Globals.verbose?
keychain_entry = CredentialsManager::AccountManager.new(user: user, password: password)
user ||= keychain_entry.user
password = keychain_entry.password
end
if user.to_s.strip.empty? || password.to_s.strip.empty?
raise NoUserCredentialsError.new, "No login data provided"
end
self.user = user
@password = password
begin
do_login(user, password) # calls `send_login_request` in sub class (which then will redirect back here to `send_shared_login_request`, below)
rescue InvalidUserCredentialsError => ex
raise ex unless keychain_entry
if keychain_entry.invalid_credentials
login(user)
else
raise ex
end
end
end | ruby | def login(user = nil, password = nil)
if user.to_s.empty? || password.to_s.empty?
require 'credentials_manager/account_manager'
puts("Reading keychain entry, because either user or password were empty") if Spaceship::Globals.verbose?
keychain_entry = CredentialsManager::AccountManager.new(user: user, password: password)
user ||= keychain_entry.user
password = keychain_entry.password
end
if user.to_s.strip.empty? || password.to_s.strip.empty?
raise NoUserCredentialsError.new, "No login data provided"
end
self.user = user
@password = password
begin
do_login(user, password) # calls `send_login_request` in sub class (which then will redirect back here to `send_shared_login_request`, below)
rescue InvalidUserCredentialsError => ex
raise ex unless keychain_entry
if keychain_entry.invalid_credentials
login(user)
else
raise ex
end
end
end | [
"def",
"login",
"(",
"user",
"=",
"nil",
",",
"password",
"=",
"nil",
")",
"if",
"user",
".",
"to_s",
".",
"empty?",
"||",
"password",
".",
"to_s",
".",
"empty?",
"require",
"'credentials_manager/account_manager'",
"puts",
"(",
"\"Reading keychain entry, because... | Authenticates with Apple's web services. This method has to be called once
to generate a valid session. The session will automatically be used from then
on.
This method will automatically use the username from the Appfile (if available)
and fetch the password from the Keychain (if available)
@param user (String) (optional): The username (usually the email address)
@param password (String) (optional): The password
@raise InvalidUserCredentialsError: raised if authentication failed
@return (Spaceship::Client) The client the login method was called for | [
"Authenticates",
"with",
"Apple",
"s",
"web",
"services",
".",
"This",
"method",
"has",
"to",
"be",
"called",
"once",
"to",
"generate",
"a",
"valid",
"session",
".",
"The",
"session",
"will",
"automatically",
"be",
"used",
"from",
"then",
"on",
"."
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/client.rb#L366-L394 | train | This method is used to login to the server | [
30522,
13366,
8833,
2378,
1006,
5310,
1027,
9152,
2140,
1010,
20786,
1027,
9152,
2140,
1007,
2065,
5310,
1012,
2000,
1035,
1055,
1012,
4064,
1029,
1064,
1064,
20786,
1012,
2000,
1035,
1055,
1012,
4064,
1029,
5478,
1005,
22496,
1035,
3208,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/agreements.rb | Azure::Logic::Mgmt::V2016_06_01.Agreements.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, integration_account_name, agreement_name, agreement, custom_headers:nil)
create_or_update_async(resource_group_name, integration_account_name, agreement_name, agreement, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, integration_account_name, agreement_name, agreement, custom_headers:nil)
create_or_update_async(resource_group_name, integration_account_name, agreement_name, agreement, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"agreement_name",
",",
"agreement",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
... | Creates or updates an integration account agreement.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param agreement_name [String] The integration account agreement name.
@param agreement [IntegrationAccountAgreement] The integration account
agreement.
@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",
"an",
"integration",
"account",
"agreement",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/agreements.rb#L252-L254 | train | Creates or updates an integration account agreement. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8346,
1035,
4070,
1035,
2171,
1010,
3820,
1035,
2171,
1010,
3820,
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_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/jobs.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Jobs.list_by_manager_as_lazy | def list_by_manager_as_lazy(resource_group_name, manager_name, filter:nil, custom_headers:nil)
response = list_by_manager_async(resource_group_name, manager_name, filter:filter, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_manager_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_manager_as_lazy(resource_group_name, manager_name, filter:nil, custom_headers:nil)
response = list_by_manager_async(resource_group_name, manager_name, filter:filter, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_manager_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_manager_as_lazy",
"(",
"resource_group_name",
",",
"manager_name",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_manager_async",
"(",
"resource_group_name",
",",
"manager_name",
",",
"filter",
":",
"filt... | Gets all the jobs for the specified manager. With optional OData query
parameters, a filtered set of jobs is returned.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param filter [String] OData Filter options
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [JobList] which provide lazy access to pages of the response. | [
"Gets",
"all",
"the",
"jobs",
"for",
"the",
"specified",
"manager",
".",
"With",
"optional",
"OData",
"query",
"parameters",
"a",
"filtered",
"set",
"of",
"jobs",
"is",
"returned",
"."
] | 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/jobs.rb#L683-L692 | train | Gets the list of all the managed database versions. | [
30522,
13366,
2862,
1035,
2011,
1035,
3208,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
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 | management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_containers.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationProtectionContainers.list_by_replication_fabrics_as_lazy | def list_by_replication_fabrics_as_lazy(fabric_name, custom_headers:nil)
response = list_by_replication_fabrics_async(fabric_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_replication_fabrics_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_replication_fabrics_as_lazy(fabric_name, custom_headers:nil)
response = list_by_replication_fabrics_async(fabric_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_replication_fabrics_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_replication_fabrics_as_lazy",
"(",
"fabric_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_replication_fabrics_async",
"(",
"fabric_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"unless",
"response",
".",
"... | Gets the list of protection container for a fabric.
Lists the protection containers in the specified fabric.
@param fabric_name [String] Fabric name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ProtectionContainerCollection] which provide lazy access to pages of
the response. | [
"Gets",
"the",
"list",
"of",
"protection",
"container",
"for",
"a",
"fabric",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_containers.rb#L1144-L1153 | train | Gets all the fabrics in a service registry. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
25123,
1035,
2004,
1035,
13971,
1006,
8313,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
21647,
1035,
25123,
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... |
googleapis/google-cloud-ruby | google-cloud-datastore/lib/google-cloud-datastore.rb | Google.Cloud.datastore | def datastore scope: nil, timeout: nil, client_config: nil
Google::Cloud.datastore @project, @keyfile,
scope: scope, timeout: (timeout || @timeout),
client_config: client_config
end | ruby | def datastore scope: nil, timeout: nil, client_config: nil
Google::Cloud.datastore @project, @keyfile,
scope: scope, timeout: (timeout || @timeout),
client_config: client_config
end | [
"def",
"datastore",
"scope",
":",
"nil",
",",
"timeout",
":",
"nil",
",",
"client_config",
":",
"nil",
"Google",
"::",
"Cloud",
".",
"datastore",
"@project",
",",
"@keyfile",
",",
"scope",
":",
"scope",
",",
"timeout",
":",
"(",
"timeout",
"||",
"@timeou... | Creates a new object for connecting to the Datastore service.
Each call creates a new connection.
For more information on connecting to Google Cloud see the
{file:AUTHENTICATION.md Authentication Guide}.
@param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
set of resources and operations that the connection can access. See
[Using OAuth 2.0 to Access Google
APIs](https://developers.google.com/identity/protocols/OAuth2).
The default scope is:
* `https://www.googleapis.com/auth/datastore`
@param [Integer] timeout Default timeout to use in requests. Optional.
@param [Hash] client_config A hash of values to override the default
behavior of the API client. See Google::Gax::CallSettings. Optional.
@return [Google::Cloud::Datastore::Dataset]
@example
require "google/cloud"
gcloud = Google::Cloud.new
datastore = gcloud.datastore
task = datastore.entity "Task" do |t|
t["type"] = "Personal"
t["done"] = false
t["priority"] = 4
t["description"] = "Learn Cloud Datastore"
end
datastore.save task
@example You shouldn't need to override the default scope, but you can:
require "google/cloud"
gcloud = Google::Cloud.new
platform_scope = "https://www.googleapis.com/auth/cloud-platform"
datastore = gcloud.datastore scope: platform_scope | [
"Creates",
"a",
"new",
"object",
"for",
"connecting",
"to",
"the",
"Datastore",
"service",
".",
"Each",
"call",
"creates",
"a",
"new",
"connection",
"."
] | 846c1a57250ac860ef4de1b54853a480ab2ff702 | https://github.com/googleapis/google-cloud-ruby/blob/846c1a57250ac860ef4de1b54853a480ab2ff702/google-cloud-datastore/lib/google-cloud-datastore.rb#L72-L76 | train | Create a datastore | [
30522,
13366,
2951,
23809,
2063,
9531,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
9152,
2140,
1010,
7396,
1035,
9530,
8873,
2290,
1024,
9152,
2140,
8224,
1024,
1024,
6112,
1012,
2951,
23809,
2063,
1030,
2622,
1010,
1030,
3145,
8873,
2571,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-06-01/generated/azure_mgmt_recovery_services_backup/jobs.rb | Azure::RecoveryServicesBackup::Mgmt::V2016_06_01.Jobs.export | def export(vault_name, resource_group_name, filter:nil, custom_headers:nil)
response = export_async(vault_name, resource_group_name, filter:filter, custom_headers:custom_headers).value!
nil
end | ruby | def export(vault_name, resource_group_name, filter:nil, custom_headers:nil)
response = export_async(vault_name, resource_group_name, filter:filter, custom_headers:custom_headers).value!
nil
end | [
"def",
"export",
"(",
"vault_name",
",",
"resource_group_name",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"export_async",
"(",
"vault_name",
",",
"resource_group_name",
",",
"filter",
":",
"filter",
",",
"custom_headers"... | Exports all jobs for a given Shared Access Signatures (SAS) URL. The SAS URL
expires within 15 minutes of its creation.
@param vault_name [String] The name of the Recovery Services vault.
@param resource_group_name [String] The name of the resource group associated
with the Recovery Services vault.
@param filter [String] The OData filter options. status eq { InProgress ,
Completed , Failed , CompletedWithWarnings , Cancelled , Cancelling } and
backupManagementType eq {AzureIaasVM, MAB, DPM, AzureBackupServer, AzureSql }
and operation eq { ConfigureBackup , Backup , Restore , DisableBackup ,
DeleteBackupData } and jobId eq {guid} and startTime eq { yyyy-mm-dd hh:mm:ss
PM } and endTime eq { yyyy-mm-dd hh:mm:ss PM }.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Exports",
"all",
"jobs",
"for",
"a",
"given",
"Shared",
"Access",
"Signatures",
"(",
"SAS",
")",
"URL",
".",
"The",
"SAS",
"URL",
"expires",
"within",
"15",
"minutes",
"of",
"its",
"creation",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_backup/lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/jobs.rb#L45-L48 | train | Export a list of documents to a vault. | [
30522,
13366,
9167,
1006,
11632,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
9167,
1035,
2004,
6038,
2278,
1006,
11632,
1035,
2171,
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... |
kmuto/review | lib/epubmaker/producer.rb | EPUBMaker.Producer.ncx | def ncx(wobj, indentarray = [])
s = @epub.ncx(indentarray)
if !s.nil? && !wobj.nil?
wobj.puts s
end
end | ruby | def ncx(wobj, indentarray = [])
s = @epub.ncx(indentarray)
if !s.nil? && !wobj.nil?
wobj.puts s
end
end | [
"def",
"ncx",
"(",
"wobj",
",",
"indentarray",
"=",
"[",
"]",
")",
"s",
"=",
"@epub",
".",
"ncx",
"(",
"indentarray",
")",
"if",
"!",
"s",
".",
"nil?",
"&&",
"!",
"wobj",
".",
"nil?",
"wobj",
".",
"puts",
"s",
"end",
"end"
] | Write ncx file to IO object +wobj+. +indentarray+ defines prefix
string for each level. | [
"Write",
"ncx",
"file",
"to",
"IO",
"object",
"+",
"wobj",
"+",
".",
"+",
"indentarray",
"+",
"defines",
"prefix",
"string",
"for",
"each",
"level",
"."
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/producer.rb#L115-L120 | train | Return the NCX of the EPUB | [
30522,
13366,
13316,
2595,
1006,
24185,
2497,
3501,
1010,
27427,
4765,
2906,
9447,
1027,
1031,
1033,
1007,
1055,
1027,
1030,
4958,
12083,
1012,
13316,
2595,
1006,
27427,
4765,
2906,
9447,
1007,
2065,
999,
1055,
1012,
9152,
2140,
1029,
1004,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
zipmark/rspec_api_documentation | lib/rspec_api_documentation/configuration.rb | RspecApiDocumentation.Configuration.define_group | def define_group(name, &block)
subconfig = self.class.new(self)
subconfig.filter = name
subconfig.docs_dir = self.docs_dir.join(name.to_s)
yield subconfig
groups << subconfig
end | ruby | def define_group(name, &block)
subconfig = self.class.new(self)
subconfig.filter = name
subconfig.docs_dir = self.docs_dir.join(name.to_s)
yield subconfig
groups << subconfig
end | [
"def",
"define_group",
"(",
"name",
",",
"&",
"block",
")",
"subconfig",
"=",
"self",
".",
"class",
".",
"new",
"(",
"self",
")",
"subconfig",
".",
"filter",
"=",
"name",
"subconfig",
".",
"docs_dir",
"=",
"self",
".",
"docs_dir",
".",
"join",
"(",
"... | Defines a new sub configuration
Automatically sets the `filter` to the group name, and the `docs_dir` to
a subfolder of the parent's `doc_dir` named the group name.
RspecApiDocumentation.configure do |config|
config.docs_dir = "doc/api"
config.define_group(:public) do |config|
# Default values
config.docs_dir = "doc/api/public"
config.filter = :public
end
end
Params:
+name+:: String name of the group
+block+:: Block configuration block | [
"Defines",
"a",
"new",
"sub",
"configuration"
] | 54fbfda3ec8ede5b3d871700ff69aabe89eafb2f | https://github.com/zipmark/rspec_api_documentation/blob/54fbfda3ec8ede5b3d871700ff69aabe89eafb2f/lib/rspec_api_documentation/configuration.rb#L33-L39 | train | Define a new group | [
30522,
13366,
9375,
1035,
2177,
1006,
2171,
1010,
1004,
3796,
1007,
4942,
8663,
8873,
2290,
1027,
2969,
1012,
2465,
1012,
2047,
1006,
2969,
1007,
4942,
8663,
8873,
2290,
1012,
11307,
1027,
2171,
4942,
8663,
8873,
2290,
1012,
9986,
2015,
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_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/elastic_pools.rb | Azure::SQL::Mgmt::V2017_10_01_preview.ElasticPools.list_by_server_next | def list_by_server_next(next_page_link, custom_headers:nil)
response = list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_server_next(next_page_link, custom_headers:nil)
response = list_by_server_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_server_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_server_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response... | Gets all elastic pools in a server.
@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 [ElasticPoolListResult] operation results. | [
"Gets",
"all",
"elastic",
"pools",
"in",
"a",
"server",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/elastic_pools.rb#L711-L714 | train | Gets the list of the elastic network interfaces in a server. | [
30522,
13366,
2862,
1035,
2011,
1035,
8241,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
8241,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-cloudwatch/lib/aws-sdk-cloudwatch/alarm.rb | Aws::CloudWatch.Alarm.set_state | def set_state(options = {})
options = options.merge(alarm_name: @name)
resp = @client.set_alarm_state(options)
resp.data
end | ruby | def set_state(options = {})
options = options.merge(alarm_name: @name)
resp = @client.set_alarm_state(options)
resp.data
end | [
"def",
"set_state",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"alarm_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"set_alarm_state",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
alarm.set_state({
state_value: "OK", # required, accepts OK, ALARM, INSUFFICIENT_DATA
state_reason: "StateReason", # required
state_reason_data: "StateReasonData",
})
@param [Hash] options ({})
@option options [required, String] :state_value
The value of the state.
@option options [required, String] :state_reason
The reason that this alarm is set to this specific state, in text
format.
@option options [String] :state_reason_data
The reason that this alarm is set to this specific state, in JSON
format.
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-cloudwatch/lib/aws-sdk-cloudwatch/alarm.rb#L442-L446 | train | Set the state of the alarm | [
30522,
13366,
2275,
1035,
2110,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
8598,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
2275,
1035,
8598,
1035,
2110,
1006,
7047,
1007,
24501,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.4.0.36/generated/azure_service_fabric/mesh_code_package.rb | Azure::ServiceFabric::V6_4_0_36.MeshCodePackage.get_container_logs | def get_container_logs(application_resource_name, service_resource_name, replica_name, code_package_name, tail:nil, custom_headers:nil)
response = get_container_logs_async(application_resource_name, service_resource_name, replica_name, code_package_name, tail:tail, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_container_logs(application_resource_name, service_resource_name, replica_name, code_package_name, tail:nil, custom_headers:nil)
response = get_container_logs_async(application_resource_name, service_resource_name, replica_name, code_package_name, tail:tail, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_container_logs",
"(",
"application_resource_name",
",",
"service_resource_name",
",",
"replica_name",
",",
"code_package_name",
",",
"tail",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_container_logs_async",
"(",
"application_re... | Gets the logs from the container.
Gets the logs for the container of the specified code package of the service
replica.
@param application_resource_name [String] The identity of the application.
@param service_resource_name [String] The identity of the service.
@param replica_name [String] Service Fabric replica name.
@param code_package_name [String] The name of code package of the service.
@param tail [String] Number of lines to show from the end of the logs.
Default is 100. 'all' to show the complete logs.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ContainerLogs] operation results. | [
"Gets",
"the",
"logs",
"from",
"the",
"container",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.4.0.36/generated/azure_service_fabric/mesh_code_package.rb#L42-L45 | train | Gets the logs for the container. | [
30522,
13366,
2131,
1035,
11661,
1035,
15664,
1006,
4646,
1035,
7692,
1035,
2171,
1010,
2326,
1035,
7692,
1035,
2171,
1010,
15059,
1035,
2171,
1010,
3642,
1035,
7427,
1035,
2171,
1010,
5725,
1024,
9152,
2140,
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_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_with_http_info | def list_by_replication_protected_items_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:nil)
list_by_replication_protected_items_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:custom_headers).value!
end | ruby | def list_by_replication_protected_items_with_http_info(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:nil)
list_by_replication_protected_items_async(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:custom_headers).value!
end | [
"def",
"list_by_replication_protected_items_with_http_info",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"replicated_protected_item_name",
",",
"custom_headers",
":",
"nil",
")",
"list_by_replication_protected_items_async",
"(",
"fabric_name",
",",
"protection_contai... | 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 [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"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#L168-L170 | train | Gets the list of all the protection items in a fabric. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
5123,
1035,
5167,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
8313,
1035,
2171,
1010,
3860,
1035,
11661,
1035,
2171,
1010,
28024,
2094,
1035,
5123,
1035,
8875,
1035,
2171,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/volume.rb | Aws::EC2.Volume.describe_attribute | def describe_attribute(options = {})
options = options.merge(volume_id: @id)
resp = @client.describe_volume_attribute(options)
resp.data
end | ruby | def describe_attribute(options = {})
options = options.merge(volume_id: @id)
resp = @client.describe_volume_attribute(options)
resp.data
end | [
"def",
"describe_attribute",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"volume_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"describe_volume_attribute",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
volume.describe_attribute({
attribute: "autoEnableIO", # required, accepts autoEnableIO, productCodes
dry_run: false,
})
@param [Hash] options ({})
@option options [required, String] :attribute
The attribute of the volume. This parameter is required.
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@return [Types::DescribeVolumeAttributeResult] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/volume.rb#L388-L392 | train | Describe the attributes of a volume | [
30522,
13366,
6235,
1035,
17961,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
3872,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
6235,
1035,
3872,
1035,
17961,
1006,
7047,
1007,
24501,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | samples/Ruby/sinatra.rb | Sinatra.Base.indifferent_hash | def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end | ruby | def indifferent_hash
Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
end | [
"def",
"indifferent_hash",
"Hash",
".",
"new",
"{",
"|",
"hash",
",",
"key",
"|",
"hash",
"[",
"key",
".",
"to_s",
"]",
"if",
"Symbol",
"===",
"key",
"}",
"end"
] | Creates a Hash with indifferent access. | [
"Creates",
"a",
"Hash",
"with",
"indifferent",
"access",
"."
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/samples/Ruby/sinatra.rb#L926-L928 | train | Returns a hash of the indifferent symbols in the array | [
30522,
13366,
24436,
1035,
23325,
23325,
1012,
2047,
1063,
1064,
23325,
1010,
3145,
1064,
23325,
1031,
3145,
1012,
2000,
1035,
1055,
1033,
2065,
6454,
1027,
1027,
1027,
3145,
1065,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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/global_users.rb | Azure::Labservices::Mgmt::V2018_10_15.GlobalUsers.begin_start_environment | def begin_start_environment(user_name, environment_operations_payload, custom_headers:nil)
response = begin_start_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value!
nil
end | ruby | def begin_start_environment(user_name, environment_operations_payload, custom_headers:nil)
response = begin_start_environment_async(user_name, environment_operations_payload, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_start_environment",
"(",
"user_name",
",",
"environment_operations_payload",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_start_environment_async",
"(",
"user_name",
",",
"environment_operations_payload",
",",
"custom_headers",
":custom_header... | Starts an environment by starting all resources inside the environment. This
operation can take a while to complete
@param user_name [String] The name of the user.
@param environment_operations_payload [EnvironmentOperationsPayload]
Represents payload for any Environment operations like get, start, stop,
connect
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Starts",
"an",
"environment",
"by",
"starting",
"all",
"resources",
"inside",
"the",
"environment",
".",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb#L950-L953 | train | Starts an environment. | [
30522,
13366,
4088,
1035,
2707,
1035,
4044,
1006,
5310,
1035,
2171,
1010,
4044,
1035,
3136,
1035,
18093,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
2707,
1035,
4044,
1035,
2004,
6038,
2278,
1006,
5310,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb | Azure::MediaServices::Mgmt::V2018_07_01.LiveEvents.stop | def stop(resource_group_name, account_name, live_event_name, parameters, custom_headers:nil)
response = stop_async(resource_group_name, account_name, live_event_name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def stop(resource_group_name, account_name, live_event_name, parameters, custom_headers:nil)
response = stop_async(resource_group_name, account_name, live_event_name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"stop",
"(",
"resource_group_name",
",",
"account_name",
",",
"live_event_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"stop_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"live_event_name",
",",
"parameter... | Stop Live Event
Stops an existing Live Event.
@param resource_group_name [String] The name of the resource group within the
Azure subscription.
@param account_name [String] The Media Services account name.
@param live_event_name [String] The name of the Live Event.
@param parameters [LiveEventActionInput] LiveEvent stop parameters
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Stop",
"Live",
"Event"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb#L436-L439 | train | Stops the live event. | [
30522,
13366,
2644,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
2444,
1035,
2724,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2644,
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... |
etewiah/property_web_builder | app/models/pwb/website.rb | Pwb.Website.get_element_class | def get_element_class(element_name)
style_details = style_variables_for_theme["vic"] || Pwb::PresetStyle.default_values
style_associations = style_details["associations"] || []
style_associations[element_name] || ""
end | ruby | def get_element_class(element_name)
style_details = style_variables_for_theme["vic"] || Pwb::PresetStyle.default_values
style_associations = style_details["associations"] || []
style_associations[element_name] || ""
end | [
"def",
"get_element_class",
"(",
"element_name",
")",
"style_details",
"=",
"style_variables_for_theme",
"[",
"\"vic\"",
"]",
"||",
"Pwb",
"::",
"PresetStyle",
".",
"default_values",
"style_associations",
"=",
"style_details",
"[",
"\"associations\"",
"]",
"||",
"[",
... | spt 2017 - above 2 will be redundant once vic becomes default layout
below used when rendering to decide which class names
to use for which elements | [
"spt",
"2017",
"-",
"above",
"2",
"will",
"be",
"redundant",
"once",
"vic",
"becomes",
"default",
"layout",
"below",
"used",
"when",
"rendering",
"to",
"decide",
"which",
"class",
"names",
"to",
"use",
"for",
"which",
"elements"
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/models/pwb/website.rb#L152-L156 | train | Returns the class of the element with the given name. | [
30522,
13366,
2131,
1035,
5783,
1035,
2465,
1006,
5783,
1035,
2171,
1007,
2806,
1035,
4751,
1027,
2806,
1035,
10857,
1035,
2005,
1035,
4323,
1031,
1000,
10967,
1000,
1033,
1064,
1064,
1052,
2860,
2497,
1024,
1024,
3653,
13462,
21756,
2571,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/2017-06-01-preview/generated/azure_mgmt_container_registry/webhooks.rb | Azure::ContainerRegistry::Mgmt::V2017_06_01_preview.Webhooks.update | def update(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
response = update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
response = update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update",
"(",
"resource_group_name",
",",
"registry_name",
",",
"webhook_name",
",",
"webhook_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"webhook_name",
",... | Updates a webhook 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 webhook_name [String] The name of the webhook.
@param webhook_update_parameters [WebhookUpdateParameters] The parameters for
updating a webhook.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Webhook] operation results. | [
"Updates",
"a",
"webhook",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/webhooks.rb#L235-L238 | train | Updates a webhook. | [
30522,
13366,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
4773,
6806,
6559,
1035,
2171,
1010,
4773,
6806,
6559,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
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... |
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.invoke_infrastructure_command_with_http_info | def invoke_infrastructure_command_with_http_info(command, service_id:nil, timeout:60, custom_headers:nil)
invoke_infrastructure_command_async(command, service_id:service_id, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def invoke_infrastructure_command_with_http_info(command, service_id:nil, timeout:60, custom_headers:nil)
invoke_infrastructure_command_async(command, service_id:service_id, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"invoke_infrastructure_command_with_http_info",
"(",
"command",
",",
"service_id",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"invoke_infrastructure_command_async",
"(",
"command",
",",
"service_id",
":service_id",
",",
"time... | Invokes an administrative command on the given Infrastructure Service
instance.
For clusters that have one or more instances of the Infrastructure Service
configured,
this API provides a way to send infrastructure-specific commands to a
particular
instance of the Infrastructure Service.
Available commands and their corresponding response formats vary depending
upon
the infrastructure on which the cluster is running.
This API supports the Service Fabric platform; it is not meant to be used
directly from your code.
@param command [String] The text of the command to be invoked. The content of
the command is infrastructure-specific.
@param service_id [String] The identity of the infrastructure service. This
is the full name of the infrastructure service without the 'fabric:' URI
scheme. This parameter required only for the cluster that have more than one
instance of infrastructure service running.
@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. | [
"Invokes",
"an",
"administrative",
"command",
"on",
"the",
"given",
"Infrastructure",
"Service",
"instance",
"."
] | 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#L20384-L20386 | train | Invoke an infrastructure command. | [
30522,
13366,
1999,
6767,
3489,
1035,
6502,
1035,
3094,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
3094,
1010,
2326,
1035,
8909,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/user.rb | Azure::ApiManagement::Mgmt::V2018_01_01.User.generate_sso_url_with_http_info | def generate_sso_url_with_http_info(resource_group_name, service_name, uid, custom_headers:nil)
generate_sso_url_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value!
end | ruby | def generate_sso_url_with_http_info(resource_group_name, service_name, uid, custom_headers:nil)
generate_sso_url_async(resource_group_name, service_name, uid, custom_headers:custom_headers).value!
end | [
"def",
"generate_sso_url_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"uid",
",",
"custom_headers",
":",
"nil",
")",
"generate_sso_url_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"uid",
",",
"custom_headers",
":custom_headers",
... | Retrieves a redirection URL containing an authentication token for signing a
given user into the developer portal.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param uid [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. | [
"Retrieves",
"a",
"redirection",
"URL",
"containing",
"an",
"authentication",
"token",
"for",
"signing",
"a",
"given",
"user",
"into",
"the",
"developer",
"portal",
"."
] | 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/user.rb#L869-L871 | train | Generate SSO URL for the specified App Service plan. | [
30522,
13366,
9699,
1035,
7020,
2080,
1035,
24471,
2140,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
21318,
2094,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
9699,
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... |
Katello/katello | app/models/katello/pulp_sync_status.rb | Katello.PulpSyncProgress.format_errors | def format_errors(details)
errors = {messages: [], details: []}
if details && !details.key?(:finished_count)
details.each do |step, report|
if step == "content"
parse_content(report, errors)
else
parse_generic(report, errors)
end
end
end
errors
end | ruby | def format_errors(details)
errors = {messages: [], details: []}
if details && !details.key?(:finished_count)
details.each do |step, report|
if step == "content"
parse_content(report, errors)
else
parse_generic(report, errors)
end
end
end
errors
end | [
"def",
"format_errors",
"(",
"details",
")",
"errors",
"=",
"{",
"messages",
":",
"[",
"]",
",",
"details",
":",
"[",
"]",
"}",
"if",
"details",
"&&",
"!",
"details",
".",
"key?",
"(",
":finished_count",
")",
"details",
".",
"each",
"do",
"|",
"step"... | Possible formats coming from pulp
We ignore this case:
{'finished_count' => {}}
We extract from this case:
{'content' => {'error' => ''},
'errata' => {'error' => ''},
'packages' => {'error' => ''},
'metadata' => {'error_details => ''}
} | [
"Possible",
"formats",
"coming",
"from",
"pulp"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/pulp_sync_status.rb#L68-L82 | train | Format errors | [
30522,
13366,
4289,
1035,
10697,
1006,
4751,
1007,
10697,
1027,
1063,
7696,
1024,
1031,
1033,
1010,
4751,
1024,
1031,
1033,
1065,
2065,
4751,
1004,
1004,
999,
4751,
1012,
3145,
1029,
1006,
1024,
2736,
1035,
4175,
1007,
4751,
1012,
2169,
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... |
meew0/discordrb | lib/discordrb/logger.rb | Discordrb.Logger.mode= | def mode=(value)
case value
when :debug
@enabled_modes = %i[debug good info warn error out in ratelimit]
when :verbose
@enabled_modes = %i[good info warn error out in ratelimit]
when :normal
@enabled_modes = %i[info warn error ratelimit]
when :quiet
@enabled_modes = %i[warn error]
when :silent
@enabled_modes = %i[]
end
end | ruby | def mode=(value)
case value
when :debug
@enabled_modes = %i[debug good info warn error out in ratelimit]
when :verbose
@enabled_modes = %i[good info warn error out in ratelimit]
when :normal
@enabled_modes = %i[info warn error ratelimit]
when :quiet
@enabled_modes = %i[warn error]
when :silent
@enabled_modes = %i[]
end
end | [
"def",
"mode",
"=",
"(",
"value",
")",
"case",
"value",
"when",
":debug",
"@enabled_modes",
"=",
"%i[",
"debug",
"good",
"info",
"warn",
"error",
"out",
"in",
"ratelimit",
"]",
"when",
":verbose",
"@enabled_modes",
"=",
"%i[",
"good",
"info",
"warn",
"erro... | Sets the logging mode
Possible modes are:
* :debug logs everything
* :verbose logs everything except for debug messages
* :normal logs useful information, warnings and errors
* :quiet only logs warnings and errors
* :silent logs nothing
@param value [Symbol] What logging mode to use | [
"Sets",
"the",
"logging",
"mode",
"Possible",
"modes",
"are",
":",
"*",
":",
"debug",
"logs",
"everything",
"*",
":",
"verbose",
"logs",
"everything",
"except",
"for",
"debug",
"messages",
"*",
":",
"normal",
"logs",
"useful",
"information",
"warnings",
"and... | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/logger.rb#L66-L79 | train | Set the mode of the object. | [
30522,
13366,
5549,
1027,
1006,
3643,
1007,
2553,
3643,
2043,
1024,
2139,
8569,
2290,
1030,
9124,
1035,
11583,
1027,
1003,
1045,
1031,
2139,
8569,
2290,
2204,
18558,
11582,
7561,
2041,
1999,
3446,
17960,
4183,
1033,
2043,
1024,
12034,
9232,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
mikel/mail | lib/mail/network/retriever_methods/base.rb | Mail.Retriever.last | def last(options = nil, &block)
options = options ? Hash[options] : {}
options[:what] = :last
options[:count] ||= 1
find(options, &block)
end | ruby | def last(options = nil, &block)
options = options ? Hash[options] : {}
options[:what] = :last
options[:count] ||= 1
find(options, &block)
end | [
"def",
"last",
"(",
"options",
"=",
"nil",
",",
"&",
"block",
")",
"options",
"=",
"options",
"?",
"Hash",
"[",
"options",
"]",
":",
"{",
"}",
"options",
"[",
":what",
"]",
"=",
":last",
"options",
"[",
":count",
"]",
"||=",
"1",
"find",
"(",
"op... | Get the most recent received email(s)
Possible options:
count: number of emails to retrieve. The default value is 1.
order: order of emails returned. Possible values are :asc or :desc. Default value is :asc. | [
"Get",
"the",
"most",
"recent",
"received",
"email",
"(",
"s",
")"
] | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/network/retriever_methods/base.rb#L27-L32 | train | Returns the last element in the list | [
30522,
13366,
2197,
1006,
7047,
1027,
9152,
2140,
1010,
1004,
3796,
1007,
7047,
1027,
7047,
1029,
23325,
1031,
7047,
1033,
1024,
1063,
1065,
7047,
1031,
1024,
2054,
1033,
1027,
1024,
2197,
7047,
1031,
1024,
4175,
1033,
1064,
1064,
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... |
sunspot/sunspot | sunspot/lib/sunspot/schema.rb | Sunspot.Schema.to_xml | def to_xml
template_path = File.join(File.dirname(__FILE__), '..', '..', 'templates', 'schema.xml.erb')
template_text = File.read(template_path)
erb = if RUBY_VERSION >= '2.6'
ERB.new(template_text, trim_mode: '-')
else
ERB.new(template_text, nil, '-')
end
erb.result(binding)
end | ruby | def to_xml
template_path = File.join(File.dirname(__FILE__), '..', '..', 'templates', 'schema.xml.erb')
template_text = File.read(template_path)
erb = if RUBY_VERSION >= '2.6'
ERB.new(template_text, trim_mode: '-')
else
ERB.new(template_text, nil, '-')
end
erb.result(binding)
end | [
"def",
"to_xml",
"template_path",
"=",
"File",
".",
"join",
"(",
"File",
".",
"dirname",
"(",
"__FILE__",
")",
",",
"'..'",
",",
"'..'",
",",
"'templates'",
",",
"'schema.xml.erb'",
")",
"template_text",
"=",
"File",
".",
"read",
"(",
"template_path",
")",... | Return an XML representation of this schema using the ERB template | [
"Return",
"an",
"XML",
"representation",
"of",
"this",
"schema",
"using",
"the",
"ERB",
"template"
] | 31dd76cd7a14a4ef7bd541de97483d8cd72ff685 | https://github.com/sunspot/sunspot/blob/31dd76cd7a14a4ef7bd541de97483d8cd72ff685/sunspot/lib/sunspot/schema.rb#L90-L101 | train | Convert the schema to an XML object. | [
30522,
13366,
2000,
1035,
20950,
23561,
1035,
4130,
1027,
5371,
1012,
3693,
1006,
5371,
1012,
16101,
18442,
1006,
1035,
1035,
5371,
1035,
1035,
1007,
1010,
1005,
1012,
1012,
1005,
1010,
1005,
1012,
1012,
1005,
1010,
1005,
23561,
2015,
1005,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_resources/lib/2016-02-01/generated/azure_mgmt_resources/tags.rb | Azure::Resources::Mgmt::V2016_02_01.Tags.delete_value | def delete_value(tag_name, tag_value, custom_headers:nil)
response = delete_value_async(tag_name, tag_value, custom_headers:custom_headers).value!
nil
end | ruby | def delete_value(tag_name, tag_value, custom_headers:nil)
response = delete_value_async(tag_name, tag_value, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete_value",
"(",
"tag_name",
",",
"tag_value",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_value_async",
"(",
"tag_name",
",",
"tag_value",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Delete a subscription resource tag value.
@param tag_name [String] The name of the tag.
@param tag_value [String] The value of the tag.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"a",
"subscription",
"resource",
"tag",
"value",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/tags.rb#L33-L36 | train | Deletes a tag value. | [
30522,
13366,
3972,
12870,
1035,
3643,
1006,
6415,
1035,
2171,
1010,
6415,
1035,
3643,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
3643,
1035,
2004,
6038,
2278,
1006,
6415,
1035,
2171,
1010,
6415,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/server_endpoints.rb | Azure::StorageSync::Mgmt::V2018_07_01.ServerEndpoints.list_by_sync_group | def list_by_sync_group(resource_group_name, storage_sync_service_name, sync_group_name, custom_headers:nil)
response = list_by_sync_group_async(resource_group_name, storage_sync_service_name, sync_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_sync_group(resource_group_name, storage_sync_service_name, sync_group_name, custom_headers:nil)
response = list_by_sync_group_async(resource_group_name, storage_sync_service_name, sync_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_sync_group",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"sync_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_sync_group_async",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"sync_g... | Get a ServerEndpoint list.
@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 sync_group_name [String] Name of Sync Group resource.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ServerEndpointArray] operation results. | [
"Get",
"a",
"ServerEndpoint",
"list",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/server_endpoints.rb#L302-L305 | train | Gets the list of all the image documents in a sync group. | [
30522,
13366,
2862,
1035,
2011,
1035,
26351,
1035,
2177,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5527,
1035,
26351,
1035,
2326,
1035,
2171,
1010,
26351,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-dynamodb/lib/aws-sdk-dynamodb/table.rb | Aws::DynamoDB.Table.query | def query(options = {})
options = options.merge(table_name: @name)
resp = @client.query(options)
resp.data
end | ruby | def query(options = {})
options = options.merge(table_name: @name)
resp = @client.query(options)
resp.data
end | [
"def",
"query",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"table_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"query",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
table.query({
index_name: "IndexName",
select: "ALL_ATTRIBUTES", # accepts ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT
attributes_to_get: ["AttributeName"],
limit: 1,
consistent_read: false,
key_conditions: {
"AttributeName" => {
attribute_value_list: ["value"], # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
comparison_operator: "EQ", # required, accepts EQ, NE, IN, LE, LT, GE, GT, BETWEEN, NOT_NULL, NULL, CONTAINS, NOT_CONTAINS, BEGINS_WITH
},
},
query_filter: {
"AttributeName" => {
attribute_value_list: ["value"], # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
comparison_operator: "EQ", # required, accepts EQ, NE, IN, LE, LT, GE, GT, BETWEEN, NOT_NULL, NULL, CONTAINS, NOT_CONTAINS, BEGINS_WITH
},
},
conditional_operator: "AND", # accepts AND, OR
scan_index_forward: false,
exclusive_start_key: {
"AttributeName" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
},
return_consumed_capacity: "INDEXES", # accepts INDEXES, TOTAL, NONE
projection_expression: "ProjectionExpression",
filter_expression: "ConditionExpression",
key_condition_expression: "KeyExpression",
expression_attribute_names: {
"ExpressionAttributeNameVariable" => "AttributeName",
},
expression_attribute_values: {
"ExpressionAttributeValueVariable" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
},
})
@param [Hash] options ({})
@option options [String] :index_name
The name of an index to query. This index can be any local secondary
index or global secondary index on the table. Note that if you use the
`IndexName` parameter, you must also provide `TableName.`
@option options [String] :select
The attributes to be returned in the result. You can retrieve all item
attributes, specific item attributes, the count of matching items, or
in the case of an index, some or all of the attributes projected into
the index.
* `ALL_ATTRIBUTES` - Returns all of the item attributes from the
specified table or index. If you query a local secondary index, then
for each matching item in the index DynamoDB will fetch the entire
item from the parent table. If the index is configured to project
all item attributes, then all of the data can be obtained from the
local secondary index, and no fetching is required.
* `ALL_PROJECTED_ATTRIBUTES` - Allowed only when querying an index.
Retrieves all attributes that have been projected into the index. If
the index is configured to project all attributes, this return value
is equivalent to specifying `ALL_ATTRIBUTES`.
* `COUNT` - Returns the number of matching items, rather than the
matching items themselves.
* `SPECIFIC_ATTRIBUTES` - Returns only the attributes listed in
`AttributesToGet`. This return value is equivalent to specifying
`AttributesToGet` without specifying any value for `Select`.
If you query or scan a local secondary index and request only
attributes that are projected into that index, the operation will
read only the index and not the table. If any of the requested
attributes are not projected into the local secondary index,
DynamoDB will fetch each of these attributes from the parent table.
This extra fetching incurs additional throughput cost and latency.
If you query or scan a global secondary index, you can only request
attributes that are projected into the index. Global secondary index
queries cannot fetch attributes from the parent table.
If neither `Select` nor `AttributesToGet` are specified, DynamoDB
defaults to `ALL_ATTRIBUTES` when accessing a table, and
`ALL_PROJECTED_ATTRIBUTES` when accessing an index. You cannot use
both `Select` and `AttributesToGet` together in a single request,
unless the value for `Select` is `SPECIFIC_ATTRIBUTES`. (This usage is
equivalent to specifying `AttributesToGet` without any value for
`Select`.)
<note markdown="1"> If you use the `ProjectionExpression` parameter, then the value for
`Select` can only be `SPECIFIC_ATTRIBUTES`. Any other value for
`Select` will return an error.
</note>
@option options [Array<String>] :attributes_to_get
This is a legacy parameter. Use `ProjectionExpression` instead. For
more information, see [AttributesToGet][1] in the *Amazon DynamoDB
Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html
@option options [Integer] :limit
The maximum number of items to evaluate (not necessarily the number of
matching items). If DynamoDB processes the number of items up to the
limit while processing the results, it stops the operation and returns
the matching values up to that point, and a key in `LastEvaluatedKey`
to apply in a subsequent operation, so that you can pick up where you
left off. Also, if the processed data set size exceeds 1 MB before
DynamoDB reaches this limit, it stops the operation and returns the
matching values up to the limit, and a key in `LastEvaluatedKey` to
apply in a subsequent operation to continue the operation. For more
information, see [Query and Scan][1] in the *Amazon DynamoDB Developer
Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html
@option options [Boolean] :consistent_read
Determines the read consistency model: If set to `true`, then the
operation uses strongly consistent reads; otherwise, the operation
uses eventually consistent reads.
Strongly consistent reads are not supported on global secondary
indexes. If you query a global secondary index with `ConsistentRead`
set to `true`, you will receive a `ValidationException`.
@option options [Hash<String,Types::Condition>] :key_conditions
This is a legacy parameter. Use `KeyConditionExpression` instead. For
more information, see [KeyConditions][1] in the *Amazon DynamoDB
Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html
@option options [Hash<String,Types::Condition>] :query_filter
This is a legacy parameter. Use `FilterExpression` instead. For more
information, see [QueryFilter][1] in the *Amazon DynamoDB Developer
Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html
@option options [String] :conditional_operator
This is a legacy parameter. Use `FilterExpression` instead. For more
information, see [ConditionalOperator][1] in the *Amazon DynamoDB
Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html
@option options [Boolean] :scan_index_forward
Specifies the order for index traversal: If `true` (default), the
traversal is performed in ascending order; if `false`, the traversal
is performed in descending order.
Items with the same partition key value are stored in sorted order by
sort key. If the sort key data type is Number, the results are stored
in numeric order. For type String, the results are stored in order of
UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary
data as unsigned.
If `ScanIndexForward` is `true`, DynamoDB returns the results in the
order in which they are stored (by sort key value). This is the
default behavior. If `ScanIndexForward` is `false`, DynamoDB reads the
results in reverse order by sort key value, and then returns the
results to the client.
@option options [Hash<String,Types::AttributeValue>] :exclusive_start_key
The primary key of the first item that this operation will evaluate.
Use the value that was returned for `LastEvaluatedKey` in the previous
operation.
The data type for `ExclusiveStartKey` must be String, Number or
Binary. No set data types are allowed.
@option options [String] :return_consumed_capacity
Determines the level of detail about provisioned throughput
consumption that is returned in the response:
* `INDEXES` - The response includes the aggregate `ConsumedCapacity`
for the operation, together with `ConsumedCapacity` for each table
and secondary index that was accessed.
Note that some operations, such as `GetItem` and `BatchGetItem`, do
not access any indexes at all. In these cases, specifying `INDEXES`
will only return `ConsumedCapacity` information for table(s).
* `TOTAL` - The response includes only the aggregate
`ConsumedCapacity` for the operation.
* `NONE` - No `ConsumedCapacity` details are included in the response.
@option options [String] :projection_expression
A string that identifies one or more attributes to retrieve from the
table. These attributes can include scalars, sets, or elements of a
JSON document. The attributes in the expression must be separated by
commas.
If no attribute names are specified, then all attributes will be
returned. If any of the requested attributes are not found, they will
not appear in the result.
For more information, see [Accessing Item Attributes][1] in the
*Amazon DynamoDB Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html
@option options [String] :filter_expression
A string that contains conditions that DynamoDB applies after the
`Query` operation, but before the data is returned to you. Items that
do not satisfy the `FilterExpression` criteria are not returned.
A `FilterExpression` does not allow key attributes. You cannot define
a filter expression based on a partition key or a sort key.
<note markdown="1"> A `FilterExpression` is applied after the items have already been
read; the process of filtering does not consume any additional read
capacity units.
</note>
For more information, see [Filter Expressions][1] in the *Amazon
DynamoDB Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults
@option options [String] :key_condition_expression
The condition that specifies the key value(s) for items to be
retrieved by the `Query` action.
The condition must perform an equality test on a single partition key
value.
The condition can optionally perform one of several comparison tests
on a single sort key value. This allows `Query` to retrieve one item
with a given partition key value and sort key value, or several items
that have the same partition key value but different sort key values.
The partition key equality test is required, and must be specified in
the following format:
`partitionKeyName` *=* `:partitionkeyval`
If you also want to provide a condition for the sort key, it must be
combined using `AND` with the condition for the sort key. Following is
an example, using the **=** comparison operator for the sort key:
`partitionKeyName` `=` `:partitionkeyval` `AND` `sortKeyName` `=`
`:sortkeyval`
Valid comparisons for the sort key condition are as follows:
* `sortKeyName` `=` `:sortkeyval` - true if the sort key value is
equal to `:sortkeyval`.
* `sortKeyName` `<` `:sortkeyval` - true if the sort key value is less
than `:sortkeyval`.
* `sortKeyName` `<=` `:sortkeyval` - true if the sort key value is
less than or equal to `:sortkeyval`.
* `sortKeyName` `>` `:sortkeyval` - true if the sort key value is
greater than `:sortkeyval`.
* `sortKeyName` `>= ` `:sortkeyval` - true if the sort key value is
greater than or equal to `:sortkeyval`.
* `sortKeyName` `BETWEEN` `:sortkeyval1` `AND` `:sortkeyval2` - true
if the sort key value is greater than or equal to `:sortkeyval1`,
and less than or equal to `:sortkeyval2`.
* `begins_with (` `sortKeyName`, `:sortkeyval` `)` - true if the sort
key value begins with a particular operand. (You cannot use this
function with a sort key that is of type Number.) Note that the
function name `begins_with` is case-sensitive.
Use the `ExpressionAttributeValues` parameter to replace tokens such
as `:partitionval` and `:sortval` with actual values at runtime.
You can optionally use the `ExpressionAttributeNames` parameter to
replace the names of the partition key and sort key with placeholder
tokens. This option might be necessary if an attribute name conflicts
with a DynamoDB reserved word. For example, the following
`KeyConditionExpression` parameter causes an error because *Size* is a
reserved word:
* `Size = :myval`
^
To work around this, define a placeholder (such a `#S`) to represent
the attribute name *Size*. `KeyConditionExpression` then is as
follows:
* `#S = :myval`
^
For a list of reserved words, see [Reserved Words][1] in the *Amazon
DynamoDB Developer Guide*.
For more information on `ExpressionAttributeNames` and
`ExpressionAttributeValues`, see [Using Placeholders for Attribute
Names and Values][2] in the *Amazon DynamoDB Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html
[2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ExpressionPlaceholders.html
@option options [Hash<String,String>] :expression_attribute_names
One or more substitution tokens for attribute names in an expression.
The following are some use cases for using
`ExpressionAttributeNames`\:
* To access an attribute whose name conflicts with a DynamoDB reserved
word.
* To create a placeholder for repeating occurrences of an attribute
name in an expression.
* To prevent special characters in an attribute name from being
misinterpreted in an expression.
Use the **#** character in an expression to dereference an attribute
name. For example, consider the following attribute name:
* `Percentile`
^
The name of this attribute conflicts with a reserved word, so it
cannot be used directly in an expression. (For the complete list of
reserved words, see [Reserved Words][1] in the *Amazon DynamoDB
Developer Guide*). To work around this, you could specify the
following for `ExpressionAttributeNames`\:
* `\{"#P":"Percentile"\}`
^
You could then use this substitution in an expression, as in this
example:
* `#P = :val`
^
<note markdown="1"> Tokens that begin with the **\:** character are *expression attribute
values*, which are placeholders for the actual value at runtime.
</note>
For more information on expression attribute names, see [Accessing
Item Attributes][2] in the *Amazon DynamoDB Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html
[2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html
@option options [Hash<String,Types::AttributeValue>] :expression_attribute_values
One or more values that can be substituted in an expression.
Use the **\:** (colon) character in an expression to dereference an
attribute value. For example, suppose that you wanted to check whether
the value of the *ProductStatus* attribute was one of the following:
`Available | Backordered | Discontinued`
You would first need to specify `ExpressionAttributeValues` as
follows:
`\{ ":avail":\{"S":"Available"\}, ":back":\{"S":"Backordered"\},
":disc":\{"S":"Discontinued"\} \}`
You could then use these values in an expression, such as this:
`ProductStatus IN (:avail, :back, :disc)`
For more information on expression attribute values, see [Specifying
Conditions][1] in the *Amazon DynamoDB Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html
@return [Types::QueryOutput] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/table.rb#L1357-L1361 | train | Returns the number of rows in the table | [
30522,
13366,
23032,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2795,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
23032,
1006,
7047,
1007,
24501,
2361,
1012,
2951,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_trigger_rollover_with_http_info | def begin_trigger_rollover_with_http_info(resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers:nil)
begin_trigger_rollover_async(resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_trigger_rollover_with_http_info(resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers:nil)
begin_trigger_rollover_async(resource_group_name, storage_sync_service_name, server_id, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_trigger_rollover_with_http_info",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"server_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_trigger_rollover_async",
"(",
"resource_group_name",
",",
"storage_sync_service_name... | Triggers Server certificate rollover.
@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] Server Id
@param parameters [TriggerRolloverRequest] Body of Trigger Rollover request.
@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. | [
"Triggers",
"Server",
"certificate",
"rollover",
"."
] | 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#L625-L627 | train | Trigger rollover of a server. | [
30522,
13366,
4088,
1035,
9495,
1035,
4897,
7840,
1035,
2007,
1035,
8299,
1035,
18558,
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,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.text_field | def text_field(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'text_field_for', &block)
define_method(name) do
return platform.text_field_value_for identifier.clone unless block_given?
self.send("#{name}_element").value
end
define_method("#{name}=") do |value|
return platform.text_field_value_set(identifier.clone, value) unless block_given?
self.send("#{name}_element").value = value
end
end | ruby | def text_field(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'text_field_for', &block)
define_method(name) do
return platform.text_field_value_for identifier.clone unless block_given?
self.send("#{name}_element").value
end
define_method("#{name}=") do |value|
return platform.text_field_value_set(identifier.clone, value) unless block_given?
self.send("#{name}_element").value = value
end
end | [
"def",
"text_field",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'text_field_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
"ret... | adds four methods to the page object - one to set text in a text field,
another to retrieve text from a text field, another to return the text
field element, another to check the text field's existence.
@example
text_field(:first_name, :id => "first_name")
# will generate 'first_name', 'first_name=', 'first_name_element',
# 'first_name?' methods
@param [String] the name used for the generated methods
@param [Hash] identifier how we find a text field.
@param optional block to be invoked when element method is called | [
"adds",
"four",
"methods",
"to",
"the",
"page",
"object",
"-",
"one",
"to",
"set",
"text",
"in",
"a",
"text",
"field",
"another",
"to",
"retrieve",
"text",
"from",
"a",
"text",
"field",
"another",
"to",
"return",
"the",
"text",
"field",
"element",
"anoth... | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L196-L206 | train | Creates a text field. | [
30522,
13366,
3793,
1035,
2492,
1006,
2171,
1010,
8909,
4765,
18095,
1027,
1063,
1024,
5950,
1027,
1028,
1014,
1065,
1010,
1004,
3796,
1007,
3115,
1035,
4725,
1006,
2171,
1010,
8909,
4765,
18095,
1010,
1005,
3793,
1035,
2492,
1035,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replicationv_centers.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationvCenters.delete | def delete(fabric_name, v_center_name, custom_headers:nil)
response = delete_async(fabric_name, v_center_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(fabric_name, v_center_name, custom_headers:nil)
response = delete_async(fabric_name, v_center_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"fabric_name",
",",
"v_center_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"fabric_name",
",",
"v_center_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Remove vCenter operation.
The operation to remove(unregister) a registered vCenter server from the
vault.
@param fabric_name [String] Fabric name.
@param v_center_name [String] vCenter name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Remove",
"vCenter",
"operation",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replicationv_centers.rb#L279-L282 | train | Deletes a virtual network in a fabric. | [
30522,
13366,
3972,
12870,
1006,
8313,
1035,
2171,
1010,
1058,
1035,
2415,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
8313,
1035,
2171,
1010,
1058,
1035,
2415,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-rds/lib/aws-sdk-rds/db_snapshot.rb | Aws::RDS.DBSnapshot.restore | def restore(options = {})
options = options.merge(db_snapshot_identifier: @snapshot_id)
resp = @client.restore_db_instance_from_db_snapshot(options)
DBInstance.new(
id: resp.data.db_instance.db_instance_identifier,
data: resp.data.db_instance,
client: @client
)
end | ruby | def restore(options = {})
options = options.merge(db_snapshot_identifier: @snapshot_id)
resp = @client.restore_db_instance_from_db_snapshot(options)
DBInstance.new(
id: resp.data.db_instance.db_instance_identifier,
data: resp.data.db_instance,
client: @client
)
end | [
"def",
"restore",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"db_snapshot_identifier",
":",
"@snapshot_id",
")",
"resp",
"=",
"@client",
".",
"restore_db_instance_from_db_snapshot",
"(",
"options",
")",
"DBInstance",
".",
... | @example Request syntax with placeholder values
dbinstance = db_snapshot.restore({
db_instance_identifier: "String", # required
db_instance_class: "String",
port: 1,
availability_zone: "String",
db_subnet_group_name: "String",
multi_az: false,
publicly_accessible: false,
auto_minor_version_upgrade: false,
license_model: "String",
db_name: "String",
engine: "String",
iops: 1,
option_group_name: "String",
tags: [
{
key: "String",
value: "String",
},
],
storage_type: "String",
tde_credential_arn: "String",
tde_credential_password: "String",
vpc_security_group_ids: ["String"],
domain: "String",
copy_tags_to_snapshot: false,
domain_iam_role_name: "String",
enable_iam_database_authentication: false,
enable_cloudwatch_logs_exports: ["String"],
processor_features: [
{
name: "String",
value: "String",
},
],
use_default_processor_features: false,
db_parameter_group_name: "String",
deletion_protection: false,
})
@param [Hash] options ({})
@option options [required, String] :db_instance_identifier
Name of the DB instance to create from the DB snapshot. This parameter
isn't case-sensitive.
Constraints:
* Must contain from 1 to 63 numbers, letters, or hyphens
* First character must be a letter
* Can't end with a hyphen or contain two consecutive hyphens
Example: `my-snapshot-id`
@option options [String] :db_instance_class
The compute and memory capacity of the Amazon RDS DB instance, for
example, `db.m4.large`. Not all DB instance classes are available in
all AWS Regions, or for all database engines. For the full list of DB
instance classes, and availability for your engine, see [DB Instance
Class][1] in the *Amazon RDS User Guide.*
Default: The same DBInstanceClass as the original DB instance.
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html
@option options [Integer] :port
The port number on which the database accepts connections.
Default: The same port as the original DB instance
Constraints: Value must be `1150-65535`
@option options [String] :availability_zone
The EC2 Availability Zone that the DB instance is created in.
Default: A random, system-chosen Availability Zone.
Constraint: You can't specify the AvailabilityZone parameter if the
MultiAZ parameter is set to `true`.
Example: `us-east-1a`
@option options [String] :db_subnet_group_name
The DB subnet group name to use for the new instance.
Constraints: If supplied, must match the name of an existing
DBSubnetGroup.
Example: `mySubnetgroup`
@option options [Boolean] :multi_az
Specifies if the DB instance is a Multi-AZ deployment.
Constraint: You can't specify the AvailabilityZone parameter if the
MultiAZ parameter is set to `true`.
@option options [Boolean] :publicly_accessible
Specifies the accessibility options for the DB instance. A value of
true specifies an Internet-facing instance with a publicly resolvable
DNS name, which resolves to a public IP address. A value of false
specifies an internal instance with a DNS name that resolves to a
private IP address. For more information, see CreateDBInstance.
@option options [Boolean] :auto_minor_version_upgrade
Indicates that minor version upgrades are applied automatically to the
DB instance during the maintenance window.
@option options [String] :license_model
License model information for the restored DB instance.
Default: Same as source.
Valid values: `license-included` \| `bring-your-own-license` \|
`general-public-license`
@option options [String] :db_name
The database name for the restored DB instance.
<note markdown="1"> This parameter doesn't apply to the MySQL, PostgreSQL, or MariaDB
engines.
</note>
@option options [String] :engine
The database engine to use for the new instance.
Default: The same as source
Constraint: Must be compatible with the engine of the source. For
example, you can restore a MariaDB 10.1 DB instance from a MySQL 5.6
snapshot.
Valid Values:
* `mariadb`
* `mysql`
* `oracle-ee`
* `oracle-se2`
* `oracle-se1`
* `oracle-se`
* `postgres`
* `sqlserver-ee`
* `sqlserver-se`
* `sqlserver-ex`
* `sqlserver-web`
@option options [Integer] :iops
Specifies the amount of provisioned IOPS for the DB instance,
expressed in I/O operations per second. If this parameter is not
specified, the IOPS value is taken from the backup. If this parameter
is set to 0, the new instance is converted to a non-PIOPS instance.
The conversion takes additional time, though your DB instance is
available for connections before the conversion starts.
The provisioned IOPS value must follow the requirements for your
database engine. For more information, see [Amazon RDS Provisioned
IOPS Storage to Improve Performance][1] in the *Amazon RDS User
Guide.*
Constraints: Must be an integer greater than 1000.
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS
@option options [String] :option_group_name
The name of the option group to be used for the restored DB instance.
Permanent options, such as the TDE option for Oracle Advanced Security
TDE, can't be removed from an option group, and that option group
can't be removed from a DB instance once it is associated with a DB
instance
@option options [Array<Types::Tag>] :tags
A list of tags. For more information, see [Tagging Amazon RDS
Resources][1] in the *Amazon RDS User Guide.*
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html
@option options [String] :storage_type
Specifies the storage type to be associated with the DB instance.
Valid values: `standard | gp2 | io1`
If you specify `io1`, you must also include a value for the `Iops`
parameter.
Default: `io1` if the `Iops` parameter is specified, otherwise
`standard`
@option options [String] :tde_credential_arn
The ARN from the key store with which to associate the instance for
TDE encryption.
@option options [String] :tde_credential_password
The password for the given ARN from the key store in order to access
the device.
@option options [Array<String>] :vpc_security_group_ids
A list of EC2 VPC security groups to associate with this DB instance.
Default: The default EC2 VPC security group for the DB subnet group's
VPC.
@option options [String] :domain
Specify the Active Directory Domain to restore the instance in.
@option options [Boolean] :copy_tags_to_snapshot
True to copy all tags from the restored DB instance to snapshots of
the restored DB instance, and otherwise false. The default is false.
@option options [String] :domain_iam_role_name
Specify the name of the IAM role to be used when making API calls to
the Directory Service.
@option options [Boolean] :enable_iam_database_authentication
True to enable mapping of AWS Identity and Access Management (IAM)
accounts to database accounts, and otherwise false.
You can enable IAM database authentication for the following database
engines
* For MySQL 5.6, minor version 5.6.34 or higher
* For MySQL 5.7, minor version 5.7.16 or higher
Default: `false`
@option options [Array<String>] :enable_cloudwatch_logs_exports
The list of logs that the restored DB instance is to export to
CloudWatch Logs. The values in the list depend on the DB engine being
used. For more information, see [Publishing Database Logs to Amazon
CloudWatch Logs][1] in the *Amazon Aurora User Guide*.
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch
@option options [Array<Types::ProcessorFeature>] :processor_features
The number of CPU cores and the number of threads per core for the DB
instance class of the DB instance.
@option options [Boolean] :use_default_processor_features
A value that specifies that the DB instance class of the DB instance
uses its default processor features.
@option options [String] :db_parameter_group_name
The name of the DB parameter group to associate with this DB instance.
If this argument is omitted, the default DBParameterGroup for the
specified engine is used.
Constraints:
* If supplied, must match the name of an existing DBParameterGroup.
* Must be 1 to 255 letters, numbers, or hyphens.
* First character must be a letter.
* Can't end with a hyphen or contain two consecutive hyphens.
@option options [Boolean] :deletion_protection
Indicates if the DB instance should have deletion protection enabled.
The database can't be deleted when this value is set to true. The
default is false. For more information, see [ Deleting a DB
Instance][1].
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html
@return [DBInstance] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_snapshot.rb#L796-L804 | train | Restore the DB Instance from a snapshot | [
30522,
13366,
9239,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
16962,
1035,
20057,
12326,
1035,
8909,
4765,
18095,
1024,
1030,
20057,
12326,
1035,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
9239,
1035,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/overcommit | lib/overcommit/hook_loader/base.rb | Overcommit::HookLoader.Base.create_hook | def create_hook(hook_name)
Overcommit::Hook.const_get(@context.hook_class_name).
const_get(hook_name).
new(@config, @context)
rescue LoadError, NameError => error
raise Overcommit::Exceptions::HookLoadError,
"Unable to load hook '#{hook_name}': #{error}",
error.backtrace
end | ruby | def create_hook(hook_name)
Overcommit::Hook.const_get(@context.hook_class_name).
const_get(hook_name).
new(@config, @context)
rescue LoadError, NameError => error
raise Overcommit::Exceptions::HookLoadError,
"Unable to load hook '#{hook_name}': #{error}",
error.backtrace
end | [
"def",
"create_hook",
"(",
"hook_name",
")",
"Overcommit",
"::",
"Hook",
".",
"const_get",
"(",
"@context",
".",
"hook_class_name",
")",
".",
"const_get",
"(",
"hook_name",
")",
".",
"new",
"(",
"@config",
",",
"@context",
")",
"rescue",
"LoadError",
",",
... | Load and return a {Hook} from a CamelCase hook name. | [
"Load",
"and",
"return",
"a",
"{",
"Hook",
"}",
"from",
"a",
"CamelCase",
"hook",
"name",
"."
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/hook_loader/base.rb#L28-L36 | train | Create a hook | [
30522,
13366,
3443,
1035,
8103,
1006,
8103,
1035,
2171,
1007,
2058,
9006,
22930,
1024,
1024,
8103,
1012,
9530,
3367,
1035,
2131,
1006,
1030,
6123,
1012,
8103,
1035,
2465,
1035,
2171,
1007,
1012,
9530,
3367,
1035,
2131,
1006,
8103,
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_redis/lib/2017-10-01/generated/azure_mgmt_redis/redis.rb | Azure::Redis::Mgmt::V2017_10_01.Redis.list_upgrade_notifications | def list_upgrade_notifications(resource_group_name, name, history, custom_headers:nil)
response = list_upgrade_notifications_async(resource_group_name, name, history, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_upgrade_notifications(resource_group_name, name, history, custom_headers:nil)
response = list_upgrade_notifications_async(resource_group_name, name, history, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_upgrade_notifications",
"(",
"resource_group_name",
",",
"name",
",",
"history",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_upgrade_notifications_async",
"(",
"resource_group_name",
",",
"name",
",",
"history",
",",
"custom_headers",
"... | Gets any upgrade notifications for a Redis cache.
@param resource_group_name [String] The name of the resource group.
@param name [String] The name of the Redis cache.
@param history [Float] how many minutes in past to look for upgrade
notifications
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [NotificationListResponse] operation results. | [
"Gets",
"any",
"upgrade",
"notifications",
"for",
"a",
"Redis",
"cache",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_redis/lib/2017-10-01/generated/azure_mgmt_redis/redis.rb#L126-L129 | train | Gets the list of upgrade notifications for a resource group. | [
30522,
13366,
2862,
1035,
12200,
1035,
26828,
2015,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
2381,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
12200,
1035,
26828,
2015,
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_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb | Azure::Web::Mgmt::V2018_02_01.Recommendations.list_recommended_rules_for_web_app_as_lazy | def list_recommended_rules_for_web_app_as_lazy(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
response = list_recommended_rules_for_web_app_async(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_recommended_rules_for_web_app_as_lazy(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
response = list_recommended_rules_for_web_app_async(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_recommended_rules_for_web_app_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_recommended_rules_for_web_app_as_lazy",
"(",
"resource_group_name",
",",
"site_name",
",",
"featured",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_recommended_rules_for_web_app_async",
"(",
"resource... | Get all recommendations for an app.
Get all recommendations for an app.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Name of the app.
@param featured [Boolean] Specify <code>true</code> to return only the most
critical recommendations. The default is <code>false</code>, which returns
all recommendations.
@param filter [String] Return only channels specified in the filter. Filter
is specified by using OData syntax. Example: $filter=channel eq 'Api' or
channel eq 'Notification'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RecommendationCollection] which provide lazy access to pages of the
response. | [
"Get",
"all",
"recommendations",
"for",
"an",
"app",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb#L1319-L1328 | train | Gets the list of recommended rules for an App Service Environment. | [
30522,
13366,
2862,
1035,
6749,
1035,
3513,
1035,
2005,
1035,
4773,
1035,
10439,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
2956,
1024,
9152,
2140,
1010,
11307,
1024,
9152,
2140,
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... |
piotrmurach/github | lib/github_api/client/projects/columns.rb | Github.Client::Projects::Columns.get | def get(*args)
arguments(args, required: [:column_id])
params = arguments.params
params["accept"] ||= ::Github::Client::Projects::PREVIEW_MEDIA
get_request("/projects/columns/#{arguments.column_id}", params)
end | ruby | def get(*args)
arguments(args, required: [:column_id])
params = arguments.params
params["accept"] ||= ::Github::Client::Projects::PREVIEW_MEDIA
get_request("/projects/columns/#{arguments.column_id}", params)
end | [
"def",
"get",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":column_id",
"]",
")",
"params",
"=",
"arguments",
".",
"params",
"params",
"[",
"\"accept\"",
"]",
"||=",
"::",
"Github",
"::",
"Client",
"::",
"Projects",
"::"... | Get a project columns
@example
github = Github.new
github.projects.columns.get :column_id
@see https://developer.github.com/v3/projects/columns/#get-a-project-column
@api public | [
"Get",
"a",
"project",
"columns"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/projects/columns.rb#L42-L49 | train | Get a column s segmentation | [
30522,
13366,
2131,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5930,
1035,
8909,
1033,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
11498,
5244,
1031,
1000,
5138,
1000,
1033,
1064,
1064,
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... |
fastlane/fastlane | fastlane/lib/fastlane/swift_fastlane_api_generator.rb | Fastlane.SwiftFastlaneAPIGenerator.generate_swift | def generate_swift
self.generated_paths = [] # reset generated paths in case we're called multiple times
file_content = []
file_content << "import Foundation"
tool_details = []
ActionsList.all_actions do |action|
next if self.actions_not_supported.include?(action.action_name)
swift_function = process_action(action: action)
if defined?(swift_function.class_name)
tool_details << SwiftToolDetail.new(
command_line_tool_name: action.action_name,
swift_class: swift_function.class_name,
swift_protocol: swift_function.protocol_name
)
end
unless swift_function
next
end
file_content << swift_function.swift_code
end
file_content << "" # newline because we're adding an extension
file_content << "// These are all the parsing functions needed to transform our data into the expected types"
file_content << generate_lanefile_parsing_functions
tool_objects = generate_lanefile_tool_objects(classes: tool_details.map(&:swift_class))
file_content << tool_objects
new_file_content = file_content.join("\n")
fastlane_swift_api_path = File.join(@target_output_path, "Fastlane.swift")
old_file_content = File.read(fastlane_swift_api_path)
# compare old file content to potential new file content
api_version = determine_api_version(new_file_content: new_file_content, old_file_content: old_file_content)
old_api_version = find_api_version_string(content: old_file_content)
# if there is a change, we need to write out the new file
if api_version != old_api_version
new_file_content.concat(autogen_version_warning_text(api_version: api_version))
File.write(fastlane_swift_api_path, new_file_content)
UI.success(fastlane_swift_api_path)
self.generated_paths << fastlane_swift_api_path
end
default_implementations_path = generate_default_implementations(tool_details: tool_details)
# we might not have any changes, like if it's a hotpatch
self.generated_paths += default_implementations_path if default_implementations_path.length > 0
return self.generated_paths
end | ruby | def generate_swift
self.generated_paths = [] # reset generated paths in case we're called multiple times
file_content = []
file_content << "import Foundation"
tool_details = []
ActionsList.all_actions do |action|
next if self.actions_not_supported.include?(action.action_name)
swift_function = process_action(action: action)
if defined?(swift_function.class_name)
tool_details << SwiftToolDetail.new(
command_line_tool_name: action.action_name,
swift_class: swift_function.class_name,
swift_protocol: swift_function.protocol_name
)
end
unless swift_function
next
end
file_content << swift_function.swift_code
end
file_content << "" # newline because we're adding an extension
file_content << "// These are all the parsing functions needed to transform our data into the expected types"
file_content << generate_lanefile_parsing_functions
tool_objects = generate_lanefile_tool_objects(classes: tool_details.map(&:swift_class))
file_content << tool_objects
new_file_content = file_content.join("\n")
fastlane_swift_api_path = File.join(@target_output_path, "Fastlane.swift")
old_file_content = File.read(fastlane_swift_api_path)
# compare old file content to potential new file content
api_version = determine_api_version(new_file_content: new_file_content, old_file_content: old_file_content)
old_api_version = find_api_version_string(content: old_file_content)
# if there is a change, we need to write out the new file
if api_version != old_api_version
new_file_content.concat(autogen_version_warning_text(api_version: api_version))
File.write(fastlane_swift_api_path, new_file_content)
UI.success(fastlane_swift_api_path)
self.generated_paths << fastlane_swift_api_path
end
default_implementations_path = generate_default_implementations(tool_details: tool_details)
# we might not have any changes, like if it's a hotpatch
self.generated_paths += default_implementations_path if default_implementations_path.length > 0
return self.generated_paths
end | [
"def",
"generate_swift",
"self",
".",
"generated_paths",
"=",
"[",
"]",
"# reset generated paths in case we're called multiple times",
"file_content",
"=",
"[",
"]",
"file_content",
"<<",
"\"import Foundation\"",
"tool_details",
"=",
"[",
"]",
"ActionsList",
".",
"all_act... | stores all file names of generated files (as they are generated) | [
"stores",
"all",
"file",
"names",
"of",
"generated",
"files",
"(",
"as",
"they",
"are",
"generated",
")"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/swift_fastlane_api_generator.rb#L54-L107 | train | Generate the file content for the Swift file | [
30522,
13366,
9699,
1035,
9170,
2969,
1012,
7013,
1035,
10425,
1027,
1031,
1033,
1001,
25141,
7013,
10425,
1999,
2553,
2057,
1005,
2128,
2170,
3674,
2335,
5371,
1035,
4180,
1027,
1031,
1033,
5371,
1035,
4180,
1026,
1026,
1000,
12324,
3192,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_property_info_list | def get_property_info_list(name_id, include_values:false, continuation_token:nil, timeout:60, custom_headers:nil)
response = get_property_info_list_async(name_id, include_values:include_values, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_property_info_list(name_id, include_values:false, continuation_token:nil, timeout:60, custom_headers:nil)
response = get_property_info_list_async(name_id, include_values:include_values, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_property_info_list",
"(",
"name_id",
",",
"include_values",
":",
"false",
",",
"continuation_token",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_property_info_list_async",
"(",
"name_id",
",",
... | Gets information on all Service Fabric properties under a given name.
A Service Fabric name can have one or more named properties that stores
custom information. This operation gets the information about these
properties in a paged list. The information include name, value and metadata
about each of the properties.
@param name_id [String] The Service Fabric name, without the 'fabric:' URI
scheme.
@param include_values [Boolean] Allows specifying whether to include the
values of the properties returned. True if values should be returned with the
metadata; False to return only property metadata.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@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 [PagedPropertyInfoList] operation results. | [
"Gets",
"information",
"on",
"all",
"Service",
"Fabric",
"properties",
"under",
"a",
"given",
"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#L26590-L26593 | train | Gets the property info list for a given App Service Environment. | [
30522,
13366,
2131,
1035,
3200,
1035,
18558,
1035,
2862,
1006,
2171,
1035,
8909,
1010,
2421,
1035,
5300,
1024,
6270,
1010,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
3438,
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... |
mongodb/mongo-ruby-driver | lib/mongo/collection.rb | Mongo.Collection.insert_one | def insert_one(document, opts = {})
client.send(:with_session, opts) do |session|
write_with_retry(session, write_concern) do |server, txn_num|
Operation::Insert.new(
:documents => [ document ],
:db_name => database.name,
:coll_name => name,
:write_concern => write_concern,
:bypass_document_validation => !!opts[:bypass_document_validation],
:options => opts,
:id_generator => client.options[:id_generator],
:session => session,
:txn_num => txn_num
).execute(server)
end
end
end | ruby | def insert_one(document, opts = {})
client.send(:with_session, opts) do |session|
write_with_retry(session, write_concern) do |server, txn_num|
Operation::Insert.new(
:documents => [ document ],
:db_name => database.name,
:coll_name => name,
:write_concern => write_concern,
:bypass_document_validation => !!opts[:bypass_document_validation],
:options => opts,
:id_generator => client.options[:id_generator],
:session => session,
:txn_num => txn_num
).execute(server)
end
end
end | [
"def",
"insert_one",
"(",
"document",
",",
"opts",
"=",
"{",
"}",
")",
"client",
".",
"send",
"(",
":with_session",
",",
"opts",
")",
"do",
"|",
"session",
"|",
"write_with_retry",
"(",
"session",
",",
"write_concern",
")",
"do",
"|",
"server",
",",
"t... | Insert a single document into the collection.
@example Insert a document into the collection.
collection.insert_one({ name: 'test' })
@param [ Hash ] document The document to insert.
@param [ Hash ] opts The insert options.
@option opts [ Session ] :session The session to use for the operation.
@return [ Result ] The database response wrapper.
@since 2.0.0 | [
"Insert",
"a",
"single",
"document",
"into",
"the",
"collection",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/collection.rb#L476-L492 | train | Insert one document into the collection | [
30522,
13366,
19274,
1035,
2028,
1006,
6254,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
7396,
1012,
4604,
1006,
1024,
2007,
1035,
5219,
30524,
1035,
2171,
1027,
1028,
7809,
1012,
2171,
1010,
1024,
8902,
2140,
1035,
2171,
1027,
1028,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.restart_deployed_code_package | def restart_deployed_code_package(node_name, application_id, restart_deployed_code_package_description, timeout:60, custom_headers:nil)
response = restart_deployed_code_package_async(node_name, application_id, restart_deployed_code_package_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def restart_deployed_code_package(node_name, application_id, restart_deployed_code_package_description, timeout:60, custom_headers:nil)
response = restart_deployed_code_package_async(node_name, application_id, restart_deployed_code_package_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"restart_deployed_code_package",
"(",
"node_name",
",",
"application_id",
",",
"restart_deployed_code_package_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"restart_deployed_code_package_async",
"(",
"node_name",
... | Restarts a code package deployed on a Service Fabric node in a cluster.
Restarts a code package deployed on a Service Fabric node in a cluster. This
aborts the code package process, which will restart all the user service
replicas hosted in that process.
@param node_name [String] The name of the node.
@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 restart_deployed_code_package_description
[RestartDeployedCodePackageDescription] Describes the deployed code package
on Service Fabric node to restart.
@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. | [
"Restarts",
"a",
"code",
"package",
"deployed",
"on",
"a",
"Service",
"Fabric",
"node",
"in",
"a",
"cluster",
"."
] | 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#L17251-L17254 | train | Restarts the code package deployed on the node. | [
30522,
13366,
23818,
1035,
7333,
1035,
3642,
1035,
7427,
1006,
13045,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
23818,
1035,
7333,
1035,
3642,
1035,
7427,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
kpumuk/meta-tags | lib/meta_tags/renderer.rb | MetaTags.Renderer.render_links | def render_links(tags)
[ :amphtml, :canonical, :prev, :next, :image_src ].each do |tag_name|
href = meta_tags.extract(tag_name)
if href.present?
@normalized_meta_tags[tag_name] = href
tags << Tag.new(:link, rel: tag_name, href: href)
end
end
end | ruby | def render_links(tags)
[ :amphtml, :canonical, :prev, :next, :image_src ].each do |tag_name|
href = meta_tags.extract(tag_name)
if href.present?
@normalized_meta_tags[tag_name] = href
tags << Tag.new(:link, rel: tag_name, href: href)
end
end
end | [
"def",
"render_links",
"(",
"tags",
")",
"[",
":amphtml",
",",
":canonical",
",",
":prev",
",",
":next",
",",
":image_src",
"]",
".",
"each",
"do",
"|",
"tag_name",
"|",
"href",
"=",
"meta_tags",
".",
"extract",
"(",
"tag_name",
")",
"if",
"href",
".",... | Renders links.
@param [Array<Tag>] tags a buffer object to store tag in. | [
"Renders",
"links",
"."
] | 03585f95edf96cd17024c5c155ce46ec8bc47232 | https://github.com/kpumuk/meta-tags/blob/03585f95edf96cd17024c5c155ce46ec8bc47232/lib/meta_tags/renderer.rb#L152-L160 | train | render links | [
30522,
13366,
17552,
1035,
6971,
1006,
22073,
1007,
1031,
1024,
23713,
11039,
19968,
1010,
1024,
18562,
1010,
1024,
3653,
2615,
1010,
1024,
2279,
1010,
1024,
3746,
1035,
5034,
2278,
1033,
1012,
2169,
2079,
1064,
6415,
1035,
2171,
1064,
1785... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/lab_accounts.rb | Azure::Labservices::Mgmt::V2018_10_15.LabAccounts.list_by_resource_group_with_http_info | def list_by_resource_group_with_http_info(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
end | ruby | def list_by_resource_group_with_http_info(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
end | [
"def",
"list_by_resource_group_with_http_info",
"(",
"resource_group_name",
",",
"expand",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"top",
":",
"nil",
",",
"orderby",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_by_resource_group_async",
"(",
"re... | List lab accounts in a resource group.
@param resource_group_name [String] The name of the resource group.
@param expand [String] Specify the $expand query. Example:
'properties($expand=sizeConfiguration)'
@param filter [String] The filter to apply to the operation.
@param top [Integer] The maximum number of resources to return from the
operation.
@param orderby [String] The ordering expression for the results, using OData
notation.
@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. | [
"List",
"lab",
"accounts",
"in",
"a",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb#L166-L168 | train | Gets the list of all the segmentation elements in a resource group. | [
30522,
13366,
2862,
1035,
2011,
1035,
7692,
1035,
2177,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7818,
1024,
9152,
2140,
1010,
11307,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
2344,
3762,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/forge/errors.rb | Puppet::Forge::Errors.SSLVerifyError.multiline | def multiline
message = []
message << _('Could not connect via HTTPS to %{uri}') % { uri: @uri }
message << _(' Unable to verify the SSL certificate')
message << _(' The certificate may not be signed by a valid CA')
message << _(' The CA bundle included with OpenSSL may not be valid or up to date')
message.join("\n")
end | ruby | def multiline
message = []
message << _('Could not connect via HTTPS to %{uri}') % { uri: @uri }
message << _(' Unable to verify the SSL certificate')
message << _(' The certificate may not be signed by a valid CA')
message << _(' The CA bundle included with OpenSSL may not be valid or up to date')
message.join("\n")
end | [
"def",
"multiline",
"message",
"=",
"[",
"]",
"message",
"<<",
"_",
"(",
"'Could not connect via HTTPS to %{uri}'",
")",
"%",
"{",
"uri",
":",
"@uri",
"}",
"message",
"<<",
"_",
"(",
"' Unable to verify the SSL certificate'",
")",
"message",
"<<",
"_",
"(",
"... | @option options [String] :uri The URI that failed
@option options [String] :original the original exception
Return a multiline version of the error message
@return [String] the multiline version of the error message | [
"@option",
"options",
"[",
"String",
"]",
":",
"uri",
"The",
"URI",
"that",
"failed",
"@option",
"options",
"[",
"String",
"]",
":",
"original",
"the",
"original",
"exception",
"Return",
"a",
"multiline",
"version",
"of",
"the",
"error",
"message"
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/forge/errors.rb#L34-L41 | train | Returns a multiline list of the errors that occurred. | [
30522,
13366,
4800,
4179,
4471,
1027,
1031,
1033,
4471,
1026,
1026,
1035,
1006,
1005,
2071,
2025,
7532,
3081,
16770,
2000,
1003,
1063,
24471,
2072,
1065,
1005,
1007,
1003,
1063,
24471,
2072,
1024,
1030,
24471,
2072,
1065,
4471,
1026,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | activesupport/lib/active_support/array_inquirer.rb | ActiveSupport.ArrayInquirer.any? | def any?(*candidates)
if candidates.none?
super
else
candidates.any? do |candidate|
include?(candidate.to_sym) || include?(candidate.to_s)
end
end
end | ruby | def any?(*candidates)
if candidates.none?
super
else
candidates.any? do |candidate|
include?(candidate.to_sym) || include?(candidate.to_s)
end
end
end | [
"def",
"any?",
"(",
"*",
"candidates",
")",
"if",
"candidates",
".",
"none?",
"super",
"else",
"candidates",
".",
"any?",
"do",
"|",
"candidate",
"|",
"include?",
"(",
"candidate",
".",
"to_sym",
")",
"||",
"include?",
"(",
"candidate",
".",
"to_s",
")",... | Passes each element of +candidates+ collection to ArrayInquirer collection.
The method returns true if any element from the ArrayInquirer collection
is equal to the stringified or symbolized form of any element in the +candidates+ collection.
If +candidates+ collection is not given, method returns true.
variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet])
variants.any? # => true
variants.any?(:phone, :tablet) # => true
variants.any?('phone', 'desktop') # => true
variants.any?(:desktop, :watch) # => false | [
"Passes",
"each",
"element",
"of",
"+",
"candidates",
"+",
"collection",
"to",
"ArrayInquirer",
"collection",
".",
"The",
"method",
"returns",
"true",
"if",
"any",
"element",
"from",
"the",
"ArrayInquirer",
"collection",
"is",
"equal",
"to",
"the",
"stringified"... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/array_inquirer.rb#L25-L33 | train | Returns true if any of the given candidates are available. | [
30522,
13366,
2151,
1029,
1006,
1008,
5347,
1007,
2065,
5347,
1012,
3904,
1029,
3565,
2842,
5347,
1012,
2151,
1029,
2079,
1064,
4018,
1064,
2421,
1029,
1006,
4018,
1012,
2000,
1035,
25353,
2213,
1007,
1064,
1064,
2421,
1029,
1006,
4018,
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... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.h5 | def h5(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h5_for', &block)
define_method(name) do
return platform.h5_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | ruby | def h5(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h5_for', &block)
define_method(name) do
return platform.h5_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | [
"def",
"h5",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'h5_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
"return",
"platfor... | adds three methods - one to retrieve the text of a h5 element,
another to return a h5 element, and another to check for it's existence.
@example
h5(:title, :id => 'title')
# will generate 'title', 'title_element', and 'title?' methods
@param [Symbol] the name used for the generated methods
@param [Hash] identifier how we find a H5.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"text",
"of",
"a",
"h5",
"element",
"another",
"to",
"return",
"a",
"h5",
"element",
"and",
"another",
"to",
"check",
"for",
"it",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L742-L748 | train | Creates a new H5 object. | [
30522,
13366,
1044,
2629,
1006,
2171,
1010,
8909,
4765,
18095,
1027,
1063,
1024,
5950,
1027,
1028,
1014,
1065,
1010,
1004,
3796,
1007,
3115,
1035,
4725,
1006,
2171,
1010,
8909,
4765,
18095,
1010,
1005,
1044,
2629,
1035,
2005,
1005,
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... |
appium/ruby_lib | lib/appium_lib/android/common/helper.rb | Appium.Android.ele_index | def ele_index(class_name, index)
results = tags(class_name)
if index == 'last()'
index = results.length
index -= 1 if index >= 0
else
raise 'Index must be >= 1' unless index >= 1
index -= 1 if index >= 1
end
# uiautomator has issues with index/instance so calculate the index
# client side.
results[index]
end | ruby | def ele_index(class_name, index)
results = tags(class_name)
if index == 'last()'
index = results.length
index -= 1 if index >= 0
else
raise 'Index must be >= 1' unless index >= 1
index -= 1 if index >= 1
end
# uiautomator has issues with index/instance so calculate the index
# client side.
results[index]
end | [
"def",
"ele_index",
"(",
"class_name",
",",
"index",
")",
"results",
"=",
"tags",
"(",
"class_name",
")",
"if",
"index",
"==",
"'last()'",
"index",
"=",
"results",
".",
"length",
"index",
"-=",
"1",
"if",
"index",
">=",
"0",
"else",
"raise",
"'Index must... | Find the element of type class_name at matching index.
@param class_name [String] the class name to find
@param index [Integer] the index
@return [Element] the found element of type class_name | [
"Find",
"the",
"element",
"of",
"type",
"class_name",
"at",
"matching",
"index",
"."
] | 1f5898400dd1928bfe42ddd5f842d1f8738f2f76 | https://github.com/appium/ruby_lib/blob/1f5898400dd1928bfe42ddd5f842d1f8738f2f76/lib/appium_lib/android/common/helper.rb#L147-L161 | train | Returns the index of the element in the list of tags | [
30522,
13366,
3449,
2063,
1035,
5950,
1006,
2465,
1035,
2171,
1010,
5950,
1007,
3463,
1027,
22073,
1006,
2465,
1035,
2171,
1007,
2065,
5950,
1027,
1027,
1005,
2197,
1006,
1007,
30524,
1015,
1005,
4983,
5950,
1028,
1027,
1015,
5950,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/model_break.rb | SquareConnect.ModelBreak.break_type_id= | def break_type_id=(break_type_id)
if break_type_id.nil?
fail ArgumentError, "break_type_id cannot be nil"
end
if break_type_id.to_s.length < 1
fail ArgumentError, "invalid value for 'break_type_id', the character length must be great than or equal to 1."
end
@break_type_id = break_type_id
end | ruby | def break_type_id=(break_type_id)
if break_type_id.nil?
fail ArgumentError, "break_type_id cannot be nil"
end
if break_type_id.to_s.length < 1
fail ArgumentError, "invalid value for 'break_type_id', the character length must be great than or equal to 1."
end
@break_type_id = break_type_id
end | [
"def",
"break_type_id",
"=",
"(",
"break_type_id",
")",
"if",
"break_type_id",
".",
"nil?",
"fail",
"ArgumentError",
",",
"\"break_type_id cannot be nil\"",
"end",
"if",
"break_type_id",
".",
"to_s",
".",
"length",
"<",
"1",
"fail",
"ArgumentError",
",",
"\"invali... | Custom attribute writer method with validation
@param [Object] break_type_id Value to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"with",
"validation"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/model_break.rb#L175-L185 | train | Set the break type id. | [
30522,
13366,
3338,
1035,
2828,
1035,
8909,
1027,
1006,
3338,
1035,
2828,
1035,
8909,
1007,
2065,
3338,
1035,
2828,
30524,
8246,
6685,
2121,
29165,
1010,
1000,
3338,
1035,
2828,
1035,
8909,
3685,
2022,
9152,
2140,
1000,
2203,
2065,
3338,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
kmuto/review | lib/review/latexbuilder.rb | ReVIEW.LATEXBuilder.inline_i | def inline_i(str)
if @book.config.check_version('2', exception: false)
macro('textit', escape(str))
else
macro('reviewit', escape(str))
end
end | ruby | def inline_i(str)
if @book.config.check_version('2', exception: false)
macro('textit', escape(str))
else
macro('reviewit', escape(str))
end
end | [
"def",
"inline_i",
"(",
"str",
")",
"if",
"@book",
".",
"config",
".",
"check_version",
"(",
"'2'",
",",
"exception",
":",
"false",
")",
"macro",
"(",
"'textit'",
",",
"escape",
"(",
"str",
")",
")",
"else",
"macro",
"(",
"'reviewit'",
",",
"escape",
... | index -> italic | [
"index",
"-",
">",
"italic"
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/review/latexbuilder.rb#L1022-L1028 | train | inline_i | [
30522,
13366,
23881,
1035,
1045,
1006,
2358,
2099,
1007,
2065,
1030,
2338,
1012,
9530,
8873,
2290,
1012,
4638,
1035,
2544,
1006,
1005,
1016,
1005,
1010,
6453,
1024,
6270,
1007,
26632,
1006,
1005,
3793,
4183,
1005,
1010,
4019,
1006,
2358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/object_data_types.rb | Azure::Automation::Mgmt::V2015_10_31.ObjectDataTypes.list_fields_by_module_and_type_with_http_info | def list_fields_by_module_and_type_with_http_info(resource_group_name, automation_account_name, module_name, type_name, custom_headers:nil)
list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers:custom_headers).value!
end | ruby | def list_fields_by_module_and_type_with_http_info(resource_group_name, automation_account_name, module_name, type_name, custom_headers:nil)
list_fields_by_module_and_type_async(resource_group_name, automation_account_name, module_name, type_name, custom_headers:custom_headers).value!
end | [
"def",
"list_fields_by_module_and_type_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"module_name",
",",
"type_name",
",",
"custom_headers",
":",
"nil",
")",
"list_fields_by_module_and_type_async",
"(",
"resource_group_name",
",",
"automation... | Retrieve a list of fields of a given type identified by module name.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param module_name [String] The name of module.
@param type_name [String] The name of type.
@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. | [
"Retrieve",
"a",
"list",
"of",
"fields",
"of",
"a",
"given",
"type",
"identified",
"by",
"module",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/object_data_types.rb#L53-L55 | train | Gets the list of fields of a module and type. | [
30522,
13366,
2862,
1035,
4249,
1035,
2011,
1035,
11336,
1035,
1998,
1035,
2828,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
11336,
1035,
2171,
1010,
2828,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.delete_sas_definition_with_http_info | def delete_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil)
delete_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value!
end | ruby | def delete_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil)
delete_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_sas_definition_with_http_info",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"sas_definition_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_sas_definition_async",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"sas_definition_name",
... | Deletes a SAS definition from a specified storage account. This operation
requires the storage/deletesas permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param storage_account_name [String] The name of the storage account.
@param sas_definition_name [String] The name of the SAS definition.
@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. | [
"Deletes",
"a",
"SAS",
"definition",
"from",
"a",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"deletesas",
"permission",
"."
] | 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#L7797-L7799 | train | Deletes the specified SAS definition. | [
30522,
13366,
3972,
12870,
1035,
21871,
1035,
6210,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
21871,
1035,
6210,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
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... |
Anthony-Gaudino/jekyll-multiple-languages-plugin | lib/jekyll-multiple-languages-plugin.rb | Jekyll.Site.process | def process
# Check if plugin settings are set, if not, set a default or quit.
#-------------------------------------------------------------------------
self.parsed_translations ||= {}
self.config['exclude_from_localizations'] ||= []
if ( !self.config['languages'] or
self.config['languages'].empty? or
!self.config['languages'].all?
)
puts 'You must provide at least one language using the "languages" setting on your _config.yml.'
exit
end
# Variables
#-------------------------------------------------------------------------
# Original Jekyll configurations
baseurl_org = self.config[ 'baseurl' ].to_s # Baseurl set on _config.yml
dest_org = self.dest # Destination folder where the website is generated
# Site building only variables
languages = self.config['languages'] # List of languages set on _config.yml
# Site wide plugin configurations
self.config['default_lang'] = languages.first # Default language (first language of array set on _config.yml)
self.config[ 'lang'] = languages.first # Current language being processed
self.config['baseurl_root'] = baseurl_org # Baseurl of website root (without the appended language code)
self.config['translations'] = self.parsed_translations # Hash that stores parsed translations read from YAML files. Exposes this hash to Liquid.
# Build the website for default language
#-------------------------------------------------------------------------
puts "Building site for default language: \"#{self.config['lang']}\" to: #{self.dest}"
process_org
# Build the website for the other languages
#-------------------------------------------------------------------------
# Remove .htaccess file from included files, so it wont show up on translations folders.
self.include -= [".htaccess"]
languages.drop(1).each do |lang|
# Language specific config/variables
@dest = dest_org + "/" + lang
self.config['baseurl'] = baseurl_org + "/" + lang
self.config['lang'] = lang
puts "Building site for language: \"#{self.config['lang']}\" to: #{self.dest}"
process_org
end
# Revert to initial Jekyll configurations (necessary for regeneration)
self.config[ 'baseurl' ] = baseurl_org # Baseurl set on _config.yml
@dest = dest_org # Destination folder where the website is generated
puts 'Build complete'
end | ruby | def process
# Check if plugin settings are set, if not, set a default or quit.
#-------------------------------------------------------------------------
self.parsed_translations ||= {}
self.config['exclude_from_localizations'] ||= []
if ( !self.config['languages'] or
self.config['languages'].empty? or
!self.config['languages'].all?
)
puts 'You must provide at least one language using the "languages" setting on your _config.yml.'
exit
end
# Variables
#-------------------------------------------------------------------------
# Original Jekyll configurations
baseurl_org = self.config[ 'baseurl' ].to_s # Baseurl set on _config.yml
dest_org = self.dest # Destination folder where the website is generated
# Site building only variables
languages = self.config['languages'] # List of languages set on _config.yml
# Site wide plugin configurations
self.config['default_lang'] = languages.first # Default language (first language of array set on _config.yml)
self.config[ 'lang'] = languages.first # Current language being processed
self.config['baseurl_root'] = baseurl_org # Baseurl of website root (without the appended language code)
self.config['translations'] = self.parsed_translations # Hash that stores parsed translations read from YAML files. Exposes this hash to Liquid.
# Build the website for default language
#-------------------------------------------------------------------------
puts "Building site for default language: \"#{self.config['lang']}\" to: #{self.dest}"
process_org
# Build the website for the other languages
#-------------------------------------------------------------------------
# Remove .htaccess file from included files, so it wont show up on translations folders.
self.include -= [".htaccess"]
languages.drop(1).each do |lang|
# Language specific config/variables
@dest = dest_org + "/" + lang
self.config['baseurl'] = baseurl_org + "/" + lang
self.config['lang'] = lang
puts "Building site for language: \"#{self.config['lang']}\" to: #{self.dest}"
process_org
end
# Revert to initial Jekyll configurations (necessary for regeneration)
self.config[ 'baseurl' ] = baseurl_org # Baseurl set on _config.yml
@dest = dest_org # Destination folder where the website is generated
puts 'Build complete'
end | [
"def",
"process",
"# Check if plugin settings are set, if not, set a default or quit.",
"#-------------------------------------------------------------------------",
"self",
".",
"parsed_translations",
"||=",
"{",
"}",
"self",
".",
"config",
"[",
"'exclude_from_localizations'",
"]",
... | ======================================
process
Reads Jekyll and plugin configuration parameters set on _config.yml, sets
main parameters and processes the website for each language.
====================================== | [
"======================================",
"process"
] | 85e0e7972e6a4f94d5e7ab470ff0360905e11e4a | https://github.com/Anthony-Gaudino/jekyll-multiple-languages-plugin/blob/85e0e7972e6a4f94d5e7ab470ff0360905e11e4a/lib/jekyll-multiple-languages-plugin.rb#L80-L144 | train | Process the configuration file | [
30522,
13366,
2832,
1001,
4638,
2065,
13354,
2378,
10906,
2024,
2275,
1010,
2065,
2025,
1010,
2275,
1037,
12398,
2030,
8046,
1012,
1001,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
1011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.update_tags_with_http_info | def update_tags_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
update_tags_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | ruby | def update_tags_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
update_tags_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"update_tags_with_http_info",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"update_tags_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
... | Updates a network watcher tags.
@param resource_group_name [String] The name of the resource group.
@param network_watcher_name [String] The name of the network watcher.
@param parameters [TagsObject] Parameters supplied to update network watcher
tags.
@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",
"a",
"network",
"watcher",
"tags",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L299-L301 | train | Updates a network pool s tags. | [
30522,
13366,
10651,
1035,
22073,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
1035,
22073,
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_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb | Azure::MachineLearning::Mgmt::V2017_01_01.WebServices.patch | def patch(resource_group_name, web_service_name, patch_payload, custom_headers:nil)
response = patch_async(resource_group_name, web_service_name, patch_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def patch(resource_group_name, web_service_name, patch_payload, custom_headers:nil)
response = patch_async(resource_group_name, web_service_name, patch_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"patch",
"(",
"resource_group_name",
",",
"web_service_name",
",",
"patch_payload",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"patch_async",
"(",
"resource_group_name",
",",
"web_service_name",
",",
"patch_payload",
",",
"custom_headers",
":custo... | Modifies an existing web service resource. The PATCH API call is an
asynchronous operation. To determine whether it has completed successfully,
you must perform a Get operation.
@param resource_group_name [String] Name of the resource group in which the
web service is located.
@param web_service_name [String] The name of the web service.
@param patch_payload [WebService] The payload to use to patch the web
service.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [WebService] operation results. | [
"Modifies",
"an",
"existing",
"web",
"service",
"resource",
".",
"The",
"PATCH",
"API",
"call",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"determine",
"whether",
"it",
"has",
"completed",
"successfully",
"you",
"must",
"perform",
"a",
"Get",
"operati... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb#L205-L208 | train | Patch a specified Web Service. | [
30522,
13366,
8983,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4773,
1035,
2326,
1035,
2171,
1010,
8983,
1035,
18093,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
8983,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.