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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mongodb/mongoid | lib/mongoid/serializable.rb | Mongoid.Serializable.relation_options | def relation_options(inclusions, options, name)
if inclusions.is_a?(Hash)
inclusions[name]
else
{ except: options[:except], only: options[:only] }
end
end | ruby | def relation_options(inclusions, options, name)
if inclusions.is_a?(Hash)
inclusions[name]
else
{ except: options[:except], only: options[:only] }
end
end | [
"def",
"relation_options",
"(",
"inclusions",
",",
"options",
",",
"name",
")",
"if",
"inclusions",
".",
"is_a?",
"(",
"Hash",
")",
"inclusions",
"[",
"name",
"]",
"else",
"{",
"except",
":",
"options",
"[",
":except",
"]",
",",
"only",
":",
"options",
... | Since the inclusions can be a hash, symbol, or array of symbols, this is
provided as a convenience to parse out the options.
@example Get the association options.
document.relation_names(:include => [ :addresses ])
@param [ Hash, Symbol, Array<Symbol> ] inclusions The inclusions.
@param [ Hash ] options The options.
@param [ Symbol ] name The name of the association.
@return [ Hash ] The options for the association.
@since 2.0.0.rc.6 | [
"Since",
"the",
"inclusions",
"can",
"be",
"a",
"hash",
"symbol",
"or",
"array",
"of",
"symbols",
"this",
"is",
"provided",
"as",
"a",
"convenience",
"to",
"parse",
"out",
"the",
"options",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/serializable.rb#L164-L170 | train | Returns the options for a given relation | [
30522,
13366,
7189,
1035,
7047,
1006,
10502,
2015,
1010,
7047,
1010,
2171,
1007,
2065,
10502,
2015,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
10502,
2015,
1031,
2171,
1033,
2842,
1063,
3272,
1024,
7047,
1031,
1024,
3272,
1033,
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... |
opal/opal | lib/opal/cli.rb | Opal.CLI.evals_or_file | def evals_or_file
# --library
return if lib_only
if evals.any?
yield evals.join("\n"), '-e'
elsif file && (filename != '-' || evals.empty?)
yield file.read, filename
end
end | ruby | def evals_or_file
# --library
return if lib_only
if evals.any?
yield evals.join("\n"), '-e'
elsif file && (filename != '-' || evals.empty?)
yield file.read, filename
end
end | [
"def",
"evals_or_file",
"# --library",
"return",
"if",
"lib_only",
"if",
"evals",
".",
"any?",
"yield",
"evals",
".",
"join",
"(",
"\"\\n\"",
")",
",",
"'-e'",
"elsif",
"file",
"&&",
"(",
"filename",
"!=",
"'-'",
"||",
"evals",
".",
"empty?",
")",
"yield... | Internal: Yields a string of source code and the proper filename for either
evals, stdin or a filepath. | [
"Internal",
":",
"Yields",
"a",
"string",
"of",
"source",
"code",
"and",
"the",
"proper",
"filename",
"for",
"either",
"evals",
"stdin",
"or",
"a",
"filepath",
"."
] | 41aedc0fd62aab00d3c117ba0caf00206bedd981 | https://github.com/opal/opal/blob/41aedc0fd62aab00d3c117ba0caf00206bedd981/lib/opal/cli.rb#L139-L148 | train | Returns the result of the block if any. | [
30522,
13366,
9345,
4877,
1035,
2030,
1035,
5371,
1001,
1011,
1011,
3075,
2709,
2065,
5622,
2497,
1035,
2069,
2065,
9345,
4877,
1012,
2151,
1029,
10750,
9345,
4877,
1012,
3693,
1006,
1000,
1032,
1050,
1000,
1007,
1010,
1005,
1011,
1041,
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_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.list_storage_containers_next | def list_storage_containers_next(next_page_link, custom_headers:nil)
response = list_storage_containers_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_storage_containers_next(next_page_link, custom_headers:nil)
response = list_storage_containers_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_storage_containers_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_storage_containers_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"un... | Lists the Azure Storage containers, if any, associated with the specified
Data Lake Analytics and Azure Storage account combination. The response
includes a link to the next page of results, if any.
@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 [ListBlobContainersResult] operation results. | [
"Lists",
"the",
"Azure",
"Storage",
"containers",
"if",
"any",
"associated",
"with",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"and",
"Azure",
"Storage",
"account",
"combination",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"pa... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L2355-L2358 | train | Gets the next page of storage containers. | [
30522,
13366,
2862,
1035,
5527,
1035,
16143,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
5527,
1035,
16143,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/resource.rb | Aws::EC2.Resource.vpcs | def vpcs(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_vpcs(options)
resp.each_page do |page|
batch = []
page.data.vpcs.each do |v|
batch << Vpc.new(
id: v.vpc_id,
data: v,
client: @client
)
end
y.yield(batch)
end
end
Vpc::Collection.new(batches)
end | ruby | def vpcs(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_vpcs(options)
resp.each_page do |page|
batch = []
page.data.vpcs.each do |v|
batch << Vpc.new(
id: v.vpc_id,
data: v,
client: @client
)
end
y.yield(batch)
end
end
Vpc::Collection.new(batches)
end | [
"def",
"vpcs",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"resp",
"=",
"@client",
".",
"describe_vpcs",
"(",
"options",
")",
"resp",
".",
"each_page",
"do",
"|",
"page",
"|",
"batch",
"=",
"["... | @example Request syntax with placeholder values
vpcs = ec2.vpcs({
filters: [
{
name: "String",
values: ["String"],
},
],
vpc_ids: ["String"],
dry_run: false,
})
@param [Hash] options ({})
@option options [Array<Types::Filter>] :filters
One or more filters.
* `cidr` - The primary IPv4 CIDR block of the VPC. The CIDR block you
specify must exactly match the VPC's CIDR block for information to
be returned for the VPC. Must contain the slash followed by one or
two digits (for example, `/28`).
* `cidr-block-association.cidr-block` - An IPv4 CIDR block associated
with the VPC.
* `cidr-block-association.association-id` - The association ID for an
IPv4 CIDR block associated with the VPC.
* `cidr-block-association.state` - The state of an IPv4 CIDR block
associated with the VPC.
* `dhcp-options-id` - The ID of a set of DHCP options.
* `ipv6-cidr-block-association.ipv6-cidr-block` - An IPv6 CIDR block
associated with the VPC.
* `ipv6-cidr-block-association.association-id` - The association ID
for an IPv6 CIDR block associated with the VPC.
* `ipv6-cidr-block-association.state` - The state of an IPv6 CIDR
block associated with the VPC.
* `isDefault` - Indicates whether the VPC is the default VPC.
* `owner-id` - The ID of the AWS account that owns the VPC.
* `state` - The state of the VPC (`pending` \| `available`).
* `tag`\:<key> - The key/value combination of a tag assigned to
the resource. Use the tag key in the filter name and the tag value
as the filter value. For example, to find all resources that have a
tag with the key `Owner` and the value `TeamA`, specify `tag:Owner`
for the filter name and `TeamA` for the filter value.
* `tag-key` - The key of a tag assigned to the resource. Use this
filter to find all resources assigned a tag with a specific key,
regardless of the tag value.
* `vpc-id` - The ID of the VPC.
@option options [Array<String>] :vpc_ids
One or more VPC IDs.
Default: Describes all your VPCs.
@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 [Vpc::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/resource.rb#L3059-L3075 | train | Returns a list of all the VPCs in the cluster. | [
30522,
13366,
21210,
6169,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
24501,
2361,
1027,
1030,
7396,
1012,
6235,
1035,
21210,
6169,
1006,
7047,
1007,
24501,
2361,
1012,
216... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeorgeKaraszi/ActiveRecordExtended | lib/active_record_extended/utilities.rb | ActiveRecordExtended.Utilities.pipe_cte_with! | def pipe_cte_with!(subquery)
return self unless subquery.try(:with_values?)
cte_ary = flatten_safely(subquery.with_values)
subquery.with_values = nil # Remove nested queries with values
# Add subquery's CTE's to the parents query stack. (READ THE SPECIAL NOTE ABOVE!)
if @scope.with_values?
# combine top-level and lower level queries `.with` values into 1 structure
with_hash = cte_ary.each_with_object(@scope.with_values.first) do |from_cte, hash|
hash.reverse_merge!(from_cte)
end
@scope.with_values = [with_hash]
else
# Top level has no with values
@scope.with!(*cte_ary)
end
self
end | ruby | def pipe_cte_with!(subquery)
return self unless subquery.try(:with_values?)
cte_ary = flatten_safely(subquery.with_values)
subquery.with_values = nil # Remove nested queries with values
# Add subquery's CTE's to the parents query stack. (READ THE SPECIAL NOTE ABOVE!)
if @scope.with_values?
# combine top-level and lower level queries `.with` values into 1 structure
with_hash = cte_ary.each_with_object(@scope.with_values.first) do |from_cte, hash|
hash.reverse_merge!(from_cte)
end
@scope.with_values = [with_hash]
else
# Top level has no with values
@scope.with!(*cte_ary)
end
self
end | [
"def",
"pipe_cte_with!",
"(",
"subquery",
")",
"return",
"self",
"unless",
"subquery",
".",
"try",
"(",
":with_values?",
")",
"cte_ary",
"=",
"flatten_safely",
"(",
"subquery",
".",
"with_values",
")",
"subquery",
".",
"with_values",
"=",
"nil",
"# Remove nested... | Will carry defined CTE tables from the nested sub-query and gradually pushes it up to the parents query stack
I.E: It pushes `WITH [:cte_name:] AS(...), ..` to the top of the query structure tree
SPECIAL GOTCHA NOTE: (if duplicate keys are found) This will favor the parents query `with's` over nested ones! | [
"Will",
"carry",
"defined",
"CTE",
"tables",
"from",
"the",
"nested",
"sub",
"-",
"query",
"and",
"gradually",
"pushes",
"it",
"up",
"to",
"the",
"parents",
"query",
"stack",
"I",
".",
"E",
":",
"It",
"pushes",
"WITH",
"[",
":",
"cte_name",
":",
"]",
... | aca74eebb64b9957a2c8765bef6e43c7d5736fd8 | https://github.com/GeorgeKaraszi/ActiveRecordExtended/blob/aca74eebb64b9957a2c8765bef6e43c7d5736fd8/lib/active_record_extended/utilities.rb#L81-L101 | train | Pipes a CTE with another subquery. | [
30522,
13366,
8667,
1035,
14931,
2063,
1035,
2007,
999,
1006,
4942,
4226,
2854,
1007,
2709,
2969,
4983,
30524,
2007,
1035,
5300,
1029,
1007,
14931,
2063,
1035,
12098,
2100,
1027,
4257,
6528,
1035,
9689,
1006,
4942,
4226,
2854,
1012,
2007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.get_hierarchical_entity_role | def get_hierarchical_entity_role(app_id, version_id, h_entity_id, role_id, custom_headers:nil)
response = get_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_hierarchical_entity_role(app_id, version_id, h_entity_id, role_id, custom_headers:nil)
response = get_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_hierarchical_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"h_entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_hierarchical_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"h_entity_id",
",",
"ro... | Get one role for a given hierarchical entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param h_entity_id The hierarchical entity extractor ID.
@param role_id entity role ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EntityRole] operation results. | [
"Get",
"one",
"role",
"for",
"a",
"given",
"hierarchical",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L10653-L10656 | train | Gets the role of the specified hierarchical entity. | [
30522,
13366,
2131,
1035,
25835,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
1044,
1035,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/cache.rb | Discordrb.Cache.member | def member(server_or_id, user_id)
server_id = server_or_id.resolve_id
user_id = user_id.resolve_id
server = server_or_id.is_a?(Server) ? server_or_id : self.server(server_id)
return server.member(user_id) if server.member_cached?(user_id)
LOGGER.out("Resolving member #{server_id} on server #{user_id}")
begin
response = API::Server.resolve_member(token, server_id, user_id)
rescue RestClient::ResourceNotFound
return nil
end
member = Member.new(JSON.parse(response), server, self)
server.cache_member(member)
end | ruby | def member(server_or_id, user_id)
server_id = server_or_id.resolve_id
user_id = user_id.resolve_id
server = server_or_id.is_a?(Server) ? server_or_id : self.server(server_id)
return server.member(user_id) if server.member_cached?(user_id)
LOGGER.out("Resolving member #{server_id} on server #{user_id}")
begin
response = API::Server.resolve_member(token, server_id, user_id)
rescue RestClient::ResourceNotFound
return nil
end
member = Member.new(JSON.parse(response), server, self)
server.cache_member(member)
end | [
"def",
"member",
"(",
"server_or_id",
",",
"user_id",
")",
"server_id",
"=",
"server_or_id",
".",
"resolve_id",
"user_id",
"=",
"user_id",
".",
"resolve_id",
"server",
"=",
"server_or_id",
".",
"is_a?",
"(",
"Server",
")",
"?",
"server_or_id",
":",
"self",
"... | Gets a member by both IDs, or `Server` and user ID.
@param server_or_id [Server, Integer] The `Server` or server ID for which a member should be resolved
@param user_id [Integer] The ID of the user that should be resolved
@return [Member, nil] The member identified by the IDs, or `nil` if none could be found | [
"Gets",
"a",
"member",
"by",
"both",
"IDs",
"or",
"Server",
"and",
"user",
"ID",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/cache.rb#L111-L127 | train | Returns a member object for the specified server or server id. | [
30522,
13366,
2266,
1006,
8241,
1035,
2030,
1035,
8909,
1010,
5310,
1035,
8909,
1007,
8241,
1035,
8909,
1027,
8241,
1035,
2030,
1035,
8909,
1012,
10663,
1035,
8909,
5310,
1035,
8909,
1027,
5310,
1035,
8909,
1012,
10663,
1035,
8909,
8241,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/managers.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Managers.get_encryption_settings | def get_encryption_settings(resource_group_name, manager_name, custom_headers:nil)
response = get_encryption_settings_async(resource_group_name, manager_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_encryption_settings(resource_group_name, manager_name, custom_headers:nil)
response = get_encryption_settings_async(resource_group_name, manager_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_encryption_settings",
"(",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_encryption_settings_async",
"(",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":custom_headers",
")",
"."... | Returns the encryption settings of the manager.
@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 [EncryptionSettings] operation results. | [
"Returns",
"the",
"encryption",
"settings",
"of",
"the",
"manager",
"."
] | 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/managers.rb#L701-L704 | train | Gets encryption settings for the specified managed database. | [
30522,
13366,
2131,
1035,
21999,
1035,
10906,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
21999,
1035,
10906,
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... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/document.rb | HQMF2.Document.handle_attribute_value | def handle_attribute_value(attribute, value)
type = attribute.at_xpath('./cda:value/@xsi:type', NAMESPACES).try(:value)
case type
when 'II'
if value.nil?
value = attribute.at_xpath('./cda:value/@extension', NAMESPACES).try(:value)
end
HQMF::Identifier.new(type,
attribute.at_xpath('./cda:value/@root', NAMESPACES).try(:value),
attribute.at_xpath('./cda:value/@extension', NAMESPACES).try(:value))
when 'ED'
HQMF::ED.new(type, value, attribute.at_xpath('./cda:value/@mediaType', NAMESPACES).try(:value))
when 'CD'
HQMF::Coded.new('CD',
attribute.at_xpath('./cda:value/@codeSystem', NAMESPACES).try(:value),
attribute.at_xpath('./cda:value/@code', NAMESPACES).try(:value),
attribute.at_xpath('./cda:value/@valueSet', NAMESPACES).try(:value),
attribute.at_xpath('./cda:value/cda:displayName/@value', NAMESPACES).try(:value))
else
value.present? ? HQMF::GenericValueContainer.new(type, value) : HQMF::AnyValue.new(type)
end
end | ruby | def handle_attribute_value(attribute, value)
type = attribute.at_xpath('./cda:value/@xsi:type', NAMESPACES).try(:value)
case type
when 'II'
if value.nil?
value = attribute.at_xpath('./cda:value/@extension', NAMESPACES).try(:value)
end
HQMF::Identifier.new(type,
attribute.at_xpath('./cda:value/@root', NAMESPACES).try(:value),
attribute.at_xpath('./cda:value/@extension', NAMESPACES).try(:value))
when 'ED'
HQMF::ED.new(type, value, attribute.at_xpath('./cda:value/@mediaType', NAMESPACES).try(:value))
when 'CD'
HQMF::Coded.new('CD',
attribute.at_xpath('./cda:value/@codeSystem', NAMESPACES).try(:value),
attribute.at_xpath('./cda:value/@code', NAMESPACES).try(:value),
attribute.at_xpath('./cda:value/@valueSet', NAMESPACES).try(:value),
attribute.at_xpath('./cda:value/cda:displayName/@value', NAMESPACES).try(:value))
else
value.present? ? HQMF::GenericValueContainer.new(type, value) : HQMF::AnyValue.new(type)
end
end | [
"def",
"handle_attribute_value",
"(",
"attribute",
",",
"value",
")",
"type",
"=",
"attribute",
".",
"at_xpath",
"(",
"'./cda:value/@xsi:type'",
",",
"NAMESPACES",
")",
".",
"try",
"(",
":value",
")",
"case",
"type",
"when",
"'II'",
"if",
"value",
".",
"nil?... | Extracts the value used by a particular attribute | [
"Extracts",
"the",
"value",
"used",
"by",
"a",
"particular",
"attribute"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/document.rb#L215-L236 | train | Handles the attribute value | [
30522,
13366,
5047,
1035,
17961,
1035,
3643,
1006,
17961,
1010,
3643,
1007,
2828,
1027,
17961,
1012,
2012,
1035,
26726,
8988,
1006,
1005,
1012,
1013,
3729,
2050,
1024,
3643,
1013,
1030,
1060,
5332,
1024,
2828,
1005,
1010,
3415,
15327,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | lib/linguist/repository.rb | Linguist.Repository.languages | def languages
@sizes ||= begin
sizes = Hash.new { 0 }
cache.each do |_, (language, size)|
sizes[language] += size
end
sizes
end
end | ruby | def languages
@sizes ||= begin
sizes = Hash.new { 0 }
cache.each do |_, (language, size)|
sizes[language] += size
end
sizes
end
end | [
"def",
"languages",
"@sizes",
"||=",
"begin",
"sizes",
"=",
"Hash",
".",
"new",
"{",
"0",
"}",
"cache",
".",
"each",
"do",
"|",
"_",
",",
"(",
"language",
",",
"size",
")",
"|",
"sizes",
"[",
"language",
"]",
"+=",
"size",
"end",
"sizes",
"end",
... | Public: Returns a breakdown of language stats.
Examples
# => { 'Ruby' => 46319,
'JavaScript' => 258 }
Returns a Hash of language names and Integer size values. | [
"Public",
":",
"Returns",
"a",
"breakdown",
"of",
"language",
"stats",
"."
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/repository.rb#L65-L73 | train | Returns the sizes of the languages in the current language. | [
30522,
13366,
4155,
1030,
10826,
1064,
1064,
1027,
4088,
10826,
1027,
23325,
1012,
2047,
1063,
1014,
1065,
17053,
1012,
2169,
2079,
1064,
1035,
1010,
1006,
2653,
1010,
2946,
1007,
1064,
10826,
1031,
2653,
1033,
1009,
1027,
2946,
2203,
10826... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sensu/sensu | lib/sensu/daemon.rb | Sensu.Daemon.setup_transport | def setup_transport
transport_name = @settings[:transport][:name]
transport_settings = @settings[transport_name]
@logger.debug("connecting to transport", {
:name => transport_name,
:settings => transport_settings
})
Transport.logger = @logger
Transport.connect(transport_name, transport_settings) do |connection|
@transport = connection
@transport.on_error do |error|
@logger.error("transport connection error", :error => error.to_s)
if @settings[:transport][:reconnect_on_error]
@transport.reconnect
else
stop
end
end
@transport.before_reconnect do
unless testing?
@logger.warn("reconnecting to transport")
pause
end
end
@transport.after_reconnect do
@logger.info("reconnected to transport")
resume
end
yield(@transport) if block_given?
end
end | ruby | def setup_transport
transport_name = @settings[:transport][:name]
transport_settings = @settings[transport_name]
@logger.debug("connecting to transport", {
:name => transport_name,
:settings => transport_settings
})
Transport.logger = @logger
Transport.connect(transport_name, transport_settings) do |connection|
@transport = connection
@transport.on_error do |error|
@logger.error("transport connection error", :error => error.to_s)
if @settings[:transport][:reconnect_on_error]
@transport.reconnect
else
stop
end
end
@transport.before_reconnect do
unless testing?
@logger.warn("reconnecting to transport")
pause
end
end
@transport.after_reconnect do
@logger.info("reconnected to transport")
resume
end
yield(@transport) if block_given?
end
end | [
"def",
"setup_transport",
"transport_name",
"=",
"@settings",
"[",
":transport",
"]",
"[",
":name",
"]",
"transport_settings",
"=",
"@settings",
"[",
"transport_name",
"]",
"@logger",
".",
"debug",
"(",
"\"connecting to transport\"",
",",
"{",
":name",
"=>",
"tran... | Set up the Sensu transport connection. Sensu uses a transport
API, allowing it to use various message brokers. By default,
Sensu will use the built-in "rabbitmq" transport. The Sensu
service will stop gracefully in the event of a transport error,
and pause/resume in the event of connectivity issues. This
method creates the transport instance variable: `@transport`.
https://github.com/sensu/sensu-transport
@yield [Object] passes initialized and connected Transport
connection object to the callback/block. | [
"Set",
"up",
"the",
"Sensu",
"transport",
"connection",
".",
"Sensu",
"uses",
"a",
"transport",
"API",
"allowing",
"it",
"to",
"use",
"various",
"message",
"brokers",
".",
"By",
"default",
"Sensu",
"will",
"use",
"the",
"built",
"-",
"in",
"rabbitmq",
"tra... | 51319e4b58c8d9986f101ad71ff729aa3e51e951 | https://github.com/sensu/sensu/blob/51319e4b58c8d9986f101ad71ff729aa3e51e951/lib/sensu/daemon.rb#L281-L311 | train | setup the transport object | [
30522,
13366,
16437,
1035,
3665,
3665,
1035,
2171,
1027,
1030,
10906,
1031,
1024,
3665,
1033,
1031,
1024,
2171,
1033,
3665,
1035,
10906,
1027,
1030,
10906,
1031,
3665,
1035,
2171,
1033,
1030,
8833,
4590,
1012,
2139,
8569,
2290,
1006,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | lib/linguist/blob_helper.rb | Linguist.BlobHelper._mime_type | def _mime_type
if defined? @_mime_type
@_mime_type
else
guesses = ::MIME::Types.type_for(extname.to_s)
# Prefer text mime types over binary
@_mime_type = guesses.detect { |type| type.ascii? } ||
# Otherwise use the first guess
guesses.first
end
end | ruby | def _mime_type
if defined? @_mime_type
@_mime_type
else
guesses = ::MIME::Types.type_for(extname.to_s)
# Prefer text mime types over binary
@_mime_type = guesses.detect { |type| type.ascii? } ||
# Otherwise use the first guess
guesses.first
end
end | [
"def",
"_mime_type",
"if",
"defined?",
"@_mime_type",
"@_mime_type",
"else",
"guesses",
"=",
"::",
"MIME",
"::",
"Types",
".",
"type_for",
"(",
"extname",
".",
"to_s",
")",
"# Prefer text mime types over binary",
"@_mime_type",
"=",
"guesses",
".",
"detect",
"{",
... | Internal: Lookup mime type for extension.
Returns a MIME::Type | [
"Internal",
":",
"Lookup",
"mime",
"type",
"for",
"extension",
"."
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/blob_helper.rb#L32-L43 | train | Returns the mime type of the file. | [
30522,
13366,
1035,
2771,
4168,
1035,
2828,
2065,
4225,
1029,
1030,
1035,
2771,
4168,
1035,
2828,
1030,
1035,
2771,
4168,
1035,
2828,
2842,
3984,
2229,
1027,
1024,
1024,
2771,
4168,
1024,
1024,
4127,
1012,
2828,
1035,
2005,
1006,
4654,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/jobs.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Jobs.get_with_http_info | def get_with_http_info(device_name, job_name, resource_group_name, manager_name, custom_headers:nil)
get_async(device_name, job_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(device_name, job_name, resource_group_name, manager_name, custom_headers:nil)
get_async(device_name, job_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"device_name",
",",
"job_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"device_name",
",",
"job_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom... | Gets the details of the specified job name.
@param device_name [String] The device name
@param job_name [String] The job 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. | [
"Gets",
"the",
"details",
"of",
"the",
"specified",
"job",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/jobs.rb#L158-L160 | train | Gets the specified HDInsight cluster. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5080,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-sns/lib/aws-sdk-sns/topic.rb | Aws::SNS.Topic.add_permission | def add_permission(options = {})
options = options.merge(topic_arn: @arn)
resp = @client.add_permission(options)
resp.data
end | ruby | def add_permission(options = {})
options = options.merge(topic_arn: @arn)
resp = @client.add_permission(options)
resp.data
end | [
"def",
"add_permission",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"topic_arn",
":",
"@arn",
")",
"resp",
"=",
"@client",
".",
"add_permission",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
topic.add_permission({
label: "label", # required
aws_account_id: ["delegate"], # required
action_name: ["action"], # required
})
@param [Hash] options ({})
@option options [required, String] :label
A unique identifier for the new policy statement.
@option options [required, Array<String>] :aws_account_id
The AWS account IDs of the users (principals) who will be given access
to the specified actions. The users must have AWS accounts, but do not
need to be signed up for this service.
@option options [required, Array<String>] :action_name
The action you want to allow for the specified principal(s).
Valid values: any Amazon SNS action name.
@return [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-sns/lib/aws-sdk-sns/topic.rb#L121-L125 | train | Add a permission to a topic | [
30522,
13366,
5587,
1035,
6656,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
8476,
1035,
12098,
2078,
1024,
1030,
12098,
2078,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
5587,
1035,
6656,
1006,
7047,
1007,
24501,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/api/labor_api.rb | SquareConnect.LaborApi.create_break_type | def create_break_type(body, opts = {})
data, _status_code, _headers = create_break_type_with_http_info(body, opts)
return data
end | ruby | def create_break_type(body, opts = {})
data, _status_code, _headers = create_break_type_with_http_info(body, opts)
return data
end | [
"def",
"create_break_type",
"(",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"create_break_type_with_http_info",
"(",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | CreateBreakType
Creates a new `BreakType`. A `BreakType` is a template for creating `Break` objects. You must provide the following values in your request to this endpoint: - `location_id` - `break_name` - `expected_duration` - `is_paid` You can only have 3 `BreakType` instances per location. If you attempt to add a 4th `BreakType` for a location, an `INVALID_REQUEST_ERROR` \"Exceeded limit of 3 breaks per location.\" is returned.
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [CreateBreakTypeResponse] | [
"CreateBreakType",
"Creates",
"a",
"new",
"BreakType",
".",
"A",
"BreakType",
"is",
"a",
"template",
"for",
"creating",
"Break",
"objects",
".",
"You",
"must",
"provide",
"the",
"following",
"values",
"in",
"your",
"request",
"to",
"this",
"endpoint",
":",
"... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/labor_api.rb#L25-L28 | train | Creates a break type | [
30522,
13366,
3443,
1035,
3338,
1035,
2828,
1006,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
3443,
1035,
3338,
1035,
2828,
1035,
2007,
1035,
8299,
1035,
18558,
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... |
rails/rails | activerecord/lib/active_record/migration.rb | ActiveRecord.Migration.run | def run(*migration_classes)
opts = migration_classes.extract_options!
dir = opts[:direction] || :up
dir = (dir == :down ? :up : :down) if opts[:revert]
if reverting?
# If in revert and going :up, say, we want to execute :down without reverting, so
revert { run(*migration_classes, direction: dir, revert: true) }
else
migration_classes.each do |migration_class|
migration_class.new.exec_migration(connection, dir)
end
end
end | ruby | def run(*migration_classes)
opts = migration_classes.extract_options!
dir = opts[:direction] || :up
dir = (dir == :down ? :up : :down) if opts[:revert]
if reverting?
# If in revert and going :up, say, we want to execute :down without reverting, so
revert { run(*migration_classes, direction: dir, revert: true) }
else
migration_classes.each do |migration_class|
migration_class.new.exec_migration(connection, dir)
end
end
end | [
"def",
"run",
"(",
"*",
"migration_classes",
")",
"opts",
"=",
"migration_classes",
".",
"extract_options!",
"dir",
"=",
"opts",
"[",
":direction",
"]",
"||",
":up",
"dir",
"=",
"(",
"dir",
"==",
":down",
"?",
":up",
":",
":down",
")",
"if",
"opts",
"[... | Runs the given migration classes.
Last argument can specify options:
- :direction (default is :up)
- :revert (default is false) | [
"Runs",
"the",
"given",
"migration",
"classes",
".",
"Last",
"argument",
"can",
"specify",
"options",
":",
"-",
":",
"direction",
"(",
"default",
"is",
":",
"up",
")",
"-",
":",
"revert",
"(",
"default",
"is",
"false",
")"
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/migration.rb#L766-L778 | train | Run all the migrations in the given migration classes. | [
30522,
13366,
2448,
1006,
1008,
9230,
1035,
4280,
1007,
23569,
2015,
1027,
9230,
1035,
4280,
1012,
14817,
1035,
7047,
999,
16101,
1027,
23569,
2015,
1031,
30524,
1024,
2091,
1007,
2065,
23569,
2015,
1031,
1024,
7065,
8743,
1033,
2065,
7065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
opal/opal | lib/opal/compiler.rb | Opal.Compiler.unique_temp | def unique_temp(name)
name = name.to_s
if name && !name.empty?
name = name
.to_s
.gsub('<=>', '$lt_eq_gt')
.gsub('===', '$eq_eq_eq')
.gsub('==', '$eq_eq')
.gsub('=~', '$eq_tilde')
.gsub('!~', '$excl_tilde')
.gsub('!=', '$not_eq')
.gsub('<=', '$lt_eq')
.gsub('>=', '$gt_eq')
.gsub('=', '$eq')
.gsub('?', '$ques')
.gsub('!', '$excl')
.gsub('/', '$slash')
.gsub('%', '$percent')
.gsub('+', '$plus')
.gsub('-', '$minus')
.gsub('<', '$lt')
.gsub('>', '$gt')
.gsub(/[^\w\$]/, '$')
end
unique = (@unique += 1)
"#{'$' unless name.start_with?('$')}#{name}$#{unique}"
end | ruby | def unique_temp(name)
name = name.to_s
if name && !name.empty?
name = name
.to_s
.gsub('<=>', '$lt_eq_gt')
.gsub('===', '$eq_eq_eq')
.gsub('==', '$eq_eq')
.gsub('=~', '$eq_tilde')
.gsub('!~', '$excl_tilde')
.gsub('!=', '$not_eq')
.gsub('<=', '$lt_eq')
.gsub('>=', '$gt_eq')
.gsub('=', '$eq')
.gsub('?', '$ques')
.gsub('!', '$excl')
.gsub('/', '$slash')
.gsub('%', '$percent')
.gsub('+', '$plus')
.gsub('-', '$minus')
.gsub('<', '$lt')
.gsub('>', '$gt')
.gsub(/[^\w\$]/, '$')
end
unique = (@unique += 1)
"#{'$' unless name.start_with?('$')}#{name}$#{unique}"
end | [
"def",
"unique_temp",
"(",
"name",
")",
"name",
"=",
"name",
".",
"to_s",
"if",
"name",
"&&",
"!",
"name",
".",
"empty?",
"name",
"=",
"name",
".",
"to_s",
".",
"gsub",
"(",
"'<=>'",
",",
"'$lt_eq_gt'",
")",
".",
"gsub",
"(",
"'==='",
",",
"'$eq_eq... | Used to generate a unique id name per file. These are used
mainly to name method bodies for methods that use blocks. | [
"Used",
"to",
"generate",
"a",
"unique",
"id",
"name",
"per",
"file",
".",
"These",
"are",
"used",
"mainly",
"to",
"name",
"method",
"bodies",
"for",
"methods",
"that",
"use",
"blocks",
"."
] | 41aedc0fd62aab00d3c117ba0caf00206bedd981 | https://github.com/opal/opal/blob/41aedc0fd62aab00d3c117ba0caf00206bedd981/lib/opal/compiler.rb#L270-L296 | train | Returns a unique temp name | [
30522,
13366,
4310,
1035,
8915,
8737,
1006,
2171,
1007,
2171,
1027,
2171,
1012,
2000,
1035,
1055,
2065,
2171,
1004,
1004,
999,
2171,
1012,
4064,
1029,
2171,
1027,
2171,
1012,
2000,
1035,
1055,
1012,
28177,
12083,
1006,
1005,
1026,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.update_storage_account | def update_storage_account(resource_group_name, account_name, storage_account_name, parameters, custom_headers:nil)
response = update_storage_account_async(resource_group_name, account_name, storage_account_name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def update_storage_account(resource_group_name, account_name, storage_account_name, parameters, custom_headers:nil)
response = update_storage_account_async(resource_group_name, account_name, storage_account_name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"update_storage_account",
"(",
"resource_group_name",
",",
"account_name",
",",
"storage_account_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_storage_account_async",
"(",
"resource_group_name",
",",
"account_name",
",",... | Updates the Data Lake Analytics account to replace Azure Storage blob account
details, such as the access key and/or suffix.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Analytics account.
@param account_name [String] The name of the Data Lake Analytics account to
modify storage accounts in
@param storage_account_name [String] The Azure Storage account to modify
@param parameters [AddStorageAccountParameters] The parameters containing the
access key and suffix to update the storage account with.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Updates",
"the",
"Data",
"Lake",
"Analytics",
"account",
"to",
"replace",
"Azure",
"Storage",
"blob",
"account",
"details",
"such",
"as",
"the",
"access",
"key",
"and",
"/",
"or",
"suffix",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L244-L247 | train | Updates the specified storage account. | [
30522,
13366,
10651,
1035,
5527,
1035,
4070,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
5527,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb | Azure::Compute::Mgmt::V2017_12_01.VirtualMachineScaleSetVMs.deallocate | def deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
response = deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def deallocate(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
response = deallocate_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"deallocate",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"instance_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"deallocate_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"instance_id",
",",
"custom_headers",
... | Deallocates a specific virtual machine in a VM scale set. Shuts down the
virtual machine and releases the compute resources it uses. You are not
billed for the compute resources of this virtual machine once it is
deallocated.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param instance_id [String] The instance ID of the virtual machine.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusResponse] operation results. | [
"Deallocates",
"a",
"specific",
"virtual",
"machine",
"in",
"a",
"VM",
"scale",
"set",
".",
"Shuts",
"down",
"the",
"virtual",
"machine",
"and",
"releases",
"the",
"compute",
"resources",
"it",
"uses",
".",
"You",
"are",
"not",
"billed",
"for",
"the",
"com... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb#L128-L131 | train | Deallocate a virtual machine from a VM scale set. | [
30522,
13366,
3066,
4135,
16280,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
6013,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3066,
4135,
16280,
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/lib/decidim/component_manifest.rb | Decidim.ComponentManifest.run_hooks | def run_hooks(event_name, context = nil)
return unless hooks[event_name]
hooks[event_name.to_sym].each do |hook|
hook.call(context)
end
end | ruby | def run_hooks(event_name, context = nil)
return unless hooks[event_name]
hooks[event_name.to_sym].each do |hook|
hook.call(context)
end
end | [
"def",
"run_hooks",
"(",
"event_name",
",",
"context",
"=",
"nil",
")",
"return",
"unless",
"hooks",
"[",
"event_name",
"]",
"hooks",
"[",
"event_name",
".",
"to_sym",
"]",
".",
"each",
"do",
"|",
"hook",
"|",
"hook",
".",
"call",
"(",
"context",
")",
... | Public: Runs all the hooks associated with this manifest and a particular
event.
event_name - A String or Symbol with the event name.
context - An optional context that will be provided to the block as a
parameter. Usually the subject of the hook.
Returns nothing. | [
"Public",
":",
"Runs",
"all",
"the",
"hooks",
"associated",
"with",
"this",
"manifest",
"and",
"a",
"particular",
"event",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/component_manifest.rb#L84-L89 | train | Run all hooks for the given event_name | [
30522,
13366,
2448,
1035,
18008,
1006,
2724,
1035,
2171,
1010,
6123,
1027,
9152,
2140,
1007,
2709,
4983,
18008,
1031,
2724,
1035,
2171,
1033,
18008,
1031,
2724,
1035,
2171,
1012,
2000,
1035,
25353,
2213,
1033,
1012,
2169,
2079,
1064,
8103,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dry-rb/dry-initializer | lib/dry/initializer/dsl.rb | Dry::Initializer.DSL.define | def define(procedure = nil, &block)
config = Config.new(null: null)
config.instance_exec(&(procedure || block))
config.mixin.include Mixin::Root
config.mixin
end | ruby | def define(procedure = nil, &block)
config = Config.new(null: null)
config.instance_exec(&(procedure || block))
config.mixin.include Mixin::Root
config.mixin
end | [
"def",
"define",
"(",
"procedure",
"=",
"nil",
",",
"&",
"block",
")",
"config",
"=",
"Config",
".",
"new",
"(",
"null",
":",
"null",
")",
"config",
".",
"instance_exec",
"(",
"(",
"procedure",
"||",
"block",
")",
")",
"config",
".",
"mixin",
".",
... | Returns mixin module to be included to target class by hand
@return [Module]
@yield proc defining params and options | [
"Returns",
"mixin",
"module",
"to",
"be",
"included",
"to",
"target",
"class",
"by",
"hand"
] | 422d331468602ff0d3543fbb336b784343e5cc31 | https://github.com/dry-rb/dry-initializer/blob/422d331468602ff0d3543fbb336b784343e5cc31/lib/dry/initializer/dsl.rb#L24-L29 | train | Define a new mixin | [
30522,
13366,
9375,
1006,
7709,
1027,
9152,
2140,
1010,
1004,
3796,
1007,
9530,
8873,
2290,
1027,
9530,
8873,
2290,
1012,
2047,
1006,
19701,
1024,
19701,
1007,
9530,
8873,
2290,
1012,
6013,
1035,
4654,
8586,
1006,
1004,
1006,
7709,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-12-01/generated/azure_mgmt_network/p2s_vpn_gateways.rb | Azure::Network::Mgmt::V2018_12_01.P2sVpnGateways.begin_generate_vpn_profile_with_http_info | def begin_generate_vpn_profile_with_http_info(resource_group_name, gateway_name, parameters, custom_headers:nil)
begin_generate_vpn_profile_async(resource_group_name, gateway_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_generate_vpn_profile_with_http_info(resource_group_name, gateway_name, parameters, custom_headers:nil)
begin_generate_vpn_profile_async(resource_group_name, gateway_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_generate_vpn_profile_with_http_info",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_generate_vpn_profile_async",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"parameters",
",",
"cust... | Generates VPN profile for P2S client of the P2SVpnGateway in the specified
resource group.
@param resource_group_name [String] The name of the resource group.
@param gateway_name [String] The name of the P2SVpnGateway.
@param parameters [P2SVpnProfileParameters] Parameters supplied to the
generate P2SVpnGateway VPN client package 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. | [
"Generates",
"VPN",
"profile",
"for",
"P2S",
"client",
"of",
"the",
"P2SVpnGateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-12-01/generated/azure_mgmt_network/p2s_vpn_gateways.rb#L834-L836 | train | Generates a VPN profile for the specified virtual wan gateway. | [
30522,
13366,
4088,
1035,
9699,
1035,
21210,
2078,
1035,
6337,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11909,
1035,
2171,
1010,
11709,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/p2s_vpn_server_configurations.rb | Azure::Network::Mgmt::V2019_02_01.P2sVpnServerConfigurations.list_by_virtual_wan | def list_by_virtual_wan(resource_group_name, virtual_wan_name, custom_headers:nil)
first_page = list_by_virtual_wan_as_lazy(resource_group_name, virtual_wan_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_virtual_wan(resource_group_name, virtual_wan_name, custom_headers:nil)
first_page = list_by_virtual_wan_as_lazy(resource_group_name, virtual_wan_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_virtual_wan",
"(",
"resource_group_name",
",",
"virtual_wan_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_virtual_wan_as_lazy",
"(",
"resource_group_name",
",",
"virtual_wan_name",
",",
"custom_headers",
":custom_headers",
")",
... | Retrieves all P2SVpnServerConfigurations for a particular VirtualWan.
@param resource_group_name [String] The resource group name of the
VirtualWan.
@param virtual_wan_name [String] The name of the VirtualWan.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<P2SVpnServerConfiguration>] operation results. | [
"Retrieves",
"all",
"P2SVpnServerConfigurations",
"for",
"a",
"particular",
"VirtualWan",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/p2s_vpn_server_configurations.rb#L234-L237 | train | Gets all the segmentation features of a virtual wan. | [
30522,
13366,
2862,
1035,
2011,
1035,
7484,
1035,
14071,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
14071,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2011,
1035,
7484,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_skus_as_lazy | def list_multi_role_pool_skus_as_lazy(resource_group_name, name, custom_headers:nil)
response = list_multi_role_pool_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_pool_skus_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_multi_role_pool_skus_as_lazy(resource_group_name, name, custom_headers:nil)
response = list_multi_role_pool_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_pool_skus_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_multi_role_pool_skus_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_multi_role_pool_skus_async",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Get available SKUs for scaling a multi-role pool.
Get available SKUs for scaling a multi-role pool.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SkuInfoCollection] which provide lazy access to pages of the
response. | [
"Get",
"available",
"SKUs",
"for",
"scaling",
"a",
"multi",
"-",
"role",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L7696-L7705 | train | Gets the list of all the skus in a multi - role pool. | [
30522,
13366,
2862,
1035,
4800,
1035,
2535,
1035,
4770,
1035,
15315,
2271,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
4800,
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... |
hashicorp/vagrant | lib/vagrant/environment.rb | Vagrant.Environment.root_path | def root_path
return @root_path if defined?(@root_path)
root_finder = lambda do |path|
# Note: To remain compatible with Ruby 1.8, we have to use
# a `find` here instead of an `each`.
vf = find_vagrantfile(path, @vagrantfile_name)
return path if vf
return nil if path.root? || !File.exist?(path)
root_finder.call(path.parent)
end
@root_path = root_finder.call(cwd)
end | ruby | def root_path
return @root_path if defined?(@root_path)
root_finder = lambda do |path|
# Note: To remain compatible with Ruby 1.8, we have to use
# a `find` here instead of an `each`.
vf = find_vagrantfile(path, @vagrantfile_name)
return path if vf
return nil if path.root? || !File.exist?(path)
root_finder.call(path.parent)
end
@root_path = root_finder.call(cwd)
end | [
"def",
"root_path",
"return",
"@root_path",
"if",
"defined?",
"(",
"@root_path",
")",
"root_finder",
"=",
"lambda",
"do",
"|",
"path",
"|",
"# Note: To remain compatible with Ruby 1.8, we have to use",
"# a `find` here instead of an `each`.",
"vf",
"=",
"find_vagrantfile",
... | The root path is the path where the top-most (loaded last)
Vagrantfile resides. It can be considered the project root for
this environment.
@return [String] | [
"The",
"root",
"path",
"is",
"the",
"path",
"where",
"the",
"top",
"-",
"most",
"(",
"loaded",
"last",
")",
"Vagrantfile",
"resides",
".",
"It",
"can",
"be",
"considered",
"the",
"project",
"root",
"for",
"this",
"environment",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/environment.rb#L752-L765 | train | Returns the root path of the current directory. | [
30522,
13366,
7117,
1035,
4130,
2709,
1030,
7117,
1035,
4130,
2065,
4225,
1029,
1006,
1030,
7117,
1035,
4130,
1007,
7117,
1035,
2424,
2121,
1027,
23375,
2079,
1064,
4130,
1064,
1001,
3602,
1024,
2000,
3961,
11892,
2007,
10090,
1015,
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... |
daddyz/phonelib | lib/phonelib/phone_analyzer.rb | Phonelib.PhoneAnalyzer.with_replaced_national_prefix | def with_replaced_national_prefix(phone, data)
return phone unless data[Core::NATIONAL_PREFIX_TRANSFORM_RULE]
pattern = cr("^(?:#{data[Core::NATIONAL_PREFIX_FOR_PARSING]})")
match = phone.match pattern
if match && match.captures.compact.size > 0
phone.gsub(pattern, data[Core::NATIONAL_PREFIX_TRANSFORM_RULE])
else
phone
end
end | ruby | def with_replaced_national_prefix(phone, data)
return phone unless data[Core::NATIONAL_PREFIX_TRANSFORM_RULE]
pattern = cr("^(?:#{data[Core::NATIONAL_PREFIX_FOR_PARSING]})")
match = phone.match pattern
if match && match.captures.compact.size > 0
phone.gsub(pattern, data[Core::NATIONAL_PREFIX_TRANSFORM_RULE])
else
phone
end
end | [
"def",
"with_replaced_national_prefix",
"(",
"phone",
",",
"data",
")",
"return",
"phone",
"unless",
"data",
"[",
"Core",
"::",
"NATIONAL_PREFIX_TRANSFORM_RULE",
"]",
"pattern",
"=",
"cr",
"(",
"\"^(?:#{data[Core::NATIONAL_PREFIX_FOR_PARSING]})\"",
")",
"match",
"=",
... | replacing national prefix to simplified format | [
"replacing",
"national",
"prefix",
"to",
"simplified",
"format"
] | aa0023eab7c896b71275bf342bc7f49735cbdbbf | https://github.com/daddyz/phonelib/blob/aa0023eab7c896b71275bf342bc7f49735cbdbbf/lib/phonelib/phone_analyzer.rb#L50-L59 | train | Replace the national prefix with the original National Prefix. | [
30522,
13366,
2007,
1035,
2999,
1035,
2120,
1035,
17576,
1006,
3042,
1010,
2951,
1007,
2709,
3042,
4983,
2951,
1031,
4563,
1024,
1024,
2120,
1035,
17576,
1035,
10938,
1035,
3627,
1033,
5418,
1027,
13675,
1006,
1000,
1034,
1006,
1029,
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... |
square/connect-ruby-sdk | lib/square_connect/api/v1_employees_api.rb | SquareConnect.V1EmployeesApi.retrieve_timecard | def retrieve_timecard(timecard_id, opts = {})
data, _status_code, _headers = retrieve_timecard_with_http_info(timecard_id, opts)
return data
end | ruby | def retrieve_timecard(timecard_id, opts = {})
data, _status_code, _headers = retrieve_timecard_with_http_info(timecard_id, opts)
return data
end | [
"def",
"retrieve_timecard",
"(",
"timecard_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"retrieve_timecard_with_http_info",
"(",
"timecard_id",
",",
"opts",
")",
"return",
"data",
"end"
] | RetrieveTimecard
Provides the details for a single timecard. <aside> Only approved accounts can manage their employees with Square. Unapproved accounts cannot use employee management features with the API. </aside>
@param timecard_id The timecard's ID.
@param [Hash] opts the optional parameters
@return [V1Timecard] | [
"RetrieveTimecard",
"Provides",
"the",
"details",
"for",
"a",
"single",
"timecard",
".",
"<aside",
">",
"Only",
"approved",
"accounts",
"can",
"manage",
"their",
"employees",
"with",
"Square",
".",
"Unapproved",
"accounts",
"cannot",
"use",
"employee",
"management... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_employees_api.rb#L770-L773 | train | Retrieve a timecard Returns a timecard object | [
30522,
13366,
12850,
1035,
2051,
11522,
1006,
2051,
11522,
1035,
8909,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
12850,
1035,
2051,
11522,
1035,
2007,
1035,
8299,
1035,
185... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_authorization/lib/2018-09-01-preview/generated/azure_mgmt_authorization/role_assignments.rb | Azure::Authorization::Mgmt::V2018_09_01_preview.RoleAssignments.delete_by_id | def delete_by_id(role_id, custom_headers:nil)
response = delete_by_id_async(role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_by_id(role_id, custom_headers:nil)
response = delete_by_id_async(role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_by_id",
"(",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_by_id_async",
"(",
"role_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
"nil?",
"end"
... | Deletes a role assignment.
@param role_id [String] The ID of the role assignment to delete.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RoleAssignment] operation results. | [
"Deletes",
"a",
"role",
"assignment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_authorization/lib/2018-09-01-preview/generated/azure_mgmt_authorization/role_assignments.rb#L573-L576 | train | Deletes a role by ID. | [
30522,
13366,
3972,
12870,
1035,
2011,
1035,
8909,
1006,
2535,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2011,
1035,
8909,
1035,
2004,
6038,
2278,
1006,
2535,
1035,
8909,
1010,
7661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tongueroo/jets | lib/jets/aws_services/stack_status.rb | Jets::AwsServices.StackStatus.lookup | def lookup(outputs, key)
out = outputs.find { |o| o.output_key == key }
out&.output_value
end | ruby | def lookup(outputs, key)
out = outputs.find { |o| o.output_key == key }
out&.output_value
end | [
"def",
"lookup",
"(",
"outputs",
",",
"key",
")",
"out",
"=",
"outputs",
".",
"find",
"{",
"|",
"o",
"|",
"o",
".",
"output_key",
"==",
"key",
"}",
"out",
"&.",
"output_value",
"end"
] | Lookup output value.
Used in Jets::Resource::ApiGateway::RestApi::* andJets::Commands::Url | [
"Lookup",
"output",
"value",
".",
"Used",
"in",
"Jets",
"::",
"Resource",
"::",
"ApiGateway",
"::",
"RestApi",
"::",
"*",
"andJets",
"::",
"Commands",
"::",
"Url"
] | 46943a519224067e58aa3e2d5656e3ca083150f9 | https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/aws_services/stack_status.rb#L54-L57 | train | Lookup the output value for a given output key | [
30522,
13366,
2298,
6279,
1006,
27852,
1010,
3145,
1007,
2041,
1027,
27852,
1012,
2424,
1063,
1064,
1051,
1064,
1051,
1012,
6434,
1035,
3145,
1027,
1027,
3145,
1065,
2041,
1004,
1012,
6434,
1035,
3643,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/resource_health_metadata_operations.rb | Azure::Web::Mgmt::V2018_02_01.ResourceHealthMetadataOperations.list_by_site_as_lazy | def list_by_site_as_lazy(resource_group_name, name, custom_headers:nil)
response = list_by_site_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_site_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_site_as_lazy(resource_group_name, name, custom_headers:nil)
response = list_by_site_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_site_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_site_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_site_async",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"unless",
"r... | Gets the category of ResourceHealthMetadata to use for the given site as a
collection
Gets the category of ResourceHealthMetadata to use for the given site as a
collection
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of web app.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ResourceHealthMetadataCollection] which provide lazy access to pages
of the response. | [
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
"as",
"a",
"collection"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/resource_health_metadata_operations.rb#L1120-L1129 | train | Gets the list of all the available CDN policies. | [
30522,
13366,
2862,
1035,
2011,
1035,
2609,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
2609,
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... |
tongueroo/jets | lib/jets/resource/iam/policy_document.rb | Jets::Resource::Iam.PolicyDocument.standardize | def standardize(definition)
case definition
when String
# Expands simple string from: logs => logs:*
definition = "#{definition}:*" unless definition.include?(':')
@policy[:statement] << {
action: [definition],
effect: "Allow",
resource: "*",
}
when Hash
definition = definition.stringify_keys
if definition.key?("Version") # special case where we replace the policy entirely
@policy = definition
else
@policy[:statement] << definition
end
end
end | ruby | def standardize(definition)
case definition
when String
# Expands simple string from: logs => logs:*
definition = "#{definition}:*" unless definition.include?(':')
@policy[:statement] << {
action: [definition],
effect: "Allow",
resource: "*",
}
when Hash
definition = definition.stringify_keys
if definition.key?("Version") # special case where we replace the policy entirely
@policy = definition
else
@policy[:statement] << definition
end
end
end | [
"def",
"standardize",
"(",
"definition",
")",
"case",
"definition",
"when",
"String",
"# Expands simple string from: logs => logs:*",
"definition",
"=",
"\"#{definition}:*\"",
"unless",
"definition",
".",
"include?",
"(",
"':'",
")",
"@policy",
"[",
":statement",
"]",
... | only process policy_document once | [
"only",
"process",
"policy_document",
"once"
] | 46943a519224067e58aa3e2d5656e3ca083150f9 | https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/resource/iam/policy_document.rb#L21-L39 | train | Standardizes the given definition | [
30522,
13366,
3115,
4697,
1006,
6210,
1007,
2553,
6210,
2043,
5164,
1001,
24545,
3722,
5164,
2013,
1024,
15664,
1027,
1028,
15664,
1024,
1008,
6210,
1027,
1000,
1001,
1063,
6210,
1065,
1024,
1008,
1000,
4983,
6210,
1012,
2421,
1029,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/network_interface_association.rb | Aws::EC2.NetworkInterfaceAssociation.delete | def delete(options = {})
options = options.merge(association_id: @id)
resp = @client.disassociate_address(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(association_id: @id)
resp = @client.disassociate_address(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"association_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"disassociate_address",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
network_interface_association.delete({
public_ip: "String",
dry_run: false,
})
@param [Hash] options ({})
@option options [String] :public_ip
\[EC2-Classic\] The Elastic IP address. Required for EC2-Classic.
@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 [EmptyStructure] | [
"@!group",
"Actions",
"@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_interface_association.rb#L202-L206 | train | Delete an association | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2523,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
4487,
20939,
6499,
7405,
2618,
1035,
4769,
1006,
7047,
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/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.list_by_resource_group_next | def list_by_resource_group_next(next_page_link, custom_headers:nil)
response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_resource_group_next(next_page_link, custom_headers:nil)
response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_resource_group_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_resource_group_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unle... | Get certificate orders in a resource group.
Get certificate orders in a resource group.
@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 [AppServiceCertificateOrderCollection] operation results. | [
"Get",
"certificate",
"orders",
"in",
"a",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L2403-L2406 | train | Gets the list of all the elastic advisors in a resource group. | [
30522,
13366,
2862,
1035,
2011,
1035,
7692,
1035,
2177,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
7692,
1035,
2177,
1035,
2279,
1035,
2004,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/pdk | lib/pdk/template_file.rb | PDK.TemplateFile.render_erb | def render_erb
renderer = ERB.new(template_content, nil, '-')
renderer.filename = @template_file
renderer.result(binding)
end | ruby | def render_erb
renderer = ERB.new(template_content, nil, '-')
renderer.filename = @template_file
renderer.result(binding)
end | [
"def",
"render_erb",
"renderer",
"=",
"ERB",
".",
"new",
"(",
"template_content",
",",
"nil",
",",
"'-'",
")",
"renderer",
".",
"filename",
"=",
"@template_file",
"renderer",
".",
"result",
"(",
"binding",
")",
"end"
] | Renders the content of the template file as an ERB template.
@return [String] The rendered template.
@raise (see #template_content)
@api private | [
"Renders",
"the",
"content",
"of",
"the",
"template",
"file",
"as",
"an",
"ERB",
"template",
"."
] | 0d864aff62ffef04b5104addf399d0476afd71e7 | https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/template_file.rb#L78-L82 | train | Render the ERB template | [
30522,
13366,
17552,
1035,
9413,
2497,
17552,
2121,
1027,
9413,
2497,
1012,
2047,
1006,
23561,
1035,
4180,
1010,
9152,
2140,
1010,
1005,
1011,
1005,
1007,
17552,
2121,
1012,
5371,
18442,
1027,
1030,
23561,
1035,
5371,
17552,
2121,
1012,
276... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/vpc.rb | Aws::EC2.Vpc.attach_internet_gateway | def attach_internet_gateway(options = {})
options = options.merge(vpc_id: @id)
resp = @client.attach_internet_gateway(options)
resp.data
end | ruby | def attach_internet_gateway(options = {})
options = options.merge(vpc_id: @id)
resp = @client.attach_internet_gateway(options)
resp.data
end | [
"def",
"attach_internet_gateway",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"vpc_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"attach_internet_gateway",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
vpc.attach_internet_gateway({
dry_run: false,
internet_gateway_id: "String", # required
})
@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 [required, String] :internet_gateway_id
The ID of the internet gateway.
@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/vpc.rb#L332-L336 | train | Attach an internet gateway to this VPC | [
30522,
13366,
22476,
1035,
4274,
1035,
11909,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
21210,
2278,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
22476,
1035,
4274,
1035,
11909,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.get_site_detector_as_lazy | def get_site_detector_as_lazy(resource_group_name, site_name, diagnostic_category, detector_name, custom_headers:nil)
response = get_site_detector_async(resource_group_name, site_name, diagnostic_category, detector_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
get_site_detector_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def get_site_detector_as_lazy(resource_group_name, site_name, diagnostic_category, detector_name, custom_headers:nil)
response = get_site_detector_async(resource_group_name, site_name, diagnostic_category, detector_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
get_site_detector_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"get_site_detector_as_lazy",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_category",
",",
"detector_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_site_detector_async",
"(",
"resource_group_name",
",",
"site_name",
",",
"di... | Get Detector
Get Detector
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param diagnostic_category [String] Diagnostic Category
@param detector_name [String] Detector Name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DiagnosticDetectorCollection] which provide lazy access to pages of
the response. | [
"Get",
"Detector"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L3699-L3708 | train | Gets the detector for a site. | [
30522,
13366,
2131,
1035,
2609,
1035,
19034,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
19034,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/rich_text_run.rb | Axlsx.RichTextRun.autowidth | def autowidth(widtharray)
return if value.nil?
if styles.cellXfs[style].alignment && styles.cellXfs[style].alignment.wrap_text
first = true
value.to_s.split(/\r?\n/, -1).each do |line|
if first
first = false
else
widtharray << 0
end
widtharray[-1] += string_width(line, font_size)
end
else
widtharray[-1] += string_width(value.to_s, font_size)
end
widtharray
end | ruby | def autowidth(widtharray)
return if value.nil?
if styles.cellXfs[style].alignment && styles.cellXfs[style].alignment.wrap_text
first = true
value.to_s.split(/\r?\n/, -1).each do |line|
if first
first = false
else
widtharray << 0
end
widtharray[-1] += string_width(line, font_size)
end
else
widtharray[-1] += string_width(value.to_s, font_size)
end
widtharray
end | [
"def",
"autowidth",
"(",
"widtharray",
")",
"return",
"if",
"value",
".",
"nil?",
"if",
"styles",
".",
"cellXfs",
"[",
"style",
"]",
".",
"alignment",
"&&",
"styles",
".",
"cellXfs",
"[",
"style",
"]",
".",
"alignment",
".",
"wrap_text",
"first",
"=",
... | Tries to work out the width of the longest line in the run
@param [Array] widtharray this array is populated with the widths of each line in the run.
@return [Array] | [
"Tries",
"to",
"work",
"out",
"the",
"width",
"of",
"the",
"longest",
"line",
"in",
"the",
"run"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/rich_text_run.rb#L163-L179 | train | autowidth | [
30522,
13366,
8285,
9148,
11927,
2232,
1006,
9381,
2906,
9447,
1007,
2709,
2065,
3643,
1012,
9152,
2140,
1029,
2065,
6782,
1012,
3526,
2595,
10343,
1031,
2806,
1033,
1012,
12139,
1004,
1004,
6782,
1012,
3526,
2595,
10343,
1031,
2806,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/network_interface_tap_configurations.rb | Azure::Network::Mgmt::V2019_02_01.NetworkInterfaceTapConfigurations.delete | def delete(resource_group_name, network_interface_name, tap_configuration_name, custom_headers:nil)
response = delete_async(resource_group_name, network_interface_name, tap_configuration_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, network_interface_name, tap_configuration_name, custom_headers:nil)
response = delete_async(resource_group_name, network_interface_name, tap_configuration_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"tap_configuration_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"tap_configuration_name",
",... | Deletes the specified tap configuration from the NetworkInterface.
@param resource_group_name [String] The name of the resource group.
@param network_interface_name [String] The name of the network interface.
@param tap_configuration_name [String] The name of the tap configuration.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"tap",
"configuration",
"from",
"the",
"NetworkInterface",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/network_interface_tap_configurations.rb#L33-L36 | train | Deletes a network interface tap configuration. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
8278,
1035,
2171,
1010,
11112,
1035,
9563,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/inflector/methods.rb | ActiveSupport.Inflector.constantize | def constantize(camel_cased_word)
names = camel_cased_word.split("::")
# Trigger a built-in NameError exception including the ill-formed constant in the message.
Object.const_get(camel_cased_word) if names.empty?
# Remove the first blank element in case of '::ClassName' notation.
names.shift if names.size > 1 && names.first.empty?
names.inject(Object) do |constant, name|
if constant == Object
constant.const_get(name)
else
candidate = constant.const_get(name)
next candidate if constant.const_defined?(name, false)
next candidate unless Object.const_defined?(name)
# Go down the ancestors to check if it is owned directly. The check
# stops when we reach Object or the end of ancestors tree.
constant = constant.ancestors.inject(constant) do |const, ancestor|
break const if ancestor == Object
break ancestor if ancestor.const_defined?(name, false)
const
end
# owner is in Object, so raise
constant.const_get(name, false)
end
end
end | ruby | def constantize(camel_cased_word)
names = camel_cased_word.split("::")
# Trigger a built-in NameError exception including the ill-formed constant in the message.
Object.const_get(camel_cased_word) if names.empty?
# Remove the first blank element in case of '::ClassName' notation.
names.shift if names.size > 1 && names.first.empty?
names.inject(Object) do |constant, name|
if constant == Object
constant.const_get(name)
else
candidate = constant.const_get(name)
next candidate if constant.const_defined?(name, false)
next candidate unless Object.const_defined?(name)
# Go down the ancestors to check if it is owned directly. The check
# stops when we reach Object or the end of ancestors tree.
constant = constant.ancestors.inject(constant) do |const, ancestor|
break const if ancestor == Object
break ancestor if ancestor.const_defined?(name, false)
const
end
# owner is in Object, so raise
constant.const_get(name, false)
end
end
end | [
"def",
"constantize",
"(",
"camel_cased_word",
")",
"names",
"=",
"camel_cased_word",
".",
"split",
"(",
"\"::\"",
")",
"# Trigger a built-in NameError exception including the ill-formed constant in the message.",
"Object",
".",
"const_get",
"(",
"camel_cased_word",
")",
"if"... | Tries to find a constant with the name specified in the argument string.
constantize('Module') # => Module
constantize('Foo::Bar') # => Foo::Bar
The name is assumed to be the one of a top-level constant, no matter
whether it starts with "::" or not. No lexical context is taken into
account:
C = 'outside'
module M
C = 'inside'
C # => 'inside'
constantize('C') # => 'outside', same as ::C
end
NameError is raised when the name is not in CamelCase or the constant is
unknown. | [
"Tries",
"to",
"find",
"a",
"constant",
"with",
"the",
"name",
"specified",
"in",
"the",
"argument",
"string",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/inflector/methods.rb#L271-L300 | train | Return the constant for the given camel cased word. | [
30522,
13366,
5377,
4697,
1006,
19130,
1035,
2553,
2094,
1035,
2773,
1007,
3415,
1027,
19130,
1035,
2553,
2094,
1035,
2773,
1012,
3975,
1006,
1000,
1024,
1024,
1000,
1007,
1001,
9495,
1037,
2328,
1011,
1999,
2171,
2121,
29165,
6453,
2164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2017-03-30/generated/azure_mgmt_network/public_ipaddresses.rb | Azure::Network::Mgmt::V2017_03_30.PublicIPAddresses.list_virtual_machine_scale_set_vmpublic_ipaddresses_as_lazy | def list_virtual_machine_scale_set_vmpublic_ipaddresses_as_lazy(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers:nil)
response = list_virtual_machine_scale_set_vmpublic_ipaddresses_async(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_virtual_machine_scale_set_vmpublic_ipaddresses_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_virtual_machine_scale_set_vmpublic_ipaddresses_as_lazy(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers:nil)
response = list_virtual_machine_scale_set_vmpublic_ipaddresses_async(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, network_interface_name, ip_configuration_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_virtual_machine_scale_set_vmpublic_ipaddresses_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_virtual_machine_scale_set_vmpublic_ipaddresses_as_lazy",
"(",
"resource_group_name",
",",
"virtual_machine_scale_set_name",
",",
"virtualmachine_index",
",",
"network_interface_name",
",",
"ip_configuration_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"... | Gets information about all public IP addresses in a virtual machine IP
configuration in a virtual machine scale set.
@param resource_group_name [String] The name of the resource group.
@param virtual_machine_scale_set_name [String] The name of the virtual
machine scale set.
@param virtualmachine_index [String] The virtual machine index.
@param network_interface_name [String] The network interface name.
@param ip_configuration_name [String] The IP configuration name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PublicIPAddressListResult] which provide lazy access to pages of the
response. | [
"Gets",
"information",
"about",
"all",
"public",
"IP",
"addresses",
"in",
"a",
"virtual",
"machine",
"IP",
"configuration",
"in",
"a",
"virtual",
"machine",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2017-03-30/generated/azure_mgmt_network/public_ipaddresses.rb#L571-L580 | train | Gets a list of all public IP addresses in a virtual machine. | [
30522,
13366,
2862,
1035,
7484,
1035,
3698,
1035,
4094,
1035,
2275,
1035,
1058,
8737,
12083,
10415,
1035,
25249,
16200,
11393,
2015,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
3698,
1035,
4094,
1035,
2275... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/public_ipaddresses.rb | Azure::Network::Mgmt::V2018_07_01.PublicIPAddresses.begin_delete | def begin_delete(resource_group_name, public_ip_address_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, public_ip_address_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, public_ip_address_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, public_ip_address_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"public_ip_address_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"public_ip_address_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Deletes the specified public IP address.
@param resource_group_name [String] The name of the resource group.
@param public_ip_address_name [String] The name of the subnet.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"public",
"IP",
"address",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/public_ipaddresses.rb#L430-L433 | train | Deletes an existing public IP address. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2270,
1035,
12997,
1035,
4769,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slim-template/slim | lib/slim/parser.rb | Slim.Parser.call | def call(str)
result = [:multi]
reset(str.split(/\r?\n/), [result])
parse_line while next_line
reset
result
end | ruby | def call(str)
result = [:multi]
reset(str.split(/\r?\n/), [result])
parse_line while next_line
reset
result
end | [
"def",
"call",
"(",
"str",
")",
"result",
"=",
"[",
":multi",
"]",
"reset",
"(",
"str",
".",
"split",
"(",
"/",
"\\r",
"\\n",
"/",
")",
",",
"[",
"result",
"]",
")",
"parse_line",
"while",
"next_line",
"reset",
"result",
"end"
] | Compile string to Temple expression
@param [String] str Slim code
@return [Array] Temple expression representing the code | [
"Compile",
"string",
"to",
"Temple",
"expression"
] | ae8e7338fcfb67256d2f6b50c64fc317210e31a2 | https://github.com/slim-template/slim/blob/ae8e7338fcfb67256d2f6b50c64fc317210e31a2/lib/slim/parser.rb#L95-L103 | train | Parse the given string and return the result. | [
30522,
13366,
2655,
1006,
2358,
2099,
1007,
2765,
1027,
1031,
1024,
4800,
1033,
25141,
1006,
2358,
2099,
1012,
3975,
1006,
1013,
1032,
1054,
1029,
1032,
1050,
1013,
1007,
1010,
1031,
2765,
1033,
1007,
11968,
3366,
1035,
2240,
2096,
2279,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.update_key | def update_key(vault_base_url, key_name, key_version, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil)
response = update_key_async(vault_base_url, key_name, key_version, key_ops:key_ops, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_key(vault_base_url, key_name, key_version, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil)
response = update_key_async(vault_base_url, key_name, key_version, key_ops:key_ops, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_key",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"key_ops",
":",
"nil",
",",
"key_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_key_async",
"(",
"vault_... | The update key operation changes specified attributes of a stored key and can
be applied to any key type and key version stored in Azure Key Vault.
In order to perform this operation, the key must already exist in the Key
Vault. Note: The cryptographic material of a key itself cannot be changed.
This operation requires the keys/update permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param key_name [String] The name of key to update.
@param key_version [String] The version of the key to update.
@param key_ops [Array<JsonWebKeyOperation>] Json web key operations. For more
information on possible key operations, see JsonWebKeyOperation.
@param key_attributes [KeyAttributes]
@param tags [Hash{String => String}] Application specific metadata in the
form of key-value pairs.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [KeyBundle] operation results. | [
"The",
"update",
"key",
"operation",
"changes",
"specified",
"attributes",
"of",
"a",
"stored",
"key",
"and",
"can",
"be",
"applied",
"to",
"any",
"key",
"type",
"and",
"key",
"version",
"stored",
"in",
"Azure",
"Key",
"Vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L559-L562 | train | Updates a key in a key vault. | [
30522,
13366,
10651,
1035,
3145,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
3145,
1035,
2544,
1010,
3145,
1035,
23092,
30524,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
314... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/machine_learning_compute.rb | Azure::MachineLearningServices::Mgmt::V2018_03_01_preview.MachineLearningCompute.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, workspace_name, compute_name, custom_headers:nil)
begin_delete_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, workspace_name, compute_name, custom_headers:nil)
begin_delete_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"compute_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"compute_name",
",",
"custom_headers",
":cus... | Deletes specified Machine Learning compute.
@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 compute_name [String] Name of the Azure Machine Learning compute.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"specified",
"Machine",
"Learning",
"compute",
"."
] | 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/machine_learning_compute.rb#L620-L622 | train | Deletes a compute. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2573,
15327,
1035,
2171,
1010,
24134,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
3972,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/session.rb | Mongo.Session.validate_read_preference! | def validate_read_preference!(command)
return unless in_transaction? && non_primary_read_preference_mode?(command)
raise Mongo::Error::InvalidTransactionOperation.new(
Mongo::Error::InvalidTransactionOperation::INVALID_READ_PREFERENCE)
end | ruby | def validate_read_preference!(command)
return unless in_transaction? && non_primary_read_preference_mode?(command)
raise Mongo::Error::InvalidTransactionOperation.new(
Mongo::Error::InvalidTransactionOperation::INVALID_READ_PREFERENCE)
end | [
"def",
"validate_read_preference!",
"(",
"command",
")",
"return",
"unless",
"in_transaction?",
"&&",
"non_primary_read_preference_mode?",
"(",
"command",
")",
"raise",
"Mongo",
"::",
"Error",
"::",
"InvalidTransactionOperation",
".",
"new",
"(",
"Mongo",
"::",
"Error... | Ensure that the read preference of a command primary.
@example
session.validate_read_preference!(command)
@raise [ Mongo::Error::InvalidTransactionOperation ] If the read preference of the command is
not primary.
@since 2.6.0
@api private | [
"Ensure",
"that",
"the",
"read",
"preference",
"of",
"a",
"command",
"primary",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/session.rb#L351-L356 | train | Validate read preference mode | [
30522,
13366,
9398,
3686,
1035,
3191,
1035,
12157,
999,
1006,
3094,
1007,
2709,
4983,
1999,
1035,
12598,
1029,
1004,
1004,
2512,
1035,
3078,
1035,
3191,
1035,
12157,
1035,
5549,
1029,
1006,
3094,
1007,
5333,
12256,
3995,
1024,
1024,
7561,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | spec/spec_helper/project_helper.rb | SpecHelper.ProjectHelper.compare_settings | def compare_settings(produced, expected, params)
it 'should match build settings' do
# Find faulty settings in different categories
missing_settings = expected.keys.reject { |k| produced.key?(k) }
unexpected_settings = produced.keys.reject { |k| expected.key?(k) }
wrong_settings = (expected.keys - missing_settings).select do |k|
produced_setting = produced[k]
produced_setting = produced_setting.join(' ') if produced_setting.respond_to? :join
produced_setting != expected[k]
end
# Build pretty description for what is going on
description = []
description << "Doesn't match build settings for \e[1m#{params}\e[0m"
if wrong_settings.count > 0
description << 'Wrong build settings:'
description += wrong_settings.map { |s| "* #{s.to_s.yellow} is #{produced[s].to_s.red}, but should be #{expected[s].to_s.green}" }
description << ''
end
if missing_settings.count > 0
description << 'Missing build settings:'
description << missing_settings.map { |s| "* #{s.to_s.red} (#{expected[s]})" }
description << ''
end
if unexpected_settings.count > 0
description << 'Unexpected additional build settings:'
description += unexpected_settings.map { |s| "* #{s.to_s.green} (#{produced[s]})" }
description << ''
end
# Expect
faulty_settings = missing_settings + unexpected_settings + wrong_settings
faulty_settings.should.satisfy(description * "\n") do
faulty_settings.length == 0
end
end
end | ruby | def compare_settings(produced, expected, params)
it 'should match build settings' do
# Find faulty settings in different categories
missing_settings = expected.keys.reject { |k| produced.key?(k) }
unexpected_settings = produced.keys.reject { |k| expected.key?(k) }
wrong_settings = (expected.keys - missing_settings).select do |k|
produced_setting = produced[k]
produced_setting = produced_setting.join(' ') if produced_setting.respond_to? :join
produced_setting != expected[k]
end
# Build pretty description for what is going on
description = []
description << "Doesn't match build settings for \e[1m#{params}\e[0m"
if wrong_settings.count > 0
description << 'Wrong build settings:'
description += wrong_settings.map { |s| "* #{s.to_s.yellow} is #{produced[s].to_s.red}, but should be #{expected[s].to_s.green}" }
description << ''
end
if missing_settings.count > 0
description << 'Missing build settings:'
description << missing_settings.map { |s| "* #{s.to_s.red} (#{expected[s]})" }
description << ''
end
if unexpected_settings.count > 0
description << 'Unexpected additional build settings:'
description += unexpected_settings.map { |s| "* #{s.to_s.green} (#{produced[s]})" }
description << ''
end
# Expect
faulty_settings = missing_settings + unexpected_settings + wrong_settings
faulty_settings.should.satisfy(description * "\n") do
faulty_settings.length == 0
end
end
end | [
"def",
"compare_settings",
"(",
"produced",
",",
"expected",
",",
"params",
")",
"it",
"'should match build settings'",
"do",
"# Find faulty settings in different categories",
"missing_settings",
"=",
"expected",
".",
"keys",
".",
"reject",
"{",
"|",
"k",
"|",
"produc... | Generates test cases to compare two settings hashes.
@param [Hash{String => String}] produced
the produced build settings.
@param [Hash{String => String}] expected
the expected build settings.
@param [#to_s] params
the parameters used to construct the produced build settings. | [
"Generates",
"test",
"cases",
"to",
"compare",
"two",
"settings",
"hashes",
"."
] | 3be1684437a6f8e69c7836ad4c85a2b78663272f | https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/spec/spec_helper/project_helper.rb#L29-L68 | train | Compare build settings with the produced settings | [
30522,
13366,
12826,
1035,
10906,
1006,
2550,
1010,
3517,
1010,
11498,
5244,
1007,
2009,
1005,
2323,
2674,
3857,
10906,
1005,
2079,
1001,
2424,
28927,
10906,
1999,
2367,
7236,
4394,
1035,
10906,
1027,
3517,
1012,
6309,
1012,
15454,
1063,
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... |
middleman/middleman | middleman-cli/lib/middleman-cli/server.rb | Middleman::Cli.Server.server | def server
require 'middleman-core'
require 'middleman-core/preview_server'
unless ENV['MM_ROOT']
puts '== Could not find a Middleman project config.rb'
exit
end
params = {
debug: options['verbose'],
instrumenting: options['instrument'],
reload_paths: options['reload_paths'],
daemon: options['daemon']
}
puts '== The Middleman is loading'
::Middleman::PreviewServer.start(params, options)
end | ruby | def server
require 'middleman-core'
require 'middleman-core/preview_server'
unless ENV['MM_ROOT']
puts '== Could not find a Middleman project config.rb'
exit
end
params = {
debug: options['verbose'],
instrumenting: options['instrument'],
reload_paths: options['reload_paths'],
daemon: options['daemon']
}
puts '== The Middleman is loading'
::Middleman::PreviewServer.start(params, options)
end | [
"def",
"server",
"require",
"'middleman-core'",
"require",
"'middleman-core/preview_server'",
"unless",
"ENV",
"[",
"'MM_ROOT'",
"]",
"puts",
"'== Could not find a Middleman project config.rb'",
"exit",
"end",
"params",
"=",
"{",
"debug",
":",
"options",
"[",
"'verbose'",... | Start the server | [
"Start",
"the",
"server"
] | a0dd9f78094813162895511e8516e0c5507cee50 | https://github.com/middleman/middleman/blob/a0dd9f78094813162895511e8516e0c5507cee50/middleman-cli/lib/middleman-cli/server.rb#L36-L54 | train | Starts the preview server | [
30522,
13366,
8241,
5478,
1005,
2690,
2386,
1011,
4563,
1005,
5478,
1005,
2690,
2386,
1011,
4563,
1013,
19236,
1035,
8241,
1005,
4983,
4372,
2615,
1031,
1005,
3461,
1035,
7117,
1005,
1033,
8509,
1005,
1027,
1027,
2071,
2025,
2424,
1037,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb | Azure::CognitiveServices::ContentModerator::V1_0.Reviews.add_video_transcript_moderation_result_with_http_info | def add_video_transcript_moderation_result_with_http_info(content_type, team_name, review_id, transcript_moderation_body, custom_headers:nil)
add_video_transcript_moderation_result_async(content_type, team_name, review_id, transcript_moderation_body, custom_headers:custom_headers).value!
end | ruby | def add_video_transcript_moderation_result_with_http_info(content_type, team_name, review_id, transcript_moderation_body, custom_headers:nil)
add_video_transcript_moderation_result_async(content_type, team_name, review_id, transcript_moderation_body, custom_headers:custom_headers).value!
end | [
"def",
"add_video_transcript_moderation_result_with_http_info",
"(",
"content_type",
",",
"team_name",
",",
"review_id",
",",
"transcript_moderation_body",
",",
"custom_headers",
":",
"nil",
")",
"add_video_transcript_moderation_result_async",
"(",
"content_type",
",",
"team_na... | This API adds a transcript screen text result file for a video review.
Transcript screen text result file is a result of Screen Text API . In order
to generate transcript screen text result file , a transcript file has to be
screened for profanity using Screen Text API.
@param content_type [String] The content type.
@param team_name [String] Your team name.
@param review_id [String] Id of the review.
@param transcript_moderation_body [Array<TranscriptModerationBodyItem>] Body
for add video transcript moderation result API
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"This",
"API",
"adds",
"a",
"transcript",
"screen",
"text",
"result",
"file",
"for",
"a",
"video",
"review",
".",
"Transcript",
"screen",
"text",
"result",
"file",
"is",
"a",
"result",
"of",
"Screen",
"Text",
"API",
".",
"In",
"order",
"to",
"generate",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb#L1164-L1166 | train | Add a transcript moderation result to a video review. | [
30522,
13366,
5587,
1035,
2678,
1035,
24051,
1035,
5549,
8156,
1035,
2765,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
4180,
1035,
2828,
1010,
2136,
1035,
2171,
1010,
3319,
1035,
8909,
1010,
24051,
1035,
5549,
8156,
1035,
2303,
1010,
7661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | gym/lib/gym/runner.rb | Gym.Runner.move_apps_folder | def move_apps_folder
if Dir.exist?(PackageCommandGenerator.apps_path)
FileUtils.mv(PackageCommandGenerator.apps_path, File.expand_path(Gym.config[:output_directory]), force: true)
apps_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.apps_path))
UI.success("Successfully exported Apps folder:")
UI.message(apps_path)
apps_path
end
end | ruby | def move_apps_folder
if Dir.exist?(PackageCommandGenerator.apps_path)
FileUtils.mv(PackageCommandGenerator.apps_path, File.expand_path(Gym.config[:output_directory]), force: true)
apps_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.apps_path))
UI.success("Successfully exported Apps folder:")
UI.message(apps_path)
apps_path
end
end | [
"def",
"move_apps_folder",
"if",
"Dir",
".",
"exist?",
"(",
"PackageCommandGenerator",
".",
"apps_path",
")",
"FileUtils",
".",
"mv",
"(",
"PackageCommandGenerator",
".",
"apps_path",
",",
"File",
".",
"expand_path",
"(",
"Gym",
".",
"config",
"[",
":output_dire... | Move the Apps folder to the output directory | [
"Move",
"the",
"Apps",
"folder",
"to",
"the",
"output",
"directory"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/gym/lib/gym/runner.rb#L249-L258 | train | Move the Apps folder to the output directory | [
30522,
13366,
2693,
1035,
18726,
1035,
19622,
2065,
16101,
1012,
4839,
1029,
1006,
7427,
9006,
2386,
11818,
3678,
8844,
1012,
18726,
1035,
4130,
1007,
5371,
21823,
4877,
1012,
19842,
1006,
7427,
9006,
2386,
11818,
3678,
8844,
1012,
18726,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_network_gateways.rb | Azure::Network::Mgmt::V2018_07_01.VirtualNetworkGateways.set_vpnclient_ipsec_parameters | def set_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:nil)
response = set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def set_vpnclient_ipsec_parameters(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:nil)
response = set_vpnclient_ipsec_parameters_async(resource_group_name, virtual_network_gateway_name, vpnclient_ipsec_params, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"set_vpnclient_ipsec_parameters",
"(",
"resource_group_name",
",",
"virtual_network_gateway_name",
",",
"vpnclient_ipsec_params",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"set_vpnclient_ipsec_parameters_async",
"(",
"resource_group_name",
",",
"virtual_ne... | The Set VpnclientIpsecParameters operation sets the vpnclient ipsec policy
for P2S client of virtual network gateway in the specified resource group
through Network resource provider.
@param resource_group_name [String] The name of the resource group.
@param virtual_network_gateway_name [String] The name of the virtual network
gateway.
@param vpnclient_ipsec_params [VpnClientIPsecParameters] Parameters supplied
to the Begin Set vpnclient ipsec parameters of Virtual Network Gateway P2S
client operation through Network resource provider.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VpnClientIPsecParameters] operation results. | [
"The",
"Set",
"VpnclientIpsecParameters",
"operation",
"sets",
"the",
"vpnclient",
"ipsec",
"policy",
"for",
"P2S",
"client",
"of",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"through",
"Network",
"resource",
"provider",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_network_gateways.rb#L971-L974 | train | Set vpnclient ipsec parameters. | [
30522,
13366,
2275,
1035,
21210,
12273,
8751,
3372,
1035,
12997,
3366,
2278,
1035,
11709,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
2897,
1035,
11909,
1035,
2171,
1010,
21210,
12273,
8751,
3372,
1035,
12997,
3366,
2278,
30524,
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_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb | Azure::EventGrid::Mgmt::V2019_02_01_preview.Topics.begin_create_or_update | def begin_create_or_update(resource_group_name, topic_name, topic_info, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create_or_update(resource_group_name, topic_name, topic_info, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create_or_update",
"(",
"resource_group_name",
",",
"topic_name",
",",
"topic_info",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"topic_name",
",",
"topic_info",
",",
"custom_hea... | Create a topic
Asynchronously creates a new topic with the specified parameters.
@param resource_group_name [String] The name of the resource group within the
user's subscription.
@param topic_name [String] Name of the topic
@param topic_info [Topic] Topic information
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Topic] operation results. | [
"Create",
"a",
"topic"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb#L803-L806 | train | Creates or updates a topic. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8476,
1035,
2171,
1010,
8476,
1035,
18558,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3443,
1035,
2030,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Shopify/liquid | lib/liquid/context.rb | Liquid.Context.stack | def stack(new_scope = nil)
old_stack_used = @this_stack_used
if new_scope
push(new_scope)
@this_stack_used = true
else
@this_stack_used = false
end
yield
ensure
pop if @this_stack_used
@this_stack_used = old_stack_used
end | ruby | def stack(new_scope = nil)
old_stack_used = @this_stack_used
if new_scope
push(new_scope)
@this_stack_used = true
else
@this_stack_used = false
end
yield
ensure
pop if @this_stack_used
@this_stack_used = old_stack_used
end | [
"def",
"stack",
"(",
"new_scope",
"=",
"nil",
")",
"old_stack_used",
"=",
"@this_stack_used",
"if",
"new_scope",
"push",
"(",
"new_scope",
")",
"@this_stack_used",
"=",
"true",
"else",
"@this_stack_used",
"=",
"false",
"end",
"yield",
"ensure",
"pop",
"if",
"@... | Pushes a new local scope on the stack, pops it at the end of the block
Example:
context.stack do
context['var'] = 'hi'
end
context['var] #=> nil | [
"Pushes",
"a",
"new",
"local",
"scope",
"on",
"the",
"stack",
"pops",
"it",
"at",
"the",
"end",
"of",
"the",
"block"
] | b3b63a683f6daaea7e70f1602ee829abdf970ef3 | https://github.com/Shopify/liquid/blob/b3b63a683f6daaea7e70f1602ee829abdf970ef3/lib/liquid/context.rb#L114-L127 | train | Stack the current context of the block. | [
30522,
13366,
9991,
1006,
2047,
1035,
9531,
1027,
9152,
2140,
1007,
2214,
1035,
9991,
1035,
2109,
1027,
1030,
2023,
1035,
9991,
1035,
2109,
2065,
2047,
1035,
9531,
5245,
1006,
2047,
1035,
9531,
1007,
1030,
2023,
1035,
9991,
1035,
2109,
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_network/lib/2019-02-01/generated/azure_mgmt_network/vpn_connections.rb | Azure::Network::Mgmt::V2019_02_01.VpnConnections.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, gateway_name, connection_name, custom_headers:nil)
begin_delete_async(resource_group_name, gateway_name, connection_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, gateway_name, connection_name, custom_headers:nil)
begin_delete_async(resource_group_name, gateway_name, connection_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"connection_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"connection_name",
",",
"custom_headers",
":c... | Deletes a vpn connection.
@param resource_group_name [String] The resource group name of the
VpnGateway.
@param gateway_name [String] The name of the gateway.
@param connection_name [String] The name of the connection.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"a",
"vpn",
"connection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/vpn_connections.rb#L465-L467 | train | Deletes the specified connection from the specified HDInsight gateway. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11909,
1035,
2171,
1010,
4434,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/backend.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Backend.get_entity_tag_with_http_info | def get_entity_tag_with_http_info(resource_group_name, service_name, backendid, custom_headers:nil)
get_entity_tag_async(resource_group_name, service_name, backendid, custom_headers:custom_headers).value!
end | ruby | def get_entity_tag_with_http_info(resource_group_name, service_name, backendid, custom_headers:nil)
get_entity_tag_async(resource_group_name, service_name, backendid, custom_headers:custom_headers).value!
end | [
"def",
"get_entity_tag_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"backendid",
",",
"custom_headers",
":",
"nil",
")",
"get_entity_tag_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"backendid",
",",
"custom_headers",
":custom_he... | Gets the entity state (Etag) version of the backend specified by its
identifier.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param backendid [String] Identifier of the Backend entity. 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. | [
"Gets",
"the",
"entity",
"state",
"(",
"Etag",
")",
"version",
"of",
"the",
"backend",
"specified",
"by",
"its",
"identifier",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/backend.rb#L178-L180 | train | Gets the entity tag for the specified backend. | [
30522,
13366,
2131,
1035,
9178,
1035,
6415,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
2067,
10497,
3593,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
9178,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-core/lib/aws-sdk-core/endpoint_cache.rb | Aws.EndpointCache.extract_key | def extract_key(ctx)
parts = []
# fetching from cred provider directly gives warnings
parts << ctx.config.credentials.credentials.access_key_id
if _endpoint_operation_identifier(ctx)
parts << ctx.operation_name
ctx.operation.input.shape.members.inject(parts) do |p, (name, ref)|
p << ctx.params[name] if ref["endpointdiscoveryid"]
p
end
end
parts.join('_')
end | ruby | def extract_key(ctx)
parts = []
# fetching from cred provider directly gives warnings
parts << ctx.config.credentials.credentials.access_key_id
if _endpoint_operation_identifier(ctx)
parts << ctx.operation_name
ctx.operation.input.shape.members.inject(parts) do |p, (name, ref)|
p << ctx.params[name] if ref["endpointdiscoveryid"]
p
end
end
parts.join('_')
end | [
"def",
"extract_key",
"(",
"ctx",
")",
"parts",
"=",
"[",
"]",
"# fetching from cred provider directly gives warnings",
"parts",
"<<",
"ctx",
".",
"config",
".",
"credentials",
".",
"credentials",
".",
"access_key_id",
"if",
"_endpoint_operation_identifier",
"(",
"ctx... | extract the key to be used in the cache from request context
@param [RequestContext] ctx
@return [String] | [
"extract",
"the",
"key",
"to",
"be",
"used",
"in",
"the",
"cache",
"from",
"request",
"context"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-core/lib/aws-sdk-core/endpoint_cache.rb#L105-L117 | train | Extract the key from the request parameters | [
30522,
13366,
14817,
1035,
3145,
1006,
14931,
2595,
1007,
3033,
1027,
1031,
1033,
1001,
18584,
2075,
2013,
13675,
2098,
10802,
3495,
3957,
16234,
3033,
1026,
1026,
14931,
2595,
1012,
9530,
8873,
2290,
1012,
22496,
1012,
22496,
1012,
3229,
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... |
stevegraham/slanger | lib/slanger/handler.rb | Slanger.Handler.onmessage | def onmessage(msg)
msg = Oj.strict_load(msg)
msg['data'] = Oj.strict_load(msg['data']) if msg['data'].is_a? String
event = msg['event'].gsub(/\Apusher:/, 'pusher_')
if event =~ /\Aclient-/
msg['socket_id'] = connection.socket_id
Channel.send_client_message msg
elsif respond_to? event, true
send event, msg
end
rescue JSON::ParserError
error({ code: 5001, message: "Invalid JSON" })
rescue Exception => e
error({ code: 500, message: "#{e.message}\n #{e.backtrace.join "\n"}" })
end | ruby | def onmessage(msg)
msg = Oj.strict_load(msg)
msg['data'] = Oj.strict_load(msg['data']) if msg['data'].is_a? String
event = msg['event'].gsub(/\Apusher:/, 'pusher_')
if event =~ /\Aclient-/
msg['socket_id'] = connection.socket_id
Channel.send_client_message msg
elsif respond_to? event, true
send event, msg
end
rescue JSON::ParserError
error({ code: 5001, message: "Invalid JSON" })
rescue Exception => e
error({ code: 500, message: "#{e.message}\n #{e.backtrace.join "\n"}" })
end | [
"def",
"onmessage",
"(",
"msg",
")",
"msg",
"=",
"Oj",
".",
"strict_load",
"(",
"msg",
")",
"msg",
"[",
"'data'",
"]",
"=",
"Oj",
".",
"strict_load",
"(",
"msg",
"[",
"'data'",
"]",
")",
"if",
"msg",
"[",
"'data'",
"]",
".",
"is_a?",
"String",
"e... | Dispatches message handling to method with same name as
the event name | [
"Dispatches",
"message",
"handling",
"to",
"method",
"with",
"same",
"name",
"as",
"the",
"event",
"name"
] | f26f80c675dc4d853bce401743779a6959981af1 | https://github.com/stevegraham/slanger/blob/f26f80c675dc4d853bce401743779a6959981af1/lib/slanger/handler.rb#L27-L45 | train | Send a message to the server | [
30522,
13366,
2006,
7834,
3736,
3351,
1006,
5796,
2290,
1007,
5796,
2290,
1027,
1051,
3501,
1012,
9384,
1035,
7170,
1006,
5796,
2290,
1007,
5796,
2290,
1031,
1005,
2951,
1005,
1033,
1027,
1051,
3501,
1012,
9384,
1035,
7170,
1006,
5796,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/logger.rb | Watir.Logger.deprecate | def deprecate(old, new, reference: '', ids: [])
return if @ignored.include?('deprecations') || (@ignored & ids.map!(&:to_s)).any?
msg = ids.empty? ? '' : "[#{ids.map(&:inspect).join(', ')}] "
ref_msg = reference.empty? ? '.' : "; see explanation for this deprecation: #{reference}."
warn "[DEPRECATION] #{msg}#{old} is deprecated. Use #{new} instead#{ref_msg}"
end | ruby | def deprecate(old, new, reference: '', ids: [])
return if @ignored.include?('deprecations') || (@ignored & ids.map!(&:to_s)).any?
msg = ids.empty? ? '' : "[#{ids.map(&:inspect).join(', ')}] "
ref_msg = reference.empty? ? '.' : "; see explanation for this deprecation: #{reference}."
warn "[DEPRECATION] #{msg}#{old} is deprecated. Use #{new} instead#{ref_msg}"
end | [
"def",
"deprecate",
"(",
"old",
",",
"new",
",",
"reference",
":",
"''",
",",
"ids",
":",
"[",
"]",
")",
"return",
"if",
"@ignored",
".",
"include?",
"(",
"'deprecations'",
")",
"||",
"(",
"@ignored",
"&",
"ids",
".",
"map!",
"(",
":to_s",
")",
")"... | Marks code as deprecated with replacement.
@param [String] old
@param [String] new | [
"Marks",
"code",
"as",
"deprecated",
"with",
"replacement",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/logger.rb#L91-L97 | train | Deprecates the deprecation of a given method. | [
30522,
13366,
2139,
28139,
16280,
1006,
2214,
1010,
2047,
1010,
4431,
1024,
1005,
1005,
1010,
8909,
2015,
1024,
1031,
1033,
1007,
2709,
2065,
1030,
6439,
1012,
2421,
1029,
1006,
1005,
2139,
28139,
10719,
2015,
1005,
1007,
1064,
1064,
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_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.begin_resume_as_lazy | def begin_resume_as_lazy(resource_group_name, name, custom_headers:nil)
response = begin_resume_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
begin_resume_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def begin_resume_as_lazy(resource_group_name, name, custom_headers:nil)
response = begin_resume_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
begin_resume_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"begin_resume_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_resume_async",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"unless",
"r... | Resume an App Service Environment.
Resume 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 [WebAppCollection] which provide lazy access to pages of the
response. | [
"Resume",
"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#L8052-L8061 | train | Resumes a managed cluster. | [
30522,
13366,
4088,
1035,
13746,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
13746,
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... |
deivid-rodriguez/byebug | lib/byebug/interface.rb | Byebug.Interface.read_input | def read_input(prompt, save_hist = true)
line = prepare_input(prompt)
return unless line
history.push(line) if save_hist
command_queue.concat(split_commands(line))
command_queue.shift
end | ruby | def read_input(prompt, save_hist = true)
line = prepare_input(prompt)
return unless line
history.push(line) if save_hist
command_queue.concat(split_commands(line))
command_queue.shift
end | [
"def",
"read_input",
"(",
"prompt",
",",
"save_hist",
"=",
"true",
")",
"line",
"=",
"prepare_input",
"(",
"prompt",
")",
"return",
"unless",
"line",
"history",
".",
"push",
"(",
"line",
")",
"if",
"save_hist",
"command_queue",
".",
"concat",
"(",
"split_c... | Reads a new line from the interface's input stream, parses it into
commands and saves it to history.
@return [String] Representing something to be run by the debugger. | [
"Reads",
"a",
"new",
"line",
"from",
"the",
"interface",
"s",
"input",
"stream",
"parses",
"it",
"into",
"commands",
"and",
"saves",
"it",
"to",
"history",
"."
] | bf41a63858a648baa7fb621600d6451786d1572a | https://github.com/deivid-rodriguez/byebug/blob/bf41a63858a648baa7fb621600d6451786d1572a/lib/byebug/interface.rb#L54-L62 | train | Read input from the command line | [
30522,
13366,
3191,
1035,
7953,
1006,
25732,
1010,
3828,
1035,
2010,
2102,
1027,
2995,
1007,
2240,
1027,
7374,
1035,
7953,
1006,
25732,
1007,
2709,
4983,
2240,
2381,
1012,
5245,
1006,
2240,
1007,
2065,
3828,
1035,
2010,
2102,
3094,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/bot.rb | Discordrb.Bot.update_guild_role | def update_guild_role(data)
role_data = data['role']
server_id = data['guild_id'].to_i
server = @servers[server_id]
new_role = Role.new(role_data, self, server)
role_id = role_data['id'].to_i
old_role = server.roles.find { |r| r.id == role_id }
old_role.update_from(new_role)
end | ruby | def update_guild_role(data)
role_data = data['role']
server_id = data['guild_id'].to_i
server = @servers[server_id]
new_role = Role.new(role_data, self, server)
role_id = role_data['id'].to_i
old_role = server.roles.find { |r| r.id == role_id }
old_role.update_from(new_role)
end | [
"def",
"update_guild_role",
"(",
"data",
")",
"role_data",
"=",
"data",
"[",
"'role'",
"]",
"server_id",
"=",
"data",
"[",
"'guild_id'",
"]",
".",
"to_i",
"server",
"=",
"@servers",
"[",
"server_id",
"]",
"new_role",
"=",
"Role",
".",
"new",
"(",
"role_d... | Internal handler for GUILD_ROLE_UPDATE | [
"Internal",
"handler",
"for",
"GUILD_ROLE_UPDATE"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L910-L918 | train | Update a guild role | [
30522,
13366,
10651,
1035,
9054,
1035,
2535,
1006,
2951,
1007,
2535,
1035,
2951,
1027,
2951,
1031,
1005,
2535,
1005,
1033,
8241,
1035,
8909,
1027,
2951,
1031,
1005,
9054,
1035,
8909,
1005,
1033,
1012,
2000,
1035,
1045,
8241,
1027,
1030,
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... |
fastlane/fastlane | credentials_manager/lib/credentials_manager/appfile_config.rb | CredentialsManager.AppfileConfig.for_lane | def for_lane(lane_name)
if lane_name.to_s.split(" ").count > 1
# That's the legacy syntax 'platform name'
puts("You use deprecated syntax '#{lane_name}' in your Appfile.".yellow)
puts("Please follow the Appfile guide: https://docs.fastlane.tools/advanced/#appfile".yellow)
platform, lane_name = lane_name.split(" ")
return unless platform == ENV["FASTLANE_PLATFORM_NAME"]
# the lane name will be verified below
end
if ENV["FASTLANE_LANE_NAME"] == lane_name.to_s
yield
end
end | ruby | def for_lane(lane_name)
if lane_name.to_s.split(" ").count > 1
# That's the legacy syntax 'platform name'
puts("You use deprecated syntax '#{lane_name}' in your Appfile.".yellow)
puts("Please follow the Appfile guide: https://docs.fastlane.tools/advanced/#appfile".yellow)
platform, lane_name = lane_name.split(" ")
return unless platform == ENV["FASTLANE_PLATFORM_NAME"]
# the lane name will be verified below
end
if ENV["FASTLANE_LANE_NAME"] == lane_name.to_s
yield
end
end | [
"def",
"for_lane",
"(",
"lane_name",
")",
"if",
"lane_name",
".",
"to_s",
".",
"split",
"(",
"\" \"",
")",
".",
"count",
">",
"1",
"# That's the legacy syntax 'platform name'",
"puts",
"(",
"\"You use deprecated syntax '#{lane_name}' in your Appfile.\"",
".",
"yellow",
... | Override Appfile configuration for a specific lane.
lane_name - Symbol representing a lane name. (Can be either :name, 'name' or 'platform name')
block - Block to execute to override configuration values.
Discussion If received lane name does not match the lane name available as environment variable, no changes will
be applied. | [
"Override",
"Appfile",
"configuration",
"for",
"a",
"specific",
"lane",
"."
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/credentials_manager/lib/credentials_manager/appfile_config.rb#L152-L166 | train | This is the fastlane - like method that takes a single lane name and returns the result. | [
30522,
13366,
2005,
1035,
4644,
1006,
4644,
1035,
2171,
1007,
2065,
4644,
1035,
2171,
1012,
2000,
1035,
1055,
1012,
3975,
1006,
1000,
1000,
1007,
1012,
4175,
1028,
1015,
1001,
2008,
1005,
1055,
1996,
8027,
20231,
1005,
4132,
2171,
1005,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mojombo/chronic | lib/chronic/handlers.rb | Chronic.Handlers.handle_sm_sy | def handle_sm_sy(tokens, options)
month = tokens[0].get_tag(ScalarMonth).type
year = tokens[1].get_tag(ScalarYear).type
handle_year_and_month(year, month)
end | ruby | def handle_sm_sy(tokens, options)
month = tokens[0].get_tag(ScalarMonth).type
year = tokens[1].get_tag(ScalarYear).type
handle_year_and_month(year, month)
end | [
"def",
"handle_sm_sy",
"(",
"tokens",
",",
"options",
")",
"month",
"=",
"tokens",
"[",
"0",
"]",
".",
"get_tag",
"(",
"ScalarMonth",
")",
".",
"type",
"year",
"=",
"tokens",
"[",
"1",
"]",
".",
"get_tag",
"(",
"ScalarYear",
")",
".",
"type",
"handle... | Handle scalar-month/scalar-year | [
"Handle",
"scalar",
"-",
"month",
"/",
"scalar",
"-",
"year"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L293-L297 | train | Handle the SMMsy token | [
30522,
13366,
5047,
1035,
15488,
1035,
25353,
1006,
19204,
2015,
1010,
7047,
1007,
3204,
1027,
19204,
2015,
1031,
1014,
1033,
1012,
2131,
1035,
6415,
1006,
26743,
10867,
12162,
2232,
1007,
1012,
2828,
2095,
1027,
19204,
2015,
1031,
1015,
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 | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.update_certificate_operation_with_http_info | def update_certificate_operation_with_http_info(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil)
update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:custom_headers).value!
end | ruby | def update_certificate_operation_with_http_info(vault_base_url, certificate_name, cancellation_requested, custom_headers:nil)
update_certificate_operation_async(vault_base_url, certificate_name, cancellation_requested, custom_headers:custom_headers).value!
end | [
"def",
"update_certificate_operation_with_http_info",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"cancellation_requested",
",",
"custom_headers",
":",
"nil",
")",
"update_certificate_operation_async",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"cancellation_... | Updates a certificate operation.
Updates a certificate creation operation that is already in progress. This
operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param certificate_name [String] The name of the certificate.
@param cancellation_requested [Boolean] Indicates if cancellation was
requested on the certificate operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"a",
"certificate",
"operation",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L6075-L6077 | train | Updates the certificate operation. | [
30522,
13366,
10651,
1035,
8196,
1035,
3169,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
16990,
1035,
7303,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_reservations/lib/2019-04-01-preview/generated/azure_mgmt_reservations/reservation_order.rb | Azure::Reservations::Mgmt::V2019_04_01_preview.ReservationOrder.purchase_async | def purchase_async(reservation_order_id, body, custom_headers:nil)
# Send request
promise = begin_purchase_async(reservation_order_id, body, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Reservations::Mgmt::V2019_04_01_preview::Models::ReservationOrderResponse.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def purchase_async(reservation_order_id, body, custom_headers:nil)
# Send request
promise = begin_purchase_async(reservation_order_id, body, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Reservations::Mgmt::V2019_04_01_preview::Models::ReservationOrderResponse.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"purchase_async",
"(",
"reservation_order_id",
",",
"body",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_purchase_async",
"(",
"reservation_order_id",
",",
"body",
",",
"custom_headers",
":custom_headers",
")",
"promise",
"="... | @param reservation_order_id [String] Order Id of the reservation
@param body [PurchaseRequest] Information needed for calculate or purchase
reservation
@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",
"reservation_order_id",
"[",
"String",
"]",
"Order",
"Id",
"of",
"the",
"reservation",
"@param",
"body",
"[",
"PurchaseRequest",
"]",
"Information",
"needed",
"for",
"calculate",
"or",
"purchase",
"reservation",
"@param",
"custom_headers",
"[",
"Hash",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_reservations/lib/2019-04-01-preview/generated/azure_mgmt_reservations/reservation_order.rb#L245-L261 | train | Purchases a reservation order. | [
30522,
13366,
5309,
1035,
2004,
6038,
2278,
1006,
11079,
1035,
2344,
1035,
8909,
1010,
2303,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
5309,
1035,
2004,
6038,
2278,
1006,
11079,
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/models/hyrax/operation.rb | Hyrax.Operation.fail! | def fail!(message = nil)
run_callbacks :failure do
update(status: FAILURE, message: message)
parent&.rollup_status
end
end | ruby | def fail!(message = nil)
run_callbacks :failure do
update(status: FAILURE, message: message)
parent&.rollup_status
end
end | [
"def",
"fail!",
"(",
"message",
"=",
"nil",
")",
"run_callbacks",
":failure",
"do",
"update",
"(",
"status",
":",
"FAILURE",
",",
"message",
":",
"message",
")",
"parent",
"&.",
"rollup_status",
"end",
"end"
] | Mark this operation as a FAILURE. If this is a child operation, roll up to
the parent any failures.
@param [String, nil] message record any failure message
@see Hyrax::Operation::FAILURE
@see #rollup_status
@note This will run any registered :failure callbacks
@todo Where are these callbacks defined? Document this | [
"Mark",
"this",
"operation",
"as",
"a",
"FAILURE",
".",
"If",
"this",
"is",
"a",
"child",
"operation",
"roll",
"up",
"to",
"the",
"parent",
"any",
"failures",
"."
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/models/hyrax/operation.rb#L76-L81 | train | fails the current process | [
30522,
13366,
8246,
999,
1006,
4471,
1027,
9152,
2140,
1007,
2448,
1035,
2655,
12221,
1024,
4945,
2079,
10651,
1006,
3570,
1024,
4945,
1010,
4471,
1024,
4471,
1007,
6687,
1004,
1012,
4897,
6279,
1035,
3570,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
danger/danger | lib/danger/danger_core/plugins/dangerfile_vsts_plugin.rb | Danger.DangerfileVSTSPlugin.markdown_link | def markdown_link(paths, full_path: true)
paths = [paths] unless paths.kind_of?(Array)
commit = head_commit
repo = pr_json[:repository][:remoteUrl].to_s
paths = paths.map do |path|
path, line = path.split("#L")
url_path = path.start_with?("/") ? path : "/#{path}"
text = full_path ? path : File.basename(path)
url_path.gsub!(" ", "%20")
line_ref = line ? "&line=#{line}" : ""
create_markdown_link("#{repo}/commit/#{commit}?path=#{url_path}&_a=contents#{line_ref}", text)
end
return paths.first if paths.count < 2
paths.first(paths.count - 1).join(", ") + " & " + paths.last
end | ruby | def markdown_link(paths, full_path: true)
paths = [paths] unless paths.kind_of?(Array)
commit = head_commit
repo = pr_json[:repository][:remoteUrl].to_s
paths = paths.map do |path|
path, line = path.split("#L")
url_path = path.start_with?("/") ? path : "/#{path}"
text = full_path ? path : File.basename(path)
url_path.gsub!(" ", "%20")
line_ref = line ? "&line=#{line}" : ""
create_markdown_link("#{repo}/commit/#{commit}?path=#{url_path}&_a=contents#{line_ref}", text)
end
return paths.first if paths.count < 2
paths.first(paths.count - 1).join(", ") + " & " + paths.last
end | [
"def",
"markdown_link",
"(",
"paths",
",",
"full_path",
":",
"true",
")",
"paths",
"=",
"[",
"paths",
"]",
"unless",
"paths",
".",
"kind_of?",
"(",
"Array",
")",
"commit",
"=",
"head_commit",
"repo",
"=",
"pr_json",
"[",
":repository",
"]",
"[",
":remote... | @!group VSTS Misc
Returns a list of Markdown links for a file, or files in the head repository.
It returns a string of multiple links if passed an array.
@param [String or Array<String>] paths
A list of strings to convert to Markdown links
@param [Bool] full_path
Shows the full path as the link's text, defaults to `true`.
@return [String] | [
"@!group",
"VSTS",
"Misc",
"Returns",
"a",
"list",
"of",
"Markdown",
"links",
"for",
"a",
"file",
"or",
"files",
"in",
"the",
"head",
"repository",
".",
"It",
"returns",
"a",
"string",
"of",
"multiple",
"links",
"if",
"passed",
"an",
"array",
".",
"@para... | 0d6d09f2d949c287fe75202d947374042b0679f4 | https://github.com/danger/danger/blob/0d6d09f2d949c287fe75202d947374042b0679f4/lib/danger/danger_core/plugins/dangerfile_vsts_plugin.rb#L162-L178 | train | Create markdown link to a list of files | [
30522,
13366,
2928,
7698,
1035,
4957,
1006,
10425,
1010,
2440,
1035,
4130,
1024,
2995,
1007,
10425,
1027,
1031,
10425,
1033,
4983,
10425,
1012,
2785,
1035,
1997,
1029,
1006,
9140,
1007,
10797,
1027,
2132,
1035,
10797,
16360,
2080,
1027,
109... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/role.rb | Discordrb.Role.packed= | def packed=(packed, update_perms = true)
update_role_data(permissions: packed)
@permissions.bits = packed if update_perms
end | ruby | def packed=(packed, update_perms = true)
update_role_data(permissions: packed)
@permissions.bits = packed if update_perms
end | [
"def",
"packed",
"=",
"(",
"packed",
",",
"update_perms",
"=",
"true",
")",
"update_role_data",
"(",
"permissions",
":",
"packed",
")",
"@permissions",
".",
"bits",
"=",
"packed",
"if",
"update_perms",
"end"
] | Changes this role's permissions to a fixed bitfield. This allows setting multiple permissions at once with just
one API call.
Information on how this bitfield is structured can be found at
https://discordapp.com/developers/docs/topics/permissions.
@example Remove all permissions from a role
role.packed = 0
@param packed [Integer] A bitfield with the desired permissions value.
@param update_perms [true, false] Whether the internal data should also be updated. This should always be true
when calling externally. | [
"Changes",
"this",
"role",
"s",
"permissions",
"to",
"a",
"fixed",
"bitfield",
".",
"This",
"allows",
"setting",
"multiple",
"permissions",
"at",
"once",
"with",
"just",
"one",
"API",
"call",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/role.rb#L143-L146 | train | Update the permissions of the role. | [
30522,
13366,
8966,
1027,
1006,
8966,
1010,
10651,
1035,
2566,
5244,
1027,
2995,
1007,
10651,
1035,
2535,
1035,
2951,
1006,
6656,
2015,
1024,
8966,
1007,
1030,
6656,
2015,
1012,
9017,
1027,
8966,
2065,
10651,
1035,
2566,
5244,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.add_emoji | def add_emoji(name, image, roles = [], reason: nil)
image_string = image
if image.respond_to? :read
image_string = 'data:image/jpg;base64,'
image_string += Base64.strict_encode64(image.read)
end
data = JSON.parse(API::Server.add_emoji(@bot.token, @id, image_string, name, roles.map(&:resolve_id), reason))
new_emoji = Emoji.new(data)
@emoji[new_emoji.id] = new_emoji
end | ruby | def add_emoji(name, image, roles = [], reason: nil)
image_string = image
if image.respond_to? :read
image_string = 'data:image/jpg;base64,'
image_string += Base64.strict_encode64(image.read)
end
data = JSON.parse(API::Server.add_emoji(@bot.token, @id, image_string, name, roles.map(&:resolve_id), reason))
new_emoji = Emoji.new(data)
@emoji[new_emoji.id] = new_emoji
end | [
"def",
"add_emoji",
"(",
"name",
",",
"image",
",",
"roles",
"=",
"[",
"]",
",",
"reason",
":",
"nil",
")",
"image_string",
"=",
"image",
"if",
"image",
".",
"respond_to?",
":read",
"image_string",
"=",
"'data:image/jpg;base64,'",
"image_string",
"+=",
"Base... | Adds a new custom emoji on this server.
@param name [String] The name of emoji to create.
@param image [String, #read] A base64 encoded string with the image data, or an object that responds to `#read`, such as `File`.
@param roles [Array<Role, String, Integer>] An array of roles, or role IDs to be whitelisted for this emoji.
@param reason [String] The reason the for the creation of this emoji.
@return [Emoji] The emoji that has been added. | [
"Adds",
"a",
"new",
"custom",
"emoji",
"on",
"this",
"server",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/server.rb#L508-L518 | train | Add an emoji to the server. | [
30522,
13366,
5587,
1035,
7861,
29147,
2072,
1006,
2171,
1010,
3746,
1010,
4395,
1027,
1031,
1033,
1010,
3114,
1024,
9152,
2140,
1007,
3746,
1035,
5164,
1027,
3746,
2065,
3746,
1012,
6869,
1035,
2000,
1029,
1024,
3191,
3746,
1035,
5164,
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... |
awesome-print/awesome_print | lib/awesome_print/ext/sequel.rb | AwesomePrint.Sequel.awesome_sequel_model_class | def awesome_sequel_model_class(object)
data = object.db_schema.inject({}) { |h, (prop, defn)| h.merge(prop => defn[:db_type]) }
name = "class #{awesome_simple(object.to_s, :class)}"
base = "< #{awesome_simple(object.superclass.to_s, :class)}"
[name, base, awesome_hash(data)].join(' ')
end | ruby | def awesome_sequel_model_class(object)
data = object.db_schema.inject({}) { |h, (prop, defn)| h.merge(prop => defn[:db_type]) }
name = "class #{awesome_simple(object.to_s, :class)}"
base = "< #{awesome_simple(object.superclass.to_s, :class)}"
[name, base, awesome_hash(data)].join(' ')
end | [
"def",
"awesome_sequel_model_class",
"(",
"object",
")",
"data",
"=",
"object",
".",
"db_schema",
".",
"inject",
"(",
"{",
"}",
")",
"{",
"|",
"h",
",",
"(",
"prop",
",",
"defn",
")",
"|",
"h",
".",
"merge",
"(",
"prop",
"=>",
"defn",
"[",
":db_typ... | Format Sequel Model class.
------------------------------------------------------------------------------ | [
"Format",
"Sequel",
"Model",
"class",
".",
"------------------------------------------------------------------------------"
] | 4564fd74721562cbef2443f7d97109bf9192343d | https://github.com/awesome-print/awesome_print/blob/4564fd74721562cbef2443f7d97109bf9192343d/lib/awesome_print/ext/sequel.rb#L47-L53 | train | Returns the class name base and data for the given object. | [
30522,
13366,
12476,
1035,
8297,
1035,
2944,
1035,
2465,
1006,
4874,
1007,
2951,
1027,
4874,
1012,
16962,
1035,
8040,
28433,
1012,
1999,
20614,
1006,
1063,
1065,
1007,
1063,
1064,
1044,
1010,
1006,
17678,
1010,
13366,
2078,
1007,
1064,
1044... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/transaction.rb | Braintree.Transaction.void | def void
warn "[DEPRECATED] void as an instance method is deprecated. Please use Transaction.void"
result = @gateway.transaction.void(id)
if result.success?
copy_instance_variables_from_object result.transaction
end
result
end | ruby | def void
warn "[DEPRECATED] void as an instance method is deprecated. Please use Transaction.void"
result = @gateway.transaction.void(id)
if result.success?
copy_instance_variables_from_object result.transaction
end
result
end | [
"def",
"void",
"warn",
"\"[DEPRECATED] void as an instance method is deprecated. Please use Transaction.void\"",
"result",
"=",
"@gateway",
".",
"transaction",
".",
"void",
"(",
"id",
")",
"if",
"result",
".",
"success?",
"copy_instance_variables_from_object",
"result",
".",
... | Deprecated. Use Braintree::Transaction.void | [
"Deprecated",
".",
"Use",
"Braintree",
"::",
"Transaction",
".",
"void"
] | 6e56c7099ea55bcdc4073cbea60b2688cef69663 | https://github.com/braintree/braintree_ruby/blob/6e56c7099ea55bcdc4073cbea60b2688cef69663/lib/braintree/transaction.rb#L405-L412 | train | This method is used to void a transaction. | [
30522,
13366,
11675,
11582,
1000,
1031,
2139,
28139,
12921,
1033,
11675,
2004,
2019,
6013,
4118,
2003,
2139,
28139,
12921,
1012,
3531,
2224,
12598,
1012,
11675,
1000,
2765,
1027,
1030,
11909,
1012,
12598,
1012,
11675,
1006,
8909,
1007,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_chaos | def get_chaos(timeout:60, custom_headers:nil)
response = get_chaos_async(timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_chaos(timeout:60, custom_headers:nil)
response = get_chaos_async(timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_chaos",
"(",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_chaos_async",
"(",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"respons... | Get the status of Chaos.
Get the status of Chaos indicating whether or not Chaos is running, the Chaos
parameters used for running Chaos and the status of the Chaos Schedule.
@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 [Chaos] operation results. | [
"Get",
"the",
"status",
"of",
"Chaos",
"."
] | 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#L18423-L18426 | train | Get the chaos of the specified product. | [
30522,
13366,
2131,
1035,
8488,
1006,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
8488,
1035,
2004,
6038,
2278,
1006,
2051,
5833,
1024,
2051,
5833,
1010,
7661,
1035,
20346,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_search/lib/2015-08-19/generated/azure_mgmt_search/services.rb | Azure::Search::Mgmt::V2015_08_19.Services.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, search_service_name, service, search_management_request_options:nil, custom_headers:nil)
begin_create_or_update_async(resource_group_name, search_service_name, service, search_management_request_options:search_management_request_options, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, search_service_name, service, search_management_request_options:nil, custom_headers:nil)
begin_create_or_update_async(resource_group_name, search_service_name, service, search_management_request_options:search_management_request_options, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"search_service_name",
",",
"service",
",",
"search_management_request_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",... | Creates or updates a Search service in the given resource group. If the
Search service already exists, all properties will be updated with the given
values.
@param resource_group_name [String] The name of the resource group within the
current subscription. You can obtain this value from the Azure Resource
Manager API or the portal.
@param search_service_name [String] The name of the Azure Search service to
create or update. Search service names must only contain lowercase letters,
digits or dashes, cannot use dash as the first two or last one characters,
cannot contain consecutive dashes, and must be between 2 and 60 characters in
length. Search service names must be globally unique since they are part of
the service URI (https://<name>.search.windows.net). You cannot change the
service name after the service is created.
@param service [SearchService] The definition of the Search service to create
or update.
@param search_management_request_options [SearchManagementRequestOptions]
Additional parameters for the operation
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"a",
"Search",
"service",
"in",
"the",
"given",
"resource",
"group",
".",
"If",
"the",
"Search",
"service",
"already",
"exists",
"all",
"properties",
"will",
"be",
"updated",
"with",
"the",
"given",
"values",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_search/lib/2015-08-19/generated/azure_mgmt_search/services.rb#L717-L719 | train | Creates or updates a search service. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3945,
1035,
2326,
1035,
2171,
1010,
2326,
1010,
3945,
1035,
2968,
1035,
5227,
1035,
7047,
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... |
meew0/discordrb | lib/discordrb/cache.rb | Discordrb.Cache.voice_regions | def voice_regions
return @voice_regions unless @voice_regions.empty?
regions = JSON.parse API.voice_regions(token)
regions.each do |data|
@voice_regions[data['id']] = VoiceRegion.new(data)
end
@voice_regions
end | ruby | def voice_regions
return @voice_regions unless @voice_regions.empty?
regions = JSON.parse API.voice_regions(token)
regions.each do |data|
@voice_regions[data['id']] = VoiceRegion.new(data)
end
@voice_regions
end | [
"def",
"voice_regions",
"return",
"@voice_regions",
"unless",
"@voice_regions",
".",
"empty?",
"regions",
"=",
"JSON",
".",
"parse",
"API",
".",
"voice_regions",
"(",
"token",
")",
"regions",
".",
"each",
"do",
"|",
"data",
"|",
"@voice_regions",
"[",
"data",
... | Returns or caches the available voice regions | [
"Returns",
"or",
"caches",
"the",
"available",
"voice",
"regions"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/cache.rb#L29-L38 | train | Returns an array of VoiceRegions object. | [
30522,
13366,
2376,
1035,
4655,
2709,
1030,
2376,
1035,
4655,
4983,
1030,
2376,
1035,
4655,
1012,
4064,
1029,
4655,
1027,
1046,
3385,
1012,
11968,
3366,
17928,
1012,
2376,
1035,
4655,
1006,
19204,
1007,
4655,
1012,
2169,
2079,
1064,
2951,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kpumuk/meta-tags | lib/meta_tags/text_normalizer.rb | MetaTags.TextNormalizer.strip_tags | def strip_tags(string)
if defined?(Loofah)
# Instead of strip_tags we will use Loofah to strip tags from now on
Loofah.fragment(string).text(encode_special_chars: false)
else
helpers.strip_tags(string)
end
end | ruby | def strip_tags(string)
if defined?(Loofah)
# Instead of strip_tags we will use Loofah to strip tags from now on
Loofah.fragment(string).text(encode_special_chars: false)
else
helpers.strip_tags(string)
end
end | [
"def",
"strip_tags",
"(",
"string",
")",
"if",
"defined?",
"(",
"Loofah",
")",
"# Instead of strip_tags we will use Loofah to strip tags from now on",
"Loofah",
".",
"fragment",
"(",
"string",
")",
".",
"text",
"(",
"encode_special_chars",
":",
"false",
")",
"else",
... | Strips all HTML tags from the +html+, including comments.
@param [String] string HTML string.
@return [String] html_safe string with no HTML tags. | [
"Strips",
"all",
"HTML",
"tags",
"from",
"the",
"+",
"html",
"+",
"including",
"comments",
"."
] | 03585f95edf96cd17024c5c155ce46ec8bc47232 | https://github.com/kpumuk/meta-tags/blob/03585f95edf96cd17024c5c155ce46ec8bc47232/lib/meta_tags/text_normalizer.rb#L81-L88 | train | Strip tags from a string | [
30522,
13366,
6167,
1035,
22073,
1006,
5164,
1007,
2065,
4225,
1029,
1006,
8840,
11253,
4430,
1007,
1001,
2612,
1997,
6167,
1035,
22073,
2057,
2097,
2224,
8840,
11253,
4430,
2000,
6167,
22073,
2013,
2085,
2006,
8840,
11253,
4430,
1012,
1577... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_computervision/lib/1.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb | Azure::CognitiveServices::ComputerVision::V1_0.ComputerVisionClient.recognize_text_with_http_info | def recognize_text_with_http_info(url, detect_handwriting:false, custom_headers:nil)
recognize_text_async(url, detect_handwriting:detect_handwriting, custom_headers:custom_headers).value!
end | ruby | def recognize_text_with_http_info(url, detect_handwriting:false, custom_headers:nil)
recognize_text_async(url, detect_handwriting:detect_handwriting, custom_headers:custom_headers).value!
end | [
"def",
"recognize_text_with_http_info",
"(",
"url",
",",
"detect_handwriting",
":",
"false",
",",
"custom_headers",
":",
"nil",
")",
"recognize_text_async",
"(",
"url",
",",
"detect_handwriting",
":detect_handwriting",
",",
"custom_headers",
":custom_headers",
")",
".",... | Recognize Text operation. When you use the Recognize Text interface, the
response contains a field called 'Operation-Location'. The
'Operation-Location' field contains the URL that you must use for your Get
Handwritten Text Operation Result operation.
@param url [String] Publicly reachable URL of an image
@param detect_handwriting [Boolean] If 'true' is specified, handwriting
recognition is performed. If this parameter is set to 'false' or is not
specified, printed text recognition is performed.
@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. | [
"Recognize",
"Text",
"operation",
".",
"When",
"you",
"use",
"the",
"Recognize",
"Text",
"interface",
"the",
"response",
"contains",
"a",
"field",
"called",
"Operation",
"-",
"Location",
".",
"The",
"Operation",
"-",
"Location",
"field",
"contains",
"the",
"UR... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_computervision/lib/1.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb#L1108-L1110 | train | Recognizes text in a given URL. | [
30522,
13366,
6807,
1035,
3793,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
24471,
2140,
1010,
11487,
1035,
24149,
1024,
6270,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
6807,
1035,
3793,
1035,
2004,
6038,
2278,
1006,
24471,
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... |
square/connect-ruby-sdk | lib/square_connect/api/o_auth_api.rb | SquareConnect.OAuthApi.renew_token | def renew_token(client_id, body, opts = {})
data, _status_code, _headers = renew_token_with_http_info(client_id, body, opts)
return data
end | ruby | def renew_token(client_id, body, opts = {})
data, _status_code, _headers = renew_token_with_http_info(client_id, body, opts)
return data
end | [
"def",
"renew_token",
"(",
"client_id",
",",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"renew_token_with_http_info",
"(",
"client_id",
",",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | RenewToken
`RenewToken` is deprecated. For information about refreshing OAuth access tokens, see [Renew OAuth Token](/authz/oauth/cookbook/oauth-renew). Renews an OAuth access token before it expires. OAuth access tokens besides your application's personal access token expire after __30 days__. You can also renew expired tokens within __15 days__ of their expiration. You cannot renew an access token that has been expired for more than 15 days. Instead, the associated user must re-complete the OAuth flow from the beginning. __Important:__ The `Authorization` header for this endpoint must have the following format: ``` Authorization: Client APPLICATION_SECRET ``` Replace `APPLICATION_SECRET` with the application secret on the Credentials page in the [application dashboard](https://connect.squareup.com/apps).
@param client_id Your application's ID, available from the [application dashboard](https://connect.squareup.com/apps).
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [RenewTokenResponse] | [
"RenewToken",
"RenewToken",
"is",
"deprecated",
".",
"For",
"information",
"about",
"refreshing",
"OAuth",
"access",
"tokens",
"see",
"[",
"Renew",
"OAuth",
"Token",
"]",
"(",
"/",
"authz",
"/",
"oauth",
"/",
"cookbook",
"/",
"oauth",
"-",
"renew",
")",
".... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/o_auth_api.rb#L81-L84 | train | Renews a token | [
30522,
13366,
20687,
1035,
19204,
1006,
7396,
1035,
8909,
1010,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
20687,
1035,
19204,
1035,
2007,
1035,
8299,
1035,
18558,
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... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.4.0.36/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_4_0_36.ServiceFabricClientAPIs.disable_partition_backup_with_http_info | def disable_partition_backup_with_http_info(partition_id, disable_backup_description:nil, timeout:60, custom_headers:nil)
disable_partition_backup_async(partition_id, disable_backup_description:disable_backup_description, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def disable_partition_backup_with_http_info(partition_id, disable_backup_description:nil, timeout:60, custom_headers:nil)
disable_partition_backup_async(partition_id, disable_backup_description:disable_backup_description, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"disable_partition_backup_with_http_info",
"(",
"partition_id",
",",
"disable_backup_description",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"disable_partition_backup_async",
"(",
"partition_id",
",",
"disable_backup_description",... | Disables periodic backup of Service Fabric partition which was previously
enabled.
Disables periodic backup of partition which was previously enabled. Backup
must be explicitly enabled before it can be disabled.
In case the backup is enabled for the Service Fabric application or service,
which this partition is part of, this partition would continue to be
periodically backed up as per the policy mapped at the higher level entity.
@param partition_id The identity of the partition.
@param disable_backup_description [DisableBackupDescription] Specifies the
parameters to disable backup for any backup entity.
@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. | [
"Disables",
"periodic",
"backup",
"of",
"Service",
"Fabric",
"partition",
"which",
"was",
"previously",
"enabled",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.4.0.36/generated/azure_service_fabric/service_fabric_client_apis.rb#L25209-L25211 | train | Disables backup of the specified partition. | [
30522,
13366,
4487,
19150,
1035,
13571,
1035,
10200,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
4487,
19150,
1035,
10200,
1035,
6412,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
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 | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb | Azure::CognitiveServices::Face::V1_0.LargePersonGroupPerson.delete_face | def delete_face(large_person_group_id, person_id, persisted_face_id, custom_headers:nil)
response = delete_face_async(large_person_group_id, person_id, persisted_face_id, custom_headers:custom_headers).value!
nil
end | ruby | def delete_face(large_person_group_id, person_id, persisted_face_id, custom_headers:nil)
response = delete_face_async(large_person_group_id, person_id, persisted_face_id, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete_face",
"(",
"large_person_group_id",
",",
"person_id",
",",
"persisted_face_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_face_async",
"(",
"large_person_group_id",
",",
"person_id",
",",
"persisted_face_id",
",",
"custom_headers",... | Delete a face from a person. Relative feature for the persisted face will
also be deleted.
@param large_person_group_id [String] Id referencing a particular large
person group.
@param person_id Id referencing a particular person.
@param persisted_face_id Id referencing a particular persistedFaceId of an
existing face.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"a",
"face",
"from",
"a",
"person",
".",
"Relative",
"feature",
"for",
"the",
"persisted",
"face",
"will",
"also",
"be",
"deleted",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb#L570-L573 | train | Deletes a persisted face from a person. | [
30522,
13366,
3972,
12870,
1035,
2227,
1006,
2312,
1035,
2711,
1035,
2177,
1035,
8909,
1010,
2711,
1035,
8909,
1010,
19035,
1035,
2227,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2227,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/cache.rb | Discordrb.Cache.invite | def invite(invite)
code = resolve_invite_code(invite)
Invite.new(JSON.parse(API::Invite.resolve(token, code)), self)
end | ruby | def invite(invite)
code = resolve_invite_code(invite)
Invite.new(JSON.parse(API::Invite.resolve(token, code)), self)
end | [
"def",
"invite",
"(",
"invite",
")",
"code",
"=",
"resolve_invite_code",
"(",
"invite",
")",
"Invite",
".",
"new",
"(",
"JSON",
".",
"parse",
"(",
"API",
"::",
"Invite",
".",
"resolve",
"(",
"token",
",",
"code",
")",
")",
",",
"self",
")",
"end"
] | Gets information about an invite.
@param invite [String, Invite] The invite to join. For possible formats see {#resolve_invite_code}.
@return [Invite] The invite with information about the given invite URL. | [
"Gets",
"information",
"about",
"an",
"invite",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/cache.rb#L204-L207 | train | Returns a new invite object. | [
30522,
13366,
13260,
1006,
13260,
1007,
3642,
1027,
10663,
1035,
13260,
1035,
3642,
1006,
13260,
1007,
13260,
1012,
2047,
1006,
1046,
3385,
1012,
11968,
3366,
1006,
17928,
1024,
1024,
13260,
1012,
10663,
1006,
19204,
1010,
3642,
1007,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_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_service_type_info_by_name | def get_deployed_service_type_info_by_name(node_name, application_id, service_type_name, service_manifest_name:nil, timeout:60, custom_headers:nil)
response = get_deployed_service_type_info_by_name_async(node_name, application_id, service_type_name, service_manifest_name:service_manifest_name, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_deployed_service_type_info_by_name(node_name, application_id, service_type_name, service_manifest_name:nil, timeout:60, custom_headers:nil)
response = get_deployed_service_type_info_by_name_async(node_name, application_id, service_type_name, service_manifest_name:service_manifest_name, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_deployed_service_type_info_by_name",
"(",
"node_name",
",",
"application_id",
",",
"service_type_name",
",",
"service_manifest_name",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_deployed_service_type_i... | Gets the information about a specified service type of the application
deployed on a node in a Service Fabric cluster.
Gets the list containing the information about a specific service type from
the applications deployed on a node in a Service Fabric cluster. The response
includes the name of the service type, its registration status, the code
package that registered it and activation ID of the service package. Each
entry represents one activation of a service type, differentiated by the
activation ID.
@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 service_type_name [String] Specifies the name of a Service Fabric
service type.
@param service_manifest_name [String] The name of the service manifest to
filter the list of deployed service type information. If specified, the
response will only contain the information about service types that are
defined in this service manifest.
@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 [Array] operation results. | [
"Gets",
"the",
"information",
"about",
"a",
"specified",
"service",
"type",
"of",
"the",
"application",
"deployed",
"on",
"a",
"node",
"in",
"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#L5901-L5904 | train | Gets the service type information for a service type. | [
30522,
13366,
2131,
1035,
7333,
1035,
2326,
1035,
2828,
1035,
18558,
1035,
2011,
1035,
2171,
1006,
13045,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
2326,
1035,
2828,
1035,
2171,
1010,
2326,
1035,
19676,
1035,
2171,
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_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.copy_image_store_content | def copy_image_store_content(image_store_copy_description, timeout:60, custom_headers:nil)
response = copy_image_store_content_async(image_store_copy_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def copy_image_store_content(image_store_copy_description, timeout:60, custom_headers:nil)
response = copy_image_store_content_async(image_store_copy_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"copy_image_store_content",
"(",
"image_store_copy_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"copy_image_store_content_async",
"(",
"image_store_copy_description",
",",
"timeout",
":",
"timeout",
",",
"custo... | Copies image store content internally
Copies the image store content from the source image store relative path to
the destination image store relative path.
@param image_store_copy_description [ImageStoreCopyDescription] Describes the
copy description for the image store.
@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. | [
"Copies",
"image",
"store",
"content",
"internally"
] | 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#L19622-L19625 | train | Copy image store content to an image store. | [
30522,
13366,
6100,
1035,
3746,
1035,
3573,
1035,
4180,
1006,
3746,
1035,
3573,
1035,
6100,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
6100,
1035,
3746,
1035,
3573,
1035,
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... |
mongodb/mongo-ruby-driver | lib/mongo/collection.rb | Mongo.Collection.create | def create(opts = {})
operation = { :create => name }.merge(options)
operation.delete(:write)
server = next_primary
if (options[:collation] || options[Operation::COLLATION]) && !server.features.collation_enabled?
raise Error::UnsupportedCollation.new
end
client.send(:with_session, opts) do |session|
Operation::Create.new({
selector: operation,
db_name: database.name,
write_concern: write_concern,
session: session
}).execute(server)
end
end | ruby | def create(opts = {})
operation = { :create => name }.merge(options)
operation.delete(:write)
server = next_primary
if (options[:collation] || options[Operation::COLLATION]) && !server.features.collation_enabled?
raise Error::UnsupportedCollation.new
end
client.send(:with_session, opts) do |session|
Operation::Create.new({
selector: operation,
db_name: database.name,
write_concern: write_concern,
session: session
}).execute(server)
end
end | [
"def",
"create",
"(",
"opts",
"=",
"{",
"}",
")",
"operation",
"=",
"{",
":create",
"=>",
"name",
"}",
".",
"merge",
"(",
"options",
")",
"operation",
".",
"delete",
"(",
":write",
")",
"server",
"=",
"next_primary",
"if",
"(",
"options",
"[",
":coll... | Force the collection to be created in the database.
@example Force the collection to be created.
collection.create
@param [ Hash ] opts The options for the create operation.
@option options [ Session ] :session The session to use for the operation.
@return [ Result ] The result of the command.
@since 2.0.0 | [
"Force",
"the",
"collection",
"to",
"be",
"created",
"in",
"the",
"database",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/collection.rb#L184-L199 | train | Create a new database | [
30522,
13366,
3443,
1006,
23569,
2015,
1027,
1063,
1065,
1007,
3169,
1027,
1063,
1024,
3443,
1027,
1028,
2171,
1065,
1012,
13590,
1006,
7047,
1007,
3169,
1012,
3972,
12870,
1006,
1024,
4339,
1007,
8241,
1027,
2279,
1035,
3078,
2065,
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_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb | Azure::Storage::Mgmt::V2018_11_01.StorageAccounts.list_service_sas_with_http_info | def list_service_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
list_service_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
end | ruby | def list_service_sas_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
list_service_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"list_service_sas_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"list_service_sas_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"parameters",
",",
"custom_headers",
":cus... | List service SAS credentials of a specific resource.
@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 parameters [ServiceSasParameters] The parameters to provide to list
service SAS credentials.
@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",
"service",
"SAS",
"credentials",
"of",
"a",
"specific",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb#L1130-L1132 | train | Gets the SAS of the specified service account. | [
30522,
13366,
2862,
1035,
2326,
1035,
21871,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
1035,
2326,
1035,
21871,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.list_data_lake_store_accounts_with_http_info | def list_data_lake_store_accounts_with_http_info(resource_group_name, account_name, filter:nil, top:nil, skip:nil, expand:nil, select:nil, orderby:nil, count:nil, search:nil, format:nil, custom_headers:nil)
list_data_lake_store_accounts_async(resource_group_name, account_name, filter:filter, top:top, skip:skip, expand:expand, select:select, orderby:orderby, count:count, search:search, format:format, custom_headers:custom_headers).value!
end | ruby | def list_data_lake_store_accounts_with_http_info(resource_group_name, account_name, filter:nil, top:nil, skip:nil, expand:nil, select:nil, orderby:nil, count:nil, search:nil, format:nil, custom_headers:nil)
list_data_lake_store_accounts_async(resource_group_name, account_name, filter:filter, top:top, skip:skip, expand:expand, select:select, orderby:orderby, count:count, search:search, format:format, custom_headers:custom_headers).value!
end | [
"def",
"list_data_lake_store_accounts_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"filter",
":",
"nil",
",",
"top",
":",
"nil",
",",
"skip",
":",
"nil",
",",
"expand",
":",
"nil",
",",
"select",
":",
"nil",
",",
"orderby",
":",
"ni... | Gets the first page of Data Lake Store accounts linked to the specified Data
Lake Analytics account. The response includes a link to the next page, if
any.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Analytics account.
@param account_name [String] The name of the Data Lake Analytics account for
which to list Data Lake Store accounts.
@param filter [String] OData filter. Optional.
@param top [Integer] The number of items to return. Optional.
@param skip [Integer] The number of items to skip over before returning
elements. Optional.
@param expand [String] OData expansion. Expand related resources in line with
the retrieved resources, e.g. Categories/$expand=Products would expand
Product data in line with each Category entry. Optional.
@param select [String] OData Select statement. Limits the properties on each
entry to just those requested, e.g.
Categories?$select=CategoryName,Description. Optional.
@param orderby [String] OrderBy clause. One or more comma-separated
expressions with an optional "asc" (the default) or "desc" depending on the
order you'd like the values sorted, e.g. Categories?$orderby=CategoryName
desc. Optional.
@param count [Boolean] The Boolean value of true or false to request a count
of the matching resources included with the resources in the response, e.g.
Categories?$count=true. Optional.
@param search [String] A free form search. A free-text search expression to
match for whether a particular entry should be included in the feed, e.g.
Categories?$search=blue OR green. Optional.
@param format [String] The desired return format. Return the response in
particular formatxii without access to request headers for standard
content-type negotiation (e.g Orders?$format=json). Optional.
@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",
"first",
"page",
"of",
"Data",
"Lake",
"Store",
"accounts",
"linked",
"to",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L1357-L1359 | train | Gets the list of data lake store accounts. | [
30522,
13366,
2862,
1035,
2951,
1035,
2697,
1035,
3573,
1035,
6115,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
13558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/user.rb | Aws::IAM.User.detach_policy | def detach_policy(options = {})
options = options.merge(user_name: @name)
resp = @client.detach_user_policy(options)
resp.data
end | ruby | def detach_policy(options = {})
options = options.merge(user_name: @name)
resp = @client.detach_user_policy(options)
resp.data
end | [
"def",
"detach_policy",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"user_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"detach_user_policy",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
user.detach_policy({
policy_arn: "arnType", # required
})
@param [Hash] options ({})
@option options [required, String] :policy_arn
The Amazon Resource Name (ARN) of the IAM policy you want to detach.
For more information about ARNs, see [Amazon Resource Names (ARNs) and
AWS Service Namespaces][1] in the *AWS General Reference*.
[1]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/user.rb#L531-L535 | train | Detach policy from user | [
30522,
13366,
20010,
6776,
1035,
3343,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
5310,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
20010,
6776,
1035,
5310,
1035,
3343,
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_resources_management/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups.rb | Azure::ResourcesManagement::Mgmt::V2017_11_01_preview.ManagementGroups.get_with_http_info | def get_with_http_info(group_id, expand:nil, recurse:nil, cache_control:'no-cache', custom_headers:nil)
get_async(group_id, expand:expand, recurse:recurse, cache_control:cache_control, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(group_id, expand:nil, recurse:nil, cache_control:'no-cache', custom_headers:nil)
get_async(group_id, expand:expand, recurse:recurse, cache_control:cache_control, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"group_id",
",",
"expand",
":",
"nil",
",",
"recurse",
":",
"nil",
",",
"cache_control",
":",
"'no-cache'",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"group_id",
",",
"expand",
":",
"expand",
",",
"recurse",
... | Get the details of the management group.
@param group_id [String] Management Group ID.
@param expand [Enum] The $expand=children query string parameter allows
clients to request inclusion of children in the response payload. Possible
values include: 'children'
@param recurse [Boolean] The $recurse=true query string parameter allows
clients to request inclusion of entire hierarchy in the response payload.
@param cache_control [String] Indicates that the request shouldn't utilize
any caches.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Get",
"the",
"details",
"of",
"the",
"management",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources_management/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups.rb#L177-L179 | train | Gets the group s coverages. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2177,
1035,
8909,
1010,
7818,
1024,
9152,
2140,
1010,
28667,
28393,
1024,
9152,
2140,
1010,
17053,
1035,
2491,
1024,
1005,
2053,
1011,
17053,
1005,
1010,
7661,
1035,
20346,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.get_closed_list_entity_role | def get_closed_list_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = get_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_closed_list_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = get_closed_list_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_closed_list_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_closed_list_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id"... | Get one role for a given list entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id entity ID.
@param role_id entity role ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EntityRole] operation results. | [
"Get",
"one",
"role",
"for",
"a",
"given",
"list",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L9403-L9406 | train | Gets the role of the entity in a version of the application. | [
30522,
13366,
2131,
1035,
2701,
1035,
2862,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
refinery/refinerycms | core/app/helpers/refinery/tag_helper.rb | Refinery.TagHelper.refinery_help_tag | def refinery_help_tag(title='Tip')
title = title.html_safe? ? title : h(title)
action_icon(:info, '#', title, {tooltip: title})
end | ruby | def refinery_help_tag(title='Tip')
title = title.html_safe? ? title : h(title)
action_icon(:info, '#', title, {tooltip: title})
end | [
"def",
"refinery_help_tag",
"(",
"title",
"=",
"'Tip'",
")",
"title",
"=",
"title",
".",
"html_safe?",
"?",
"title",
":",
"h",
"(",
"title",
")",
"action_icon",
"(",
":info",
",",
"'#'",
",",
"title",
",",
"{",
"tooltip",
":",
"title",
"}",
")",
"end... | Returns <img class='help' tooltip='Your Input' src='refinery/icons/information.png' />
Remember to wrap your block with <span class='label_with_help'></span> if you're using a label next to the help tag. | [
"Returns",
"<img",
"class",
"=",
"help",
"tooltip",
"=",
"Your",
"Input",
"src",
"=",
"refinery",
"/",
"icons",
"/",
"information",
".",
"png",
"/",
">",
"Remember",
"to",
"wrap",
"your",
"block",
"with",
"<span",
"class",
"=",
"label_with_help",
">",
"<... | 67f117f937c5264ec0aeabe8e7eac1d562c5bc7b | https://github.com/refinery/refinerycms/blob/67f117f937c5264ec0aeabe8e7eac1d562c5bc7b/core/app/helpers/refinery/tag_helper.rb#L7-L10 | train | Returns a refinery help tag | [
30522,
13366,
21034,
1035,
2393,
1035,
6415,
1006,
2516,
1027,
1005,
5955,
1005,
1007,
2516,
1027,
2516,
1012,
16129,
1035,
3647,
1029,
1029,
2516,
1024,
1044,
1006,
2516,
1007,
2895,
1035,
12696,
1006,
1024,
18558,
1010,
1005,
1001,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.ImageList.read | def read(*files, &block)
Kernel.raise ArgumentError, 'no files given' if files.length.zero?
files.each do |f|
Magick::Image.read(f, &block).each { |n| @images << n }
end
@scene = length - 1
self
end | ruby | def read(*files, &block)
Kernel.raise ArgumentError, 'no files given' if files.length.zero?
files.each do |f|
Magick::Image.read(f, &block).each { |n| @images << n }
end
@scene = length - 1
self
end | [
"def",
"read",
"(",
"*",
"files",
",",
"&",
"block",
")",
"Kernel",
".",
"raise",
"ArgumentError",
",",
"'no files given'",
"if",
"files",
".",
"length",
".",
"zero?",
"files",
".",
"each",
"do",
"|",
"f",
"|",
"Magick",
"::",
"Image",
".",
"read",
"... | Read files and concatenate the new images | [
"Read",
"files",
"and",
"concatenate",
"the",
"new",
"images"
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L1659-L1666 | train | Reads a file or a list of images from the given directory. | [
30522,
13366,
3191,
1006,
1008,
6764,
1010,
1004,
3796,
1007,
16293,
1012,
5333,
6685,
2121,
29165,
1010,
1005,
2053,
6764,
2445,
1005,
2065,
6764,
1012,
3091,
1012,
5717,
1029,
6764,
1012,
2169,
2079,
1064,
1042,
1064,
3894,
2243,
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... |
rails/sprockets | lib/sprockets/manifest_utils.rb | Sprockets.ManifestUtils.find_directory_manifest | def find_directory_manifest(dirname)
entries = File.directory?(dirname) ? Dir.entries(dirname) : []
entry = entries.find { |e| e =~ MANIFEST_RE } ||
generate_manifest_path
File.join(dirname, entry)
end | ruby | def find_directory_manifest(dirname)
entries = File.directory?(dirname) ? Dir.entries(dirname) : []
entry = entries.find { |e| e =~ MANIFEST_RE } ||
generate_manifest_path
File.join(dirname, entry)
end | [
"def",
"find_directory_manifest",
"(",
"dirname",
")",
"entries",
"=",
"File",
".",
"directory?",
"(",
"dirname",
")",
"?",
"Dir",
".",
"entries",
"(",
"dirname",
")",
":",
"[",
"]",
"entry",
"=",
"entries",
".",
"find",
"{",
"|",
"e",
"|",
"e",
"=~"... | Public: Find or pick a new manifest filename for target build directory.
dirname - String dirname
Examples
find_directory_manifest("/app/public/assets")
# => "/app/public/assets/.sprockets-manifest-abc123.json"
Returns String filename. | [
"Public",
":",
"Find",
"or",
"pick",
"a",
"new",
"manifest",
"filename",
"for",
"target",
"build",
"directory",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/manifest_utils.rb#L36-L41 | train | Find the manifest file in the given directory | [
30522,
13366,
2424,
1035,
14176,
1035,
19676,
1006,
16101,
18442,
1007,
10445,
1027,
5371,
1012,
14176,
1029,
1006,
16101,
18442,
1007,
1029,
16101,
1012,
10445,
1006,
16101,
18442,
1007,
1024,
1031,
1033,
4443,
1027,
10445,
1012,
2424,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongoid | lib/mongoid/serializable.rb | Mongoid.Serializable.serialize_attribute | def serialize_attribute(attrs, name, names, options)
if relations.key?(name)
value = send(name)
attrs[name] = value ? value.serializable_hash(options) : nil
elsif names.include?(name) && !fields.key?(name)
attrs[name] = read_raw_attribute(name)
elsif !attribute_missing?(name)
attrs[name] = send(name)
end
end | ruby | def serialize_attribute(attrs, name, names, options)
if relations.key?(name)
value = send(name)
attrs[name] = value ? value.serializable_hash(options) : nil
elsif names.include?(name) && !fields.key?(name)
attrs[name] = read_raw_attribute(name)
elsif !attribute_missing?(name)
attrs[name] = send(name)
end
end | [
"def",
"serialize_attribute",
"(",
"attrs",
",",
"name",
",",
"names",
",",
"options",
")",
"if",
"relations",
".",
"key?",
"(",
"name",
")",
"value",
"=",
"send",
"(",
"name",
")",
"attrs",
"[",
"name",
"]",
"=",
"value",
"?",
"value",
".",
"seriali... | Serialize a single attribute. Handles associations, fields, and dynamic
attributes.
@api private
@example Serialize the attribute.
document.serialize_attribute({}, "id" , [ "id" ])
@param [ Hash ] attrs The attributes.
@param [ String ] name The attribute name.
@param [ Array<String> ] names The names of all attributes.
@param [ Hash ] options The options.
@return [ Object ] The attribute.
@since 3.0.0 | [
"Serialize",
"a",
"single",
"attribute",
".",
"Handles",
"associations",
"fields",
"and",
"dynamic",
"attributes",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/serializable.rb#L100-L109 | train | serializes a single attribute | [
30522,
13366,
7642,
4697,
1035,
17961,
1006,
2012,
16344,
2015,
1010,
2171,
1010,
3415,
1010,
7047,
1007,
2065,
4262,
1012,
3145,
1029,
1006,
2171,
1007,
3643,
1027,
4604,
1006,
2171,
1007,
2012,
16344,
2015,
1031,
2171,
1033,
1027,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_links/lib/2016-09-01/generated/azure_mgmt_links/resource_links.rb | Azure::Links::Mgmt::V2016_09_01.ResourceLinks.list_at_source_scope_next | def list_at_source_scope_next(next_page_link, custom_headers:nil)
response = list_at_source_scope_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_at_source_scope_next(next_page_link, custom_headers:nil)
response = list_at_source_scope_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_at_source_scope_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_at_source_scope_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",... | Gets a list of resource links at and below the specified source scope.
@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 [ResourceLinkResult] operation results. | [
"Gets",
"a",
"list",
"of",
"resource",
"links",
"at",
"and",
"below",
"the",
"specified",
"source",
"scope",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_links/lib/2016-09-01/generated/azure_mgmt_links/resource_links.rb#L629-L632 | train | Gets the list of a specific language. | [
30522,
13366,
2862,
1035,
2012,
1035,
3120,
1035,
9531,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2012,
1035,
3120,
1035,
9531,
1035,
2279,
1035,
2004,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/presents_attributes.rb | Hyrax.PresentsAttributes.attribute_to_html | def attribute_to_html(field, options = {})
unless respond_to?(field)
Rails.logger.warn("#{self.class} attempted to render #{field}, but no method exists with that name.")
return
end
if options[:html_dl]
renderer_for(field, options).new(field, send(field), options).render_dl_row
else
renderer_for(field, options).new(field, send(field), options).render
end
end | ruby | def attribute_to_html(field, options = {})
unless respond_to?(field)
Rails.logger.warn("#{self.class} attempted to render #{field}, but no method exists with that name.")
return
end
if options[:html_dl]
renderer_for(field, options).new(field, send(field), options).render_dl_row
else
renderer_for(field, options).new(field, send(field), options).render
end
end | [
"def",
"attribute_to_html",
"(",
"field",
",",
"options",
"=",
"{",
"}",
")",
"unless",
"respond_to?",
"(",
"field",
")",
"Rails",
".",
"logger",
".",
"warn",
"(",
"\"#{self.class} attempted to render #{field}, but no method exists with that name.\"",
")",
"return",
"... | Present the attribute as an HTML table row or dl row.
@param [Hash] options
@option options [Symbol] :render_as use an alternate renderer
(e.g., :linked or :linked_attribute to use LinkedAttributeRenderer)
@option options [String] :search_field If the method_name of the attribute is different than
how the attribute name should appear on the search URL,
you can explicitly set the URL's search field name
@option options [String] :label The default label for the field if no translation is found
@option options [TrueClass, FalseClass] :include_empty should we display a row if there are no values?
@option options [String] :work_type name of work type class (e.g., "GenericWork") | [
"Present",
"the",
"attribute",
"as",
"an",
"HTML",
"table",
"row",
"or",
"dl",
"row",
"."
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/presenters/hyrax/presents_attributes.rb#L15-L26 | train | Render the given attribute to HTML. | [
30522,
13366,
17961,
1035,
2000,
1035,
16129,
1006,
2492,
1010,
7047,
1027,
1063,
1065,
1007,
4983,
6869,
1035,
2000,
1029,
1006,
2492,
1007,
15168,
1012,
8833,
4590,
1012,
11582,
1006,
1000,
1001,
1063,
2969,
1012,
2465,
1065,
4692,
2000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dry-rb/dry-initializer | lib/dry/initializer/dsl.rb | Dry::Initializer.DSL.[] | def [](undefined: true, **)
null = (undefined == false) ? nil : UNDEFINED
Module.new.tap do |mod|
mod.extend DSL
mod.include self
mod.send(:instance_variable_set, :@null, null)
end
end | ruby | def [](undefined: true, **)
null = (undefined == false) ? nil : UNDEFINED
Module.new.tap do |mod|
mod.extend DSL
mod.include self
mod.send(:instance_variable_set, :@null, null)
end
end | [
"def",
"[]",
"(",
"undefined",
":",
"true",
",",
"**",
")",
"null",
"=",
"(",
"undefined",
"==",
"false",
")",
"?",
"nil",
":",
"UNDEFINED",
"Module",
".",
"new",
".",
"tap",
"do",
"|",
"mod",
"|",
"mod",
".",
"extend",
"DSL",
"mod",
".",
"includ... | Returns a version of the module with custom settings
@option settings [Boolean] :undefined
If unassigned params and options should be treated different from nil
@return [Dry::Initializer] | [
"Returns",
"a",
"version",
"of",
"the",
"module",
"with",
"custom",
"settings"
] | 422d331468602ff0d3543fbb336b784343e5cc31 | https://github.com/dry-rb/dry-initializer/blob/422d331468602ff0d3543fbb336b784343e5cc31/lib/dry/initializer/dsl.rb#L12-L19 | train | Returns a new object with the current object as the first argument. | [
30522,
13366,
1031,
1033,
1006,
6151,
28344,
1024,
2995,
1010,
1008,
1008,
1007,
19701,
1027,
1006,
6151,
28344,
1027,
1027,
6270,
1007,
1029,
9152,
2140,
1024,
6151,
28344,
11336,
1012,
2047,
1012,
11112,
2079,
1064,
16913,
1064,
16913,
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... |
ruby-protobuf/protobuf | lib/protobuf/message.rb | Protobuf.Message.clear! | def clear!
@values.delete_if do |_, value|
if value.is_a?(::Protobuf::Field::FieldArray) || value.is_a?(::Protobuf::Field::FieldHash)
value.clear
false
else
true
end
end
self
end | ruby | def clear!
@values.delete_if do |_, value|
if value.is_a?(::Protobuf::Field::FieldArray) || value.is_a?(::Protobuf::Field::FieldHash)
value.clear
false
else
true
end
end
self
end | [
"def",
"clear!",
"@values",
".",
"delete_if",
"do",
"|",
"_",
",",
"value",
"|",
"if",
"value",
".",
"is_a?",
"(",
"::",
"Protobuf",
"::",
"Field",
"::",
"FieldArray",
")",
"||",
"value",
".",
"is_a?",
"(",
"::",
"Protobuf",
"::",
"Field",
"::",
"Fie... | Constructor
Public Instance Methods | [
"Constructor"
] | a2e0cbb783d49d37648c07d795dc4f7eb8d14eb1 | https://github.com/ruby-protobuf/protobuf/blob/a2e0cbb783d49d37648c07d795dc4f7eb8d14eb1/lib/protobuf/message.rb#L41-L51 | train | Clear all the fields in the field. | [
30522,
13366,
3154,
999,
1030,
5300,
1012,
3972,
12870,
1035,
2065,
2079,
1064,
1035,
1010,
3643,
1064,
2065,
3643,
1012,
2003,
1035,
1037,
1029,
1006,
1024,
1024,
15053,
8569,
2546,
1024,
1024,
2492,
1024,
1024,
2492,
2906,
9447,
1007,
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... |
puppetlabs/puppet | lib/puppet/util/logging.rb | Puppet::Util.Logging.debug | def debug(*args)
return nil unless Puppet::Util::Log.level == :debug
if block_given?
send_log(:debug, yield(*args))
else
send_log(:debug, args.join(" "))
end
end | ruby | def debug(*args)
return nil unless Puppet::Util::Log.level == :debug
if block_given?
send_log(:debug, yield(*args))
else
send_log(:debug, args.join(" "))
end
end | [
"def",
"debug",
"(",
"*",
"args",
")",
"return",
"nil",
"unless",
"Puppet",
"::",
"Util",
"::",
"Log",
".",
"level",
"==",
":debug",
"if",
"block_given?",
"send_log",
"(",
":debug",
",",
"yield",
"(",
"args",
")",
")",
"else",
"send_log",
"(",
":debug"... | Output a debug log message if debugging is on (but only then)
If the output is anything except a static string, give the debug
a block - it will be called with all other arguments, and is expected
to return the single string result.
Use a block at all times for increased performance.
@example This takes 40% of the time compared to not using a block
Puppet.debug { "This is a string that interpolated #{x} and #{y} }" | [
"Output",
"a",
"debug",
"log",
"message",
"if",
"debugging",
"is",
"on",
"(",
"but",
"only",
"then",
")",
"If",
"the",
"output",
"is",
"anything",
"except",
"a",
"static",
"string",
"give",
"the",
"debug",
"a",
"block",
"-",
"it",
"will",
"be",
"called... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/logging.rb#L34-L41 | train | debug method | [
30522,
13366,
2139,
8569,
2290,
1006,
1008,
12098,
5620,
1007,
2709,
9152,
2140,
4983,
13997,
1024,
1024,
21183,
4014,
1024,
1024,
8833,
1012,
2504,
1027,
1027,
1024,
2139,
8569,
2290,
2065,
3796,
1035,
2445,
1029,
4604,
1035,
8833,
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... |
daddyz/phonelib | lib/phonelib/phone_analyzer.rb | Phonelib.PhoneAnalyzer.parse_single_country | def parse_single_country(e164, data)
valid_match = phone_match_data?(e164, data)
if valid_match
national_and_data(data, valid_match)
else
possible_match = phone_match_data?(e164, data, true)
possible_match && national_and_data(data, possible_match, true)
end
end | ruby | def parse_single_country(e164, data)
valid_match = phone_match_data?(e164, data)
if valid_match
national_and_data(data, valid_match)
else
possible_match = phone_match_data?(e164, data, true)
possible_match && national_and_data(data, possible_match, true)
end
end | [
"def",
"parse_single_country",
"(",
"e164",
",",
"data",
")",
"valid_match",
"=",
"phone_match_data?",
"(",
"e164",
",",
"data",
")",
"if",
"valid_match",
"national_and_data",
"(",
"data",
",",
"valid_match",
")",
"else",
"possible_match",
"=",
"phone_match_data?"... | method checks if phone is valid against single provided country data
==== Attributes
* +e164+ - e164 representation of phone for parsing
* +data+ - country data for single country for parsing | [
"method",
"checks",
"if",
"phone",
"is",
"valid",
"against",
"single",
"provided",
"country",
"data"
] | aa0023eab7c896b71275bf342bc7f49735cbdbbf | https://github.com/daddyz/phonelib/blob/aa0023eab7c896b71275bf342bc7f49735cbdbbf/lib/phonelib/phone_analyzer.rb#L90-L98 | train | Parse single country data | [
30522,
13366,
11968,
3366,
1035,
2309,
1035,
2406,
1006,
1041,
16048,
2549,
1010,
2951,
1007,
9398,
1035,
2674,
1027,
3042,
1035,
2674,
1035,
2951,
1029,
1006,
1041,
16048,
2549,
1010,
2951,
1007,
2065,
9398,
1035,
2674,
2120,
1035,
1998,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_filter_rules.rb | Azure::Network::Mgmt::V2018_07_01.RouteFilterRules.list_by_route_filter_next | def list_by_route_filter_next(next_page_link, custom_headers:nil)
response = list_by_route_filter_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_route_filter_next(next_page_link, custom_headers:nil)
response = list_by_route_filter_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_route_filter_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_route_filter_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",... | Gets all RouteFilterRules in a route filter.
@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 [RouteFilterRuleListResult] operation results. | [
"Gets",
"all",
"RouteFilterRules",
"in",
"a",
"route",
"filter",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_filter_rules.rb#L673-L676 | train | Gets a list of all the elastic route terms under a route. | [
30522,
13366,
2862,
1035,
2011,
1035,
2799,
1035,
11307,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
2799,
1035,
11307,
1035,
2279,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/auto_scaling_group.rb | Aws::AutoScaling.AutoScalingGroup.disable_metrics_collection | def disable_metrics_collection(options = {})
options = options.merge(auto_scaling_group_name: @name)
resp = @client.disable_metrics_collection(options)
resp.data
end | ruby | def disable_metrics_collection(options = {})
options = options.merge(auto_scaling_group_name: @name)
resp = @client.disable_metrics_collection(options)
resp.data
end | [
"def",
"disable_metrics_collection",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"auto_scaling_group_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"disable_metrics_collection",
"(",
"options",
")",
"resp",
".",
"d... | @example Request syntax with placeholder values
auto_scaling_group.disable_metrics_collection({
metrics: ["XmlStringMaxLen255"],
})
@param [Hash] options ({})
@option options [Array<String>] :metrics
One or more of the following metrics. If you omit this parameter, all
metrics are disabled.
* `GroupMinSize`
* `GroupMaxSize`
* `GroupDesiredCapacity`
* `GroupInServiceInstances`
* `GroupPendingInstances`
* `GroupStandbyInstances`
* `GroupTerminatingInstances`
* `GroupTotalInstances`
@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#L460-L464 | train | Disables the metrics collection | [
30522,
13366,
4487,
19150,
1035,
12046,
2015,
1035,
3074,
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,
4487,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/filter.rb | ActiveInteraction.Filter.cast | def cast(value, _interaction)
case value
when NilClass
raise MissingValueError, name unless default?
nil
else
raise InvalidValueError, "#{name}: #{describe(value)}"
end
end | ruby | def cast(value, _interaction)
case value
when NilClass
raise MissingValueError, name unless default?
nil
else
raise InvalidValueError, "#{name}: #{describe(value)}"
end
end | [
"def",
"cast",
"(",
"value",
",",
"_interaction",
")",
"case",
"value",
"when",
"NilClass",
"raise",
"MissingValueError",
",",
"name",
"unless",
"default?",
"nil",
"else",
"raise",
"InvalidValueError",
",",
"\"#{name}: #{describe(value)}\"",
"end",
"end"
] | @param value [Object]
@param _interaction [Base, nil]
@return [Object]
@raise [MissingValueError] If the value is missing and there is no
default.
@raise [InvalidValueError] If the value is invalid.
@private | [
"@param",
"value",
"[",
"Object",
"]",
"@param",
"_interaction",
"[",
"Base",
"nil",
"]"
] | fdc00a041e939ef48948baa2f7fd1ce2e4d66982 | https://github.com/AaronLasseigne/active_interaction/blob/fdc00a041e939ef48948baa2f7fd1ce2e4d66982/lib/active_interaction/filter.rb#L175-L184 | train | Casts a value to a valid type. | [
30522,
13366,
3459,
1006,
3643,
1010,
1035,
8290,
1007,
2553,
3643,
2043,
9152,
15472,
27102,
5333,
4394,
10175,
5657,
2121,
29165,
1010,
2171,
4983,
12398,
1029,
9152,
2140,
2842,
5333,
19528,
10175,
5657,
2121,
29165,
1010,
1000,
1001,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.