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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chaps-io/public_activity | lib/public_activity/common.rb | PublicActivity.Common.prepare_parameters | def prepare_parameters(options)
params = {}
params.merge!(self.class.activity_params_global)
params.merge!(self.activity_params) if self.activity_params
params.merge!([options.delete(:parameters), options.delete(:params), {}].compact.first)
params.each { |k, v| params[k] = PublicActivity.resolve_value(self, v) }
end | ruby | def prepare_parameters(options)
params = {}
params.merge!(self.class.activity_params_global)
params.merge!(self.activity_params) if self.activity_params
params.merge!([options.delete(:parameters), options.delete(:params), {}].compact.first)
params.each { |k, v| params[k] = PublicActivity.resolve_value(self, v) }
end | [
"def",
"prepare_parameters",
"(",
"options",
")",
"params",
"=",
"{",
"}",
"params",
".",
"merge!",
"(",
"self",
".",
"class",
".",
"activity_params_global",
")",
"params",
".",
"merge!",
"(",
"self",
".",
"activity_params",
")",
"if",
"self",
".",
"activi... | Prepares i18n parameters that will
be serialized into the Activity#parameters column
@private | [
"Prepares",
"i18n",
"parameters",
"that",
"will",
"be",
"serialized",
"into",
"the",
"Activity#parameters",
"column"
] | e4357cd14db67299e0cbbd656300f51b7069ea9b | https://github.com/chaps-io/public_activity/blob/e4357cd14db67299e0cbbd656300f51b7069ea9b/lib/public_activity/common.rb#L319-L325 | train | Prepare parameters for the activity | [
30522,
13366,
7374,
1035,
11709,
1006,
7047,
1007,
11498,
5244,
1027,
1063,
1065,
11498,
5244,
1012,
13590,
999,
1006,
2969,
1012,
2465,
1012,
4023,
1035,
11498,
5244,
1035,
3795,
1007,
11498,
5244,
1012,
13590,
999,
1006,
2969,
1012,
4023,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.merge_certificate_with_http_info | def merge_certificate_with_http_info(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil)
merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
end | ruby | def merge_certificate_with_http_info(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil)
merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
end | [
"def",
"merge_certificate_with_http_info",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"x509certificates",
",",
"certificate_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"merge_certificate_async",
"(",
"vault_base_ur... | Merges a certificate or a certificate chain with a key pair existing on the
server.
The MergeCertificate operation performs the merging of a certificate or
certificate chain with a key pair currently available in the service. This
operation requires the certificates/create 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 x509certificates [Array<Array<Integer>>] The certificate or the
certificate chain to merge.
@param certificate_attributes [CertificateAttributes] The attributes of the
certificate (optional).
@param tags [Hash{String => String}] Application specific metadata in the
form of key-value pairs.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Merges",
"a",
"certificate",
"or",
"a",
"certificate",
"chain",
"with",
"a",
"key",
"pair",
"existing",
"on",
"the",
"server",
"."
] | 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#L6420-L6422 | train | Merge a certificate into a single resource group. | [
30522,
13366,
13590,
1035,
8196,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
1060,
12376,
2683,
17119,
3775,
8873,
16280,
2015,
1010,
8196,
1035,
12332,
1024,
9152,
2140,
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... |
etewiah/property_web_builder | spec/mailers/previews/pwb/enquiry_mailer_preview.rb | Pwb.EnquiryMailerPreview.general_enquiry_targeting_agency | def general_enquiry_targeting_agency
@message = Message.new(origin_email: "jd@propertywebbuilder.com", delivery_email: "test@test.com")
@client = Client.new(first_names: "John Doe", phone_number_primary: "22 44", email: "jd@propertywebbuilder.com")
EnquiryMailer.general_enquiry_targeting_agency(@client, @message)
end | ruby | def general_enquiry_targeting_agency
@message = Message.new(origin_email: "jd@propertywebbuilder.com", delivery_email: "test@test.com")
@client = Client.new(first_names: "John Doe", phone_number_primary: "22 44", email: "jd@propertywebbuilder.com")
EnquiryMailer.general_enquiry_targeting_agency(@client, @message)
end | [
"def",
"general_enquiry_targeting_agency",
"@message",
"=",
"Message",
".",
"new",
"(",
"origin_email",
":",
"\"jd@propertywebbuilder.com\"",
",",
"delivery_email",
":",
"\"test@test.com\"",
")",
"@client",
"=",
"Client",
".",
"new",
"(",
"first_names",
":",
"\"John D... | def general_enquiry_targeting_enquirer
@message = Message.new(email: "jd@propertywebbuilder.com")
EnquiryMailer.general_enquiry_targeting_enquirer(Tenant.first, @message)
end | [
"def",
"general_enquiry_targeting_enquirer"
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/spec/mailers/previews/pwb/enquiry_mailer_preview.rb#L12-L16 | train | Returns the correct enquiry targeting agency | [
30522,
13366,
2236,
1035,
4372,
15549,
2854,
1035,
14126,
1035,
4034,
1030,
4471,
1027,
4471,
1012,
2047,
1006,
4761,
1035,
10373,
1024,
1000,
26219,
1030,
3200,
8545,
10322,
19231,
4063,
1012,
4012,
1000,
1010,
6959,
1035,
10373,
1024,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_consumption/lib/2018-06-30/generated/azure_mgmt_consumption/usage_details.rb | Azure::Consumption::Mgmt::V2018_06_30.UsageDetails.list_for_billing_period_by_enrollment_account_next | def list_for_billing_period_by_enrollment_account_next(next_page_link, custom_headers:nil)
response = list_for_billing_period_by_enrollment_account_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_for_billing_period_by_enrollment_account_next(next_page_link, custom_headers:nil)
response = list_for_billing_period_by_enrollment_account_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_for_billing_period_by_enrollment_account_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_for_billing_period_by_enrollment_account_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"v... | Lists the usage details based on enrollmentAccountId for a scope by billing
period. Usage details are available via this API only for May 1, 2014 or
later.
@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 [UsageDetailsListResult] operation results. | [
"Lists",
"the",
"usage",
"details",
"based",
"on",
"enrollmentAccountId",
"for",
"a",
"scope",
"by",
"billing",
"period",
".",
"Usage",
"details",
"are",
"available",
"via",
"this",
"API",
"only",
"for",
"May",
"1",
"2014",
"or",
"later",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_consumption/lib/2018-06-30/generated/azure_mgmt_consumption/usage_details.rb#L1887-L1890 | train | Gets the list of all the enrollment accounts for a subscription. | [
30522,
13366,
2862,
1035,
2005,
1035,
25640,
1035,
2558,
1035,
2011,
1035,
10316,
1035,
4070,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2005,
1035,
25640,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/connection_monitors.rb | Azure::Network::Mgmt::V2018_07_01.ConnectionMonitors.create_or_update_async | def create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Network::Mgmt::V2018_07_01::Models::ConnectionMonitorResult.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, network_watcher_name, connection_monitor_name, parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Network::Mgmt::V2018_07_01::Models::ConnectionMonitorResult.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"create_or_update_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"connection_monitor_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_or_update_async",
"(",
"resource_group_name",
... | @param resource_group_name [String] The name of the resource group containing
Network Watcher.
@param network_watcher_name [String] The name of the Network Watcher
resource.
@param connection_monitor_name [String] The name of the connection monitor.
@param parameters [ConnectionMonitor] Parameters that define the operation to
create a connection monitor.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"resource",
"group",
"containing",
"Network",
"Watcher",
".",
"@param",
"network_watcher_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"Network",
"Watcher",
"resource",
"."... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/connection_monitors.rb#L58-L74 | train | Creates or updates a connection monitor. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
30524,
1035,
2171,
1010,
4434,
1035,
8080,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/connection_monitors.rb | Azure::Network::Mgmt::V2018_10_01.ConnectionMonitors.begin_stop | def begin_stop(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil)
response = begin_stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_stop(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil)
response = begin_stop_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_stop",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"connection_monitor_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_stop_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"connection_monitor_name"... | Stops the specified connection monitor.
@param resource_group_name [String] The name of the resource group containing
Network Watcher.
@param network_watcher_name [String] The name of the Network Watcher
resource.
@param connection_monitor_name [String] The name of the connection monitor.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Stops",
"the",
"specified",
"connection",
"monitor",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/connection_monitors.rb#L687-L690 | train | Stops the specified connection monitor. | [
30522,
13366,
4088,
1035,
2644,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
4434,
1035,
8080,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
2644,
1035,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb | Aws::AutoScaling.LaunchConfiguration.delete | def delete(options = {})
options = options.merge(launch_configuration_name: @name)
resp = @client.delete_launch_configuration(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(launch_configuration_name: @name)
resp = @client.delete_launch_configuration(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"launch_configuration_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"delete_launch_configuration",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
launch_configuration.delete()
@param [Hash] options ({})
@return [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/launch_configuration.rb#L306-L310 | train | Delete the launch configuration | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
4888,
1035,
9563,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
4888,
1035,
9563,
1006,
7047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.delete_service_with_http_info | def delete_service_with_http_info(service_id, force_remove:nil, timeout:60, custom_headers:nil)
delete_service_async(service_id, force_remove:force_remove, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def delete_service_with_http_info(service_id, force_remove:nil, timeout:60, custom_headers:nil)
delete_service_async(service_id, force_remove:force_remove, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"delete_service_with_http_info",
"(",
"service_id",
",",
"force_remove",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"delete_service_async",
"(",
"service_id",
",",
"force_remove",
":force_remove",
",",
"timeout",
":",
"ti... | Deletes an existing Service Fabric service.
Deletes an existing Service Fabric service. A service must be created before
it can be deleted. By default, Service Fabric will try to close service
replicas in a graceful manner and then delete the service. However, if the
service is having issues closing the replica gracefully, the delete operation
may take a long time or get stuck. Use the optional ForceRemove flag to skip
the graceful close sequence and forcefully delete the service.
@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 force_remove [Boolean] Remove a Service Fabric application or service
forcefully without going through the graceful shutdown sequence. This
parameter can be used to forcefully delete an application or service for
which delete is timing out due to issues in the service code that prevents
graceful close of replicas.
@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. | [
"Deletes",
"an",
"existing",
"Service",
"Fabric",
"service",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L10440-L10442 | train | Deletes the specified service. | [
30522,
13366,
3972,
12870,
1035,
2326,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2326,
1035,
8909,
1010,
2486,
1035,
6366,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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... |
geokit/geokit | lib/geokit/bounds.rb | Geokit.Bounds.to_span | def to_span
lat_span = @ne.lat - @sw.lat
lng_span = crosses_meridian? ? 360 + @ne.lng - @sw.lng : @ne.lng - @sw.lng
Geokit::LatLng.new(lat_span.abs, lng_span.abs)
end | ruby | def to_span
lat_span = @ne.lat - @sw.lat
lng_span = crosses_meridian? ? 360 + @ne.lng - @sw.lng : @ne.lng - @sw.lng
Geokit::LatLng.new(lat_span.abs, lng_span.abs)
end | [
"def",
"to_span",
"lat_span",
"=",
"@ne",
".",
"lat",
"-",
"@sw",
".",
"lat",
"lng_span",
"=",
"crosses_meridian?",
"?",
"360",
"+",
"@ne",
".",
"lng",
"-",
"@sw",
".",
"lng",
":",
"@ne",
".",
"lng",
"-",
"@sw",
".",
"lng",
"Geokit",
"::",
"LatLng"... | Returns true if the candidate object is logically equal. Logical
equivalence is true if the lat and lng attributes are the same for both
objects.
Equivalent to Google Maps API's .toSpan() method on GLatLng's.
Returns a LatLng object, whose coordinates represent the size of a
rectangle defined by these bounds. | [
"Returns",
"true",
"if",
"the",
"candidate",
"object",
"is",
"logically",
"equal",
".",
"Logical",
"equivalence",
"is",
"true",
"if",
"the",
"lat",
"and",
"lng",
"attributes",
"are",
"the",
"same",
"for",
"both",
"objects",
".",
"Equivalent",
"to",
"Google",... | b7c13376bd85bf14f9534228ea466d09ac0afbf4 | https://github.com/geokit/geokit/blob/b7c13376bd85bf14f9534228ea466d09ac0afbf4/lib/geokit/bounds.rb#L60-L64 | train | Returns a new array of the coordinates of the segment in the segment. | [
30522,
13366,
2000,
1035,
8487,
2474,
2102,
1035,
8487,
1027,
1030,
11265,
1012,
2474,
2102,
1011,
1030,
25430,
1012,
2474,
2102,
1048,
3070,
1035,
8487,
1027,
7821,
1035,
17984,
1029,
1029,
9475,
1009,
1030,
11265,
1012,
1048,
3070,
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... |
puppetlabs/puppet | lib/puppet/util/windows/sid.rb | Puppet::Util::Windows.SID.name_to_principal | def name_to_principal(name)
# Apparently, we accept a symbol..
name = name.to_s.strip if name
# if name is a SID string, convert it to raw bytes for use with lookup_account_sid
raw_sid_bytes = nil
begin
string_to_sid_ptr(name) do |sid_ptr|
raw_sid_bytes = sid_ptr.read_array_of_uchar(get_length_sid(sid_ptr))
end
rescue
end
raw_sid_bytes ? Principal.lookup_account_sid(raw_sid_bytes) : Principal.lookup_account_name(name)
rescue
nil
end | ruby | def name_to_principal(name)
# Apparently, we accept a symbol..
name = name.to_s.strip if name
# if name is a SID string, convert it to raw bytes for use with lookup_account_sid
raw_sid_bytes = nil
begin
string_to_sid_ptr(name) do |sid_ptr|
raw_sid_bytes = sid_ptr.read_array_of_uchar(get_length_sid(sid_ptr))
end
rescue
end
raw_sid_bytes ? Principal.lookup_account_sid(raw_sid_bytes) : Principal.lookup_account_name(name)
rescue
nil
end | [
"def",
"name_to_principal",
"(",
"name",
")",
"# Apparently, we accept a symbol..",
"name",
"=",
"name",
".",
"to_s",
".",
"strip",
"if",
"name",
"# if name is a SID string, convert it to raw bytes for use with lookup_account_sid",
"raw_sid_bytes",
"=",
"nil",
"begin",
"strin... | Convert an account name, e.g. 'Administrators' into a Principal::SID object,
e.g. 'S-1-5-32-544'. The name can be specified as 'Administrators',
'BUILTIN\Administrators', or 'S-1-5-32-544', and will return the
SID object. Returns nil if the account doesn't exist.
This method returns a SID::Principal with the account, domain, SID, etc | [
"Convert",
"an",
"account",
"name",
"e",
".",
"g",
".",
"Administrators",
"into",
"a",
"Principal",
"::",
"SID",
"object",
"e",
".",
"g",
".",
"S",
"-",
"1",
"-",
"5",
"-",
"32",
"-",
"544",
".",
"The",
"name",
"can",
"be",
"specified",
"as",
"Ad... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/windows/sid.rb#L66-L82 | train | Returns the principal for the given name. | [
30522,
13366,
2171,
1035,
2000,
1035,
4054,
1006,
2171,
1007,
1001,
4593,
1010,
2057,
5138,
1037,
6454,
1012,
1012,
2171,
1027,
2171,
1012,
2000,
1035,
1055,
1012,
6167,
2065,
2171,
1001,
2065,
2171,
2003,
1037,
15765,
5164,
1010,
10463,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/route_table.rb | Aws::EC2.RouteTable.delete | def delete(options = {})
options = options.merge(route_table_id: @id)
resp = @client.delete_route_table(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(route_table_id: @id)
resp = @client.delete_route_table(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"route_table_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"delete_route_table",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
route_table.delete({
dry_run: false,
})
@param [Hash] options ({})
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/route_table.rb#L317-L321 | train | Delete a route table | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2799,
1035,
2795,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
2799,
1035,
2795,
1006,
7047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.list_site_detector_responses_slot_as_lazy | def list_site_detector_responses_slot_as_lazy(resource_group_name, site_name, slot, custom_headers:nil)
response = list_site_detector_responses_slot_async(resource_group_name, site_name, slot, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_site_detector_responses_slot_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_site_detector_responses_slot_as_lazy(resource_group_name, site_name, slot, custom_headers:nil)
response = list_site_detector_responses_slot_async(resource_group_name, site_name, slot, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_site_detector_responses_slot_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_site_detector_responses_slot_as_lazy",
"(",
"resource_group_name",
",",
"site_name",
",",
"slot",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_site_detector_responses_slot_async",
"(",
"resource_group_name",
",",
"site_name",
",",
"slot",
",... | List Site Detector Responses
List Site Detector Responses
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param slot [String] Slot Name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DetectorResponseCollection] which provide lazy access to pages of
the response. | [
"List",
"Site",
"Detector",
"Responses"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L3725-L3734 | train | Gets the list of detector responses for a site. | [
30522,
30524,
1027,
2862,
1035,
2609,
1035,
19034,
1035,
10960,
1035,
10453,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
10453,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_worker_pool_skus | def list_worker_pool_skus(resource_group_name, name, worker_pool_name, custom_headers:nil)
first_page = list_worker_pool_skus_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_worker_pool_skus(resource_group_name, name, worker_pool_name, custom_headers:nil)
first_page = list_worker_pool_skus_as_lazy(resource_group_name, name, worker_pool_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_worker_pool_skus",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_worker_pool_skus_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"custom_h... | Get available SKUs for scaling a worker pool.
Get available SKUs for scaling a worker pool.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param worker_pool_name [String] Name of the worker pool.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<SkuInfo>] operation results. | [
"Get",
"available",
"SKUs",
"for",
"scaling",
"a",
"worker",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L3937-L3940 | train | Gets all the skus of a worker pool. | [
30522,
13366,
2862,
1035,
7309,
1035,
4770,
1035,
15315,
2271,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7309,
1035,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
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_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/group_users.rb | Azure::ApiManagement::Mgmt::V2016_10_10.GroupUsers.create_with_http_info | def create_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers:nil)
create_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value!
end | ruby | def create_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers:nil)
create_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value!
end | [
"def",
"create_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"group_id",
",",
"uid",
",",
"custom_headers",
":",
"nil",
")",
"create_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"group_id",
",",
"uid",
",",
"custom_headers",... | Adds a user to the specified 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 uid [String] User identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Adds",
"a",
"user",
"to",
"the",
"specified",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/group_users.rb#L221-L223 | train | Creates a new chunk of a chunk of a chunk of a chunk of data. | [
30522,
13366,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
2177,
1035,
8909,
1010,
21318,
2094,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3443,
1035,
2004,
6038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_repair_task_list | def get_repair_task_list(task_id_filter:nil, state_filter:nil, executor_filter:nil, custom_headers:nil)
response = get_repair_task_list_async(task_id_filter:task_id_filter, state_filter:state_filter, executor_filter:executor_filter, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_repair_task_list(task_id_filter:nil, state_filter:nil, executor_filter:nil, custom_headers:nil)
response = get_repair_task_list_async(task_id_filter:task_id_filter, state_filter:state_filter, executor_filter:executor_filter, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_repair_task_list",
"(",
"task_id_filter",
":",
"nil",
",",
"state_filter",
":",
"nil",
",",
"executor_filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_repair_task_list_async",
"(",
"task_id_filter",
":task_id_filter",
",... | Gets a list of repair tasks matching the given filters.
This API supports the Service Fabric platform; it is not meant to be used
directly from your code.
@param task_id_filter [String] The repair task ID prefix to be matched.
@param state_filter [Integer] A bitwise-OR of the following values,
specifying which task states should be included in the result list.
- 1 - Created
- 2 - Claimed
- 4 - Preparing
- 8 - Approved
- 16 - Executing
- 32 - Restoring
- 64 - Completed
@param executor_filter [String] The name of the repair executor whose claimed
tasks should be included in the list.
@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",
"repair",
"tasks",
"matching",
"the",
"given",
"filters",
"."
] | 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#L13985-L13988 | train | Gets the list of tasks that are currently in the current task list. | [
30522,
13366,
2131,
1035,
7192,
1035,
4708,
1035,
2862,
1006,
4708,
1035,
8909,
1035,
11307,
1024,
9152,
2140,
1010,
2110,
1035,
11307,
1024,
9152,
2140,
1010,
4654,
8586,
16161,
2099,
1035,
11307,
1024,
9152,
2140,
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... |
hashicorp/vault-ruby | lib/vault/api/sys/audit.rb | Vault.Sys.enable_audit | def enable_audit(path, type, description, options = {})
client.put("/v1/sys/audit/#{encode_path(path)}", JSON.fast_generate(
type: type,
description: description,
options: options,
))
return true
end | ruby | def enable_audit(path, type, description, options = {})
client.put("/v1/sys/audit/#{encode_path(path)}", JSON.fast_generate(
type: type,
description: description,
options: options,
))
return true
end | [
"def",
"enable_audit",
"(",
"path",
",",
"type",
",",
"description",
",",
"options",
"=",
"{",
"}",
")",
"client",
".",
"put",
"(",
"\"/v1/sys/audit/#{encode_path(path)}\"",
",",
"JSON",
".",
"fast_generate",
"(",
"type",
":",
"type",
",",
"description",
":"... | Enable a particular audit. Note: the +options+ depend heavily on the
type of audit being enabled. Please refer to audit-specific documentation
for which need to be enabled.
@example
Vault.sys.enable_audit("/file-audit", "file", "File audit", path: "/path/on/disk") #=> true
@param [String] path
the path to mount the audit
@param [String] type
the type of audit to enable
@param [String] description
a human-friendly description of the audit backend
@param [Hash] options
audit-specific options
@return [true] | [
"Enable",
"a",
"particular",
"audit",
".",
"Note",
":",
"the",
"+",
"options",
"+",
"depend",
"heavily",
"on",
"the",
"type",
"of",
"audit",
"being",
"enabled",
".",
"Please",
"refer",
"to",
"audit",
"-",
"specific",
"documentation",
"for",
"which",
"need"... | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/sys/audit.rb#L53-L60 | train | Enable auditing for a given path | [
30522,
13366,
9585,
1035,
15727,
1006,
4130,
1010,
2828,
1010,
6412,
1010,
7047,
1027,
1063,
1065,
1007,
7396,
1012,
2404,
1006,
1000,
1013,
1058,
2487,
1013,
25353,
2015,
1013,
15727,
1013,
1001,
1063,
4372,
16044,
1035,
4130,
1006,
4130,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | frameit/lib/frameit/editor.rb | Frameit.Editor.put_title_into_background_stacked | def put_title_into_background_stacked(background, title, keyword)
resize_text(title)
resize_text(keyword)
vertical_padding = vertical_frame_padding # assign padding to variable
spacing_between_title_and_keyword = (actual_font_size / 2)
title_left_space = (background.width / 2.0 - title.width / 2.0).round
keyword_left_space = (background.width / 2.0 - keyword.width / 2.0).round
self.space_to_device += title.height + keyword.height + spacing_between_title_and_keyword + vertical_padding
if title_below_image
keyword_top = background.height - effective_text_height / 2 - (keyword.height + spacing_between_title_and_keyword + title.height) / 2
else
keyword_top = device_top(background) / 2 - spacing_between_title_and_keyword / 2 - keyword.height
end
title_top = keyword_top + keyword.height + spacing_between_title_and_keyword
# keyword
background = background.composite(keyword, "png") do |c|
c.compose("Over")
c.geometry("+#{keyword_left_space}+#{keyword_top}")
end
# Place the title below the keyword
background = background.composite(title, "png") do |c|
c.compose("Over")
c.geometry("+#{title_left_space}+#{title_top}")
end
background
end | ruby | def put_title_into_background_stacked(background, title, keyword)
resize_text(title)
resize_text(keyword)
vertical_padding = vertical_frame_padding # assign padding to variable
spacing_between_title_and_keyword = (actual_font_size / 2)
title_left_space = (background.width / 2.0 - title.width / 2.0).round
keyword_left_space = (background.width / 2.0 - keyword.width / 2.0).round
self.space_to_device += title.height + keyword.height + spacing_between_title_and_keyword + vertical_padding
if title_below_image
keyword_top = background.height - effective_text_height / 2 - (keyword.height + spacing_between_title_and_keyword + title.height) / 2
else
keyword_top = device_top(background) / 2 - spacing_between_title_and_keyword / 2 - keyword.height
end
title_top = keyword_top + keyword.height + spacing_between_title_and_keyword
# keyword
background = background.composite(keyword, "png") do |c|
c.compose("Over")
c.geometry("+#{keyword_left_space}+#{keyword_top}")
end
# Place the title below the keyword
background = background.composite(title, "png") do |c|
c.compose("Over")
c.geometry("+#{title_left_space}+#{title_top}")
end
background
end | [
"def",
"put_title_into_background_stacked",
"(",
"background",
",",
"title",
",",
"keyword",
")",
"resize_text",
"(",
"title",
")",
"resize_text",
"(",
"keyword",
")",
"vertical_padding",
"=",
"vertical_frame_padding",
"# assign padding to variable",
"spacing_between_title_... | Add the title above or below the device | [
"Add",
"the",
"title",
"above",
"or",
"below",
"the",
"device"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/frameit/lib/frameit/editor.rb#L292-L321 | train | This method is used to put the title into the background image | [
30522,
13366,
2404,
1035,
2516,
1035,
2046,
1035,
4281,
1035,
16934,
1006,
4281,
1010,
2516,
1010,
3145,
18351,
1007,
24501,
4697,
1035,
3793,
1006,
2516,
1007,
24501,
4697,
1035,
3793,
1006,
3145,
18351,
1007,
7471,
1035,
11687,
4667,
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_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb | Azure::SQL::Mgmt::V2014_04_01.Databases.begin_export_with_http_info | def begin_export_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_export_with_http_info(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_export_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_export_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"param... | Exports a database to a bacpac.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param database_name [String] The name of the database to be exported.
@param parameters [ExportRequest] The required parameters for exporting a
database.
@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. | [
"Exports",
"a",
"database",
"to",
"a",
"bacpac",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb#L2024-L2026 | train | Export a database to a JSON blob. | [
30522,
13366,
4088,
1035,
9167,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
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... |
square/connect-ruby-sdk | lib/square_connect/models/order_fulfillment_recipient.rb | SquareConnect.OrderFulfillmentRecipient.phone_number= | def phone_number=(phone_number)
if !phone_number.nil? && phone_number.to_s.length > 16
fail ArgumentError, "invalid value for 'phone_number', the character length must be smaller than or equal to 16."
end
@phone_number = phone_number
end | ruby | def phone_number=(phone_number)
if !phone_number.nil? && phone_number.to_s.length > 16
fail ArgumentError, "invalid value for 'phone_number', the character length must be smaller than or equal to 16."
end
@phone_number = phone_number
end | [
"def",
"phone_number",
"=",
"(",
"phone_number",
")",
"if",
"!",
"phone_number",
".",
"nil?",
"&&",
"phone_number",
".",
"to_s",
".",
"length",
">",
"16",
"fail",
"ArgumentError",
",",
"\"invalid value for 'phone_number', the character length must be smaller than or equal... | Custom attribute writer method with validation
@param [Object] phone_number Value to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"with",
"validation"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/order_fulfillment_recipient.rb#L126-L133 | train | Set the phone number of the phone. | [
30522,
30524,
1996,
2839,
3091,
2442,
2022,
3760,
2084,
2030,
5020,
2000,
2385,
1012,
1000,
2203,
1030,
3042,
1035,
2193,
1027,
3042,
1035,
2193,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.delete_async | def delete_async(resource_group_name, resource_name, custom_headers:nil)
# Send request
promise = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = {
client_side_validation: true,
required: false,
serialized_name: 'parsed_response',
type: {
name: 'Object'
}
}
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def delete_async(resource_group_name, resource_name, custom_headers:nil)
# Send request
promise = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = {
client_side_validation: true,
required: false,
serialized_name: 'parsed_response',
type: {
name: 'Object'
}
}
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"delete_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":custom_headers",
")",
"pro... | @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 to delete.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"resource",
"group",
"that",
"contains",
"the",
"IoT",
"hub",
".",
"@param",
"resource_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"IoT",
"hub",
"to",
"delete",
"."... | 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#L205-L228 | train | Deletes a resource. | [
30522,
13366,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
3972,
12870,
1035,
2004,
6038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb | Azure::Batch::Mgmt::V2017_09_01.PoolOperations.stop_resize_with_http_info | def stop_resize_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
stop_resize_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
end | ruby | def stop_resize_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
stop_resize_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
end | [
"def",
"stop_resize_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"custom_headers",
":",
"nil",
")",
"stop_resize_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"custom_headers",
":custom_headers"... | Stops an ongoing resize operation on the pool.
This does not restore the pool to its previous state before the resize
operation: it only stops any further changes being made, and the pool
maintains its current state. After stopping, the pool stabilizes at the
number of nodes it was at when the stop operation was done. During the stop
operation, the pool allocation state changes first to stopping and then to
steady. A resize operation need not be an explicit resize pool request; this
API can also be used to halt the initial sizing of the pool when it is
created.
@param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param pool_name [String] The pool name. This must be unique within the
account.
@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. | [
"Stops",
"an",
"ongoing",
"resize",
"operation",
"on",
"the",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb#L683-L685 | train | Stops resize of the specified pool. | [
30522,
13366,
2644,
1035,
24501,
4697,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2644,
1035,
24501,
4697,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_analysis_services/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb | Azure::AnalysisServices::Mgmt::V2017_08_01_beta.Servers.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, server_name, server_update_parameters, custom_headers:nil)
begin_update_async(resource_group_name, server_name, server_update_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"server_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"server_update_parameters",
",",
"custom... | Updates the current state of the specified Analysis Services server.
@param resource_group_name [String] The name of the Azure Resource group of
which a given Analysis Services server is part. This name must be at least 1
character in length, and no more than 90.
@param server_name [String] The name of the Analysis Services server. It must
be at least 3 characters in length, and no more than 63.
@param server_update_parameters [AnalysisServicesServerUpdateParameters]
Request object that contains the updated information for the server.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"the",
"current",
"state",
"of",
"the",
"specified",
"Analysis",
"Services",
"server",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_analysis_services/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb#L1501-L1503 | train | Updates a server s index. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
30524,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
8241,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb | Aws::RDS.DBInstance.modify | def modify(options = {})
options = options.merge(db_instance_identifier: @id)
resp = @client.modify_db_instance(options)
DBInstance.new(
id: resp.data.db_instance.db_instance_identifier,
data: resp.data.db_instance,
client: @client
)
end | ruby | def modify(options = {})
options = options.merge(db_instance_identifier: @id)
resp = @client.modify_db_instance(options)
DBInstance.new(
id: resp.data.db_instance.db_instance_identifier,
data: resp.data.db_instance,
client: @client
)
end | [
"def",
"modify",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"db_instance_identifier",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"modify_db_instance",
"(",
"options",
")",
"DBInstance",
".",
"new",
"(",
"id",
":"... | @example Request syntax with placeholder values
dbinstance = db_instance.modify({
allocated_storage: 1,
db_instance_class: "String",
db_subnet_group_name: "String",
db_security_groups: ["String"],
vpc_security_group_ids: ["String"],
apply_immediately: false,
master_user_password: "String",
db_parameter_group_name: "String",
backup_retention_period: 1,
preferred_backup_window: "String",
preferred_maintenance_window: "String",
multi_az: false,
engine_version: "String",
allow_major_version_upgrade: false,
auto_minor_version_upgrade: false,
license_model: "String",
iops: 1,
option_group_name: "String",
new_db_instance_identifier: "String",
storage_type: "String",
tde_credential_arn: "String",
tde_credential_password: "String",
ca_certificate_identifier: "String",
domain: "String",
copy_tags_to_snapshot: false,
monitoring_interval: 1,
db_port_number: 1,
publicly_accessible: false,
monitoring_role_arn: "String",
domain_iam_role_name: "String",
promotion_tier: 1,
enable_iam_database_authentication: false,
enable_performance_insights: false,
performance_insights_kms_key_id: "String",
performance_insights_retention_period: 1,
cloudwatch_logs_export_configuration: {
enable_log_types: ["String"],
disable_log_types: ["String"],
},
processor_features: [
{
name: "String",
value: "String",
},
],
use_default_processor_features: false,
deletion_protection: false,
})
@param [Hash] options ({})
@option options [Integer] :allocated_storage
The new amount of storage (in gibibytes) to allocate for the DB
instance.
For MariaDB, MySQL, Oracle, and PostgreSQL, the value supplied must be
at least 10% greater than the current value. Values that are not at
least 10% greater than the existing value are rounded up so that they
are 10% greater than the current value.
For the valid values for allocated storage for each engine, see
CreateDBInstance.
@option options [String] :db_instance_class
The new compute and memory capacity of the DB instance, for example,
`db.m4.large`. Not all DB instance classes are available in all AWS
Regions, or for all database engines. For the full list of DB instance
classes, and availability for your engine, see [DB Instance Class][1]
in the *Amazon RDS User Guide.*
If you modify the DB instance class, an outage occurs during the
change. The change is applied during the next maintenance window,
unless `ApplyImmediately` is specified as `true` for this request.
Default: Uses existing setting
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html
@option options [String] :db_subnet_group_name
The new DB subnet group for the DB instance. You can use this
parameter to move your DB instance to a different VPC. If your DB
instance is not in a VPC, you can also use this parameter to move your
DB instance into a VPC. For more information, see [Updating the VPC
for a DB Instance][1] in the *Amazon RDS User Guide.*
Changing the subnet group causes an outage during the change. The
change is applied during the next maintenance window, unless you
specify `true` for the `ApplyImmediately` parameter.
Constraints: If supplied, must match the name of an existing
DBSubnetGroup.
Example: `mySubnetGroup`
[1]: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Non-VPC2VPC
@option options [Array<String>] :db_security_groups
A list of DB security groups to authorize on this DB instance.
Changing this setting doesn't result in an outage and the change is
asynchronously applied as soon as possible.
Constraints:
* If supplied, must match existing DBSecurityGroups.
^
@option options [Array<String>] :vpc_security_group_ids
A list of EC2 VPC security groups to authorize on this DB instance.
This change is asynchronously applied as soon as possible.
**Amazon Aurora**
Not applicable. The associated list of EC2 VPC security groups is
managed by the DB cluster. For more information, see ModifyDBCluster.
Constraints:
* If supplied, must match existing VpcSecurityGroupIds.
^
@option options [Boolean] :apply_immediately
Specifies whether the modifications in this request and any pending
modifications are asynchronously applied as soon as possible,
regardless of the `PreferredMaintenanceWindow` setting for the DB
instance.
If this parameter is set to `false`, changes to the DB instance are
applied during the next maintenance window. Some parameter changes can
cause an outage and are applied on the next call to RebootDBInstance,
or the next failure reboot. Review the table of parameters in
[Modifying a DB Instance and Using the Apply Immediately Parameter][1]
in the *Amazon RDS User Guide.* to see the impact that setting
`ApplyImmediately` to `true` or `false` has for each modified
parameter and to determine when the changes are applied.
Default: `false`
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.DBInstance.Modifying.html
@option options [String] :master_user_password
The new password for the master user. The password can include any
printable ASCII character except "/", """, or "@".
Changing this parameter doesn't result in an outage and the change is
asynchronously applied as soon as possible. Between the time of the
request and the completion of the request, the `MasterUserPassword`
element exists in the `PendingModifiedValues` element of the operation
response.
**Amazon Aurora**
Not applicable. The password for the master user is managed by the DB
cluster. For more information, see ModifyDBCluster.
Default: Uses existing setting
**MariaDB**
Constraints: Must contain from 8 to 41 characters.
**Microsoft SQL Server**
Constraints: Must contain from 8 to 128 characters.
**MySQL**
Constraints: Must contain from 8 to 41 characters.
**Oracle**
Constraints: Must contain from 8 to 30 characters.
**PostgreSQL**
Constraints: Must contain from 8 to 128 characters.
<note markdown="1"> Amazon RDS API actions never return the password, so this action
provides a way to regain access to a primary instance user if the
password is lost. This includes restoring privileges that might have
been accidentally revoked.
</note>
@option options [String] :db_parameter_group_name
The name of the DB parameter group to apply to the DB instance.
Changing this setting doesn't result in an outage. The parameter
group name itself is changed immediately, but the actual parameter
changes are not applied until you reboot the instance without
failover. The db instance will NOT be rebooted automatically and the
parameter changes will NOT be applied during the next maintenance
window.
Default: Uses existing setting
Constraints: The DB parameter group must be in the same DB parameter
group family as this DB instance.
@option options [Integer] :backup_retention_period
The number of days to retain automated backups. Setting this parameter
to a positive number enables backups. Setting this parameter to 0
disables automated backups.
Changing this parameter can result in an outage if you change from 0
to a non-zero value or from a non-zero value to 0. These changes are
applied during the next maintenance window unless the
`ApplyImmediately` parameter is set to `true` for this request. If you
change the parameter from one non-zero value to another non-zero
value, the change is asynchronously applied as soon as possible.
**Amazon Aurora**
Not applicable. The retention period for automated backups is managed
by the DB cluster. For more information, see ModifyDBCluster.
Default: Uses existing setting
Constraints:
* Must be a value from 0 to 35
* Can be specified for a MySQL Read Replica only if the source is
running MySQL 5.6 or later
* Can be specified for a PostgreSQL Read Replica only if the source is
running PostgreSQL 9.3.5
* Can't be set to 0 if the DB instance is a source to Read Replicas
@option options [String] :preferred_backup_window
The daily time range during which automated backups are created if
automated backups are enabled, as determined by the
`BackupRetentionPeriod` parameter. Changing this parameter doesn't
result in an outage and the change is asynchronously applied as soon
as possible.
**Amazon Aurora**
Not applicable. The daily time range for creating automated backups is
managed by the DB cluster. For more information, see ModifyDBCluster.
Constraints:
* Must be in the format hh24:mi-hh24:mi
* Must be in Universal Time Coordinated (UTC)
* Must not conflict with the preferred maintenance window
* Must be at least 30 minutes
@option options [String] :preferred_maintenance_window
The weekly time range (in UTC) during which system maintenance can
occur, which might result in an outage. Changing this parameter
doesn't result in an outage, except in the following situation, and
the change is asynchronously applied as soon as possible. If there are
pending actions that cause a reboot, and the maintenance window is
changed to include the current time, then changing this parameter will
cause a reboot of the DB instance. If moving this window to the
current time, there must be at least 30 minutes between the current
time and end of the window to ensure pending changes are applied.
Default: Uses existing setting
Format: ddd:hh24:mi-ddd:hh24:mi
Valid Days: Mon \| Tue \| Wed \| Thu \| Fri \| Sat \| Sun
Constraints: Must be at least 30 minutes
@option options [Boolean] :multi_az
Specifies if the DB instance is a Multi-AZ deployment. Changing this
parameter doesn't result in an outage and the change is applied
during the next maintenance window unless the `ApplyImmediately`
parameter is set to `true` for this request.
@option options [String] :engine_version
The version number of the database engine to upgrade to. Changing this
parameter results in an outage and the change is applied during the
next maintenance window unless the `ApplyImmediately` parameter is set
to `true` for this request.
For major version upgrades, if a nondefault DB parameter group is
currently in use, a new DB parameter group in the DB parameter group
family for the new engine version must be specified. The new DB
parameter group can be the default for that DB parameter group family.
For information about valid engine versions, see CreateDBInstance, or
call DescribeDBEngineVersions.
@option options [Boolean] :allow_major_version_upgrade
Indicates that major version upgrades are allowed. Changing this
parameter doesn't result in an outage and the change is
asynchronously applied as soon as possible.
Constraints: This parameter must be set to true when specifying a
value for the EngineVersion parameter that is a different major
version than the DB instance's current version.
@option options [Boolean] :auto_minor_version_upgrade
Indicates that minor version upgrades are applied automatically to the
DB instance during the maintenance window. Changing this parameter
doesn't result in an outage except in the following case and the
change is asynchronously applied as soon as possible. An outage will
result if this parameter is set to `true` during the maintenance
window, and a newer minor version is available, and RDS has enabled
auto patching for that engine version.
@option options [String] :license_model
The license model for the DB instance.
Valid values: `license-included` \| `bring-your-own-license` \|
`general-public-license`
@option options [Integer] :iops
The new Provisioned IOPS (I/O operations per second) value for the RDS
instance.
Changing this setting doesn't result in an outage and the change is
applied during the next maintenance window unless the
`ApplyImmediately` parameter is set to `true` for this request. If you
are migrating from Provisioned IOPS to standard storage, set this
value to 0. The DB instance will require a reboot for the change in
storage type to take effect.
If you choose to migrate your DB instance from using standard storage
to using Provisioned IOPS, or from using Provisioned IOPS to using
standard storage, the process can take time. The duration of the
migration depends on several factors such as database load, storage
size, storage type (standard or Provisioned IOPS), amount of IOPS
provisioned (if any), and the number of prior scale storage
operations. Typical migration times are under 24 hours, but the
process can take up to several days in some cases. During the
migration, the DB instance is available for use, but might experience
performance degradation. While the migration takes place, nightly
backups for the instance are suspended. No other Amazon RDS operations
can take place for the instance, including modifying the instance,
rebooting the instance, deleting the instance, creating a Read Replica
for the instance, and creating a DB snapshot of the instance.
Constraints: For MariaDB, MySQL, Oracle, and PostgreSQL, the value
supplied must be at least 10% greater than the current value. Values
that are not at least 10% greater than the existing value are rounded
up so that they are 10% greater than the current value.
Default: Uses existing setting
@option options [String] :option_group_name
Indicates that the DB instance should be associated with the specified
option group. Changing this parameter doesn't result in an outage
except in the following case and the change is applied during the next
maintenance window unless the `ApplyImmediately` parameter is set to
`true` for this request. If the parameter change results in an option
group that enables OEM, this change can cause a brief (sub-second)
period during which new connections are rejected but existing
connections are not interrupted.
Permanent options, such as the TDE option for Oracle Advanced Security
TDE, can't be removed from an option group, and that option group
can't be removed from a DB instance once it is associated with a DB
instance
@option options [String] :new_db_instance_identifier
The new DB instance identifier for the DB instance when renaming a DB
instance. When you change the DB instance identifier, an instance
reboot will occur immediately if you set `Apply Immediately` to true,
or will occur during the next maintenance window if `Apply
Immediately` to false. This value is stored as a lowercase string.
Constraints:
* Must contain from 1 to 63 letters, numbers, or hyphens.
* The first character must be a letter.
* Can't end with a hyphen or contain two consecutive hyphens.
Example: `mydbinstance`
@option options [String] :storage_type
Specifies the storage type to be associated with the DB instance.
If you specify Provisioned IOPS (`io1`), you must also include a value
for the `Iops` parameter.
If you choose to migrate your DB instance from using standard storage
to using Provisioned IOPS, or from using Provisioned IOPS to using
standard storage, the process can take time. The duration of the
migration depends on several factors such as database load, storage
size, storage type (standard or Provisioned IOPS), amount of IOPS
provisioned (if any), and the number of prior scale storage
operations. Typical migration times are under 24 hours, but the
process can take up to several days in some cases. During the
migration, the DB instance is available for use, but might experience
performance degradation. While the migration takes place, nightly
backups for the instance are suspended. No other Amazon RDS operations
can take place for the instance, including modifying the instance,
rebooting the instance, deleting the instance, creating a Read Replica
for the instance, and creating a DB snapshot of the instance.
Valid values: `standard | gp2 | io1`
Default: `io1` if the `Iops` parameter is specified, otherwise
`standard`
@option options [String] :tde_credential_arn
The ARN from the key store with which to associate the instance for
TDE encryption.
@option options [String] :tde_credential_password
The password for the given ARN from the key store in order to access
the device.
@option options [String] :ca_certificate_identifier
Indicates the certificate that needs to be associated with the
instance.
@option options [String] :domain
The Active Directory Domain to move the instance to. Specify `none` to
remove the instance from its current domain. The domain must be
created prior to this operation. Currently only a Microsoft SQL Server
instance can be created in a Active Directory Domain.
@option options [Boolean] :copy_tags_to_snapshot
True to copy all tags from the DB instance to snapshots of the DB
instance, and otherwise false. The default is false.
**Amazon Aurora**
Not applicable. Copying tags to snapshots is managed by the DB
cluster. Setting this value for an Aurora DB instance has no effect on
the DB cluster setting. For more information, see ModifyDBCluster.
@option options [Integer] :monitoring_interval
The interval, in seconds, between points when Enhanced Monitoring
metrics are collected for the DB instance. To disable collecting
Enhanced Monitoring metrics, specify 0. The default is 0.
If `MonitoringRoleArn` is specified, then you must also set
`MonitoringInterval` to a value other than 0.
Valid Values: `0, 1, 5, 10, 15, 30, 60`
@option options [Integer] :db_port_number
The port number on which the database accepts connections.
The value of the `DBPortNumber` parameter must not match any of the
port values specified for options in the option group for the DB
instance.
Your database will restart when you change the `DBPortNumber` value
regardless of the value of the `ApplyImmediately` parameter.
**MySQL**
Default: `3306`
Valid Values: `1150-65535`
**MariaDB**
Default: `3306`
Valid Values: `1150-65535`
**PostgreSQL**
Default: `5432`
Valid Values: `1150-65535`
Type: Integer
**Oracle**
Default: `1521`
Valid Values: `1150-65535`
**SQL Server**
Default: `1433`
Valid Values: `1150-65535` except for `1434`, `3389`, `47001`,
`49152`, and `49152` through `49156`.
**Amazon Aurora**
Default: `3306`
Valid Values: `1150-65535`
@option options [Boolean] :publicly_accessible
Boolean value that indicates if the DB instance has a publicly
resolvable DNS name. Set to `True` to make the DB instance
Internet-facing with a publicly resolvable DNS name, which resolves to
a public IP address. Set to `False` to make the DB instance internal
with a DNS name that resolves to a private IP address.
`PubliclyAccessible` only applies to DB instances in a VPC. The DB
instance must be part of a public subnet and `PubliclyAccessible` must
be true in order for it to be publicly accessible.
Changes to the `PubliclyAccessible` parameter are applied immediately
regardless of the value of the `ApplyImmediately` parameter.
Default: false
@option options [String] :monitoring_role_arn
The ARN for the IAM role that permits RDS to send enhanced monitoring
metrics to Amazon CloudWatch Logs. For example,
`arn:aws:iam:123456789012:role/emaccess`. For information on creating
a monitoring role, go to [To create an IAM role for Amazon RDS
Enhanced Monitoring][1] in the *Amazon RDS User Guide.*
If `MonitoringInterval` is set to a value other than 0, then you must
supply a `MonitoringRoleArn` value.
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html#USER_Monitoring.OS.IAMRole
@option options [String] :domain_iam_role_name
The name of the IAM role to use when making API calls to the Directory
Service.
@option options [Integer] :promotion_tier
A value that specifies the order in which an Aurora Replica is
promoted to the primary instance after a failure of the existing
primary instance. For more information, see [ Fault Tolerance for an
Aurora DB Cluster][1] in the *Amazon Aurora User Guide*.
Default: 1
Valid Values: 0 - 15
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Managing.Backups.html#Aurora.Managing.FaultTolerance
@option options [Boolean] :enable_iam_database_authentication
True to enable mapping of AWS Identity and Access Management (IAM)
accounts to database accounts, and otherwise false.
You can enable IAM database authentication for the following database
engines
**Amazon Aurora**
Not applicable. Mapping AWS IAM accounts to database accounts is
managed by the DB cluster. For more information, see ModifyDBCluster.
**MySQL**
* For MySQL 5.6, minor version 5.6.34 or higher
* For MySQL 5.7, minor version 5.7.16 or higher
Default: `false`
@option options [Boolean] :enable_performance_insights
True to enable Performance Insights for the DB instance, and otherwise
false.
For more information, see [Using Amazon Performance Insights][1] in
the *Amazon Relational Database Service User Guide*.
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html
@option options [String] :performance_insights_kms_key_id
The AWS KMS key identifier for encryption of Performance Insights
data. The KMS key ID is the Amazon Resource Name (ARN), KMS key
identifier, or the KMS key alias for the KMS encryption key.
@option options [Integer] :performance_insights_retention_period
The amount of time, in days, to retain Performance Insights data.
Valid values are 7 or 731 (2 years).
@option options [Types::CloudwatchLogsExportConfiguration] :cloudwatch_logs_export_configuration
The configuration setting for the log types to be enabled for export
to CloudWatch Logs for a specific DB instance.
A change to the `CloudwatchLogsExportConfiguration` parameter is
always applied to the DB instance immediately. Therefore, the
`ApplyImmediately` parameter has no effect.
@option options [Array<Types::ProcessorFeature>] :processor_features
The number of CPU cores and the number of threads per core for the DB
instance class of the DB instance.
@option options [Boolean] :use_default_processor_features
A value that specifies that the DB instance class of the DB instance
uses its default processor features.
@option options [Boolean] :deletion_protection
Indicates if the DB instance has deletion protection enabled. The
database can't be deleted when this value is set to true. For more
information, see [ Deleting a DB Instance][1].
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html
@return [DBInstance] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb#L2410-L2418 | train | Modify the DB Instance | [
30522,
13366,
19933,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
16962,
1035,
6013,
1035,
8909,
4765,
18095,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
19933,
1035,
16962,
1035,
6013,
1006,
704... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/import/properties_controller.rb | Pwb.Import::PropertiesController.retrieve_from_pwb | def retrieve_from_pwb
imported_properties = Pwb::ImportProperties.new(params[:file]).import_csv
render json: {
retrieved_items: imported_properties
}
# return render json: { "success": true }, status: :ok, head: :no_content
end | ruby | def retrieve_from_pwb
imported_properties = Pwb::ImportProperties.new(params[:file]).import_csv
render json: {
retrieved_items: imported_properties
}
# return render json: { "success": true }, status: :ok, head: :no_content
end | [
"def",
"retrieve_from_pwb",
"imported_properties",
"=",
"Pwb",
"::",
"ImportProperties",
".",
"new",
"(",
"params",
"[",
":file",
"]",
")",
".",
"import_csv",
"render",
"json",
":",
"{",
"retrieved_items",
":",
"imported_properties",
"}",
"# return render json: { \"... | http://localhost:3000/import/Properties/retrieve_from_pwb | [
"http",
":",
"//",
"localhost",
":",
"3000",
"/",
"import",
"/",
"Properties",
"/",
"retrieve_from_pwb"
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/controllers/pwb/import/properties_controller.rb#L4-L10 | train | retrieve from pwb
| [
30522,
13366,
12850,
1035,
2013,
1035,
1052,
2860,
2497,
10964,
1035,
5144,
1027,
1052,
2860,
2497,
1024,
1024,
12324,
21572,
4842,
7368,
1012,
2047,
1006,
11498,
5244,
1031,
1024,
5371,
1033,
1007,
1012,
12324,
1035,
20116,
2615,
17552,
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... |
decidim/decidim | decidim-core/app/models/decidim/scope.rb | Decidim.Scope.part_of_scopes | def part_of_scopes(root = nil)
scope_ids = part_of
scope_ids.select! { |id| id == root.id || !root.part_of.member?(id) } if root
organization.scopes.where(id: scope_ids).sort { |s1, s2| part_of.index(s2.id) <=> part_of.index(s1.id) }
end | ruby | def part_of_scopes(root = nil)
scope_ids = part_of
scope_ids.select! { |id| id == root.id || !root.part_of.member?(id) } if root
organization.scopes.where(id: scope_ids).sort { |s1, s2| part_of.index(s2.id) <=> part_of.index(s1.id) }
end | [
"def",
"part_of_scopes",
"(",
"root",
"=",
"nil",
")",
"scope_ids",
"=",
"part_of",
"scope_ids",
".",
"select!",
"{",
"|",
"id",
"|",
"id",
"==",
"root",
".",
"id",
"||",
"!",
"root",
".",
"part_of",
".",
"member?",
"(",
"id",
")",
"}",
"if",
"root... | Gets the scopes from the part_of list in descending order (first the top level scope, last itself)
root - The root scope to start retrieval. If present, ignores top level scopes until reaching the root scope.
Returns an array of Scope objects | [
"Gets",
"the",
"scopes",
"from",
"the",
"part_of",
"list",
"in",
"descending",
"order",
"(",
"first",
"the",
"top",
"level",
"scope",
"last",
"itself",
")"
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/models/decidim/scope.rb#L66-L70 | train | Returns the part_of scopes for the current organization | [
30522,
13366,
2112,
1035,
1997,
1035,
9531,
2015,
1006,
7117,
1027,
9152,
2140,
1007,
9531,
1035,
8909,
2015,
1027,
2112,
1035,
1997,
9531,
1035,
8909,
2015,
1012,
7276,
999,
1063,
1064,
8909,
1064,
8909,
1027,
1027,
7117,
1012,
8909,
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... |
meew0/discordrb | lib/discordrb/await.rb | Discordrb.Await.match | def match(event)
dummy_handler = EventContainer.handler_class(@type).new(@attributes, @bot)
return [nil, nil] unless event.instance_of?(@type) && dummy_handler.matches?(event)
should_delete = nil
should_delete = true if (@block && @block.call(event) != false) || !@block
[@key, should_delete]
end | ruby | def match(event)
dummy_handler = EventContainer.handler_class(@type).new(@attributes, @bot)
return [nil, nil] unless event.instance_of?(@type) && dummy_handler.matches?(event)
should_delete = nil
should_delete = true if (@block && @block.call(event) != false) || !@block
[@key, should_delete]
end | [
"def",
"match",
"(",
"event",
")",
"dummy_handler",
"=",
"EventContainer",
".",
"handler_class",
"(",
"@type",
")",
".",
"new",
"(",
"@attributes",
",",
"@bot",
")",
"return",
"[",
"nil",
",",
"nil",
"]",
"unless",
"event",
".",
"instance_of?",
"(",
"@ty... | Makes a new await. For internal use only.
@!visibility private
Checks whether the await can be triggered by the given event, and if it can, execute the block
and return its result along with this await's key.
@param event [Event] An event to check for.
@return [Array] This await's key and whether or not it should be deleted. If there was no match, both are nil. | [
"Makes",
"a",
"new",
"await",
".",
"For",
"internal",
"use",
"only",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/await.rb#L42-L50 | train | Returns the key and value for the event. | [
30522,
13366,
2674,
1006,
2724,
1007,
24369,
1035,
28213,
1027,
2724,
8663,
18249,
2121,
1012,
28213,
1035,
2465,
1006,
1030,
2828,
1007,
1012,
2047,
1006,
1030,
12332,
1010,
1030,
28516,
1007,
2709,
1031,
9152,
2140,
1010,
9152,
2140,
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_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb | Azure::Batch::Mgmt::V2017_09_01.PoolOperations.create_async | def create_async(resource_group_name, account_name, pool_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
# Send request
promise = begin_create_async(resource_group_name, account_name, pool_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Batch::Mgmt::V2017_09_01::Models::Pool.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def create_async(resource_group_name, account_name, pool_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
# Send request
promise = begin_create_async(resource_group_name, account_name, pool_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Batch::Mgmt::V2017_09_01::Models::Pool.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"create_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"parameters",
",",
"if_match",
":",
"nil",
",",
"if_none_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_asyn... | @param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param pool_name [String] The pool name. This must be unique within the
account.
@param parameters [Pool] Additional parameters for pool creation.
@param if_match [String] The entity state (ETag) version of the pool to
update. A value of "*" can be used to apply the operation only if the pool
already exists. If omitted, this operation will always be applied.
@param if_none_match [String] Set to '*' to allow a new pool to be created,
but to prevent updating an existing pool. Other values will be ignored.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"resource",
"group",
"that",
"contains",
"the",
"Batch",
"account",
".",
"@param",
"account_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"Batch",
"account",
".",
"@par... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb#L221-L237 | train | Creates a pool. | [
30522,
13366,
3443,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4770,
1035,
2171,
1010,
11709,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
2065,
1035,
3904,
1035,
2674,
1024,
9152,
2140,
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... |
refinery/refinerycms | pages/app/models/refinery/page.rb | Refinery.Page.reposition_parts! | def reposition_parts!
reload.parts.each_with_index do |part, index|
part.update_columns position: index
end
end | ruby | def reposition_parts!
reload.parts.each_with_index do |part, index|
part.update_columns position: index
end
end | [
"def",
"reposition_parts!",
"reload",
".",
"parts",
".",
"each_with_index",
"do",
"|",
"part",
",",
"index",
"|",
"part",
".",
"update_columns",
"position",
":",
"index",
"end",
"end"
] | Repositions the child page_parts that belong to this page.
This ensures that they are in the correct 0,1,2,3,4... etc order. | [
"Repositions",
"the",
"child",
"page_parts",
"that",
"belong",
"to",
"this",
"page",
".",
"This",
"ensures",
"that",
"they",
"are",
"in",
"the",
"correct",
"0",
"1",
"2",
"3",
"4",
"...",
"etc",
"order",
"."
] | 67f117f937c5264ec0aeabe8e7eac1d562c5bc7b | https://github.com/refinery/refinerycms/blob/67f117f937c5264ec0aeabe8e7eac1d562c5bc7b/pages/app/models/refinery/page.rb#L190-L194 | train | reposition the parts | [
30522,
13366,
16360,
19234,
1035,
3033,
999,
2128,
11066,
1012,
3033,
1012,
2169,
1035,
2007,
1035,
5950,
2079,
1064,
2112,
1010,
5950,
1064,
2112,
1012,
10651,
1035,
7753,
2597,
1024,
5950,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb | Azure::CognitiveServices::ComputerVision::V2_0.ComputerVisionClient.tag_image_in_stream_with_http_info | def tag_image_in_stream_with_http_info(image, language:nil, custom_headers:nil)
tag_image_in_stream_async(image, language:language, custom_headers:custom_headers).value!
end | ruby | def tag_image_in_stream_with_http_info(image, language:nil, custom_headers:nil)
tag_image_in_stream_async(image, language:language, custom_headers:custom_headers).value!
end | [
"def",
"tag_image_in_stream_with_http_info",
"(",
"image",
",",
"language",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"tag_image_in_stream_async",
"(",
"image",
",",
"language",
":",
"language",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",... | This operation generates a list of words, or tags, that are relevant to the
content of the supplied image. The Computer Vision API can return tags based
on objects, living beings, scenery or actions found in images. Unlike
categories, tags are not organized according to a hierarchical classification
system, but correspond to image content. Tags may contain hints to avoid
ambiguity or provide context, for example the tag "cello" may be accompanied
by the hint "musical instrument". All tags are in English.
Two input methods are supported -- (1) Uploading an image or (2) specifying
an image URL.
A successful response will be returned in JSON. If the request failed, the
response will contain an error code and a message to help understand what
went wrong.
@param image An image stream.
@param language [Enum] The desired language for output generation. If this
parameter is not specified, the default value is "en".Supported
languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es',
'ja', 'pt', 'zh'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"This",
"operation",
"generates",
"a",
"list",
"of",
"words",
"or",
"tags",
"that",
"are",
"relevant",
"to",
"the",
"content",
"of",
"the",
"supplied",
"image",
".",
"The",
"Computer",
"Vision",
"API",
"can",
"return",
"tags",
"based",
"on",
"objects",
"li... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb#L2867-L2869 | train | Tags an image in an image stream. | [
30522,
13366,
6415,
1035,
3746,
1035,
30524,
2653,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
twitter/secure_headers | lib/secure_headers/headers/content_security_policy.rb | SecureHeaders.ContentSecurityPolicy.build_value | def build_value
directives.map do |directive_name|
case DIRECTIVE_VALUE_TYPES[directive_name]
when :source_list, :require_sri_for_list # require_sri is a simple set of strings that don't need to deal with symbol casing
build_source_list_directive(directive_name)
when :boolean
symbol_to_hyphen_case(directive_name) if @config.directive_value(directive_name)
when :sandbox_list
build_sandbox_list_directive(directive_name)
when :media_type_list
build_media_type_list_directive(directive_name)
end
end.compact.join("; ")
end | ruby | def build_value
directives.map do |directive_name|
case DIRECTIVE_VALUE_TYPES[directive_name]
when :source_list, :require_sri_for_list # require_sri is a simple set of strings that don't need to deal with symbol casing
build_source_list_directive(directive_name)
when :boolean
symbol_to_hyphen_case(directive_name) if @config.directive_value(directive_name)
when :sandbox_list
build_sandbox_list_directive(directive_name)
when :media_type_list
build_media_type_list_directive(directive_name)
end
end.compact.join("; ")
end | [
"def",
"build_value",
"directives",
".",
"map",
"do",
"|",
"directive_name",
"|",
"case",
"DIRECTIVE_VALUE_TYPES",
"[",
"directive_name",
"]",
"when",
":source_list",
",",
":require_sri_for_list",
"# require_sri is a simple set of strings that don't need to deal with symbol casin... | Private: converts the config object into a string representing a policy.
Places default-src at the first directive and report-uri as the last. All
others are presented in alphabetical order.
Returns a content security policy header value. | [
"Private",
":",
"converts",
"the",
"config",
"object",
"into",
"a",
"string",
"representing",
"a",
"policy",
".",
"Places",
"default",
"-",
"src",
"at",
"the",
"first",
"directive",
"and",
"report",
"-",
"uri",
"as",
"the",
"last",
".",
"All",
"others",
... | 543e6712aadae08f1653ed973e6b6204f7eac26a | https://github.com/twitter/secure_headers/blob/543e6712aadae08f1653ed973e6b6204f7eac26a/lib/secure_headers/headers/content_security_policy.rb#L51-L64 | train | Build the value of the directive | [
30522,
13366,
3857,
1035,
3643,
16449,
2015,
1012,
4949,
2079,
1064,
16449,
1035,
2171,
1064,
2553,
16449,
1035,
3643,
1035,
4127,
1031,
16449,
1035,
2171,
1033,
2043,
1024,
3120,
1035,
2862,
1010,
1024,
5478,
1035,
5185,
1035,
2005,
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... |
tongueroo/ufo | lib/ufo/stack.rb | Ufo.Stack.template_body | def template_body
custom_template = "#{Ufo.root}/.ufo/settings/cfn/stack.yml"
path = if File.exist?(custom_template)
custom_template
else
# built-in default
File.expand_path("../cfn/stack.yml", File.dirname(__FILE__))
end
RenderMePretty.result(path, context: context.scope)
end | ruby | def template_body
custom_template = "#{Ufo.root}/.ufo/settings/cfn/stack.yml"
path = if File.exist?(custom_template)
custom_template
else
# built-in default
File.expand_path("../cfn/stack.yml", File.dirname(__FILE__))
end
RenderMePretty.result(path, context: context.scope)
end | [
"def",
"template_body",
"custom_template",
"=",
"\"#{Ufo.root}/.ufo/settings/cfn/stack.yml\"",
"path",
"=",
"if",
"File",
".",
"exist?",
"(",
"custom_template",
")",
"custom_template",
"else",
"# built-in default",
"File",
".",
"expand_path",
"(",
"\"../cfn/stack.yml\"",
... | do not memoize template_body it can change for a rename retry | [
"do",
"not",
"memoize",
"template_body",
"it",
"can",
"change",
"for",
"a",
"rename",
"retry"
] | 16ac3dad28edcab2693c0e7d89a1971aca65b8f9 | https://github.com/tongueroo/ufo/blob/16ac3dad28edcab2693c0e7d89a1971aca65b8f9/lib/ufo/stack.rb#L73-L82 | train | Returns the body of the template | [
30522,
13366,
23561,
1035,
2303,
7661,
1035,
23561,
1027,
1000,
1001,
1063,
24321,
1012,
7117,
1065,
1013,
1012,
24321,
1013,
10906,
1013,
12935,
2078,
1013,
9991,
1012,
1061,
19968,
1000,
4130,
1027,
2065,
5371,
1012,
4839,
1029,
1006,
766... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2019_03_01.VirtualMachineScaleSets.begin_reimage_with_http_info | def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_input, custom_headers:custom_headers).value!
end | ruby | def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_input, custom_headers:custom_headers).value!
end | [
"def",
"begin_reimage_with_http_info",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_scale_set_reimage_input",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"begin_reimage_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_scale_se... | Reimages (upgrade the operating system) one or more virtual machines in a VM
scale set which don't have a ephemeral OS disk, for virtual machines who have
a ephemeral OS disk the virtual machine is reset to initial state.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
Parameters for Reimaging VM ScaleSet.
@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. | [
"Reimages",
"(",
"upgrade",
"the",
"operating",
"system",
")",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"which",
"don",
"t",
"have",
"a",
"ephemeral",
"OS",
"disk",
"for",
"virtual",
"machines",
"who",
"have",
"a",
"ep... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L2471-L2473 | train | Reimage a virtual machine in a VM scale set. | [
30522,
13366,
4088,
1035,
24964,
26860,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
30524,
2015,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/managers.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Managers.delete_extended_info | def delete_extended_info(resource_group_name, manager_name, custom_headers:nil)
response = delete_extended_info_async(resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete_extended_info(resource_group_name, manager_name, custom_headers:nil)
response = delete_extended_info_async(resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete_extended_info",
"(",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_extended_info_async",
"(",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"v... | Deletes the extended info of the manager.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"extended",
"info",
"of",
"the",
"manager",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/managers.rb#L993-L996 | train | Deletes the extended information of the specified managed volume. | [
30522,
13366,
3972,
12870,
1035,
3668,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
3668,
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/filters.rb | Jekyll.Filters.parse_condition | def parse_condition(exp)
parser = Liquid::Parser.new(exp)
condition = parse_binary_comparison(parser)
parser.consume(:end_of_string)
condition
end | ruby | def parse_condition(exp)
parser = Liquid::Parser.new(exp)
condition = parse_binary_comparison(parser)
parser.consume(:end_of_string)
condition
end | [
"def",
"parse_condition",
"(",
"exp",
")",
"parser",
"=",
"Liquid",
"::",
"Parser",
".",
"new",
"(",
"exp",
")",
"condition",
"=",
"parse_binary_comparison",
"(",
"parser",
")",
"parser",
".",
"consume",
"(",
":end_of_string",
")",
"condition",
"end"
] | ----------- The following set of code was *adapted* from Liquid::If
----------- ref: https://git.io/vp6K6
Parse a string to a Liquid Condition | [
"-----------",
"The",
"following",
"set",
"of",
"code",
"was",
"*",
"adapted",
"*",
"from",
"Liquid",
"::",
"If",
"-----------",
"ref",
":",
"https",
":",
"//",
"git",
".",
"io",
"/",
"vp6K6",
"Parse",
"a",
"string",
"to",
"a",
"Liquid",
"Condition"
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/filters.rb#L394-L400 | train | Parse the condition | [
30522,
13366,
11968,
3366,
1035,
4650,
1006,
4654,
2361,
1007,
11968,
8043,
1027,
6381,
1024,
1024,
11968,
8043,
1012,
2047,
1006,
4654,
2361,
1007,
4650,
1027,
11968,
3366,
1035,
12441,
1035,
7831,
1006,
11968,
8043,
1007,
11968,
8043,
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... |
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_composite_entity | def add_composite_entity(app_id, version_id, composite_model_create_object, custom_headers:nil)
response = add_composite_entity_async(app_id, version_id, composite_model_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def add_composite_entity(app_id, version_id, composite_model_create_object, custom_headers:nil)
response = add_composite_entity_async(app_id, version_id, composite_model_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"add_composite_entity",
"(",
"app_id",
",",
"version_id",
",",
"composite_model_create_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"add_composite_entity_async",
"(",
"app_id",
",",
"version_id",
",",
"composite_model_create_object",
",",
"cu... | Adds a composite entity extractor to a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param composite_model_create_object [CompositeEntityModel] 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",
"composite",
"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#L738-L741 | train | Adds a composite entity to a version of the application. | [
30522,
13366,
5587,
1035,
12490,
1035,
9178,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
12490,
1035,
2944,
1035,
3443,
1035,
4874,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
5587,
1035,
12490,
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... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_regex_entity_role | def delete_regex_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = delete_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_regex_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = delete_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_regex_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_regex_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",... | Delete a role for a given regular expression in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity ID.
@param role_id The entity role Id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatus] operation results. | [
"Delete",
"a",
"role",
"for",
"a",
"given",
"regular",
"expression",
"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#L9932-L9935 | train | Deletes a regex entity role. | [
30522,
13366,
3972,
12870,
1035,
19723,
10288,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.begin_check_connectivity_with_http_info | def begin_check_connectivity_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
begin_check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_check_connectivity_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
begin_check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_check_connectivity_with_http_info",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_check_connectivity_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
... | Verifies the possibility of establishing a direct TCP connection from a
virtual machine to a given endpoint including another VM or an arbitrary
remote server.
@param resource_group_name [String] The name of the network watcher resource
group.
@param network_watcher_name [String] The name of the network watcher
resource.
@param parameters [ConnectivityParameters] Parameters that determine how the
connectivity check will be performed.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Verifies",
"the",
"possibility",
"of",
"establishing",
"a",
"direct",
"TCP",
"connection",
"from",
"a",
"virtual",
"machine",
"to",
"a",
"given",
"endpoint",
"including",
"another",
"VM",
"or",
"an",
"arbitrary",
"remote",
"server",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L2147-L2149 | train | Checks connectivity of the specified virtual network. | [
30522,
13366,
4088,
1035,
4638,
1035,
20831,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_user.rb | Azure::ApiManagement::Mgmt::V2018_01_01.NotificationRecipientUser.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, service_name, notification_name, uid, custom_headers:nil)
create_or_update_async(resource_group_name, service_name, notification_name, uid, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, service_name, notification_name, uid, custom_headers:nil)
create_or_update_async(resource_group_name, service_name, notification_name, uid, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",",
"uid",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"notification_name",
",... | Adds the API Management User to the list of Recipients for the Notification.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param notification_name [NotificationName] Notification Name Identifier.
Possible values include: 'RequestPublisherNotificationMessage',
'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage',
'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher',
'QuotaLimitApproachingPublisherNotificationMessage'
@param uid [String] User identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Adds",
"the",
"API",
"Management",
"User",
"to",
"the",
"list",
"of",
"Recipients",
"for",
"the",
"Notification",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_user.rb#L292-L294 | train | Creates or updates a notification. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
26828,
1035,
2171,
1010,
21318,
2094,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/security_group.rb | Aws::EC2.SecurityGroup.authorize_ingress | def authorize_ingress(options = {})
options = options.merge(group_id: @id)
resp = @client.authorize_security_group_ingress(options)
resp.data
end | ruby | def authorize_ingress(options = {})
options = options.merge(group_id: @id)
resp = @client.authorize_security_group_ingress(options)
resp.data
end | [
"def",
"authorize_ingress",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"group_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"authorize_security_group_ingress",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
security_group.authorize_ingress({
cidr_ip: "String",
from_port: 1,
group_name: "String",
ip_permissions: [
{
from_port: 1,
ip_protocol: "String",
ip_ranges: [
{
cidr_ip: "String",
description: "String",
},
],
ipv_6_ranges: [
{
cidr_ipv_6: "String",
description: "String",
},
],
prefix_list_ids: [
{
description: "String",
prefix_list_id: "String",
},
],
to_port: 1,
user_id_group_pairs: [
{
description: "String",
group_id: "String",
group_name: "String",
peering_status: "String",
user_id: "String",
vpc_id: "String",
vpc_peering_connection_id: "String",
},
],
},
],
ip_protocol: "String",
source_security_group_name: "String",
source_security_group_owner_id: "String",
to_port: 1,
dry_run: false,
})
@param [Hash] options ({})
@option options [String] :cidr_ip
The IPv4 address range, in CIDR format. You can't specify this
parameter when specifying a source security group. To specify an IPv6
address range, use a set of IP permissions.
Alternatively, use a set of IP permissions to specify multiple rules
and a description for the rule.
@option options [Integer] :from_port
The start of port range for the TCP and UDP protocols, or an ICMP type
number. For the ICMP type number, use `-1` to specify all types. If
you specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules
and a description for the rule.
@option options [String] :group_name
\[EC2-Classic, default VPC\] The name of the security group. You must
specify either the security group ID or the security group name in the
request.
@option options [Array<Types::IpPermission>] :ip_permissions
The sets of IP permissions.
@option options [String] :ip_protocol
The IP protocol name (`tcp`, `udp`, `icmp`) or number (see [Protocol
Numbers][1]). To specify `icmpv6`, use a set of IP permissions.
\[VPC only\] Use `-1` to specify all protocols. If you specify `-1` or
a protocol other than `tcp`, `udp`, or `icmp`, traffic on all ports is
allowed, regardless of any ports you specify.
Alternatively, use a set of IP permissions to specify multiple rules
and a description for the rule.
[1]: http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
@option options [String] :source_security_group_name
\[EC2-Classic, default VPC\] The name of the source security group.
You can't specify this parameter in combination with the following
parameters: the CIDR IP address range, the start of the port range,
the IP protocol, and the end of the port range. Creates rules that
grant full ICMP, UDP, and TCP access. To create a rule with a specific
IP protocol and port range, use a set of IP permissions instead. For
EC2-VPC, the source security group must be in the same VPC.
@option options [String] :source_security_group_owner_id
\[nondefault VPC\] The AWS account ID for the source security group,
if the source security group is in a different account. You can't
specify this parameter in combination with the following parameters:
the CIDR IP address range, the IP protocol, the start of the port
range, and the end of the port range. Creates rules that grant full
ICMP, UDP, and TCP access. To create a rule with a specific IP
protocol and port range, use a set of IP permissions instead.
@option options [Integer] :to_port
The end of port range for the TCP and UDP protocols, or an ICMP code
number. For the ICMP code number, use `-1` to specify all codes. If
you specify all ICMP types, you must specify all codes.
Alternatively, use a set of IP permissions to specify multiple rules
and a description for the rule.
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/security_group.rb#L398-L402 | train | Authorize ingress for security group | [
30522,
13366,
3166,
4697,
1035,
13749,
8303,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2177,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3166,
4697,
1035,
3036,
1035,
2177,
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_iot_central/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/apps.rb | Azure::IotCentral::Mgmt::V2017_07_01_privatepreview.Apps.check_name_availability | def check_name_availability(operation_inputs, custom_headers:nil)
response = check_name_availability_async(operation_inputs, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def check_name_availability(operation_inputs, custom_headers:nil)
response = check_name_availability_async(operation_inputs, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"check_name_availability",
"(",
"operation_inputs",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"check_name_availability_async",
"(",
"operation_inputs",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",... | Check if an IoT Central application name is available.
@param operation_inputs [OperationInputs] Set the name parameter in the
OperationInputs structure to the name of the IoT Central application to
check.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [AppNameAvailabilityInfo] operation results. | [
"Check",
"if",
"an",
"IoT",
"Central",
"application",
"name",
"is",
"available",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_central/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/apps.rb#L451-L454 | train | Check the name availability of the specified managed managed | [
30522,
13366,
4638,
1035,
2171,
1035,
11343,
1006,
3169,
1035,
20407,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4638,
1035,
2171,
1035,
11343,
1035,
2004,
6038,
2278,
1006,
3169,
1035,
20407,
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... |
grpc/grpc | src/ruby/lib/grpc/generic/client_stub.rb | GRPC.ClientStub.request_response | def request_response(method, req, marshal, unmarshal,
deadline: nil,
return_op: false,
parent: nil,
credentials: nil,
metadata: {})
c = new_active_call(method, marshal, unmarshal,
deadline: deadline,
parent: parent,
credentials: credentials)
interception_context = @interceptors.build_context
intercept_args = {
method: method,
request: req,
call: c.interceptable,
metadata: metadata
}
if return_op
# return the operation view of the active_call; define #execute as a
# new method for this instance that invokes #request_response.
c.merge_metadata_to_send(metadata)
op = c.operation
op.define_singleton_method(:execute) do
interception_context.intercept!(:request_response, intercept_args) do
c.request_response(req, metadata: metadata)
end
end
op
else
interception_context.intercept!(:request_response, intercept_args) do
c.request_response(req, metadata: metadata)
end
end
end | ruby | def request_response(method, req, marshal, unmarshal,
deadline: nil,
return_op: false,
parent: nil,
credentials: nil,
metadata: {})
c = new_active_call(method, marshal, unmarshal,
deadline: deadline,
parent: parent,
credentials: credentials)
interception_context = @interceptors.build_context
intercept_args = {
method: method,
request: req,
call: c.interceptable,
metadata: metadata
}
if return_op
# return the operation view of the active_call; define #execute as a
# new method for this instance that invokes #request_response.
c.merge_metadata_to_send(metadata)
op = c.operation
op.define_singleton_method(:execute) do
interception_context.intercept!(:request_response, intercept_args) do
c.request_response(req, metadata: metadata)
end
end
op
else
interception_context.intercept!(:request_response, intercept_args) do
c.request_response(req, metadata: metadata)
end
end
end | [
"def",
"request_response",
"(",
"method",
",",
"req",
",",
"marshal",
",",
"unmarshal",
",",
"deadline",
":",
"nil",
",",
"return_op",
":",
"false",
",",
"parent",
":",
"nil",
",",
"credentials",
":",
"nil",
",",
"metadata",
":",
"{",
"}",
")",
"c",
... | Creates a new ClientStub.
Minimally, a stub is created with the just the host of the gRPC service
it wishes to access, e.g.,
my_stub = ClientStub.new(example.host.com:50505,
:this_channel_is_insecure)
If a channel_override argument is passed, it will be used as the
underlying channel. Otherwise, the channel_args argument will be used
to construct a new underlying channel.
There are some specific keyword args that are not used to configure the
channel:
- :channel_override
when present, this must be a pre-created GRPC::Core::Channel. If it's
present the host and arbitrary keyword arg areignored, and the RPC
connection uses this channel.
- :timeout
when present, this is the default timeout used for calls
@param host [String] the host the stub connects to
@param creds [Core::ChannelCredentials|Symbol] the channel credentials, or
:this_channel_is_insecure, which explicitly indicates that the client
should be created with an insecure connection. Note: this argument is
ignored if the channel_override argument is provided.
@param channel_override [Core::Channel] a pre-created channel
@param timeout [Number] the default timeout to use in requests
@param propagate_mask [Number] A bitwise combination of flags in
GRPC::Core::PropagateMasks. Indicates how data should be propagated
from parent server calls to child client calls if this client is being
used within a gRPC server.
@param channel_args [Hash] the channel arguments. Note: this argument is
ignored if the channel_override argument is provided.
@param interceptors [Array<GRPC::ClientInterceptor>] An array of
GRPC::ClientInterceptor objects that will be used for
intercepting calls before they are executed
Interceptors are an EXPERIMENTAL API.
request_response sends a request to a GRPC server, and returns the
response.
== Flow Control ==
This is a blocking call.
* it does not return until a response is received.
* the requests is sent only when GRPC core's flow control allows it to
be sent.
== Errors ==
An RuntimeError is raised if
* the server responds with a non-OK status
* the deadline is exceeded
== Return Value ==
If return_op is false, the call returns the response
If return_op is true, the call returns an Operation, calling execute
on the Operation returns the response.
@param method [String] the RPC method to call on the GRPC server
@param req [Object] the request sent to the server
@param marshal [Function] f(obj)->string that marshals requests
@param unmarshal [Function] f(string)->obj that unmarshals responses
@param deadline [Time] (optional) the time the request should complete
@param return_op [true|false] return an Operation if true
@param parent [Core::Call] a prior call whose reserved metadata
will be propagated by this one.
@param credentials [Core::CallCredentials] credentials to use when making
the call
@param metadata [Hash] metadata to be sent to the server
@return [Object] the response received from the server | [
"Creates",
"a",
"new",
"ClientStub",
"."
] | f3937f0e55227a4ef3a23f895d3b204a947610f8 | https://github.com/grpc/grpc/blob/f3937f0e55227a4ef3a23f895d3b204a947610f8/src/ruby/lib/grpc/generic/client_stub.rb#L148-L181 | train | Creates a new active_call and returns a new active_call object. | [
30522,
13366,
5227,
1035,
3433,
1006,
4118,
1010,
2128,
4160,
1010,
8610,
1010,
4895,
7849,
7377,
2140,
1010,
15117,
1024,
9152,
2140,
1010,
2709,
1035,
6728,
1024,
6270,
1010,
6687,
1024,
9152,
2140,
1010,
22496,
1024,
9152,
2140,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/api/v1_employees_api.rb | SquareConnect.V1EmployeesApi.retrieve_employee | def retrieve_employee(employee_id, opts = {})
data, _status_code, _headers = retrieve_employee_with_http_info(employee_id, opts)
return data
end | ruby | def retrieve_employee(employee_id, opts = {})
data, _status_code, _headers = retrieve_employee_with_http_info(employee_id, opts)
return data
end | [
"def",
"retrieve_employee",
"(",
"employee_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"retrieve_employee_with_http_info",
"(",
"employee_id",
",",
"opts",
")",
"return",
"data",
"end"
] | RetrieveEmployee
Provides the details for a single employee.
@param employee_id The employee's ID.
@param [Hash] opts the optional parameters
@return [V1Employee] | [
"RetrieveEmployee",
"Provides",
"the",
"details",
"for",
"a",
"single",
"employee",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_employees_api.rb#L660-L663 | train | Retrieve a specific employee | [
30522,
13366,
12850,
1035,
7904,
1006,
7904,
1035,
8909,
1010,
23569,
2015,
1027,
30524,
7904,
1035,
8909,
1010,
23569,
2015,
1007,
2709,
2951,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/user.rb | Aws::IAM.User.create_policy | def create_policy(options = {})
options = options.merge(user_name: @name)
resp = @client.put_user_policy(options)
UserPolicy.new(
user_name: @name,
name: options[:policy_name],
client: @client
)
end | ruby | def create_policy(options = {})
options = options.merge(user_name: @name)
resp = @client.put_user_policy(options)
UserPolicy.new(
user_name: @name,
name: options[:policy_name],
client: @client
)
end | [
"def",
"create_policy",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"user_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"put_user_policy",
"(",
"options",
")",
"UserPolicy",
".",
"new",
"(",
"user_name",
":"... | @example Request syntax with placeholder values
userpolicy = user.create_policy({
policy_name: "policyNameType", # required
policy_document: "policyDocumentType", # required
})
@param [Hash] options ({})
@option options [required, String] :policy_name
The name of the policy document.
This parameter allows (through its [regex pattern][1]) a string of
characters consisting of upper and lowercase alphanumeric characters
with no spaces. You can also include any of the following characters:
\_+=,.@-
[1]: http://wikipedia.org/wiki/regex
@option options [required, String] :policy_document
The policy document.
The [regex pattern][1] used to validate this parameter is a string of
characters consisting of the following:
* Any printable ASCII character ranging from the space character
(\\u0020) through the end of the ASCII character range
* The printable characters in the Basic Latin and Latin-1 Supplement
character set (through \\u00FF)
* The special characters tab (\\u0009), line feed (\\u000A), and
carriage return (\\u000D)
[1]: http://wikipedia.org/wiki/regex
@return [UserPolicy] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/user.rb#L494-L502 | train | Create a policy | [
30522,
13366,
3443,
1035,
3343,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
5310,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
2404,
1035,
5310,
1035,
3343,
1006,
7047,
1007,
5310,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb | Azure::Batch::Mgmt::V2017_09_01.PoolOperations.begin_create | def begin_create(resource_group_name, account_name, pool_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
response = begin_create_async(resource_group_name, account_name, pool_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create(resource_group_name, account_name, pool_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
response = begin_create_async(resource_group_name, account_name, pool_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"parameters",
",",
"if_match",
":",
"nil",
",",
"if_none_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_async",
"(",
"resou... | Creates a new pool inside the specified account.
@param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param pool_name [String] The pool name. This must be unique within the
account.
@param parameters [Pool] Additional parameters for pool creation.
@param if_match [String] The entity state (ETag) version of the pool to
update. A value of "*" can be used to apply the operation only if the pool
already exists. If omitted, this operation will always be applied.
@param if_none_match [String] Set to '*' to allow a new pool to be created,
but to prevent updating an existing pool. Other values will be ignored.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Pool] operation results. | [
"Creates",
"a",
"new",
"pool",
"inside",
"the",
"specified",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb#L788-L791 | train | Creates a new virtual network pool. | [
30522,
13366,
4088,
1035,
3443,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4770,
1035,
2171,
1010,
11709,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
2065,
1035,
3904,
1035,
2674,
1024,
9152,
2140,
1010,
7661,
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_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb | Azure::Web::Mgmt::V2018_02_01.Recommendations.list_recommended_rules_for_web_app | def list_recommended_rules_for_web_app(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
first_page = list_recommended_rules_for_web_app_as_lazy(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_recommended_rules_for_web_app(resource_group_name, site_name, featured:nil, filter:nil, custom_headers:nil)
first_page = list_recommended_rules_for_web_app_as_lazy(resource_group_name, site_name, featured:featured, filter:filter, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_recommended_rules_for_web_app",
"(",
"resource_group_name",
",",
"site_name",
",",
"featured",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_recommended_rules_for_web_app_as_lazy",
"(",
"resource_gro... | Get all recommendations for an app.
Get all recommendations for an app.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Name of the app.
@param featured [Boolean] Specify <code>true</code> to return only the most
critical recommendations. The default is <code>false</code>, which returns
all recommendations.
@param filter [String] Return only channels specified in the filter. Filter
is specified by using OData syntax. Example: $filter=channel eq 'Api' or
channel eq 'Notification'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<Recommendation>] operation results. | [
"Get",
"all",
"recommendations",
"for",
"an",
"app",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb#L449-L452 | train | Gets the recommendations for the specified Web App. | [
30522,
13366,
2862,
1035,
6749,
1035,
3513,
1035,
2005,
1035,
4773,
1035,
10439,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
2956,
1024,
9152,
2140,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/subscription.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Subscription.regenerate_primary_key_with_http_info | def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid, custom_headers:nil)
regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value!
end | ruby | def regenerate_primary_key_with_http_info(resource_group_name, service_name, sid, custom_headers:nil)
regenerate_primary_key_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value!
end | [
"def",
"regenerate_primary_key_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"sid",
",",
"custom_headers",
":",
"nil",
")",
"regenerate_primary_key_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"sid",
",",
"custom_headers",
":custo... | Regenerates primary key of existing subscription of the API Management
service instance.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param sid [String] Subscription entity Identifier. The entity represents the
association between a user and a product in API Management.
@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. | [
"Regenerates",
"primary",
"key",
"of",
"existing",
"subscription",
"of",
"the",
"API",
"Management",
"service",
"instance",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/subscription.rb#L780-L782 | train | Regenerate the primary key of the specified managed product. | [
30522,
13366,
19723,
24454,
3686,
1035,
3078,
1035,
3145,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
15765,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
19723,
24454,
368... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
castwide/solargraph | lib/solargraph/range.rb | Solargraph.Range.contain? | def contain? position
position = Position.normalize(position)
return false if position.line < start.line || position.line > ending.line
return false if position.line == start.line && position.character < start.character
return false if position.line == ending.line && position.character > ending.character
true
end | ruby | def contain? position
position = Position.normalize(position)
return false if position.line < start.line || position.line > ending.line
return false if position.line == start.line && position.character < start.character
return false if position.line == ending.line && position.character > ending.character
true
end | [
"def",
"contain?",
"position",
"position",
"=",
"Position",
".",
"normalize",
"(",
"position",
")",
"return",
"false",
"if",
"position",
".",
"line",
"<",
"start",
".",
"line",
"||",
"position",
".",
"line",
">",
"ending",
".",
"line",
"return",
"false",
... | True if the specified position is inside the range.
@param position [Position, Array(Integer, Integer)]
@return [Boolean] | [
"True",
"if",
"the",
"specified",
"position",
"is",
"inside",
"the",
"range",
"."
] | 47badb5d151aca775ccbe6c470236089eae7839d | https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/range.rb#L33-L39 | train | Returns true if the position is in the current position sequence | [
30522,
13366,
5383,
1029,
2597,
2597,
1027,
2597,
1012,
3671,
4697,
1006,
2597,
1007,
2709,
6270,
2065,
2597,
1012,
2240,
1026,
2707,
1012,
2240,
1064,
1064,
2597,
1012,
2240,
1028,
4566,
1012,
2240,
2709,
6270,
2065,
2597,
1012,
2240,
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_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb | Azure::Locks::Mgmt::V2015_01_01.ManagementLocks.create_or_update_at_subscription_level | def create_or_update_at_subscription_level(lock_name, parameters, custom_headers:nil)
response = create_or_update_at_subscription_level_async(lock_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update_at_subscription_level(lock_name, parameters, custom_headers:nil)
response = create_or_update_at_subscription_level_async(lock_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update_at_subscription_level",
"(",
"lock_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_at_subscription_level_async",
"(",
"lock_name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",... | Create or update a management lock at the subscription level.
@param lock_name [String] The name of lock.
@param parameters [ManagementLockObject] The management lock parameters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ManagementLockObject] operation results. | [
"Create",
"or",
"update",
"a",
"management",
"lock",
"at",
"the",
"subscription",
"level",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb#L569-L572 | train | Creates or updates a lock at subscription level. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2012,
1035,
15002,
1035,
2504,
1006,
5843,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2030,
1035,
10651,
1035,
2012,
1035,
15002... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb | Azure::Web::Mgmt::V2018_02_01.Recommendations.get_rule_details_by_web_app | def get_rule_details_by_web_app(resource_group_name, site_name, name, update_seen:nil, recommendation_id:nil, custom_headers:nil)
response = get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen:update_seen, recommendation_id:recommendation_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_rule_details_by_web_app(resource_group_name, site_name, name, update_seen:nil, recommendation_id:nil, custom_headers:nil)
response = get_rule_details_by_web_app_async(resource_group_name, site_name, name, update_seen:update_seen, recommendation_id:recommendation_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_rule_details_by_web_app",
"(",
"resource_group_name",
",",
"site_name",
",",
"name",
",",
"update_seen",
":",
"nil",
",",
"recommendation_id",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_rule_details_by_web_app_async",
"(",
... | Get a recommendation rule for an app.
Get a recommendation rule for an app.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Name of the app.
@param name [String] Name of the recommendation.
@param update_seen [Boolean] Specify <code>true</code> to update the
last-seen timestamp of the recommendation object.
@param recommendation_id [String] The GUID of the recommedation object if you
query an expired one. You don't need to specify it to query an active entry.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RecommendationRule] operation results. | [
"Get",
"a",
"recommendation",
"rule",
"for",
"an",
"app",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb#L757-L760 | train | Gets the rule details for a given App Service Environment. | [
30522,
13366,
2131,
1035,
3627,
1035,
4751,
1035,
2011,
1035,
4773,
1035,
10439,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
2171,
1010,
10651,
1035,
2464,
1024,
9152,
2140,
1010,
12832,
1035,
8909,
1024,
9152,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.add_explicit_list_item_with_http_info | def add_explicit_list_item_with_http_info(app_id, version_id, entity_id, item, custom_headers:nil)
add_explicit_list_item_async(app_id, version_id, entity_id, item, custom_headers:custom_headers).value!
end | ruby | def add_explicit_list_item_with_http_info(app_id, version_id, entity_id, item, custom_headers:nil)
add_explicit_list_item_async(app_id, version_id, entity_id, item, custom_headers:custom_headers).value!
end | [
"def",
"add_explicit_list_item_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"item",
",",
"custom_headers",
":",
"nil",
")",
"add_explicit_list_item_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"item",
",",
"custom_hea... | Add a new exception to the explicit list for the Pattern.Any entity in a
version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The Pattern.Any entity extractor ID.
@param item [ExplicitListItemCreateObject] The new explicit list item.
@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",
"a",
"new",
"exception",
"to",
"the",
"explicit",
"list",
"for",
"the",
"Pattern",
".",
"Any",
"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#L8080-L8082 | train | Adds an explicit list item to the application version. | [
30522,
13366,
5587,
1035,
13216,
1035,
2862,
1035,
8875,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
8875,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
5587,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_scheduler/lib/2016-03-01/generated/azure_mgmt_scheduler/job_collections.rb | Azure::Scheduler::Mgmt::V2016_03_01.JobCollections.disable_async | def disable_async(resource_group_name, job_collection_name, custom_headers:nil)
# Send request
promise = begin_disable_async(resource_group_name, job_collection_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def disable_async(resource_group_name, job_collection_name, custom_headers:nil)
# Send request
promise = begin_disable_async(resource_group_name, job_collection_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"disable_async",
"(",
"resource_group_name",
",",
"job_collection_name",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_disable_async",
"(",
"resource_group_name",
",",
"job_collection_name",
",",
"custom_headers",
":custom_headers",... | @param resource_group_name [String] The resource group name.
@param job_collection_name [String] The job collection name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"The",
"resource",
"group",
"name",
".",
"@param",
"job_collection_name",
"[",
"String",
"]",
"The",
"job",
"collection",
"name",
".",
"@param",
"custom_headers",
"[",
"Hash",
"{",
"String",
"=",
">",
"Strin... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_scheduler/lib/2016-03-01/generated/azure_mgmt_scheduler/job_collections.rb#L608-L622 | train | Disables a job collection. | [
30522,
13366,
4487,
19150,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3105,
1035,
3074,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
4487,
19150,
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... |
boazsegev/combine_pdf | lib/combine_pdf/pdf_public.rb | CombinePDF.PDF.fonts | def fonts(limit_to_type0 = false)
fonts_array = []
pages.each do |pg|
if pg[:Resources][:Font]
pg[:Resources][:Font].values.each do |f|
f = f[:referenced_object] if f[:referenced_object]
if (limit_to_type0 || f[:Subtype] == :Type0) && f[:Type] == :Font && !fonts_array.include?(f)
fonts_array << f
end
end
end
end
fonts_array
end | ruby | def fonts(limit_to_type0 = false)
fonts_array = []
pages.each do |pg|
if pg[:Resources][:Font]
pg[:Resources][:Font].values.each do |f|
f = f[:referenced_object] if f[:referenced_object]
if (limit_to_type0 || f[:Subtype] == :Type0) && f[:Type] == :Font && !fonts_array.include?(f)
fonts_array << f
end
end
end
end
fonts_array
end | [
"def",
"fonts",
"(",
"limit_to_type0",
"=",
"false",
")",
"fonts_array",
"=",
"[",
"]",
"pages",
".",
"each",
"do",
"|",
"pg",
"|",
"if",
"pg",
"[",
":Resources",
"]",
"[",
":Font",
"]",
"pg",
"[",
":Resources",
"]",
"[",
":Font",
"]",
".",
"values... | returns an array with the different fonts used in the file.
Type0 font objects ( "font[:Subtype] == :Type0" ) can be registered with the font library
for use in PDFWriter objects (font numbering / table creation etc').
@param limit_to_type0 [true,false] limits the list to type0 fonts. | [
"returns",
"an",
"array",
"with",
"the",
"different",
"fonts",
"used",
"in",
"the",
"file",
"."
] | 09054051019c069f551f3e60be789577c0f93900 | https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/pdf_public.rb#L257-L270 | train | Returns an array of all the fonts in the page | [
30522,
13366,
15489,
2015,
1006,
5787,
1035,
2000,
1035,
2828,
2692,
1027,
6270,
1007,
15489,
2015,
1035,
9140,
1027,
1031,
1033,
5530,
1012,
2169,
2079,
1064,
18720,
1064,
2065,
18720,
1031,
1024,
4219,
1033,
1031,
1024,
15489,
1033,
18720... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/package.rb | Axlsx.Package.content_types | def content_types
c_types = base_content_types
workbook.drawings.each do |drawing|
c_types << Axlsx::Override.new(:PartName => "/xl/#{drawing.pn}",
:ContentType => DRAWING_CT)
end
workbook.charts.each do |chart|
c_types << Axlsx::Override.new(:PartName => "/xl/#{chart.pn}",
:ContentType => CHART_CT)
end
workbook.tables.each do |table|
c_types << Axlsx::Override.new(:PartName => "/xl/#{table.pn}",
:ContentType => TABLE_CT)
end
workbook.pivot_tables.each do |pivot_table|
c_types << Axlsx::Override.new(:PartName => "/xl/#{pivot_table.pn}",
:ContentType => PIVOT_TABLE_CT)
c_types << Axlsx::Override.new(:PartName => "/xl/#{pivot_table.cache_definition.pn}",
:ContentType => PIVOT_TABLE_CACHE_DEFINITION_CT)
end
workbook.comments.each do |comment|
if comment.size > 0
c_types << Axlsx::Override.new(:PartName => "/xl/#{comment.pn}",
:ContentType => COMMENT_CT)
end
end
if workbook.comments.size > 0
c_types << Axlsx::Default.new(:Extension => "vml", :ContentType => VML_DRAWING_CT)
end
workbook.worksheets.each do |sheet|
c_types << Axlsx::Override.new(:PartName => "/xl/#{sheet.pn}",
:ContentType => WORKSHEET_CT)
end
exts = workbook.images.map { |image| image.extname.downcase }
exts.uniq.each do |ext|
ct = if ['jpeg', 'jpg'].include?(ext)
JPEG_CT
elsif ext == 'gif'
GIF_CT
elsif ext == 'png'
PNG_CT
end
c_types << Axlsx::Default.new(:ContentType => ct, :Extension => ext )
end
if use_shared_strings
c_types << Axlsx::Override.new(:PartName => "/xl/#{SHARED_STRINGS_PN}",
:ContentType => SHARED_STRINGS_CT)
end
c_types
end | ruby | def content_types
c_types = base_content_types
workbook.drawings.each do |drawing|
c_types << Axlsx::Override.new(:PartName => "/xl/#{drawing.pn}",
:ContentType => DRAWING_CT)
end
workbook.charts.each do |chart|
c_types << Axlsx::Override.new(:PartName => "/xl/#{chart.pn}",
:ContentType => CHART_CT)
end
workbook.tables.each do |table|
c_types << Axlsx::Override.new(:PartName => "/xl/#{table.pn}",
:ContentType => TABLE_CT)
end
workbook.pivot_tables.each do |pivot_table|
c_types << Axlsx::Override.new(:PartName => "/xl/#{pivot_table.pn}",
:ContentType => PIVOT_TABLE_CT)
c_types << Axlsx::Override.new(:PartName => "/xl/#{pivot_table.cache_definition.pn}",
:ContentType => PIVOT_TABLE_CACHE_DEFINITION_CT)
end
workbook.comments.each do |comment|
if comment.size > 0
c_types << Axlsx::Override.new(:PartName => "/xl/#{comment.pn}",
:ContentType => COMMENT_CT)
end
end
if workbook.comments.size > 0
c_types << Axlsx::Default.new(:Extension => "vml", :ContentType => VML_DRAWING_CT)
end
workbook.worksheets.each do |sheet|
c_types << Axlsx::Override.new(:PartName => "/xl/#{sheet.pn}",
:ContentType => WORKSHEET_CT)
end
exts = workbook.images.map { |image| image.extname.downcase }
exts.uniq.each do |ext|
ct = if ['jpeg', 'jpg'].include?(ext)
JPEG_CT
elsif ext == 'gif'
GIF_CT
elsif ext == 'png'
PNG_CT
end
c_types << Axlsx::Default.new(:ContentType => ct, :Extension => ext )
end
if use_shared_strings
c_types << Axlsx::Override.new(:PartName => "/xl/#{SHARED_STRINGS_PN}",
:ContentType => SHARED_STRINGS_CT)
end
c_types
end | [
"def",
"content_types",
"c_types",
"=",
"base_content_types",
"workbook",
".",
"drawings",
".",
"each",
"do",
"|",
"drawing",
"|",
"c_types",
"<<",
"Axlsx",
"::",
"Override",
".",
"new",
"(",
":PartName",
"=>",
"\"/xl/#{drawing.pn}\"",
",",
":ContentType",
"=>",... | Appends override objects for drawings, charts, and sheets as they exist in your workbook to the default content types.
@return [ContentType]
@private | [
"Appends",
"override",
"objects",
"for",
"drawings",
"charts",
"and",
"sheets",
"as",
"they",
"exist",
"in",
"your",
"workbook",
"to",
"the",
"default",
"content",
"types",
"."
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/package.rb#L269-L324 | train | Returns an array of content types for this workbook | [
30522,
13366,
4180,
1035,
4127,
1039,
1035,
4127,
1027,
2918,
1035,
4180,
1035,
4127,
2147,
8654,
1012,
9254,
1012,
2169,
2079,
1064,
5059,
1064,
1039,
1035,
4127,
1026,
1026,
22260,
4877,
2595,
1024,
1024,
2058,
15637,
1012,
2047,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_consumption/lib/2018-01-31/generated/azure_mgmt_consumption/price_sheet.rb | Azure::Consumption::Mgmt::V2018_01_31.PriceSheet.get_by_billing_period | def get_by_billing_period(billing_period_name, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
response = get_by_billing_period_async(billing_period_name, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_billing_period(billing_period_name, expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
response = get_by_billing_period_async(billing_period_name, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_billing_period",
"(",
"billing_period_name",
",",
"expand",
":",
"nil",
",",
"skiptoken",
":",
"nil",
",",
"top",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_billing_period_async",
"(",
"billing_period_name",
",",
... | Get the price sheet for a scope by subscriptionId and billing period. Price
sheet is available via this API only for May 1, 2014 or later.
@param billing_period_name [String] Billing Period Name.
@param expand [String] May be used to expand the properties/meterDetails
within a price sheet. By default, these fields are not included when
returning price sheet.
@param skiptoken [String] Skiptoken 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 skiptoken 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 top N
results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PriceSheetResult] operation results. | [
"Get",
"the",
"price",
"sheet",
"for",
"a",
"scope",
"by",
"subscriptionId",
"and",
"billing",
"period",
".",
"Price",
"sheet",
"is",
"available",
"via",
"this",
"API",
"only",
"for",
"May",
"1",
"2014",
"or",
"later",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_consumption/lib/2018-01-31/generated/azure_mgmt_consumption/price_sheet.rb#L160-L163 | train | Gets the list of all the applications in a billing period. | [
30522,
13366,
2131,
1035,
2011,
1035,
25640,
1035,
2558,
1006,
25640,
1035,
2558,
1035,
2171,
1010,
7818,
1024,
9152,
2140,
1010,
13558,
18715,
2368,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | lib/linguist/blob_helper.rb | Linguist.BlobHelper._mime_type | def _mime_type
if defined? @_mime_type
@_mime_type
else
guesses = ::MIME::Types.type_for(extname.to_s)
# Prefer text mime types over binary
@_mime_type = guesses.detect { |type| type.ascii? } ||
# Otherwise use the first guess
guesses.first
end
end | ruby | def _mime_type
if defined? @_mime_type
@_mime_type
else
guesses = ::MIME::Types.type_for(extname.to_s)
# Prefer text mime types over binary
@_mime_type = guesses.detect { |type| type.ascii? } ||
# Otherwise use the first guess
guesses.first
end
end | [
"def",
"_mime_type",
"if",
"defined?",
"@_mime_type",
"@_mime_type",
"else",
"guesses",
"=",
"::",
"MIME",
"::",
"Types",
".",
"type_for",
"(",
"extname",
".",
"to_s",
")",
"# Prefer text mime types over binary",
"@_mime_type",
"=",
"guesses",
".",
"detect",
"{",
... | Internal: Lookup mime type for extension.
Returns a MIME::Type | [
"Internal",
":",
"Lookup",
"mime",
"type",
"for",
"extension",
"."
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/blob_helper.rb#L32-L43 | train | Returns the mime type of the file. | [
30522,
13366,
1035,
2771,
4168,
1035,
2828,
2065,
4225,
1029,
1030,
1035,
2771,
4168,
1035,
2828,
1030,
1035,
2771,
4168,
1035,
2828,
2842,
3984,
2229,
1027,
1024,
1024,
2771,
4168,
1024,
1024,
4127,
1012,
2828,
1035,
2005,
1006,
4654,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vault-ruby | lib/vault/api/approle.rb | Vault.AppRole.create_secret_id | def create_secret_id(role_name, options = {})
headers = extract_headers!(options)
if options[:secret_id]
json = client.post("/v1/auth/approle/role/#{encode_path(role_name)}/custom-secret-id", JSON.fast_generate(options), headers)
else
json = client.post("/v1/auth/approle/role/#{encode_path(role_name)}/secret-id", JSON.fast_generate(options), headers)
end
return Secret.decode(json)
end | ruby | def create_secret_id(role_name, options = {})
headers = extract_headers!(options)
if options[:secret_id]
json = client.post("/v1/auth/approle/role/#{encode_path(role_name)}/custom-secret-id", JSON.fast_generate(options), headers)
else
json = client.post("/v1/auth/approle/role/#{encode_path(role_name)}/secret-id", JSON.fast_generate(options), headers)
end
return Secret.decode(json)
end | [
"def",
"create_secret_id",
"(",
"role_name",
",",
"options",
"=",
"{",
"}",
")",
"headers",
"=",
"extract_headers!",
"(",
"options",
")",
"if",
"options",
"[",
":secret_id",
"]",
"json",
"=",
"client",
".",
"post",
"(",
"\"/v1/auth/approle/role/#{encode_path(rol... | Generates and issues a new SecretID on an existing AppRole.
@example Generate a new SecretID
result = Vault.approle.create_secret_id("testrole") #=> #<Vault::Secret lease_id="...">
result.data[:secret_id] #=> "841771dc-11c9-bbc7-bcac-6a3945a69cd9"
@example Assign a custom SecretID
result = Vault.approle.create_secret_id("testrole", {
secret_id: "testsecretid"
}) #=> #<Vault::Secret lease_id="...">
result.data[:secret_id] #=> "testsecretid"
@param [String] role_name
The name of the AppRole
@param [Hash] options
@option options [String] :secret_id
SecretID to be attached to the Role. If not set, then the new SecretID
will be generated
@option options [Hash<String, String>] :metadata
Metadata to be tied to the SecretID. This should be a JSON-formatted
string containing the metadata in key-value pairs. It will be set on
tokens issued with this SecretID, and is logged in audit logs in
plaintext.
@return [true] | [
"Generates",
"and",
"issues",
"a",
"new",
"SecretID",
"on",
"an",
"existing",
"AppRole",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/approle.rb#L160-L168 | train | Create a secret id for a role | [
30522,
13366,
3443,
1035,
3595,
1035,
8909,
1006,
2535,
1035,
2171,
1010,
7047,
1027,
1063,
1065,
1007,
20346,
2015,
1027,
14817,
1035,
20346,
2015,
999,
1006,
7047,
1007,
2065,
7047,
1031,
1024,
3595,
1035,
8909,
1033,
1046,
3385,
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... |
hashicorp/vault-ruby | lib/vault/api/auth.rb | Vault.Authenticate.aws_ec2 | def aws_ec2(role, pkcs7, nonce = nil, route = nil)
route ||= '/v1/auth/aws-ec2/login'
payload = { role: role, pkcs7: pkcs7 }
# Set a custom nonce if client is providing one
payload[:nonce] = nonce if nonce
json = client.post(route, JSON.fast_generate(payload))
secret = Secret.decode(json)
client.token = secret.auth.client_token
return secret
end | ruby | def aws_ec2(role, pkcs7, nonce = nil, route = nil)
route ||= '/v1/auth/aws-ec2/login'
payload = { role: role, pkcs7: pkcs7 }
# Set a custom nonce if client is providing one
payload[:nonce] = nonce if nonce
json = client.post(route, JSON.fast_generate(payload))
secret = Secret.decode(json)
client.token = secret.auth.client_token
return secret
end | [
"def",
"aws_ec2",
"(",
"role",
",",
"pkcs7",
",",
"nonce",
"=",
"nil",
",",
"route",
"=",
"nil",
")",
"route",
"||=",
"'/v1/auth/aws-ec2/login'",
"payload",
"=",
"{",
"role",
":",
"role",
",",
"pkcs7",
":",
"pkcs7",
"}",
"# Set a custom nonce if client is pr... | Authenticate via the AWS EC2 authentication method. If authentication is
successful, the resulting token will be stored on the client and used
for future requests.
@example
Vault.auth.aws_ec2("read-only", "pkcs7", "vault-nonce") #=> #<Vault::Secret lease_id="">
@param [String] role
@param [String] pkcs7
pkcs7 returned by the instance identity document (with line breaks removed)
@param [String] nonce optional
@param [String] route optional
@return [Secret] | [
"Authenticate",
"via",
"the",
"AWS",
"EC2",
"authentication",
"method",
".",
"If",
"authentication",
"is",
"successful",
"the",
"resulting",
"token",
"will",
"be",
"stored",
"on",
"the",
"client",
"and",
"used",
"for",
"future",
"requests",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/auth.rb#L180-L189 | train | Create a new instance of AWS EC2 | [
30522,
13366,
22091,
2015,
1035,
14925,
2475,
1006,
2535,
1010,
1052,
2243,
6169,
2581,
1010,
2512,
3401,
1027,
9152,
2140,
1010,
2799,
1027,
9152,
2140,
1007,
2799,
1064,
1064,
1027,
1005,
1013,
1058,
2487,
1013,
8740,
2705,
1013,
22091,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
CanCanCommunity/cancancan | lib/cancan/ability.rb | CanCan.Ability.can? | def can?(action, subject, attribute = nil, *extra_args)
match = extract_subjects(subject).lazy.map do |a_subject|
relevant_rules_for_match(action, a_subject).detect do |rule|
rule.matches_conditions?(action, a_subject, attribute, *extra_args) && rule.matches_attributes?(attribute)
end
end.reject(&:nil?).first
match ? match.base_behavior : false
end | ruby | def can?(action, subject, attribute = nil, *extra_args)
match = extract_subjects(subject).lazy.map do |a_subject|
relevant_rules_for_match(action, a_subject).detect do |rule|
rule.matches_conditions?(action, a_subject, attribute, *extra_args) && rule.matches_attributes?(attribute)
end
end.reject(&:nil?).first
match ? match.base_behavior : false
end | [
"def",
"can?",
"(",
"action",
",",
"subject",
",",
"attribute",
"=",
"nil",
",",
"*",
"extra_args",
")",
"match",
"=",
"extract_subjects",
"(",
"subject",
")",
".",
"lazy",
".",
"map",
"do",
"|",
"a_subject",
"|",
"relevant_rules_for_match",
"(",
"action",... | Check if the user has permission to perform a given action on an object.
can? :destroy, @project
You can also pass the class instead of an instance (if you don't have one handy).
can? :create, Project
Nested resources can be passed through a hash, this way conditions which are
dependent upon the association will work when using a class.
can? :create, @category => Project
You can also pass multiple objects to check. You only need to pass a hash
following the pattern { :any => [many subjects] }. The behaviour is check if
there is a permission on any of the given objects.
can? :create, {:any => [Project, Rule]}
Any additional arguments will be passed into the "can" block definition. This
can be used to pass more information about the user's request for example.
can? :create, Project, request.remote_ip
can :create, Project do |project, remote_ip|
# ...
end
Not only can you use the can? method in the controller and view (see ControllerAdditions),
but you can also call it directly on an ability instance.
ability.can? :destroy, @project
This makes testing a user's abilities very easy.
def test "user can only destroy projects which he owns"
user = User.new
ability = Ability.new(user)
assert ability.can?(:destroy, Project.new(:user => user))
assert ability.cannot?(:destroy, Project.new)
end
Also see the RSpec Matchers to aid in testing. | [
"Check",
"if",
"the",
"user",
"has",
"permission",
"to",
"perform",
"a",
"given",
"action",
"on",
"an",
"object",
"."
] | b2e5660c6b9b683fc45b8f425b90c4d06e2f24bf | https://github.com/CanCanCommunity/cancancan/blob/b2e5660c6b9b683fc45b8f425b90c4d06e2f24bf/lib/cancan/ability.rb#L74-L81 | train | Returns the base behavior for the given action and subject. | [
30522,
13366,
2064,
1029,
1006,
2895,
1010,
3395,
1010,
17961,
1027,
9152,
2140,
1010,
1008,
4469,
1035,
12098,
5620,
1007,
2674,
1027,
14817,
1035,
5739,
1006,
3395,
1007,
1012,
13971,
1012,
4949,
2079,
1064,
1037,
1035,
3395,
1064,
7882,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
activeadmin/activeadmin | lib/active_admin/namespace.rb | ActiveAdmin.Namespace.register | def register(resource_class, options = {}, &block)
config = find_or_build_resource(resource_class, options)
# Register the resource
register_resource_controller(config)
parse_registration_block(config, &block) if block_given?
reset_menu!
# Dispatch a registration event
ActiveSupport::Notifications.publish ActiveAdmin::Resource::RegisterEvent, config
# Return the config
config
end | ruby | def register(resource_class, options = {}, &block)
config = find_or_build_resource(resource_class, options)
# Register the resource
register_resource_controller(config)
parse_registration_block(config, &block) if block_given?
reset_menu!
# Dispatch a registration event
ActiveSupport::Notifications.publish ActiveAdmin::Resource::RegisterEvent, config
# Return the config
config
end | [
"def",
"register",
"(",
"resource_class",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"config",
"=",
"find_or_build_resource",
"(",
"resource_class",
",",
"options",
")",
"# Register the resource",
"register_resource_controller",
"(",
"config",
")",
"pa... | Register a resource into this namespace. The preffered method to access this is to
use the global registration ActiveAdmin.register which delegates to the proper
namespace instance. | [
"Register",
"a",
"resource",
"into",
"this",
"namespace",
".",
"The",
"preffered",
"method",
"to",
"access",
"this",
"is",
"to",
"use",
"the",
"global",
"registration",
"ActiveAdmin",
".",
"register",
"which",
"delegates",
"to",
"the",
"proper",
"namespace",
"... | 0759c8dcf97865748c9344459162ac3c7e65a6cd | https://github.com/activeadmin/activeadmin/blob/0759c8dcf97865748c9344459162ac3c7e65a6cd/lib/active_admin/namespace.rb#L65-L78 | train | Register a resource | [
30522,
13366,
4236,
1006,
7692,
1035,
2465,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
9530,
8873,
2290,
1027,
2424,
1035,
2030,
1035,
3857,
1035,
7692,
1006,
7692,
1035,
2465,
1010,
7047,
1007,
1001,
4236,
1996,
7692,
4236,
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... |
fastlane/fastlane | credentials_manager/lib/credentials_manager/cli.rb | CredentialsManager.CLI.add | def add(username, password)
CredentialsManager::AccountManager.new(
user: username,
password: password
).add_to_keychain
end | ruby | def add(username, password)
CredentialsManager::AccountManager.new(
user: username,
password: password
).add_to_keychain
end | [
"def",
"add",
"(",
"username",
",",
"password",
")",
"CredentialsManager",
"::",
"AccountManager",
".",
"new",
"(",
"user",
":",
"username",
",",
"password",
":",
"password",
")",
".",
"add_to_keychain",
"end"
] | Add entry to Apple Keychain using AccountManager | [
"Add",
"entry",
"to",
"Apple",
"Keychain",
"using",
"AccountManager"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/credentials_manager/lib/credentials_manager/cli.rb#L53-L58 | train | Add a user to the keychain | [
30522,
13366,
5587,
1006,
5310,
18442,
1010,
20786,
1007,
22496,
24805,
4590,
1024,
1024,
4070,
24805,
4590,
1012,
2047,
1006,
5310,
1024,
5310,
18442,
1010,
20786,
1024,
20786,
1007,
1012,
5587,
1035,
2000,
1035,
3145,
24925,
2078,
2203,
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... |
RailsEventStore/rails_event_store | ruby_event_store/lib/ruby_event_store/event.rb | RubyEventStore.Event.correlate_with | def correlate_with(other_message)
self.correlation_id = other_message.correlation_id || other_message.message_id
self.causation_id = other_message.message_id
end | ruby | def correlate_with(other_message)
self.correlation_id = other_message.correlation_id || other_message.message_id
self.causation_id = other_message.message_id
end | [
"def",
"correlate_with",
"(",
"other_message",
")",
"self",
".",
"correlation_id",
"=",
"other_message",
".",
"correlation_id",
"||",
"other_message",
".",
"message_id",
"self",
".",
"causation_id",
"=",
"other_message",
".",
"message_id",
"end"
] | Sets correlation_id and causation_id in metadata based
on correlation_id and message_id of the provided message.
{http://railseventstore.org/docs/correlation_causation/ Find out more}
@param other_message [Event, Proto, command] message to correlate with. Most likely an event or a command. Must respond to correlation_id and message_id.
@return [String] set causation_id | [
"Sets",
"correlation_id",
"and",
"causation_id",
"in",
"metadata",
"based",
"on",
"correlation_id",
"and",
"message_id",
"of",
"the",
"provided",
"message",
".",
"{",
"http",
":",
"//",
"railseventstore",
".",
"org",
"/",
"docs",
"/",
"correlation_causation",
"/... | 3ee4f3148499794154ee6fec74ccf6d4670d85ac | https://github.com/RailsEventStore/rails_event_store/blob/3ee4f3148499794154ee6fec74ccf6d4670d85ac/ruby_event_store/lib/ruby_event_store/event.rb#L133-L136 | train | This method is used to correlate the message with another message | [
30522,
13366,
2522,
14343,
13806,
1035,
2007,
1006,
2060,
1035,
4471,
1007,
2969,
1012,
16902,
1035,
8909,
1027,
2060,
1035,
4471,
1012,
16902,
1035,
8909,
1064,
1064,
2060,
1035,
4471,
1012,
4471,
1035,
8909,
2969,
1012,
6187,
10383,
3508,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hexgnu/linkedin | lib/linked_in/mash.rb | LinkedIn.Mash.timestamp | def timestamp
value = self['timestamp']
if value.kind_of? Integer
value = value / 1000 if value > 9999999999
Time.at(value)
else
value
end
end | ruby | def timestamp
value = self['timestamp']
if value.kind_of? Integer
value = value / 1000 if value > 9999999999
Time.at(value)
else
value
end
end | [
"def",
"timestamp",
"value",
"=",
"self",
"[",
"'timestamp'",
"]",
"if",
"value",
".",
"kind_of?",
"Integer",
"value",
"=",
"value",
"/",
"1000",
"if",
"value",
">",
"9999999999",
"Time",
".",
"at",
"(",
"value",
")",
"else",
"value",
"end",
"end"
] | Convert the 'timestamp' field from a string to a Time object
@return [Time] | [
"Convert",
"the",
"timestamp",
"field",
"from",
"a",
"string",
"to",
"a",
"Time",
"object"
] | a56f5381e7d84b934c53e891b1f0421fe8a6caf9 | https://github.com/hexgnu/linkedin/blob/a56f5381e7d84b934c53e891b1f0421fe8a6caf9/lib/linked_in/mash.rb#L44-L52 | train | Get the current timestamp | [
30522,
13366,
2335,
15464,
2361,
3643,
1027,
2969,
1031,
1005,
2335,
15464,
2361,
1005,
1033,
2065,
3643,
1012,
2785,
1035,
1997,
1029,
16109,
3643,
1027,
3643,
1013,
6694,
2065,
3643,
1028,
25897,
2683,
2683,
2683,
2683,
2683,
2683,
2683,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_with_http_info | def list_worker_pool_instance_metric_definitions_with_http_info(resource_group_name, name, worker_pool_name, instance, custom_headers:nil)
list_worker_pool_instance_metric_definitions_async(resource_group_name, name, worker_pool_name, instance, custom_headers:custom_headers).value!
end | ruby | def list_worker_pool_instance_metric_definitions_with_http_info(resource_group_name, name, worker_pool_name, instance, custom_headers:nil)
list_worker_pool_instance_metric_definitions_async(resource_group_name, name, worker_pool_name, instance, custom_headers:custom_headers).value!
end | [
"def",
"list_worker_pool_instance_metric_definitions_with_http_info",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"instance",
",",
"custom_headers",
":",
"nil",
")",
"list_worker_pool_instance_metric_definitions_async",
"(",
"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 [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"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#L3466-L3468 | train | Gets metric definitions for the specified instance. | [
30522,
13366,
2862,
1035,
7309,
1035,
4770,
1035,
6013,
1035,
12046,
1035,
15182,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7309,
1035,
4770,
1035,
2171,
1010,
6013,
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... |
octokit/octokit.rb | lib/octokit/connection.rb | Octokit.Connection.boolean_from_response | def boolean_from_response(method, path, options = {})
request(method, path, options)
@last_response.status == 204
rescue Octokit::NotFound
false
end | ruby | def boolean_from_response(method, path, options = {})
request(method, path, options)
@last_response.status == 204
rescue Octokit::NotFound
false
end | [
"def",
"boolean_from_response",
"(",
"method",
",",
"path",
",",
"options",
"=",
"{",
"}",
")",
"request",
"(",
"method",
",",
"path",
",",
"options",
")",
"@last_response",
".",
"status",
"==",
"204",
"rescue",
"Octokit",
"::",
"NotFound",
"false",
"end"
... | Executes the request, checking if it was successful
@return [Boolean] True on success, false otherwise | [
"Executes",
"the",
"request",
"checking",
"if",
"it",
"was",
"successful"
] | ddf750601529a6a7da5fe5293d10031709b8605d | https://github.com/octokit/octokit.rb/blob/ddf750601529a6a7da5fe5293d10031709b8605d/lib/octokit/connection.rb#L163-L168 | train | Returns a boolean from the last response | [
30522,
13366,
22017,
20898,
1035,
2013,
1035,
3433,
1006,
4118,
1010,
4130,
1010,
7047,
1027,
1063,
1065,
1007,
5227,
1006,
4118,
1010,
4130,
1010,
7047,
1007,
1030,
2197,
1035,
3433,
1012,
3570,
1027,
1027,
19627,
5343,
13323,
23212,
2102,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
floere/phony | lib/phony/country_codes.rb | Phony.CountryCodes.partial_split | def partial_split number
cc = ''
1.upto(3) do |i|
cc << number.slice!(0..0)
country = countries[i][cc]
return [country, cc, number] if country
end
# This line is never reached as CCs are in prefix code.
end | ruby | def partial_split number
cc = ''
1.upto(3) do |i|
cc << number.slice!(0..0)
country = countries[i][cc]
return [country, cc, number] if country
end
# This line is never reached as CCs are in prefix code.
end | [
"def",
"partial_split",
"number",
"cc",
"=",
"''",
"1",
".",
"upto",
"(",
"3",
")",
"do",
"|",
"i",
"|",
"cc",
"<<",
"number",
".",
"slice!",
"(",
"0",
"..",
"0",
")",
"country",
"=",
"countries",
"[",
"i",
"]",
"[",
"cc",
"]",
"return",
"[",
... | Split off the country and the cc, and also return the national number part. | [
"Split",
"off",
"the",
"country",
"and",
"the",
"cc",
"and",
"also",
"return",
"the",
"national",
"number",
"part",
"."
] | 9ca50743499cf478a25fdb927bcdacd29d2c90c7 | https://github.com/floere/phony/blob/9ca50743499cf478a25fdb927bcdacd29d2c90c7/lib/phony/country_codes.rb#L140-L148 | train | Split the number into two parts | [
30522,
13366,
7704,
1035,
3975,
2193,
10507,
1027,
1005,
1005,
1015,
1012,
2039,
3406,
1006,
1017,
1007,
2079,
1064,
1045,
1064,
10507,
1026,
1026,
2193,
1012,
14704,
999,
1006,
1014,
1012,
1012,
1014,
1007,
2406,
1027,
3032,
1031,
1045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/property.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Property.get_entity_tag_with_http_info | def get_entity_tag_with_http_info(resource_group_name, service_name, prop_id, custom_headers:nil)
get_entity_tag_async(resource_group_name, service_name, prop_id, custom_headers:custom_headers).value!
end | ruby | def get_entity_tag_with_http_info(resource_group_name, service_name, prop_id, custom_headers:nil)
get_entity_tag_async(resource_group_name, service_name, prop_id, custom_headers:custom_headers).value!
end | [
"def",
"get_entity_tag_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"prop_id",
",",
"custom_headers",
":",
"nil",
")",
"get_entity_tag_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"prop_id",
",",
"custom_headers",
":custom_header... | Gets the entity state (Etag) version of the property specified by its
identifier.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param prop_id [String] Identifier of the property.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"entity",
"state",
"(",
"Etag",
")",
"version",
"of",
"the",
"property",
"specified",
"by",
"its",
"identifier",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/property.rb#L176-L178 | train | Gets the entity tag for the specified resource group. | [
30522,
13366,
2131,
1035,
9178,
1035,
6415,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
17678,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
9178,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb | Azure::Storage::Mgmt::V2018_07_01.BlobContainers.clear_legal_hold | def clear_legal_hold(resource_group_name, account_name, container_name, legal_hold, custom_headers:nil)
response = clear_legal_hold_async(resource_group_name, account_name, container_name, legal_hold, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def clear_legal_hold(resource_group_name, account_name, container_name, legal_hold, custom_headers:nil)
response = clear_legal_hold_async(resource_group_name, account_name, container_name, legal_hold, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"clear_legal_hold",
"(",
"resource_group_name",
",",
"account_name",
",",
"container_name",
",",
"legal_hold",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"clear_legal_hold_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"container_name... | Clears legal hold tags. Clearing the same or non-existent tag results in an
idempotent operation. ClearLegalHold clears out only the specified tags in
the request.
@param resource_group_name [String] The name of the resource group within the
user's subscription. The name is case insensitive.
@param account_name [String] The name of the storage account within the
specified resource group. Storage account names must be between 3 and 24
characters in length and use numbers and lower-case letters only.
@param container_name [String] The name of the blob container within the
specified storage account. Blob container names must be between 3 and 63
characters in length and use numbers, lower-case letters and dash (-) only.
Every dash (-) character must be immediately preceded and followed by a
letter or number.
@param legal_hold [LegalHold] The LegalHold property that will be clear from
a blob container.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [LegalHold] operation results. | [
"Clears",
"legal",
"hold",
"tags",
".",
"Clearing",
"the",
"same",
"or",
"non",
"-",
"existent",
"tag",
"results",
"in",
"an",
"idempotent",
"operation",
".",
"ClearLegalHold",
"clears",
"out",
"only",
"the",
"specified",
"tags",
"in",
"the",
"request",
"."
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb#L839-L842 | train | Clear the legal hold of a container. | [
30522,
13366,
3154,
1035,
3423,
1035,
2907,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11661,
1035,
2171,
1010,
3423,
1035,
2907,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3154,
1035,
3423,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_tag | def serialized_tag(tagname, str, additional_attributes = {}, &block)
str << "<#{tagname} "
serialized_attributes(str, additional_attributes)
if block_given?
str << '>'
yield
str << "</#{tagname}>"
else
str << '/>'
end
end | ruby | def serialized_tag(tagname, str, additional_attributes = {}, &block)
str << "<#{tagname} "
serialized_attributes(str, additional_attributes)
if block_given?
str << '>'
yield
str << "</#{tagname}>"
else
str << '/>'
end
end | [
"def",
"serialized_tag",
"(",
"tagname",
",",
"str",
",",
"additional_attributes",
"=",
"{",
"}",
",",
"&",
"block",
")",
"str",
"<<",
"\"<#{tagname} \"",
"serialized_attributes",
"(",
"str",
",",
"additional_attributes",
")",
"if",
"block_given?",
"str",
"<<",
... | creates a XML tag with serialized attributes
@see SerializedAttributes#serialized_attributes | [
"creates",
"a",
"XML",
"tag",
"with",
"serialized",
"attributes"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/util/serialized_attributes.rb#L34-L44 | train | Serialize a tag | [
30522,
13366,
27289,
1035,
6415,
1006,
6415,
18442,
1010,
2358,
2099,
1010,
3176,
1035,
12332,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
2358,
2099,
1026,
1026,
1000,
1026,
1001,
1063,
6415,
18442,
1065,
1000,
27289,
1035,
12332,
1006,
2358... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/local_network_gateways.rb | Azure::Network::Mgmt::V2018_07_01.LocalNetworkGateways.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, local_network_gateway_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, local_network_gateway_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, local_network_gateway_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, local_network_gateway_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"local_network_gateway_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"local_network_gateway_name",
",",
"paramet... | Creates or updates a local network gateway in the specified resource group.
@param resource_group_name [String] The name of the resource group.
@param local_network_gateway_name [String] The name of the local network
gateway.
@param parameters [LocalNetworkGateway] Parameters supplied to the create or
update local network gateway 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",
"local",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/local_network_gateways.rb#L375-L377 | train | Creates or updates a local network gateway. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2334,
1035,
2897,
1035,
11909,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_marketplace_ordering/lib/2015-06-01/generated/azure_mgmt_marketplace_ordering/marketplace_agreements.rb | Azure::MarketplaceOrdering::Mgmt::V2015_06_01.MarketplaceAgreements.sign | def sign(publisher_id, offer_id, plan_id, custom_headers:nil)
response = sign_async(publisher_id, offer_id, plan_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def sign(publisher_id, offer_id, plan_id, custom_headers:nil)
response = sign_async(publisher_id, offer_id, plan_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"sign",
"(",
"publisher_id",
",",
"offer_id",
",",
"plan_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"sign_async",
"(",
"publisher_id",
",",
"offer_id",
",",
"plan_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"res... | Sign marketplace terms.
@param publisher_id [String] Publisher identifier string of image being
deployed.
@param offer_id [String] Offer identifier string of image being deployed.
@param plan_id [String] Plan identifier string of image being deployed.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [AgreementTerms] operation results. | [
"Sign",
"marketplace",
"terms",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_marketplace_ordering/lib/2015-06-01/generated/azure_mgmt_marketplace_ordering/marketplace_agreements.rb#L250-L253 | train | Signs an offer to a plan. | [
30522,
13366,
3696,
1006,
6674,
1035,
8909,
1010,
3749,
1035,
8909,
1010,
2933,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3696,
1035,
2004,
6038,
2278,
1006,
6674,
1035,
8909,
1010,
3749,
1035,
8909,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/sprockets | lib/sprockets/processing.rb | Sprockets.Processing.register_bundle_metadata_reducer | def register_bundle_metadata_reducer(mime_type, key, *args, &block)
case args.size
when 0
reducer = block
when 1
if block_given?
initial = args[0]
reducer = block
else
initial = nil
reducer = args[0].to_proc
end
when 2
initial = args[0]
reducer = args[1].to_proc
else
raise ArgumentError, "wrong number of arguments (#{args.size} for 0..2)"
end
self.config = hash_reassoc(config, :bundle_reducers, mime_type) do |reducers|
reducers.merge(key => [initial, reducer])
end
end | ruby | def register_bundle_metadata_reducer(mime_type, key, *args, &block)
case args.size
when 0
reducer = block
when 1
if block_given?
initial = args[0]
reducer = block
else
initial = nil
reducer = args[0].to_proc
end
when 2
initial = args[0]
reducer = args[1].to_proc
else
raise ArgumentError, "wrong number of arguments (#{args.size} for 0..2)"
end
self.config = hash_reassoc(config, :bundle_reducers, mime_type) do |reducers|
reducers.merge(key => [initial, reducer])
end
end | [
"def",
"register_bundle_metadata_reducer",
"(",
"mime_type",
",",
"key",
",",
"*",
"args",
",",
"&",
"block",
")",
"case",
"args",
".",
"size",
"when",
"0",
"reducer",
"=",
"block",
"when",
"1",
"if",
"block_given?",
"initial",
"=",
"args",
"[",
"0",
"]"... | Public: Register bundle metadata reducer function.
Examples
Sprockets.register_bundle_metadata_reducer 'application/javascript', :jshint_errors, [], :+
Sprockets.register_bundle_metadata_reducer 'text/css', :selector_count, 0 { |total, count|
total + count
}
mime_type - String MIME Type. Use '*/*' applies to all types.
key - Symbol metadata key
initial - Initial memo to pass to the reduce funciton (default: nil)
block - Proc accepting the memo accumulator and current value
Returns nothing. | [
"Public",
":",
"Register",
"bundle",
"metadata",
"reducer",
"function",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/processing.rb#L137-L159 | train | Register a bundle metadata reducer. | [
30522,
13366,
4236,
1035,
14012,
1035,
27425,
1035,
5547,
2099,
1006,
2771,
4168,
1035,
2828,
1010,
3145,
1010,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
2553,
12098,
5620,
1012,
2946,
2043,
1014,
5547,
2099,
1027,
3796,
2043,
1015,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb | Azure::Locks::Mgmt::V2015_01_01.ManagementLocks.delete_at_resource_level_with_http_info | def delete_at_resource_level_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, custom_headers:nil)
delete_at_resource_level_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, custom_headers:custom_headers).value!
end | ruby | def delete_at_resource_level_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, custom_headers:nil)
delete_at_resource_level_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_at_resource_level_with_http_info",
"(",
"resource_group_name",
",",
"resource_provider_namespace",
",",
"parent_resource_path",
",",
"resource_type",
",",
"resource_name",
",",
"lock_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_at_resource_level_async",... | Deletes the management lock of a resource or any level below resource.
@param resource_group_name [String] The name of the resource group.
@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 lock_name [String] The name of lock.
@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",
"management",
"lock",
"of",
"a",
"resource",
"or",
"any",
"level",
"below",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb#L490-L492 | train | Deletes a resource at resource level. | [
30522,
13366,
3972,
12870,
1035,
2012,
1035,
7692,
1035,
2504,
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,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb | Azure::CDN::Mgmt::V2016_10_02.Profiles.create_async | def create_async(resource_group_name, profile_name, profile, custom_headers:nil)
# Send request
promise = begin_create_async(resource_group_name, profile_name, profile, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::Profile.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def create_async(resource_group_name, profile_name, profile, custom_headers:nil)
# Send request
promise = begin_create_async(resource_group_name, profile_name, profile, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::CDN::Mgmt::V2016_10_02::Models::Profile.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"create_async",
"(",
"resource_group_name",
",",
"profile_name",
",",
"profile",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_async",
"(",
"resource_group_name",
",",
"profile_name",
",",
"profile",
",",
"custom_header... | @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 profile [Profile] Profile properties needed to create a new profile.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"Name",
"of",
"the",
"Resource",
"group",
"within",
"the",
"Azure",
"subscription",
".",
"@param",
"profile_name",
"[",
"String",
"]",
"Name",
"of",
"the",
"CDN",
"profile",
"which",
"is",
"unique",
"within"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb#L339-L355 | train | Creates a new CDN profile. | [
30522,
13366,
3443,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
6337,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
3443,
1035,
2004,
6038,
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... |
tongueroo/jets | lib/jets/controller/rendering/rack_renderer.rb | Jets::Controller::Rendering.RackRenderer.render | def render
# we do some normalization here
status = normalize_status_code(@options[:status])
base64 = normalized_base64_option(@options)
headers = @options[:headers] || {}
set_content_type!(status, headers)
# x-jets-base64 to convert this Rack triplet to a API Gateway hash structure later
headers["x-jets-base64"] = base64 ? 'yes' : 'no' # headers values must be Strings
# Rails rendering does heavy lifting
if drop_content_info?(status)
body = StringIO.new
else
renderer = ActionController::Base.renderer.new(renderer_options)
body = renderer.render(render_options)
body = StringIO.new(body)
end
[status, headers, body] # triplet
end | ruby | def render
# we do some normalization here
status = normalize_status_code(@options[:status])
base64 = normalized_base64_option(@options)
headers = @options[:headers] || {}
set_content_type!(status, headers)
# x-jets-base64 to convert this Rack triplet to a API Gateway hash structure later
headers["x-jets-base64"] = base64 ? 'yes' : 'no' # headers values must be Strings
# Rails rendering does heavy lifting
if drop_content_info?(status)
body = StringIO.new
else
renderer = ActionController::Base.renderer.new(renderer_options)
body = renderer.render(render_options)
body = StringIO.new(body)
end
[status, headers, body] # triplet
end | [
"def",
"render",
"# we do some normalization here",
"status",
"=",
"normalize_status_code",
"(",
"@options",
"[",
":status",
"]",
")",
"base64",
"=",
"normalized_base64_option",
"(",
"@options",
")",
"headers",
"=",
"@options",
"[",
":headers",
"]",
"||",
"{",
"}"... | Example response:
[200, {"my-header" = > "value" }, "my body" ]
Returns rack triplet | [
"Example",
"response",
":"
] | 46943a519224067e58aa3e2d5656e3ca083150f9 | https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/controller/rendering/rack_renderer.rb#L18-L40 | train | render the response | [
30522,
13366,
17552,
1001,
2057,
2079,
2070,
3671,
3989,
2182,
3570,
1027,
3671,
4697,
1035,
3570,
1035,
3642,
1006,
1030,
7047,
1031,
1024,
3570,
1033,
1007,
2918,
21084,
1027,
3671,
3550,
1035,
2918,
21084,
1035,
5724,
1006,
1030,
7047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/monitoring.rb | Mongo.Monitoring.failed | def failed(topic, event)
subscribers_for(topic).each{ |subscriber| subscriber.failed(event) }
end | ruby | def failed(topic, event)
subscribers_for(topic).each{ |subscriber| subscriber.failed(event) }
end | [
"def",
"failed",
"(",
"topic",
",",
"event",
")",
"subscribers_for",
"(",
"topic",
")",
".",
"each",
"{",
"|",
"subscriber",
"|",
"subscriber",
".",
"failed",
"(",
"event",
")",
"}",
"end"
] | Publish a failed event.
@example Publish a failed event.
monitoring.failed(COMMAND, event)
@param [ String ] topic The event topic.
@param [ Event ] event The event to publish.
@since 2.1.0 | [
"Publish",
"a",
"failed",
"event",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/monitoring.rb#L278-L280 | train | Called when a topic has failed. | [
30522,
13366,
3478,
1006,
8476,
1010,
2724,
1007,
17073,
1035,
2005,
1006,
8476,
1007,
1012,
2169,
1063,
1064,
4942,
29234,
2099,
1064,
4942,
29234,
2099,
1012,
3478,
1006,
2724,
1007,
1065,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/router.rb | Jets.Router.root | def root(to, options={})
default = {path: '', to: to, method: :get, root: true}
options = default.merge(options)
@routes << Route.new(options)
end | ruby | def root(to, options={})
default = {path: '', to: to, method: :get, root: true}
options = default.merge(options)
@routes << Route.new(options)
end | [
"def",
"root",
"(",
"to",
",",
"options",
"=",
"{",
"}",
")",
"default",
"=",
"{",
"path",
":",
"''",
",",
"to",
":",
"to",
",",
"method",
":",
":get",
",",
"root",
":",
"true",
"}",
"options",
"=",
"default",
".",
"merge",
"(",
"options",
")",... | root "posts#index" | [
"root",
"posts#index"
] | 46943a519224067e58aa3e2d5656e3ca083150f9 | https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/router.rb#L87-L91 | train | Add a root route to the routes list | [
30522,
13366,
7117,
1006,
2000,
1010,
7047,
1027,
1063,
1065,
1007,
12398,
1027,
1063,
4130,
1024,
1005,
1005,
1010,
2000,
1024,
2000,
1010,
4118,
1024,
1024,
2131,
1010,
7117,
1024,
2995,
1065,
7047,
1027,
12398,
1012,
13590,
1006,
7047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongoid | lib/mongoid/touchable.rb | Mongoid.Touchable.define_relation_touch_method | def define_relation_touch_method(name, association)
relation_classes = if association.polymorphic?
association.send(:inverse_association_classes)
else
[ association.relation_class ]
end
relation_classes.each { |c| c.send(:include, InstanceMethods) }
method_name = "touch_#{name}_after_create_or_destroy"
association.inverse_class.class_eval <<-TOUCH, __FILE__, __LINE__ + 1
def #{method_name}
without_autobuild do
relation = __send__(:#{name})
relation.touch #{":#{association.touch_field}" if association.touch_field} if relation
end
end
TOUCH
method_name.to_sym
end | ruby | def define_relation_touch_method(name, association)
relation_classes = if association.polymorphic?
association.send(:inverse_association_classes)
else
[ association.relation_class ]
end
relation_classes.each { |c| c.send(:include, InstanceMethods) }
method_name = "touch_#{name}_after_create_or_destroy"
association.inverse_class.class_eval <<-TOUCH, __FILE__, __LINE__ + 1
def #{method_name}
without_autobuild do
relation = __send__(:#{name})
relation.touch #{":#{association.touch_field}" if association.touch_field} if relation
end
end
TOUCH
method_name.to_sym
end | [
"def",
"define_relation_touch_method",
"(",
"name",
",",
"association",
")",
"relation_classes",
"=",
"if",
"association",
".",
"polymorphic?",
"association",
".",
"send",
"(",
":inverse_association_classes",
")",
"else",
"[",
"association",
".",
"relation_class",
"]"... | Define the method that will get called for touching belongs_to
associations.
@api private
@example Define the touch association.
Model.define_relation_touch_method(:band)
Model.define_relation_touch_method(:band, :band_updated_at)
@param [ Symbol ] name The name of the association.
@param [ Association ] association The association metadata.
@since 3.1.0
@return [ Symbol ] The method name. | [
"Define",
"the",
"method",
"that",
"will",
"get",
"called",
"for",
"touching",
"belongs_to",
"associations",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/touchable.rb#L82-L100 | train | Defines a touch method for the given association. | [
30522,
13366,
9375,
1035,
7189,
1035,
3543,
1035,
4118,
1006,
2171,
1010,
2523,
1007,
7189,
1035,
4280,
1027,
2065,
2523,
1012,
26572,
18078,
1029,
2523,
1012,
4604,
1006,
1024,
19262,
1035,
2523,
1035,
4280,
1007,
2842,
1031,
2523,
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... |
mongodb/mongo-ruby-driver | lib/mongo/session.rb | Mongo.Session.add_txn_num! | def add_txn_num!(command)
command.tap do |c|
c[:txnNumber] = BSON::Int64.new(@server_session.txn_num) if in_transaction?
end
end | ruby | def add_txn_num!(command)
command.tap do |c|
c[:txnNumber] = BSON::Int64.new(@server_session.txn_num) if in_transaction?
end
end | [
"def",
"add_txn_num!",
"(",
"command",
")",
"command",
".",
"tap",
"do",
"|",
"c",
"|",
"c",
"[",
":txnNumber",
"]",
"=",
"BSON",
"::",
"Int64",
".",
"new",
"(",
"@server_session",
".",
"txn_num",
")",
"if",
"in_transaction?",
"end",
"end"
] | Add the transaction number to a command document if applicable.
@example
session.add_txn_num!(cmd)
@return [ Hash, BSON::Document ] The command document.
@since 2.6.0
@api private | [
"Add",
"the",
"transaction",
"number",
"to",
"a",
"command",
"document",
"if",
"applicable",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/session.rb#L248-L252 | train | Add the txn number to the command | [
30522,
13366,
5587,
1035,
19067,
2078,
1035,
16371,
2213,
999,
1006,
3094,
1007,
3094,
1012,
11112,
2079,
1064,
1039,
1064,
1039,
1031,
1024,
19067,
10695,
29440,
1033,
1027,
18667,
2239,
1024,
1024,
20014,
21084,
1012,
2047,
1006,
1030,
82... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/reporting_api.rb | SquareConnect.ReportingApi.list_additional_recipient_receivables | def list_additional_recipient_receivables(location_id, opts = {})
data, _status_code, _headers = list_additional_recipient_receivables_with_http_info(location_id, opts)
return data
end | ruby | def list_additional_recipient_receivables(location_id, opts = {})
data, _status_code, _headers = list_additional_recipient_receivables_with_http_info(location_id, opts)
return data
end | [
"def",
"list_additional_recipient_receivables",
"(",
"location_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"list_additional_recipient_receivables_with_http_info",
"(",
"location_id",
",",
"opts",
")",
"return",
"data",
"end... | ListAdditionalRecipientReceivables
Returns a list of receivables (across all possible sending locations) representing monies credited to the provided location ID by another Square account using the `additional_recipients` field in a transaction. Max results per [page](#paginatingresults): 50
@param location_id The ID of the location to list AdditionalRecipientReceivables for.
@param [Hash] opts the optional parameters
@option opts [String] :begin_time The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.
@option opts [String] :end_time The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.
@option opts [String] :sort_order The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`
@option opts [String] :cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
@return [ListAdditionalRecipientReceivablesResponse] | [
"ListAdditionalRecipientReceivables",
"Returns",
"a",
"list",
"of",
"receivables",
"(",
"across",
"all",
"possible",
"sending",
"locations",
")",
"representing",
"monies",
"credited",
"to",
"the",
"provided",
"location",
"ID",
"by",
"another",
"Square",
"account",
"... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/reporting_api.rb#L99-L102 | train | Returns the additional recipient receivables for a location | [
30522,
13366,
2862,
1035,
3176,
1035,
7799,
1035,
28667,
7416,
12423,
2015,
1006,
3295,
1035,
30524,
20346,
2015,
1027,
2862,
1035,
3176,
1035,
7799,
1035,
28667,
7416,
12423,
2015,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
3295,
1035,
890... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/lib/decidim/data_portability_file_reader.rb | Decidim.DataPortabilityFileReader.file_path | def file_path
directory_name = Rails.root.join(Decidim::DataPortabilityUploader.new.store_dir)
FileUtils.mkdir_p(directory_name) unless File.exist?(directory_name)
directory_name + file_name
end | ruby | def file_path
directory_name = Rails.root.join(Decidim::DataPortabilityUploader.new.store_dir)
FileUtils.mkdir_p(directory_name) unless File.exist?(directory_name)
directory_name + file_name
end | [
"def",
"file_path",
"directory_name",
"=",
"Rails",
".",
"root",
".",
"join",
"(",
"Decidim",
"::",
"DataPortabilityUploader",
".",
"new",
".",
"store_dir",
")",
"FileUtils",
".",
"mkdir_p",
"(",
"directory_name",
")",
"unless",
"File",
".",
"exist?",
"(",
"... | Returns a String with the absolute file_path to be read or generate. | [
"Returns",
"a",
"String",
"with",
"the",
"absolute",
"file_path",
"to",
"be",
"read",
"or",
"generate",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/data_portability_file_reader.rb#L30-L34 | train | Returns the path to the file with the highest priority. | [
30522,
13366,
5371,
30524,
1012,
12395,
4305,
2099,
1035,
1052,
1006,
14176,
1035,
2171,
1007,
4983,
5371,
1012,
4839,
1029,
1006,
14176,
1035,
2171,
1007,
14176,
1035,
2171,
1009,
5371,
1035,
2171,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_items_api.rb | SquareConnect.V1ItemsApi.delete_modifier_list | def delete_modifier_list(location_id, modifier_list_id, opts = {})
data, _status_code, _headers = delete_modifier_list_with_http_info(location_id, modifier_list_id, opts)
return data
end | ruby | def delete_modifier_list(location_id, modifier_list_id, opts = {})
data, _status_code, _headers = delete_modifier_list_with_http_info(location_id, modifier_list_id, opts)
return data
end | [
"def",
"delete_modifier_list",
"(",
"location_id",
",",
"modifier_list_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"delete_modifier_list_with_http_info",
"(",
"location_id",
",",
"modifier_list_id",
",",
"opts",
")",
"r... | DeleteModifierList
Deletes an existing item modifier list and all modifier options associated with it. *Note**: DeleteModifierList returns nothing on success but Connect SDKs map the empty response to an empty `V1DeleteModifierListRequest` object as documented below.
@param location_id The ID of the item's associated location.
@param modifier_list_id The ID of the modifier list to delete.
@param [Hash] opts the optional parameters
@return [V1ModifierList] | [
"DeleteModifierList",
"Deletes",
"an",
"existing",
"item",
"modifier",
"list",
"and",
"all",
"modifier",
"options",
"associated",
"with",
"it",
".",
"*",
"Note",
"**",
":",
"DeleteModifierList",
"returns",
"nothing",
"on",
"success",
"but",
"Connect",
"SDKs",
"m... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L931-L934 | train | Delete a modifier list | [
30522,
13366,
3972,
12870,
1035,
16913,
18095,
1035,
2862,
1006,
3295,
1035,
8909,
1010,
16913,
18095,
1035,
2862,
1035,
8909,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
397... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongoid | lib/mongoid/reloadable.rb | Mongoid.Reloadable.extract_embedded_attributes | def extract_embedded_attributes(attributes)
atomic_position.split(".").inject(attributes) do |attrs, part|
attrs = attrs[part =~ /\d/ ? part.to_i : part]
attrs
end
end | ruby | def extract_embedded_attributes(attributes)
atomic_position.split(".").inject(attributes) do |attrs, part|
attrs = attrs[part =~ /\d/ ? part.to_i : part]
attrs
end
end | [
"def",
"extract_embedded_attributes",
"(",
"attributes",
")",
"atomic_position",
".",
"split",
"(",
"\".\"",
")",
".",
"inject",
"(",
"attributes",
")",
"do",
"|",
"attrs",
",",
"part",
"|",
"attrs",
"=",
"attrs",
"[",
"part",
"=~",
"/",
"\\d",
"/",
"?",... | Extract only the desired embedded document from the attributes.
@example Extract the embedded document.
document.extract_embedded_attributes(attributes)
@param [ Hash ] attributes The document in the db.
@return [ Hash ] The document's extracted attributes.
@since 2.3.2 | [
"Extract",
"only",
"the",
"desired",
"embedded",
"document",
"from",
"the",
"attributes",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/reloadable.rb#L89-L94 | train | Extract the attributes from the atomic_position | [
30522,
13366,
14817,
1035,
11157,
1035,
12332,
1006,
12332,
1007,
9593,
1035,
2597,
1012,
3975,
1006,
1000,
1012,
1000,
1007,
1012,
1999,
20614,
1006,
12332,
1007,
2079,
1064,
2012,
16344,
2015,
1010,
2112,
1064,
2012,
16344,
2015,
1027,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/galleries.rb | Azure::Compute::Mgmt::V2019_03_01.Galleries.create_or_update | def create_or_update(resource_group_name, gallery_name, gallery, custom_headers:nil)
response = create_or_update_async(resource_group_name, gallery_name, gallery, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(resource_group_name, gallery_name, gallery, custom_headers:nil)
response = create_or_update_async(resource_group_name, gallery_name, gallery, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"resource_group_name",
",",
"gallery_name",
",",
"gallery",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"resource_group_name",
",",
"gallery_name",
",",
"gallery",
",",
"custom_headers",
":cus... | Create or update a Shared Image Gallery.
@param resource_group_name [String] The name of the resource group.
@param gallery_name [String] The name of the Shared Image Gallery. The
allowed characters are alphabets and numbers with dots and periods allowed in
the middle. The maximum length is 80 characters.
@param gallery [Gallery] Parameters supplied to the create or update Shared
Image Gallery operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Gallery] operation results. | [
"Create",
"or",
"update",
"a",
"Shared",
"Image",
"Gallery",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/galleries.rb#L38-L41 | train | Creates or updates a gallery. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3916,
1035,
2171,
1010,
3916,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2030,
1035,
10651,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/lazy_load_hooks.rb | ActiveSupport.LazyLoadHooks.on_load | def on_load(name, options = {}, &block)
@loaded[name].each do |base|
execute_hook(name, base, options, block)
end
@load_hooks[name] << [block, options]
end | ruby | def on_load(name, options = {}, &block)
@loaded[name].each do |base|
execute_hook(name, base, options, block)
end
@load_hooks[name] << [block, options]
end | [
"def",
"on_load",
"(",
"name",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"@loaded",
"[",
"name",
"]",
".",
"each",
"do",
"|",
"base",
"|",
"execute_hook",
"(",
"name",
",",
"base",
",",
"options",
",",
"block",
")",
"end",
"@load_hooks... | Declares a block that will be executed when a Rails component is fully
loaded.
Options:
* <tt>:yield</tt> - Yields the object that run_load_hooks to +block+.
* <tt>:run_once</tt> - Given +block+ will run only once. | [
"Declares",
"a",
"block",
"that",
"will",
"be",
"executed",
"when",
"a",
"Rails",
"component",
"is",
"fully",
"loaded",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/lazy_load_hooks.rb#L41-L47 | train | Execute the load hook for the given name. | [
30522,
13366,
2006,
1035,
7170,
1006,
2171,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
1030,
8209,
1031,
2171,
1033,
1012,
2169,
2079,
1064,
2918,
1064,
15389,
1035,
8103,
1006,
2171,
1010,
2918,
1010,
7047,
1010,
3796,
1007,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/alias.rb | Vagrant.Alias.register | def register(keyword, command)
@aliases.register(keyword.to_sym) do
lambda do |args|
# directly execute shell commands
if command.start_with?("!")
return Util::SafeExec.exec "#{command[1..-1]} #{args.join(" ")}".strip
end
return CLI.new(command.split.concat(args), @env).execute
end
end
end | ruby | def register(keyword, command)
@aliases.register(keyword.to_sym) do
lambda do |args|
# directly execute shell commands
if command.start_with?("!")
return Util::SafeExec.exec "#{command[1..-1]} #{args.join(" ")}".strip
end
return CLI.new(command.split.concat(args), @env).execute
end
end
end | [
"def",
"register",
"(",
"keyword",
",",
"command",
")",
"@aliases",
".",
"register",
"(",
"keyword",
".",
"to_sym",
")",
"do",
"lambda",
"do",
"|",
"args",
"|",
"# directly execute shell commands",
"if",
"command",
".",
"start_with?",
"(",
"\"!\"",
")",
"ret... | This registers an alias. | [
"This",
"registers",
"an",
"alias",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/alias.rb#L43-L54 | train | register a command to the command list | [
30522,
13366,
4236,
1006,
3145,
18351,
1010,
3094,
1007,
1030,
14593,
2229,
1012,
4236,
1006,
3145,
18351,
1012,
2000,
1035,
25353,
2213,
1007,
2079,
23375,
2079,
1064,
12098,
5620,
1064,
1001,
3495,
15389,
5806,
10954,
2065,
3094,
1012,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/runner.rb | HamlLint.Runner.process_files | def process_files(report)
files.each do |file|
process_file(file, report)
break if report.failed? && fail_fast?
end
end | ruby | def process_files(report)
files.each do |file|
process_file(file, report)
break if report.failed? && fail_fast?
end
end | [
"def",
"process_files",
"(",
"report",
")",
"files",
".",
"each",
"do",
"|",
"file",
"|",
"process_file",
"(",
"file",
",",
"report",
")",
"break",
"if",
"report",
".",
"failed?",
"&&",
"fail_fast?",
"end",
"end"
] | Process the files and add them to the given report.
@param report [HamlLint::Report]
@return [void] | [
"Process",
"the",
"files",
"and",
"add",
"them",
"to",
"the",
"given",
"report",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/runner.rb#L111-L116 | train | Process the files | [
30522,
13366,
2832,
1035,
6764,
1006,
3189,
1007,
6764,
1012,
2169,
2079,
1064,
5371,
1064,
2832,
1035,
5371,
1006,
5371,
1010,
3189,
1007,
3338,
2065,
3189,
1012,
3478,
1029,
1004,
1004,
8246,
1035,
3435,
1029,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kpumuk/meta-tags | lib/meta_tags/text_normalizer.rb | MetaTags.TextNormalizer.truncate_array | def truncate_array(string_array, limit = nil, separator = '', natural_separator = ' ')
return string_array if limit.nil? || limit <= 0
length = 0
result = []
string_array.each do |string|
limit_left = calculate_limit_left(limit, length, result, separator)
if string.length > limit_left
result << truncate(string, limit_left, natural_separator)
break
end
length += (result.any? ? separator.length : 0) + string.length
result << string
# No more strings will fit
break if length + separator.length >= limit
end
result
end | ruby | def truncate_array(string_array, limit = nil, separator = '', natural_separator = ' ')
return string_array if limit.nil? || limit <= 0
length = 0
result = []
string_array.each do |string|
limit_left = calculate_limit_left(limit, length, result, separator)
if string.length > limit_left
result << truncate(string, limit_left, natural_separator)
break
end
length += (result.any? ? separator.length : 0) + string.length
result << string
# No more strings will fit
break if length + separator.length >= limit
end
result
end | [
"def",
"truncate_array",
"(",
"string_array",
",",
"limit",
"=",
"nil",
",",
"separator",
"=",
"''",
",",
"natural_separator",
"=",
"' '",
")",
"return",
"string_array",
"if",
"limit",
".",
"nil?",
"||",
"limit",
"<=",
"0",
"length",
"=",
"0",
"result",
... | Truncates a string to a specific limit.
@param [Array<String>] string_array input strings.
@param [Integer,nil] limit characters number to truncate to.
@param [String] separator separator that will be used to join array later.
@param [String] natural_separator natural separator to truncate at.
@return [String] truncated string. | [
"Truncates",
"a",
"string",
"to",
"a",
"specific",
"limit",
"."
] | 03585f95edf96cd17024c5c155ce46ec8bc47232 | https://github.com/kpumuk/meta-tags/blob/03585f95edf96cd17024c5c155ce46ec8bc47232/lib/meta_tags/text_normalizer.rb#L158-L180 | train | Truncate a string array to a limit of length | [
30522,
13366,
19817,
4609,
16280,
1035,
9140,
1006,
5164,
1035,
9140,
1010,
5787,
1027,
9152,
2140,
1010,
19802,
25879,
2953,
1027,
1005,
1005,
1010,
3019,
1035,
19802,
25879,
2953,
1027,
1005,
1005,
1007,
2709,
5164,
1035,
9140,
2065,
5787... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
onelogin/ruby-saml | lib/xml_security.rb | XMLSecurity.Document.sign_document | def sign_document(private_key, certificate, signature_method = RSA_SHA1, digest_method = SHA1)
noko = Nokogiri::XML(self.to_s) do |config|
config.options = XMLSecurity::BaseDocument::NOKOGIRI_OPTIONS
end
signature_element = REXML::Element.new("ds:Signature").add_namespace('ds', DSIG)
signed_info_element = signature_element.add_element("ds:SignedInfo")
signed_info_element.add_element("ds:CanonicalizationMethod", {"Algorithm" => C14N})
signed_info_element.add_element("ds:SignatureMethod", {"Algorithm"=>signature_method})
# Add Reference
reference_element = signed_info_element.add_element("ds:Reference", {"URI" => "##{uuid}"})
# Add Transforms
transforms_element = reference_element.add_element("ds:Transforms")
transforms_element.add_element("ds:Transform", {"Algorithm" => ENVELOPED_SIG})
c14element = transforms_element.add_element("ds:Transform", {"Algorithm" => C14N})
c14element.add_element("ec:InclusiveNamespaces", {"xmlns:ec" => C14N, "PrefixList" => INC_PREFIX_LIST})
digest_method_element = reference_element.add_element("ds:DigestMethod", {"Algorithm" => digest_method})
inclusive_namespaces = INC_PREFIX_LIST.split(" ")
canon_doc = noko.canonicalize(canon_algorithm(C14N), inclusive_namespaces)
reference_element.add_element("ds:DigestValue").text = compute_digest(canon_doc, algorithm(digest_method_element))
# add SignatureValue
noko_sig_element = Nokogiri::XML(signature_element.to_s) do |config|
config.options = XMLSecurity::BaseDocument::NOKOGIRI_OPTIONS
end
noko_signed_info_element = noko_sig_element.at_xpath('//ds:Signature/ds:SignedInfo', 'ds' => DSIG)
canon_string = noko_signed_info_element.canonicalize(canon_algorithm(C14N))
signature = compute_signature(private_key, algorithm(signature_method).new, canon_string)
signature_element.add_element("ds:SignatureValue").text = signature
# add KeyInfo
key_info_element = signature_element.add_element("ds:KeyInfo")
x509_element = key_info_element.add_element("ds:X509Data")
x509_cert_element = x509_element.add_element("ds:X509Certificate")
if certificate.is_a?(String)
certificate = OpenSSL::X509::Certificate.new(certificate)
end
x509_cert_element.text = Base64.encode64(certificate.to_der).gsub(/\n/, "")
# add the signature
issuer_element = self.elements["//saml:Issuer"]
if issuer_element
self.root.insert_after issuer_element, signature_element
else
if sp_sso_descriptor = self.elements["/md:EntityDescriptor"]
self.root.insert_before sp_sso_descriptor, signature_element
else
self.root.add_element(signature_element)
end
end
end | ruby | def sign_document(private_key, certificate, signature_method = RSA_SHA1, digest_method = SHA1)
noko = Nokogiri::XML(self.to_s) do |config|
config.options = XMLSecurity::BaseDocument::NOKOGIRI_OPTIONS
end
signature_element = REXML::Element.new("ds:Signature").add_namespace('ds', DSIG)
signed_info_element = signature_element.add_element("ds:SignedInfo")
signed_info_element.add_element("ds:CanonicalizationMethod", {"Algorithm" => C14N})
signed_info_element.add_element("ds:SignatureMethod", {"Algorithm"=>signature_method})
# Add Reference
reference_element = signed_info_element.add_element("ds:Reference", {"URI" => "##{uuid}"})
# Add Transforms
transforms_element = reference_element.add_element("ds:Transforms")
transforms_element.add_element("ds:Transform", {"Algorithm" => ENVELOPED_SIG})
c14element = transforms_element.add_element("ds:Transform", {"Algorithm" => C14N})
c14element.add_element("ec:InclusiveNamespaces", {"xmlns:ec" => C14N, "PrefixList" => INC_PREFIX_LIST})
digest_method_element = reference_element.add_element("ds:DigestMethod", {"Algorithm" => digest_method})
inclusive_namespaces = INC_PREFIX_LIST.split(" ")
canon_doc = noko.canonicalize(canon_algorithm(C14N), inclusive_namespaces)
reference_element.add_element("ds:DigestValue").text = compute_digest(canon_doc, algorithm(digest_method_element))
# add SignatureValue
noko_sig_element = Nokogiri::XML(signature_element.to_s) do |config|
config.options = XMLSecurity::BaseDocument::NOKOGIRI_OPTIONS
end
noko_signed_info_element = noko_sig_element.at_xpath('//ds:Signature/ds:SignedInfo', 'ds' => DSIG)
canon_string = noko_signed_info_element.canonicalize(canon_algorithm(C14N))
signature = compute_signature(private_key, algorithm(signature_method).new, canon_string)
signature_element.add_element("ds:SignatureValue").text = signature
# add KeyInfo
key_info_element = signature_element.add_element("ds:KeyInfo")
x509_element = key_info_element.add_element("ds:X509Data")
x509_cert_element = x509_element.add_element("ds:X509Certificate")
if certificate.is_a?(String)
certificate = OpenSSL::X509::Certificate.new(certificate)
end
x509_cert_element.text = Base64.encode64(certificate.to_der).gsub(/\n/, "")
# add the signature
issuer_element = self.elements["//saml:Issuer"]
if issuer_element
self.root.insert_after issuer_element, signature_element
else
if sp_sso_descriptor = self.elements["/md:EntityDescriptor"]
self.root.insert_before sp_sso_descriptor, signature_element
else
self.root.add_element(signature_element)
end
end
end | [
"def",
"sign_document",
"(",
"private_key",
",",
"certificate",
",",
"signature_method",
"=",
"RSA_SHA1",
",",
"digest_method",
"=",
"SHA1",
")",
"noko",
"=",
"Nokogiri",
"::",
"XML",
"(",
"self",
".",
"to_s",
")",
"do",
"|",
"config",
"|",
"config",
".",
... | <Signature>
<SignedInfo>
<CanonicalizationMethod />
<SignatureMethod />
<Reference>
<Transforms>
<DigestMethod>
<DigestValue>
</Reference>
<Reference /> etc.
</SignedInfo>
<SignatureValue />
<KeyInfo />
<Object />
</Signature> | [
"<Signature",
">",
"<SignedInfo",
">",
"<CanonicalizationMethod",
"/",
">",
"<SignatureMethod",
"/",
">",
"<Reference",
">",
"<Transforms",
">",
"<DigestMethod",
">",
"<DigestValue",
">",
"<",
"/",
"Reference",
">",
"<Reference",
"/",
">",
"etc",
".",
"<",
"/"... | 688d9e927d8b2d22a8b4daa870740d234b7b76c8 | https://github.com/onelogin/ruby-saml/blob/688d9e927d8b2d22a8b4daa870740d234b7b76c8/lib/xml_security.rb#L117-L172 | train | Sign the document using the given private key and certificate | [
30522,
13366,
3696,
1035,
6254,
1006,
2797,
1035,
3145,
1010,
8196,
1010,
8085,
1035,
4118,
1027,
12667,
2050,
1035,
21146,
2487,
1010,
17886,
1035,
4118,
1027,
21146,
2487,
1007,
2053,
3683,
1027,
2053,
3683,
23243,
1024,
1024,
20950,
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... |
square/connect-ruby-sdk | lib/square_connect/models/create_order_request_tax.rb | SquareConnect.CreateOrderRequestTax.valid? | def valid?
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
return false if !@name.nil? && @name.to_s.length > 255
type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"])
return false unless type_validator.valid?(@type)
return false if !@percentage.nil? && @percentage.to_s.length > 10
return true
end | ruby | def valid?
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
return false if !@name.nil? && @name.to_s.length > 255
type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"])
return false unless type_validator.valid?(@type)
return false if !@percentage.nil? && @percentage.to_s.length > 10
return true
end | [
"def",
"valid?",
"return",
"false",
"if",
"!",
"@catalog_object_id",
".",
"nil?",
"&&",
"@catalog_object_id",
".",
"to_s",
".",
"length",
">",
"192",
"return",
"false",
"if",
"!",
"@name",
".",
"nil?",
"&&",
"@name",
".",
"to_s",
".",
"length",
">",
"255... | Check to see if the all the properties in the model are valid
@return true if the model is valid | [
"Check",
"to",
"see",
"if",
"the",
"all",
"the",
"properties",
"in",
"the",
"model",
"are",
"valid"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/create_order_request_tax.rb#L116-L123 | train | Returns true if the object is valid for the given object ID. | [
30522,
13366,
9398,
1029,
2709,
6270,
2065,
999,
1030,
12105,
1035,
4874,
1035,
8909,
1012,
9152,
2140,
1029,
1004,
1004,
1030,
12105,
1035,
4874,
1035,
8909,
1012,
2000,
1035,
1055,
1012,
3091,
1028,
17613,
2709,
6270,
2065,
999,
1030,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/overcommit | lib/overcommit/configuration_validator.rb | Overcommit.ConfigurationValidator.ensure_hook_type_sections_exist | def ensure_hook_type_sections_exist(hash)
Overcommit::Utils.supported_hook_type_classes.each do |hook_type|
hash[hook_type] ||= {}
hash[hook_type]['ALL'] ||= {}
end
end | ruby | def ensure_hook_type_sections_exist(hash)
Overcommit::Utils.supported_hook_type_classes.each do |hook_type|
hash[hook_type] ||= {}
hash[hook_type]['ALL'] ||= {}
end
end | [
"def",
"ensure_hook_type_sections_exist",
"(",
"hash",
")",
"Overcommit",
"::",
"Utils",
".",
"supported_hook_type_classes",
".",
"each",
"do",
"|",
"hook_type",
"|",
"hash",
"[",
"hook_type",
"]",
"||=",
"{",
"}",
"hash",
"[",
"hook_type",
"]",
"[",
"'ALL'",
... | Ensures that keys for all supported hook types exist (PreCommit,
CommitMsg, etc.) | [
"Ensures",
"that",
"keys",
"for",
"all",
"supported",
"hook",
"types",
"exist",
"(",
"PreCommit",
"CommitMsg",
"etc",
".",
")"
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/configuration_validator.rb#L34-L39 | train | Ensure that the hook type sections exist in the given hash. | [
30522,
13366,
5676,
1035,
8103,
1035,
2828,
1035,
5433,
1035,
4839,
1006,
23325,
1007,
2058,
9006,
22930,
1024,
1024,
21183,
12146,
1012,
3569,
1035,
8103,
1035,
2828,
1035,
4280,
1012,
2169,
2079,
1064,
8103,
1035,
2828,
1064,
23325,
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_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb | Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.list_deployments_at_resource_group_with_http_info | def list_deployments_at_resource_group_with_http_info(resource_group_name, remediation_name, query_options:nil, custom_headers:nil)
list_deployments_at_resource_group_async(resource_group_name, remediation_name, query_options:query_options, custom_headers:custom_headers).value!
end | ruby | def list_deployments_at_resource_group_with_http_info(resource_group_name, remediation_name, query_options:nil, custom_headers:nil)
list_deployments_at_resource_group_async(resource_group_name, remediation_name, query_options:query_options, custom_headers:custom_headers).value!
end | [
"def",
"list_deployments_at_resource_group_with_http_info",
"(",
"resource_group_name",
",",
"remediation_name",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_deployments_at_resource_group_async",
"(",
"resource_group_name",
",",
"remediation_n... | Gets all deployments for a remediation at resource group scope.
@param resource_group_name [String] Resource group name.
@param remediation_name [String] The name of the remediation.
@param query_options [QueryOptions] Additional parameters for the operation
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"all",
"deployments",
"for",
"a",
"remediation",
"at",
"resource",
"group",
"scope",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L1201-L1203 | train | Gets the list of deployments at resource group scope. | [
30522,
13366,
2862,
1035,
10813,
2015,
1035,
2012,
1035,
7692,
1035,
2177,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2128,
16969,
3508,
1035,
2171,
1010,
23032,
1035,
7047,
1024,
30524,
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... |
randym/axlsx | lib/axlsx/stylesheet/pattern_fill.rb | Axlsx.PatternFill.to_xml_string | def to_xml_string(str = '')
str << ('<patternFill patternType="' << patternType.to_s << '">')
if fgColor.is_a?(Color)
fgColor.to_xml_string str, "fgColor"
end
if bgColor.is_a?(Color)
bgColor.to_xml_string str, "bgColor"
end
str << '</patternFill>'
end | ruby | def to_xml_string(str = '')
str << ('<patternFill patternType="' << patternType.to_s << '">')
if fgColor.is_a?(Color)
fgColor.to_xml_string str, "fgColor"
end
if bgColor.is_a?(Color)
bgColor.to_xml_string str, "bgColor"
end
str << '</patternFill>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"str",
"<<",
"(",
"'<patternFill patternType=\"'",
"<<",
"patternType",
".",
"to_s",
"<<",
"'\">'",
")",
"if",
"fgColor",
".",
"is_a?",
"(",
"Color",
")",
"fgColor",
".",
"to_xml_string",
"str",
",",
"\"f... | Serializes the object
@param [String] str
@return [String] | [
"Serializes",
"the",
"object"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/stylesheet/pattern_fill.rb#L61-L71 | train | Convert the pattern to XML string. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
2358,
2099,
1026,
1026,
1006,
1005,
1026,
5418,
8873,
3363,
5418,
13874,
1027,
1000,
1005,
1026,
1026,
5418,
13874,
1012,
2000,
1035,
1055,
1026,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.verify_with_http_info | def verify_with_http_info(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:nil)
verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:custom_headers).value!
end | ruby | def verify_with_http_info(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:nil)
verify_async(vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers:custom_headers).value!
end | [
"def",
"verify_with_http_info",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"algorithm",
",",
"digest",
",",
"signature",
",",
"custom_headers",
":",
"nil",
")",
"verify_async",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
... | Verifies a signature using a specified key.
The VERIFY operation is applicable to symmetric keys stored in Azure Key
Vault. VERIFY is not strictly necessary for asymmetric keys stored in Azure
Key Vault since signature verification can be performed using the public
portion of the key but this operation is supported as a convenience for
callers that only have a key-reference and not the public portion of the key.
This operation requires the keys/verify 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. For more information on possible algorithm types, see
JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384',
'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512',
'ECDSA256'
@param digest The digest used for signing.
@param signature The signature to be verified.
@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. | [
"Verifies",
"a",
"signature",
"using",
"a",
"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#L1812-L1814 | train | Verify the specified key. | [
30522,
13366,
20410,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
3145,
1035,
2544,
1010,
9896,
1010,
17886,
1010,
8085,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_apis.rb | Azure::ApiManagement::Mgmt::V2016_10_10.ProductApis.create_with_http_info | def create_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers:nil)
create_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value!
end | ruby | def create_with_http_info(resource_group_name, service_name, product_id, api_id, custom_headers:nil)
create_async(resource_group_name, service_name, product_id, api_id, custom_headers:custom_headers).value!
end | [
"def",
"create_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"product_id",
",",
"api_id",
",",
"custom_headers",
":",
"nil",
")",
"create_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"product_id",
",",
"api_id",
",",
"custom... | Adds an API to the specified product.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param product_id [String] Product identifier. Must be unique in the current
API Management service instance.
@param api_id [String] API identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Adds",
"an",
"API",
"to",
"the",
"specified",
"product",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/product_apis.rb#L211-L213 | train | Creates a new product specification. | [
30522,
13366,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
4031,
1035,
8909,
1010,
17928,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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... |
puppetlabs/bolt | lib/bolt/pal.rb | Bolt.PAL.list_modules | def list_modules
internal_module_groups = { BOLTLIB_PATH => 'Plan Language Modules',
MODULES_PATH => 'Packaged Modules' }
in_bolt_compiler do
# NOTE: Can replace map+to_h with transform_values when Ruby 2.4
# is the minimum supported version.
Puppet.lookup(:current_environment).modules_by_path.map do |path, modules|
module_group = internal_module_groups[path]
values = modules.map do |mod|
mod_info = { name: (mod.forge_name || mod.name),
version: mod.version }
mod_info[:internal_module_group] = module_group unless module_group.nil?
mod_info
end
[path, values]
end.to_h
end
end | ruby | def list_modules
internal_module_groups = { BOLTLIB_PATH => 'Plan Language Modules',
MODULES_PATH => 'Packaged Modules' }
in_bolt_compiler do
# NOTE: Can replace map+to_h with transform_values when Ruby 2.4
# is the minimum supported version.
Puppet.lookup(:current_environment).modules_by_path.map do |path, modules|
module_group = internal_module_groups[path]
values = modules.map do |mod|
mod_info = { name: (mod.forge_name || mod.name),
version: mod.version }
mod_info[:internal_module_group] = module_group unless module_group.nil?
mod_info
end
[path, values]
end.to_h
end
end | [
"def",
"list_modules",
"internal_module_groups",
"=",
"{",
"BOLTLIB_PATH",
"=>",
"'Plan Language Modules'",
",",
"MODULES_PATH",
"=>",
"'Packaged Modules'",
"}",
"in_bolt_compiler",
"do",
"# NOTE: Can replace map+to_h with transform_values when Ruby 2.4",
"# is the minimum supp... | Returns a mapping of all modules available to the Bolt compiler
@return [Hash{String => Array<Hash{Symbol => String,nil}>}]
A hash that associates each directory on the module path with an array
containing a hash of information for each module in that directory.
The information hash provides the name, version, and a string
indicating whether the module belongs to an internal module group. | [
"Returns",
"a",
"mapping",
"of",
"all",
"modules",
"available",
"to",
"the",
"Bolt",
"compiler"
] | 50689a33699939d262ea7c822a4b24fd8c4f8d8a | https://github.com/puppetlabs/bolt/blob/50689a33699939d262ea7c822a4b24fd8c4f8d8a/lib/bolt/pal.rb#L313-L334 | train | Returns a hash of all the modules that are in the current environment. | [
30522,
13366,
2862,
1035,
14184,
4722,
1035,
11336,
1035,
2967,
1027,
1063,
10053,
29521,
1035,
4130,
1027,
1028,
1005,
2933,
2653,
14184,
1005,
1010,
14184,
1035,
4130,
1027,
1028,
1005,
21972,
14184,
1005,
1065,
1999,
1035,
10053,
1035,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_redis/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb | Azure::Redis::Mgmt::V2017_02_01.Redis.export_data | def export_data(resource_group_name, name, parameters, custom_headers:nil)
response = export_data_async(resource_group_name, name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def export_data(resource_group_name, name, parameters, custom_headers:nil)
response = export_data_async(resource_group_name, name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"export_data",
"(",
"resource_group_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"export_data_async",
"(",
"resource_group_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",... | Export data from the redis cache to blobs in a container.
@param resource_group_name [String] The name of the resource group.
@param name [String] The name of the Redis cache.
@param parameters [ExportRDBParameters] Parameters for Redis export
operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Export",
"data",
"from",
"the",
"redis",
"cache",
"to",
"blobs",
"in",
"a",
"container",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_redis/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb#L844-L847 | train | Export a list of data structures. | [
30522,
13366,
9167,
1035,
2951,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
9167,
1035,
2951,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/p2s_vpn_server_configurations.rb | Azure::Network::Mgmt::V2019_02_01.P2sVpnServerConfigurations.create_or_update | def create_or_update(resource_group_name, virtual_wan_name, p2svpn_server_configuration_name, p2svpn_server_configuration_parameters, custom_headers:nil)
response = create_or_update_async(resource_group_name, virtual_wan_name, p2svpn_server_configuration_name, p2svpn_server_configuration_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(resource_group_name, virtual_wan_name, p2svpn_server_configuration_name, p2svpn_server_configuration_parameters, custom_headers:nil)
response = create_or_update_async(resource_group_name, virtual_wan_name, p2svpn_server_configuration_name, p2svpn_server_configuration_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"resource_group_name",
",",
"virtual_wan_name",
",",
"p2svpn_server_configuration_name",
",",
"p2svpn_server_configuration_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"resource_group_name",... | Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it
doesn't exist else updates the existing P2SVpnServerConfiguration.
@param resource_group_name [String] The resource group name of the
VirtualWan.
@param virtual_wan_name [String] The name of the VirtualWan.
@param p2svpn_server_configuration_name [String] The name of the
P2SVpnServerConfiguration.
@param p2svpn_server_configuration_parameters [P2SVpnServerConfiguration]
Parameters supplied to create or Update a P2SVpnServerConfiguration.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [P2SVpnServerConfiguration] operation results. | [
"Creates",
"a",
"P2SVpnServerConfiguration",
"to",
"associate",
"with",
"a",
"VirtualWan",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"P2SVpnServerConfiguration",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/p2s_vpn_server_configurations.rb#L142-L145 | train | Creates or updates a virtual wan server configuration. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
14071,
1035,
2171,
1010,
1052,
2475,
2015,
2615,
2361,
2078,
1035,
8241,
1035,
9563,
1035,
2171,
1010,
1052,
2475,
2015,
2615,
2361,
2078,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jeremytregunna/ruby-trello | lib/trello/card.rb | Trello.Card.move_to_board | def move_to_board(new_board, new_list = nil)
unless board_id == new_board.id
payload = { value: new_board.id }
payload[:idList] = new_list.id if new_list
client.put("/cards/#{id}/idBoard", payload)
end
end | ruby | def move_to_board(new_board, new_list = nil)
unless board_id == new_board.id
payload = { value: new_board.id }
payload[:idList] = new_list.id if new_list
client.put("/cards/#{id}/idBoard", payload)
end
end | [
"def",
"move_to_board",
"(",
"new_board",
",",
"new_list",
"=",
"nil",
")",
"unless",
"board_id",
"==",
"new_board",
".",
"id",
"payload",
"=",
"{",
"value",
":",
"new_board",
".",
"id",
"}",
"payload",
"[",
":idList",
"]",
"=",
"new_list",
".",
"id",
... | Move this card to the given board (and optional list on this board) | [
"Move",
"this",
"card",
"to",
"the",
"given",
"board",
"(",
"and",
"optional",
"list",
"on",
"this",
"board",
")"
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/card.rb#L358-L364 | train | Move the card to the board | [
30522,
13366,
2693,
1035,
2000,
1035,
2604,
1006,
2047,
1035,
2604,
1010,
2047,
1035,
2862,
1027,
9152,
2140,
1007,
4983,
2604,
1035,
8909,
1027,
1027,
2047,
1035,
2604,
1012,
8909,
18093,
1027,
1063,
3643,
1024,
2047,
1035,
2604,
1012,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chaps-io/public_activity | lib/public_activity/utility/view_helpers.rb | PublicActivity.ViewHelpers.render_activity | def render_activity activities, options = {}
if activities.is_a? PublicActivity::Activity
activities.render self, options
elsif activities.respond_to?(:map)
# depend on ORMs to fetch as needed
# maybe we can support Postgres streaming with this?
activities.map {|activity| activity.render self, options.dup }.join.html_safe
end
end | ruby | def render_activity activities, options = {}
if activities.is_a? PublicActivity::Activity
activities.render self, options
elsif activities.respond_to?(:map)
# depend on ORMs to fetch as needed
# maybe we can support Postgres streaming with this?
activities.map {|activity| activity.render self, options.dup }.join.html_safe
end
end | [
"def",
"render_activity",
"activities",
",",
"options",
"=",
"{",
"}",
"if",
"activities",
".",
"is_a?",
"PublicActivity",
"::",
"Activity",
"activities",
".",
"render",
"self",
",",
"options",
"elsif",
"activities",
".",
"respond_to?",
"(",
":map",
")",
"# de... | View helper for rendering an activity, calls {PublicActivity::Activity#render} internally. | [
"View",
"helper",
"for",
"rendering",
"an",
"activity",
"calls",
"{",
"PublicActivity",
"::",
"Activity#render",
"}",
"internally",
"."
] | e4357cd14db67299e0cbbd656300f51b7069ea9b | https://github.com/chaps-io/public_activity/blob/e4357cd14db67299e0cbbd656300f51b7069ea9b/lib/public_activity/utility/view_helpers.rb#L8-L16 | train | render an activity | [
30522,
13366,
17552,
1035,
4023,
3450,
1010,
7047,
1027,
1063,
1065,
2065,
3450,
1012,
2003,
1035,
1037,
1029,
2270,
18908,
7730,
1024,
1024,
4023,
3450,
1012,
17552,
2969,
1010,
7047,
3449,
5332,
2546,
3450,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb | Aws::RDS.Resource.certificates | def certificates(options = {})
batches = Enumerator.new do |y|
batch = []
resp = @client.describe_certificates(options)
resp.data.certificates.each do |c|
batch << Certificate.new(
id: c.certificate_identifier,
data: c,
client: @client
)
end
y.yield(batch)
end
Certificate::Collection.new(batches)
end | ruby | def certificates(options = {})
batches = Enumerator.new do |y|
batch = []
resp = @client.describe_certificates(options)
resp.data.certificates.each do |c|
batch << Certificate.new(
id: c.certificate_identifier,
data: c,
client: @client
)
end
y.yield(batch)
end
Certificate::Collection.new(batches)
end | [
"def",
"certificates",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"batch",
"=",
"[",
"]",
"resp",
"=",
"@client",
".",
"describe_certificates",
"(",
"options",
")",
"resp",
".",
"data",
".",
"ce... | @example Request syntax with placeholder values
certificates = rds.certificates({
certificate_identifier: "String",
filters: [
{
name: "String", # required
values: ["String"], # required
},
],
max_records: 1,
marker: "String",
})
@param [Hash] options ({})
@option options [String] :certificate_identifier
The user-supplied certificate identifier. If this parameter is
specified, information for only the identified certificate is
returned. This parameter isn't case-sensitive.
Constraints:
* Must match an existing CertificateIdentifier.
^
@option options [Array<Types::Filter>] :filters
This parameter is not currently supported.
@option options [Integer] :max_records
The maximum number of records to include in the response. If more
records exist than the specified `MaxRecords` value, a pagination
token called a marker is included in the response so that the
remaining results can be retrieved.
Default: 100
Constraints: Minimum 20, maximum 100.
@option options [String] :marker
An optional pagination token provided by a previous
DescribeCertificates request. If this parameter is specified, the
response includes only records beyond the marker, up to the value
specified by `MaxRecords`.
@return [Certificate::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb#L1596-L1610 | train | Returns a collection of certificates | [
30522,
13366,
17987,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
14108,
1027,
1031,
1033,
24501,
2361,
1027,
1030,
7396,
1012,
6235,
1035,
17987,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.