repo stringclasses 237 values | path stringlengths 11 168 | func_name stringlengths 10 147 | original_string stringlengths 79 124k | language stringclasses 1 value | code stringlengths 79 124k | code_tokens listlengths 16 45.3k | docstring stringlengths 4 23.5k | docstring_tokens listlengths 1 452 | sha stringclasses 237 values | url stringlengths 95 268 | partition stringclasses 1 value | summary stringlengths 8 229 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
david942j/one_gadget | lib/one_gadget/cli.rb | OneGadget.CLI.display_gadgets | def display_gadgets(gadgets, raw)
if raw
show(gadgets.map(&:offset).join(' '))
else
show(gadgets.map(&:inspect).join("\n"))
end
end | ruby | def display_gadgets(gadgets, raw)
if raw
show(gadgets.map(&:offset).join(' '))
else
show(gadgets.map(&:inspect).join("\n"))
end
end | [
"def",
"display_gadgets",
"(",
"gadgets",
",",
"raw",
")",
"if",
"raw",
"show",
"(",
"gadgets",
".",
"map",
"(",
":offset",
")",
".",
"join",
"(",
"' '",
")",
")",
"else",
"show",
"(",
"gadgets",
".",
"map",
"(",
":inspect",
")",
".",
"join",
"(",
... | Writes gadgets to stdout.
@param [Array<OneGadget::Gadget::Gadget>] gadgets
@param [Boolean] raw
In raw mode, only the offset of gadgets are printed.
@return [true] | [
"Writes",
"gadgets",
"to",
"stdout",
"."
] | ff6ef04541e83441bfe3c2664a6febd1640f4263 | https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/cli.rb#L177-L183 | train | displays the gadgets | [
30522,
13366,
4653,
1035,
11721,
28682,
1006,
11721,
28682,
1010,
6315,
1007,
2065,
6315,
2265,
1006,
11721,
28682,
1012,
4949,
1006,
1004,
1024,
16396,
1007,
1012,
3693,
1006,
1005,
1005,
1007,
1007,
2842,
2265,
1006,
11721,
28682,
1012,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/data/user.rb | Discordrb.User.update_presence | def update_presence(data)
@status = data['status'].to_sym
if data['game']
game = data['game']
@game = game['name']
@stream_url = game['url']
@stream_type = game['type']
else
@game = @stream_url = @stream_type = nil
end
end | ruby | def update_presence(data)
@status = data['status'].to_sym
if data['game']
game = data['game']
@game = game['name']
@stream_url = game['url']
@stream_type = game['type']
else
@game = @stream_url = @stream_type = nil
end
end | [
"def",
"update_presence",
"(",
"data",
")",
"@status",
"=",
"data",
"[",
"'status'",
"]",
".",
"to_sym",
"if",
"data",
"[",
"'game'",
"]",
"game",
"=",
"data",
"[",
"'game'",
"]",
"@game",
"=",
"game",
"[",
"'name'",
"]",
"@stream_url",
"=",
"game",
... | Set the user's presence data
@note for internal use only
@!visibility private | [
"Set",
"the",
"user",
"s",
"presence",
"data"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/user.rb#L122-L134 | train | Update the presence of the game. | [
30522,
13366,
10651,
1035,
3739,
1006,
2951,
1007,
1030,
3570,
1027,
2951,
1031,
1005,
3570,
1005,
1033,
1012,
2000,
1035,
25353,
2213,
2065,
2951,
1031,
1005,
2208,
1005,
1033,
2208,
1027,
2951,
1031,
1005,
2208,
1005,
1033,
1030,
2208,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_sqlvirtualmachine/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machines.rb | Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview.SqlVirtualMachines.get_with_http_info | def get_with_http_info(resource_group_name, sql_virtual_machine_name, expand:nil, custom_headers:nil)
get_async(resource_group_name, sql_virtual_machine_name, expand:expand, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, sql_virtual_machine_name, expand:nil, custom_headers:nil)
get_async(resource_group_name, sql_virtual_machine_name, expand:expand, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"sql_virtual_machine_name",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"sql_virtual_machine_name",
",",
"expand",
":",
"expand",
",",
... | Gets a SQL virtual machine.
@param resource_group_name [String] Name of the resource group that contains
the resource. You can obtain this value from the Azure Resource Manager API
or the portal.
@param sql_virtual_machine_name [String] Name of the SQL virtual machine.
@param expand [String] The child resources to include in the response.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"a",
"SQL",
"virtual",
"machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sqlvirtualmachine/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machines.rb#L59-L61 | train | Gets the specified SQL virtual machine s index. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
29296,
1035,
7484,
1035,
3698,
1035,
2171,
1010,
7818,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
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_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_worker_pool_instance_metric_definitions | def list_worker_pool_instance_metric_definitions(resource_group_name, name, worker_pool_name, instance, custom_headers:nil)
first_page = list_worker_pool_instance_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, instance, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_worker_pool_instance_metric_definitions(resource_group_name, name, worker_pool_name, instance, custom_headers:nil)
first_page = list_worker_pool_instance_metric_definitions_as_lazy(resource_group_name, name, worker_pool_name, instance, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_worker_pool_instance_metric_definitions",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"instance",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_worker_pool_instance_metric_definitions_as_lazy",
"(",
"resource_group_name... | Get metric definitions for a specific instance of a worker pool of an App
Service Environment.
Get metric definitions for a specific instance of a worker pool of an App
Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param worker_pool_name [String] Name of the worker pool.
@param instance [String] Name of the instance in the worker pool.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<ResourceMetricDefinition>] operation results. | [
"Get",
"metric",
"definitions",
"for",
"a",
"specific",
"instance",
"of",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L3444-L3447 | train | Gets all metric definitions for a worker pool. | [
30522,
13366,
2862,
1035,
7309,
1035,
4770,
1035,
6013,
1035,
12046,
1035,
15182,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7309,
1035,
4770,
1035,
2171,
1010,
6013,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.get_patterns | def get_patterns(all_patterns, type)
type = Core::FIXED_LINE if type == Core::FIXED_OR_MOBILE
patterns = all_patterns[type]
if patterns
[
type_regex(patterns, Core::POSSIBLE_PATTERN),
type_regex(patterns, Core::VALID_PATTERN)
]
else
[nil, nil]
end
end | ruby | def get_patterns(all_patterns, type)
type = Core::FIXED_LINE if type == Core::FIXED_OR_MOBILE
patterns = all_patterns[type]
if patterns
[
type_regex(patterns, Core::POSSIBLE_PATTERN),
type_regex(patterns, Core::VALID_PATTERN)
]
else
[nil, nil]
end
end | [
"def",
"get_patterns",
"(",
"all_patterns",
",",
"type",
")",
"type",
"=",
"Core",
"::",
"FIXED_LINE",
"if",
"type",
"==",
"Core",
"::",
"FIXED_OR_MOBILE",
"patterns",
"=",
"all_patterns",
"[",
"type",
"]",
"if",
"patterns",
"[",
"type_regex",
"(",
"patterns... | Returns possible and valid patterns for validation for provided type
==== Attributes
* +all_patterns+ - hash of all patterns for validation
* +type+ - type of phone to get patterns for | [
"Returns",
"possible",
"and",
"valid",
"patterns",
"for",
"validation",
"for",
"provided",
"type"
] | aa0023eab7c896b71275bf342bc7f49735cbdbbf | https://github.com/daddyz/phonelib/blob/aa0023eab7c896b71275bf342bc7f49735cbdbbf/lib/phonelib/phone_analyzer.rb#L198-L210 | train | Returns the patterns for a given type. | [
30522,
13366,
2131,
1035,
7060,
1006,
2035,
1035,
7060,
1010,
2828,
1007,
2828,
1027,
4563,
1024,
1024,
4964,
1035,
2240,
2065,
2828,
1027,
1027,
4563,
1024,
1024,
4964,
1035,
2030,
1035,
4684,
7060,
1027,
2035,
1035,
7060,
1031,
2828,
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/2018-07-01/generated/azure_mgmt_network/express_route_cross_connection_peerings.rb | Azure::Network::Mgmt::V2018_07_01.ExpressRouteCrossConnectionPeerings.delete | def delete(resource_group_name, cross_connection_name, peering_name, custom_headers:nil)
response = delete_async(resource_group_name, cross_connection_name, peering_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, cross_connection_name, peering_name, custom_headers:nil)
response = delete_async(resource_group_name, cross_connection_name, peering_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"cross_connection_name",
",",
"peering_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"cross_connection_name",
",",
"peering_name",
",",
"custom_headers",... | Deletes the specified peering from the ExpressRouteCrossConnection.
@param resource_group_name [String] The name of the resource group.
@param cross_connection_name [String] The name of the
ExpressRouteCrossConnection.
@param peering_name [String] The name of the peering.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"peering",
"from",
"the",
"ExpressRouteCrossConnection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/express_route_cross_connection_peerings.rb#L129-L132 | train | Deletes a peering from the specified ExpressRouteCrossConnection. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2892,
1035,
4434,
1035,
2171,
1010,
16740,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_keys.rb | Azure::SQL::Mgmt::V2015_05_01_preview.ServerKeys.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, server_name, key_name, custom_headers:nil)
begin_delete_async(resource_group_name, server_name, key_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, server_name, key_name, custom_headers:nil)
begin_delete_async(resource_group_name, server_name, key_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"key_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"key_name",
",",
"custom_headers",
":custom_headers",
... | Deletes the server key with the given name.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param key_name [String] The name of the server key to be deleted.
@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",
"the",
"server",
"key",
"with",
"the",
"given",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/server_keys.rb#L499-L501 | train | Deletes a key from the specified server. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
3145,
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... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.b | def b(name, identifier={:index => 0}, &block)
standard_methods(name, identifier,'b_for', &block)
define_method(name) do
return platform.b_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | ruby | def b(name, identifier={:index => 0}, &block)
standard_methods(name, identifier,'b_for', &block)
define_method(name) do
return platform.b_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | [
"def",
"b",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'b_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
"return",
"platform"... | adds three methods - one to retrieve the text of a b element, another to
retrieve a b element, and another to check for it's existence.
@example
b(:bold, :id => 'title')
# will generate 'bold', 'bold_element', and 'bold?' methods
@param [Symbol] the name used for the generated methods
@param [Hash] identifier how we find a b.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"text",
"of",
"a",
"b",
"element",
"another",
"to",
"retrieve",
"a",
"b",
"element",
"and",
"another",
"to",
"check",
"for",
"it",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L911-L917 | train | Define a method to return the text for the given element. | [
30522,
13366,
1038,
1006,
2171,
1010,
8909,
4765,
18095,
1027,
1063,
1024,
5950,
1027,
1028,
1014,
1065,
1010,
1004,
3796,
1007,
3115,
1035,
4725,
1006,
2171,
1010,
8909,
4765,
18095,
1010,
1005,
1038,
1035,
2005,
1005,
1010,
1004,
3796,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sensu/sensu | lib/sensu/utilities.rb | Sensu.Utilities.deep_merge | def deep_merge(hash_one, hash_two)
merged = hash_one.dup
hash_two.each do |key, value|
merged[key] = case
when hash_one[key].is_a?(Hash) && value.is_a?(Hash)
deep_merge(hash_one[key], value)
when hash_one[key].is_a?(Array) && value.is_a?(Array)
(hash_one[key] + value).uniq
else
value
end
end
merged
end | ruby | def deep_merge(hash_one, hash_two)
merged = hash_one.dup
hash_two.each do |key, value|
merged[key] = case
when hash_one[key].is_a?(Hash) && value.is_a?(Hash)
deep_merge(hash_one[key], value)
when hash_one[key].is_a?(Array) && value.is_a?(Array)
(hash_one[key] + value).uniq
else
value
end
end
merged
end | [
"def",
"deep_merge",
"(",
"hash_one",
",",
"hash_two",
")",
"merged",
"=",
"hash_one",
".",
"dup",
"hash_two",
".",
"each",
"do",
"|",
"key",
",",
"value",
"|",
"merged",
"[",
"key",
"]",
"=",
"case",
"when",
"hash_one",
"[",
"key",
"]",
".",
"is_a?"... | Deep merge two hashes. Nested hashes are deep merged, arrays are
concatenated and duplicate array items are removed.
@param hash_one [Hash]
@param hash_two [Hash]
@return [Hash] deep merged hash. | [
"Deep",
"merge",
"two",
"hashes",
".",
"Nested",
"hashes",
"are",
"deep",
"merged",
"arrays",
"are",
"concatenated",
"and",
"duplicate",
"array",
"items",
"are",
"removed",
"."
] | 51319e4b58c8d9986f101ad71ff729aa3e51e951 | https://github.com/sensu/sensu/blob/51319e4b58c8d9986f101ad71ff729aa3e51e951/lib/sensu/utilities.rb#L39-L52 | train | Deep merge two hashes | [
30522,
13366,
2784,
1035,
13590,
1006,
23325,
1035,
2028,
1010,
23325,
1035,
2048,
1007,
5314,
1027,
23325,
1035,
2028,
1012,
4241,
2361,
23325,
1035,
2048,
1012,
2169,
2079,
1064,
3145,
1010,
3643,
1064,
5314,
1031,
3145,
1033,
1027,
2553,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_deleted_certificates_as_lazy | def get_deleted_certificates_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_deleted_certificates_as_lazy_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def get_deleted_certificates_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_deleted_certificates_as_lazy_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"get_deleted_certificates_as_lazy",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"get_deleted_certificates_as_lazy_as_lazy",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"cus... | Lists the deleted certificates in the specified vault currently available for
recovery.
The GetDeletedCertificates operation retrieves the certificates in the
current vault which are in a deleted state and ready for recovery or purging.
This operation includes deletion-specific information. This operation
requires the certificates/get/list permission. This operation can only be
enabled on soft-delete enabled vaults.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param maxresults [Integer] Maximum number of results to return in a page. If
not specified the service will return up to 25 results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DeletedCertificateListResult] operation results. | [
"Lists",
"the",
"deleted",
"certificates",
"in",
"the",
"specified",
"vault",
"currently",
"available",
"for",
"recovery",
"."
] | 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#L10445-L10448 | train | Gets the deleted certificates. | [
30522,
13366,
2131,
1035,
17159,
1035,
17987,
1035,
2004,
1035,
13971,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
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... |
square/connect-ruby-sdk | lib/square_connect/api/v1_employees_api.rb | SquareConnect.V1EmployeesApi.delete_timecard | def delete_timecard(timecard_id, opts = {})
data, _status_code, _headers = delete_timecard_with_http_info(timecard_id, opts)
return data
end | ruby | def delete_timecard(timecard_id, opts = {})
data, _status_code, _headers = delete_timecard_with_http_info(timecard_id, opts)
return data
end | [
"def",
"delete_timecard",
"(",
"timecard_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"delete_timecard_with_http_info",
"(",
"timecard_id",
",",
"opts",
")",
"return",
"data",
"end"
] | DeleteTimecard
Deletes a timecard. Timecards can also be deleted through the Square Dashboard. Deleted timecards are still accessible through Connect API endpoints, but cannot be modified. The `deleted` field of the `Timecard` object indicates whether the timecard has been deleted. *Note**: By default, deleted timecards appear alongside valid timecards in results returned by the [ListTimecards](#endpoint-v1employees-listtimecards) endpoint. To filter deleted timecards, include the `deleted` query parameter in the list request. <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 ID of the timecard to delete.
@param [Hash] opts the optional parameters
@return [Object] | [
"DeleteTimecard",
"Deletes",
"a",
"timecard",
".",
"Timecards",
"can",
"also",
"be",
"deleted",
"through",
"the",
"Square",
"Dashboard",
".",
"Deleted",
"timecards",
"are",
"still",
"accessible",
"through",
"Connect",
"API",
"endpoints",
"but",
"cannot",
"be",
"... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_employees_api.rb#L190-L193 | train | Delete a timecard | [
30522,
13366,
3972,
12870,
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,
3972,
12870,
1035,
2051,
11522,
1035,
2007,
1035,
829... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/util/serialized_attributes.rb | Axlsx.SerializedAttributes.serialized_element_attributes | def serialized_element_attributes(str='', additional_attributes=[], &block)
attrs = self.class.xml_element_attributes + additional_attributes
values = instance_values
attrs.each do |attribute_name|
value = values[attribute_name.to_s]
next if value.nil?
value = yield value if block_given?
element_name = Axlsx.camel(attribute_name, false)
str << "<#{element_name}>#{value}</#{element_name}>"
end
str
end | ruby | def serialized_element_attributes(str='', additional_attributes=[], &block)
attrs = self.class.xml_element_attributes + additional_attributes
values = instance_values
attrs.each do |attribute_name|
value = values[attribute_name.to_s]
next if value.nil?
value = yield value if block_given?
element_name = Axlsx.camel(attribute_name, false)
str << "<#{element_name}>#{value}</#{element_name}>"
end
str
end | [
"def",
"serialized_element_attributes",
"(",
"str",
"=",
"''",
",",
"additional_attributes",
"=",
"[",
"]",
",",
"&",
"block",
")",
"attrs",
"=",
"self",
".",
"class",
".",
"xml_element_attributes",
"+",
"additional_attributes",
"values",
"=",
"instance_values",
... | serialized instance values at text nodes on a camelized element of the
attribute name. You may pass in a block for evaluation against non nil
values. We use an array for element attributes becuase misordering will
break the xml and 1.8.7 does not support ordered hashes.
@param [String] str The string instance to which serialized data is appended
@param [Array] additional_attributes An array of additional attribute names.
@return [String] The serialized output. | [
"serialized",
"instance",
"values",
"at",
"text",
"nodes",
"on",
"a",
"camelized",
"element",
"of",
"the",
"attribute",
"name",
".",
"You",
"may",
"pass",
"in",
"a",
"block",
"for",
"evaluation",
"against",
"non",
"nil",
"values",
".",
"We",
"use",
"an",
... | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/util/serialized_attributes.rb#L76-L87 | train | Serialize the attributes of the element. | [
30522,
13366,
27289,
1035,
5783,
1035,
12332,
1006,
2358,
2099,
1027,
1005,
1005,
1010,
3176,
1035,
12332,
1027,
1031,
1033,
1010,
1004,
3796,
1007,
2012,
16344,
2015,
1027,
2969,
1012,
2465,
1012,
20950,
1035,
5783,
1035,
12332,
1009,
3176... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_sas_definitions_as_lazy_with_http_info | def get_sas_definitions_as_lazy_with_http_info(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil)
get_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers).value!
end | ruby | def get_sas_definitions_as_lazy_with_http_info(vault_base_url, storage_account_name, maxresults:nil, custom_headers:nil)
get_sas_definitions_as_lazy_async(vault_base_url, storage_account_name, maxresults:maxresults, custom_headers:custom_headers).value!
end | [
"def",
"get_sas_definitions_as_lazy_with_http_info",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_sas_definitions_as_lazy_async",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"max... | List storage SAS definitions for the given storage account. This operation
requires the storage/listsas permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param storage_account_name [String] The name of the storage account.
@param maxresults [Integer] Maximum number of results to return in a page. If
not specified the service will return up to 25 results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"List",
"storage",
"SAS",
"definitions",
"for",
"the",
"given",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"listsas",
"permission",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L10669-L10671 | train | Gets the SAS definitions for the specified storage account. | [
30522,
13366,
2131,
1035,
21871,
1035,
15182,
1035,
2004,
1035,
13971,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/1.0/document.rb | HQMF1.Document.backfill_derived_code_lists | def backfill_derived_code_lists
data_criteria_by_id = {}
@data_criteria.each {|criteria| data_criteria_by_id[criteria.id] = criteria}
@data_criteria.each do |criteria|
if (criteria.derived_from)
derived_from = data_criteria_by_id[criteria.derived_from]
criteria.definition = derived_from.definition
criteria.status = derived_from.status
criteria.code_list_id = derived_from.code_list_id
end
end
end | ruby | def backfill_derived_code_lists
data_criteria_by_id = {}
@data_criteria.each {|criteria| data_criteria_by_id[criteria.id] = criteria}
@data_criteria.each do |criteria|
if (criteria.derived_from)
derived_from = data_criteria_by_id[criteria.derived_from]
criteria.definition = derived_from.definition
criteria.status = derived_from.status
criteria.code_list_id = derived_from.code_list_id
end
end
end | [
"def",
"backfill_derived_code_lists",
"data_criteria_by_id",
"=",
"{",
"}",
"@data_criteria",
".",
"each",
"{",
"|",
"criteria",
"|",
"data_criteria_by_id",
"[",
"criteria",
".",
"id",
"]",
"=",
"criteria",
"}",
"@data_criteria",
".",
"each",
"do",
"|",
"criteri... | if the data criteria is derived from another criteria, then we want to grab the properties from the derived criteria
this is typically the case with Occurrence A, Occurrence B type data criteria | [
"if",
"the",
"data",
"criteria",
"is",
"derived",
"from",
"another",
"criteria",
"then",
"we",
"want",
"to",
"grab",
"the",
"properties",
"from",
"the",
"derived",
"criteria",
"this",
"is",
"typically",
"the",
"case",
"with",
"Occurrence",
"A",
"Occurrence",
... | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/1.0/document.rb#L132-L143 | train | Backfill derived code lists | [
30522,
13366,
2067,
8873,
3363,
1035,
5173,
1035,
3642,
1035,
7201,
2951,
1035,
9181,
1035,
2011,
1035,
8909,
1027,
1063,
1065,
1030,
2951,
1035,
9181,
1012,
2169,
1063,
1064,
9181,
1064,
2951,
30524,
2079,
1064,
9181,
1064,
2065,
1006,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.list_custom_prebuilt_entity_roles | def list_custom_prebuilt_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
response = list_custom_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_custom_prebuilt_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
response = list_custom_prebuilt_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_custom_prebuilt_entity_roles",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_custom_prebuilt_entity_roles_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"custom_headers",... | Get all roles for a prebuilt 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 custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Get",
"all",
"roles",
"for",
"a",
"prebuilt",
"entity",
"in",
"a",
"version",
"of",
"the",
"application"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L7719-L7722 | train | Gets the roles of the entity in a version of the application. | [
30522,
13366,
2862,
1035,
7661,
1035,
3653,
8569,
4014,
2102,
1035,
9178,
1035,
4395,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_signalr/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb | Azure::Signalr::Mgmt::V2018_03_01_preview.SignalR.begin_regenerate_key_with_http_info | def begin_regenerate_key_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
begin_regenerate_key_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
end | ruby | def begin_regenerate_key_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
begin_regenerate_key_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_regenerate_key_with_http_info",
"(",
"resource_group_name",
",",
"resource_name",
",",
"parameters",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"begin_regenerate_key_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"parameters",
":",
... | Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be
regenerated at the same time.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param resource_name [String] The name of the SignalR resource.
@param parameters [RegenerateKeyParameters] Parameter that describes the
Regenerate Key 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. | [
"Regenerate",
"SignalR",
"service",
"access",
"key",
".",
"PrimaryKey",
"and",
"SecondaryKey",
"cannot",
"be",
"regenerated",
"at",
"the",
"same",
"time",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_signalr/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb#L727-L729 | train | Regenerate a key for the specified container group. | [
30522,
13366,
4088,
1035,
19723,
24454,
3686,
1035,
3145,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
11709,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/models/create_checkout_request.rb | SquareConnect.CreateCheckoutRequest.merchant_support_email= | def merchant_support_email=(merchant_support_email)
if !merchant_support_email.nil? && merchant_support_email.to_s.length > 254
fail ArgumentError, "invalid value for 'merchant_support_email', the character length must be smaller than or equal to 254."
end
@merchant_support_email = merchant_support_email
end | ruby | def merchant_support_email=(merchant_support_email)
if !merchant_support_email.nil? && merchant_support_email.to_s.length > 254
fail ArgumentError, "invalid value for 'merchant_support_email', the character length must be smaller than or equal to 254."
end
@merchant_support_email = merchant_support_email
end | [
"def",
"merchant_support_email",
"=",
"(",
"merchant_support_email",
")",
"if",
"!",
"merchant_support_email",
".",
"nil?",
"&&",
"merchant_support_email",
".",
"to_s",
".",
"length",
">",
"254",
"fail",
"ArgumentError",
",",
"\"invalid value for 'merchant_support_email',... | Custom attribute writer method with validation
@param [Object] merchant_support_email Value to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"with",
"validation"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/create_checkout_request.rb#L194-L201 | train | Sets the merchant_support_email field of the invoice. | [
30522,
13366,
6432,
1035,
2490,
1035,
10373,
1027,
1006,
6432,
1035,
2490,
1035,
10373,
1007,
2065,
999,
6432,
1035,
2490,
1035,
10373,
1012,
9152,
2140,
1029,
1004,
1004,
6432,
1035,
2490,
1035,
10373,
1012,
2000,
1035,
1055,
1012,
3091,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Katello/katello | app/models/katello/content_view.rb | Katello.ContentView.all_version_library_instances | def all_version_library_instances
all_repos = all_version_repos.where(:library_instance_id => nil).pluck("#{Katello::Repository.table_name}.id")
all_repos += all_version_repos.pluck(:library_instance_id)
Repository.where(:id => all_repos)
end | ruby | def all_version_library_instances
all_repos = all_version_repos.where(:library_instance_id => nil).pluck("#{Katello::Repository.table_name}.id")
all_repos += all_version_repos.pluck(:library_instance_id)
Repository.where(:id => all_repos)
end | [
"def",
"all_version_library_instances",
"all_repos",
"=",
"all_version_repos",
".",
"where",
"(",
":library_instance_id",
"=>",
"nil",
")",
".",
"pluck",
"(",
"\"#{Katello::Repository.table_name}.id\"",
")",
"all_repos",
"+=",
"all_version_repos",
".",
"pluck",
"(",
":l... | get the library instances of all repos within this view | [
"get",
"the",
"library",
"instances",
"of",
"all",
"repos",
"within",
"this",
"view"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/content_view.rb#L367-L371 | train | Returns an array of all the repositories that are in the library. | [
30522,
13366,
2035,
1035,
2544,
1035,
3075,
1035,
12107,
2035,
1035,
16360,
2891,
1027,
2035,
1035,
2544,
1035,
16360,
2891,
1012,
2073,
1006,
1024,
3075,
1035,
6013,
1035,
8909,
1027,
1028,
9152,
2140,
1007,
1012,
20228,
12722,
1006,
1000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb | Azure::MediaServices::Mgmt::V2018_07_01.LiveEvents.reset | def reset(resource_group_name, account_name, live_event_name, custom_headers:nil)
response = reset_async(resource_group_name, account_name, live_event_name, custom_headers:custom_headers).value!
nil
end | ruby | def reset(resource_group_name, account_name, live_event_name, custom_headers:nil)
response = reset_async(resource_group_name, account_name, live_event_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"reset",
"(",
"resource_group_name",
",",
"account_name",
",",
"live_event_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"reset_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"live_event_name",
",",
"custom_headers",
":custom_he... | Reset Live Event
Resets an existing Live Event.
@param resource_group_name [String] The name of the resource group within the
Azure subscription.
@param account_name [String] The Media Services account name.
@param live_event_name [String] The name of the Live Event.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Reset",
"Live",
"Event"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb#L481-L484 | train | Reset the live event. | [
30522,
13366,
25141,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
2444,
1035,
2724,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
25141,
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... |
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_provisioned_fabric_code_version_info_list | def get_provisioned_fabric_code_version_info_list(code_version:nil, timeout:60, custom_headers:nil)
response = get_provisioned_fabric_code_version_info_list_async(code_version:code_version, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_provisioned_fabric_code_version_info_list(code_version:nil, timeout:60, custom_headers:nil)
response = get_provisioned_fabric_code_version_info_list_async(code_version:code_version, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_provisioned_fabric_code_version_info_list",
"(",
"code_version",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_provisioned_fabric_code_version_info_list_async",
"(",
"code_version",
":code_version",
",",
"... | Gets a list of fabric code versions that are provisioned in a Service Fabric
cluster.
Gets a list of information about fabric code versions that are provisioned in
the cluster. The parameter CodeVersion can be used to optionally filter the
output to only that particular version.
@param code_version [String] The product version of Service Fabric.
@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",
"a",
"list",
"of",
"fabric",
"code",
"versions",
"that",
"are",
"provisioned",
"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#L1545-L1548 | train | Gets the list of fabric code version info. | [
30522,
13366,
2131,
1035,
9347,
2098,
1035,
8313,
1035,
3642,
1035,
2544,
1035,
18558,
1035,
2862,
1006,
3642,
1035,
2544,
1024,
9152,
2140,
30524,
2051,
5833,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
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... |
sinatra/sinatra | lib/sinatra/base.rb | Sinatra.Templates.find_template | def find_template(views, name, engine)
yield ::File.join(views, "#{name}.#{@preferred_extension}")
if Tilt.respond_to?(:mappings)
Tilt.mappings.each do |ext, engines|
next unless ext != @preferred_extension and engines.include? engine
yield ::File.join(views, "#{name}.#{ext}")
end
else
Tilt.default_mapping.extensions_for(engine).each do |ext|
yield ::File.join(views, "#{name}.#{ext}") unless ext == @preferred_extension
end
end
end | ruby | def find_template(views, name, engine)
yield ::File.join(views, "#{name}.#{@preferred_extension}")
if Tilt.respond_to?(:mappings)
Tilt.mappings.each do |ext, engines|
next unless ext != @preferred_extension and engines.include? engine
yield ::File.join(views, "#{name}.#{ext}")
end
else
Tilt.default_mapping.extensions_for(engine).each do |ext|
yield ::File.join(views, "#{name}.#{ext}") unless ext == @preferred_extension
end
end
end | [
"def",
"find_template",
"(",
"views",
",",
"name",
",",
"engine",
")",
"yield",
"::",
"File",
".",
"join",
"(",
"views",
",",
"\"#{name}.#{@preferred_extension}\"",
")",
"if",
"Tilt",
".",
"respond_to?",
"(",
":mappings",
")",
"Tilt",
".",
"mappings",
".",
... | Calls the given block for every possible template file in views,
named name.ext, where ext is registered on engine. | [
"Calls",
"the",
"given",
"block",
"for",
"every",
"possible",
"template",
"file",
"in",
"views",
"named",
"name",
".",
"ext",
"where",
"ext",
"is",
"registered",
"on",
"engine",
"."
] | 1aa64f9858edc3f93cc8d46e26f724c1ae103b1c | https://github.com/sinatra/sinatra/blob/1aa64f9858edc3f93cc8d46e26f724c1ae103b1c/lib/sinatra/base.rb#L786-L799 | train | Find the template with the given name. | [
30522,
13366,
2424,
1035,
23561,
1006,
5328,
1010,
2171,
1010,
3194,
1007,
10750,
1024,
1024,
5371,
1012,
3693,
1006,
5328,
1010,
1000,
1001,
1063,
2171,
1065,
1012,
1001,
1063,
1030,
6871,
1035,
5331,
1065,
1000,
1007,
2065,
17010,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb | Azure::MediaServices::Mgmt::V2018_07_01.LiveEvents.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, account_name, live_event_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, account_name, live_event_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, account_name, live_event_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, account_name, live_event_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"live_event_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"live_event_name",
",",
... | Updates a existing Live Event.
@param resource_group_name [String] The name of the resource group within the
Azure subscription.
@param account_name [String] The Media Services account name.
@param live_event_name [String] The name of the Live Event.
@param parameters [LiveEvent] Live Event properties needed for creation.
@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",
"existing",
"Live",
"Event",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb#L679-L681 | train | Updates an existing live event. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
2444,
1035,
2724,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_frame_url_with_http_info | def add_video_frame_url_with_http_info(content_type, team_name, review_id, video_frame_body, timescale:nil, custom_headers:nil)
add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale:timescale, custom_headers:custom_headers).value!
end | ruby | def add_video_frame_url_with_http_info(content_type, team_name, review_id, video_frame_body, timescale:nil, custom_headers:nil)
add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale:timescale, custom_headers:custom_headers).value!
end | [
"def",
"add_video_frame_url_with_http_info",
"(",
"content_type",
",",
"team_name",
",",
"review_id",
",",
"video_frame_body",
",",
"timescale",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"add_video_frame_url_async",
"(",
"content_type",
",",
"team_name",
","... | Use this method to add frames for a video review.Timescale: This parameter is
a factor which is used to convert the timestamp on a frame into milliseconds.
Timescale is provided in the output of the Content Moderator video media
processor on the Azure Media Services platform.Timescale in the Video
Moderation output is Ticks/Second.
@param content_type [String] The content type.
@param team_name [String] Your team name.
@param review_id [String] Id of the review.
@param video_frame_body [Array<VideoFrameBodyItem>] Body for add video frames
API
@param timescale [Integer] Timescale of the video.
@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. | [
"Use",
"this",
"method",
"to",
"add",
"frames",
"for",
"a",
"video",
"review",
".",
"Timescale",
":",
"This",
"parameter",
"is",
"a",
"factor",
"which",
"is",
"used",
"to",
"convert",
"the",
"timestamp",
"on",
"a",
"frame",
"into",
"milliseconds",
".",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb#L1613-L1615 | train | Adds a video frame to a review. | [
30522,
13366,
5587,
1035,
2678,
1035,
4853,
1035,
24471,
2140,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
4180,
1035,
2828,
1010,
2136,
1035,
2171,
1010,
3319,
1035,
8909,
1010,
2678,
1035,
4853,
1035,
2303,
1010,
2335,
9289,
2063,
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... |
github/linguist | lib/linguist/generated.rb | Linguist.Generated.generated? | def generated?
xcode_file? ||
cocoapods? ||
carthage_build? ||
generated_graphql_relay? ||
generated_net_designer_file? ||
generated_net_specflow_feature_file? ||
composer_lock? ||
cargo_lock? ||
node_modules? ||
go_vendor? ||
go_lock? ||
npm_shrinkwrap_or_package_lock? ||
godeps? ||
generated_by_zephir? ||
minified_files? ||
has_source_map? ||
source_map? ||
compiled_coffeescript? ||
generated_parser? ||
generated_net_docfile? ||
generated_postscript? ||
compiled_cython_file? ||
generated_go? ||
generated_protocol_buffer? ||
generated_javascript_protocol_buffer? ||
generated_apache_thrift? ||
generated_jni_header? ||
vcr_cassette? ||
generated_module? ||
generated_unity3d_meta? ||
generated_racc? ||
generated_jflex? ||
generated_grammarkit? ||
generated_roxygen2? ||
generated_pkgdown? ||
generated_jison? ||
generated_grpc_cpp? ||
generated_dart? ||
generated_perl_ppport_header? ||
generated_gamemakerstudio?
end | ruby | def generated?
xcode_file? ||
cocoapods? ||
carthage_build? ||
generated_graphql_relay? ||
generated_net_designer_file? ||
generated_net_specflow_feature_file? ||
composer_lock? ||
cargo_lock? ||
node_modules? ||
go_vendor? ||
go_lock? ||
npm_shrinkwrap_or_package_lock? ||
godeps? ||
generated_by_zephir? ||
minified_files? ||
has_source_map? ||
source_map? ||
compiled_coffeescript? ||
generated_parser? ||
generated_net_docfile? ||
generated_postscript? ||
compiled_cython_file? ||
generated_go? ||
generated_protocol_buffer? ||
generated_javascript_protocol_buffer? ||
generated_apache_thrift? ||
generated_jni_header? ||
vcr_cassette? ||
generated_module? ||
generated_unity3d_meta? ||
generated_racc? ||
generated_jflex? ||
generated_grammarkit? ||
generated_roxygen2? ||
generated_pkgdown? ||
generated_jison? ||
generated_grpc_cpp? ||
generated_dart? ||
generated_perl_ppport_header? ||
generated_gamemakerstudio?
end | [
"def",
"generated?",
"xcode_file?",
"||",
"cocoapods?",
"||",
"carthage_build?",
"||",
"generated_graphql_relay?",
"||",
"generated_net_designer_file?",
"||",
"generated_net_specflow_feature_file?",
"||",
"composer_lock?",
"||",
"cargo_lock?",
"||",
"node_modules?",
"||",
"go... | Internal: Is the blob a generated file?
Generated source code is suppressed in diffs and is ignored by
language statistics.
Please add additional test coverage to
`test/test_blob.rb#test_generated` if you make any changes.
Return true or false | [
"Internal",
":",
"Is",
"the",
"blob",
"a",
"generated",
"file?"
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/generated.rb#L53-L94 | train | Returns true if the generated file should be generated. | [
30522,
13366,
7013,
1029,
1060,
16044,
1035,
5371,
1029,
1064,
1064,
22940,
22925,
1029,
1064,
1064,
21959,
1035,
3857,
1029,
1064,
1064,
7013,
1035,
10629,
4160,
2140,
1035,
8846,
1029,
1064,
1064,
7013,
1035,
5658,
1035,
5859,
1035,
5371,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
boazsegev/combine_pdf | lib/combine_pdf/page_methods.rb | CombinePDF.Page_Methods.write_table | def write_table(options = {})
defaults = {
headers: nil,
table_data: [[]],
font: nil,
header_font: nil,
max_font_size: 14,
column_widths: nil,
header_color: [0.8, 0.8, 0.8],
main_color: nil,
alternate_color: [0.95, 0.95, 0.95],
font_color: [0, 0, 0],
border_color: [0, 0, 0],
border_width: 1,
header_align: :center,
row_align: nil,
direction: :ltr,
max_rows: 25,
xy: nil,
size: nil
}
options = defaults.merge options
raise 'method call error! not enough rows allowed to create table' if (options[:max_rows].to_i < 1 && options[:headers]) || (options[:max_rows].to_i <= 0)
options[:header_font] ||= options[:font]
options[:row_align] ||= ((options[:direction] == :rtl) ? :right : :left)
options[:xy] ||= [((page_size[2] - page_size[0]) * 0.1), ((page_size[3] - page_size[1]) * 0.9)]
options[:size] ||= [((page_size[2] - page_size[0]) * 0.8), ((page_size[3] - page_size[1]) * 0.8)]
# assert table_data is an array of arrays
return false unless (options[:table_data].select { |r| !r.is_a?(Array) }).empty?
# compute sizes
top = options[:xy][1]
height = options[:size][1] / options[:max_rows]
from_side = options[:xy][0]
width = options[:size][0]
columns = options[:table_data][0].length
column_widths = []
columns.times { |_i| column_widths << (width / columns) }
if options[:column_widths]
scale = 0
options[:column_widths].each { |w| scale += w }
column_widths = []
options[:column_widths].each { |w| column_widths << (width * w / scale) }
end
column_widths = column_widths.reverse if options[:direction] == :rtl
# set count and start writing the data
row_number = 1
until options[:table_data].empty? || row_number > options[:max_rows]
# add headers
if options[:headers] && row_number == 1
x = from_side
headers = options[:headers]
headers = headers.reverse if options[:direction] == :rtl
column_widths.each_index do |i|
text = headers[i].to_s
textbox text, { x: x, y: (top - (height * row_number)), width: column_widths[i], height: height, box_color: options[:header_color], text_align: options[:header_align] }.merge(options).merge(font: options[:header_font])
x += column_widths[i]
end
row_number += 1
end
x = from_side
row_data = options[:table_data].shift
row_data = row_data.reverse if options[:direction] == :rtl
column_widths.each_index do |i|
text = row_data[i].to_s
box_color = (options[:alternate_color] && ((row_number.odd? && options[:headers]) || row_number.even?)) ? options[:alternate_color] : options[:main_color]
textbox text, { x: x, y: (top - (height * row_number)), width: column_widths[i], height: height, box_color: box_color, text_align: options[:row_align] }.merge(options)
x += column_widths[i]
end
row_number += 1
end
self
end | ruby | def write_table(options = {})
defaults = {
headers: nil,
table_data: [[]],
font: nil,
header_font: nil,
max_font_size: 14,
column_widths: nil,
header_color: [0.8, 0.8, 0.8],
main_color: nil,
alternate_color: [0.95, 0.95, 0.95],
font_color: [0, 0, 0],
border_color: [0, 0, 0],
border_width: 1,
header_align: :center,
row_align: nil,
direction: :ltr,
max_rows: 25,
xy: nil,
size: nil
}
options = defaults.merge options
raise 'method call error! not enough rows allowed to create table' if (options[:max_rows].to_i < 1 && options[:headers]) || (options[:max_rows].to_i <= 0)
options[:header_font] ||= options[:font]
options[:row_align] ||= ((options[:direction] == :rtl) ? :right : :left)
options[:xy] ||= [((page_size[2] - page_size[0]) * 0.1), ((page_size[3] - page_size[1]) * 0.9)]
options[:size] ||= [((page_size[2] - page_size[0]) * 0.8), ((page_size[3] - page_size[1]) * 0.8)]
# assert table_data is an array of arrays
return false unless (options[:table_data].select { |r| !r.is_a?(Array) }).empty?
# compute sizes
top = options[:xy][1]
height = options[:size][1] / options[:max_rows]
from_side = options[:xy][0]
width = options[:size][0]
columns = options[:table_data][0].length
column_widths = []
columns.times { |_i| column_widths << (width / columns) }
if options[:column_widths]
scale = 0
options[:column_widths].each { |w| scale += w }
column_widths = []
options[:column_widths].each { |w| column_widths << (width * w / scale) }
end
column_widths = column_widths.reverse if options[:direction] == :rtl
# set count and start writing the data
row_number = 1
until options[:table_data].empty? || row_number > options[:max_rows]
# add headers
if options[:headers] && row_number == 1
x = from_side
headers = options[:headers]
headers = headers.reverse if options[:direction] == :rtl
column_widths.each_index do |i|
text = headers[i].to_s
textbox text, { x: x, y: (top - (height * row_number)), width: column_widths[i], height: height, box_color: options[:header_color], text_align: options[:header_align] }.merge(options).merge(font: options[:header_font])
x += column_widths[i]
end
row_number += 1
end
x = from_side
row_data = options[:table_data].shift
row_data = row_data.reverse if options[:direction] == :rtl
column_widths.each_index do |i|
text = row_data[i].to_s
box_color = (options[:alternate_color] && ((row_number.odd? && options[:headers]) || row_number.even?)) ? options[:alternate_color] : options[:main_color]
textbox text, { x: x, y: (top - (height * row_number)), width: column_widths[i], height: height, box_color: box_color, text_align: options[:row_align] }.merge(options)
x += column_widths[i]
end
row_number += 1
end
self
end | [
"def",
"write_table",
"(",
"options",
"=",
"{",
"}",
")",
"defaults",
"=",
"{",
"headers",
":",
"nil",
",",
"table_data",
":",
"[",
"[",
"]",
"]",
",",
"font",
":",
"nil",
",",
"header_font",
":",
"nil",
",",
"max_font_size",
":",
"14",
",",
"colum... | Writes a table to the current page, removing(!) the written rows from the table_data Array.
since the table_data Array is updated, it is possible to call this method a few times,
each time creating or moving to the next page, until table_data.empty? returns true.
accepts a Hash with any of the following keys as well as any of the PDFWriter#textbox options:
headers:: an Array of strings with the headers (will be repeated every page).
table_data:: as Array of Arrays, each containing a string for each column. the first row sets the number of columns. extra columns will be ignored.
font:: a registered or standard font name (see PDFWriter). defaults to nil (:Helvetica).
header_font:: a registered or standard font name for the headers (see PDFWriter). defaults to nil (the font for all the table rows).
max_font_size:: the maximum font size. if the string doesn't fit, it will be resized. defaults to 14.
column_widths:: an array of relative column widths ([1,2] will display only the first two columns, the second twice as big as the first). defaults to nil (even widths).
header_color:: the header color. defaults to [0.8, 0.8, 0.8] (light gray).
main_color:: main row color. defaults to nil (transparent / white).
alternate_color:: alternate row color. defaults to [0.95, 0.95, 0.95] (very light gray).
font_color:: font color. defaults to [0,0,0] (black).
border_color:: border color. defaults to [0,0,0] (black).
border_width:: border width in PDF units. defaults to 1.
header_align:: the header text alignment within each column (:right, :left, :center). defaults to :center.
row_align:: the row text alignment within each column. defaults to :left (:right for RTL table).
direction:: the table's writing direction (:ltr or :rtl). this reffers to the direction of the columns and doesn't effect text (rtl text is automatically recognized). defaults to :ltr.
max_rows:: the maximum number of rows to actually draw, INCLUDING the header row. deafults to 25.
xy:: an Array specifying the top-left corner of the table. defaulte to [page_width*0.1, page_height*0.9].
size:: an Array specifying the height and the width of the table. defaulte to [page_width*0.8, page_height*0.8]. | [
"Writes",
"a",
"table",
"to",
"the",
"current",
"page",
"removing",
"(",
"!",
")",
"the",
"written",
"rows",
"from",
"the",
"table_data",
"Array",
"."
] | 09054051019c069f551f3e60be789577c0f93900 | https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/page_methods.rb#L559-L631 | train | Write a table | [
30522,
13366,
4339,
1035,
2795,
1006,
7047,
1027,
1063,
1065,
1007,
12398,
2015,
1027,
1063,
20346,
2015,
1024,
9152,
2140,
1010,
2795,
1035,
2951,
1024,
1031,
1031,
1033,
1033,
1010,
15489,
1024,
9152,
2140,
1010,
20346,
1035,
15489,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_application_backup_configuration_info_with_http_info | def get_application_backup_configuration_info_with_http_info(application_id, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
get_application_backup_configuration_info_async(application_id, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_application_backup_configuration_info_with_http_info(application_id, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
get_application_backup_configuration_info_async(application_id, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_application_backup_configuration_info_with_http_info",
"(",
"application_id",
",",
"continuation_token",
":",
"nil",
",",
"max_results",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_application_backup_configuration_info_async... | Gets the Service Fabric application backup configuration information.
Gets the Service Fabric backup configuration information for the application
and the services and partitions under this application.
@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 continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"Service",
"Fabric",
"application",
"backup",
"configuration",
"information",
"."
] | 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#L23262-L23264 | train | Gets the backup configuration information for the application. | [
30522,
13366,
2131,
1035,
4646,
1035,
10200,
1035,
9563,
1035,
18558,
1035,
2007,
1035,
8299,
1035,
30524,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
4646,
1035,
10200,
1035,
9563,
1035,
18558,
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... |
jekyll/jekyll | lib/jekyll/regenerator.rb | Jekyll.Regenerator.add_dependency | def add_dependency(path, dependency)
return if metadata[path].nil? || disabled
unless metadata[path]["deps"].include? dependency
metadata[path]["deps"] << dependency
add(dependency) unless metadata.include?(dependency)
end
regenerate? dependency
end | ruby | def add_dependency(path, dependency)
return if metadata[path].nil? || disabled
unless metadata[path]["deps"].include? dependency
metadata[path]["deps"] << dependency
add(dependency) unless metadata.include?(dependency)
end
regenerate? dependency
end | [
"def",
"add_dependency",
"(",
"path",
",",
"dependency",
")",
"return",
"if",
"metadata",
"[",
"path",
"]",
".",
"nil?",
"||",
"disabled",
"unless",
"metadata",
"[",
"path",
"]",
"[",
"\"deps\"",
"]",
".",
"include?",
"dependency",
"metadata",
"[",
"path",... | Add a dependency of a path
Returns nothing. | [
"Add",
"a",
"dependency",
"of",
"a",
"path"
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/regenerator.rb#L106-L114 | train | Add a dependency to the current object | [
30522,
13366,
5587,
1035,
24394,
1006,
4130,
1010,
24394,
1007,
2709,
2065,
27425,
1031,
4130,
1033,
1012,
9152,
2140,
1029,
1064,
1064,
9776,
4983,
27425,
1031,
4130,
1033,
1031,
1000,
2139,
4523,
1000,
1033,
1012,
2421,
1029,
24394,
27425... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.disable_service_backup_with_http_info | def disable_service_backup_with_http_info(service_id, timeout:60, custom_headers:nil)
disable_service_backup_async(service_id, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def disable_service_backup_with_http_info(service_id, timeout:60, custom_headers:nil)
disable_service_backup_async(service_id, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"disable_service_backup_with_http_info",
"(",
"service_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"disable_service_backup_async",
"(",
"service_id",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".",... | Disables periodic backup of Service Fabric service which was previously
enabled.
Disables periodic backup of Service Fabric service 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, which this
service is part of, this service would continue to be periodically backed up
as per the policy mapped at the application level.
@param service_id [String] The identity of the service. This is typically the
full name of the service without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the service name is "fabric:/myapp/app1/svc1", the service
identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous
versions.
@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",
"service",
"which",
"was",
"previously",
"enabled",
"."
] | 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#L24009-L24011 | train | Disables backup of the specified service. | [
30522,
13366,
4487,
19150,
1035,
2326,
1035,
10200,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2326,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4487,
19150,
1035,
2326,
1035,
10200,
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... |
piotrmurach/github | lib/github_api/client/activity/notifications.rb | Github.Client::Activity::Notifications.list | def list(*args)
arguments(args)
params = arguments.params
response = if ( (user_name = params.delete('user')) &&
(repo_name = params.delete('repo')) )
get_request("/repos/#{user_name}/#{repo_name}/notifications", params)
else
get_request('/notifications', params)
end
return response unless block_given?
response.each { |el| yield el }
end | ruby | def list(*args)
arguments(args)
params = arguments.params
response = if ( (user_name = params.delete('user')) &&
(repo_name = params.delete('repo')) )
get_request("/repos/#{user_name}/#{repo_name}/notifications", params)
else
get_request('/notifications', params)
end
return response unless block_given?
response.each { |el| yield el }
end | [
"def",
"list",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
")",
"params",
"=",
"arguments",
".",
"params",
"response",
"=",
"if",
"(",
"(",
"user_name",
"=",
"params",
".",
"delete",
"(",
"'user'",
")",
")",
"&&",
"(",
"repo_name",
"=",
"params"... | List your notifications
List all notifications for the current user, grouped by repository.
@see https://developer.github.com/v3/activity/notifications/#list-your-notifications
@param [Hash] params
@option params [Boolean] :all
If true, show notifications marked as read.
Default: false
@option params [Boolean] :participating
If true, only shows notifications in which the user
is directly participating or mentioned. Default: false
@option params [String] :since
Filters out any notifications updated before the given time.
This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
Default: Time.now
@example
github = Github.new oauth_token: 'token'
github.activity.notifications.list
List your notifications in a repository
@see https://developer.github.com/v3/activity/notifications/#list-your-notifications-in-a-repository
@example
github = Github.new
github.activity.notifications.list user: 'user-name', repo: 'repo-name'
@api public | [
"List",
"your",
"notifications"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/activity/notifications.rb#L38-L50 | train | List all notifications | [
30522,
13366,
2862,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
3433,
1027,
2065,
1006,
1006,
5310,
1035,
2171,
1027,
11498,
5244,
1012,
3972,
12870,
1006,
1005,
5310,
1005,
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_advisor/lib/2017-03-31/generated/azure_mgmt_advisor/suppressions.rb | Azure::Advisor::Mgmt::V2017_03_31.Suppressions.delete | def delete(resource_uri, recommendation_id, name, custom_headers:nil)
response = delete_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_uri, recommendation_id, name, custom_headers:nil)
response = delete_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_uri",
",",
"recommendation_id",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_uri",
",",
"recommendation_id",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Enables the activation of a snoozed or dismissed recommendation. The snoozed
or dismissed attribute of a recommendation is referred to as a suppression.
@param resource_uri [String] The fully qualified Azure Resource Manager
identifier of the resource to which the recommendation applies.
@param recommendation_id [String] The recommendation ID.
@param name [String] The name of the suppression.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Enables",
"the",
"activation",
"of",
"a",
"snoozed",
"or",
"dismissed",
"recommendation",
".",
"The",
"snoozed",
"or",
"dismissed",
"attribute",
"of",
"a",
"recommendation",
"is",
"referred",
"to",
"as",
"a",
"suppression",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_advisor/lib/2017-03-31/generated/azure_mgmt_advisor/suppressions.rb#L252-L255 | train | Deletes a specific recommendation. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
24471,
2072,
1010,
12832,
1035,
8909,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
24471,
2072,
1010,
1283... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmosolgo/graphql-ruby | lib/graphql/analysis/analyze_query.rb | GraphQL.Analysis.reduce_node | def reduce_node(irep_node, reducer_states)
visit_analyzers(:enter, irep_node, reducer_states)
irep_node.typed_children.each do |type_defn, children|
children.each do |name, child_irep_node|
reduce_node(child_irep_node, reducer_states)
end
end
visit_analyzers(:leave, irep_node, reducer_states)
end | ruby | def reduce_node(irep_node, reducer_states)
visit_analyzers(:enter, irep_node, reducer_states)
irep_node.typed_children.each do |type_defn, children|
children.each do |name, child_irep_node|
reduce_node(child_irep_node, reducer_states)
end
end
visit_analyzers(:leave, irep_node, reducer_states)
end | [
"def",
"reduce_node",
"(",
"irep_node",
",",
"reducer_states",
")",
"visit_analyzers",
"(",
":enter",
",",
"irep_node",
",",
"reducer_states",
")",
"irep_node",
".",
"typed_children",
".",
"each",
"do",
"|",
"type_defn",
",",
"children",
"|",
"children",
".",
... | Enter the node, visit its children, then leave the node. | [
"Enter",
"the",
"node",
"visit",
"its",
"children",
"then",
"leave",
"the",
"node",
"."
] | d5be13a816f220b9efbabeaa69a3e56fedf311f5 | https://github.com/rmosolgo/graphql-ruby/blob/d5be13a816f220b9efbabeaa69a3e56fedf311f5/lib/graphql/analysis/analyze_query.rb#L67-L77 | train | Reduce the node with the children of the given irep node. | [
30522,
13366,
5547,
1035,
13045,
1006,
20868,
13699,
1035,
13045,
1010,
5547,
2099,
1035,
2163,
1007,
3942,
1035,
17908,
2869,
1006,
1024,
4607,
1010,
20868,
13699,
1035,
13045,
1010,
5547,
2099,
1035,
2163,
1007,
20868,
13699,
1035,
13045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
collectiveidea/interactor | lib/interactor/hooks.rb | Interactor.Hooks.run_hook | def run_hook(hook, *args)
hook.is_a?(Symbol) ? send(hook, *args) : instance_exec(*args, &hook)
end | ruby | def run_hook(hook, *args)
hook.is_a?(Symbol) ? send(hook, *args) : instance_exec(*args, &hook)
end | [
"def",
"run_hook",
"(",
"hook",
",",
"*",
"args",
")",
"hook",
".",
"is_a?",
"(",
"Symbol",
")",
"?",
"send",
"(",
"hook",
",",
"args",
")",
":",
"instance_exec",
"(",
"args",
",",
"hook",
")",
"end"
] | Internal: Run an individual hook. The "run_hook" method is the common
interface by which an individual hook is run. If the given hook is a
symbol, the method is invoked whether public or private. If the hook is a
proc, the proc is evaluated in the context of the current instance.
hook - A Symbol or Proc hook.
args - Zero or more arguments to be passed as block arguments into the
given block or as arguments into the method described by the given
Symbol method name.
Returns nothing. | [
"Internal",
":",
"Run",
"an",
"individual",
"hook",
".",
"The",
"run_hook",
"method",
"is",
"the",
"common",
"interface",
"by",
"which",
"an",
"individual",
"hook",
"is",
"run",
".",
"If",
"the",
"given",
"hook",
"is",
"a",
"symbol",
"the",
"method",
"is... | 3a8656b8e2e273f57079eb621cbafef6bd2cadbf | https://github.com/collectiveidea/interactor/blob/3a8656b8e2e273f57079eb621cbafef6bd2cadbf/lib/interactor/hooks.rb#L262-L264 | train | Run a hook. | [
30522,
13366,
2448,
1035,
8103,
1006,
8103,
1010,
1008,
12098,
5620,
1007,
8103,
1012,
2003,
1035,
1037,
1029,
1006,
6454,
1007,
1029,
4604,
1006,
8103,
1010,
1008,
12098,
5620,
1007,
1024,
6013,
1035,
4654,
8586,
1006,
1008,
12098,
5620,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
licensee/licensee | lib/licensee/content_helper.rb | Licensee.ContentHelper.content_without_title_and_version | def content_without_title_and_version
@content_without_title_and_version ||= begin
@_content = nil
ops = %i[html hrs comments markdown_headings title version]
ops.each { |op| strip(op) }
_content
end
end | ruby | def content_without_title_and_version
@content_without_title_and_version ||= begin
@_content = nil
ops = %i[html hrs comments markdown_headings title version]
ops.each { |op| strip(op) }
_content
end
end | [
"def",
"content_without_title_and_version",
"@content_without_title_and_version",
"||=",
"begin",
"@_content",
"=",
"nil",
"ops",
"=",
"%i[",
"html",
"hrs",
"comments",
"markdown_headings",
"title",
"version",
"]",
"ops",
".",
"each",
"{",
"|",
"op",
"|",
"strip",
... | Content with the title and version removed
The first time should normally be the attribution line
Used to dry up `content_normalized` but we need the case sensitive
content with attribution first to detect attribuion in LicenseFile | [
"Content",
"with",
"the",
"title",
"and",
"version",
"removed",
"The",
"first",
"time",
"should",
"normally",
"be",
"the",
"attribution",
"line",
"Used",
"to",
"dry",
"up",
"content_normalized",
"but",
"we",
"need",
"the",
"case",
"sensitive",
"content",
"with... | e181f73f529f9cefa91096817a9c13b9e1608599 | https://github.com/licensee/licensee/blob/e181f73f529f9cefa91096817a9c13b9e1608599/lib/licensee/content_helper.rb#L132-L139 | train | Returns the content without the title and version. | [
30522,
13366,
4180,
1035,
2302,
1035,
2516,
1035,
1998,
1035,
2544,
1030,
4180,
1035,
2302,
1035,
2516,
1035,
1998,
1035,
2544,
1064,
1064,
1027,
4088,
1030,
1035,
4180,
1027,
9152,
2140,
23092,
1027,
1003,
1045,
1031,
16129,
17850,
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... |
mislav/will_paginate | lib/will_paginate/view_helpers.rb | WillPaginate.ViewHelpers.page_entries_info | def page_entries_info(collection, options = {})
model = options[:model]
model = collection.first.class unless model or collection.empty?
model ||= 'entry'
model_key = if model.respond_to? :model_name
model.model_name.i18n_key # ActiveModel::Naming
else
model.to_s.underscore
end
if options.fetch(:html, true)
b, eb = '<b>', '</b>'
sp = ' '
html_key = '_html'
else
b = eb = html_key = ''
sp = ' '
end
model_count = collection.total_pages > 1 ? 5 : collection.size
defaults = ["models.#{model_key}"]
defaults << Proc.new { |_, opts|
if model.respond_to? :model_name
model.model_name.human(:count => opts[:count])
else
name = model_key.to_s.tr('_', ' ')
raise "can't pluralize model name: #{model.inspect}" unless name.respond_to? :pluralize
opts[:count] == 1 ? name : name.pluralize
end
}
model_name = will_paginate_translate defaults, :count => model_count
if collection.total_pages < 2
i18n_key = :"page_entries_info.single_page#{html_key}"
keys = [:"#{model_key}.#{i18n_key}", i18n_key]
will_paginate_translate keys, :count => collection.total_entries, :model => model_name do |_, opts|
case opts[:count]
when 0; "No #{opts[:model]} found"
when 1; "Displaying #{b}1#{eb} #{opts[:model]}"
else "Displaying #{b}all#{sp}#{opts[:count]}#{eb} #{opts[:model]}"
end
end
else
i18n_key = :"page_entries_info.multi_page#{html_key}"
keys = [:"#{model_key}.#{i18n_key}", i18n_key]
params = {
:model => model_name, :count => collection.total_entries,
:from => collection.offset + 1, :to => collection.offset + collection.length
}
will_paginate_translate keys, params do |_, opts|
%{Displaying %s #{b}%d#{sp}-#{sp}%d#{eb} of #{b}%d#{eb} in total} %
[ opts[:model], opts[:from], opts[:to], opts[:count] ]
end
end
end | ruby | def page_entries_info(collection, options = {})
model = options[:model]
model = collection.first.class unless model or collection.empty?
model ||= 'entry'
model_key = if model.respond_to? :model_name
model.model_name.i18n_key # ActiveModel::Naming
else
model.to_s.underscore
end
if options.fetch(:html, true)
b, eb = '<b>', '</b>'
sp = ' '
html_key = '_html'
else
b = eb = html_key = ''
sp = ' '
end
model_count = collection.total_pages > 1 ? 5 : collection.size
defaults = ["models.#{model_key}"]
defaults << Proc.new { |_, opts|
if model.respond_to? :model_name
model.model_name.human(:count => opts[:count])
else
name = model_key.to_s.tr('_', ' ')
raise "can't pluralize model name: #{model.inspect}" unless name.respond_to? :pluralize
opts[:count] == 1 ? name : name.pluralize
end
}
model_name = will_paginate_translate defaults, :count => model_count
if collection.total_pages < 2
i18n_key = :"page_entries_info.single_page#{html_key}"
keys = [:"#{model_key}.#{i18n_key}", i18n_key]
will_paginate_translate keys, :count => collection.total_entries, :model => model_name do |_, opts|
case opts[:count]
when 0; "No #{opts[:model]} found"
when 1; "Displaying #{b}1#{eb} #{opts[:model]}"
else "Displaying #{b}all#{sp}#{opts[:count]}#{eb} #{opts[:model]}"
end
end
else
i18n_key = :"page_entries_info.multi_page#{html_key}"
keys = [:"#{model_key}.#{i18n_key}", i18n_key]
params = {
:model => model_name, :count => collection.total_entries,
:from => collection.offset + 1, :to => collection.offset + collection.length
}
will_paginate_translate keys, params do |_, opts|
%{Displaying %s #{b}%d#{sp}-#{sp}%d#{eb} of #{b}%d#{eb} in total} %
[ opts[:model], opts[:from], opts[:to], opts[:count] ]
end
end
end | [
"def",
"page_entries_info",
"(",
"collection",
",",
"options",
"=",
"{",
"}",
")",
"model",
"=",
"options",
"[",
":model",
"]",
"model",
"=",
"collection",
".",
"first",
".",
"class",
"unless",
"model",
"or",
"collection",
".",
"empty?",
"model",
"||=",
... | Renders a message containing number of displayed vs. total entries.
<%= page_entries_info @posts %>
#-> Displaying posts 6 - 12 of 26 in total
The default output contains HTML. Use ":html => false" for plain text. | [
"Renders",
"a",
"message",
"containing",
"number",
"of",
"displayed",
"vs",
".",
"total",
"entries",
"."
] | 63e84fb7e7508231ca83d94c524bfab5fbe9a578 | https://github.com/mislav/will_paginate/blob/63e84fb7e7508231ca83d94c524bfab5fbe9a578/lib/will_paginate/view_helpers.rb#L105-L160 | train | Returns the page entries info for a collection | [
30522,
13366,
3931,
1035,
10445,
1035,
18558,
1006,
3074,
1010,
7047,
1027,
1063,
1065,
1007,
2944,
1027,
7047,
1031,
1024,
2944,
1033,
2944,
1027,
3074,
1012,
2034,
1012,
2465,
4983,
2944,
2030,
3074,
1012,
4064,
1029,
2944,
1064,
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... |
etewiah/property_web_builder | app/controllers/pwb/api/v1/web_contents_controller.rb | Pwb.Api::V1::WebContentsController.create_content_with_photo | def create_content_with_photo
tag = params[:tag]
photo = ContentPhoto.create
key = tag.underscore.camelize + photo.id.to_s
new_content = Content.create(tag: tag, key: key)
# photo.subdomain = subdomain
# photo.folder = current_tenant_model.whitelabel_country_code
# photo.tenant_id = current_tenant_model.id
if params[:file]
photo.image = params[:file]
end
photo.save!
new_content.content_photos.push photo
# http://typeoneerror.com/labs/jsonapi-resources-ember-data/
# resource for model
resource = Api::V1::WebContentResource.new(new_content, nil)
# serializer for resource
serializer = JSONAPI::ResourceSerializer.new(Api::V1::WebContentResource)
# jsonapi-compliant hash (ready to be send to render)
photo.reload
# above needed to ensure image_url is available
# might need below if upload in prod is slow..
# upload_confirmed = false
# tries = 0
# until upload_confirmed
# if photo.image_url.present?
# upload_confirmed = true
# else
# sleep 1
# photo.reload
# tries += 1
# if tries > 5
# upload_confirmed = true
# end
# end
# end
render json: serializer.serialize_to_hash(resource)
# return render json: new_content.to_json
# return render :json => { :error => "Sorry...", :status => "444", :data => "ssss" }, :status => 422
end | ruby | def create_content_with_photo
tag = params[:tag]
photo = ContentPhoto.create
key = tag.underscore.camelize + photo.id.to_s
new_content = Content.create(tag: tag, key: key)
# photo.subdomain = subdomain
# photo.folder = current_tenant_model.whitelabel_country_code
# photo.tenant_id = current_tenant_model.id
if params[:file]
photo.image = params[:file]
end
photo.save!
new_content.content_photos.push photo
# http://typeoneerror.com/labs/jsonapi-resources-ember-data/
# resource for model
resource = Api::V1::WebContentResource.new(new_content, nil)
# serializer for resource
serializer = JSONAPI::ResourceSerializer.new(Api::V1::WebContentResource)
# jsonapi-compliant hash (ready to be send to render)
photo.reload
# above needed to ensure image_url is available
# might need below if upload in prod is slow..
# upload_confirmed = false
# tries = 0
# until upload_confirmed
# if photo.image_url.present?
# upload_confirmed = true
# else
# sleep 1
# photo.reload
# tries += 1
# if tries > 5
# upload_confirmed = true
# end
# end
# end
render json: serializer.serialize_to_hash(resource)
# return render json: new_content.to_json
# return render :json => { :error => "Sorry...", :status => "444", :data => "ssss" }, :status => 422
end | [
"def",
"create_content_with_photo",
"tag",
"=",
"params",
"[",
":tag",
"]",
"photo",
"=",
"ContentPhoto",
".",
"create",
"key",
"=",
"tag",
".",
"underscore",
".",
"camelize",
"+",
"photo",
".",
"id",
".",
"to_s",
"new_content",
"=",
"Content",
".",
"creat... | below used when uploading carousel images | [
"below",
"used",
"when",
"uploading",
"carousel",
"images"
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/controllers/pwb/api/v1/web_contents_controller.rb#L38-L85 | train | Create a new content with a photo | [
30522,
13366,
3443,
1035,
4180,
1035,
2007,
1035,
6302,
6415,
1027,
11498,
5244,
1031,
1024,
6415,
1033,
6302,
1027,
4180,
8458,
11439,
1012,
3443,
3145,
1027,
6415,
1012,
2104,
9363,
2890,
1012,
19130,
4697,
1009,
6302,
1012,
8909,
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... |
rails/rails | activestorage/lib/active_storage/downloading.rb | ActiveStorage.Downloading.download_blob_to | def download_blob_to(file) #:doc:
file.binmode
blob.download { |chunk| file.write(chunk) }
file.flush
file.rewind
end | ruby | def download_blob_to(file) #:doc:
file.binmode
blob.download { |chunk| file.write(chunk) }
file.flush
file.rewind
end | [
"def",
"download_blob_to",
"(",
"file",
")",
"#:doc:",
"file",
".",
"binmode",
"blob",
".",
"download",
"{",
"|",
"chunk",
"|",
"file",
".",
"write",
"(",
"chunk",
")",
"}",
"file",
".",
"flush",
"file",
".",
"rewind",
"end"
] | Efficiently downloads blob data into the given file. | [
"Efficiently",
"downloads",
"blob",
"data",
"into",
"the",
"given",
"file",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activestorage/lib/active_storage/downloading.rb#L35-L40 | train | Download the blob to the given file. | [
30522,
13366,
8816,
1035,
1038,
4135,
2497,
1035,
2000,
1006,
5371,
1007,
1001,
1024,
9986,
1024,
5371,
1012,
8026,
5302,
3207,
1038,
4135,
2497,
1012,
8816,
1063,
1064,
20000,
1064,
5371,
1012,
4339,
1006,
20000,
1007,
1065,
5371,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_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.system_update | def system_update(resource_group_name, workspace_name, compute_name, custom_headers:nil)
response = system_update_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
nil
end | ruby | def system_update(resource_group_name, workspace_name, compute_name, custom_headers:nil)
response = system_update_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"system_update",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"compute_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"system_update_async",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"compute_name",
",",
"custom_headers",... | System Update On 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. | [
"System",
"Update",
"On",
"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#L329-L332 | train | Updates a compute. | [
30522,
13366,
2291,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2573,
15327,
1035,
2171,
1010,
24134,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2291,
1035,
10651,
1035,
2004,
6038,
2278,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_netapp/lib/2017-08-15-preview/generated/azure_mgmt_netapp/snapshots.rb | Azure::NetApp::Mgmt::V2017_08_15_preview.Snapshots.list_with_http_info | def list_with_http_info(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
list_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
end | ruby | def list_with_http_info(resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
list_async(resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
end | [
"def",
"list_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"volume_name",
",",
"custom_headers",
":",
"nil",
")",
"list_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"volume_name",
",",
"cu... | List snapshots
@param resource_group_name [String] The name of the resource group.
@param account_name [String] The name of the NetApp account
@param pool_name [String] The name of the capacity pool
@param volume_name [String] The name of the volume
@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",
"snapshots"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_netapp/lib/2017-08-15-preview/generated/azure_mgmt_netapp/snapshots.rb#L53-L55 | train | Gets the list of the specified HDInsight volume. | [
30522,
13366,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4770,
1035,
2171,
1010,
3872,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2017-03-01/generated/azure_mgmt_api_management/tenant_configuration.rb | Azure::ApiManagement::Mgmt::V2017_03_01.TenantConfiguration.deploy | def deploy(resource_group_name, service_name, parameters, custom_headers:nil)
response = deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def deploy(resource_group_name, service_name, parameters, custom_headers:nil)
response = deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"deploy",
"(",
"resource_group_name",
",",
"service_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"deploy_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
... | This operation applies changes from the specified Git branch to the
configuration database. This is a long running operation and could take
several minutes to complete.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param parameters [DeployConfigurationParameters] Deploy Configuration
parameters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationResultContract] operation results. | [
"This",
"operation",
"applies",
"changes",
"from",
"the",
"specified",
"Git",
"branch",
"to",
"the",
"configuration",
"database",
".",
"This",
"is",
"a",
"long",
"running",
"operation",
"and",
"could",
"take",
"several",
"minutes",
"to",
"complete",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2017-03-01/generated/azure_mgmt_api_management/tenant_configuration.rb#L38-L41 | train | Deploy a service to a service group. | [
30522,
13366,
21296,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
21296,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/thrift | lib/rb/lib/thrift/protocol/json_protocol.rb | Thrift.JsonProtocol.write_json_integer | def write_json_integer(num)
@context.write(trans)
escapeNum = @context.escapeNum
if (escapeNum)
trans.write(@@kJSONStringDelimiter)
end
trans.write(num.to_s);
if (escapeNum)
trans.write(@@kJSONStringDelimiter)
end
end | ruby | def write_json_integer(num)
@context.write(trans)
escapeNum = @context.escapeNum
if (escapeNum)
trans.write(@@kJSONStringDelimiter)
end
trans.write(num.to_s);
if (escapeNum)
trans.write(@@kJSONStringDelimiter)
end
end | [
"def",
"write_json_integer",
"(",
"num",
")",
"@context",
".",
"write",
"(",
"trans",
")",
"escapeNum",
"=",
"@context",
".",
"escapeNum",
"if",
"(",
"escapeNum",
")",
"trans",
".",
"write",
"(",
"@@kJSONStringDelimiter",
")",
"end",
"trans",
".",
"write",
... | Convert the given integer type to a JSON number, or a string
if the context requires it (eg: key in a map pair). | [
"Convert",
"the",
"given",
"integer",
"type",
"to",
"a",
"JSON",
"number",
"or",
"a",
"string",
"if",
"the",
"context",
"requires",
"it",
"(",
"eg",
":",
"key",
"in",
"a",
"map",
"pair",
")",
"."
] | 27d8387c49a49fcf193893f834e9766ae0b051c1 | https://github.com/apache/thrift/blob/27d8387c49a49fcf193893f834e9766ae0b051c1/lib/rb/lib/thrift/protocol/json_protocol.rb#L320-L330 | train | Write a JSON integer to the current context. | [
30522,
13366,
4339,
1035,
1046,
3385,
1035,
16109,
1006,
16371,
2213,
1007,
1030,
6123,
1012,
4339,
1006,
9099,
1007,
4019,
19172,
1027,
1030,
6123,
1012,
4019,
19172,
2065,
1006,
4019,
19172,
1007,
9099,
1012,
4339,
1006,
1030,
1030,
1047,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.add_hierarchical_entity | def add_hierarchical_entity(app_id, version_id, hierarchical_model_create_object, custom_headers:nil)
response = add_hierarchical_entity_async(app_id, version_id, hierarchical_model_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def add_hierarchical_entity(app_id, version_id, hierarchical_model_create_object, custom_headers:nil)
response = add_hierarchical_entity_async(app_id, version_id, hierarchical_model_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"add_hierarchical_entity",
"(",
"app_id",
",",
"version_id",
",",
"hierarchical_model_create_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"add_hierarchical_entity_async",
"(",
"app_id",
",",
"version_id",
",",
"hierarchical_model_create_object",
... | Adds a hierarchical entity extractor to a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param hierarchical_model_create_object [HierarchicalEntityModel] A model
containing the name and children of the new entity extractor.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Uuid] operation results. | [
"Adds",
"a",
"hierarchical",
"entity",
"extractor",
"to",
"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#L503-L506 | train | Adds a hierarchical entity to the application version. | [
30522,
13366,
5587,
1035,
25835,
1035,
9178,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
25835,
1035,
2944,
1035,
3443,
1035,
4874,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
5587,
1035,
25835,
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... |
RailsEventStore/rails_event_store | ruby_event_store/lib/ruby_event_store/specification.rb | RubyEventStore.Specification.reduce | def reduce(accumulator = nil, &block)
raise ArgumentError.new("Block must be given") unless block_given?
each.reduce(accumulator, &block)
end | ruby | def reduce(accumulator = nil, &block)
raise ArgumentError.new("Block must be given") unless block_given?
each.reduce(accumulator, &block)
end | [
"def",
"reduce",
"(",
"accumulator",
"=",
"nil",
",",
"&",
"block",
")",
"raise",
"ArgumentError",
".",
"new",
"(",
"\"Block must be given\"",
")",
"unless",
"block_given?",
"each",
".",
"reduce",
"(",
"accumulator",
",",
"block",
")",
"end"
] | Reduces the results of the query based on the specification
built up to this point result using provided block.
{http://railseventstore.org/docs/read/ Find out more}.
@accumulator starting state for reduce operation
@return reduce result as defined by block given | [
"Reduces",
"the",
"results",
"of",
"the",
"query",
"based",
"on",
"the",
"specification",
"built",
"up",
"to",
"this",
"point",
"result",
"using",
"provided",
"block",
".",
"{",
"http",
":",
"//",
"railseventstore",
".",
"org",
"/",
"docs",
"/",
"read",
... | 3ee4f3148499794154ee6fec74ccf6d4670d85ac | https://github.com/RailsEventStore/rails_event_store/blob/3ee4f3148499794154ee6fec74ccf6d4670d85ac/ruby_event_store/lib/ruby_event_store/specification.rb#L114-L117 | train | Reduce the elements of the array using the given accumulator. | [
30522,
13366,
5547,
1006,
16222,
2819,
20350,
1027,
9152,
2140,
1010,
1004,
3796,
1007,
5333,
6685,
2121,
29165,
1012,
2047,
1006,
1000,
3796,
2442,
2022,
2445,
1000,
1007,
4983,
3796,
1035,
2445,
1029,
2169,
1012,
5547,
1006,
16222,
2819,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/db_cluster_parameter_group.rb | Aws::RDS.DBClusterParameterGroup.reset | def reset(options = {})
options = options.merge(db_cluster_parameter_group_name: @name)
resp = @client.reset_db_cluster_parameter_group(options)
DBClusterParameterGroup.new(
name: resp.data.db_cluster_parameter_group_name,
client: @client
)
end | ruby | def reset(options = {})
options = options.merge(db_cluster_parameter_group_name: @name)
resp = @client.reset_db_cluster_parameter_group(options)
DBClusterParameterGroup.new(
name: resp.data.db_cluster_parameter_group_name,
client: @client
)
end | [
"def",
"reset",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"db_cluster_parameter_group_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"reset_db_cluster_parameter_group",
"(",
"options",
")",
"DBClusterParameterGroup",... | @example Request syntax with placeholder values
dbclusterparametergroup = db_cluster_parameter_group.reset({
reset_all_parameters: false,
parameters: [
{
parameter_name: "String",
parameter_value: "String",
description: "String",
source: "String",
apply_type: "String",
data_type: "String",
allowed_values: "String",
is_modifiable: false,
minimum_engine_version: "String",
apply_method: "immediate", # accepts immediate, pending-reboot
supported_engine_modes: ["String"],
},
],
})
@param [Hash] options ({})
@option options [Boolean] :reset_all_parameters
A value that is set to `true` to reset all parameters in the DB
cluster parameter group to their default values, and `false`
otherwise. You can't use this parameter if there is a list of
parameter names specified for the `Parameters` parameter.
@option options [Array<Types::Parameter>] :parameters
A list of parameter names in the DB cluster parameter group to reset
to the default values. You can't use this parameter if the
`ResetAllParameters` parameter is set to `true`.
@return [DBClusterParameterGroup] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_cluster_parameter_group.rb#L307-L314 | train | Reset the DB cluster parameter group | [
30522,
13366,
25141,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
16962,
1035,
9324,
1035,
16381,
1035,
2177,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
25141,
1035,
16962,
1035,
932... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/worksheet.rb | Axlsx.Worksheet.to_xml_string | def to_xml_string str=''
add_autofilter_defined_name_to_workbook
auto_filter.apply if auto_filter.range
str << '<?xml version="1.0" encoding="UTF-8"?>'
str << worksheet_node
serializable_parts.each do |item|
item.to_xml_string(str) if item
end
str << '</worksheet>'
end | ruby | def to_xml_string str=''
add_autofilter_defined_name_to_workbook
auto_filter.apply if auto_filter.range
str << '<?xml version="1.0" encoding="UTF-8"?>'
str << worksheet_node
serializable_parts.each do |item|
item.to_xml_string(str) if item
end
str << '</worksheet>'
end | [
"def",
"to_xml_string",
"str",
"=",
"''",
"add_autofilter_defined_name_to_workbook",
"auto_filter",
".",
"apply",
"if",
"auto_filter",
".",
"range",
"str",
"<<",
"'<?xml version=\"1.0\" encoding=\"UTF-8\"?>'",
"str",
"<<",
"worksheet_node",
"serializable_parts",
".",
"each"... | Serializes the worksheet object to an xml string
This intentionally does not use nokogiri for performance reasons
@return [String] | [
"Serializes",
"the",
"worksheet",
"object",
"to",
"an",
"xml",
"string",
"This",
"intentionally",
"does",
"not",
"use",
"nokogiri",
"for",
"performance",
"reasons"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/worksheet.rb#L563-L572 | train | Returns xml string representation of the worksheet. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
2358,
2099,
1027,
1005,
1005,
5587,
1035,
8285,
8873,
21928,
1035,
4225,
1035,
2171,
1035,
2000,
1035,
2147,
8654,
8285,
1035,
11307,
1012,
6611,
2065,
8285,
1035,
11307,
1012,
2846,
2358,
2099,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_deleted_certificate | def get_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
response = get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
response = get_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_deleted_certificate",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_deleted_certificate_async",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Retrieves information about the specified deleted certificate.
The GetDeletedCertificate operation retrieves the deleted certificate
information plus its attributes, such as retention interval, scheduled
permanent deletion and the current deletion recovery level. This operation
requires the certificates/get 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 custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DeletedCertificateBundle] operation results. | [
"Retrieves",
"information",
"about",
"the",
"specified",
"deleted",
"certificate",
"."
] | 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#L6648-L6651 | train | Gets the deleted certificate. | [
30522,
13366,
2131,
1035,
17159,
1035,
8196,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
17159,
1035,
8196,
1035,
2004,
6038,
2278,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tongueroo/jets | lib/jets/controller/rendering/rack_renderer.rb | Jets::Controller::Rendering.RackRenderer.rackify_headers | def rackify_headers(headers)
results = {}
headers.each do |k,v|
rack_key = 'HTTP_' + k.gsub('-','_').upcase
results[rack_key] = v
end
results
end | ruby | def rackify_headers(headers)
results = {}
headers.each do |k,v|
rack_key = 'HTTP_' + k.gsub('-','_').upcase
results[rack_key] = v
end
results
end | [
"def",
"rackify_headers",
"(",
"headers",
")",
"results",
"=",
"{",
"}",
"headers",
".",
"each",
"do",
"|",
"k",
",",
"v",
"|",
"rack_key",
"=",
"'HTTP_'",
"+",
"k",
".",
"gsub",
"(",
"'-'",
",",
"'_'",
")",
".",
"upcase",
"results",
"[",
"rack_key... | Takes headers and adds HTTP_ to front of the keys because that is what rack
does to the headers passed from a request. This seems to be the standard
when testing with curl and inspecting the headers in a Rack app. Example:
https://gist.github.com/tongueroo/94f22f6c261c8999e4f4f776547e2ee3
This is useful for:
ActionController::Base.renderer.new(renderer_options)
renderer_options are rack normalized headers.
Example input (from api gateway)
{"host"=>"localhost:8888",
"user-agent"=>"curl/7.53.1",
"accept"=>"*/*",
"version"=>"HTTP/1.1",
"x-amzn-trace-id"=>"Root=1-5bde5b19-61d0d4ab4659144f8f69e38f"}
Example output:
{"HTTP_HOST"=>"localhost:8888",
"HTTP_USER_AGENT"=>"curl/7.53.1",
"HTTP_ACCEPT"=>"*/*",
"HTTP_VERSION"=>"HTTP/1.1",
"HTTP_X_AMZN_TRACE_ID"=>"Root=1-5bde5b19-61d0d4ab4659144f8f69e38f"} | [
"Takes",
"headers",
"and",
"adds",
"HTTP_",
"to",
"front",
"of",
"the",
"keys",
"because",
"that",
"is",
"what",
"rack",
"does",
"to",
"the",
"headers",
"passed",
"from",
"a",
"request",
".",
"This",
"seems",
"to",
"be",
"the",
"standard",
"when",
"testi... | 46943a519224067e58aa3e2d5656e3ca083150f9 | https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/controller/rendering/rack_renderer.rb#L104-L111 | train | Rackify the headers | [
30522,
13366,
14513,
8757,
1035,
20346,
2015,
1006,
20346,
2015,
1007,
3463,
1027,
1063,
1065,
20346,
2015,
1012,
2169,
2079,
1064,
1047,
1010,
1058,
1064,
14513,
1035,
3145,
1027,
1005,
8299,
1035,
1005,
1009,
1047,
1012,
28177,
12083,
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... |
CocoaPods/Xcodeproj | lib/xcodeproj/project.rb | Xcodeproj.Project.to_tree_hash | def to_tree_hash
hash = {}
objects_dictionary = {}
hash['objects'] = objects_dictionary
hash['archiveVersion'] = archive_version.to_s
hash['objectVersion'] = object_version.to_s
hash['classes'] = classes
hash['rootObject'] = root_object.to_tree_hash
hash
end | ruby | def to_tree_hash
hash = {}
objects_dictionary = {}
hash['objects'] = objects_dictionary
hash['archiveVersion'] = archive_version.to_s
hash['objectVersion'] = object_version.to_s
hash['classes'] = classes
hash['rootObject'] = root_object.to_tree_hash
hash
end | [
"def",
"to_tree_hash",
"hash",
"=",
"{",
"}",
"objects_dictionary",
"=",
"{",
"}",
"hash",
"[",
"'objects'",
"]",
"=",
"objects_dictionary",
"hash",
"[",
"'archiveVersion'",
"]",
"=",
"archive_version",
".",
"to_s",
"hash",
"[",
"'objectVersion'",
"]",
"=",
... | Converts the objects tree to a hash substituting the hash
of the referenced to their UUID reference. As a consequence the hash of
an object might appear multiple times and the information about their
uniqueness is lost.
This method is designed to work in conjunction with {Hash#recursive_diff}
to provide a complete, yet readable, diff of two projects *not* affected
by differences in UUIDs.
@return [Hash] a hash representation of the project different from the
plist one. | [
"Converts",
"the",
"objects",
"tree",
"to",
"a",
"hash",
"substituting",
"the",
"hash",
"of",
"the",
"referenced",
"to",
"their",
"UUID",
"reference",
".",
"As",
"a",
"consequence",
"the",
"hash",
"of",
"an",
"object",
"might",
"appear",
"multiple",
"times",... | 3be1684437a6f8e69c7836ad4c85a2b78663272f | https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/lib/xcodeproj/project.rb#L320-L329 | train | Returns a tree hash of the object. | [
30522,
13366,
2000,
1035,
3392,
1035,
23325,
23325,
1027,
1063,
1065,
5200,
1035,
9206,
1027,
1063,
1065,
23325,
1031,
1005,
5200,
1005,
1033,
1027,
5200,
1035,
9206,
23325,
1031,
1005,
8756,
27774,
1005,
1033,
1027,
8756,
1035,
2544,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/group_user.rb | Azure::ApiManagement::Mgmt::V2019_01_01.GroupUser.create_with_http_info | def create_with_http_info(resource_group_name, service_name, group_id, user_id, custom_headers:nil)
create_async(resource_group_name, service_name, group_id, user_id, custom_headers:custom_headers).value!
end | ruby | def create_with_http_info(resource_group_name, service_name, group_id, user_id, custom_headers:nil)
create_async(resource_group_name, service_name, group_id, user_id, custom_headers:custom_headers).value!
end | [
"def",
"create_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"group_id",
",",
"user_id",
",",
"custom_headers",
":",
"nil",
")",
"create_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"group_id",
",",
"user_id",
",",
"custom_h... | Add existing user to existing group
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param group_id [String] Group identifier. Must be unique in the current API
Management service instance.
@param user_id [String] User identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Add",
"existing",
"user",
"to",
"existing",
"group"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/group_user.rb#L312-L314 | train | Creates a new centralized version of the specified user in the group. | [
30522,
13366,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
2177,
1035,
8909,
1010,
5310,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3443,
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... |
ruby/psych | lib/psych/scalar_scanner.rb | Psych.ScalarScanner.parse_time | def parse_time string
klass = class_loader.load 'Time'
date, time = *(string.split(/[ tT]/, 2))
(yy, m, dd) = date.match(/^(-?\d{4})-(\d{1,2})-(\d{1,2})/).captures.map { |x| x.to_i }
md = time.match(/(\d+:\d+:\d+)(?:\.(\d*))?\s*(Z|[-+]\d+(:\d\d)?)?/)
(hh, mm, ss) = md[1].split(':').map { |x| x.to_i }
us = (md[2] ? Rational("0.#{md[2]}") : 0) * 1000000
time = klass.utc(yy, m, dd, hh, mm, ss, us)
return time if 'Z' == md[3]
return klass.at(time.to_i, us) unless md[3]
tz = md[3].match(/^([+\-]?\d{1,2})\:?(\d{1,2})?$/)[1..-1].compact.map { |digit| Integer(digit, 10) }
offset = tz.first * 3600
if offset < 0
offset -= ((tz[1] || 0) * 60)
else
offset += ((tz[1] || 0) * 60)
end
klass.new(yy, m, dd, hh, mm, ss+us/(1_000_000r), offset)
end | ruby | def parse_time string
klass = class_loader.load 'Time'
date, time = *(string.split(/[ tT]/, 2))
(yy, m, dd) = date.match(/^(-?\d{4})-(\d{1,2})-(\d{1,2})/).captures.map { |x| x.to_i }
md = time.match(/(\d+:\d+:\d+)(?:\.(\d*))?\s*(Z|[-+]\d+(:\d\d)?)?/)
(hh, mm, ss) = md[1].split(':').map { |x| x.to_i }
us = (md[2] ? Rational("0.#{md[2]}") : 0) * 1000000
time = klass.utc(yy, m, dd, hh, mm, ss, us)
return time if 'Z' == md[3]
return klass.at(time.to_i, us) unless md[3]
tz = md[3].match(/^([+\-]?\d{1,2})\:?(\d{1,2})?$/)[1..-1].compact.map { |digit| Integer(digit, 10) }
offset = tz.first * 3600
if offset < 0
offset -= ((tz[1] || 0) * 60)
else
offset += ((tz[1] || 0) * 60)
end
klass.new(yy, m, dd, hh, mm, ss+us/(1_000_000r), offset)
end | [
"def",
"parse_time",
"string",
"klass",
"=",
"class_loader",
".",
"load",
"'Time'",
"date",
",",
"time",
"=",
"(",
"string",
".",
"split",
"(",
"/",
"/",
",",
"2",
")",
")",
"(",
"yy",
",",
"m",
",",
"dd",
")",
"=",
"date",
".",
"match",
"(",
"... | Parse and return a Time from +string+ | [
"Parse",
"and",
"return",
"a",
"Time",
"from",
"+",
"string",
"+"
] | f3a37e6bc1c2a98bfc9fafc389ea05622c744af9 | https://github.com/ruby/psych/blob/f3a37e6bc1c2a98bfc9fafc389ea05622c744af9/lib/psych/scalar_scanner.rb#L122-L147 | train | Parse a string into a Time object. | [
30522,
13366,
11968,
3366,
1035,
2051,
5164,
1047,
27102,
1027,
2465,
1035,
7170,
2121,
1012,
7170,
1005,
2051,
1005,
3058,
1010,
2051,
1027,
1008,
1006,
5164,
1012,
3975,
1006,
1013,
1031,
23746,
1033,
1013,
1010,
1016,
1007,
1007,
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... |
puppetlabs/puppet | lib/puppet/module_tool/contents_description.rb | Puppet::ModuleTool.ContentsDescription.attr_doc | def attr_doc(type, kind)
attrs = []
type.allattrs.each do |name|
if type.attrtype(name) == kind && name != :provider
attrs.push(:name => name, :doc => type.attrclass(name).doc)
end
end
attrs
end | ruby | def attr_doc(type, kind)
attrs = []
type.allattrs.each do |name|
if type.attrtype(name) == kind && name != :provider
attrs.push(:name => name, :doc => type.attrclass(name).doc)
end
end
attrs
end | [
"def",
"attr_doc",
"(",
"type",
",",
"kind",
")",
"attrs",
"=",
"[",
"]",
"type",
".",
"allattrs",
".",
"each",
"do",
"|",
"name",
"|",
"if",
"type",
".",
"attrtype",
"(",
"name",
")",
"==",
"kind",
"&&",
"name",
"!=",
":provider",
"attrs",
".",
... | Return an array of hashes representing this +type+'s attrs of +kind+
(e.g. :param or :property), each containing :name and :doc. | [
"Return",
"an",
"array",
"of",
"hashes",
"representing",
"this",
"+",
"type",
"+",
"s",
"attrs",
"of",
"+",
"kind",
"+",
"(",
"e",
".",
"g",
".",
":",
"param",
"or",
":",
"property",
")",
"each",
"containing",
":",
"name",
"and",
":",
"doc",
"."
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/module_tool/contents_description.rb#L64-L74 | train | Get the doc for a given attribute type | [
30522,
13366,
2012,
16344,
1035,
9986,
1006,
2828,
1010,
2785,
1007,
2012,
16344,
2015,
1027,
1031,
1033,
2828,
1012,
25699,
4779,
2869,
1012,
2169,
2079,
1064,
2171,
1064,
2065,
2828,
1012,
2012,
16344,
13874,
1006,
2171,
1007,
1027,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/runbook_operations.rb | Azure::Automation::Mgmt::V2015_10_31.RunbookOperations.update_with_http_info | def update_with_http_info(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers:nil)
update_async(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers:nil)
update_async(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"runbook_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"runbook_name",
","... | Update the runbook identified by runbook name.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param runbook_name [String] The runbook name.
@param parameters [RunbookUpdateParameters] The update parameters for
runbook.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Update",
"the",
"runbook",
"identified",
"by",
"runbook",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/runbook_operations.rb#L386-L388 | train | Updates a runbook s index. | [
30522,
13366,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
2448,
8654,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.add_sub_list | def add_sub_list(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:nil)
response = add_sub_list_async(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def add_sub_list(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:nil)
response = add_sub_list_async(app_id, version_id, cl_entity_id, word_list_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"add_sub_list",
"(",
"app_id",
",",
"version_id",
",",
"cl_entity_id",
",",
"word_list_create_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"add_sub_list_async",
"(",
"app_id",
",",
"version_id",
",",
"cl_entity_id",
",",
"word_list_create... | Adds a sublist to an existing list entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param cl_entity_id The list entity extractor ID.
@param word_list_create_object [WordListObject] Words list.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Bignum] operation results. | [
"Adds",
"a",
"sublist",
"to",
"an",
"existing",
"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#L4098-L4101 | train | Adds a list of words to the list. | [
30522,
13366,
5587,
1035,
4942,
1035,
2862,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
18856,
1035,
9178,
1035,
8909,
1010,
2773,
1035,
2862,
1035,
3443,
1035,
4874,
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... |
jhund/filterrific | lib/filterrific/action_controller_extension.rb | Filterrific.ActionControllerExtension.sanitize_filterrific_param | def sanitize_filterrific_param(val)
case val
when Array
# Return Array
val.map { |e| sanitize_filterrific_param(e) }
when Hash
# Return Hash
val.inject({}) { |m, (k,v)| m[k] = sanitize_filterrific_param(v); m }
when NilClass
# Nothing to do, use val as is
val
when String
helpers.sanitize(val)
else
# Nothing to do, use val as is
val
end
end | ruby | def sanitize_filterrific_param(val)
case val
when Array
# Return Array
val.map { |e| sanitize_filterrific_param(e) }
when Hash
# Return Hash
val.inject({}) { |m, (k,v)| m[k] = sanitize_filterrific_param(v); m }
when NilClass
# Nothing to do, use val as is
val
when String
helpers.sanitize(val)
else
# Nothing to do, use val as is
val
end
end | [
"def",
"sanitize_filterrific_param",
"(",
"val",
")",
"case",
"val",
"when",
"Array",
"# Return Array",
"val",
".",
"map",
"{",
"|",
"e",
"|",
"sanitize_filterrific_param",
"(",
"e",
")",
"}",
"when",
"Hash",
"# Return Hash",
"val",
".",
"inject",
"(",
"{",
... | Sanitizes value to prevent xss attack.
Uses Rails ActionView::Helpers::SanitizeHelper.
@param val [Object] the value to sanitize. Can be any kind of object. Collections
will have their members sanitized recursively. | [
"Sanitizes",
"value",
"to",
"prevent",
"xss",
"attack",
".",
"Uses",
"Rails",
"ActionView",
"::",
"Helpers",
"::",
"SanitizeHelper",
"."
] | 811edc57d3e2a3e538c1f0e9554e0909be052881 | https://github.com/jhund/filterrific/blob/811edc57d3e2a3e538c1f0e9554e0909be052881/lib/filterrific/action_controller_extension.rb#L90-L107 | train | Sanitize the given value for the Filterrific parameter | [
30522,
13366,
2624,
25090,
4371,
1035,
11307,
3089,
8873,
2278,
1035,
11498,
2213,
1006,
11748,
1007,
2553,
11748,
2043,
9140,
1001,
2709,
9140,
11748,
1012,
4949,
1063,
1064,
1041,
1064,
2624,
25090,
4371,
1035,
11307,
3089,
8873,
2278,
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_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb | Azure::IotHub::Mgmt::V2017_01_19.IotHubResource.import_devices_with_http_info | def import_devices_with_http_info(resource_group_name, resource_name, import_devices_parameters, custom_headers:nil)
import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers:custom_headers).value!
end | ruby | def import_devices_with_http_info(resource_group_name, resource_name, import_devices_parameters, custom_headers:nil)
import_devices_async(resource_group_name, resource_name, import_devices_parameters, custom_headers:custom_headers).value!
end | [
"def",
"import_devices_with_http_info",
"(",
"resource_group_name",
",",
"resource_name",
",",
"import_devices_parameters",
",",
"custom_headers",
":",
"nil",
")",
"import_devices_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"import_devices_parameters",
",",... | Import, update, or delete device identities in the IoT hub identity registry
from a blob. For more information, see:
https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
Import, update, or delete device identities in the IoT hub identity registry
from a blob. For more information, see:
https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities.
@param resource_group_name [String] The name of the resource group that
contains the IoT hub.
@param resource_name [String] The name of the IoT hub.
@param import_devices_parameters [ImportDevicesRequest] The parameters that
specify the import devices 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. | [
"Import",
"update",
"or",
"delete",
"device",
"identities",
"in",
"the",
"IoT",
"hub",
"identity",
"registry",
"from",
"a",
"blob",
".",
"For",
"more",
"information",
"see",
":",
"https",
":",
"//",
"docs",
".",
"microsoft",
".",
"com",
"/",
"azure",
"/"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb#L1875-L1877 | train | Import devices from the specified resource group. | [
30522,
13366,
12324,
1035,
5733,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
12324,
1035,
5733,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
12324,
1035,
5733... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_all_entities_backed_up_by_policy_with_http_info | def get_all_entities_backed_up_by_policy_with_http_info(backup_policy_name, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
get_all_entities_backed_up_by_policy_async(backup_policy_name, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_all_entities_backed_up_by_policy_with_http_info(backup_policy_name, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
get_all_entities_backed_up_by_policy_async(backup_policy_name, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_all_entities_backed_up_by_policy_with_http_info",
"(",
"backup_policy_name",
",",
"continuation_token",
":",
"nil",
",",
"max_results",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_all_entities_backed_up_by_policy_async",
"... | Gets the list of backup entities that are associated with this policy.
Returns a list of Service Fabric application, service or partition which are
associated with this backup policy.
@param backup_policy_name [String] The name of the backup policy.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"list",
"of",
"backup",
"entities",
"that",
"are",
"associated",
"with",
"this",
"policy",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L22734-L22736 | train | Gets all entities backed up by backup policy. | [
30522,
13366,
2131,
1035,
2035,
1035,
11422,
1035,
6153,
1035,
2039,
1035,
2011,
1035,
3343,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10200,
1035,
3343,
1035,
2171,
1010,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
4098,
1035,
3463,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | 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_partition_info_with_http_info | def get_partition_info_with_http_info(partition_id, timeout:60, custom_headers:nil)
get_partition_info_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_partition_info_with_http_info(partition_id, timeout:60, custom_headers:nil)
get_partition_info_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_partition_info_with_http_info",
"(",
"partition_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_partition_info_async",
"(",
"partition_id",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".",
"... | Gets the information about a Service Fabric partition.
Gets the information about the specified partition. The response includes the
partition ID, partitioning scheme information, keys supported by the
partition, status, health, and other details about the partition.
@param partition_id The identity of the partition.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"information",
"about",
"a",
"Service",
"Fabric",
"partition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L12002-L12004 | train | Gets the information about the specified partition. | [
30522,
13366,
2131,
1035,
13571,
1035,
18558,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
13571,
1035,
18558,
1035,
2004,
603... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.txn_read_preference | def txn_read_preference
rp = txn_options && txn_options[:read_preference] ||
@client.read_preference
Mongo::Lint.validate_underscore_read_preference(rp)
rp
end | ruby | def txn_read_preference
rp = txn_options && txn_options[:read_preference] ||
@client.read_preference
Mongo::Lint.validate_underscore_read_preference(rp)
rp
end | [
"def",
"txn_read_preference",
"rp",
"=",
"txn_options",
"&&",
"txn_options",
"[",
":read_preference",
"]",
"||",
"@client",
".",
"read_preference",
"Mongo",
"::",
"Lint",
".",
"validate_underscore_read_preference",
"(",
"rp",
")",
"rp",
"end"
] | Get the read preference the session will use in the currently
active transaction.
This is a driver style hash with underscore keys.
@example Get the transaction's read preference
session.txn_read_preference
@return [ Hash ] The read preference of the transaction.
@since 2.6.0 | [
"Get",
"the",
"read",
"preference",
"the",
"session",
"will",
"use",
"in",
"the",
"currently",
"active",
"transaction",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/session.rb#L886-L891 | train | Validate the read preference of the current transaction. | [
30522,
13366,
19067,
2078,
1035,
3191,
1035,
12157,
1054,
2361,
1027,
19067,
2078,
1035,
7047,
1004,
1004,
19067,
2078,
1035,
7047,
1031,
1024,
3191,
1035,
12157,
1033,
1064,
1064,
1030,
7396,
1012,
3191,
1035,
12157,
12256,
3995,
1024,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/node_reports.rb | Azure::Automation::Mgmt::V2015_10_31.NodeReports.list_by_node_next | def list_by_node_next(next_page_link, custom_headers:nil)
response = list_by_node_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_node_next(next_page_link, custom_headers:nil)
response = list_by_node_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_node_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_node_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
... | Retrieve the Dsc node report list by node id.
@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 [DscNodeReportListResult] operation results. | [
"Retrieve",
"the",
"Dsc",
"node",
"report",
"list",
"by",
"node",
"id",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/node_reports.rb#L332-L335 | train | Gets the list of all the node IDs in a given App Service Environment. | [
30522,
13366,
2862,
1035,
2011,
1035,
13045,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
13045,
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... |
piotrmurach/github | lib/github_api/client/issues/labels.rb | Github.Client::Issues::Labels.create | def create(*args)
arguments(args, required: [:user, :repo]) do
permit VALID_LABEL_INPUTS
assert_required VALID_LABEL_INPUTS
end
post_request("/repos/#{arguments.user}/#{arguments.repo}/labels", arguments.params)
end | ruby | def create(*args)
arguments(args, required: [:user, :repo]) do
permit VALID_LABEL_INPUTS
assert_required VALID_LABEL_INPUTS
end
post_request("/repos/#{arguments.user}/#{arguments.repo}/labels", arguments.params)
end | [
"def",
"create",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
"]",
")",
"do",
"permit",
"VALID_LABEL_INPUTS",
"assert_required",
"VALID_LABEL_INPUTS",
"end",
"post_request",
"(",
"\"/repos/#{arguments.user}/#{a... | Create a label
@param [Hash] params
@option params [String] :name
Required string
@option params [String] :color
Required string - 6 character hex code, without leading
@example
github = Github.new user: 'user-name', repo: 'repo-name'
github.issues.labels.create name: 'API', color: 'FFFFFF'
@api public | [
"Create",
"a",
"label"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/issues/labels.rb#L80-L87 | train | Create a label | [
30522,
13366,
3443,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1033,
1007,
2079,
9146,
9398,
1035,
3830,
1035,
20407,
20865,
1035,
3223,
9398,
1035,
3830,
1035,
20407... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | sigh/lib/sigh/runner.rb | Sigh.Runner.certificate_to_use | def certificate_to_use
certificates = certificates_for_profile_and_platform
# Filter them
certificates = certificates.find_all do |c|
if Sigh.config[:cert_id]
next unless c.id == Sigh.config[:cert_id].strip
end
if Sigh.config[:cert_owner_name]
next unless c.owner_name.strip == Sigh.config[:cert_owner_name].strip
end
true
end
# verify certificates
if Helper.mac?
unless Sigh.config[:skip_certificate_verification]
certificates = certificates.find_all do |c|
file = Tempfile.new('cert')
file.write(c.download_raw)
file.close
FastlaneCore::CertChecker.installed?(file.path)
end
end
end
if certificates.count > 1 && !Sigh.config[:development]
UI.important("Found more than one code signing identity. Choosing the first one. Check out `fastlane sigh --help` to see all available options.")
UI.important("Available Code Signing Identities for current filters:")
certificates.each do |c|
str = ["\t- Name:", c.owner_name, "- ID:", c.id + " - Expires", c.expires.strftime("%d/%m/%Y")].join(" ")
UI.message(str.green)
end
end
if certificates.count == 0
filters = ""
filters << "Owner Name: '#{Sigh.config[:cert_owner_name]}' " if Sigh.config[:cert_owner_name]
filters << "Certificate ID: '#{Sigh.config[:cert_id]}' " if Sigh.config[:cert_id]
UI.important("No certificates for filter: #{filters}") if filters.length > 0
message = "Could not find a matching code signing identity for type '#{profile_type.to_s.split(':').last}'. "
message += "It is recommended to use match to manage code signing for you, more information on https://codesigning.guide. "
message += "If you don't want to do so, you can also use cert to generate a new one: https://fastlane.tools/cert"
UI.user_error!(message)
end
return certificates if Sigh.config[:development] # development profiles support multiple certificates
return certificates.first
end | ruby | def certificate_to_use
certificates = certificates_for_profile_and_platform
# Filter them
certificates = certificates.find_all do |c|
if Sigh.config[:cert_id]
next unless c.id == Sigh.config[:cert_id].strip
end
if Sigh.config[:cert_owner_name]
next unless c.owner_name.strip == Sigh.config[:cert_owner_name].strip
end
true
end
# verify certificates
if Helper.mac?
unless Sigh.config[:skip_certificate_verification]
certificates = certificates.find_all do |c|
file = Tempfile.new('cert')
file.write(c.download_raw)
file.close
FastlaneCore::CertChecker.installed?(file.path)
end
end
end
if certificates.count > 1 && !Sigh.config[:development]
UI.important("Found more than one code signing identity. Choosing the first one. Check out `fastlane sigh --help` to see all available options.")
UI.important("Available Code Signing Identities for current filters:")
certificates.each do |c|
str = ["\t- Name:", c.owner_name, "- ID:", c.id + " - Expires", c.expires.strftime("%d/%m/%Y")].join(" ")
UI.message(str.green)
end
end
if certificates.count == 0
filters = ""
filters << "Owner Name: '#{Sigh.config[:cert_owner_name]}' " if Sigh.config[:cert_owner_name]
filters << "Certificate ID: '#{Sigh.config[:cert_id]}' " if Sigh.config[:cert_id]
UI.important("No certificates for filter: #{filters}") if filters.length > 0
message = "Could not find a matching code signing identity for type '#{profile_type.to_s.split(':').last}'. "
message += "It is recommended to use match to manage code signing for you, more information on https://codesigning.guide. "
message += "If you don't want to do so, you can also use cert to generate a new one: https://fastlane.tools/cert"
UI.user_error!(message)
end
return certificates if Sigh.config[:development] # development profiles support multiple certificates
return certificates.first
end | [
"def",
"certificate_to_use",
"certificates",
"=",
"certificates_for_profile_and_platform",
"# Filter them",
"certificates",
"=",
"certificates",
".",
"find_all",
"do",
"|",
"c",
"|",
"if",
"Sigh",
".",
"config",
"[",
":cert_id",
"]",
"next",
"unless",
"c",
".",
"i... | Certificate to use based on the current distribution mode | [
"Certificate",
"to",
"use",
"based",
"on",
"the",
"current",
"distribution",
"mode"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/sigh/lib/sigh/runner.rb#L186-L237 | train | Returns the certificate to use for the current profile and platform | [
30522,
13366,
8196,
1035,
2000,
1035,
2224,
17987,
1027,
17987,
1035,
2005,
1035,
6337,
1035,
1998,
1035,
4132,
1001,
11307,
2068,
17987,
1027,
17987,
1012,
2424,
1035,
2035,
2079,
1064,
1039,
1064,
2065,
6682,
1012,
9530,
8873,
2290,
1031,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_service_bus/lib/2017-04-01/generated/azure_mgmt_service_bus/rules.rb | Azure::ServiceBus::Mgmt::V2017_04_01.Rules.list_by_subscriptions_with_http_info | def list_by_subscriptions_with_http_info(resource_group_name, namespace_name, topic_name, subscription_name, skip:nil, top:nil, custom_headers:nil)
list_by_subscriptions_async(resource_group_name, namespace_name, topic_name, subscription_name, skip:skip, top:top, custom_headers:custom_headers).value!
end | ruby | def list_by_subscriptions_with_http_info(resource_group_name, namespace_name, topic_name, subscription_name, skip:nil, top:nil, custom_headers:nil)
list_by_subscriptions_async(resource_group_name, namespace_name, topic_name, subscription_name, skip:skip, top:top, custom_headers:custom_headers).value!
end | [
"def",
"list_by_subscriptions_with_http_info",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"topic_name",
",",
"subscription_name",
",",
"skip",
":",
"nil",
",",
"top",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_by_subscriptions_async",
"(",
... | List all the rules within given topic-subscription
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The namespace name
@param topic_name [String] The topic name.
@param subscription_name [String] The subscription name.
@param skip [Integer] Skip is only used if a previous operation returned a
partial result. If a previous response contains a nextLink element, the value
of the nextLink element will include a skip parameter that specifies a
starting point to use for subsequent calls.
@param top [Integer] May be used to limit the number of results to the most
recent N usageDetails.
@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",
"all",
"the",
"rules",
"within",
"given",
"topic",
"-",
"subscription"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_bus/lib/2017-04-01/generated/azure_mgmt_service_bus/rules.rb#L67-L69 | train | Gets the list of all the documents in a subscription. | [
30522,
13366,
2862,
1035,
2011,
1035,
15002,
2015,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
8476,
1035,
2171,
1010,
15002,
1035,
2171,
1010,
13558,
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... |
httprb/http | lib/http/client.rb | HTTP.Client.verify_connection! | def verify_connection!(uri)
if default_options.persistent? && uri.origin != default_options.persistent
raise StateError, "Persistence is enabled for #{default_options.persistent}, but we got #{uri.origin}"
# We re-create the connection object because we want to let prior requests
# lazily load the body as long as possible, and this mimics prior functionality.
elsif @connection && (!@connection.keep_alive? || @connection.expired?)
close
# If we get into a bad state (eg, Timeout.timeout ensure being killed)
# close the connection to prevent potential for mixed responses.
elsif @state == :dirty
close
end
end | ruby | def verify_connection!(uri)
if default_options.persistent? && uri.origin != default_options.persistent
raise StateError, "Persistence is enabled for #{default_options.persistent}, but we got #{uri.origin}"
# We re-create the connection object because we want to let prior requests
# lazily load the body as long as possible, and this mimics prior functionality.
elsif @connection && (!@connection.keep_alive? || @connection.expired?)
close
# If we get into a bad state (eg, Timeout.timeout ensure being killed)
# close the connection to prevent potential for mixed responses.
elsif @state == :dirty
close
end
end | [
"def",
"verify_connection!",
"(",
"uri",
")",
"if",
"default_options",
".",
"persistent?",
"&&",
"uri",
".",
"origin",
"!=",
"default_options",
".",
"persistent",
"raise",
"StateError",
",",
"\"Persistence is enabled for #{default_options.persistent}, but we got #{uri.origin}... | Verify our request isn't going to be made against another URI | [
"Verify",
"our",
"request",
"isn",
"t",
"going",
"to",
"be",
"made",
"against",
"another",
"URI"
] | f37a10ea4fab3ee411907ea2e4251ddf0ca33a93 | https://github.com/httprb/http/blob/f37a10ea4fab3ee411907ea2e4251ddf0ca33a93/lib/http/client.rb#L110-L122 | train | verify connection object | [
30522,
13366,
20410,
1035,
4434,
999,
1006,
24471,
2072,
1007,
2065,
12398,
1035,
7047,
1012,
14516,
1029,
1004,
1004,
24471,
2072,
1012,
4761,
999,
1027,
12398,
1035,
7047,
1012,
14516,
5333,
2110,
2121,
29165,
1010,
1000,
28297,
2003,
912... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_scans.rb | Azure::SQL::Mgmt::V2017_10_01_preview.ManagedDatabaseVulnerabilityAssessmentScans.export_with_http_info | def export_with_http_info(resource_group_name, managed_instance_name, database_name, scan_id, custom_headers:nil)
export_async(resource_group_name, managed_instance_name, database_name, scan_id, custom_headers:custom_headers).value!
end | ruby | def export_with_http_info(resource_group_name, managed_instance_name, database_name, scan_id, custom_headers:nil)
export_async(resource_group_name, managed_instance_name, database_name, scan_id, custom_headers:custom_headers).value!
end | [
"def",
"export_with_http_info",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"database_name",
",",
"scan_id",
",",
"custom_headers",
":",
"nil",
")",
"export_async",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"database_name",
",",
"... | Convert an existing scan result to a human readable format. If already exists
nothing happens
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param managed_instance_name [String] The name of the managed instance.
@param database_name [String] The name of the scanned database.
@param scan_id [String] The vulnerability assessment scan Id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Convert",
"an",
"existing",
"scan",
"result",
"to",
"a",
"human",
"readable",
"format",
".",
"If",
"already",
"exists",
"nothing",
"happens"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_scans.rb#L323-L325 | train | Export a database scan. | [
30522,
13366,
9167,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
6013,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
13594,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
9167,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/admin_set_options_presenter.rb | Hyrax.AdminSetOptionsPresenter.sharing? | def sharing?(permission_template:)
wf = workflow(permission_template: permission_template)
return false unless wf
wf.allows_access_grant?
end | ruby | def sharing?(permission_template:)
wf = workflow(permission_template: permission_template)
return false unless wf
wf.allows_access_grant?
end | [
"def",
"sharing?",
"(",
"permission_template",
":",
")",
"wf",
"=",
"workflow",
"(",
"permission_template",
":",
"permission_template",
")",
"return",
"false",
"unless",
"wf",
"wf",
".",
"allows_access_grant?",
"end"
] | Does the workflow for the currently selected permission template allow sharing? | [
"Does",
"the",
"workflow",
"for",
"the",
"currently",
"selected",
"permission",
"template",
"allow",
"sharing?"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/presenters/hyrax/admin_set_options_presenter.rb#L45-L49 | train | Returns true if the current user has access to the given permission template. | [
30522,
13366,
6631,
1029,
1006,
6656,
1035,
23561,
1024,
1007,
1059,
2546,
1027,
2147,
12314,
1006,
6656,
1035,
23561,
1024,
6656,
1035,
23561,
1007,
2709,
6270,
4983,
1059,
2546,
1059,
2546,
1012,
4473,
1035,
3229,
1035,
3946,
1029,
2203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.sign | def sign(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
response = sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def sign(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
response = sign_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"sign",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"algorithm",
",",
"value",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"sign_async",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"algorithm",
",",... | Creates a signature from a digest using the specified key.
The SIGN operation is applicable to asymmetric and symmetric keys stored in
Azure Key Vault since this operation uses the private portion of the key.
This operation requires the keys/sign permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param key_name [String] The name of the key.
@param key_version [String] The version of the key.
@param algorithm [JsonWebKeySignatureAlgorithm] The signing/verification
algorithm identifier. For more information on possible algorithm types, see
JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384',
'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512',
'ECDSA256'
@param value
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [KeyOperationResult] operation results. | [
"Creates",
"a",
"signature",
"from",
"a",
"digest",
"using",
"the",
"specified",
"key",
"."
] | 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#L1633-L1636 | train | Sign a key using the specified key name and version. | [
30522,
13366,
3696,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
3145,
1035,
2544,
1010,
9896,
1010,
3643,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3696,
1035,
2004,
6038,
2278,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sinatra/sinatra | lib/sinatra/base.rb | Sinatra.Base.process_route | def process_route(pattern, conditions, block = nil, values = [])
route = @request.path_info
route = '/' if route.empty? and not settings.empty_path_info?
route = route[0..-2] if !settings.strict_paths? && route != '/' && route.end_with?('/')
return unless params = pattern.params(route)
params.delete("ignore") # TODO: better params handling, maybe turn it into "smart" object or detect changes
force_encoding(params)
original, @params = @params, @params.merge(params) if params.any?
regexp_exists = pattern.is_a?(Mustermann::Regular) || (pattern.respond_to?(:patterns) && pattern.patterns.any? {|subpattern| subpattern.is_a?(Mustermann::Regular)} )
if regexp_exists
captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
values += captures
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue
@env['sinatra.error.params'] = @params
raise
ensure
@params = original if original
end | ruby | def process_route(pattern, conditions, block = nil, values = [])
route = @request.path_info
route = '/' if route.empty? and not settings.empty_path_info?
route = route[0..-2] if !settings.strict_paths? && route != '/' && route.end_with?('/')
return unless params = pattern.params(route)
params.delete("ignore") # TODO: better params handling, maybe turn it into "smart" object or detect changes
force_encoding(params)
original, @params = @params, @params.merge(params) if params.any?
regexp_exists = pattern.is_a?(Mustermann::Regular) || (pattern.respond_to?(:patterns) && pattern.patterns.any? {|subpattern| subpattern.is_a?(Mustermann::Regular)} )
if regexp_exists
captures = pattern.match(route).captures.map { |c| URI_INSTANCE.unescape(c) if c }
values += captures
@params[:captures] = force_encoding(captures) unless captures.nil? || captures.empty?
else
values += params.values.flatten
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
rescue
@env['sinatra.error.params'] = @params
raise
ensure
@params = original if original
end | [
"def",
"process_route",
"(",
"pattern",
",",
"conditions",
",",
"block",
"=",
"nil",
",",
"values",
"=",
"[",
"]",
")",
"route",
"=",
"@request",
".",
"path_info",
"route",
"=",
"'/'",
"if",
"route",
".",
"empty?",
"and",
"not",
"settings",
".",
"empty... | If the current request matches pattern and conditions, fill params
with keys and call the given block.
Revert params afterwards.
Returns pass block. | [
"If",
"the",
"current",
"request",
"matches",
"pattern",
"and",
"conditions",
"fill",
"params",
"with",
"keys",
"and",
"call",
"the",
"given",
"block",
".",
"Revert",
"params",
"afterwards",
"."
] | 1aa64f9858edc3f93cc8d46e26f724c1ae103b1c | https://github.com/sinatra/sinatra/blob/1aa64f9858edc3f93cc8d46e26f724c1ae103b1c/lib/sinatra/base.rb#L1019-L1047 | train | Process the route | [
30522,
13366,
2832,
1035,
2799,
1006,
5418,
1010,
3785,
1010,
3796,
1027,
9152,
2140,
1010,
5300,
1027,
1031,
1033,
1007,
2799,
1027,
1030,
5227,
1012,
4130,
1035,
18558,
2799,
1027,
1005,
1013,
1005,
2065,
2799,
1012,
4064,
1029,
1998,
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... |
mhenrixon/sidekiq-unique-jobs | lib/sidekiq_unique_jobs/digests.rb | SidekiqUniqueJobs.Digests.all | def all(pattern: SCAN_PATTERN, count: DEFAULT_COUNT)
redis { |conn| conn.sscan_each(UNIQUE_SET, match: pattern, count: count).to_a }
end | ruby | def all(pattern: SCAN_PATTERN, count: DEFAULT_COUNT)
redis { |conn| conn.sscan_each(UNIQUE_SET, match: pattern, count: count).to_a }
end | [
"def",
"all",
"(",
"pattern",
":",
"SCAN_PATTERN",
",",
"count",
":",
"DEFAULT_COUNT",
")",
"redis",
"{",
"|",
"conn",
"|",
"conn",
".",
"sscan_each",
"(",
"UNIQUE_SET",
",",
"match",
":",
"pattern",
",",
"count",
":",
"count",
")",
".",
"to_a",
"}",
... | Return unique digests matching pattern
@param [String] pattern a pattern to match with
@param [Integer] count the maximum number to match
@return [Array<String>] with unique digests | [
"Return",
"unique",
"digests",
"matching",
"pattern"
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/digests.rb#L21-L23 | train | Returns all the unique elements in the set | [
30522,
13366,
2035,
1006,
5418,
1024,
13594,
1035,
5418,
1010,
4175,
1024,
12398,
1035,
4175,
1007,
2417,
2483,
1063,
1064,
9530,
2078,
1064,
9530,
2078,
1012,
7020,
9336,
1035,
2169,
1006,
4310,
1035,
2275,
1010,
2674,
1024,
5418,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/util/serialized_attributes.rb | Axlsx.SerializedAttributes.declared_attributes | def declared_attributes
instance_values.select do |key, value|
value != nil && self.class.xml_attributes.include?(key.to_sym)
end
end | ruby | def declared_attributes
instance_values.select do |key, value|
value != nil && self.class.xml_attributes.include?(key.to_sym)
end
end | [
"def",
"declared_attributes",
"instance_values",
".",
"select",
"do",
"|",
"key",
",",
"value",
"|",
"value",
"!=",
"nil",
"&&",
"self",
".",
"class",
".",
"xml_attributes",
".",
"include?",
"(",
"key",
".",
"to_sym",
")",
"end",
"end"
] | A hash of instance variables that have been declared with
seraialized_attributes and are not nil.
This requires ruby 1.9.3 or higher | [
"A",
"hash",
"of",
"instance",
"variables",
"that",
"have",
"been",
"declared",
"with",
"seraialized_attributes",
"and",
"are",
"not",
"nil",
".",
"This",
"requires",
"ruby",
"1",
".",
"9",
".",
"3",
"or",
"higher"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/util/serialized_attributes.rb#L63-L67 | train | Returns the array of the attributes that are declared in the XML document. | [
30522,
13366,
30524,
5300,
1012,
7276,
2079,
1064,
3145,
1010,
3643,
1064,
3643,
999,
1027,
9152,
2140,
1004,
1004,
2969,
1012,
2465,
1012,
20950,
1035,
12332,
1012,
2421,
1029,
1006,
3145,
1012,
2000,
1035,
25353,
2213,
1007,
2203,
2203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
strongself/Generamba | lib/generamba/helpers/module_validator.rb | Generamba.ModuleValidator.validate | def validate(code_module)
mandatory_fields = [COMPANY_KEY,
PROJECT_NAME_KEY,
XCODEPROJ_PATH_KEY]
mandatory_fields.each do |field|
unless code_module.instance_variable_get("@#{field}")
puts "Module is broken! *#{field}* field cannot be empty, because it is mandatory.".red
exit
end
end
project_failure_fields = all_project_failure_fields(code_module)
test_failure_fields = all_test_failure_fields(code_module)
failure_fields = project_failure_fields + test_failure_fields
if failure_fields.count > 0
puts "Module is broken! *#{failure_fields}* field cannot be empty, because it is mandatory.".red
exit
end
end | ruby | def validate(code_module)
mandatory_fields = [COMPANY_KEY,
PROJECT_NAME_KEY,
XCODEPROJ_PATH_KEY]
mandatory_fields.each do |field|
unless code_module.instance_variable_get("@#{field}")
puts "Module is broken! *#{field}* field cannot be empty, because it is mandatory.".red
exit
end
end
project_failure_fields = all_project_failure_fields(code_module)
test_failure_fields = all_test_failure_fields(code_module)
failure_fields = project_failure_fields + test_failure_fields
if failure_fields.count > 0
puts "Module is broken! *#{failure_fields}* field cannot be empty, because it is mandatory.".red
exit
end
end | [
"def",
"validate",
"(",
"code_module",
")",
"mandatory_fields",
"=",
"[",
"COMPANY_KEY",
",",
"PROJECT_NAME_KEY",
",",
"XCODEPROJ_PATH_KEY",
"]",
"mandatory_fields",
".",
"each",
"do",
"|",
"field",
"|",
"unless",
"code_module",
".",
"instance_variable_get",
"(",
... | Method validates module
@param code_module [CodeModule] The instance of CodeModule
@return [Void] | [
"Method",
"validates",
"module",
"@param",
"code_module",
"[",
"CodeModule",
"]",
"The",
"instance",
"of",
"CodeModule"
] | 9ef343805f3a66f58bc36e120e822d5436a4da97 | https://github.com/strongself/Generamba/blob/9ef343805f3a66f58bc36e120e822d5436a4da97/lib/generamba/helpers/module_validator.rb#L12-L32 | train | Validate the code module | [
30522,
13366,
9398,
3686,
1006,
3642,
1035,
11336,
1007,
10915,
1035,
4249,
1027,
1031,
2194,
1035,
3145,
1010,
2622,
1035,
2171,
1035,
3145,
1010,
1060,
16044,
21572,
3501,
1035,
4130,
1035,
3145,
1033,
10915,
1035,
4249,
1012,
2169,
2079,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jekyll/jekyll | lib/jekyll/frontmatter_defaults.rb | Jekyll.FrontmatterDefaults.matching_sets | def matching_sets(path, type)
@matched_set_cache ||= {}
@matched_set_cache[path] ||= {}
@matched_set_cache[path][type] ||= begin
valid_sets.select do |set|
!set.key?("scope") || applies?(set["scope"], path, type)
end
end
end | ruby | def matching_sets(path, type)
@matched_set_cache ||= {}
@matched_set_cache[path] ||= {}
@matched_set_cache[path][type] ||= begin
valid_sets.select do |set|
!set.key?("scope") || applies?(set["scope"], path, type)
end
end
end | [
"def",
"matching_sets",
"(",
"path",
",",
"type",
")",
"@matched_set_cache",
"||=",
"{",
"}",
"@matched_set_cache",
"[",
"path",
"]",
"||=",
"{",
"}",
"@matched_set_cache",
"[",
"path",
"]",
"[",
"type",
"]",
"||=",
"begin",
"valid_sets",
".",
"select",
"d... | rubocop: enable PredicateName
Collects a list of sets that match the given path and type
Returns an array of hashes | [
"rubocop",
":",
"enable",
"PredicateName",
"Collects",
"a",
"list",
"of",
"sets",
"that",
"match",
"the",
"given",
"path",
"and",
"type"
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/frontmatter_defaults.rb#L202-L210 | train | Returns the set matching the given path and type | [
30522,
13366,
9844,
1035,
4520,
1006,
4130,
1010,
2828,
1007,
1030,
10349,
1035,
2275,
1035,
17053,
1064,
1064,
1027,
1063,
1065,
1030,
10349,
1035,
2275,
1035,
17053,
1031,
30524,
1064,
999,
2275,
1012,
3145,
1029,
1006,
1000,
9531,
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... |
seejohnrun/ice_cube | lib/ice_cube/validated_rule.rb | IceCube.ValidatedRule.next_time | def next_time(time, start_time, closing_time)
@time = time
unless @start_time
@start_time = realign(time, start_time)
@time = @start_time if @time < @start_time
end
return nil unless find_acceptable_time_before(closing_time)
@uses += 1 if @time
@time
end | ruby | def next_time(time, start_time, closing_time)
@time = time
unless @start_time
@start_time = realign(time, start_time)
@time = @start_time if @time < @start_time
end
return nil unless find_acceptable_time_before(closing_time)
@uses += 1 if @time
@time
end | [
"def",
"next_time",
"(",
"time",
",",
"start_time",
",",
"closing_time",
")",
"@time",
"=",
"time",
"unless",
"@start_time",
"@start_time",
"=",
"realign",
"(",
"time",
",",
"start_time",
")",
"@time",
"=",
"@start_time",
"if",
"@time",
"<",
"@start_time",
"... | Compute the next time after (or including) the specified time in respect
to the given start time | [
"Compute",
"the",
"next",
"time",
"after",
"(",
"or",
"including",
")",
"the",
"specified",
"time",
"in",
"respect",
"to",
"the",
"given",
"start",
"time"
] | fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd | https://github.com/seejohnrun/ice_cube/blob/fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd/lib/ice_cube/validated_rule.rb#L49-L60 | train | Returns the next time in the sequence of time objects. | [
30522,
13366,
2279,
1035,
2051,
1006,
2051,
1010,
2707,
1035,
2051,
1010,
5494,
1035,
2051,
1007,
1030,
2051,
1027,
2051,
4983,
1030,
2707,
1035,
2051,
1030,
2707,
1035,
2051,
1027,
2613,
23773,
1006,
2051,
1010,
2707,
1035,
2051,
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... |
palkan/logidze | lib/logidze/history.rb | Logidze.History.current_ts? | def current_ts?(time)
(current_version.time <= time) &&
(next_version.nil? || (next_version.time < time))
end | ruby | def current_ts?(time)
(current_version.time <= time) &&
(next_version.nil? || (next_version.time < time))
end | [
"def",
"current_ts?",
"(",
"time",
")",
"(",
"current_version",
".",
"time",
"<=",
"time",
")",
"&&",
"(",
"next_version",
".",
"nil?",
"||",
"(",
"next_version",
".",
"time",
"<",
"time",
")",
")",
"end"
] | Return true iff time corresponds to current version | [
"Return",
"true",
"iff",
"time",
"corresponds",
"to",
"current",
"version"
] | ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8 | https://github.com/palkan/logidze/blob/ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8/lib/logidze/history.rb#L98-L101 | train | Returns true if the current version is at the given time. | [
30522,
13366,
2783,
1035,
24529,
1029,
1006,
2051,
1007,
1006,
2783,
1035,
2544,
1012,
2051,
1026,
1027,
2051,
1007,
1004,
1004,
1006,
2279,
1035,
2544,
1012,
9152,
2140,
1029,
1064,
1064,
1006,
2279,
1035,
2544,
1012,
2051,
1026,
2051,
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_resources/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb | Azure::Resources::Mgmt::V2016_02_01.Resources.check_existence_with_http_info | def check_existence_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
end | ruby | def check_existence_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
end | [
"def",
"check_existence_with_http_info",
"(",
"resource_group_name",
",",
"resource_provider_namespace",
",",
"parent_resource_path",
",",
"resource_type",
",",
"resource_name",
",",
"api_version",
",",
"custom_headers",
":",
"nil",
")",
"check_existence_async",
"(",
"resou... | Checks whether resource exists.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param resource_provider_namespace [String] Resource identity.
@param parent_resource_path [String] Resource identity.
@param resource_type [String] Resource identity.
@param resource_name [String] Resource identity.
@param api_version [String]
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Checks",
"whether",
"resource",
"exists",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb#L194-L196 | train | Checks if the resource exists in the resource group. | [
30522,
13366,
4638,
1035,
4598,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
10802,
1035,
3415,
15327,
1010,
6687,
1035,
7692,
1035,
4130,
1010,
7692,
1035,
2828,
1010,
7692,
1035,
2171,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/xml_mini/jdom.rb | ActiveSupport.XmlMini_JDOM.empty_content? | def empty_content?(element)
text = +""
child_nodes = element.child_nodes
(0...child_nodes.length).each do |i|
item = child_nodes.item(i)
if item.node_type == Node.TEXT_NODE
text << item.get_data.strip
end
end
text.strip.length == 0
end | ruby | def empty_content?(element)
text = +""
child_nodes = element.child_nodes
(0...child_nodes.length).each do |i|
item = child_nodes.item(i)
if item.node_type == Node.TEXT_NODE
text << item.get_data.strip
end
end
text.strip.length == 0
end | [
"def",
"empty_content?",
"(",
"element",
")",
"text",
"=",
"+",
"\"\"",
"child_nodes",
"=",
"element",
".",
"child_nodes",
"(",
"0",
"...",
"child_nodes",
".",
"length",
")",
".",
"each",
"do",
"|",
"i",
"|",
"item",
"=",
"child_nodes",
".",
"item",
"(... | Determines if a document element has text content
element::
XML element to be checked. | [
"Determines",
"if",
"a",
"document",
"element",
"has",
"text",
"content"
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/xml_mini/jdom.rb#L171-L181 | train | Returns true if the element has no content | [
30522,
13366,
4064,
1035,
4180,
1029,
1006,
5783,
1007,
3793,
1027,
1009,
1000,
1000,
2775,
1035,
14164,
1027,
5783,
1012,
2775,
1035,
14164,
30524,
1035,
13045,
3793,
1026,
1026,
8875,
1012,
2131,
1035,
2951,
1012,
6167,
2203,
2203,
3793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb | Azure::CDN::Mgmt::V2017_04_02.CustomDomains.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:nil)
begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:nil)
begin_delete_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"profile_name",
",",
"endpoint_name",
",",
"custom_domain_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"profile_name",
",",
"endpoint_name",
","... | Deletes an existing custom domain within an endpoint.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param profile_name [String] Name of the CDN profile which is unique within
the resource group.
@param endpoint_name [String] Name of the endpoint under the profile which is
unique globally.
@param custom_domain_name [String] Name of the custom domain within an
endpoint.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"an",
"existing",
"custom",
"domain",
"within",
"an",
"endpoint",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb#L777-L779 | train | Deletes a domain in an endpoint. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
30524,
8400,
1035,
2171,
1010,
7661,
1035,
5884,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/rake | lib/rake/file_task.rb | Rake.FileTask.timestamp | def timestamp
if File.exist?(name)
File.mtime(name.to_s)
else
Rake::LATE
end
end | ruby | def timestamp
if File.exist?(name)
File.mtime(name.to_s)
else
Rake::LATE
end
end | [
"def",
"timestamp",
"if",
"File",
".",
"exist?",
"(",
"name",
")",
"File",
".",
"mtime",
"(",
"name",
".",
"to_s",
")",
"else",
"Rake",
"::",
"LATE",
"end",
"end"
] | Time stamp for file task. | [
"Time",
"stamp",
"for",
"file",
"task",
"."
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/file_task.rb#L21-L27 | train | Returns the timestamp of the file. | [
30522,
13366,
2335,
15464,
2361,
2065,
5371,
1012,
4839,
1029,
1006,
2171,
1007,
5371,
1012,
11047,
14428,
1006,
2171,
1012,
2000,
1035,
1055,
1007,
2842,
26008,
1024,
1024,
2397,
2203,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.Draw.text_anchor | def text_anchor(anchor)
Kernel.raise ArgumentError, "Unknown anchor constant: #{anchor}" unless ANCHOR_TYPE_NAMES.key?(anchor.to_i)
primitive "text-anchor #{ANCHOR_TYPE_NAMES[anchor.to_i]}"
end | ruby | def text_anchor(anchor)
Kernel.raise ArgumentError, "Unknown anchor constant: #{anchor}" unless ANCHOR_TYPE_NAMES.key?(anchor.to_i)
primitive "text-anchor #{ANCHOR_TYPE_NAMES[anchor.to_i]}"
end | [
"def",
"text_anchor",
"(",
"anchor",
")",
"Kernel",
".",
"raise",
"ArgumentError",
",",
"\"Unknown anchor constant: #{anchor}\"",
"unless",
"ANCHOR_TYPE_NAMES",
".",
"key?",
"(",
"anchor",
".",
"to_i",
")",
"primitive",
"\"text-anchor #{ANCHOR_TYPE_NAMES[anchor.to_i]}\"",
... | SVG-compatible version of text_align | [
"SVG",
"-",
"compatible",
"version",
"of",
"text_align"
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L618-L621 | train | Returns the text - anchor for the given text. | [
30522,
13366,
3793,
1035,
8133,
1006,
8133,
1007,
16293,
1012,
5333,
6685,
2121,
29165,
1010,
1000,
4242,
8133,
5377,
1024,
1001,
1063,
8133,
1065,
1000,
4983,
8133,
1035,
2828,
1035,
3415,
1012,
3145,
1029,
1006,
8133,
1012,
2000,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/app/mailers/decidim/decidim_devise_mailer.rb | Decidim.DecidimDeviseMailer.invitation_instructions | def invitation_instructions(user, token, opts = {})
with_user(user) do
@token = token
@organization = user.organization
@opts = opts
opts[:subject] = I18n.t("devise.mailer.#{opts[:invitation_instructions]}.subject", organization: user.organization.name) if opts[:invitation_instructions]
end
devise_mail(user, opts[:invitation_instructions] || :invitation_instructions, opts)
end | ruby | def invitation_instructions(user, token, opts = {})
with_user(user) do
@token = token
@organization = user.organization
@opts = opts
opts[:subject] = I18n.t("devise.mailer.#{opts[:invitation_instructions]}.subject", organization: user.organization.name) if opts[:invitation_instructions]
end
devise_mail(user, opts[:invitation_instructions] || :invitation_instructions, opts)
end | [
"def",
"invitation_instructions",
"(",
"user",
",",
"token",
",",
"opts",
"=",
"{",
"}",
")",
"with_user",
"(",
"user",
")",
"do",
"@token",
"=",
"token",
"@organization",
"=",
"user",
".",
"organization",
"@opts",
"=",
"opts",
"opts",
"[",
":subject",
"... | Sends an email with the invitation instructions to a new user.
user - The User that has been invited.
token - The String to be sent as a token to verify the invitation.
opts - A Hash with options to send the email (optional). | [
"Sends",
"an",
"email",
"with",
"the",
"invitation",
"instructions",
"to",
"a",
"new",
"user",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/mailers/decidim/decidim_devise_mailer.rb#L16-L26 | train | invitation instructions | [
30522,
13366,
8468,
1035,
8128,
1006,
5310,
1010,
19204,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2007,
1035,
5310,
1006,
5310,
1007,
2079,
1030,
19204,
1027,
19204,
1030,
3029,
1027,
5310,
1012,
3029,
1030,
23569,
2015,
1027,
23569,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/resource.rb | Aws::AutoScaling.Resource.instances | def instances(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_auto_scaling_instances(options)
resp.each_page do |page|
batch = []
page.data.auto_scaling_instances.each do |a|
batch << Instance.new(
group_name: a.auto_scaling_group_name,
id: a.instance_id,
data: a,
client: @client
)
end
y.yield(batch)
end
end
Instance::Collection.new(batches)
end | ruby | def instances(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_auto_scaling_instances(options)
resp.each_page do |page|
batch = []
page.data.auto_scaling_instances.each do |a|
batch << Instance.new(
group_name: a.auto_scaling_group_name,
id: a.instance_id,
data: a,
client: @client
)
end
y.yield(batch)
end
end
Instance::Collection.new(batches)
end | [
"def",
"instances",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"resp",
"=",
"@client",
".",
"describe_auto_scaling_instances",
"(",
"options",
")",
"resp",
".",
"each_page",
"do",
"|",
"page",
"|",
... | @example Request syntax with placeholder values
instances = auto_scaling.instances({
instance_ids: ["XmlStringMaxLen19"],
})
@param [Hash] options ({})
@option options [Array<String>] :instance_ids
The IDs of the instances. You can specify up to `MaxRecords` IDs. If
you omit this parameter, all Auto Scaling instances are described. If
you specify an ID that does not exist, it is ignored with no error.
@return [Instance::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/resource.rb#L617-L634 | train | Returns an array of all the instances in the auto - scaling group. | [
30522,
13366,
12107,
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,
8285,
1035,
25169,
1035,
12107,
1006,
7047,
1007,
24501,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
getsentry/raven-ruby | lib/raven/integrations/sidekiq.rb | Raven.SidekiqErrorHandler.transaction_from_context | def transaction_from_context(context)
classname = (context["wrapped"] || context["class"] ||
(context[:job] && (context[:job]["wrapped"] || context[:job]["class"]))
)
if classname
"Sidekiq/#{classname}"
elsif context[:event]
"Sidekiq/#{context[:event]}"
else
"Sidekiq"
end
end | ruby | def transaction_from_context(context)
classname = (context["wrapped"] || context["class"] ||
(context[:job] && (context[:job]["wrapped"] || context[:job]["class"]))
)
if classname
"Sidekiq/#{classname}"
elsif context[:event]
"Sidekiq/#{context[:event]}"
else
"Sidekiq"
end
end | [
"def",
"transaction_from_context",
"(",
"context",
")",
"classname",
"=",
"(",
"context",
"[",
"\"wrapped\"",
"]",
"||",
"context",
"[",
"\"class\"",
"]",
"||",
"(",
"context",
"[",
":job",
"]",
"&&",
"(",
"context",
"[",
":job",
"]",
"[",
"\"wrapped\"",
... | this will change in the future:
https://github.com/mperham/sidekiq/pull/3161 | [
"this",
"will",
"change",
"in",
"the",
"future",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"mperham",
"/",
"sidekiq",
"/",
"pull",
"/",
"3161"
] | 729c22f9284939695f14822683bff1a0b72502bd | https://github.com/getsentry/raven-ruby/blob/729c22f9284939695f14822683bff1a0b72502bd/lib/raven/integrations/sidekiq.rb#L57-L68 | train | Returns the transaction ID from the given context | [
30522,
13366,
12598,
1035,
2013,
1035,
6123,
1006,
6123,
1007,
2465,
18442,
1027,
1006,
6123,
1031,
1000,
5058,
1000,
1033,
1064,
1064,
6123,
1031,
1000,
2465,
1000,
1033,
1064,
1064,
1006,
6123,
1031,
1024,
3105,
1033,
1004,
1004,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb | Azure::CognitiveServices::ContentModerator::V1_0.Reviews.add_video_transcript | def add_video_transcript(team_name, review_id, vttfile, custom_headers:nil)
response = add_video_transcript_async(team_name, review_id, vttfile, custom_headers:custom_headers).value!
nil
end | ruby | def add_video_transcript(team_name, review_id, vttfile, custom_headers:nil)
response = add_video_transcript_async(team_name, review_id, vttfile, custom_headers:custom_headers).value!
nil
end | [
"def",
"add_video_transcript",
"(",
"team_name",
",",
"review_id",
",",
"vttfile",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"add_video_transcript_async",
"(",
"team_name",
",",
"review_id",
",",
"vttfile",
",",
"custom_headers",
":custom_headers",
")... | This API adds a transcript file (text version of all the words spoken in a
video) to a video review. The file should be a valid WebVTT format.
@param team_name [String] Your team name.
@param review_id [String] Id of the review.
@param vttfile Transcript file of the video.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"This",
"API",
"adds",
"a",
"transcript",
"file",
"(",
"text",
"version",
"of",
"all",
"the",
"words",
"spoken",
"in",
"a",
"video",
")",
"to",
"a",
"video",
"review",
".",
"The",
"file",
"should",
"be",
"a",
"valid",
"WebVTT",
"format",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb#L1263-L1266 | train | Adds a video transcript to a review. | [
30522,
13366,
5587,
1035,
2678,
1035,
24051,
1006,
2136,
1035,
2171,
1010,
3319,
1035,
8909,
1010,
28879,
24475,
9463,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
5587,
1035,
2678,
1035,
24051,
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... |
mongodb/mongo-ruby-driver | lib/mongo/database.rb | Mongo.Database.watch | def watch(pipeline = [], options = {})
Mongo::Collection::View::ChangeStream.new(
Mongo::Collection::View.new(collection("#{COMMAND}.aggregate")),
pipeline,
Mongo::Collection::View::ChangeStream::DATABASE,
options)
end | ruby | def watch(pipeline = [], options = {})
Mongo::Collection::View::ChangeStream.new(
Mongo::Collection::View.new(collection("#{COMMAND}.aggregate")),
pipeline,
Mongo::Collection::View::ChangeStream::DATABASE,
options)
end | [
"def",
"watch",
"(",
"pipeline",
"=",
"[",
"]",
",",
"options",
"=",
"{",
"}",
")",
"Mongo",
"::",
"Collection",
"::",
"View",
"::",
"ChangeStream",
".",
"new",
"(",
"Mongo",
"::",
"Collection",
"::",
"View",
".",
"new",
"(",
"collection",
"(",
"\"#{... | As of version 3.6 of the MongoDB server, a ``$changeStream`` pipeline stage is supported
in the aggregation framework. As of version 4.0, this stage allows users to request that
notifications are sent for all changes that occur in the client's database.
@example Get change notifications for a given database..
database.watch([{ '$match' => { operationType: { '$in' => ['insert', 'replace'] } } }])
@param [ Array<Hash> ] pipeline Optional additional filter operators.
@param [ Hash ] options The change stream options.
@option options [ String ] :full_document Allowed values: 'default', 'updateLookup'.
Defaults to 'default'. When set to 'updateLookup', the change notification for partial
updates will include both a delta describing the changes to the document, as well as a copy
of the entire document that was changed from some time after the change occurred.
@option options [ BSON::Document, Hash ] :resume_after Specifies the logical starting point
for the new change stream.
@option options [ Integer ] :max_await_time_ms The maximum amount of time for the server to
wait on new documents to satisfy a change stream query.
@option options [ Integer ] :batch_size The number of documents to return per batch.
@option options [ BSON::Document, Hash ] :collation The collation to use.
@option options [ Session ] :session The session to use.
@option options [ BSON::Timestamp ] :start_at_operation_time Only return
changes that occurred after the specified timestamp. Any command run
against the server will return a cluster time that can be used here.
Only recognized by server versions 4.0+.
@note A change stream only allows 'majority' read concern.
@note This helper method is preferable to running a raw aggregation with a $changeStream
stage, for the purpose of supporting resumability.
@return [ ChangeStream ] The change stream object.
@since 2.6.0 | [
"As",
"of",
"version",
"3",
".",
"6",
"of",
"the",
"MongoDB",
"server",
"a",
"$changeStream",
"pipeline",
"stage",
"is",
"supported",
"in",
"the",
"aggregation",
"framework",
".",
"As",
"of",
"version",
"4",
".",
"0",
"this",
"stage",
"allows",
"users",
... | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/database.rb#L292-L298 | train | Create a new watch | [
30522,
13366,
3422,
1006,
13117,
1027,
1031,
1033,
1010,
7047,
1027,
1063,
1065,
1007,
12256,
3995,
1024,
1024,
3074,
1024,
1024,
3193,
1024,
1024,
3431,
25379,
1012,
2047,
1006,
12256,
3995,
1024,
1024,
3074,
1024,
1024,
3193,
1012,
2047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmosolgo/graphql-ruby | lib/graphql/schema.rb | GraphQL.Schema.rescue_middleware | def rescue_middleware
@rescue_middleware ||= GraphQL::Schema::RescueMiddleware.new.tap { |m| middleware.insert(0, m) }
end | ruby | def rescue_middleware
@rescue_middleware ||= GraphQL::Schema::RescueMiddleware.new.tap { |m| middleware.insert(0, m) }
end | [
"def",
"rescue_middleware",
"@rescue_middleware",
"||=",
"GraphQL",
"::",
"Schema",
"::",
"RescueMiddleware",
".",
"new",
".",
"tap",
"{",
"|",
"m",
"|",
"middleware",
".",
"insert",
"(",
"0",
",",
"m",
")",
"}",
"end"
] | Lazily create a middleware and add it to the schema
(Don't add it if it's not used) | [
"Lazily",
"create",
"a",
"middleware",
"and",
"add",
"it",
"to",
"the",
"schema",
"(",
"Don",
"t",
"add",
"it",
"if",
"it",
"s",
"not",
"used",
")"
] | d5be13a816f220b9efbabeaa69a3e56fedf311f5 | https://github.com/rmosolgo/graphql-ruby/blob/d5be13a816f220b9efbabeaa69a3e56fedf311f5/lib/graphql/schema.rb#L1173-L1175 | train | Returns the middleware to use for the rescue middleware. | [
30522,
13366,
5343,
1035,
2690,
8059,
1030,
5343,
1035,
2690,
8059,
1064,
1064,
1027,
10629,
4160,
2140,
1024,
1024,
8040,
28433,
1024,
1024,
5343,
4328,
20338,
8059,
1012,
2047,
1012,
11112,
1063,
1064,
1049,
1064,
2690,
8059,
1012,
19274,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lynndylanhurley/devise_token_auth | app/controllers/devise_token_auth/omniauth_callbacks_controller.rb | DeviseTokenAuth.OmniauthCallbacksController.whitelisted_params | def whitelisted_params
whitelist = params_for_resource(:sign_up)
whitelist.inject({}) do |coll, key|
param = omniauth_params[key.to_s]
coll[key] = param if param
coll
end
end | ruby | def whitelisted_params
whitelist = params_for_resource(:sign_up)
whitelist.inject({}) do |coll, key|
param = omniauth_params[key.to_s]
coll[key] = param if param
coll
end
end | [
"def",
"whitelisted_params",
"whitelist",
"=",
"params_for_resource",
"(",
":sign_up",
")",
"whitelist",
".",
"inject",
"(",
"{",
"}",
")",
"do",
"|",
"coll",
",",
"key",
"|",
"param",
"=",
"omniauth_params",
"[",
"key",
".",
"to_s",
"]",
"coll",
"[",
"k... | derive allowed params from the standard devise parameter sanitizer | [
"derive",
"allowed",
"params",
"from",
"the",
"standard",
"devise",
"parameter",
"sanitizer"
] | 0727ac77e5d1cf8c065faa81ca6ddbba9cc0fe44 | https://github.com/lynndylanhurley/devise_token_auth/blob/0727ac77e5d1cf8c065faa81ca6ddbba9cc0fe44/app/controllers/devise_token_auth/omniauth_callbacks_controller.rb#L112-L120 | train | Returns a hash of the params for the request | [
30522,
13366,
2317,
9863,
2098,
1035,
11498,
5244,
2317,
9863,
1027,
11498,
5244,
1035,
2005,
1035,
7692,
1006,
1024,
3696,
1035,
2039,
1007,
2317,
9863,
1012,
1999,
20614,
1006,
1063,
1065,
1007,
2079,
1064,
8902,
2140,
1010,
3145,
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 | runtime/ms_rest_azure/lib/ms_rest_azure/polling_state.rb | MsRestAzure.PollingState.get_provisioning_state | def get_provisioning_state
# On non flattened resource, we should find provisioning_state inside 'properties'
if (!@resource.nil? && @resource.respond_to?(:properties) && @resource.properties.respond_to?(:provisioning_state) && !@resource.properties.provisioning_state.nil?)
@resource.properties.provisioning_state
# On flattened resource, we should find provisioning_state at the top level
elsif !@resource.nil? && @resource.respond_to?(:provisioning_state) && !@resource.provisioning_state.nil?
@resource.provisioning_state
else
nil
end
end | ruby | def get_provisioning_state
# On non flattened resource, we should find provisioning_state inside 'properties'
if (!@resource.nil? && @resource.respond_to?(:properties) && @resource.properties.respond_to?(:provisioning_state) && !@resource.properties.provisioning_state.nil?)
@resource.properties.provisioning_state
# On flattened resource, we should find provisioning_state at the top level
elsif !@resource.nil? && @resource.respond_to?(:provisioning_state) && !@resource.provisioning_state.nil?
@resource.provisioning_state
else
nil
end
end | [
"def",
"get_provisioning_state",
"# On non flattened resource, we should find provisioning_state inside 'properties'",
"if",
"(",
"!",
"@resource",
".",
"nil?",
"&&",
"@resource",
".",
"respond_to?",
"(",
":properties",
")",
"&&",
"@resource",
".",
"properties",
".",
"respo... | Returns the provisioning status of the resource
@return [String] provisioning status of the resource | [
"Returns",
"the",
"provisioning",
"status",
"of",
"the",
"resource"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/runtime/ms_rest_azure/lib/ms_rest_azure/polling_state.rb#L58-L68 | train | Returns the ID of the provisioning state in the current resource. | [
30522,
13366,
2131,
1035,
9347,
2075,
1035,
2110,
1001,
2006,
2512,
16379,
7692,
1010,
2057,
2323,
2424,
9347,
2075,
1035,
2110,
2503,
1005,
5144,
1005,
2065,
1006,
999,
1030,
7692,
1012,
9152,
2140,
1029,
1004,
1004,
1030,
7692,
1012,
68... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.Image.get_exif_by_number | def get_exif_by_number(*tag)
hash = {}
if tag.length.zero?
exif_data = self['EXIF:!']
if exif_data
exif_data.split("\n").each do |exif|
tag, value = exif.split('=')
tag = tag[1, 4].hex
hash[tag] = value
end
end
else
get_exif_by_number # ensure properties is populated with exif data
tag.each do |num|
rval = self[format('#%04X', num.to_i)]
hash[num] = rval == 'unknown' ? nil : rval
end
end
hash
end | ruby | def get_exif_by_number(*tag)
hash = {}
if tag.length.zero?
exif_data = self['EXIF:!']
if exif_data
exif_data.split("\n").each do |exif|
tag, value = exif.split('=')
tag = tag[1, 4].hex
hash[tag] = value
end
end
else
get_exif_by_number # ensure properties is populated with exif data
tag.each do |num|
rval = self[format('#%04X', num.to_i)]
hash[num] = rval == 'unknown' ? nil : rval
end
end
hash
end | [
"def",
"get_exif_by_number",
"(",
"*",
"tag",
")",
"hash",
"=",
"{",
"}",
"if",
"tag",
".",
"length",
".",
"zero?",
"exif_data",
"=",
"self",
"[",
"'EXIF:!'",
"]",
"if",
"exif_data",
"exif_data",
".",
"split",
"(",
"\"\\n\"",
")",
".",
"each",
"do",
... | Retrieve EXIF data by tag number or all tag/value pairs. The return value is a hash. | [
"Retrieve",
"EXIF",
"data",
"by",
"tag",
"number",
"or",
"all",
"tag",
"/",
"value",
"pairs",
".",
"The",
"return",
"value",
"is",
"a",
"hash",
"."
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L831-L850 | train | Get the exif data for a given tag | [
30522,
13366,
2131,
1035,
4654,
10128,
1035,
2011,
1035,
2193,
1006,
1008,
6415,
1007,
23325,
1027,
1063,
1065,
2065,
6415,
1012,
3091,
1012,
5717,
1029,
4654,
10128,
1035,
2951,
1027,
2969,
1031,
1005,
4654,
10128,
1024,
999,
1005,
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/2018-07-01/generated/azure_mgmt_network/routes.rb | Azure::Network::Mgmt::V2018_07_01.Routes.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, route_table_name, route_name, route_parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, route_table_name, route_name, route_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, route_table_name, route_name, route_parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, route_table_name, route_name, route_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"route_table_name",
",",
"route_name",
",",
"route_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"route_table_name",
",",
... | Creates or updates a route in the specified route table.
@param resource_group_name [String] The name of the resource group.
@param route_table_name [String] The name of the route table.
@param route_name [String] The name of the route.
@param route_parameters [Route] Parameters supplied to the create or update
route 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",
"route",
"in",
"the",
"specified",
"route",
"table",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/routes.rb#L416-L418 | train | Creates or updates a route in the specified route table. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2799,
1035,
2795,
1035,
2171,
1010,
2799,
1035,
2171,
1010,
2799,
1035,
11709,
1010,
7661,
1035,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
httprb/http | lib/http/client.rb | HTTP.Client.perform | def perform(req, options)
verify_connection!(req.uri)
@state = :dirty
@connection ||= HTTP::Connection.new(req, options)
unless @connection.failed_proxy_connect?
@connection.send_request(req)
@connection.read_headers!
end
res = Response.new(
:status => @connection.status_code,
:version => @connection.http_version,
:headers => @connection.headers,
:proxy_headers => @connection.proxy_response_headers,
:connection => @connection,
:encoding => options.encoding,
:uri => req.uri
)
res = options.features.inject(res) do |response, (_name, feature)|
feature.wrap_response(response)
end
@connection.finish_response if req.verb == :head
@state = :clean
res
rescue
close
raise
end | ruby | def perform(req, options)
verify_connection!(req.uri)
@state = :dirty
@connection ||= HTTP::Connection.new(req, options)
unless @connection.failed_proxy_connect?
@connection.send_request(req)
@connection.read_headers!
end
res = Response.new(
:status => @connection.status_code,
:version => @connection.http_version,
:headers => @connection.headers,
:proxy_headers => @connection.proxy_response_headers,
:connection => @connection,
:encoding => options.encoding,
:uri => req.uri
)
res = options.features.inject(res) do |response, (_name, feature)|
feature.wrap_response(response)
end
@connection.finish_response if req.verb == :head
@state = :clean
res
rescue
close
raise
end | [
"def",
"perform",
"(",
"req",
",",
"options",
")",
"verify_connection!",
"(",
"req",
".",
"uri",
")",
"@state",
"=",
":dirty",
"@connection",
"||=",
"HTTP",
"::",
"Connection",
".",
"new",
"(",
"req",
",",
"options",
")",
"unless",
"@connection",
".",
"f... | Perform a single (no follow) HTTP request | [
"Perform",
"a",
"single",
"(",
"no",
"follow",
")",
"HTTP",
"request"
] | f37a10ea4fab3ee411907ea2e4251ddf0ca33a93 | https://github.com/httprb/http/blob/f37a10ea4fab3ee411907ea2e4251ddf0ca33a93/lib/http/client.rb#L66-L99 | train | Perform a request | [
30522,
13366,
4685,
1006,
2128,
4160,
1010,
7047,
1007,
20410,
1035,
4434,
999,
1006,
2128,
4160,
1012,
24471,
2072,
1007,
1030,
2110,
1027,
1024,
6530,
1030,
4434,
1064,
1064,
1027,
8299,
1024,
1024,
4434,
1012,
2047,
1006,
2128,
4160,
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... |
rails/sprockets | lib/sprockets/encoding_utils.rb | Sprockets.EncodingUtils.charlock_detect | def charlock_detect(str)
if defined? CharlockHolmes::EncodingDetector
if detected = CharlockHolmes::EncodingDetector.detect(str)
str.force_encoding(detected[:encoding]) if detected[:encoding]
end
end
str
end | ruby | def charlock_detect(str)
if defined? CharlockHolmes::EncodingDetector
if detected = CharlockHolmes::EncodingDetector.detect(str)
str.force_encoding(detected[:encoding]) if detected[:encoding]
end
end
str
end | [
"def",
"charlock_detect",
"(",
"str",
")",
"if",
"defined?",
"CharlockHolmes",
"::",
"EncodingDetector",
"if",
"detected",
"=",
"CharlockHolmes",
"::",
"EncodingDetector",
".",
"detect",
"(",
"str",
")",
"str",
".",
"force_encoding",
"(",
"detected",
"[",
":enco... | Internal: Use Charlock Holmes to detect encoding.
To enable this code path, require 'charlock_holmes'
Returns encoded String. | [
"Internal",
":",
"Use",
"Charlock",
"Holmes",
"to",
"detect",
"encoding",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/encoding_utils.rb#L122-L130 | train | detects the encoding of a string | [
30522,
13366,
25869,
7878,
1035,
11487,
1006,
2358,
2099,
1007,
2065,
4225,
1029,
25869,
7878,
18884,
2229,
1024,
1024,
17181,
3207,
26557,
4263,
2065,
11156,
1027,
25869,
7878,
18884,
2229,
1024,
1024,
17181,
3207,
30524,
2358,
2099,
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... |
sunspot/sunspot | sunspot/lib/sunspot/setup.rb | Sunspot.Setup.add_document_boost | def add_document_boost(attr_name, &block)
@document_boost_extractor =
if attr_name
if attr_name.respond_to?(:to_f)
DataExtractor::Constant.new(attr_name)
else
DataExtractor::AttributeExtractor.new(attr_name)
end
else
DataExtractor::BlockExtractor.new(&block)
end
end | ruby | def add_document_boost(attr_name, &block)
@document_boost_extractor =
if attr_name
if attr_name.respond_to?(:to_f)
DataExtractor::Constant.new(attr_name)
else
DataExtractor::AttributeExtractor.new(attr_name)
end
else
DataExtractor::BlockExtractor.new(&block)
end
end | [
"def",
"add_document_boost",
"(",
"attr_name",
",",
"&",
"block",
")",
"@document_boost_extractor",
"=",
"if",
"attr_name",
"if",
"attr_name",
".",
"respond_to?",
"(",
":to_f",
")",
"DataExtractor",
"::",
"Constant",
".",
"new",
"(",
"attr_name",
")",
"else",
... | Add a document boost to documents at index time. Document boost can be
static (the same for all documents of this class), or extracted on a per-
document basis using either attribute or block extraction as per usual. | [
"Add",
"a",
"document",
"boost",
"to",
"documents",
"at",
"index",
"time",
".",
"Document",
"boost",
"can",
"be",
"static",
"(",
"the",
"same",
"for",
"all",
"documents",
"of",
"this",
"class",
")",
"or",
"extracted",
"on",
"a",
"per",
"-",
"document",
... | 31dd76cd7a14a4ef7bd541de97483d8cd72ff685 | https://github.com/sunspot/sunspot/blob/31dd76cd7a14a4ef7bd541de97483d8cd72ff685/sunspot/lib/sunspot/setup.rb#L97-L108 | train | Add a document boost extractor to the document. | [
30522,
13366,
5587,
1035,
6254,
1035,
12992,
1006,
2012,
16344,
1035,
2171,
1010,
1004,
3796,
1007,
1030,
6254,
1035,
12992,
1035,
14817,
2953,
1027,
2065,
2012,
16344,
1035,
2171,
2065,
2012,
16344,
1035,
2171,
1012,
6869,
1035,
2000,
1029... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ankane/groupdate | lib/groupdate/relation_builder.rb | Groupdate.RelationBuilder.resolve_column | def resolve_column(relation, column)
node = relation.send(:relation).send(:arel_columns, [column]).first
node = Arel::Nodes::SqlLiteral.new(node) if node.is_a?(String)
relation.connection.visitor.accept(node, Arel::Collectors::SQLString.new).value
end | ruby | def resolve_column(relation, column)
node = relation.send(:relation).send(:arel_columns, [column]).first
node = Arel::Nodes::SqlLiteral.new(node) if node.is_a?(String)
relation.connection.visitor.accept(node, Arel::Collectors::SQLString.new).value
end | [
"def",
"resolve_column",
"(",
"relation",
",",
"column",
")",
"node",
"=",
"relation",
".",
"send",
"(",
":relation",
")",
".",
"send",
"(",
":arel_columns",
",",
"[",
"column",
"]",
")",
".",
"first",
"node",
"=",
"Arel",
"::",
"Nodes",
"::",
"SqlLite... | resolves eagerly
need to convert both where_clause (easy)
and group_clause (not easy) if want to avoid this | [
"resolves",
"eagerly",
"need",
"to",
"convert",
"both",
"where_clause",
"(",
"easy",
")",
"and",
"group_clause",
"(",
"not",
"easy",
")",
"if",
"want",
"to",
"avoid",
"this"
] | f9c824a9b7df479f64facd293e50bd47efb7c499 | https://github.com/ankane/groupdate/blob/f9c824a9b7df479f64facd293e50bd47efb7c499/lib/groupdate/relation_builder.rb#L180-L184 | train | Resolve column | [
30522,
13366,
10663,
1035,
5930,
1006,
7189,
1010,
5930,
1007,
13045,
1027,
7189,
1012,
4604,
1006,
1024,
7189,
1007,
1012,
4604,
1006,
1024,
2024,
2140,
1035,
7753,
1010,
1031,
5930,
1033,
1007,
1012,
2034,
13045,
1027,
2024,
2140,
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... |
hanami/hanami | lib/hanami/common_logger.rb | Hanami.CommonLogger.extract_params | def extract_params(env)
result = env.fetch(QUERY_HASH, {})
result.merge!(env.fetch(FORM_HASH, {}))
result.merge!(Utils::Hash.deep_stringify(env.fetch(ROUTER_PARAMS, {})))
result
end | ruby | def extract_params(env)
result = env.fetch(QUERY_HASH, {})
result.merge!(env.fetch(FORM_HASH, {}))
result.merge!(Utils::Hash.deep_stringify(env.fetch(ROUTER_PARAMS, {})))
result
end | [
"def",
"extract_params",
"(",
"env",
")",
"result",
"=",
"env",
".",
"fetch",
"(",
"QUERY_HASH",
",",
"{",
"}",
")",
"result",
".",
"merge!",
"(",
"env",
".",
"fetch",
"(",
"FORM_HASH",
",",
"{",
"}",
")",
")",
"result",
".",
"merge!",
"(",
"Utils"... | rubocop:enable Metrics/MethodLength
rubocop:enable Metrics/AbcSize
@since 1.1.0
@api private | [
"rubocop",
":",
"enable",
"Metrics",
"/",
"MethodLength",
"rubocop",
":",
"enable",
"Metrics",
"/",
"AbcSize"
] | 8c6e5147e92ef869b25379448572da3698eacfdc | https://github.com/hanami/hanami/blob/8c6e5147e92ef869b25379448572da3698eacfdc/lib/hanami/common_logger.rb#L86-L91 | train | Extract params from the env | [
30522,
13366,
14817,
1035,
11498,
5244,
1006,
4372,
2615,
1007,
2765,
1027,
4372,
2615,
1012,
18584,
1006,
23032,
1035,
23325,
1010,
1063,
1065,
1007,
2765,
1012,
13590,
999,
1006,
4372,
2615,
1012,
18584,
1006,
2433,
1035,
23325,
1010,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/role.rb | Aws::IAM.Role.policies | def policies(options = {})
batches = Enumerator.new do |y|
options = options.merge(role_name: @name)
resp = @client.list_role_policies(options)
resp.each_page do |page|
batch = []
page.data.policy_names.each do |p|
batch << RolePolicy.new(
role_name: @name,
name: p,
client: @client
)
end
y.yield(batch)
end
end
RolePolicy::Collection.new(batches)
end | ruby | def policies(options = {})
batches = Enumerator.new do |y|
options = options.merge(role_name: @name)
resp = @client.list_role_policies(options)
resp.each_page do |page|
batch = []
page.data.policy_names.each do |p|
batch << RolePolicy.new(
role_name: @name,
name: p,
client: @client
)
end
y.yield(batch)
end
end
RolePolicy::Collection.new(batches)
end | [
"def",
"policies",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"options",
"=",
"options",
".",
"merge",
"(",
"role_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"list_role_policies",
"(",
... | @example Request syntax with placeholder values
role.policies()
@param [Hash] options ({})
@return [RolePolicy::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/role.rb#L393-L410 | train | Get all policies for this role | [
30522,
13366,
6043,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
7047,
1027,
7047,
1012,
13590,
1006,
2535,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/core_ext/range/include_time_with_zone.rb | ActiveSupport.IncludeTimeWithZone.include? | def include?(value)
if first.is_a?(TimeWithZone)
cover?(value)
elsif last.is_a?(TimeWithZone)
cover?(value)
else
super
end
end | ruby | def include?(value)
if first.is_a?(TimeWithZone)
cover?(value)
elsif last.is_a?(TimeWithZone)
cover?(value)
else
super
end
end | [
"def",
"include?",
"(",
"value",
")",
"if",
"first",
".",
"is_a?",
"(",
"TimeWithZone",
")",
"cover?",
"(",
"value",
")",
"elsif",
"last",
".",
"is_a?",
"(",
"TimeWithZone",
")",
"cover?",
"(",
"value",
")",
"else",
"super",
"end",
"end"
] | :nodoc:
Extends the default Range#include? to support ActiveSupport::TimeWithZone.
(1.hour.ago..1.hour.from_now).include?(Time.current) # => true | [
":",
"nodoc",
":",
"Extends",
"the",
"default",
"Range#include?",
"to",
"support",
"ActiveSupport",
"::",
"TimeWithZone",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/core_ext/range/include_time_with_zone.rb#L11-L19 | train | Returns true if the time range contains the value. | [
30522,
13366,
2421,
1029,
1006,
3643,
1007,
2065,
2034,
1012,
2003,
1035,
1037,
1029,
1006,
2051,
24415,
15975,
1007,
3104,
1029,
1006,
3643,
1007,
3449,
5332,
2546,
2197,
1012,
2003,
1035,
1037,
1029,
1006,
2051,
24415,
15975,
1007,
3104,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.vault_shipping_address | def vault_shipping_address
return nil if shipping_details.id.nil?
@gateway.address.find(customer_details.id, shipping_details.id)
end | ruby | def vault_shipping_address
return nil if shipping_details.id.nil?
@gateway.address.find(customer_details.id, shipping_details.id)
end | [
"def",
"vault_shipping_address",
"return",
"nil",
"if",
"shipping_details",
".",
"id",
".",
"nil?",
"@gateway",
".",
"address",
".",
"find",
"(",
"customer_details",
".",
"id",
",",
"shipping_details",
".",
"id",
")",
"end"
] | If this transaction was stored in the vault, or created from vault records,
vault_shipping_address will return the associated Braintree::Address. Because the
vault shipping address can be updated after the transaction was created, the attributes
on vault_shipping_address may not match the attributes on shipping_details. | [
"If",
"this",
"transaction",
"was",
"stored",
"in",
"the",
"vault",
"or",
"created",
"from",
"vault",
"records",
"vault_shipping_address",
"will",
"return",
"the",
"associated",
"Braintree",
"::",
"Address",
".",
"Because",
"the",
"vault",
"shipping",
"address",
... | 6e56c7099ea55bcdc4073cbea60b2688cef69663 | https://github.com/braintree/braintree_ruby/blob/6e56c7099ea55bcdc4073cbea60b2688cef69663/lib/braintree/transaction.rb#L399-L402 | train | Returns the index of the address that is associated with the shipping details. | [
30522,
13366,
11632,
1035,
7829,
1035,
4769,
2709,
9152,
2140,
2065,
7829,
1035,
4751,
1012,
8909,
1012,
9152,
2140,
1029,
1030,
11909,
1012,
4769,
1012,
2424,
1006,
8013,
1035,
4751,
1012,
8909,
1010,
7829,
1035,
4751,
1012,
8909,
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... |
randym/axlsx | lib/axlsx/util/storage.rb | Axlsx.Storage.data= | def data=(v)
Axlsx::validate_string(v)
self.type = TYPES[:stream] unless @type
@size = v.size
@data = v.bytes.to_a
end | ruby | def data=(v)
Axlsx::validate_string(v)
self.type = TYPES[:stream] unless @type
@size = v.size
@data = v.bytes.to_a
end | [
"def",
"data",
"=",
"(",
"v",
")",
"Axlsx",
"::",
"validate_string",
"(",
"v",
")",
"self",
".",
"type",
"=",
"TYPES",
"[",
":stream",
"]",
"unless",
"@type",
"@size",
"=",
"v",
".",
"size",
"@data",
"=",
"v",
".",
"bytes",
".",
"to_a",
"end"
] | Set the data associated with the stream. If the stream type is undefined, we automatically specify the storage as a stream type. # with the exception of storages that are type root, all storages with data should be type stream.
@param [String] v The data for this storages stream
@return [Array] | [
"Set",
"the",
"data",
"associated",
"with",
"the",
"stream",
".",
"If",
"the",
"stream",
"type",
"is",
"undefined",
"we",
"automatically",
"specify",
"the",
"storage",
"as",
"a",
"stream",
"type",
".",
"#",
"with",
"the",
"exception",
"of",
"storages",
"th... | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/util/storage.rb#L79-L84 | train | Set the data of the file. | [
30522,
13366,
2951,
1027,
1006,
1058,
1007,
22260,
4877,
2595,
1024,
1024,
9398,
3686,
1035,
5164,
1006,
1058,
1007,
2969,
1012,
2828,
1027,
4127,
1031,
1024,
5460,
1033,
4983,
1030,
2828,
1030,
2946,
1027,
30524,
2951,
1027,
1058,
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... |
alexreisner/geocoder | lib/geocoder/calculations.rb | Geocoder.Calculations.bounding_box | def bounding_box(point, radius, options = {})
lat,lon = extract_coordinates(point)
radius = radius.to_f
[
lat - (radius / latitude_degree_distance(options[:units])),
lon - (radius / longitude_degree_distance(lat, options[:units])),
lat + (radius / latitude_degree_distance(options[:units])),
lon + (radius / longitude_degree_distance(lat, options[:units]))
]
end | ruby | def bounding_box(point, radius, options = {})
lat,lon = extract_coordinates(point)
radius = radius.to_f
[
lat - (radius / latitude_degree_distance(options[:units])),
lon - (radius / longitude_degree_distance(lat, options[:units])),
lat + (radius / latitude_degree_distance(options[:units])),
lon + (radius / longitude_degree_distance(lat, options[:units]))
]
end | [
"def",
"bounding_box",
"(",
"point",
",",
"radius",
",",
"options",
"=",
"{",
"}",
")",
"lat",
",",
"lon",
"=",
"extract_coordinates",
"(",
"point",
")",
"radius",
"=",
"radius",
".",
"to_f",
"[",
"lat",
"-",
"(",
"radius",
"/",
"latitude_degree_distance... | Returns coordinates of the southwest and northeast corners of a box
with the given point at its center. The radius is the shortest distance
from the center point to any side of the box (the length of each side
is twice the radius).
This is useful for finding corner points of a map viewport, or for
roughly limiting the possible solutions in a geo-spatial search
(ActiveRecord queries use it thusly).
See Geocoder::Calculations.distance_between for
ways of specifying the point. Also accepts an options hash:
* <tt>:units</tt> - <tt>:mi</tt> or <tt>:km</tt>.
Use Geocoder.configure(:units => ...) to configure default units. | [
"Returns",
"coordinates",
"of",
"the",
"southwest",
"and",
"northeast",
"corners",
"of",
"a",
"box",
"with",
"the",
"given",
"point",
"at",
"its",
"center",
".",
"The",
"radius",
"is",
"the",
"shortest",
"distance",
"from",
"the",
"center",
"point",
"to",
... | e087dc2759264ee6f307b926bb2de4ec2406859e | https://github.com/alexreisner/geocoder/blob/e087dc2759264ee6f307b926bb2de4ec2406859e/lib/geocoder/calculations.rb#L210-L219 | train | Returns bounding box of a point | [
30522,
13366,
5391,
2075,
1035,
3482,
1006,
2391,
1010,
12177,
1010,
7047,
1027,
1063,
1065,
1007,
2474,
2102,
1010,
8840,
2078,
1027,
14817,
1035,
12093,
1006,
2391,
1007,
12177,
1027,
12177,
1012,
2000,
1035,
1042,
1031,
2474,
2102,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jnunemaker/httparty | lib/httparty.rb | HTTParty.ClassMethods.connection_adapter | def connection_adapter(custom_adapter = nil, options = nil)
if custom_adapter.nil?
default_options[:connection_adapter]
else
default_options[:connection_adapter] = custom_adapter
default_options[:connection_adapter_options] = options
end
end | ruby | def connection_adapter(custom_adapter = nil, options = nil)
if custom_adapter.nil?
default_options[:connection_adapter]
else
default_options[:connection_adapter] = custom_adapter
default_options[:connection_adapter_options] = options
end
end | [
"def",
"connection_adapter",
"(",
"custom_adapter",
"=",
"nil",
",",
"options",
"=",
"nil",
")",
"if",
"custom_adapter",
".",
"nil?",
"default_options",
"[",
":connection_adapter",
"]",
"else",
"default_options",
"[",
":connection_adapter",
"]",
"=",
"custom_adapter... | Allows setting a custom connection_adapter for the http connections
@example
class Foo
include HTTParty
connection_adapter Proc.new {|uri, options| ... }
end
@example provide optional configuration for your connection_adapter
class Foo
include HTTParty
connection_adapter Proc.new {|uri, options| ... }, {foo: :bar}
end
@see HTTParty::ConnectionAdapter | [
"Allows",
"setting",
"a",
"custom",
"connection_adapter",
"for",
"the",
"http",
"connections"
] | b4099defba01231d2faaaa2660476f867e096bfb | https://github.com/jnunemaker/httparty/blob/b4099defba01231d2faaaa2660476f867e096bfb/lib/httparty.rb#L485-L492 | train | Returns the connection adapter | [
30522,
13366,
4434,
1035,
15581,
2121,
1006,
7661,
1035,
15581,
2121,
30524,
4434,
1035,
15581,
2121,
1033,
2842,
12398,
1035,
7047,
1031,
1024,
4434,
1035,
15581,
2121,
1033,
1027,
7661,
1035,
15581,
2121,
12398,
1035,
7047,
1031,
1024,
44... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/linter/instance_variables.rb | HamlLint.Linter::InstanceVariables.visit_root | def visit_root(node)
@enabled = matcher.match(File.basename(node.file)) ? true : false
end | ruby | def visit_root(node)
@enabled = matcher.match(File.basename(node.file)) ? true : false
end | [
"def",
"visit_root",
"(",
"node",
")",
"@enabled",
"=",
"matcher",
".",
"match",
"(",
"File",
".",
"basename",
"(",
"node",
".",
"file",
")",
")",
"?",
"true",
":",
"false",
"end"
] | Enables the linter if the tree is for the right file type.
@param [HamlLint::Tree::RootNode] the root of a syntax tree
@return [true, false] whether the linter is enabled for the tree | [
"Enables",
"the",
"linter",
"if",
"the",
"tree",
"is",
"for",
"the",
"right",
"file",
"type",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/linter/instance_variables.rb#L12-L14 | train | Visit the root node | [
30522,
13366,
3942,
1035,
7117,
1006,
13045,
1007,
1030,
9124,
1027,
2674,
2121,
1012,
2674,
1006,
5371,
1012,
2918,
18442,
1006,
13045,
1012,
5371,
1007,
1007,
1029,
2995,
1024,
6270,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/auto_scaling_group.rb | Aws::AutoScaling.AutoScalingGroup.policies | def policies(options = {})
batches = Enumerator.new do |y|
options = options.merge(auto_scaling_group_name: @name)
resp = @client.describe_policies(options)
resp.each_page do |page|
batch = []
page.data.scaling_policies.each do |s|
batch << ScalingPolicy.new(
name: s.policy_name,
data: s,
client: @client
)
end
y.yield(batch)
end
end
ScalingPolicy::Collection.new(batches)
end | ruby | def policies(options = {})
batches = Enumerator.new do |y|
options = options.merge(auto_scaling_group_name: @name)
resp = @client.describe_policies(options)
resp.each_page do |page|
batch = []
page.data.scaling_policies.each do |s|
batch << ScalingPolicy.new(
name: s.policy_name,
data: s,
client: @client
)
end
y.yield(batch)
end
end
ScalingPolicy::Collection.new(batches)
end | [
"def",
"policies",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"options",
"=",
"options",
".",
"merge",
"(",
"auto_scaling_group_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"describe_polic... | @example Request syntax with placeholder values
policies = auto_scaling_group.policies({
policy_names: ["ResourceName"],
policy_types: ["XmlStringMaxLen64"],
})
@param [Hash] options ({})
@option options [Array<String>] :policy_names
The names of one or more policies. If you omit this parameter, all
policies are described. If a group name is provided, the results are
limited to that group. This list is limited to 50 items. If you
specify an unknown policy name, it is ignored with no error.
@option options [Array<String>] :policy_types
One or more policy types. The valid values are `SimpleScaling`,
`StepScaling`, and `TargetTrackingScaling`.
@return [ScalingPolicy::Collection] | [
"@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#L1114-L1131 | train | Returns an array of ScalingPolicies for this Auto Scaling Group | [
30522,
13366,
6043,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
7047,
1027,
7047,
1012,
13590,
1006,
8285,
1035,
25169,
1035,
2177,
1035,
2171,
1024,
1030,
2171,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.