repo stringclasses 235 values | path stringlengths 11 168 | func_name stringlengths 12 143 | original_string stringlengths 83 6.91k | language stringclasses 1 value | code stringlengths 83 6.91k | code_tokens listlengths 15 1.01k | docstring stringlengths 5 25.7k | docstring_tokens listlengths 1 427 | sha stringclasses 235 values | url stringlengths 99 268 | partition stringclasses 1 value | summary stringlengths 7 202 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sds/haml-lint | lib/haml_lint/cli.rb | HamlLint.CLI.reporter_from_options | def reporter_from_options(options)
if options[:auto_gen_config]
HamlLint::Reporter::DisabledConfigReporter.new(log, limit: options[:auto_gen_exclude_limit] || 15) # rubocop:disable Metrics/LineLength
else
options.fetch(:reporter, HamlLint::Reporter::DefaultReporter).new(log)
end
end | ruby | def reporter_from_options(options)
if options[:auto_gen_config]
HamlLint::Reporter::DisabledConfigReporter.new(log, limit: options[:auto_gen_exclude_limit] || 15) # rubocop:disable Metrics/LineLength
else
options.fetch(:reporter, HamlLint::Reporter::DefaultReporter).new(log)
end
end | [
"def",
"reporter_from_options",
"(",
"options",
")",
"if",
"options",
"[",
":auto_gen_config",
"]",
"HamlLint",
"::",
"Reporter",
"::",
"DisabledConfigReporter",
".",
"new",
"(",
"log",
",",
"limit",
":",
"options",
"[",
":auto_gen_exclude_limit",
"]",
"||",
"15... | Instantiates a new reporter based on the options.
@param options [HamlLint::Configuration]
@option options [true, nil] :auto_gen_config whether to use the config
generating reporter
@option options [Class] :reporter the class of reporter to use
@return [HamlLint::Reporter] | [
"Instantiates",
"a",
"new",
"reporter",
"based",
"on",
"the",
"options",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/cli.rb#L95-L101 | train | Returns a reporter object from the options hash | [
30522,
13366,
6398,
1035,
2013,
1035,
7047,
1006,
7047,
1007,
2065,
7047,
1031,
1024,
8285,
1035,
8991,
1035,
9530,
8873,
2290,
1033,
10654,
21202,
2102,
1024,
1024,
6398,
1024,
1024,
9776,
8663,
8873,
17603,
6442,
2121,
1012,
2047,
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... |
refile/refile | lib/refile/rails/attachment_helper.rb | Refile.AttachmentHelper.attachment_cache_field | def attachment_cache_field(object_name, method, object:, **options)
options[:data] ||= {}
options[:data][:reference] ||= SecureRandom.hex
attacher_value = object.send("#{method}_data")
hidden_options = {
multiple: options[:multiple],
value: attacher_value.try(:to_json),
object: object,
disabled: attacher_value.blank?,
id: nil,
data: { reference: options[:data][:reference] }
}
hidden_options.merge!(index: options[:index]) if options.key?(:index)
hidden_field(object_name, method, hidden_options)
end | ruby | def attachment_cache_field(object_name, method, object:, **options)
options[:data] ||= {}
options[:data][:reference] ||= SecureRandom.hex
attacher_value = object.send("#{method}_data")
hidden_options = {
multiple: options[:multiple],
value: attacher_value.try(:to_json),
object: object,
disabled: attacher_value.blank?,
id: nil,
data: { reference: options[:data][:reference] }
}
hidden_options.merge!(index: options[:index]) if options.key?(:index)
hidden_field(object_name, method, hidden_options)
end | [
"def",
"attachment_cache_field",
"(",
"object_name",
",",
"method",
",",
"object",
":",
",",
"**",
"options",
")",
"options",
"[",
":data",
"]",
"||=",
"{",
"}",
"options",
"[",
":data",
"]",
"[",
":reference",
"]",
"||=",
"SecureRandom",
".",
"hex",
"at... | Generates a hidden form field which tracks the id of the file in the cache
before it is permanently stored.
@param object_name The name of the object to generate a field for
@param method The name of the field
@param [Hash] options
@option options [Object] object Set by the form builder
@return [ActiveSupport::SafeBuffer] The generated hidden form field | [
"Generates",
"a",
"hidden",
"form",
"field",
"which",
"tracks",
"the",
"id",
"of",
"the",
"file",
"in",
"the",
"cache",
"before",
"it",
"is",
"permanently",
"stored",
"."
] | e910f5ca5a9060c307bd0a5e813f1fec73219ed5 | https://github.com/refile/refile/blob/e910f5ca5a9060c307bd0a5e813f1fec73219ed5/lib/refile/rails/attachment_helper.rb#L105-L122 | train | Returns a hidden field for the attachment cache | [
30522,
13366,
14449,
1035,
17053,
1035,
2492,
1006,
4874,
1035,
2171,
1010,
4118,
1010,
4874,
1024,
1010,
1008,
1008,
7047,
1007,
7047,
1031,
1024,
2951,
1033,
1064,
1064,
1027,
1063,
1065,
7047,
1031,
1024,
2951,
1033,
1031,
1024,
4431,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-changelog-generator/github-changelog-generator | lib/github_changelog_generator/generator/generator_processor.rb | GitHubChangelogGenerator.Generator.filter_by_tag | def filter_by_tag(issues, newer_tag = nil)
issues.select do |issue|
issue["first_occurring_tag"] == (newer_tag.nil? ? nil : newer_tag["name"])
end
end | ruby | def filter_by_tag(issues, newer_tag = nil)
issues.select do |issue|
issue["first_occurring_tag"] == (newer_tag.nil? ? nil : newer_tag["name"])
end
end | [
"def",
"filter_by_tag",
"(",
"issues",
",",
"newer_tag",
"=",
"nil",
")",
"issues",
".",
"select",
"do",
"|",
"issue",
"|",
"issue",
"[",
"\"first_occurring_tag\"",
"]",
"==",
"(",
"newer_tag",
".",
"nil?",
"?",
"nil",
":",
"newer_tag",
"[",
"\"name\"",
... | Method filter issues, that belong only specified tag range
@param [Array] issues issues to filter
@param [Hash, Nil] newer_tag Tag to find PRs of. May be nil for unreleased section
@return [Array] filtered issues | [
"Method",
"filter",
"issues",
"that",
"belong",
"only",
"specified",
"tag",
"range"
] | f18c64b5cc0d7473b059275b88385ac11ca8b564 | https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/generator/generator_processor.rb#L84-L88 | train | Filter by tag | [
30522,
13366,
11307,
1035,
2011,
1035,
6415,
1006,
3314,
1010,
10947,
1035,
6415,
1027,
9152,
2140,
1007,
3314,
1012,
7276,
2079,
1064,
3277,
1064,
3277,
1031,
1000,
2034,
1035,
10066,
1035,
6415,
1000,
1033,
1027,
1027,
1006,
10947,
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... |
fastlane/fastlane | fastlane/lib/fastlane/commands_generator.rb | Fastlane.CommandsGenerator.ensure_fastfile | def ensure_fastfile
return true if FastlaneCore::FastlaneFolder.setup?
create = UI.confirm('Could not find fastlane in current directory. Make sure to have your fastlane configuration files inside a folder called "fastlane". Would you like to set fastlane up?')
if create
Fastlane::Setup.start
end
return false
end | ruby | def ensure_fastfile
return true if FastlaneCore::FastlaneFolder.setup?
create = UI.confirm('Could not find fastlane in current directory. Make sure to have your fastlane configuration files inside a folder called "fastlane". Would you like to set fastlane up?')
if create
Fastlane::Setup.start
end
return false
end | [
"def",
"ensure_fastfile",
"return",
"true",
"if",
"FastlaneCore",
"::",
"FastlaneFolder",
".",
"setup?",
"create",
"=",
"UI",
".",
"confirm",
"(",
"'Could not find fastlane in current directory. Make sure to have your fastlane configuration files inside a folder called \"fastlane\". ... | Makes sure a Fastfile is available
Shows an appropriate message to the user
if that's not the case
return true if the Fastfile is available | [
"Makes",
"sure",
"a",
"Fastfile",
"is",
"available",
"Shows",
"an",
"appropriate",
"message",
"to",
"the",
"user",
"if",
"that",
"s",
"not",
"the",
"case",
"return",
"true",
"if",
"the",
"Fastfile",
"is",
"available"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/commands_generator.rb#L340-L348 | train | Ensure that the fastfile is available | [
30522,
13366,
5676,
1035,
3435,
8873,
2571,
2709,
2995,
2065,
3435,
20644,
17345,
1024,
1024,
3435,
20644,
10371,
2121,
1012,
16437,
1029,
3443,
1027,
21318,
1012,
12210,
1006,
1005,
2071,
2025,
2424,
3435,
20644,
1999,
2783,
14176,
1012,
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... |
rmosolgo/graphql-ruby | lib/graphql/union_type.rb | GraphQL.UnionType.get_possible_type | def get_possible_type(type_name, ctx)
type = ctx.query.get_type(type_name)
type if type && ctx.query.schema.possible_types(self).include?(type)
end | ruby | def get_possible_type(type_name, ctx)
type = ctx.query.get_type(type_name)
type if type && ctx.query.schema.possible_types(self).include?(type)
end | [
"def",
"get_possible_type",
"(",
"type_name",
",",
"ctx",
")",
"type",
"=",
"ctx",
".",
"query",
".",
"get_type",
"(",
"type_name",
")",
"type",
"if",
"type",
"&&",
"ctx",
".",
"query",
".",
"schema",
".",
"possible_types",
"(",
"self",
")",
".",
"incl... | Get a possible type of this {UnionType} by type name
@param type_name [String]
@param ctx [GraphQL::Query::Context] The context for the current query
@return [GraphQL::ObjectType, nil] The type named `type_name` if it exists and is a member of this {UnionType}, (else `nil`) | [
"Get",
"a",
"possible",
"type",
"of",
"this",
"{",
"UnionType",
"}",
"by",
"type",
"name"
] | d5be13a816f220b9efbabeaa69a3e56fedf311f5 | https://github.com/rmosolgo/graphql-ruby/blob/d5be13a816f220b9efbabeaa69a3e56fedf311f5/lib/graphql/union_type.rb#L74-L77 | train | Get possible type from the schema | [
30522,
13366,
2131,
1035,
2825,
1035,
2828,
1006,
2828,
1035,
2171,
1010,
14931,
2595,
1007,
2828,
1027,
14931,
2595,
1012,
23032,
1012,
2131,
1035,
2828,
1006,
2828,
1035,
2171,
1007,
2828,
2065,
2828,
1004,
1004,
14931,
2595,
1012,
23032,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | app/helpers/hyrax/hyrax_helper_behavior.rb | Hyrax.HyraxHelperBehavior.link_to_profile | def link_to_profile(args)
user_or_key = args.is_a?(Hash) ? args[:value].first : args
user = case user_or_key
when User
user_or_key
when String
::User.find_by_user_key(user_or_key)
end
return user_or_key if user.nil?
text = user.respond_to?(:name) ? user.name : user_or_key
link_to text, Hyrax::Engine.routes.url_helpers.user_path(user)
end | ruby | def link_to_profile(args)
user_or_key = args.is_a?(Hash) ? args[:value].first : args
user = case user_or_key
when User
user_or_key
when String
::User.find_by_user_key(user_or_key)
end
return user_or_key if user.nil?
text = user.respond_to?(:name) ? user.name : user_or_key
link_to text, Hyrax::Engine.routes.url_helpers.user_path(user)
end | [
"def",
"link_to_profile",
"(",
"args",
")",
"user_or_key",
"=",
"args",
".",
"is_a?",
"(",
"Hash",
")",
"?",
"args",
"[",
":value",
"]",
".",
"first",
":",
"args",
"user",
"=",
"case",
"user_or_key",
"when",
"User",
"user_or_key",
"when",
"String",
"::",... | *Sometimes* a Blacklight index field helper_method
@param [String,User,Hash{Symbol=>Array}] args if a hash, the user_key must be under :value
@return [ActiveSupport::SafeBuffer] the html_safe link | [
"*",
"Sometimes",
"*",
"a",
"Blacklight",
"index",
"field",
"helper_method"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/helpers/hyrax/hyrax_helper_behavior.rb#L188-L199 | train | Link to a user | [
30522,
13366,
4957,
1035,
2000,
1035,
6337,
1006,
12098,
5620,
1007,
5310,
1035,
2030,
1035,
3145,
1027,
12098,
5620,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
1029,
12098,
5620,
1031,
1024,
3643,
1033,
1012,
2034,
1024,
12098,
5620,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
gocardless/ibandit | lib/ibandit/iban.rb | Ibandit.IBAN.valid? | def valid?
has_iban = !iban.nil?
has_pseudo_iban = !pseudo_iban.nil?
if has_pseudo_iban && !has_iban
valid_pseudo_iban?
else
valid_iban?
end
end | ruby | def valid?
has_iban = !iban.nil?
has_pseudo_iban = !pseudo_iban.nil?
if has_pseudo_iban && !has_iban
valid_pseudo_iban?
else
valid_iban?
end
end | [
"def",
"valid?",
"has_iban",
"=",
"!",
"iban",
".",
"nil?",
"has_pseudo_iban",
"=",
"!",
"pseudo_iban",
".",
"nil?",
"if",
"has_pseudo_iban",
"&&",
"!",
"has_iban",
"valid_pseudo_iban?",
"else",
"valid_iban?",
"end",
"end"
] | Validations | [
"Validations"
] | 675a4437e9de6c101c5a5b29f978a710fd35cb2c | https://github.com/gocardless/ibandit/blob/675a4437e9de6c101c5a5b29f978a710fd35cb2c/lib/ibandit/iban.rb#L93-L102 | train | Checks if the given object is valid for the given object. | [
30522,
13366,
9398,
1029,
2038,
1035,
21307,
2319,
1027,
999,
21307,
2319,
1012,
9152,
2140,
1029,
2038,
1035,
18404,
1035,
21307,
2319,
1027,
999,
18404,
1035,
21307,
2319,
1012,
9152,
2140,
1029,
2065,
2038,
1035,
18404,
1035,
21307,
2319... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.provision_cluster_async | def provision_cluster_async(provision_fabric_description, timeout:60, custom_headers:nil)
api_version = '6.0'
fail ArgumentError, 'provision_fabric_description is nil' if provision_fabric_description.nil?
fail ArgumentError, "'timeout' should satisfy the constraint - 'InclusiveMaximum': '4294967295'" if !timeout.nil? && timeout > 4294967295
fail ArgumentError, "'timeout' should satisfy the constraint - 'InclusiveMinimum': '1'" if !timeout.nil? && timeout < 1
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = accept_language unless accept_language.nil?
# Serialize Request
request_mapper = Azure::ServiceFabric::V6_2_0_9::Models::ProvisionFabricDescription.mapper()
request_content = self.serialize(request_mapper, provision_fabric_description)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = '$/Provision'
request_url = @base_url || self.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
query_params: {'api-version' => api_version,'timeout' => timeout},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = self.make_request_async(:post, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result
end
promise.execute
end | ruby | def provision_cluster_async(provision_fabric_description, timeout:60, custom_headers:nil)
api_version = '6.0'
fail ArgumentError, 'provision_fabric_description is nil' if provision_fabric_description.nil?
fail ArgumentError, "'timeout' should satisfy the constraint - 'InclusiveMaximum': '4294967295'" if !timeout.nil? && timeout > 4294967295
fail ArgumentError, "'timeout' should satisfy the constraint - 'InclusiveMinimum': '1'" if !timeout.nil? && timeout < 1
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = accept_language unless accept_language.nil?
# Serialize Request
request_mapper = Azure::ServiceFabric::V6_2_0_9::Models::ProvisionFabricDescription.mapper()
request_content = self.serialize(request_mapper, provision_fabric_description)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = '$/Provision'
request_url = @base_url || self.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
query_params: {'api-version' => api_version,'timeout' => timeout},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = self.make_request_async(:post, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
result
end
promise.execute
end | [
"def",
"provision_cluster_async",
"(",
"provision_fabric_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"api_version",
"=",
"'6.0'",
"fail",
"ArgumentError",
",",
"'provision_fabric_description is nil'",
"if",
"provision_fabric_description"... | Provision the code or configuration packages of a Service Fabric cluster.
Validate and provision the code or configuration packages of a Service Fabric
cluster.
@param provision_fabric_description [ProvisionFabricDescription] Describes
the parameters for provisioning a cluster.
@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 [Hash{String => String}] A hash of custom headers that will be added
to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response. | [
"Provision",
"the",
"code",
"or",
"configuration",
"packages",
"of",
"a",
"Service",
"Fabric",
"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#L2401-L2448 | train | Provision a cluster | [
30522,
13366,
9347,
1035,
9324,
1035,
2004,
6038,
2278,
1006,
9347,
1035,
8313,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
17928,
1035,
2544,
1027,
1005,
1020,
1012,
1014,
1005,
8246,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.Image.annotate | def annotate(draw, width, height, x, y, text, &block)
check_destroyed
draw.annotate(self, width, height, x, y, text, &block)
self
end | ruby | def annotate(draw, width, height, x, y, text, &block)
check_destroyed
draw.annotate(self, width, height, x, y, text, &block)
self
end | [
"def",
"annotate",
"(",
"draw",
",",
"width",
",",
"height",
",",
"x",
",",
"y",
",",
"text",
",",
"&",
"block",
")",
"check_destroyed",
"draw",
".",
"annotate",
"(",
"self",
",",
"width",
",",
"height",
",",
"x",
",",
"y",
",",
"text",
",",
"blo... | Provide an alternate version of Draw#annotate, for folks who
want to find it in this class. | [
"Provide",
"an",
"alternate",
"version",
"of",
"Draw#annotate",
"for",
"folks",
"who",
"want",
"to",
"find",
"it",
"in",
"this",
"class",
"."
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L756-L760 | train | annotate the image with the given text. | [
30522,
13366,
5754,
17287,
2618,
1006,
4009,
1010,
9381,
1010,
4578,
1010,
1060,
1010,
1061,
1010,
3793,
1010,
1004,
3796,
1007,
4638,
1035,
3908,
4009,
1012,
5754,
17287,
2618,
1006,
2969,
1010,
9381,
1010,
4578,
1010,
1060,
1010,
1061,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
jekyll/jekyll | lib/jekyll/site.rb | Jekyll.Site.find_converter_instance | def find_converter_instance(klass)
@find_converter_instance ||= {}
@find_converter_instance[klass] ||= begin
converters.find { |converter| converter.instance_of?(klass) } || \
raise("No Converters found for #{klass}")
end
end | ruby | def find_converter_instance(klass)
@find_converter_instance ||= {}
@find_converter_instance[klass] ||= begin
converters.find { |converter| converter.instance_of?(klass) } || \
raise("No Converters found for #{klass}")
end
end | [
"def",
"find_converter_instance",
"(",
"klass",
")",
"@find_converter_instance",
"||=",
"{",
"}",
"@find_converter_instance",
"[",
"klass",
"]",
"||=",
"begin",
"converters",
".",
"find",
"{",
"|",
"converter",
"|",
"converter",
".",
"instance_of?",
"(",
"klass",
... | Get the implementation class for the given Converter.
Returns the Converter instance implementing the given Converter.
klass - The Class of the Converter to fetch. | [
"Get",
"the",
"implementation",
"class",
"for",
"the",
"given",
"Converter",
".",
"Returns",
"the",
"Converter",
"instance",
"implementing",
"the",
"given",
"Converter",
".",
"klass",
"-",
"The",
"Class",
"of",
"the",
"Converter",
"to",
"fetch",
"."
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/site.rb#L292-L298 | train | Find the Converter instance for a given class. | [
30522,
13366,
2424,
1035,
10463,
2121,
1035,
6013,
1006,
1047,
30524,
2424,
1063,
1064,
10463,
2121,
1064,
10463,
2121,
1012,
6013,
1035,
1997,
1029,
1006,
1047,
27102,
1007,
1065,
1064,
1064,
1032,
5333,
1006,
1000,
2053,
10463,
2545,
2179... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
roo-rb/roo | lib/roo/open_office.rb | Roo.OpenOffice.font | def font(row, col, sheet = nil)
sheet ||= default_sheet
read_cells(sheet)
row, col = normalize(row, col)
style_name = @style[sheet][[row, col]] || @style_defaults[sheet][col - 1] || 'Default'
@font_style_definitions[style_name]
end | ruby | def font(row, col, sheet = nil)
sheet ||= default_sheet
read_cells(sheet)
row, col = normalize(row, col)
style_name = @style[sheet][[row, col]] || @style_defaults[sheet][col - 1] || 'Default'
@font_style_definitions[style_name]
end | [
"def",
"font",
"(",
"row",
",",
"col",
",",
"sheet",
"=",
"nil",
")",
"sheet",
"||=",
"default_sheet",
"read_cells",
"(",
"sheet",
")",
"row",
",",
"col",
"=",
"normalize",
"(",
"row",
",",
"col",
")",
"style_name",
"=",
"@style",
"[",
"sheet",
"]",
... | Given a cell, return the cell's style | [
"Given",
"a",
"cell",
"return",
"the",
"cell",
"s",
"style"
] | 4ec1104f0c3c2a29711c0c907371cd2be12bcc3c | https://github.com/roo-rb/roo/blob/4ec1104f0c3c2a29711c0c907371cd2be12bcc3c/lib/roo/open_office.rb#L134-L140 | train | Returns the font definition for a given cell | [
30522,
13366,
15489,
1006,
5216,
1010,
8902,
1010,
7123,
1027,
9152,
2140,
1007,
7123,
1064,
1064,
1027,
12398,
1035,
7123,
3191,
1035,
4442,
1006,
7123,
1007,
5216,
1010,
8902,
1027,
3671,
4697,
1006,
5216,
1010,
8902,
1007,
2806,
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/replicationv_centers.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationvCenters.begin_update_with_http_info | def begin_update_with_http_info(fabric_name, v_center_name, update_vcenter_request, custom_headers:nil)
begin_update_async(fabric_name, v_center_name, update_vcenter_request, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(fabric_name, v_center_name, update_vcenter_request, custom_headers:nil)
begin_update_async(fabric_name, v_center_name, update_vcenter_request, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"fabric_name",
",",
"v_center_name",
",",
"update_vcenter_request",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"fabric_name",
",",
"v_center_name",
",",
"update_vcenter_request",
",",
"custom_headers",
":c... | Update vCenter operation.
The operation to update a registered vCenter.
@param fabric_name [String] Fabric name.
@param v_center_name [String] vCeneter name
@param update_vcenter_request [UpdateVCenterRequest] The input to the update
vCenter 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. | [
"Update",
"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#L688-L690 | train | Updates a virtual network center. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
8313,
1035,
2171,
1010,
1058,
1035,
2415,
1035,
2171,
1010,
10651,
1035,
18315,
29110,
1035,
5227,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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... |
plaid/plaid-ruby | lib/plaid/products/asset_report.rb | Plaid.AssetReport.refresh | def refresh(asset_report_token, days_requested, options = {})
post_with_auth 'asset_report/refresh',
AssetReportRefreshResponse,
asset_report_token: asset_report_token,
days_requested: days_requested,
options: options
end | ruby | def refresh(asset_report_token, days_requested, options = {})
post_with_auth 'asset_report/refresh',
AssetReportRefreshResponse,
asset_report_token: asset_report_token,
days_requested: days_requested,
options: options
end | [
"def",
"refresh",
"(",
"asset_report_token",
",",
"days_requested",
",",
"options",
"=",
"{",
"}",
")",
"post_with_auth",
"'asset_report/refresh'",
",",
"AssetReportRefreshResponse",
",",
"asset_report_token",
":",
"asset_report_token",
",",
"days_requested",
":",
"days... | Public: Create a new, refreshed asset report.
asset_report_token - The asset report token for the asset report you want
to refresh.
days_requested - Days of transaction history requested to be included
in the Asset Report. Plaid will return as much data
as possible within the implied date range, up to a
maximum of 730 days (2 years) of history.
options - An optional object containing client-provided user
information, a client-provided report ID, and a
webhook. For more information, see the website
listed above.
Returns a AssetReportRefreshResponse object. | [
"Public",
":",
"Create",
"a",
"new",
"refreshed",
"asset",
"report",
"."
] | ce3da1c5559c739de88c5f59e54eef875f296673 | https://github.com/plaid/plaid-ruby/blob/ce3da1c5559c739de88c5f59e54eef875f296673/lib/plaid/products/asset_report.rb#L55-L61 | train | Refresh an asset report | [
30522,
13366,
25416,
21898,
1006,
11412,
1035,
3189,
1035,
19204,
1010,
2420,
1035,
7303,
1010,
7047,
1027,
1063,
1065,
1007,
2695,
1035,
2007,
1035,
8740,
2705,
1005,
11412,
1035,
3189,
1013,
25416,
21898,
1005,
1010,
11412,
2890,
6442,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sprockets | lib/sprockets/source_map_utils.rb | Sprockets.SourceMapUtils.decode_vlq_mappings | def decode_vlq_mappings(str, sources: [], names: [])
mappings = []
source_id = 0
original_line = 1
original_column = 0
name_id = 0
vlq_decode_mappings(str).each_with_index do |group, index|
generated_column = 0
generated_line = index + 1
group.each do |segment|
generated_column += segment[0]
generated = [generated_line, generated_column]
if segment.size >= 4
source_id += segment[1]
original_line += segment[2]
original_column += segment[3]
source = sources[source_id]
original = [original_line, original_column]
else
# TODO: Research this case
next
end
if segment[4]
name_id += segment[4]
name = names[name_id]
end
mapping = {source: source, generated: generated, original: original}
mapping[:name] = name if name
mappings << mapping
end
end
mappings
end | ruby | def decode_vlq_mappings(str, sources: [], names: [])
mappings = []
source_id = 0
original_line = 1
original_column = 0
name_id = 0
vlq_decode_mappings(str).each_with_index do |group, index|
generated_column = 0
generated_line = index + 1
group.each do |segment|
generated_column += segment[0]
generated = [generated_line, generated_column]
if segment.size >= 4
source_id += segment[1]
original_line += segment[2]
original_column += segment[3]
source = sources[source_id]
original = [original_line, original_column]
else
# TODO: Research this case
next
end
if segment[4]
name_id += segment[4]
name = names[name_id]
end
mapping = {source: source, generated: generated, original: original}
mapping[:name] = name if name
mappings << mapping
end
end
mappings
end | [
"def",
"decode_vlq_mappings",
"(",
"str",
",",
"sources",
":",
"[",
"]",
",",
"names",
":",
"[",
"]",
")",
"mappings",
"=",
"[",
"]",
"source_id",
"=",
"0",
"original_line",
"=",
"1",
"original_column",
"=",
"0",
"name_id",
"=",
"0",
"vlq_decode_mappings... | Public: Decode VLQ mappings and match up sources and symbol names.
str - VLQ string from 'mappings' attribute
sources - Array of Strings from 'sources' attribute
names - Array of Strings from 'names' attribute
Returns an Array of Mappings. | [
"Public",
":",
"Decode",
"VLQ",
"mappings",
"and",
"match",
"up",
"sources",
"and",
"symbol",
"names",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/source_map_utils.rb#L297-L337 | train | Decodula a string in the format of a VLQ - 2. 0. 0 | [
30522,
13366,
21933,
3207,
1035,
1058,
2140,
4160,
1035,
12375,
2015,
1006,
2358,
2099,
1010,
4216,
1024,
1031,
1033,
1010,
3415,
1024,
1031,
1033,
1007,
12375,
2015,
1027,
1031,
1033,
3120,
1035,
8909,
1027,
1014,
2434,
1035,
2240,
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... |
jnunemaker/httparty | lib/httparty.rb | HTTParty.ClassMethods.post | def post(path, options = {}, &block)
perform_request Net::HTTP::Post, path, options, &block
end | ruby | def post(path, options = {}, &block)
perform_request Net::HTTP::Post, path, options, &block
end | [
"def",
"post",
"(",
"path",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"perform_request",
"Net",
"::",
"HTTP",
"::",
"Post",
",",
"path",
",",
"options",
",",
"block",
"end"
] | Allows making a post request to a url.
class Foo
include HTTParty
end
# Simple post with full url and setting the body
Foo.post('http://foo.com/resources', body: {bar: 'baz'})
# Simple post with full url using :query option,
# which appends the parameters to the URI.
Foo.post('http://foo.com/resources', query: {bar: 'baz'}) | [
"Allows",
"making",
"a",
"post",
"request",
"to",
"a",
"url",
"."
] | b4099defba01231d2faaaa2660476f867e096bfb | https://github.com/jnunemaker/httparty/blob/b4099defba01231d2faaaa2660476f867e096bfb/lib/httparty.rb#L522-L524 | train | Perform a POST request to the specified path. | [
30522,
13366,
2695,
1006,
4130,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
4685,
1035,
5227,
5658,
1024,
1024,
8299,
1024,
1024,
2695,
1010,
4130,
1010,
7047,
1010,
1004,
3796,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sprockets | lib/sprockets/context.rb | Sprockets.Context.svg_asset_data_uri | def svg_asset_data_uri(asset)
svg = asset.source.dup
optimize_svg_for_uri_escaping!(svg)
data = Rack::Utils.escape(svg)
optimize_quoted_uri_escapes!(data)
"\"data:#{asset.content_type};charset=utf-8,#{data}\""
end | ruby | def svg_asset_data_uri(asset)
svg = asset.source.dup
optimize_svg_for_uri_escaping!(svg)
data = Rack::Utils.escape(svg)
optimize_quoted_uri_escapes!(data)
"\"data:#{asset.content_type};charset=utf-8,#{data}\""
end | [
"def",
"svg_asset_data_uri",
"(",
"asset",
")",
"svg",
"=",
"asset",
".",
"source",
".",
"dup",
"optimize_svg_for_uri_escaping!",
"(",
"svg",
")",
"data",
"=",
"Rack",
"::",
"Utils",
".",
"escape",
"(",
"svg",
")",
"optimize_quoted_uri_escapes!",
"(",
"data",
... | Returns a URI-encoded data URI (always "-quoted). | [
"Returns",
"a",
"URI",
"-",
"encoded",
"data",
"URI",
"(",
"always",
"-",
"quoted",
")",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/context.rb#L262-L268 | train | Returns the data URI for an SVG asset | [
30522,
13366,
17917,
2290,
1035,
11412,
1035,
2951,
1035,
24471,
2072,
1006,
11412,
1007,
17917,
2290,
1027,
11412,
1012,
3120,
1012,
4241,
2361,
23569,
27605,
4371,
1035,
17917,
2290,
1035,
2005,
1035,
24471,
2072,
1035,
13002,
999,
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... |
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_deployed_application_health_using_policy_with_http_info | def get_deployed_application_health_using_policy_with_http_info(node_name, application_id, events_health_state_filter:0, deployed_service_packages_health_state_filter:0, application_health_policy:nil, exclude_health_statistics:false, timeout:60, custom_headers:nil)
get_deployed_application_health_using_policy_async(node_name, application_id, events_health_state_filter:events_health_state_filter, deployed_service_packages_health_state_filter:deployed_service_packages_health_state_filter, application_health_policy:application_health_policy, exclude_health_statistics:exclude_health_statistics, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_deployed_application_health_using_policy_with_http_info(node_name, application_id, events_health_state_filter:0, deployed_service_packages_health_state_filter:0, application_health_policy:nil, exclude_health_statistics:false, timeout:60, custom_headers:nil)
get_deployed_application_health_using_policy_async(node_name, application_id, events_health_state_filter:events_health_state_filter, deployed_service_packages_health_state_filter:deployed_service_packages_health_state_filter, application_health_policy:application_health_policy, exclude_health_statistics:exclude_health_statistics, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_deployed_application_health_using_policy_with_http_info",
"(",
"node_name",
",",
"application_id",
",",
"events_health_state_filter",
":",
"0",
",",
"deployed_service_packages_health_state_filter",
":",
"0",
",",
"application_health_policy",
":",
"nil",
",",
"exclud... | Gets the information about health of an application deployed on a Service
Fabric node. using the specified policy.
Gets the information about health of an application deployed on a Service
Fabric node using the specified policy. Use EventsHealthStateFilter to
optionally filter for the collection of HealthEvent objects reported on the
deployed application based on health state. Use
DeployedServicePackagesHealthStateFilter to optionally filter for
DeployedServicePackageHealth children based on health state. Use
ApplicationHealthPolicy to optionally override the health policies used to
evaluate the health. This API only uses 'ConsiderWarningAsError' field of the
ApplicationHealthPolicy. The rest of the fields are ignored while evaluating
the health of the deployed application.
@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 events_health_state_filter [Integer] Allows filtering the collection
of HealthEvent objects returned based on health state.
The possible values for this parameter include integer value of one of the
following health states.
Only events that match the filter are returned. All events are used to
evaluate the aggregated health state.
If not specified, all entries are returned. The state values are flag based
enumeration, so the value could be a combination of these value obtained
using bitwise 'OR' operator. For example, If the provided value is 6 then all
of the events with HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param deployed_service_packages_health_state_filter [Integer] Allows
filtering of the deployed service package health state objects returned in
the result of deployed application health query based on their health state.
The possible values for this parameter include integer value of one of the
following health states.
Only deployed service packages that match the filter are returned. All
deployed service packages are used to evaluate the aggregated health state of
the deployed application.
If not specified, all entries are returned.
The state values are flag based enumeration, so the value can be a
combination of these value obtained using bitwise 'OR' operator.
For example, if the provided value is 6 then health state of service packages
with HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param application_health_policy [ApplicationHealthPolicy] Describes the
health policies used to evaluate the health of an application or one of its
children.
If not present, the health evaluation uses the health policy from application
manifest or the default health policy.
@param exclude_health_statistics [Boolean] Indicates whether the health
statistics should be returned as part of the query result. False by default.
The statistics show the number of children entities in health state Ok,
Warning, and Error.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"information",
"about",
"health",
"of",
"an",
"application",
"deployed",
"on",
"a",
"Service",
"Fabric",
"node",
".",
"using",
"the",
"specified",
"policy",
"."
] | 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#L9172-L9174 | train | Gets the health of the specified application using the health policy. | [
30522,
13366,
2131,
1035,
7333,
1035,
4646,
1035,
2740,
1035,
2478,
1035,
3343,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13045,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
2824,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
7333,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_install_updates_with_http_info | def begin_install_updates_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
begin_install_updates_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def begin_install_updates_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
begin_install_updates_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_install_updates_with_http_info",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_install_updates_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_heade... | Downloads and installs the 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.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Downloads",
"and",
"installs",
"the",
"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#L1505-L1507 | train | Installs updates to the specified device. | [
30522,
13366,
4088,
1035,
16500,
1035,
14409,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
16500,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
jnunemaker/flipper | lib/flipper/feature.rb | Flipper.Feature.enabled_gates | def enabled_gates
values = gate_values
gates.select { |gate| gate.enabled?(values[gate.key]) }
end | ruby | def enabled_gates
values = gate_values
gates.select { |gate| gate.enabled?(values[gate.key]) }
end | [
"def",
"enabled_gates",
"values",
"=",
"gate_values",
"gates",
".",
"select",
"{",
"|",
"gate",
"|",
"gate",
".",
"enabled?",
"(",
"values",
"[",
"gate",
".",
"key",
"]",
")",
"}",
"end"
] | Public: Get the gates that have been enabled for the feature.
Returns an Array of Flipper::Gate instances. | [
"Public",
":",
"Get",
"the",
"gates",
"that",
"have",
"been",
"enabled",
"for",
"the",
"feature",
"."
] | df0352b663ad3ed45d68710f10a8170249ff9d78 | https://github.com/jnunemaker/flipper/blob/df0352b663ad3ed45d68710f10a8170249ff9d78/lib/flipper/feature.rb#L292-L295 | train | Returns the index of the gates that are enabled | [
30522,
13366,
9124,
1035,
6733,
5300,
1027,
4796,
1035,
5300,
6733,
1012,
7276,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | app/presenters/hyrax/workflow_presenter.rb | Hyrax.WorkflowPresenter.actions | def actions
return [] unless sipity_entity && current_ability
actions = Hyrax::Workflow::PermissionQuery.scope_permitted_workflow_actions_available_for_current_state(entity: sipity_entity, user: current_ability.current_user)
actions.map { |action| [action.name, action_label(action)] }
end | ruby | def actions
return [] unless sipity_entity && current_ability
actions = Hyrax::Workflow::PermissionQuery.scope_permitted_workflow_actions_available_for_current_state(entity: sipity_entity, user: current_ability.current_user)
actions.map { |action| [action.name, action_label(action)] }
end | [
"def",
"actions",
"return",
"[",
"]",
"unless",
"sipity_entity",
"&&",
"current_ability",
"actions",
"=",
"Hyrax",
"::",
"Workflow",
"::",
"PermissionQuery",
".",
"scope_permitted_workflow_actions_available_for_current_state",
"(",
"entity",
":",
"sipity_entity",
",",
"... | Returns an array of tuples (key, label) appropriate for a radio group | [
"Returns",
"an",
"array",
"of",
"tuples",
"(",
"key",
"label",
")",
"appropriate",
"for",
"a",
"radio",
"group"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/presenters/hyrax/workflow_presenter.rb#L22-L26 | train | Returns an array of actions that are available for the current state. | [
30522,
13366,
4506,
2709,
1031,
1033,
4983,
10668,
3012,
1035,
9178,
1004,
1004,
2783,
1035,
3754,
4506,
1027,
1044,
19563,
2595,
1024,
1024,
2147,
12314,
1024,
1024,
6656,
4226,
2854,
1012,
9531,
1035,
7936,
1035,
2147,
12314,
1035,
4506,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/capability_host.rb | Vagrant.CapabilityHost.initialize_capabilities! | def initialize_capabilities!(host, hosts, capabilities, *args)
@cap_logger = Log4r::Logger.new(
"vagrant::capability_host::#{self.class.to_s.downcase}")
if host && !hosts[host]
raise Errors::CapabilityHostExplicitNotDetected, value: host.to_s
end
if !host
host = autodetect_capability_host(hosts, *args) if !host
raise Errors::CapabilityHostNotDetected if !host
end
if !hosts[host]
# This should never happen because the autodetect above uses the
# hosts hash to look up hosts. And if an explicit host is specified,
# we do another check higher up.
raise "Internal error. Host not found: #{host}"
end
name = host
host_info = hosts[name]
host = host_info[0].new
chain = []
chain << [name, host]
# Build the proper chain of parents if there are any.
# This allows us to do "inheritance" of capabilities later
if host_info[1]
parent_name = host_info[1]
parent_info = hosts[parent_name]
while parent_info
chain << [parent_name, parent_info[0].new]
parent_name = parent_info[1]
parent_info = hosts[parent_name]
end
end
@cap_host_chain = chain
@cap_args = args
@cap_caps = capabilities
true
end | ruby | def initialize_capabilities!(host, hosts, capabilities, *args)
@cap_logger = Log4r::Logger.new(
"vagrant::capability_host::#{self.class.to_s.downcase}")
if host && !hosts[host]
raise Errors::CapabilityHostExplicitNotDetected, value: host.to_s
end
if !host
host = autodetect_capability_host(hosts, *args) if !host
raise Errors::CapabilityHostNotDetected if !host
end
if !hosts[host]
# This should never happen because the autodetect above uses the
# hosts hash to look up hosts. And if an explicit host is specified,
# we do another check higher up.
raise "Internal error. Host not found: #{host}"
end
name = host
host_info = hosts[name]
host = host_info[0].new
chain = []
chain << [name, host]
# Build the proper chain of parents if there are any.
# This allows us to do "inheritance" of capabilities later
if host_info[1]
parent_name = host_info[1]
parent_info = hosts[parent_name]
while parent_info
chain << [parent_name, parent_info[0].new]
parent_name = parent_info[1]
parent_info = hosts[parent_name]
end
end
@cap_host_chain = chain
@cap_args = args
@cap_caps = capabilities
true
end | [
"def",
"initialize_capabilities!",
"(",
"host",
",",
"hosts",
",",
"capabilities",
",",
"*",
"args",
")",
"@cap_logger",
"=",
"Log4r",
"::",
"Logger",
".",
"new",
"(",
"\"vagrant::capability_host::#{self.class.to_s.downcase}\"",
")",
"if",
"host",
"&&",
"!",
"host... | Initializes the capability system by detecting the proper capability
host to execute on and building the chain of capabilities to execute.
@param [Symbol] host The host to use for the capabilities, or nil if
we should auto-detect it.
@param [Hash<Symbol, Array<Class, Symbol>>] hosts Potential capability
hosts. The key is the name of the host, value[0] is a class that
implements `#detect?` and value[1] is a parent host (if any).
@param [Hash<Symbol, Hash<Symbol, Class>>] capabilities The capabilities
that are supported. The key is the host of the capability. Within that
is a hash where the key is the name of the capability and the value
is the class/module implementing it. | [
"Initializes",
"the",
"capability",
"system",
"by",
"detecting",
"the",
"proper",
"capability",
"host",
"to",
"execute",
"on",
"and",
"building",
"the",
"chain",
"of",
"capabilities",
"to",
"execute",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/capability_host.rb#L27-L69 | train | Initialize the capabilities for the given host. | [
30522,
13366,
3988,
4697,
1035,
9859,
999,
1006,
3677,
1010,
6184,
1010,
9859,
1010,
1008,
12098,
5620,
1007,
1030,
6178,
1035,
8833,
4590,
1027,
8833,
2549,
2099,
1024,
1024,
8833,
4590,
1012,
2047,
1006,
1000,
12436,
18980,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb | Azure::ContainerRegistry::Mgmt::V2018_09_01.Tasks.delete | def delete(resource_group_name, registry_name, task_name, custom_headers:nil)
response = delete_async(resource_group_name, registry_name, task_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, registry_name, task_name, custom_headers:nil)
response = delete_async(resource_group_name, registry_name, task_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"registry_name",
",",
"task_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"task_name",
",",
"custom_headers",
":custom_headers",
... | Deletes a specified task.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param task_name [String] The name of the container registry task.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"a",
"specified",
"task",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb#L287-L290 | train | Deletes a task from the specified container registry. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
4708,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
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... |
meew0/discordrb | lib/discordrb/data/server.rb | Discordrb.Server.default_message_notifications= | def default_message_notifications=(notification_level)
notification_level = NOTIFICATION_LEVELS[notification_level] if notification_level.is_a?(Symbol)
update_server_data(default_message_notifications: notification_level)
end | ruby | def default_message_notifications=(notification_level)
notification_level = NOTIFICATION_LEVELS[notification_level] if notification_level.is_a?(Symbol)
update_server_data(default_message_notifications: notification_level)
end | [
"def",
"default_message_notifications",
"=",
"(",
"notification_level",
")",
"notification_level",
"=",
"NOTIFICATION_LEVELS",
"[",
"notification_level",
"]",
"if",
"notification_level",
".",
"is_a?",
"(",
"Symbol",
")",
"update_server_data",
"(",
"default_message_notificat... | Sets the default message notification level
@param notification_level [Integer, Symbol] The default message notificiation 0-1 or Symbol (see {NOTIFICATION_LEVELS}) | [
"Sets",
"the",
"default",
"message",
"notification",
"level"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/server.rb#L686-L690 | train | Update the server data with default message notifications | [
30522,
13366,
12398,
1035,
4471,
1035,
26828,
2015,
1027,
1006,
26828,
1035,
2504,
1007,
26828,
1035,
2504,
1027,
26828,
1035,
3798,
1031,
26828,
1035,
2504,
1033,
2065,
26828,
1035,
2504,
1012,
2003,
1035,
1037,
1029,
1006,
6454,
1007,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/list_customers_request.rb | SquareConnect.ListCustomersRequest.valid? | def valid?
sort_field_validator = EnumAttributeValidator.new('String', ["DEFAULT", "CREATED_AT"])
return false unless sort_field_validator.valid?(@sort_field)
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
return false unless sort_order_validator.valid?(@sort_order)
return true
end | ruby | def valid?
sort_field_validator = EnumAttributeValidator.new('String', ["DEFAULT", "CREATED_AT"])
return false unless sort_field_validator.valid?(@sort_field)
sort_order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
return false unless sort_order_validator.valid?(@sort_order)
return true
end | [
"def",
"valid?",
"sort_field_validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"DEFAULT\"",
",",
"\"CREATED_AT\"",
"]",
")",
"return",
"false",
"unless",
"sort_field_validator",
".",
"valid?",
"(",
"@sort_field",
")",
"sort_order_va... | Check to see if the all the properties in the model are valid
@return true if the model is valid | [
"Check",
"to",
"see",
"if",
"the",
"all",
"the",
"properties",
"in",
"the",
"model",
"are",
"valid"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/list_customers_request.rb#L95-L101 | train | Returns true if the object is valid for this object. | [
30522,
13366,
9398,
1029,
4066,
1035,
2492,
1035,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
12398,
1000,
1010,
1000,
2580,
1035,
2012,
1000,
1033,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/bot.rb | Discordrb.Bot.voice | def voice(thing)
id = thing.resolve_id
return @voices[id] if @voices[id]
channel = channel(id)
return nil unless channel
server_id = channel.server.id
return @voices[server_id] if @voices[server_id]
nil
end | ruby | def voice(thing)
id = thing.resolve_id
return @voices[id] if @voices[id]
channel = channel(id)
return nil unless channel
server_id = channel.server.id
return @voices[server_id] if @voices[server_id]
nil
end | [
"def",
"voice",
"(",
"thing",
")",
"id",
"=",
"thing",
".",
"resolve_id",
"return",
"@voices",
"[",
"id",
"]",
"if",
"@voices",
"[",
"id",
"]",
"channel",
"=",
"channel",
"(",
"id",
")",
"return",
"nil",
"unless",
"channel",
"server_id",
"=",
"channel"... | Gets the voice bot for a particular server or channel. You can connect to a new channel using the {#voice_connect}
method.
@param thing [Channel, Server, Integer] the server or channel you want to get the voice bot for, or its ID.
@return [Voice::VoiceBot, nil] the VoiceBot for the thing you specified, or nil if there is no connection yet | [
"Gets",
"the",
"voice",
"bot",
"for",
"a",
"particular",
"server",
"or",
"channel",
".",
"You",
"can",
"connect",
"to",
"a",
"new",
"channel",
"using",
"the",
"{",
"#voice_connect",
"}",
"method",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L296-L307 | train | Returns the voice for a given thing | [
30522,
13366,
2376,
1006,
2518,
1007,
8909,
1027,
2518,
1012,
10663,
1035,
8909,
2709,
1030,
5755,
1031,
8909,
1033,
2065,
1030,
5755,
1031,
8909,
1033,
3149,
1027,
3149,
1006,
8909,
1007,
2709,
9152,
2140,
4983,
3149,
8241,
1035,
8909,
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_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.delete | def delete(fabric_name, protection_container_name, custom_headers:nil)
response = delete_async(fabric_name, protection_container_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(fabric_name, protection_container_name, custom_headers:nil)
response = delete_async(fabric_name, protection_container_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
... | Removes a protection container.
Operation to remove a protection container.
@param fabric_name [String] Unique fabric ARM name.
@param protection_container_name [String] Unique protection container ARM
name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Removes",
"a",
"protection",
"container",
"."
] | 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#L330-L333 | train | Deletes the protection container. | [
30522,
13366,
3972,
12870,
1006,
8313,
1035,
2171,
1010,
3860,
1035,
11661,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
8313,
1035,
2171,
1010,
3860,
1035,
11661,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/origins.rb | Azure::CDN::Mgmt::V2015_06_01.Origins.begin_create | def begin_create(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
response = begin_create_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers:nil)
response = begin_create_async(origin_name, origin_properties, endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create",
"(",
"origin_name",
",",
"origin_properties",
",",
"endpoint_name",
",",
"profile_name",
",",
"resource_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_async",
"(",
"origin_name",
",",
"origin_properties",
","... | Creates a new CDN origin within an endpoint.
@param origin_name [String] Name of the origin, an arbitrary value but it
needs to be unique under endpoint
@param origin_properties [OriginParameters] Origin properties
@param endpoint_name [String] Name of the endpoint within the CDN profile.
@param profile_name [String] Name of the CDN profile within the resource
group.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Origin] operation results. | [
"Creates",
"a",
"new",
"CDN",
"origin",
"within",
"an",
"endpoint",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/origins.rb#L414-L417 | train | Creates an origin. | [
30522,
13366,
4088,
1035,
3443,
1006,
4761,
1035,
2171,
1010,
4761,
1035,
5144,
1010,
2203,
8400,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
markdownlint/markdownlint | lib/mdl/doc.rb | MarkdownLint.Doc.find_type_elements_except | def find_type_elements_except(type, nested_except=[], elements=@elements)
results = []
if type.class == Symbol
type = [type]
end
if nested_except.class == Symbol
nested_except = [nested_except]
end
elements.each do |e|
results.push(e) if type.include?(e.type)
unless nested_except.include?(e.type) or e.children.empty?
results.concat(find_type_elements_except(type, nested_except, e.children))
end
end
results
end | ruby | def find_type_elements_except(type, nested_except=[], elements=@elements)
results = []
if type.class == Symbol
type = [type]
end
if nested_except.class == Symbol
nested_except = [nested_except]
end
elements.each do |e|
results.push(e) if type.include?(e.type)
unless nested_except.include?(e.type) or e.children.empty?
results.concat(find_type_elements_except(type, nested_except, e.children))
end
end
results
end | [
"def",
"find_type_elements_except",
"(",
"type",
",",
"nested_except",
"=",
"[",
"]",
",",
"elements",
"=",
"@elements",
")",
"results",
"=",
"[",
"]",
"if",
"type",
".",
"class",
"==",
"Symbol",
"type",
"=",
"[",
"type",
"]",
"end",
"if",
"nested_except... | A variation on find_type_elements that allows you to skip drilling down
into children of specific element types.
Instead of a single type, a list of types can be provided instead to
find all types.
Unlike find_type_elements, this method will always search for nested
elements, and skip the element types given to nested_except. | [
"A",
"variation",
"on",
"find_type_elements",
"that",
"allows",
"you",
"to",
"skip",
"drilling",
"down",
"into",
"children",
"of",
"specific",
"element",
"types",
"."
] | a9e80fcf3989d73b654b00bb2225a00be53983e8 | https://github.com/markdownlint/markdownlint/blob/a9e80fcf3989d73b654b00bb2225a00be53983e8/lib/mdl/doc.rb#L110-L125 | train | Find all elements except a type | [
30522,
13366,
2424,
1035,
2828,
1035,
3787,
1035,
3272,
1006,
2828,
1010,
9089,
2098,
1035,
3272,
1027,
1031,
1033,
1010,
3787,
1027,
1030,
3787,
1007,
3463,
1027,
1031,
1033,
2065,
2828,
1012,
2465,
1027,
1027,
6454,
2828,
1027,
1031,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
toptal/chewy | lib/chewy/query.rb | Chewy.Query.random_score | def random_score(seed = Time.now, options = {})
scoring = options.merge(random_score: {seed: seed.to_i})
chain { criteria.update_scores scoring }
end | ruby | def random_score(seed = Time.now, options = {})
scoring = options.merge(random_score: {seed: seed.to_i})
chain { criteria.update_scores scoring }
end | [
"def",
"random_score",
"(",
"seed",
"=",
"Time",
".",
"now",
",",
"options",
"=",
"{",
"}",
")",
"scoring",
"=",
"options",
".",
"merge",
"(",
"random_score",
":",
"{",
"seed",
":",
"seed",
".",
"to_i",
"}",
")",
"chain",
"{",
"criteria",
".",
"upd... | Adds a random score to the search request. All scores are
added to the search request and combinded according to
`boost_mode` and `score_mode`
This probably only makes sense if you specify a filter
for the random score as well.
If you do not pass in a seed value, Time.now will be used
@example
UsersIndex.random_score(23, filter: { foo: :bar})
# => {body:
query: {
function_score: {
query: { ...},
functions: [{
random_score: { seed: 23 },
filter: { foo: :bar }
}]
} } } | [
"Adds",
"a",
"random",
"score",
"to",
"the",
"search",
"request",
".",
"All",
"scores",
"are",
"added",
"to",
"the",
"search",
"request",
"and",
"combinded",
"according",
"to",
"boost_mode",
"and",
"score_mode"
] | cb1bb3efb1bd8a31e7e31add6072189cb1f4f01b | https://github.com/toptal/chewy/blob/cb1bb3efb1bd8a31e7e31add6072189cb1f4f01b/lib/chewy/query.rb#L468-L471 | train | Update the scores based on the current random score. | [
30522,
13366,
6721,
1035,
3556,
1006,
6534,
1027,
2051,
1012,
2085,
1010,
7047,
1027,
1063,
1065,
1007,
4577,
1027,
7047,
1012,
13590,
1006,
6721,
1035,
3556,
1024,
1063,
6534,
1024,
6534,
1012,
2000,
1035,
1045,
1065,
1007,
4677,
1063,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
twitter/secure_headers | lib/secure_headers/headers/content_security_policy.rb | SecureHeaders.ContentSecurityPolicy.dedup_source_list | def dedup_source_list(sources)
sources = sources.uniq
wild_sources = sources.select { |source| source =~ STAR_REGEXP }
if wild_sources.any?
sources.reject do |source|
!wild_sources.include?(source) &&
wild_sources.any? { |pattern| File.fnmatch(pattern, source) }
end
else
sources
end
end | ruby | def dedup_source_list(sources)
sources = sources.uniq
wild_sources = sources.select { |source| source =~ STAR_REGEXP }
if wild_sources.any?
sources.reject do |source|
!wild_sources.include?(source) &&
wild_sources.any? { |pattern| File.fnmatch(pattern, source) }
end
else
sources
end
end | [
"def",
"dedup_source_list",
"(",
"sources",
")",
"sources",
"=",
"sources",
".",
"uniq",
"wild_sources",
"=",
"sources",
".",
"select",
"{",
"|",
"source",
"|",
"source",
"=~",
"STAR_REGEXP",
"}",
"if",
"wild_sources",
".",
"any?",
"sources",
".",
"reject",
... | Removes duplicates and sources that already match an existing wild card.
e.g. *.github.com asdf.github.com becomes *.github.com | [
"Removes",
"duplicates",
"and",
"sources",
"that",
"already",
"match",
"an",
"existing",
"wild",
"card",
"."
] | 543e6712aadae08f1653ed973e6b6204f7eac26a | https://github.com/twitter/secure_headers/blob/543e6712aadae08f1653ed973e6b6204f7eac26a/lib/secure_headers/headers/content_security_policy.rb#L148-L160 | train | Returns a list of all the sources that are in the source list. | [
30522,
13366,
2139,
8566,
2361,
1035,
3120,
1035,
2862,
1006,
4216,
1007,
4216,
1027,
4216,
1012,
4895,
18515,
3748,
1035,
4216,
1027,
4216,
1012,
7276,
1063,
1064,
3120,
1064,
3120,
1027,
1066,
2732,
1035,
19723,
10288,
2361,
1065,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/security_group.rb | Aws::EC2.SecurityGroup.revoke_egress | def revoke_egress(options = {})
options = options.merge(group_id: @id)
resp = @client.revoke_security_group_egress(options)
resp.data
end | ruby | def revoke_egress(options = {})
options = options.merge(group_id: @id)
resp = @client.revoke_security_group_egress(options)
resp.data
end | [
"def",
"revoke_egress",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"group_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"revoke_security_group_egress",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
security_group.revoke_egress({
dry_run: false,
ip_permissions: [
{
from_port: 1,
ip_protocol: "String",
ip_ranges: [
{
cidr_ip: "String",
description: "String",
},
],
ipv_6_ranges: [
{
cidr_ipv_6: "String",
description: "String",
},
],
prefix_list_ids: [
{
description: "String",
prefix_list_id: "String",
},
],
to_port: 1,
user_id_group_pairs: [
{
description: "String",
group_id: "String",
group_name: "String",
peering_status: "String",
user_id: "String",
vpc_id: "String",
vpc_peering_connection_id: "String",
},
],
},
],
cidr_ip: "String",
from_port: 1,
ip_protocol: "String",
to_port: 1,
source_security_group_name: "String",
source_security_group_owner_id: "String",
})
@param [Hash] options ({})
@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 [Array<Types::IpPermission>] :ip_permissions
The sets of IP permissions. You can't specify a destination security
group and a CIDR IP address range in the same set of permissions.
@option options [String] :cidr_ip
Not supported. Use a set of IP permissions to specify the CIDR.
@option options [Integer] :from_port
Not supported. Use a set of IP permissions to specify the port.
@option options [String] :ip_protocol
Not supported. Use a set of IP permissions to specify the protocol
name or number.
@option options [Integer] :to_port
Not supported. Use a set of IP permissions to specify the port.
@option options [String] :source_security_group_name
Not supported. Use a set of IP permissions to specify a destination
security group.
@option options [String] :source_security_group_owner_id
Not supported. Use a set of IP permissions to specify a destination
security group.
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/security_group.rb#L535-L539 | train | Revoke Egress security group | [
30522,
13366,
7065,
11045,
1035,
1041,
17603,
4757,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2177,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
7065,
11045,
1035,
3036,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services/lib/2016-06-01/generated/azure_mgmt_recovery_services/vaults.rb | Azure::RecoveryServices::Mgmt::V2016_06_01.Vaults.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, vault_name, vault, custom_headers:nil)
create_or_update_async(resource_group_name, vault_name, vault, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, vault_name, vault, custom_headers:nil)
create_or_update_async(resource_group_name, vault_name, vault, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"vault_name",
",",
"vault",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"vault_name",
",",
"vault",
",",
"custom_headers",
":custom_headers",
... | Creates or updates a Recovery Services vault.
@param resource_group_name [String] The name of the resource group where the
recovery services vault is present.
@param vault_name [String] The name of the recovery services vault.
@param vault [Vault] Recovery Services Vault to be created.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"a",
"Recovery",
"Services",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services/lib/2016-06-01/generated/azure_mgmt_recovery_services/vaults.rb#L323-L325 | train | Creates or updates a key vault in the specified subscription. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11632,
1035,
2171,
1010,
11632,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3443,
1035,
2030,
1035,
10651... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_machine_learning_services/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/workspaces.rb | Azure::MachineLearningServices::Mgmt::V2018_03_01_preview.Workspaces.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, workspace_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, workspace_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"parameters",
",",
"custom_headers",
"... | Creates or updates a workspace with the specified parameters.
@param resource_group_name [String] Name of the resource group in which
workspace is located.
@param workspace_name [String] Name of Azure Machine Learning workspace.
@param parameters [Workspace] The parameters for creating or updating a
machine learning workspace.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"a",
"workspace",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_machine_learning_services/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/workspaces.rb#L151-L153 | train | Creates or updates a managed product. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2573,
15327,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3443,
1035,
2030,
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... |
rails/rails | activemodel/lib/active_model/serialization.rb | ActiveModel.Serialization.serializable_add_includes | def serializable_add_includes(options = {}) #:nodoc:
return unless includes = options[:include]
unless includes.is_a?(Hash)
includes = Hash[Array(includes).flat_map { |n| n.is_a?(Hash) ? n.to_a : [[n, {}]] }]
end
includes.each do |association, opts|
if records = send(association)
yield association, records, opts
end
end
end | ruby | def serializable_add_includes(options = {}) #:nodoc:
return unless includes = options[:include]
unless includes.is_a?(Hash)
includes = Hash[Array(includes).flat_map { |n| n.is_a?(Hash) ? n.to_a : [[n, {}]] }]
end
includes.each do |association, opts|
if records = send(association)
yield association, records, opts
end
end
end | [
"def",
"serializable_add_includes",
"(",
"options",
"=",
"{",
"}",
")",
"#:nodoc:",
"return",
"unless",
"includes",
"=",
"options",
"[",
":include",
"]",
"unless",
"includes",
".",
"is_a?",
"(",
"Hash",
")",
"includes",
"=",
"Hash",
"[",
"Array",
"(",
"inc... | Add associations specified via the <tt>:include</tt> option.
Expects a block that takes as arguments:
+association+ - name of the association
+records+ - the association record(s) to be serialized
+opts+ - options for the association records | [
"Add",
"associations",
"specified",
"via",
"the",
"<tt",
">",
":",
"include<",
"/",
"tt",
">",
"option",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activemodel/lib/active_model/serialization.rb#L178-L190 | train | This method is used to add includes to the record. | [
30522,
13366,
7642,
21335,
3468,
1035,
5587,
1035,
2950,
1006,
7047,
1027,
1063,
1065,
1007,
1001,
1024,
7293,
10085,
1024,
2709,
4983,
2950,
1027,
7047,
1031,
1024,
2421,
1033,
4983,
2950,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_app_service_plans | def list_app_service_plans(resource_group_name, name, custom_headers:nil)
first_page = list_app_service_plans_as_lazy(resource_group_name, name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_app_service_plans(resource_group_name, name, custom_headers:nil)
first_page = list_app_service_plans_as_lazy(resource_group_name, name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_app_service_plans",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_app_service_plans_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
"first_page",
"... | Get all App Service plans in an App Service Environment.
Get all App Service plans in an App Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<AppServicePlan>] operation results. | [
"Get",
"all",
"App",
"Service",
"plans",
"in",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L2644-L2647 | train | Gets all the applications in a service plan. | [
30522,
13366,
2862,
1035,
10439,
1035,
2326,
1035,
3488,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
10439,
1035,
2326,
1035,
3488,
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... |
puppetlabs/bolt | lib/bolt/executor.rb | Bolt.Executor.queue_execute | def queue_execute(targets)
targets.group_by(&:transport).flat_map do |protocol, protocol_targets|
transport = transport(protocol)
report_transport(transport, protocol_targets.count)
transport.batches(protocol_targets).flat_map do |batch|
batch_promises = Array(batch).each_with_object({}) do |target, h|
h[target] = Concurrent::Promise.new(executor: :immediate)
end
# Pass this argument through to avoid retaining a reference to a
# local variable that will change on the next iteration of the loop.
@pool.post(batch_promises) do |result_promises|
begin
results = yield transport, batch
Array(results).each do |result|
result_promises[result.target].set(result)
end
# NotImplementedError can be thrown if the transport is not implemented improperly
rescue StandardError, NotImplementedError => e
result_promises.each do |target, promise|
# If an exception happens while running, the result won't be logged
# by the CLI. Log a warning, as this is probably a problem with the transport.
# If batch_* commands are used from the Base transport, then exceptions
# normally shouldn't reach here.
@logger.warn(e)
promise.set(Bolt::Result.from_exception(target, e))
end
ensure
# Make absolutely sure every promise gets a result to avoid a
# deadlock. Use whatever exception is causing this block to
# execute, or generate one if we somehow got here without an
# exception and some promise is still missing a result.
result_promises.each do |target, promise|
next if promise.fulfilled?
error = $ERROR_INFO || Bolt::Error.new("No result was returned for #{target.uri}",
"puppetlabs.bolt/missing-result-error")
promise.set(Bolt::Result.from_exception(target, error))
end
end
end
batch_promises.values
end
end
end | ruby | def queue_execute(targets)
targets.group_by(&:transport).flat_map do |protocol, protocol_targets|
transport = transport(protocol)
report_transport(transport, protocol_targets.count)
transport.batches(protocol_targets).flat_map do |batch|
batch_promises = Array(batch).each_with_object({}) do |target, h|
h[target] = Concurrent::Promise.new(executor: :immediate)
end
# Pass this argument through to avoid retaining a reference to a
# local variable that will change on the next iteration of the loop.
@pool.post(batch_promises) do |result_promises|
begin
results = yield transport, batch
Array(results).each do |result|
result_promises[result.target].set(result)
end
# NotImplementedError can be thrown if the transport is not implemented improperly
rescue StandardError, NotImplementedError => e
result_promises.each do |target, promise|
# If an exception happens while running, the result won't be logged
# by the CLI. Log a warning, as this is probably a problem with the transport.
# If batch_* commands are used from the Base transport, then exceptions
# normally shouldn't reach here.
@logger.warn(e)
promise.set(Bolt::Result.from_exception(target, e))
end
ensure
# Make absolutely sure every promise gets a result to avoid a
# deadlock. Use whatever exception is causing this block to
# execute, or generate one if we somehow got here without an
# exception and some promise is still missing a result.
result_promises.each do |target, promise|
next if promise.fulfilled?
error = $ERROR_INFO || Bolt::Error.new("No result was returned for #{target.uri}",
"puppetlabs.bolt/missing-result-error")
promise.set(Bolt::Result.from_exception(target, error))
end
end
end
batch_promises.values
end
end
end | [
"def",
"queue_execute",
"(",
"targets",
")",
"targets",
".",
"group_by",
"(",
":transport",
")",
".",
"flat_map",
"do",
"|",
"protocol",
",",
"protocol_targets",
"|",
"transport",
"=",
"transport",
"(",
"protocol",
")",
"report_transport",
"(",
"transport",
",... | Starts executing the given block on a list of nodes in parallel, one thread per "batch".
This is the main driver of execution on a list of targets. It first
groups targets by transport, then divides each group into batches as
defined by the transport. Yields each batch, along with the corresponding
transport, to the block in turn and returns an array of result promises. | [
"Starts",
"executing",
"the",
"given",
"block",
"on",
"a",
"list",
"of",
"nodes",
"in",
"parallel",
"one",
"thread",
"per",
"batch",
"."
] | 50689a33699939d262ea7c822a4b24fd8c4f8d8a | https://github.com/puppetlabs/bolt/blob/50689a33699939d262ea7c822a4b24fd8c4f8d8a/lib/bolt/executor.rb#L70-L112 | train | Execute a block of commands on the given targets. | [
30522,
13366,
24240,
1035,
15389,
1006,
7889,
1007,
7889,
1012,
2177,
1035,
2011,
1006,
1004,
1024,
3665,
1007,
1012,
4257,
1035,
4949,
2079,
1064,
8778,
1010,
8778,
1035,
7889,
1064,
3665,
1027,
3665,
1006,
8778,
1007,
3189,
1035,
3665,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/fields/content_type_field.rb | Mail.ContentTypeField.sanitize | def sanitize(val)
# TODO: check if there are cases where whitespace is not a separator
val = val.
gsub(/\s*=\s*/,'='). # remove whitespaces around equal sign
gsub(/[; ]+/, '; '). #use '; ' as a separator (or EOL)
gsub(/;\s*$/,'') #remove trailing to keep examples below
if val =~ /(boundary=(\S*))/i
val = "#{$`.downcase}boundary=#{$2}#{$'.downcase}"
else
val.downcase!
end
case
when val.chomp =~ /^\s*([\w\-]+)\/([\w\-]+)\s*;\s?(ISO[\w\-]+)$/i
# Microsoft helper:
# Handles 'type/subtype;ISO-8559-1'
"#{$1}/#{$2}; charset=#{Utilities.quote_atom($3)}"
when val.chomp =~ /^text;?$/i
# Handles 'text;' and 'text'
"text/plain;"
when val.chomp =~ /^(\w+);\s(.*)$/i
# Handles 'text; <parameters>'
"text/plain; #{$2}"
when val =~ /([\w\-]+\/[\w\-]+);\scharset="charset="(\w+)""/i
# Handles text/html; charset="charset="GB2312""
"#{$1}; charset=#{Utilities.quote_atom($2)}"
when val =~ /([\w\-]+\/[\w\-]+);\s+(.*)/i
type = $1
# Handles misquoted param values
# e.g: application/octet-stream; name=archiveshelp1[1].htm
# and: audio/x-midi;\r\n\sname=Part .exe
params = $2.to_s.split(/\s+/)
params = params.map { |i| i.to_s.chomp.strip }
params = params.map { |i| i.split(/\s*\=\s*/, 2) }
params = params.map { |i| "#{i[0]}=#{Utilities.dquote(i[1].to_s.gsub(/;$/,""))}" }.join('; ')
"#{type}; #{params}"
when val =~ /^\s*$/
'text/plain'
else
val
end
end | ruby | def sanitize(val)
# TODO: check if there are cases where whitespace is not a separator
val = val.
gsub(/\s*=\s*/,'='). # remove whitespaces around equal sign
gsub(/[; ]+/, '; '). #use '; ' as a separator (or EOL)
gsub(/;\s*$/,'') #remove trailing to keep examples below
if val =~ /(boundary=(\S*))/i
val = "#{$`.downcase}boundary=#{$2}#{$'.downcase}"
else
val.downcase!
end
case
when val.chomp =~ /^\s*([\w\-]+)\/([\w\-]+)\s*;\s?(ISO[\w\-]+)$/i
# Microsoft helper:
# Handles 'type/subtype;ISO-8559-1'
"#{$1}/#{$2}; charset=#{Utilities.quote_atom($3)}"
when val.chomp =~ /^text;?$/i
# Handles 'text;' and 'text'
"text/plain;"
when val.chomp =~ /^(\w+);\s(.*)$/i
# Handles 'text; <parameters>'
"text/plain; #{$2}"
when val =~ /([\w\-]+\/[\w\-]+);\scharset="charset="(\w+)""/i
# Handles text/html; charset="charset="GB2312""
"#{$1}; charset=#{Utilities.quote_atom($2)}"
when val =~ /([\w\-]+\/[\w\-]+);\s+(.*)/i
type = $1
# Handles misquoted param values
# e.g: application/octet-stream; name=archiveshelp1[1].htm
# and: audio/x-midi;\r\n\sname=Part .exe
params = $2.to_s.split(/\s+/)
params = params.map { |i| i.to_s.chomp.strip }
params = params.map { |i| i.split(/\s*\=\s*/, 2) }
params = params.map { |i| "#{i[0]}=#{Utilities.dquote(i[1].to_s.gsub(/;$/,""))}" }.join('; ')
"#{type}; #{params}"
when val =~ /^\s*$/
'text/plain'
else
val
end
end | [
"def",
"sanitize",
"(",
"val",
")",
"# TODO: check if there are cases where whitespace is not a separator",
"val",
"=",
"val",
".",
"gsub",
"(",
"/",
"\\s",
"\\s",
"/",
",",
"'='",
")",
".",
"# remove whitespaces around equal sign",
"gsub",
"(",
"/",
"/",
",",
"';... | Various special cases from random emails found that I am not going to change
the parser for | [
"Various",
"special",
"cases",
"from",
"random",
"emails",
"found",
"that",
"I",
"am",
"not",
"going",
"to",
"change",
"the",
"parser",
"for"
] | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/fields/content_type_field.rb#L119-L161 | train | sanitize a string | [
30522,
13366,
2624,
25090,
4371,
1006,
11748,
1007,
1001,
28681,
2080,
1024,
4638,
2065,
2045,
2024,
3572,
2073,
12461,
15327,
2003,
2025,
1037,
19802,
25879,
2953,
11748,
1027,
11748,
1012,
28177,
12083,
1006,
1013,
1032,
1055,
1008,
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... |
sensu/sensu | lib/sensu/utilities.rb | Sensu.Utilities.in_time_windows? | def in_time_windows?(conditions)
in_window = false
window_days = conditions[:days] || {}
if window_days[:all]
in_window = window_days[:all].any? do |condition|
in_time_window?(condition)
end
end
current_day = Time.now.strftime("%A").downcase.to_sym
if !in_window && window_days[current_day]
in_window = window_days[current_day].any? do |condition|
in_time_window?(condition)
end
end
in_window
end | ruby | def in_time_windows?(conditions)
in_window = false
window_days = conditions[:days] || {}
if window_days[:all]
in_window = window_days[:all].any? do |condition|
in_time_window?(condition)
end
end
current_day = Time.now.strftime("%A").downcase.to_sym
if !in_window && window_days[current_day]
in_window = window_days[current_day].any? do |condition|
in_time_window?(condition)
end
end
in_window
end | [
"def",
"in_time_windows?",
"(",
"conditions",
")",
"in_window",
"=",
"false",
"window_days",
"=",
"conditions",
"[",
":days",
"]",
"||",
"{",
"}",
"if",
"window_days",
"[",
":all",
"]",
"in_window",
"=",
"window_days",
"[",
":all",
"]",
".",
"any?",
"do",
... | Determine if time window conditions for one or more days of the
week are met. If a day of the week is provided, it can provide
one or more conditions, each with a `:begin` and `:end` time,
eg. "11:30:00 PM", or `false` will be returned.
@param conditions [Hash]
@option conditions [String] :days of the week.
@return [TrueClass, FalseClass] | [
"Determine",
"if",
"time",
"window",
"conditions",
"for",
"one",
"or",
"more",
"days",
"of",
"the",
"week",
"are",
"met",
".",
"If",
"a",
"day",
"of",
"the",
"week",
"is",
"provided",
"it",
"can",
"provide",
"one",
"or",
"more",
"conditions",
"each",
"... | 51319e4b58c8d9986f101ad71ff729aa3e51e951 | https://github.com/sensu/sensu/blob/51319e4b58c8d9986f101ad71ff729aa3e51e951/lib/sensu/utilities.rb#L356-L371 | train | Returns true if the current time is in a window | [
30522,
13366,
1999,
1035,
2051,
1035,
3645,
1029,
1006,
3785,
1007,
1999,
1035,
3332,
1027,
6270,
3332,
1035,
2420,
1027,
3785,
1031,
1024,
2420,
1033,
1064,
1064,
1063,
1065,
2065,
3332,
1035,
2420,
1031,
1024,
2035,
1033,
1999,
1035,
33... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
markdownlint/markdownlint | lib/mdl/doc.rb | MarkdownLint.Doc.add_levels | def add_levels(elements, level=1)
elements.each do |e|
e.options[:element_level] = level
add_levels(e.children, level+1)
end
end | ruby | def add_levels(elements, level=1)
elements.each do |e|
e.options[:element_level] = level
add_levels(e.children, level+1)
end
end | [
"def",
"add_levels",
"(",
"elements",
",",
"level",
"=",
"1",
")",
"elements",
".",
"each",
"do",
"|",
"e",
"|",
"e",
".",
"options",
"[",
":element_level",
"]",
"=",
"level",
"add_levels",
"(",
"e",
".",
"children",
",",
"level",
"+",
"1",
")",
"e... | Adds a 'level' option to all elements to show how nested they are | [
"Adds",
"a",
"level",
"option",
"to",
"all",
"elements",
"to",
"show",
"how",
"nested",
"they",
"are"
] | a9e80fcf3989d73b654b00bb2225a00be53983e8 | https://github.com/markdownlint/markdownlint/blob/a9e80fcf3989d73b654b00bb2225a00be53983e8/lib/mdl/doc.rb#L282-L287 | train | Add the levels of the elements to the current page | [
30522,
13366,
5587,
1035,
3798,
1006,
3787,
1010,
2504,
1027,
1015,
1007,
3787,
1012,
2169,
2079,
1064,
1041,
1064,
1041,
1012,
7047,
1031,
1024,
5783,
1035,
2504,
1033,
1027,
2504,
5587,
1035,
3798,
1006,
1041,
1012,
2336,
1010,
2504,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/streaming_endpoints.rb | Azure::MediaServices::Mgmt::V2018_07_01.StreamingEndpoints.scale_async | def scale_async(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:nil)
# Send request
promise = begin_scale_async(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def scale_async(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:nil)
# Send request
promise = begin_scale_async(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"scale_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"streaming_endpoint_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_scale_async",
"(",
"resource_group_name",
",",
"account_name",
",",... | @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 streaming_endpoint_name [String] The name of the StreamingEndpoint.
@param parameters [StreamingEntityScaleUnit] StreamingEndpoint scale
parameters
@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",
"within",
"the",
"Azure",
"subscription",
".",
"@param",
"account_name",
"[",
"String",
"]",
"The",
"Media",
"Services",
"account",
"name",
".",
"@param",
"st... | 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/streaming_endpoints.rb#L505-L519 | train | Scale a streaming endpoint to a specified size. | [
30522,
13366,
4094,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11058,
1035,
2203,
8400,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
httprb/http | lib/http/chainable.rb | HTTP.Chainable.via | def via(*proxy)
proxy_hash = {}
proxy_hash[:proxy_address] = proxy[0] if proxy[0].is_a?(String)
proxy_hash[:proxy_port] = proxy[1] if proxy[1].is_a?(Integer)
proxy_hash[:proxy_username] = proxy[2] if proxy[2].is_a?(String)
proxy_hash[:proxy_password] = proxy[3] if proxy[3].is_a?(String)
proxy_hash[:proxy_headers] = proxy[2] if proxy[2].is_a?(Hash)
proxy_hash[:proxy_headers] = proxy[4] if proxy[4].is_a?(Hash)
raise(RequestError, "invalid HTTP proxy: #{proxy_hash}") unless (2..5).cover?(proxy_hash.keys.size)
branch default_options.with_proxy(proxy_hash)
end | ruby | def via(*proxy)
proxy_hash = {}
proxy_hash[:proxy_address] = proxy[0] if proxy[0].is_a?(String)
proxy_hash[:proxy_port] = proxy[1] if proxy[1].is_a?(Integer)
proxy_hash[:proxy_username] = proxy[2] if proxy[2].is_a?(String)
proxy_hash[:proxy_password] = proxy[3] if proxy[3].is_a?(String)
proxy_hash[:proxy_headers] = proxy[2] if proxy[2].is_a?(Hash)
proxy_hash[:proxy_headers] = proxy[4] if proxy[4].is_a?(Hash)
raise(RequestError, "invalid HTTP proxy: #{proxy_hash}") unless (2..5).cover?(proxy_hash.keys.size)
branch default_options.with_proxy(proxy_hash)
end | [
"def",
"via",
"(",
"*",
"proxy",
")",
"proxy_hash",
"=",
"{",
"}",
"proxy_hash",
"[",
":proxy_address",
"]",
"=",
"proxy",
"[",
"0",
"]",
"if",
"proxy",
"[",
"0",
"]",
".",
"is_a?",
"(",
"String",
")",
"proxy_hash",
"[",
":proxy_port",
"]",
"=",
"p... | Make a request through an HTTP proxy
@param [Array] proxy
@raise [Request::Error] if HTTP proxy is invalid | [
"Make",
"a",
"request",
"through",
"an",
"HTTP",
"proxy"
] | f37a10ea4fab3ee411907ea2e4251ddf0ca33a93 | https://github.com/httprb/http/blob/f37a10ea4fab3ee411907ea2e4251ddf0ca33a93/lib/http/chainable.rb#L155-L167 | train | Returns a hash of HTTP proxy options | [
30522,
13366,
3081,
1006,
1008,
24540,
1007,
24540,
1035,
23325,
1027,
1063,
1065,
24540,
1035,
23325,
1031,
1024,
24540,
1035,
4769,
1033,
1027,
24540,
1031,
1014,
1033,
2065,
24540,
1031,
1014,
1033,
1012,
2003,
1035,
1037,
1029,
1006,
51... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/sessions.rb | Azure::Logic::Mgmt::V2016_06_01.Sessions.get_with_http_info | def get_with_http_info(resource_group_name, integration_account_name, session_name, custom_headers:nil)
get_async(resource_group_name, integration_account_name, session_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, integration_account_name, session_name, custom_headers:nil)
get_async(resource_group_name, integration_account_name, session_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"session_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"session_name",
",",
"custom_headers",
":c... | Gets an integration account session.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param session_name [String] The integration account session 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. | [
"Gets",
"an",
"integration",
"account",
"session",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/sessions.rb#L152-L154 | train | Gets the integration account integration specification. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8346,
1035,
4070,
1035,
2171,
1010,
5219,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
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_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb | Azure::Storage::Mgmt::V2018_07_01.BlobContainers.create_or_update_immutability_policy | def create_or_update_immutability_policy(resource_group_name, account_name, container_name, parameters:nil, if_match:nil, custom_headers:nil)
response = create_or_update_immutability_policy_async(resource_group_name, account_name, container_name, parameters:parameters, if_match:if_match, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update_immutability_policy(resource_group_name, account_name, container_name, parameters:nil, if_match:nil, custom_headers:nil)
response = create_or_update_immutability_policy_async(resource_group_name, account_name, container_name, parameters:parameters, if_match:if_match, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update_immutability_policy",
"(",
"resource_group_name",
",",
"account_name",
",",
"container_name",
",",
"parameters",
":",
"nil",
",",
"if_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_immutability_pol... | Creates or updates an unlocked immutability policy. ETag in If-Match is
honored if given but not required for this operation.
@param resource_group_name [String] The name of the resource group within the
user's subscription. The name is case insensitive.
@param account_name [String] The name of the storage account within the
specified resource group. Storage account names must be between 3 and 24
characters in length and use numbers and lower-case letters only.
@param container_name [String] The name of the blob container within the
specified storage account. Blob container names must be between 3 and 63
characters in length and use numbers, lower-case letters and dash (-) only.
Every dash (-) character must be immediately preceded and followed by a
letter or number.
@param parameters [ImmutabilityPolicy] The ImmutabilityPolicy Properties that
will be created or updated to a blob container.
@param if_match [String] The entity state (ETag) version of the immutability
policy to update. A value of "*" can be used to apply the operation only if
the immutability policy already exists. If omitted, this operation will
always be applied.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ImmutabilityPolicy] operation results. | [
"Creates",
"or",
"updates",
"an",
"unlocked",
"immutability",
"policy",
".",
"ETag",
"in",
"If",
"-",
"Match",
"is",
"honored",
"if",
"given",
"but",
"not",
"required",
"for",
"this",
"operation",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb#L988-L991 | train | Creates or updates an immutability policy. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
10047,
28120,
8010,
1035,
3343,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11661,
1035,
2171,
1010,
11709,
1024,
9152,
2140,
1010,
2065,
1035,
2674,
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... |
rails/rails | railties/lib/rails/application.rb | Rails.Application.watchable_args | def watchable_args #:nodoc:
files, dirs = config.watchable_files.dup, config.watchable_dirs.dup
ActiveSupport::Dependencies.autoload_paths.each do |path|
dirs[path.to_s] = [:rb]
end
[files, dirs]
end | ruby | def watchable_args #:nodoc:
files, dirs = config.watchable_files.dup, config.watchable_dirs.dup
ActiveSupport::Dependencies.autoload_paths.each do |path|
dirs[path.to_s] = [:rb]
end
[files, dirs]
end | [
"def",
"watchable_args",
"#:nodoc:",
"files",
",",
"dirs",
"=",
"config",
".",
"watchable_files",
".",
"dup",
",",
"config",
".",
"watchable_dirs",
".",
"dup",
"ActiveSupport",
"::",
"Dependencies",
".",
"autoload_paths",
".",
"each",
"do",
"|",
"path",
"|",
... | Returns an array of file paths appended with a hash of
directories-extensions suitable for ActiveSupport::FileUpdateChecker
API. | [
"Returns",
"an",
"array",
"of",
"file",
"paths",
"appended",
"with",
"a",
"hash",
"of",
"directories",
"-",
"extensions",
"suitable",
"for",
"ActiveSupport",
"::",
"FileUpdateChecker",
"API",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/railties/lib/rails/application.rb#L348-L356 | train | Returns the arguments for the watchable command. | [
30522,
13366,
3422,
3085,
1035,
12098,
5620,
1001,
1024,
7293,
10085,
1024,
6764,
1010,
16101,
2015,
1027,
9530,
8873,
2290,
1012,
3422,
3085,
1035,
6764,
1012,
4241,
2361,
1010,
9530,
8873,
2290,
1012,
3422,
3085,
1035,
16101,
2015,
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... |
castwide/solargraph | lib/solargraph/workspace.rb | Solargraph.Workspace.synchronize! | def synchronize! updater
source_hash[updater.filename] = source_hash[updater.filename].synchronize(updater)
end | ruby | def synchronize! updater
source_hash[updater.filename] = source_hash[updater.filename].synchronize(updater)
end | [
"def",
"synchronize!",
"updater",
"source_hash",
"[",
"updater",
".",
"filename",
"]",
"=",
"source_hash",
"[",
"updater",
".",
"filename",
"]",
".",
"synchronize",
"(",
"updater",
")",
"end"
] | Synchronize the workspace from the provided updater.
@param updater [Source::Updater]
@return [void] | [
"Synchronize",
"the",
"workspace",
"from",
"the",
"provided",
"updater",
"."
] | 47badb5d151aca775ccbe6c470236089eae7839d | https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/workspace.rb#L123-L125 | train | Synchronize the updater. | [
30522,
13366,
26351,
8093,
10698,
4371,
999,
10651,
2099,
3120,
1035,
23325,
1031,
10651,
2099,
1012,
5371,
18442,
1033,
1027,
3120,
1035,
23325,
1031,
10651,
2099,
1012,
5371,
18442,
1033,
1012,
26351,
8093,
10698,
4371,
1006,
10651,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/rake | lib/rake/task.rb | Rake.Task.invoke | def invoke(*args)
task_args = TaskArguments.new(arg_names, args)
invoke_with_call_chain(task_args, InvocationChain::EMPTY)
end | ruby | def invoke(*args)
task_args = TaskArguments.new(arg_names, args)
invoke_with_call_chain(task_args, InvocationChain::EMPTY)
end | [
"def",
"invoke",
"(",
"*",
"args",
")",
"task_args",
"=",
"TaskArguments",
".",
"new",
"(",
"arg_names",
",",
"args",
")",
"invoke_with_call_chain",
"(",
"task_args",
",",
"InvocationChain",
"::",
"EMPTY",
")",
"end"
] | Invoke the task if it is needed. Prerequisites are invoked first. | [
"Invoke",
"the",
"task",
"if",
"it",
"is",
"needed",
".",
"Prerequisites",
"are",
"invoked",
"first",
"."
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/task.rb#L181-L184 | train | Invoke the task with the given arguments | [
30522,
13366,
1999,
6767,
3489,
1006,
1008,
12098,
5620,
1007,
4708,
1035,
12098,
5620,
1027,
4708,
2906,
22850,
11187,
1012,
2047,
1006,
12098,
2290,
1035,
3415,
1010,
12098,
5620,
1007,
1999,
6767,
3489,
1035,
2007,
1035,
2655,
1035,
4677... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.get_image_performances | def get_image_performances(project_id, iteration_id, tag_ids:nil, order_by:nil, take:50, skip:0, custom_headers:nil)
response = get_image_performances_async(project_id, iteration_id, tag_ids:tag_ids, order_by:order_by, take:take, skip:skip, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_image_performances(project_id, iteration_id, tag_ids:nil, order_by:nil, take:50, skip:0, custom_headers:nil)
response = get_image_performances_async(project_id, iteration_id, tag_ids:tag_ids, order_by:order_by, take:take, skip:skip, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_image_performances",
"(",
"project_id",
",",
"iteration_id",
",",
"tag_ids",
":",
"nil",
",",
"order_by",
":",
"nil",
",",
"take",
":",
"50",
",",
"skip",
":",
"0",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_image_performances_... | Get image with its prediction for a given project iteration.
This API supports batching and range selection. By default it will only
return first 50 images matching images.
Use the {take} and {skip} parameters to control how many images to return in
a given batch.
The filtering is on an and/or relationship. For example, if the provided tag
ids are for the "Dog" and
"Cat" tags, then only images tagged with Dog and/or Cat will be returned
@param project_id The project id.
@param iteration_id The iteration id. Defaults to workspace.
@param tag_ids A list of tags ids to filter the images. Defaults to all
tagged images when null. Limited to 20.
@param order_by [Enum] The ordering. Defaults to newest. Possible values
include: 'Newest', 'Oldest'
@param take [Integer] Maximum number of images to return. Defaults to 50,
limited to 256.
@param skip [Integer] Number of images to skip before beginning the image
batch. Defaults to 0.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Get",
"image",
"with",
"its",
"prediction",
"for",
"a",
"given",
"project",
"iteration",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb#L2552-L2555 | train | Gets the image performance for an iteration. | [
30522,
13366,
2131,
1035,
3746,
1035,
4616,
1006,
2622,
1035,
8909,
1010,
27758,
1035,
8909,
1010,
6415,
1035,
8909,
2015,
1024,
9152,
2140,
1010,
2344,
1035,
2011,
1024,
9152,
2140,
1010,
2202,
1024,
2753,
1010,
13558,
1024,
1014,
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... |
rails/rails | activerecord/lib/active_record/relation.rb | ActiveRecord.Relation.to_sql | def to_sql
@to_sql ||= begin
if eager_loading?
apply_join_dependency do |relation, join_dependency|
relation = join_dependency.apply_column_aliases(relation)
relation.to_sql
end
else
conn = klass.connection
conn.unprepared_statement { conn.to_sql(arel) }
end
end
end | ruby | def to_sql
@to_sql ||= begin
if eager_loading?
apply_join_dependency do |relation, join_dependency|
relation = join_dependency.apply_column_aliases(relation)
relation.to_sql
end
else
conn = klass.connection
conn.unprepared_statement { conn.to_sql(arel) }
end
end
end | [
"def",
"to_sql",
"@to_sql",
"||=",
"begin",
"if",
"eager_loading?",
"apply_join_dependency",
"do",
"|",
"relation",
",",
"join_dependency",
"|",
"relation",
"=",
"join_dependency",
".",
"apply_column_aliases",
"(",
"relation",
")",
"relation",
".",
"to_sql",
"end",
... | Returns sql statement for the relation.
User.where(name: 'Oscar').to_sql
# => SELECT "users".* FROM "users" WHERE "users"."name" = 'Oscar' | [
"Returns",
"sql",
"statement",
"for",
"the",
"relation",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/relation.rb#L639-L651 | train | Returns the SQL representation of the relation. | [
30522,
13366,
2000,
1035,
29296,
1030,
2000,
1035,
29296,
1064,
1064,
1027,
4088,
2065,
9461,
1035,
10578,
1029,
6611,
1035,
3693,
1035,
24394,
2079,
1064,
7189,
1010,
3693,
1035,
24394,
1064,
7189,
1027,
3693,
1035,
24394,
1012,
6611,
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_datalake_store/lib/2015-10-01-preview/generated/azure_mgmt_datalake_store/account.rb | Azure::DataLakeStore::Mgmt::V2015_10_01_preview.Account.list_firewall_rules | def list_firewall_rules(resource_group_name, account_name, custom_headers:nil)
first_page = list_firewall_rules_as_lazy(resource_group_name, account_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_firewall_rules(resource_group_name, account_name, custom_headers:nil)
first_page = list_firewall_rules_as_lazy(resource_group_name, account_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_firewall_rules",
"(",
"resource_group_name",
",",
"account_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_firewall_rules_as_lazy",
"(",
"resource_group_name",
",",
"account_name",
",",
"custom_headers",
":custom_headers",
")",
"first_... | Lists the Data Lake Store firewall rules within the specified Data Lake Store
account.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Store account.
@param account_name [String] The name of the Data Lake Store account from
which to get the firewall rules.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<FirewallRule>] operation results. | [
"Lists",
"the",
"Data",
"Lake",
"Store",
"firewall",
"rules",
"within",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_store/lib/2015-10-01-preview/generated/azure_mgmt_datalake_store/account.rb#L233-L236 | train | Gets the firewall rules for the specified Data Lake Store account. | [
30522,
13366,
2862,
1035,
2543,
9628,
1035,
3513,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2543,
9628,
1035,
3513,
1035,
2004,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_tables.rb | Azure::Network::Mgmt::V2018_07_01.RouteTables.begin_update_tags_with_http_info | def begin_update_tags_with_http_info(resource_group_name, route_table_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, route_table_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_tags_with_http_info(resource_group_name, route_table_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, route_table_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_tags_with_http_info",
"(",
"resource_group_name",
",",
"route_table_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_tags_async",
"(",
"resource_group_name",
",",
"route_table_name",
",",
"parameters",
",",
"custom_headers... | Updates a route table tags.
@param resource_group_name [String] The name of the resource group.
@param route_table_name [String] The name of the route table.
@param parameters [TagsObject] Parameters supplied to update route table
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",
"route",
"table",
"tags",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_tables.rb#L647-L649 | train | Updates a route table tags. | [
30522,
13366,
4088,
1035,
10651,
1035,
22073,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2799,
1035,
2795,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
10651... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_run_action_repetitions.rb | Azure::Logic::Mgmt::V2016_06_01.WorkflowRunActionRepetitions.list_expression_traces | def list_expression_traces(resource_group_name, workflow_name, run_name, action_name, repetition_name, custom_headers:nil)
response = list_expression_traces_async(resource_group_name, workflow_name, run_name, action_name, repetition_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_expression_traces(resource_group_name, workflow_name, run_name, action_name, repetition_name, custom_headers:nil)
response = list_expression_traces_async(resource_group_name, workflow_name, run_name, action_name, repetition_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_expression_traces",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"run_name",
",",
"action_name",
",",
"repetition_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_expression_traces_async",
"(",
"resource_group_name",
",",
"wor... | Lists a workflow run expression trace.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param run_name [String] The workflow run name.
@param action_name [String] The workflow action name.
@param repetition_name [String] The workflow repetition.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ExpressionTraces] operation results. | [
"Lists",
"a",
"workflow",
"run",
"expression",
"trace",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_run_action_repetitions.rb#L241-L244 | train | Gets the expression traces for a workflow run. | [
30522,
13366,
2862,
1035,
3670,
1035,
10279,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
2448,
1035,
2171,
1010,
2895,
1035,
2171,
1010,
23318,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_usages_next | def list_usages_next(next_page_link, custom_headers:nil)
response = list_usages_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_usages_next(next_page_link, custom_headers:nil)
response = list_usages_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_usages_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_usages_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
"... | Get global usage metrics of an App Service Environment.
Get global usage metrics of an App Service Environment.
@param next_page_link [String] The NextLink from the previous successful call
to List operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CsmUsageQuotaCollection] operation results. | [
"Get",
"global",
"usage",
"metrics",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L6366-L6369 | train | Gets the list of all the available usages for a given resource group. | [
30522,
13366,
2862,
1035,
8192,
2015,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
8192,
2015,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
1035,
3931,
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... |
grpc/grpc | src/ruby/lib/grpc/generic/client_stub.rb | GRPC.ClientStub.request_response | def request_response(method, req, marshal, unmarshal,
deadline: nil,
return_op: false,
parent: nil,
credentials: nil,
metadata: {})
c = new_active_call(method, marshal, unmarshal,
deadline: deadline,
parent: parent,
credentials: credentials)
interception_context = @interceptors.build_context
intercept_args = {
method: method,
request: req,
call: c.interceptable,
metadata: metadata
}
if return_op
# return the operation view of the active_call; define #execute as a
# new method for this instance that invokes #request_response.
c.merge_metadata_to_send(metadata)
op = c.operation
op.define_singleton_method(:execute) do
interception_context.intercept!(:request_response, intercept_args) do
c.request_response(req, metadata: metadata)
end
end
op
else
interception_context.intercept!(:request_response, intercept_args) do
c.request_response(req, metadata: metadata)
end
end
end | ruby | def request_response(method, req, marshal, unmarshal,
deadline: nil,
return_op: false,
parent: nil,
credentials: nil,
metadata: {})
c = new_active_call(method, marshal, unmarshal,
deadline: deadline,
parent: parent,
credentials: credentials)
interception_context = @interceptors.build_context
intercept_args = {
method: method,
request: req,
call: c.interceptable,
metadata: metadata
}
if return_op
# return the operation view of the active_call; define #execute as a
# new method for this instance that invokes #request_response.
c.merge_metadata_to_send(metadata)
op = c.operation
op.define_singleton_method(:execute) do
interception_context.intercept!(:request_response, intercept_args) do
c.request_response(req, metadata: metadata)
end
end
op
else
interception_context.intercept!(:request_response, intercept_args) do
c.request_response(req, metadata: metadata)
end
end
end | [
"def",
"request_response",
"(",
"method",
",",
"req",
",",
"marshal",
",",
"unmarshal",
",",
"deadline",
":",
"nil",
",",
"return_op",
":",
"false",
",",
"parent",
":",
"nil",
",",
"credentials",
":",
"nil",
",",
"metadata",
":",
"{",
"}",
")",
"c",
... | Creates a new ClientStub.
Minimally, a stub is created with the just the host of the gRPC service
it wishes to access, e.g.,
my_stub = ClientStub.new(example.host.com:50505,
:this_channel_is_insecure)
If a channel_override argument is passed, it will be used as the
underlying channel. Otherwise, the channel_args argument will be used
to construct a new underlying channel.
There are some specific keyword args that are not used to configure the
channel:
- :channel_override
when present, this must be a pre-created GRPC::Core::Channel. If it's
present the host and arbitrary keyword arg areignored, and the RPC
connection uses this channel.
- :timeout
when present, this is the default timeout used for calls
@param host [String] the host the stub connects to
@param creds [Core::ChannelCredentials|Symbol] the channel credentials, or
:this_channel_is_insecure, which explicitly indicates that the client
should be created with an insecure connection. Note: this argument is
ignored if the channel_override argument is provided.
@param channel_override [Core::Channel] a pre-created channel
@param timeout [Number] the default timeout to use in requests
@param propagate_mask [Number] A bitwise combination of flags in
GRPC::Core::PropagateMasks. Indicates how data should be propagated
from parent server calls to child client calls if this client is being
used within a gRPC server.
@param channel_args [Hash] the channel arguments. Note: this argument is
ignored if the channel_override argument is provided.
@param interceptors [Array<GRPC::ClientInterceptor>] An array of
GRPC::ClientInterceptor objects that will be used for
intercepting calls before they are executed
Interceptors are an EXPERIMENTAL API.
request_response sends a request to a GRPC server, and returns the
response.
== Flow Control ==
This is a blocking call.
* it does not return until a response is received.
* the requests is sent only when GRPC core's flow control allows it to
be sent.
== Errors ==
An RuntimeError is raised if
* the server responds with a non-OK status
* the deadline is exceeded
== Return Value ==
If return_op is false, the call returns the response
If return_op is true, the call returns an Operation, calling execute
on the Operation returns the response.
@param method [String] the RPC method to call on the GRPC server
@param req [Object] the request sent to the server
@param marshal [Function] f(obj)->string that marshals requests
@param unmarshal [Function] f(string)->obj that unmarshals responses
@param deadline [Time] (optional) the time the request should complete
@param return_op [true|false] return an Operation if true
@param parent [Core::Call] a prior call whose reserved metadata
will be propagated by this one.
@param credentials [Core::CallCredentials] credentials to use when making
the call
@param metadata [Hash] metadata to be sent to the server
@return [Object] the response received from the server | [
"Creates",
"a",
"new",
"ClientStub",
"."
] | f3937f0e55227a4ef3a23f895d3b204a947610f8 | https://github.com/grpc/grpc/blob/f3937f0e55227a4ef3a23f895d3b204a947610f8/src/ruby/lib/grpc/generic/client_stub.rb#L148-L181 | train | Creates a new active_call and returns a new active_call object. | [
30522,
13366,
5227,
1035,
3433,
1006,
4118,
1010,
2128,
4160,
1010,
8610,
1010,
4895,
7849,
7377,
2140,
1010,
15117,
1024,
9152,
2140,
1010,
2709,
1035,
6728,
1024,
6270,
1010,
6687,
1024,
9152,
2140,
1010,
22496,
1024,
9152,
2140,
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... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_sas_definition_with_http_info | def get_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil)
get_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value!
end | ruby | def get_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, custom_headers:nil)
get_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, custom_headers:custom_headers).value!
end | [
"def",
"get_sas_definition_with_http_info",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"sas_definition_name",
",",
"custom_headers",
":",
"nil",
")",
"get_sas_definition_async",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"sas_definition_name",
",",... | Gets information about a SAS definition for the specified storage account.
This operation requires the storage/getsas 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. | [
"Gets",
"information",
"about",
"a",
"SAS",
"definition",
"for",
"the",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"getsas",
"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#L7901-L7903 | train | Gets the specified SAS definition. | [
30522,
13366,
2131,
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,
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... |
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.begin_get_flow_log_status | def begin_get_flow_log_status(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_get_flow_log_status(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = begin_get_flow_log_status_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_get_flow_log_status",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_get_flow_log_status_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"paramet... | Queries status of flow log and traffic analytics (optional) on a specified
resource.
@param resource_group_name [String] The name of the network watcher resource
group.
@param network_watcher_name [String] The name of the network watcher
resource.
@param parameters [FlowLogStatusParameters] Parameters that define a resource
to query flow log and traffic analytics (optional) status.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [FlowLogInformation] operation results. | [
"Queries",
"status",
"of",
"flow",
"log",
"and",
"traffic",
"analytics",
"(",
"optional",
")",
"on",
"a",
"specified",
"resource",
"."
] | 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#L2000-L2003 | train | Gets the flow log status of the specified resource group. | [
30522,
13366,
4088,
1035,
2131,
1035,
4834,
1035,
8833,
1035,
3570,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
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... |
samvera/hyrax | app/presenters/hyrax/collection_presenter.rb | Hyrax.CollectionPresenter.managed_access | def managed_access
return I18n.t('hyrax.dashboard.my.collection_list.managed_access.manage') if current_ability.can?(:edit, solr_document)
return I18n.t('hyrax.dashboard.my.collection_list.managed_access.deposit') if current_ability.can?(:deposit, solr_document)
return I18n.t('hyrax.dashboard.my.collection_list.managed_access.view') if current_ability.can?(:read, solr_document)
''
end | ruby | def managed_access
return I18n.t('hyrax.dashboard.my.collection_list.managed_access.manage') if current_ability.can?(:edit, solr_document)
return I18n.t('hyrax.dashboard.my.collection_list.managed_access.deposit') if current_ability.can?(:deposit, solr_document)
return I18n.t('hyrax.dashboard.my.collection_list.managed_access.view') if current_ability.can?(:read, solr_document)
''
end | [
"def",
"managed_access",
"return",
"I18n",
".",
"t",
"(",
"'hyrax.dashboard.my.collection_list.managed_access.manage'",
")",
"if",
"current_ability",
".",
"can?",
"(",
":edit",
",",
"solr_document",
")",
"return",
"I18n",
".",
"t",
"(",
"'hyrax.dashboard.my.collection_l... | For the Managed Collections tab, determine the label to use for the level of access the user has for this admin set.
Checks from most permissive to most restrictive.
@return String the access label (e.g. Manage, Deposit, View) | [
"For",
"the",
"Managed",
"Collections",
"tab",
"determine",
"the",
"label",
"to",
"use",
"for",
"the",
"level",
"of",
"access",
"the",
"user",
"has",
"for",
"this",
"admin",
"set",
".",
"Checks",
"from",
"most",
"permissive",
"to",
"most",
"restrictive",
"... | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/presenters/hyrax/collection_presenter.rb#L166-L171 | train | Returns the index of the managed_access_index that is used to determine the index of the managed_access_index. | [
30522,
13366,
3266,
1035,
3229,
2709,
1045,
15136,
2078,
1012,
1056,
1006,
1005,
1044,
19563,
2595,
1012,
24923,
1012,
2026,
1012,
3074,
1035,
2862,
1012,
3266,
1035,
3229,
1012,
6133,
1005,
1007,
2065,
2783,
1035,
3754,
1012,
2064,
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... |
sunspot/sunspot | sunspot/lib/sunspot/indexer.rb | Sunspot.Indexer.add_atomic_update | def add_atomic_update(clazz, updates={})
documents = updates.map { |id, m| prepare_atomic_update(clazz, id, m) }
add_batch_documents(documents)
end | ruby | def add_atomic_update(clazz, updates={})
documents = updates.map { |id, m| prepare_atomic_update(clazz, id, m) }
add_batch_documents(documents)
end | [
"def",
"add_atomic_update",
"(",
"clazz",
",",
"updates",
"=",
"{",
"}",
")",
"documents",
"=",
"updates",
".",
"map",
"{",
"|",
"id",
",",
"m",
"|",
"prepare_atomic_update",
"(",
"clazz",
",",
"id",
",",
"m",
")",
"}",
"add_batch_documents",
"(",
"doc... | Construct a representation of the given class instances for atomic properties update
and send it to the connection for indexing
==== Parameters
clazz<Class>:: the class of the models to be updated
updates<Hash>:: hash of updates where keys are model ids
and values are hash with property name/values to be updated | [
"Construct",
"a",
"representation",
"of",
"the",
"given",
"class",
"instances",
"for",
"atomic",
"properties",
"update",
"and",
"send",
"it",
"to",
"the",
"connection",
"for",
"indexing"
] | 31dd76cd7a14a4ef7bd541de97483d8cd72ff685 | https://github.com/sunspot/sunspot/blob/31dd76cd7a14a4ef7bd541de97483d8cd72ff685/sunspot/lib/sunspot/indexer.rb#L39-L42 | train | Add an atomic update to the database | [
30522,
13366,
5587,
1035,
9593,
1035,
10651,
1006,
18856,
10936,
2480,
1010,
14409,
1027,
1063,
1065,
1007,
5491,
1027,
14409,
1012,
4949,
1063,
1064,
8909,
1010,
1049,
1064,
7374,
1035,
9593,
1035,
10651,
1006,
18856,
10936,
2480,
1010,
89... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/plugins/plugin_manager.rb | Fastlane.PluginManager.plugin_is_added_as_dependency? | def plugin_is_added_as_dependency?(plugin_name)
UI.user_error!("fastlane plugins must start with '#{self.class.plugin_prefix}' string") unless plugin_name.start_with?(self.class.plugin_prefix)
return available_plugins.include?(plugin_name)
end | ruby | def plugin_is_added_as_dependency?(plugin_name)
UI.user_error!("fastlane plugins must start with '#{self.class.plugin_prefix}' string") unless plugin_name.start_with?(self.class.plugin_prefix)
return available_plugins.include?(plugin_name)
end | [
"def",
"plugin_is_added_as_dependency?",
"(",
"plugin_name",
")",
"UI",
".",
"user_error!",
"(",
"\"fastlane plugins must start with '#{self.class.plugin_prefix}' string\"",
")",
"unless",
"plugin_name",
".",
"start_with?",
"(",
"self",
".",
"class",
".",
"plugin_prefix",
"... | Check if a plugin is added as dependency to either the
Gemfile or the Pluginfile | [
"Check",
"if",
"a",
"plugin",
"is",
"added",
"as",
"dependency",
"to",
"either",
"the",
"Gemfile",
"or",
"the",
"Pluginfile"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/plugins/plugin_manager.rb#L71-L74 | train | Check if a plugin is added as dependency | [
30522,
13366,
13354,
2378,
1035,
2003,
1035,
2794,
1035,
2004,
1035,
24394,
1029,
1006,
13354,
2378,
1035,
2171,
1007,
21318,
1012,
5310,
1035,
7561,
999,
1006,
1000,
3435,
20644,
13354,
7076,
2442,
2707,
2007,
1005,
1001,
1063,
2969,
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... |
samvera/hyrax | app/models/concerns/hyrax/ability.rb | Hyrax.Ability.download_groups | def download_groups(id)
doc = permissions_doc(id)
return [] if doc.nil?
groups = Array(doc[self.class.read_group_field]) + Array(doc[self.class.edit_group_field])
Rails.logger.debug("[CANCAN] download_groups: #{groups.inspect}")
groups
end | ruby | def download_groups(id)
doc = permissions_doc(id)
return [] if doc.nil?
groups = Array(doc[self.class.read_group_field]) + Array(doc[self.class.edit_group_field])
Rails.logger.debug("[CANCAN] download_groups: #{groups.inspect}")
groups
end | [
"def",
"download_groups",
"(",
"id",
")",
"doc",
"=",
"permissions_doc",
"(",
"id",
")",
"return",
"[",
"]",
"if",
"doc",
".",
"nil?",
"groups",
"=",
"Array",
"(",
"doc",
"[",
"self",
".",
"class",
".",
"read_group_field",
"]",
")",
"+",
"Array",
"("... | Samvera doesn't use download user/groups, so make it an alias to read
Grant all groups with read or edit access permission to download | [
"Samvera",
"doesn",
"t",
"use",
"download",
"user",
"/",
"groups",
"so",
"make",
"it",
"an",
"alias",
"to",
"read",
"Grant",
"all",
"groups",
"with",
"read",
"or",
"edit",
"access",
"permission",
"to",
"download"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/models/concerns/hyrax/ability.rb#L38-L44 | train | Returns an array of groups that are available for the user. | [
30522,
13366,
8816,
1035,
2967,
1006,
8909,
1007,
9986,
1027,
6656,
2015,
1035,
9986,
1006,
8909,
1007,
2709,
1031,
1033,
2065,
9986,
1012,
9152,
2140,
1029,
2967,
1027,
9140,
1006,
9986,
1031,
2969,
1012,
2465,
1012,
3191,
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... |
meew0/discordrb | lib/discordrb/data/message.rb | Discordrb.Message.delete_own_reaction | def delete_own_reaction(reaction)
reaction = reaction.to_reaction if reaction.respond_to?(:to_reaction)
API::Channel.delete_own_reaction(@bot.token, @channel.id, @id, reaction)
end | ruby | def delete_own_reaction(reaction)
reaction = reaction.to_reaction if reaction.respond_to?(:to_reaction)
API::Channel.delete_own_reaction(@bot.token, @channel.id, @id, reaction)
end | [
"def",
"delete_own_reaction",
"(",
"reaction",
")",
"reaction",
"=",
"reaction",
".",
"to_reaction",
"if",
"reaction",
".",
"respond_to?",
"(",
":to_reaction",
")",
"API",
"::",
"Channel",
".",
"delete_own_reaction",
"(",
"@bot",
".",
"token",
",",
"@channel",
... | Deletes this client's reaction on this message.
@param reaction [String, #to_reaction] the reaction to remove | [
"Deletes",
"this",
"client",
"s",
"reaction",
"on",
"this",
"message",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/message.rb#L277-L280 | train | Delete the reaction from this channel. | [
30522,
13366,
3972,
12870,
1035,
2219,
1035,
4668,
1006,
4668,
1007,
4668,
1027,
4668,
1012,
2000,
1035,
4668,
2065,
4668,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
2000,
1035,
4668,
1007,
17928,
1024,
1024,
3149,
1012,
3972,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_service_name_info_with_http_info | def get_service_name_info_with_http_info(partition_id, timeout:60, custom_headers:nil)
get_service_name_info_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_service_name_info_with_http_info(partition_id, timeout:60, custom_headers:nil)
get_service_name_info_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_service_name_info_with_http_info",
"(",
"partition_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_service_name_info_async",
"(",
"partition_id",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".... | Gets the name of the Service Fabric service for a partition.
Gets name of the service for the specified partition. A 404 error is returned
if the partition ID does not exist in the cluster.
@param partition_id The identity of the partition.
@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. | [
"Gets",
"the",
"name",
"of",
"the",
"Service",
"Fabric",
"service",
"for",
"a",
"partition",
"."
] | 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#L12113-L12115 | train | Gets the service name info for the specified partition. | [
30522,
13366,
2131,
1035,
2326,
1035,
2171,
1035,
18558,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2326,
1035,
2171,
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... |
decidim/decidim | decidim-core/app/helpers/decidim/meta_tags_helper.rb | Decidim.MetaTagsHelper.add_decidim_meta_tags | def add_decidim_meta_tags(tags)
add_decidim_page_title(tags[:title])
add_decidim_meta_description(tags[:description])
add_decidim_meta_url(tags[:url])
add_decidim_meta_twitter_handler(tags[:twitter_handler])
add_decidim_meta_image_url(tags[:image_url])
end | ruby | def add_decidim_meta_tags(tags)
add_decidim_page_title(tags[:title])
add_decidim_meta_description(tags[:description])
add_decidim_meta_url(tags[:url])
add_decidim_meta_twitter_handler(tags[:twitter_handler])
add_decidim_meta_image_url(tags[:image_url])
end | [
"def",
"add_decidim_meta_tags",
"(",
"tags",
")",
"add_decidim_page_title",
"(",
"tags",
"[",
":title",
"]",
")",
"add_decidim_meta_description",
"(",
"tags",
"[",
":description",
"]",
")",
"add_decidim_meta_url",
"(",
"tags",
"[",
":url",
"]",
")",
"add_decidim_m... | Public: Sets the given metatags for the page. It's a wrapper for the individual
methods, so that you can set multiple values with a single call. See the docs for
the other methods to see how they work.
tags - A Hash containing the meta tag name as keys and its content as values.
Returns nothing. | [
"Public",
":",
"Sets",
"the",
"given",
"metatags",
"for",
"the",
"page",
".",
"It",
"s",
"a",
"wrapper",
"for",
"the",
"individual",
"methods",
"so",
"that",
"you",
"can",
"set",
"multiple",
"values",
"with",
"a",
"single",
"call",
".",
"See",
"the",
"... | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/meta_tags_helper.rb#L14-L20 | train | Adds the decidim meta tags to the document. | [
30522,
13366,
5587,
1035,
11703,
28173,
2213,
1035,
18804,
1035,
22073,
1006,
22073,
1007,
5587,
1035,
11703,
28173,
2213,
1035,
3931,
1035,
2516,
1006,
22073,
1031,
1024,
2516,
1033,
1007,
5587,
1035,
11703,
28173,
2213,
1035,
18804,
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... |
sds/haml-lint | lib/haml_lint/cli.rb | HamlLint.CLI.act_on_options | def act_on_options(options)
configure_logger(options)
if options[:help]
print_help(options)
Sysexits::EX_OK
elsif options[:version] || options[:verbose_version]
print_version(options)
Sysexits::EX_OK
elsif options[:show_linters]
print_available_linters
Sysexits::EX_OK
elsif options[:show_reporters]
print_available_reporters
Sysexits::EX_OK
else
scan_for_lints(options)
end
end | ruby | def act_on_options(options)
configure_logger(options)
if options[:help]
print_help(options)
Sysexits::EX_OK
elsif options[:version] || options[:verbose_version]
print_version(options)
Sysexits::EX_OK
elsif options[:show_linters]
print_available_linters
Sysexits::EX_OK
elsif options[:show_reporters]
print_available_reporters
Sysexits::EX_OK
else
scan_for_lints(options)
end
end | [
"def",
"act_on_options",
"(",
"options",
")",
"configure_logger",
"(",
"options",
")",
"if",
"options",
"[",
":help",
"]",
"print_help",
"(",
"options",
")",
"Sysexits",
"::",
"EX_OK",
"elsif",
"options",
"[",
":version",
"]",
"||",
"options",
"[",
":verbose... | Given the provided options, execute the appropriate command.
@return [Integer] exit status code | [
"Given",
"the",
"provided",
"options",
"execute",
"the",
"appropriate",
"command",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/cli.rb#L37-L55 | train | Acts on the options | [
30522,
13366,
2552,
1035,
2006,
1035,
7047,
1006,
7047,
1007,
9530,
8873,
27390,
2063,
1035,
8833,
4590,
1006,
7047,
1007,
2065,
7047,
1031,
1024,
2393,
1033,
6140,
1035,
2393,
1006,
7047,
1007,
25353,
3366,
9048,
3215,
1024,
1024,
4654,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.store_csrf_tokens | def store_csrf_tokens(response)
if response && response.headers
tokens = response.headers.select { |k, v| %w(csrf csrf_ts).include?(k) }
if tokens && !tokens.empty?
@csrf_tokens = tokens
end
end
end | ruby | def store_csrf_tokens(response)
if response && response.headers
tokens = response.headers.select { |k, v| %w(csrf csrf_ts).include?(k) }
if tokens && !tokens.empty?
@csrf_tokens = tokens
end
end
end | [
"def",
"store_csrf_tokens",
"(",
"response",
")",
"if",
"response",
"&&",
"response",
".",
"headers",
"tokens",
"=",
"response",
".",
"headers",
".",
"select",
"{",
"|",
"k",
",",
"v",
"|",
"%w(",
"csrf",
"csrf_ts",
")",
".",
"include?",
"(",
"k",
")",... | Is called from `parse_response` to store the latest csrf_token (if available) | [
"Is",
"called",
"from",
"parse_response",
"to",
"store",
"the",
"latest",
"csrf_token",
"(",
"if",
"available",
")"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/client.rb#L776-L783 | train | Stores the csrf tokens in the response. | [
30522,
13366,
3573,
1035,
20116,
12881,
1035,
19204,
2015,
1006,
3433,
1007,
2065,
3433,
1004,
1004,
30524,
4064,
1029,
1030,
20116,
12881,
1035,
19204,
2015,
1027,
19204,
2015,
2203,
2203,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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-10-01/generated/azure_mgmt_container_registry/registries.rb | Azure::ContainerRegistry::Mgmt::V2017_10_01.Registries.begin_update_policies_with_http_info | def begin_update_policies_with_http_info(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_policies_with_http_info(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_policies_with_http_info",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_policies_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_policies_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_p... | Updates the policies for the specified container registry.
@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 registry_policies_update_parameters [RegistryPolicies] The parameters
for updating policies of a container registry.
@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",
"the",
"policies",
"for",
"the",
"specified",
"container",
"registry",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb#L1513-L1515 | train | Updates the policies of the specified container registry. | [
30522,
13366,
4088,
1035,
10651,
1035,
6043,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
15584,
1035,
6043,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
214... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_multi_role_pool_instance_metric_definitions_as_lazy | def list_multi_role_pool_instance_metric_definitions_as_lazy(resource_group_name, name, instance, custom_headers:nil)
response = list_multi_role_pool_instance_metric_definitions_async(resource_group_name, name, instance, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_pool_instance_metric_definitions_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_multi_role_pool_instance_metric_definitions_as_lazy(resource_group_name, name, instance, custom_headers:nil)
response = list_multi_role_pool_instance_metric_definitions_async(resource_group_name, name, instance, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_pool_instance_metric_definitions_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_multi_role_pool_instance_metric_definitions_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"instance",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_multi_role_pool_instance_metric_definitions_async",
"(",
"resource_group_name",
",",
"name... | Get metric definitions for a specific instance of a multi-role pool of an App
Service Environment.
Get metric definitions for a specific instance of a multi-role pool of an App
Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param instance [String] Name of the instance in the multi-role pool.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ResourceMetricDefinitionCollection] which provide lazy access to
pages of the response. | [
"Get",
"metric",
"definitions",
"for",
"a",
"specific",
"instance",
"of",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L7582-L7591 | train | Gets all metric definitions for a multi - role pool instance. | [
30522,
13366,
2862,
1035,
4800,
1035,
2535,
1035,
4770,
1035,
6013,
1035,
12046,
1035,
15182,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
6013,
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... |
sds/scss-lint | lib/scss_lint/linter/indentation.rb | SCSSLint.Linter::Indentation.visit_atroot | def visit_atroot(node, &block)
if at_root_contains_inline_selector?(node)
return if check_indentation(node)
yield
else
check_and_visit_children(node, &block)
end
end | ruby | def visit_atroot(node, &block)
if at_root_contains_inline_selector?(node)
return if check_indentation(node)
yield
else
check_and_visit_children(node, &block)
end
end | [
"def",
"visit_atroot",
"(",
"node",
",",
"&",
"block",
")",
"if",
"at_root_contains_inline_selector?",
"(",
"node",
")",
"return",
"if",
"check_indentation",
"(",
"node",
")",
"yield",
"else",
"check_and_visit_children",
"(",
"node",
",",
"block",
")",
"end",
... | Need to define this explicitly since @at-root directives can contain
inline selectors which produces the same parse tree as if the selector was
nested within it. For example:
@at-root {
.something {
...
}
}
...and...
@at-root .something {
...
}
...produce the same parse tree, but result in different indentation
levels. | [
"Need",
"to",
"define",
"this",
"explicitly",
"since",
"@at",
"-",
"root",
"directives",
"can",
"contain",
"inline",
"selectors",
"which",
"produces",
"the",
"same",
"parse",
"tree",
"as",
"if",
"the",
"selector",
"was",
"nested",
"within",
"it",
".",
"For",... | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/linter/indentation.rb#L90-L97 | train | Visit the at - root node | [
30522,
13366,
3942,
1035,
2012,
3217,
4140,
1006,
13045,
1010,
1004,
3796,
1007,
2065,
2012,
1035,
7117,
1035,
3397,
1035,
23881,
1035,
27000,
1029,
1006,
13045,
1007,
2709,
2065,
4638,
1035,
27427,
19304,
1006,
13045,
1007,
10750,
2842,
46... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
david942j/one_gadget | lib/one_gadget/cli.rb | OneGadget.CLI.info_build_id | def info_build_id(id)
result = OneGadget::Gadget.builds_info(id)
return false if result.nil? # invalid form or BuildID not found
OneGadget::Logger.info("Information of #{id}:\n#{result.join("\n")}")
true
end | ruby | def info_build_id(id)
result = OneGadget::Gadget.builds_info(id)
return false if result.nil? # invalid form or BuildID not found
OneGadget::Logger.info("Information of #{id}:\n#{result.join("\n")}")
true
end | [
"def",
"info_build_id",
"(",
"id",
")",
"result",
"=",
"OneGadget",
"::",
"Gadget",
".",
"builds_info",
"(",
"id",
")",
"return",
"false",
"if",
"result",
".",
"nil?",
"# invalid form or BuildID not found",
"OneGadget",
"::",
"Logger",
".",
"info",
"(",
"\"Inf... | Displays libc information given BuildID.
@param [String] id
@return [Boolean]
+false+ is returned if no information found.
@example
CLI.info_build_id('b417c')
# [OneGadget] Information of b417c:
# spec/data/libc-2.27-b417c0ba7cc5cf06d1d1bed6652cedb9253c60d0.so
# Advanced Micro Devices X86-64
# GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1) stable release version 2.27.
# Copyright (C) 2018 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions.
# There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Compiled by GNU CC version 7.3.0.
# libc ABIs: UNIQUE IFUNC
# For bug reporting instructions, please see:
# <https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.
#=> true | [
"Displays",
"libc",
"information",
"given",
"BuildID",
"."
] | ff6ef04541e83441bfe3c2664a6febd1640f4263 | https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/cli.rb#L92-L98 | train | Returns the BuildID information for a given BuildID | [
30522,
13366,
18558,
1035,
3857,
1035,
8909,
1006,
8909,
1007,
2765,
1027,
2028,
3654,
24291,
1024,
1024,
11721,
24291,
1012,
16473,
1035,
18558,
1006,
8909,
1007,
2709,
6270,
2065,
2765,
1012,
9152,
2140,
1029,
1001,
19528,
2433,
2030,
385... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/locations.rb | Azure::Hdinsight::Mgmt::V2015_03_01_preview.Locations.get_capabilities | def get_capabilities(location, custom_headers:nil)
response = get_capabilities_async(location, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_capabilities(location, custom_headers:nil)
response = get_capabilities_async(location, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_capabilities",
"(",
"location",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_capabilities_async",
"(",
"location",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
"nil?"... | Gets the capabilities for the specified location.
@param location [String] The location.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CapabilitiesResult] operation results. | [
"Gets",
"the",
"capabilities",
"for",
"the",
"specified",
"location",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/locations.rb#L33-L36 | train | Gets the capabilities of the specified resource group. | [
30522,
13366,
2131,
1035,
9859,
1006,
3295,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
9859,
1035,
2004,
6038,
2278,
1006,
3295,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
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... |
CocoaPods/Xcodeproj | lib/xcodeproj/project.rb | Xcodeproj.Project.recreate_user_schemes | def recreate_user_schemes(visible = true)
schemes_dir = XCScheme.user_data_dir(path)
FileUtils.rm_rf(schemes_dir)
FileUtils.mkdir_p(schemes_dir)
xcschememanagement = {}
xcschememanagement['SchemeUserState'] = {}
xcschememanagement['SuppressBuildableAutocreation'] = {}
targets.each do |target|
scheme = XCScheme.new
test_target = target if target.respond_to?(:test_target_type?) && target.test_target_type?
launch_target = target.respond_to?(:launchable_target_type?) && target.launchable_target_type?
scheme.configure_with_targets(target, test_target, :launch_target => launch_target)
yield scheme, target if block_given?
scheme.save_as(path, target.name, false)
xcschememanagement['SchemeUserState']["#{target.name}.xcscheme"] = {}
xcschememanagement['SchemeUserState']["#{target.name}.xcscheme"]['isShown'] = visible
end
xcschememanagement_path = schemes_dir + 'xcschememanagement.plist'
Plist.write_to_path(xcschememanagement, xcschememanagement_path)
end | ruby | def recreate_user_schemes(visible = true)
schemes_dir = XCScheme.user_data_dir(path)
FileUtils.rm_rf(schemes_dir)
FileUtils.mkdir_p(schemes_dir)
xcschememanagement = {}
xcschememanagement['SchemeUserState'] = {}
xcschememanagement['SuppressBuildableAutocreation'] = {}
targets.each do |target|
scheme = XCScheme.new
test_target = target if target.respond_to?(:test_target_type?) && target.test_target_type?
launch_target = target.respond_to?(:launchable_target_type?) && target.launchable_target_type?
scheme.configure_with_targets(target, test_target, :launch_target => launch_target)
yield scheme, target if block_given?
scheme.save_as(path, target.name, false)
xcschememanagement['SchemeUserState']["#{target.name}.xcscheme"] = {}
xcschememanagement['SchemeUserState']["#{target.name}.xcscheme"]['isShown'] = visible
end
xcschememanagement_path = schemes_dir + 'xcschememanagement.plist'
Plist.write_to_path(xcschememanagement, xcschememanagement_path)
end | [
"def",
"recreate_user_schemes",
"(",
"visible",
"=",
"true",
")",
"schemes_dir",
"=",
"XCScheme",
".",
"user_data_dir",
"(",
"path",
")",
"FileUtils",
".",
"rm_rf",
"(",
"schemes_dir",
")",
"FileUtils",
".",
"mkdir_p",
"(",
"schemes_dir",
")",
"xcschememanagemen... | Recreates the user schemes of the project from scratch (removes the
folder) and optionally hides them.
@param [Bool] visible
Whether the schemes should be visible or hidden.
@return [void] | [
"Recreates",
"the",
"user",
"schemes",
"of",
"the",
"project",
"from",
"scratch",
"(",
"removes",
"the",
"folder",
")",
"and",
"optionally",
"hides",
"them",
"."
] | 3be1684437a6f8e69c7836ad4c85a2b78663272f | https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/lib/xcodeproj/project.rb#L839-L863 | train | Recreate the user schemes | [
30522,
13366,
28667,
29313,
1035,
5310,
1035,
11683,
1006,
5710,
1027,
2995,
1007,
11683,
1035,
16101,
1027,
1060,
6169,
5403,
4168,
1012,
5310,
1035,
2951,
1035,
16101,
1006,
4130,
1007,
5371,
21823,
4877,
1012,
28549,
1035,
21792,
1006,
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... |
ambethia/recaptcha | lib/recaptcha/verify.rb | Recaptcha.Verify.verify_recaptcha | def verify_recaptcha(options = {})
options = {model: options} unless options.is_a? Hash
return true if Recaptcha::Verify.skip?(options[:env])
model = options[:model]
attribute = options[:attribute] || :base
recaptcha_response = options[:response] || params['g-recaptcha-response'].to_s
begin
verified = if recaptcha_response.empty? || recaptcha_response.length > G_RESPONSE_LIMIT
false
else
recaptcha_verify_via_api_call(request, recaptcha_response, options)
end
if verified
flash.delete(:recaptcha_error) if recaptcha_flash_supported? && !model
true
else
recaptcha_error(
model,
attribute,
options[:message],
"recaptcha.errors.verification_failed",
"reCAPTCHA verification failed, please try again."
)
false
end
rescue Timeout::Error
if Recaptcha.configuration.handle_timeouts_gracefully
recaptcha_error(
model,
attribute,
options[:message],
"recaptcha.errors.recaptcha_unreachable",
"Oops, we failed to validate your reCAPTCHA response. Please try again."
)
false
else
raise RecaptchaError, "Recaptcha unreachable."
end
rescue StandardError => e
raise RecaptchaError, e.message, e.backtrace
end
end | ruby | def verify_recaptcha(options = {})
options = {model: options} unless options.is_a? Hash
return true if Recaptcha::Verify.skip?(options[:env])
model = options[:model]
attribute = options[:attribute] || :base
recaptcha_response = options[:response] || params['g-recaptcha-response'].to_s
begin
verified = if recaptcha_response.empty? || recaptcha_response.length > G_RESPONSE_LIMIT
false
else
recaptcha_verify_via_api_call(request, recaptcha_response, options)
end
if verified
flash.delete(:recaptcha_error) if recaptcha_flash_supported? && !model
true
else
recaptcha_error(
model,
attribute,
options[:message],
"recaptcha.errors.verification_failed",
"reCAPTCHA verification failed, please try again."
)
false
end
rescue Timeout::Error
if Recaptcha.configuration.handle_timeouts_gracefully
recaptcha_error(
model,
attribute,
options[:message],
"recaptcha.errors.recaptcha_unreachable",
"Oops, we failed to validate your reCAPTCHA response. Please try again."
)
false
else
raise RecaptchaError, "Recaptcha unreachable."
end
rescue StandardError => e
raise RecaptchaError, e.message, e.backtrace
end
end | [
"def",
"verify_recaptcha",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"{",
"model",
":",
"options",
"}",
"unless",
"options",
".",
"is_a?",
"Hash",
"return",
"true",
"if",
"Recaptcha",
"::",
"Verify",
".",
"skip?",
"(",
"options",
"[",
":env",
... | Your private API can be specified in the +options+ hash or preferably
using the Configuration. | [
"Your",
"private",
"API",
"can",
"be",
"specified",
"in",
"the",
"+",
"options",
"+",
"hash",
"or",
"preferably",
"using",
"the",
"Configuration",
"."
] | fcac97960ce29ebd7473315d9ffe89dccce6615e | https://github.com/ambethia/recaptcha/blob/fcac97960ce29ebd7473315d9ffe89dccce6615e/lib/recaptcha/verify.rb#L10-L54 | train | Verify recaptcha response | [
30522,
13366,
20410,
1035,
28667,
9331,
10649,
2050,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
1063,
2944,
1024,
7047,
1065,
4983,
7047,
1012,
2003,
1035,
1037,
1029,
23325,
2709,
2995,
2065,
28667,
9331,
10649,
2050,
1024,
1024,
2041... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
AaronLasseigne/active_interaction | lib/active_interaction/filters/object_filter.rb | ActiveInteraction.ObjectFilter.klass | def klass
klass_name = options.fetch(:class, name).to_s.camelize
Object.const_get(klass_name)
rescue NameError
raise InvalidClassError, "class #{klass_name.inspect} does not exist"
end | ruby | def klass
klass_name = options.fetch(:class, name).to_s.camelize
Object.const_get(klass_name)
rescue NameError
raise InvalidClassError, "class #{klass_name.inspect} does not exist"
end | [
"def",
"klass",
"klass_name",
"=",
"options",
".",
"fetch",
"(",
":class",
",",
"name",
")",
".",
"to_s",
".",
"camelize",
"Object",
".",
"const_get",
"(",
"klass_name",
")",
"rescue",
"NameError",
"raise",
"InvalidClassError",
",",
"\"class #{klass_name.inspect... | @return [Class]
@raise [InvalidClassError] | [
"@return",
"[",
"Class",
"]"
] | fdc00a041e939ef48948baa2f7fd1ce2e4d66982 | https://github.com/AaronLasseigne/active_interaction/blob/fdc00a041e939ef48948baa2f7fd1ce2e4d66982/lib/active_interaction/filters/object_filter.rb#L61-L66 | train | Returns the class name of the object. | [
30522,
13366,
1047,
27102,
1047,
27102,
1035,
2171,
1027,
7047,
1012,
18584,
1006,
1024,
2465,
1010,
2171,
1007,
1012,
2000,
1035,
1055,
1012,
19130,
4697,
4874,
1012,
9530,
3367,
1035,
2131,
1006,
1047,
27102,
1035,
2171,
1007,
5343,
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... |
hashicorp/vagrant | lib/vagrant/box_collection.rb | Vagrant.BoxCollection.all | def all
results = []
with_collection_lock do
@logger.debug("Finding all boxes in: #{@directory}")
@directory.children(true).each do |child|
# Ignore non-directories, since files are not interesting to
# us in our folder structure.
next if !child.directory?
box_name = undir_name(child.basename.to_s)
# Otherwise, traverse the subdirectories and see what versions
# we have.
child.children(true).each do |versiondir|
next if !versiondir.directory?
next if versiondir.basename.to_s.start_with?(".")
version = versiondir.basename.to_s
versiondir.children(true).each do |provider|
# Ensure version of box is correct before continuing
if !Gem::Version.correct?(version)
ui = Vagrant::UI::Prefixed.new(Vagrant::UI::Colored.new, "vagrant")
ui.warn(I18n.t("vagrant.box_version_malformed",
version: version, box_name: box_name))
@logger.debug("Invalid version #{version} for box #{box_name}")
next
end
# Verify this is a potentially valid box. If it looks
# correct enough then include it.
if provider.directory? && provider.join("metadata.json").file?
provider_name = provider.basename.to_s.to_sym
@logger.debug("Box: #{box_name} (#{provider_name}, #{version})")
results << [box_name, version, provider_name]
else
@logger.debug("Invalid box #{box_name}, ignoring: #{provider}")
end
end
end
end
end
# Sort the list to group like providers and properly ordered versions
results.sort_by! do |box_result|
[box_result[0], box_result[2], Gem::Version.new(box_result[1])]
end
results
end | ruby | def all
results = []
with_collection_lock do
@logger.debug("Finding all boxes in: #{@directory}")
@directory.children(true).each do |child|
# Ignore non-directories, since files are not interesting to
# us in our folder structure.
next if !child.directory?
box_name = undir_name(child.basename.to_s)
# Otherwise, traverse the subdirectories and see what versions
# we have.
child.children(true).each do |versiondir|
next if !versiondir.directory?
next if versiondir.basename.to_s.start_with?(".")
version = versiondir.basename.to_s
versiondir.children(true).each do |provider|
# Ensure version of box is correct before continuing
if !Gem::Version.correct?(version)
ui = Vagrant::UI::Prefixed.new(Vagrant::UI::Colored.new, "vagrant")
ui.warn(I18n.t("vagrant.box_version_malformed",
version: version, box_name: box_name))
@logger.debug("Invalid version #{version} for box #{box_name}")
next
end
# Verify this is a potentially valid box. If it looks
# correct enough then include it.
if provider.directory? && provider.join("metadata.json").file?
provider_name = provider.basename.to_s.to_sym
@logger.debug("Box: #{box_name} (#{provider_name}, #{version})")
results << [box_name, version, provider_name]
else
@logger.debug("Invalid box #{box_name}, ignoring: #{provider}")
end
end
end
end
end
# Sort the list to group like providers and properly ordered versions
results.sort_by! do |box_result|
[box_result[0], box_result[2], Gem::Version.new(box_result[1])]
end
results
end | [
"def",
"all",
"results",
"=",
"[",
"]",
"with_collection_lock",
"do",
"@logger",
".",
"debug",
"(",
"\"Finding all boxes in: #{@directory}\"",
")",
"@directory",
".",
"children",
"(",
"true",
")",
".",
"each",
"do",
"|",
"child",
"|",
"# Ignore non-directories, si... | This returns an array of all the boxes on the system, given by
their name and their provider.
@return [Array] Array of `[name, version, provider]` of the boxes
installed on this system. | [
"This",
"returns",
"an",
"array",
"of",
"all",
"the",
"boxes",
"on",
"the",
"system",
"given",
"by",
"their",
"name",
"and",
"their",
"provider",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/box_collection.rb#L215-L263 | train | Returns a list of all the boxes in the current directory. | [
30522,
13366,
2035,
3463,
1027,
1031,
1033,
2007,
1035,
3074,
1035,
5843,
2079,
1030,
8833,
4590,
1012,
2139,
8569,
2290,
1006,
1000,
4531,
2035,
8378,
1999,
1024,
1001,
1063,
1030,
14176,
1065,
1000,
1007,
1030,
14176,
1012,
2336,
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... |
decidim/decidim | decidim-core/lib/decidim/form_builder.rb | Decidim.FormBuilder.extract_validations | def extract_validations(attribute, options)
min_length = options.delete(:minlength) || length_for_attribute(attribute, :minimum) || 0
max_length = options.delete(:maxlength) || length_for_attribute(attribute, :maximum)
validation_options = {}
validation_options[:pattern] = "^(.|[\n\r]){#{min_length},#{max_length}}$" if min_length.to_i.positive? || max_length.to_i.positive?
validation_options[:required] = options[:required] || attribute_required?(attribute)
validation_options[:maxlength] ||= max_length if max_length.to_i.positive?
validation_options
end | ruby | def extract_validations(attribute, options)
min_length = options.delete(:minlength) || length_for_attribute(attribute, :minimum) || 0
max_length = options.delete(:maxlength) || length_for_attribute(attribute, :maximum)
validation_options = {}
validation_options[:pattern] = "^(.|[\n\r]){#{min_length},#{max_length}}$" if min_length.to_i.positive? || max_length.to_i.positive?
validation_options[:required] = options[:required] || attribute_required?(attribute)
validation_options[:maxlength] ||= max_length if max_length.to_i.positive?
validation_options
end | [
"def",
"extract_validations",
"(",
"attribute",
",",
"options",
")",
"min_length",
"=",
"options",
".",
"delete",
"(",
":minlength",
")",
"||",
"length_for_attribute",
"(",
"attribute",
",",
":minimum",
")",
"||",
"0",
"max_length",
"=",
"options",
".",
"delet... | Private: Builds a Hash of options to be injected at the HTML output as
HTML5 validations.
attribute - The String name of the attribute to extract the validations.
options - A Hash of options to extract validations.
Returns a Hash. | [
"Private",
":",
"Builds",
"a",
"Hash",
"of",
"options",
"to",
"be",
"injected",
"at",
"the",
"HTML",
"output",
"as",
"HTML5",
"validations",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/form_builder.rb#L469-L478 | train | Extract validation options for a given attribute | [
30522,
13366,
14817,
1035,
27354,
2015,
1006,
17961,
1010,
7047,
1007,
8117,
1035,
3091,
1027,
7047,
1012,
3972,
12870,
1006,
1024,
8117,
7770,
13512,
2232,
1007,
1064,
1064,
3091,
1035,
2005,
1035,
17961,
1006,
17961,
1010,
1024,
6263,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-lex/lib/aws-sdk-lex/client.rb | Aws::Lex.Client.post_content | def post_content(params = {}, options = {}, &block)
req = build_request(:post_content, params)
req.send_request(options, &block)
end | ruby | def post_content(params = {}, options = {}, &block)
req = build_request(:post_content, params)
req.send_request(options, &block)
end | [
"def",
"post_content",
"(",
"params",
"=",
"{",
"}",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"req",
"=",
"build_request",
"(",
":post_content",
",",
"params",
")",
"req",
".",
"send_request",
"(",
"options",
",",
"block",
")",
"end"
] | @overload initialize(options)
@param [Hash] options
@option options [required, Aws::CredentialProvider] :credentials
Your AWS credentials. This can be an instance of any one of the
following classes:
* `Aws::Credentials` - Used for configuring static, non-refreshing
credentials.
* `Aws::InstanceProfileCredentials` - Used for loading credentials
from an EC2 IMDS on an EC2 instance.
* `Aws::SharedCredentials` - Used for loading credentials from a
shared file, such as `~/.aws/config`.
* `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
When `:credentials` are not configured directly, the following
locations will be searched for credentials:
* `Aws.config[:credentials]`
* The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
* ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
* `~/.aws/credentials`
* `~/.aws/config`
* EC2 IMDS instance profile - When used by default, the timeouts are
very aggressive. Construct and pass an instance of
`Aws::InstanceProfileCredentails` to enable retries and extended
timeouts.
@option options [required, String] :region
The AWS region to connect to. The configured `:region` is
used to determine the service `:endpoint`. When not passed,
a default `:region` is search for in the following locations:
* `Aws.config[:region]`
* `ENV['AWS_REGION']`
* `ENV['AMAZON_REGION']`
* `ENV['AWS_DEFAULT_REGION']`
* `~/.aws/credentials`
* `~/.aws/config`
@option options [String] :access_key_id
@option options [Boolean] :active_endpoint_cache (false)
When set to `true`, a thread polling for endpoints will be running in
the background every 60 secs (default). Defaults to `false`.
@option options [Boolean] :client_side_monitoring (false)
When `true`, client-side metrics will be collected for all API requests from
this client.
@option options [String] :client_side_monitoring_client_id ("")
Allows you to provide an identifier for this client which will be attached to
all generated client side metrics. Defaults to an empty string.
@option options [Integer] :client_side_monitoring_port (31000)
Required for publishing client metrics. The port that the client side monitoring
agent is running on, where client metrics will be published via UDP.
@option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
Allows you to provide a custom client-side monitoring publisher class. By default,
will use the Client Side Monitoring Agent Publisher.
@option options [Boolean] :convert_params (true)
When `true`, an attempt is made to coerce request parameters into
the required types.
@option options [Boolean] :disable_host_prefix_injection (false)
Set to true to disable SDK automatically adding host prefix
to default service endpoint when available.
@option options [String] :endpoint
The client endpoint is normally constructed from the `:region`
option. You should only configure an `:endpoint` when connecting
to test endpoints. This should be avalid HTTP(S) URI.
@option options [Integer] :endpoint_cache_max_entries (1000)
Used for the maximum size limit of the LRU cache storing endpoints data
for endpoint discovery enabled operations. Defaults to 1000.
@option options [Integer] :endpoint_cache_max_threads (10)
Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
@option options [Integer] :endpoint_cache_poll_interval (60)
When :endpoint_discovery and :active_endpoint_cache is enabled,
Use this option to config the time interval in seconds for making
requests fetching endpoints information. Defaults to 60 sec.
@option options [Boolean] :endpoint_discovery (false)
When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
@option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
The log formatter.
@option options [Symbol] :log_level (:info)
The log level to send messages to the `:logger` at.
@option options [Logger] :logger
The Logger instance to send log messages to. If this option
is not set, logging will be disabled.
@option options [String] :profile ("default")
Used when loading credentials from the shared credentials file
at HOME/.aws/credentials. When not specified, 'default' is used.
@option options [Float] :retry_base_delay (0.3)
The base delay in seconds used by the default backoff function.
@option options [Symbol] :retry_jitter (:none)
A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
@see https://www.awsarchitectureblog.com/2015/03/backoff.html
@option options [Integer] :retry_limit (3)
The maximum number of times to retry failed requests. Only
~ 500 level server errors and certain ~ 400 level client errors
are retried. Generally, these are throttling errors, data
checksum errors, networking errors, timeout errors and auth
errors from expired credentials.
@option options [Integer] :retry_max_delay (0)
The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
@option options [String] :secret_access_key
@option options [String] :session_token
@option options [Boolean] :stub_responses (false)
Causes the client to return stubbed responses. By default
fake responses are generated and returned. You can specify
the response data to return or errors to raise by calling
{ClientStubs#stub_responses}. See {ClientStubs} for more information.
** Please note ** When response stubbing is enabled, no HTTP
requests are made, and retries are disabled.
@option options [Boolean] :validate_params (true)
When `true`, request parameters are validated before
sending the request.
@option options [URI::HTTP,String] :http_proxy A proxy to send
requests through. Formatted like 'http://proxy.com:123'.
@option options [Float] :http_open_timeout (15) The number of
seconds to wait when opening a HTTP session before rasing a
`Timeout::Error`.
@option options [Integer] :http_read_timeout (60) The default
number of seconds to wait for response data. This value can
safely be set
per-request on the session yeidled by {#session_for}.
@option options [Float] :http_idle_timeout (5) The number of
seconds a connection is allowed to sit idble before it is
considered stale. Stale connections are closed and removed
from the pool before making a request.
@option options [Float] :http_continue_timeout (1) The number of
seconds to wait for a 100-continue response before sending the
request body. This option has no effect unless the request has
"Expect" header set to "100-continue". Defaults to `nil` which
disables this behaviour. This value can safely be set per
request on the session yeidled by {#session_for}.
@option options [Boolean] :http_wire_trace (false) When `true`,
HTTP debug output will be sent to the `:logger`.
@option options [Boolean] :ssl_verify_peer (true) When `true`,
SSL peer certificates are verified when establishing a
connection.
@option options [String] :ssl_ca_bundle Full path to the SSL
certificate authority bundle file that should be used when
verifying peer certificates. If you do not pass
`:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
will be used if available.
@option options [String] :ssl_ca_directory Full path of the
directory that contains the unbundled SSL certificate
authority files for verifying peer certificates. If you do
not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
system default will be used if available.
@!group API Operations
Sends user input (text or speech) to Amazon Lex. Clients use this API
to send text and audio requests to Amazon Lex at runtime. Amazon Lex
interprets the user input using the machine learning model that it
built for the bot.
The `PostContent` operation supports audio input at 8kHz and 16kHz.
You can use 8kHz audio to achieve higher speech recognition accuracy
in telephone audio applications.
In response, Amazon Lex returns the next message to convey to the
user. Consider the following example messages:
* For a user input "I would like a pizza," Amazon Lex might return a
response with a message eliciting slot data (for example,
`PizzaSize`): "What size pizza would you like?".
* After the user provides all of the pizza order information, Amazon
Lex might return a response with a message to get user confirmation:
"Order the pizza?".
* After the user replies "Yes" to the confirmation prompt, Amazon
Lex might return a conclusion statement: "Thank you, your cheese
pizza has been ordered.".
Not all Amazon Lex messages require a response from the user. For
example, conclusion statements do not require a response. Some
messages require only a yes or no response. In addition to the
`message`, Amazon Lex provides additional context about the message in
the response that you can use to enhance client behavior, such as
displaying the appropriate client user interface. Consider the
following examples:
* If the message is to elicit slot data, Amazon Lex returns the
following context information:
* `x-amz-lex-dialog-state` header set to `ElicitSlot`
* `x-amz-lex-intent-name` header set to the intent name in the
current context
* `x-amz-lex-slot-to-elicit` header set to the slot name for which
the `message` is eliciting information
* `x-amz-lex-slots` header set to a map of slots configured for the
intent with their current values
* If the message is a confirmation prompt, the
`x-amz-lex-dialog-state` header is set to `Confirmation` and the
`x-amz-lex-slot-to-elicit` header is omitted.
* If the message is a clarification prompt configured for the intent,
indicating that the user intent is not understood, the
`x-amz-dialog-state` header is set to `ElicitIntent` and the
`x-amz-slot-to-elicit` header is omitted.
In addition, Amazon Lex also returns your application-specific
`sessionAttributes`. For more information, see [Managing Conversation
Context][1].
[1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html
@option params [required, String] :bot_name
Name of the Amazon Lex bot.
@option params [required, String] :bot_alias
Alias of the Amazon Lex bot.
@option params [required, String] :user_id
The ID of the client application user. Amazon Lex uses this to
identify a user's conversation with your bot. At runtime, each
request must contain the `userID` field.
To decide the user ID to use for your application, consider the
following factors.
* The `userID` field must not contain any personally identifiable
information of the user, for example, name, personal identification
numbers, or other end user personal information.
* If you want a user to start a conversation on one device and
continue on another device, use a user-specific identifier.
* If you want the same user to be able to have two independent
conversations on two different devices, choose a device-specific
identifier.
* A user can't have two independent conversations with two different
versions of the same bot. For example, a user can't have a
conversation with the PROD and BETA versions of the same bot. If you
anticipate that a user will need to have conversation with two
different versions, for example, while testing, include the bot
alias in the user ID to separate the two conversations.
@option params [String] :session_attributes
You pass this value as the `x-amz-lex-session-attributes` HTTP header.
Application-specific information passed between Amazon Lex and a
client application. The value must be a JSON serialized and base64
encoded map with string keys and values. The total size of the
`sessionAttributes` and `requestAttributes` headers is limited to 12
KB.
For more information, see [Setting Session Attributes][1].
**SDK automatically handles json encoding and base64 encoding for you
when the required value (Hash, Array, etc.) is provided according to
the description.**
[1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-session-attribs
@option params [String] :request_attributes
You pass this value as the `x-amz-lex-request-attributes` HTTP header.
Request-specific information passed between Amazon Lex and a client
application. The value must be a JSON serialized and base64 encoded
map with string keys and values. The total size of the
`requestAttributes` and `sessionAttributes` headers is limited to 12
KB.
The namespace `x-amz-lex:` is reserved for special attributes. Don't
create any request attributes with the prefix `x-amz-lex:`.
For more information, see [Setting Request Attributes][1].
**SDK automatically handles json encoding and base64 encoding for you
when the required value (Hash, Array, etc.) is provided according to
the description.**
[1]: http://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html#context-mgmt-request-attribs
@option params [required, String] :content_type
You pass this value as the `Content-Type` HTTP header.
Indicates the audio format or text. The header value must start with
one of the following prefixes:
* PCM format, audio data must be in little-endian byte order.
* audio/l16; rate=16000; channels=1
* audio/x-l16; sample-rate=16000; channel-count=1
* audio/lpcm; sample-rate=8000; sample-size-bits=16;
channel-count=1; is-big-endian=false
* Opus format
* audio/x-cbr-opus-with-preamble; preamble-size=0; bit-rate=256000;
frame-size-milliseconds=4
^
* Text format
* text/plain; charset=utf-8
^
@option params [String] :accept
You pass this value as the `Accept` HTTP header.
The message Amazon Lex returns in the response can be either text or
speech based on the `Accept` HTTP header value in the request.
* If the value is `text/plain; charset=utf-8`, Amazon Lex returns text
in the response.
* If the value begins with `audio/`, Amazon Lex returns speech in the
response. Amazon Lex uses Amazon Polly to generate the speech (using
the configuration you specified in the `Accept` header). For
example, if you specify `audio/mpeg` as the value, Amazon Lex
returns speech in the MPEG format.
The following are the accepted values:
* audio/mpeg
* audio/ogg
* audio/pcm
* text/plain; charset=utf-8
* audio/* (defaults to mpeg)
@option params [required, String, IO] :input_stream
User input in PCM or Opus audio format or text format as described in
the `Content-Type` HTTP header.
You can stream audio data to Amazon Lex or you can create a local
buffer that captures all of the audio data before sending. In general,
you get better performance if you stream audio data rather than
buffering the data locally.
@return [Types::PostContentResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
* {Types::PostContentResponse#content_type #content_type} => String
* {Types::PostContentResponse#intent_name #intent_name} => String
* {Types::PostContentResponse#slots #slots} => String
* {Types::PostContentResponse#session_attributes #session_attributes} => String
* {Types::PostContentResponse#message #message} => String
* {Types::PostContentResponse#message_format #message_format} => String
* {Types::PostContentResponse#dialog_state #dialog_state} => String
* {Types::PostContentResponse#slot_to_elicit #slot_to_elicit} => String
* {Types::PostContentResponse#input_transcript #input_transcript} => String
* {Types::PostContentResponse#audio_stream #audio_stream} => IO
@example Request syntax with placeholder values
resp = client.post_content({
bot_name: "BotName", # required
bot_alias: "BotAlias", # required
user_id: "UserId", # required
session_attributes: "AttributesString",
request_attributes: "AttributesString",
content_type: "HttpContentType", # required
accept: "Accept",
input_stream: "data", # required
})
@example Response structure
resp.content_type #=> String
resp.intent_name #=> String
resp.slots #=> String
resp.session_attributes #=> String
resp.message #=> String
resp.message_format #=> String, one of "PlainText", "CustomPayload", "SSML", "Composite"
resp.dialog_state #=> String, one of "ElicitIntent", "ConfirmIntent", "ElicitSlot", "Fulfilled", "ReadyForFulfillment", "Failed"
resp.slot_to_elicit #=> String
resp.input_transcript #=> String
resp.audio_stream #=> IO
@see http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostContent AWS API Documentation
@overload post_content(params = {})
@param [Hash] params ({}) | [
"@overload",
"initialize",
"(",
"options",
")",
"@param",
"[",
"Hash",
"]",
"options",
"@option",
"options",
"[",
"required",
"Aws",
"::",
"CredentialProvider",
"]",
":",
"credentials",
"Your",
"AWS",
"credentials",
".",
"This",
"can",
"be",
"an",
"instance",
... | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-lex/lib/aws-sdk-lex/client.rb#L494-L497 | train | Post content to the server | [
30522,
13366,
2695,
1035,
4180,
1006,
11498,
5244,
1027,
1063,
1065,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
2128,
4160,
1027,
3857,
1035,
5227,
1006,
1024,
2695,
1035,
4180,
1010,
11498,
5244,
1007,
2128,
4160,
1012,
4604,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heroku/legacy-cli | lib/heroku/command/keys.rb | Heroku::Command.Keys.remove | def remove
key = shift_argument
if key.nil? || key.empty?
error("Usage: heroku keys:remove KEY\nMust specify KEY to remove.")
end
validate_arguments!
action("Removing #{key} SSH key") do
api.delete_key(key)
end
end | ruby | def remove
key = shift_argument
if key.nil? || key.empty?
error("Usage: heroku keys:remove KEY\nMust specify KEY to remove.")
end
validate_arguments!
action("Removing #{key} SSH key") do
api.delete_key(key)
end
end | [
"def",
"remove",
"key",
"=",
"shift_argument",
"if",
"key",
".",
"nil?",
"||",
"key",
".",
"empty?",
"error",
"(",
"\"Usage: heroku keys:remove KEY\\nMust specify KEY to remove.\"",
")",
"end",
"validate_arguments!",
"action",
"(",
"\"Removing #{key} SSH key\"",
")",
"d... | keys:remove [KEY]
remove a key from the current user
Examples:
$ heroku keys:remove email@example.com
Removing email@example.com SSH key... done | [
"keys",
":",
"remove",
"[",
"KEY",
"]"
] | 6f18521a258394bfb79e6b36f7160ad8559a8e16 | https://github.com/heroku/legacy-cli/blob/6f18521a258394bfb79e6b36f7160ad8559a8e16/lib/heroku/command/keys.rb#L80-L90 | train | Remove a key from the current server | [
30522,
13366,
6366,
3145,
1027,
5670,
1035,
6685,
2065,
3145,
1012,
9152,
2140,
1029,
1064,
1064,
3145,
1012,
4064,
1029,
7561,
1006,
1000,
8192,
1024,
5394,
5283,
6309,
1024,
6366,
3145,
1032,
13221,
19966,
20648,
3145,
2000,
6366,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/auto_scaling_group.rb | Aws::AutoScaling.AutoScalingGroup.resume_processes | def resume_processes(options = {})
options = options.merge(auto_scaling_group_name: @name)
resp = @client.resume_processes(options)
resp.data
end | ruby | def resume_processes(options = {})
options = options.merge(auto_scaling_group_name: @name)
resp = @client.resume_processes(options)
resp.data
end | [
"def",
"resume_processes",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"auto_scaling_group_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"resume_processes",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
auto_scaling_group.resume_processes({
scaling_processes: ["XmlStringMaxLen255"],
})
@param [Hash] options ({})
@option options [Array<String>] :scaling_processes
One or more of the following processes. If you omit this parameter,
all processes are specified.
* `Launch`
* `Terminate`
* `HealthCheck`
* `ReplaceUnhealthy`
* `AZRebalance`
* `AlarmNotification`
* `ScheduledActions`
* `AddToLoadBalancer`
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/auto_scaling_group.rb#L710-L714 | train | Resume processes in the auto scaling group | [
30522,
13366,
13746,
1035,
6194,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
8285,
1035,
25169,
1035,
2177,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
13746,
1035,
6194,
1006,
7047,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_container_mappings.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationProtectionContainerMappings.get_with_http_info | def get_with_http_info(fabric_name, protection_container_name, mapping_name, custom_headers:nil)
get_async(fabric_name, protection_container_name, mapping_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(fabric_name, protection_container_name, mapping_name, custom_headers:nil)
get_async(fabric_name, protection_container_name, mapping_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"mapping_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"mapping_name",
",",
"custom_headers",
":custom_headers"... | Gets a protection container mapping/
Gets the details of a protection container mapping.
@param fabric_name [String] Fabric name.
@param protection_container_name [String] Protection container name.
@param mapping_name [String] Protection Container mapping 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. | [
"Gets",
"a",
"protection",
"container",
"mapping",
"/"
] | 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_container_mappings.rb#L155-L157 | train | Gets the protection container mapping. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
8313,
1035,
2171,
1010,
3860,
1035,
11661,
1035,
2171,
1010,
12375,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
6038,
2278,
1006,
8313,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
mhenrixon/sidekiq-unique-jobs | lib/sidekiq_unique_jobs/scripts.rb | SidekiqUniqueJobs.Scripts.execute_script | def execute_script(file_name, redis_pool, options = {})
redis(redis_pool) do |conn|
sha = script_sha(conn, file_name)
conn.evalsha(sha, options)
end
end | ruby | def execute_script(file_name, redis_pool, options = {})
redis(redis_pool) do |conn|
sha = script_sha(conn, file_name)
conn.evalsha(sha, options)
end
end | [
"def",
"execute_script",
"(",
"file_name",
",",
"redis_pool",
",",
"options",
"=",
"{",
"}",
")",
"redis",
"(",
"redis_pool",
")",
"do",
"|",
"conn",
"|",
"sha",
"=",
"script_sha",
"(",
"conn",
",",
"file_name",
")",
"conn",
".",
"evalsha",
"(",
"sha",... | Execute the script file
@param [Symbol] file_name the name of the lua script
@param [Sidekiq::RedisConnection, ConnectionPool] redis_pool the redis connection
@param [Hash] options arguments to pass to the script file
@option options [Array] :keys the array of keys to pass to the script
@option options [Array] :argv the array of arguments to pass to the script
@return value from script (evalsha) | [
"Execute",
"the",
"script",
"file"
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/scripts.rb#L52-L57 | train | Execute a script | [
30522,
13366,
15389,
1035,
5896,
1006,
5371,
1035,
2171,
1010,
2417,
2483,
1035,
4770,
1010,
7047,
1027,
1063,
1065,
1007,
2417,
2483,
1006,
2417,
2483,
1035,
4770,
1007,
2079,
1064,
9530,
2078,
1064,
21146,
1027,
5896,
1035,
21146,
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... |
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_container_mappings.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationProtectionContainerMappings.begin_purge_with_http_info | def begin_purge_with_http_info(fabric_name, protection_container_name, mapping_name, custom_headers:nil)
begin_purge_async(fabric_name, protection_container_name, mapping_name, custom_headers:custom_headers).value!
end | ruby | def begin_purge_with_http_info(fabric_name, protection_container_name, mapping_name, custom_headers:nil)
begin_purge_async(fabric_name, protection_container_name, mapping_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_purge_with_http_info",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"mapping_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_purge_async",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"mapping_name",
",",
"custom_headers",
"... | Purge protection container mapping.
The operation to purge(force delete) a protection container mapping
@param fabric_name [String] Fabric name.
@param protection_container_name [String] Protection container name.
@param mapping_name [String] Protection container mapping 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. | [
"Purge",
"protection",
"container",
"mapping",
"."
] | 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_container_mappings.rb#L654-L656 | train | Purges the protection container mapping. | [
30522,
13366,
4088,
1035,
24694,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
8313,
1035,
2171,
1010,
3860,
1035,
11661,
1035,
2171,
1010,
12375,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
24694,
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... |
lostisland/faraday | lib/faraday/dependency_loader.rb | Faraday.DependencyLoader.dependency | def dependency(lib = nil)
lib ? require(lib) : yield
rescue LoadError, NameError => e
self.load_error = e
end | ruby | def dependency(lib = nil)
lib ? require(lib) : yield
rescue LoadError, NameError => e
self.load_error = e
end | [
"def",
"dependency",
"(",
"lib",
"=",
"nil",
")",
"lib",
"?",
"require",
"(",
"lib",
")",
":",
"yield",
"rescue",
"LoadError",
",",
"NameError",
"=>",
"e",
"self",
".",
"load_error",
"=",
"e",
"end"
] | Executes a block which should try to require and reference dependent
libraries | [
"Executes",
"a",
"block",
"which",
"should",
"try",
"to",
"require",
"and",
"reference",
"dependent",
"libraries"
] | 3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70 | https://github.com/lostisland/faraday/blob/3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70/lib/faraday/dependency_loader.rb#L10-L14 | train | Require the given library. | [
30522,
13366,
24394,
1006,
5622,
2497,
1027,
9152,
2140,
1007,
5622,
2497,
1029,
5478,
1006,
5622,
2497,
1007,
1024,
10750,
5343,
7170,
2121,
29165,
1010,
2171,
2121,
29165,
1027,
1028,
1041,
2969,
1012,
7170,
1035,
7561,
1027,
1041,
2203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/models/v1_discount.rb | SquareConnect.V1Discount.valid? | def valid?
discount_type_validator = EnumAttributeValidator.new('String', ["FIXED", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
return false unless discount_type_validator.valid?(@discount_type)
color_validator = EnumAttributeValidator.new('String', ["9da2a6", "4ab200", "0b8000", "2952cc", "a82ee5", "e5457a", "b21212", "593c00", "e5BF00"])
return false unless color_validator.valid?(@color)
return true
end | ruby | def valid?
discount_type_validator = EnumAttributeValidator.new('String', ["FIXED", "VARIABLE_PERCENTAGE", "VARIABLE_AMOUNT"])
return false unless discount_type_validator.valid?(@discount_type)
color_validator = EnumAttributeValidator.new('String', ["9da2a6", "4ab200", "0b8000", "2952cc", "a82ee5", "e5457a", "b21212", "593c00", "e5BF00"])
return false unless color_validator.valid?(@color)
return true
end | [
"def",
"valid?",
"discount_type_validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"FIXED\"",
",",
"\"VARIABLE_PERCENTAGE\"",
",",
"\"VARIABLE_AMOUNT\"",
"]",
")",
"return",
"false",
"unless",
"discount_type_validator",
".",
"valid?",
... | Check to see if the all the properties in the model are valid
@return true if the model is valid | [
"Check",
"to",
"see",
"if",
"the",
"all",
"the",
"properties",
"in",
"the",
"model",
"are",
"valid"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/v1_discount.rb#L140-L146 | train | Returns true if the object is valid for this object. | [
30522,
13366,
9398,
1029,
19575,
1035,
2828,
1035,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
4964,
1000,
1010,
1000,
8023,
1035,
7017,
1000,
1010,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
watir/watir | lib/watir/window.rb | Watir.Window.move_to | def move_to(x_coord, y_coord)
Selenium::WebDriver::Point.new(Integer(x_coord), Integer(y_coord)).tap do |point|
use { @driver.manage.window.position = point }
end
end | ruby | def move_to(x_coord, y_coord)
Selenium::WebDriver::Point.new(Integer(x_coord), Integer(y_coord)).tap do |point|
use { @driver.manage.window.position = point }
end
end | [
"def",
"move_to",
"(",
"x_coord",
",",
"y_coord",
")",
"Selenium",
"::",
"WebDriver",
"::",
"Point",
".",
"new",
"(",
"Integer",
"(",
"x_coord",
")",
",",
"Integer",
"(",
"y_coord",
")",
")",
".",
"tap",
"do",
"|",
"point",
"|",
"use",
"{",
"@driver"... | Moves window to given x and y coordinates.
@example
browser.window.move_to 300, 200
@param [Integer] x_coord
@param [Integer] y_coord | [
"Moves",
"window",
"to",
"given",
"x",
"and",
"y",
"coordinates",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/window.rb#L79-L83 | train | Move the window to the specified coordinates. | [
30522,
13366,
2693,
1035,
2000,
1006,
1060,
1035,
2522,
8551,
1010,
1061,
1035,
2522,
8551,
1007,
7367,
7770,
5007,
1024,
1024,
4773,
23663,
2099,
1024,
1024,
2391,
1012,
2047,
1006,
16109,
1006,
1060,
1035,
2522,
8551,
1007,
1010,
16109,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/relation/finder_methods.rb | ActiveRecord.FinderMethods.exists? | def exists?(conditions = :none)
if Base === conditions
raise ArgumentError, <<-MSG.squish
You are passing an instance of ActiveRecord::Base to `exists?`.
Please pass the id of the object by calling `.id`.
MSG
end
return false if !conditions || limit_value == 0
if eager_loading?
relation = apply_join_dependency(eager_loading: false)
return relation.exists?(conditions)
end
relation = construct_relation_for_exists(conditions)
skip_query_cache_if_necessary { connection.select_one(relation.arel, "#{name} Exists?") } ? true : false
end | ruby | def exists?(conditions = :none)
if Base === conditions
raise ArgumentError, <<-MSG.squish
You are passing an instance of ActiveRecord::Base to `exists?`.
Please pass the id of the object by calling `.id`.
MSG
end
return false if !conditions || limit_value == 0
if eager_loading?
relation = apply_join_dependency(eager_loading: false)
return relation.exists?(conditions)
end
relation = construct_relation_for_exists(conditions)
skip_query_cache_if_necessary { connection.select_one(relation.arel, "#{name} Exists?") } ? true : false
end | [
"def",
"exists?",
"(",
"conditions",
"=",
":none",
")",
"if",
"Base",
"===",
"conditions",
"raise",
"ArgumentError",
",",
"<<-MSG",
".",
"squish",
"MSG",
"end",
"return",
"false",
"if",
"!",
"conditions",
"||",
"limit_value",
"==",
"0",
"if",
"eager_loading?... | Returns true if a record exists in the table that matches the +id+ or
conditions given, or false otherwise. The argument can take six forms:
* Integer - Finds the record with this primary key.
* String - Finds the record with a primary key corresponding to this
string (such as <tt>'5'</tt>).
* Array - Finds the record that matches these +find+-style conditions
(such as <tt>['name LIKE ?', "%#{query}%"]</tt>).
* Hash - Finds the record that matches these +find+-style conditions
(such as <tt>{name: 'David'}</tt>).
* +false+ - Returns always +false+.
* No args - Returns +false+ if the relation is empty, +true+ otherwise.
For more information about specifying conditions as a hash or array,
see the Conditions section in the introduction to ActiveRecord::Base.
Note: You can't pass in a condition as a string (like <tt>name =
'Jamie'</tt>), since it would be sanitized and then queried against
the primary key column, like <tt>id = 'name = \'Jamie\''</tt>.
Person.exists?(5)
Person.exists?('5')
Person.exists?(['name LIKE ?', "%#{query}%"])
Person.exists?(id: [1, 4, 8])
Person.exists?(name: 'David')
Person.exists?(false)
Person.exists?
Person.where(name: 'Spartacus', rating: 4).exists? | [
"Returns",
"true",
"if",
"a",
"record",
"exists",
"in",
"the",
"table",
"that",
"matches",
"the",
"+",
"id",
"+",
"or",
"conditions",
"given",
"or",
"false",
"otherwise",
".",
"The",
"argument",
"can",
"take",
"six",
"forms",
":"
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/relation/finder_methods.rb#L300-L318 | train | Returns true if the object exists in the database. | [
30522,
13366,
6526,
1029,
1006,
3785,
1027,
1024,
3904,
1007,
2065,
2918,
1027,
1027,
1027,
3785,
5333,
6685,
2121,
29165,
1010,
1026,
1026,
1011,
5796,
2290,
1012,
5490,
27020,
2232,
2017,
2024,
4458,
2019,
6013,
1997,
3161,
2890,
27108,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 | sigh/lib/sigh/resign.rb | Sigh.Resign.installed_identities | def installed_identities
available = request_valid_identities
ids = {}
available.split("\n").each do |current|
begin
sha1 = current.match(/[a-zA-Z0-9]{40}/).to_s
name = current.match(/.*\"(.*)\"/)[1]
ids[sha1] = name
rescue
nil
end # the last line does not match
end
ids
end | ruby | def installed_identities
available = request_valid_identities
ids = {}
available.split("\n").each do |current|
begin
sha1 = current.match(/[a-zA-Z0-9]{40}/).to_s
name = current.match(/.*\"(.*)\"/)[1]
ids[sha1] = name
rescue
nil
end # the last line does not match
end
ids
end | [
"def",
"installed_identities",
"available",
"=",
"request_valid_identities",
"ids",
"=",
"{",
"}",
"available",
".",
"split",
"(",
"\"\\n\"",
")",
".",
"each",
"do",
"|",
"current",
"|",
"begin",
"sha1",
"=",
"current",
".",
"match",
"(",
"/",
"/",
")",
... | Hash of available signing identities | [
"Hash",
"of",
"available",
"signing",
"identities"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/sigh/lib/sigh/resign.rb#L188-L202 | train | Returns the list of available identities | [
30522,
13366,
5361,
1035,
15702,
2800,
1027,
5227,
1035,
9398,
1035,
15702,
8909,
2015,
1027,
1063,
1065,
2800,
1012,
3975,
1006,
1000,
1032,
1050,
1000,
1007,
1012,
2169,
2079,
1064,
2783,
1064,
4088,
21146,
2487,
1027,
2783,
1012,
2674,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
middleman/middleman | middleman-core/lib/middleman-core/sources/source_watcher.rb | Listen.Silencer.silenced? | def silenced?(relative_path, _type)
path = relative_path.to_s
# if only_patterns && type == :file
# return true unless only_patterns.any? { |pattern| path =~ pattern }
# end
return only_patterns.none? { |pattern| path =~ pattern } if only_patterns
ignore_patterns.any? { |pattern| path =~ pattern }
end | ruby | def silenced?(relative_path, _type)
path = relative_path.to_s
# if only_patterns && type == :file
# return true unless only_patterns.any? { |pattern| path =~ pattern }
# end
return only_patterns.none? { |pattern| path =~ pattern } if only_patterns
ignore_patterns.any? { |pattern| path =~ pattern }
end | [
"def",
"silenced?",
"(",
"relative_path",
",",
"_type",
")",
"path",
"=",
"relative_path",
".",
"to_s",
"# if only_patterns && type == :file",
"# return true unless only_patterns.any? { |pattern| path =~ pattern }",
"# end",
"return",
"only_patterns",
".",
"none?",
"{",
"|"... | TODO: switch type and path places - and verify | [
"TODO",
":",
"switch",
"type",
"and",
"path",
"places",
"-",
"and",
"verify"
] | a0dd9f78094813162895511e8516e0c5507cee50 | https://github.com/middleman/middleman/blob/a0dd9f78094813162895511e8516e0c5507cee50/middleman-core/lib/middleman-core/sources/source_watcher.rb#L11-L21 | train | Returns true if the given path should be silenced. | [
30522,
13366,
25030,
1029,
1006,
5816,
1035,
4130,
1010,
1035,
2828,
1007,
4130,
1027,
5816,
1035,
4130,
1012,
2000,
1035,
1055,
1001,
2065,
2069,
1035,
7060,
1004,
1004,
2828,
1027,
1027,
1024,
5371,
1001,
2709,
2995,
4983,
2069,
1035,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/transactions.rb | ActiveRecord.Transactions.transaction_include_any_action? | def transaction_include_any_action?(actions)
actions.any? do |action|
case action
when :create
persisted? && @_new_record_before_last_commit
when :update
!(@_new_record_before_last_commit || destroyed?) && _trigger_update_callback
when :destroy
_trigger_destroy_callback
end
end
end | ruby | def transaction_include_any_action?(actions)
actions.any? do |action|
case action
when :create
persisted? && @_new_record_before_last_commit
when :update
!(@_new_record_before_last_commit || destroyed?) && _trigger_update_callback
when :destroy
_trigger_destroy_callback
end
end
end | [
"def",
"transaction_include_any_action?",
"(",
"actions",
")",
"actions",
".",
"any?",
"do",
"|",
"action",
"|",
"case",
"action",
"when",
":create",
"persisted?",
"&&",
"@_new_record_before_last_commit",
"when",
":update",
"!",
"(",
"@_new_record_before_last_commit",
... | Determine if a transaction included an action for :create, :update, or :destroy. Used in filtering callbacks. | [
"Determine",
"if",
"a",
"transaction",
"included",
"an",
"action",
"for",
":",
"create",
":",
"update",
"or",
":",
"destroy",
".",
"Used",
"in",
"filtering",
"callbacks",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/transactions.rb#L441-L452 | train | Returns true if the transaction includes any action | [
30522,
13366,
12598,
1035,
2421,
1035,
2151,
1035,
2895,
1029,
1006,
4506,
1007,
4506,
1012,
2151,
1029,
2079,
1064,
2895,
1064,
2553,
2895,
2043,
1024,
3443,
19035,
1029,
1004,
1004,
1030,
1035,
2047,
1035,
2501,
1035,
2077,
1035,
2197,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_install_updates | def begin_install_updates(device_name, resource_group_name, manager_name, custom_headers:nil)
response = begin_install_updates_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_install_updates(device_name, resource_group_name, manager_name, custom_headers:nil)
response = begin_install_updates_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_install_updates",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_install_updates_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom... | Downloads and installs the 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. | [
"Downloads",
"and",
"installs",
"the",
"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#L1489-L1492 | train | Installs updates to the specified device. | [
30522,
13366,
4088,
1035,
16500,
1035,
14409,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
16500,
1035,
14409,
1035,
2004,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/voice/network.rb | Discordrb::Voice.VoiceWS.send_speaking | def send_speaking(value)
@bot.debug("Speaking: #{value}")
@client.send({
op: 5,
d: {
speaking: value,
delay: 0
}
}.to_json)
end | ruby | def send_speaking(value)
@bot.debug("Speaking: #{value}")
@client.send({
op: 5,
d: {
speaking: value,
delay: 0
}
}.to_json)
end | [
"def",
"send_speaking",
"(",
"value",
")",
"@bot",
".",
"debug",
"(",
"\"Speaking: #{value}\"",
")",
"@client",
".",
"send",
"(",
"{",
"op",
":",
"5",
",",
"d",
":",
"{",
"speaking",
":",
"value",
",",
"delay",
":",
"0",
"}",
"}",
".",
"to_json",
"... | Send a speaking packet (op 5). This determines the green circle around the avatar in the voice channel
@param value [true, false] Whether or not the bot should be speaking | [
"Send",
"a",
"speaking",
"packet",
"(",
"op",
"5",
")",
".",
"This",
"determines",
"the",
"green",
"circle",
"around",
"the",
"avatar",
"in",
"the",
"voice",
"channel"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/voice/network.rb#L191-L200 | train | Send a speaking message to the server | [
30522,
13366,
4604,
1035,
4092,
1006,
3643,
1007,
1030,
28516,
1012,
2139,
8569,
2290,
1006,
1000,
4092,
1024,
1001,
1063,
3643,
1065,
1000,
1007,
1030,
7396,
1012,
4604,
1006,
1063,
6728,
1024,
1019,
1010,
1040,
1024,
1063,
4092,
1024,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/policy_version.rb | Aws::IAM.PolicyVersion.delete | def delete(options = {})
options = options.merge(
policy_arn: @arn,
version_id: @version_id
)
resp = @client.delete_policy_version(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(
policy_arn: @arn,
version_id: @version_id
)
resp = @client.delete_policy_version(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"policy_arn",
":",
"@arn",
",",
"version_id",
":",
"@version_id",
")",
"resp",
"=",
"@client",
".",
"delete_policy_version",
"(",
"options",
")",
"resp",
"... | @!group Actions
@example Request syntax with placeholder values
policy_version.delete()
@param [Hash] options ({})
@return [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/policy_version.rb#L221-L228 | train | Delete a policy version | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
3343,
1035,
12098,
2078,
1024,
1030,
12098,
2078,
1010,
2544,
1035,
8909,
1024,
1030,
2544,
1035,
8909,
1007,
24501,
2361,
1027,
1030,
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_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_web_worker_metric_definitions | def list_web_worker_metric_definitions(resource_group_name, name, worker_pool_name, custom_headers:nil)
first_page = list_web_worker_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_web_worker_metric_definitions(resource_group_name, name, worker_pool_name, custom_headers:nil)
first_page = list_web_worker_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_web_worker_metric_definitions",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_web_worker_metric_definitions_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool... | Get metric definitions for a worker pool of an App Service Environment.
Get metric definitions for a worker pool of an App Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param worker_pool_name [String] Name of the worker pool.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<ResourceMetricDefinition>] operation results. | [
"Get",
"metric",
"definitions",
"for",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L3696-L3699 | train | Gets all metric definitions for a worker pool. | [
30522,
13366,
2862,
1035,
4773,
1035,
7309,
1035,
12046,
1035,
15182,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7309,
1035,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/racc | lib/racc/state.rb | Racc.States.path | def path(state, rule)
rule.symbols.each_with_object([]) do |tok, path|
goto = state.gotos[tok]
path << goto
state = goto.to_state
end
end | ruby | def path(state, rule)
rule.symbols.each_with_object([]) do |tok, path|
goto = state.gotos[tok]
path << goto
state = goto.to_state
end
end | [
"def",
"path",
"(",
"state",
",",
"rule",
")",
"rule",
".",
"symbols",
".",
"each_with_object",
"(",
"[",
"]",
")",
"do",
"|",
"tok",
",",
"path",
"|",
"goto",
"=",
"state",
".",
"gotos",
"[",
"tok",
"]",
"path",
"<<",
"goto",
"state",
"=",
"goto... | Sequence of state transitions which would be taken when starting
from 'state', then following the RHS of 'rule' right to the end | [
"Sequence",
"of",
"state",
"transitions",
"which",
"would",
"be",
"taken",
"when",
"starting",
"from",
"state",
"then",
"following",
"the",
"RHS",
"of",
"rule",
"right",
"to",
"the",
"end"
] | d3244edfa11dd6e86e43f570c6444d41c7e3552a | https://github.com/ruby/racc/blob/d3244edfa11dd6e86e43f570c6444d41c7e3552a/lib/racc/state.rb#L208-L214 | train | Returns the path to the given rule. | [
30522,
13366,
4130,
1006,
2110,
1010,
3627,
1007,
3627,
1012,
9255,
1012,
2169,
1035,
2007,
1035,
4874,
1006,
1031,
1033,
1007,
2079,
1064,
2000,
2243,
1010,
4130,
1064,
2288,
2080,
1027,
2110,
1012,
2288,
2891,
1031,
2000,
2243,
1033,
41... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/drawing/pic.rb | Axlsx.Pic.use_two_cell_anchor | def use_two_cell_anchor
return if @anchor.is_a?(TwoCellAnchor)
new_anchor = TwoCellAnchor.new(@anchor.drawing, :start_at => [@anchor.from.col, @anchor.from.row])
swap_anchor(new_anchor)
end | ruby | def use_two_cell_anchor
return if @anchor.is_a?(TwoCellAnchor)
new_anchor = TwoCellAnchor.new(@anchor.drawing, :start_at => [@anchor.from.col, @anchor.from.row])
swap_anchor(new_anchor)
end | [
"def",
"use_two_cell_anchor",
"return",
"if",
"@anchor",
".",
"is_a?",
"(",
"TwoCellAnchor",
")",
"new_anchor",
"=",
"TwoCellAnchor",
".",
"new",
"(",
"@anchor",
".",
"drawing",
",",
":start_at",
"=>",
"[",
"@anchor",
".",
"from",
".",
"col",
",",
"@anchor",... | changes the anchor type to a two cell anchor | [
"changes",
"the",
"anchor",
"type",
"to",
"a",
"two",
"cell",
"anchor"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/pic.rb#L197-L201 | train | Use two cell anchor to get the correct position | [
30522,
13366,
2224,
1035,
2048,
1035,
3526,
1035,
8133,
2709,
2065,
1030,
8133,
1012,
2003,
1035,
1037,
1029,
1006,
2048,
29109,
5802,
9905,
2099,
1007,
2047,
1035,
8133,
1027,
2048,
29109,
5802,
9905,
2099,
1012,
2047,
1006,
1030,
8133,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/after_hooks.rb | Watir.AfterHooks.run | def run
# We can't just rescue exception because Firefox automatically closes alert when exception raised
return unless @after_hooks.any? && !@browser.alert.exists?
each { |after_hook| after_hook.call(@browser) }
rescue Selenium::WebDriver::Error::NoSuchWindowError => ex
Watir.logger.info "Could not execute After Hooks because browser window was closed #{ex}"
end | ruby | def run
# We can't just rescue exception because Firefox automatically closes alert when exception raised
return unless @after_hooks.any? && !@browser.alert.exists?
each { |after_hook| after_hook.call(@browser) }
rescue Selenium::WebDriver::Error::NoSuchWindowError => ex
Watir.logger.info "Could not execute After Hooks because browser window was closed #{ex}"
end | [
"def",
"run",
"# We can't just rescue exception because Firefox automatically closes alert when exception raised",
"return",
"unless",
"@after_hooks",
".",
"any?",
"&&",
"!",
"@browser",
".",
"alert",
".",
"exists?",
"each",
"{",
"|",
"after_hook",
"|",
"after_hook",
".",
... | Runs after hooks. | [
"Runs",
"after",
"hooks",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/after_hooks.rb#L67-L74 | train | Run after hooks | [
30522,
13366,
2448,
1001,
2057,
2064,
1005,
1056,
2074,
5343,
6453,
2138,
2543,
14876,
2595,
8073,
14572,
9499,
2043,
6453,
2992,
2709,
4983,
1030,
2044,
1035,
18008,
1012,
2151,
1029,
1004,
1004,
999,
1030,
16602,
1012,
9499,
1012,
6526,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.set_upgrade_orchestration_service_state | def set_upgrade_orchestration_service_state(upgrade_orchestration_service_state, timeout:60, custom_headers:nil)
response = set_upgrade_orchestration_service_state_async(upgrade_orchestration_service_state, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def set_upgrade_orchestration_service_state(upgrade_orchestration_service_state, timeout:60, custom_headers:nil)
response = set_upgrade_orchestration_service_state_async(upgrade_orchestration_service_state, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"set_upgrade_orchestration_service_state",
"(",
"upgrade_orchestration_service_state",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"set_upgrade_orchestration_service_state_async",
"(",
"upgrade_orchestration_service_state",
",",
"t... | Update the service state of Service Fabric Upgrade Orchestration Service.
Update the service state of Service Fabric Upgrade Orchestration Service.
This API is internally used for support purposes.
@param upgrade_orchestration_service_state [UpgradeOrchestrationServiceState]
Service state of Service Fabric Upgrade Orchestration Service.
@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 [UpgradeOrchestrationServiceStateSummary] operation results. | [
"Update",
"the",
"service",
"state",
"of",
"Service",
"Fabric",
"Upgrade",
"Orchestration",
"Service",
"."
] | 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#L2240-L2243 | train | Sets the state of the orchestration service to the current state of the orchestration service. | [
30522,
13366,
2275,
1035,
12200,
1035,
4032,
3508,
1035,
2326,
1035,
2110,
1006,
12200,
1035,
4032,
3508,
1035,
2326,
1035,
2110,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2275,
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... |
braintree/braintree_ruby | lib/braintree/graphql_client.rb | Braintree.GraphQLClient.query | def query(definition, variables = {}, operationName = nil)
graphql_connection = _setup_connection(@config.graphql_server, @config.graphql_port)
request = {}
request['query'] = definition
request['operationName'] = operationName if operationName
request['variables'] = variables
response = _http_do Net::HTTP::Post, @config.graphql_base_url, request.to_json, nil, graphql_connection, @graphql_headers
data = JSON.parse(response.body, :symbolize_names => true)
Util.raise_exception_for_graphql_error(data)
data
end | ruby | def query(definition, variables = {}, operationName = nil)
graphql_connection = _setup_connection(@config.graphql_server, @config.graphql_port)
request = {}
request['query'] = definition
request['operationName'] = operationName if operationName
request['variables'] = variables
response = _http_do Net::HTTP::Post, @config.graphql_base_url, request.to_json, nil, graphql_connection, @graphql_headers
data = JSON.parse(response.body, :symbolize_names => true)
Util.raise_exception_for_graphql_error(data)
data
end | [
"def",
"query",
"(",
"definition",
",",
"variables",
"=",
"{",
"}",
",",
"operationName",
"=",
"nil",
")",
"graphql_connection",
"=",
"_setup_connection",
"(",
"@config",
".",
"graphql_server",
",",
"@config",
".",
"graphql_port",
")",
"request",
"=",
"{",
"... | :nodoc: | [
":",
"nodoc",
":"
] | 6e56c7099ea55bcdc4073cbea60b2688cef69663 | https://github.com/braintree/braintree_ruby/blob/6e56c7099ea55bcdc4073cbea60b2688cef69663/lib/braintree/graphql_client.rb#L13-L26 | train | Execute a query on the graphql server | [
30522,
13366,
23032,
1006,
6210,
1010,
10857,
1027,
1063,
1065,
1010,
3169,
18442,
1027,
9152,
2140,
1007,
10629,
4160,
2140,
1035,
4434,
1027,
1035,
16437,
1035,
4434,
1006,
1030,
9530,
8873,
30524,
1033,
1027,
3169,
18442,
2065,
3169,
184... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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_service/lib/2019-02-01/generated/azure_mgmt_container_service/agent_pools.rb | Azure::ContainerService::Mgmt::V2019_02_01.AgentPools.begin_delete | def begin_delete(resource_group_name, managed_cluster_name, agent_pool_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, managed_cluster_name, agent_pool_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, managed_cluster_name, agent_pool_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, managed_cluster_name, agent_pool_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"managed_cluster_name",
",",
"agent_pool_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"managed_cluster_name",
",",
"agent_pool_name",
",",
"... | Deletes an agent pool.
Deletes the agent pool in the specified managed cluster.
@param resource_group_name [String] The name of the resource group.
@param managed_cluster_name [String] The name of the managed cluster
resource.
@param agent_pool_name [String] The name of the agent pool.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"an",
"agent",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_service/lib/2019-02-01/generated/azure_mgmt_container_service/agent_pools.rb#L474-L477 | train | Deletes the managed cluster agent pool. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
9324,
1035,
2171,
1010,
4005,
1035,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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/network_acl.rb | Aws::EC2.NetworkAcl.replace_association | def replace_association(options = {})
options = options.merge(network_acl_id: @id)
resp = @client.replace_network_acl_association(options)
resp.data
end | ruby | def replace_association(options = {})
options = options.merge(network_acl_id: @id)
resp = @client.replace_network_acl_association(options)
resp.data
end | [
"def",
"replace_association",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"network_acl_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"replace_network_acl_association",
"(",
"options",
")",
"resp",
".",
"data",
"end"... | @example Request syntax with placeholder values
network_acl.replace_association({
association_id: "String", # required
dry_run: false,
})
@param [Hash] options ({})
@option options [required, String] :association_id
The ID of the current association between the original network ACL and
the subnet.
@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::ReplaceNetworkAclAssociationResult] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/network_acl.rb#L362-L366 | train | Replace the association of this network acl | [
30522,
13366,
5672,
1035,
2523,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2897,
1035,
9353,
2140,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
5672,
1035,
2897,
1035,
9353,
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... |
fastlane/fastlane | sigh/lib/sigh/runner.rb | Sigh.Runner.create_profile! | def create_profile!
cert = certificate_to_use
bundle_id = Sigh.config[:app_identifier]
name = Sigh.config[:provisioning_name] || [bundle_id, profile_type.pretty_type].join(' ')
unless Sigh.config[:skip_fetch_profiles]
if Spaceship.provisioning_profile.all.find { |p| p.name == name }
UI.error("The name '#{name}' is already taken, using another one.")
name += " #{Time.now.to_i}"
end
end
UI.important("Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}' for '#{Sigh.config[:platform]}' platform")
profile = profile_type.create!(name: name,
bundle_id: bundle_id,
certificate: cert,
mac: Sigh.config[:platform].to_s == 'macos',
sub_platform: Sigh.config[:platform].to_s == 'tvos' ? 'tvOS' : nil,
template_name: Sigh.config[:template_name])
profile
end | ruby | def create_profile!
cert = certificate_to_use
bundle_id = Sigh.config[:app_identifier]
name = Sigh.config[:provisioning_name] || [bundle_id, profile_type.pretty_type].join(' ')
unless Sigh.config[:skip_fetch_profiles]
if Spaceship.provisioning_profile.all.find { |p| p.name == name }
UI.error("The name '#{name}' is already taken, using another one.")
name += " #{Time.now.to_i}"
end
end
UI.important("Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}' for '#{Sigh.config[:platform]}' platform")
profile = profile_type.create!(name: name,
bundle_id: bundle_id,
certificate: cert,
mac: Sigh.config[:platform].to_s == 'macos',
sub_platform: Sigh.config[:platform].to_s == 'tvos' ? 'tvOS' : nil,
template_name: Sigh.config[:template_name])
profile
end | [
"def",
"create_profile!",
"cert",
"=",
"certificate_to_use",
"bundle_id",
"=",
"Sigh",
".",
"config",
"[",
":app_identifier",
"]",
"name",
"=",
"Sigh",
".",
"config",
"[",
":provisioning_name",
"]",
"||",
"[",
"bundle_id",
",",
"profile_type",
".",
"pretty_type"... | Create a new profile and return it | [
"Create",
"a",
"new",
"profile",
"and",
"return",
"it"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/sigh/lib/sigh/runner.rb#L122-L142 | train | Creates a new provisioning profile | [
30522,
13366,
3443,
1035,
6337,
999,
8292,
5339,
1027,
8196,
1035,
2000,
1035,
2224,
14012,
1035,
8909,
1027,
6682,
1012,
9530,
8873,
2290,
1031,
1024,
10439,
1035,
8909,
4765,
18095,
1033,
2171,
1027,
6682,
1012,
9530,
8873,
2290,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/user_identities.rb | Azure::ApiManagement::Mgmt::V2019_01_01.UserIdentities.list_with_http_info | def list_with_http_info(resource_group_name, service_name, user_id, custom_headers:nil)
list_async(resource_group_name, service_name, user_id, custom_headers:custom_headers).value!
end | ruby | def list_with_http_info(resource_group_name, service_name, user_id, custom_headers:nil)
list_async(resource_group_name, service_name, user_id, custom_headers:custom_headers).value!
end | [
"def",
"list_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"user_id",
",",
"custom_headers",
":",
"nil",
")",
"list_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"user_id",
",",
"custom_headers",
":custom_headers",
")",
".",
... | List of all user identities.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param user_id [String] User identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"List",
"of",
"all",
"user",
"identities",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/user_identities.rb#L53-L55 | train | Gets the list of the user s non - existent terms. | [
30522,
13366,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
5310,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.