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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.force_recovery_service_fabric_platform_update_domain_walk | def force_recovery_service_fabric_platform_update_domain_walk(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:nil)
response = force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def force_recovery_service_fabric_platform_update_domain_walk(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:nil)
response = force_recovery_service_fabric_platform_update_domain_walk_async(resource_group_name, vm_scale_set_name, platform_update_domain, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"force_recovery_service_fabric_platform_update_domain_walk",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"platform_update_domain",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"force_recovery_service_fabric_platform_update_domain_walk_async",
"(",
... | Manual platform update domain walk to update virtual machines in a service
fabric virtual machine scale set.
@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 platform_update_domain [Integer] The platform update domain for which
a manual recovery walk is requested
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RecoveryWalkResponse] operation results. | [
"Manual",
"platform",
"update",
"domain",
"walk",
"to",
"update",
"virtual",
"machines",
"in",
"a",
"service",
"fabric",
"virtual",
"machine",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1149-L1152 | train | Walks the virtual machine scale set to the latest virtual machine scale set. | [
30522,
13366,
2486,
1035,
7233,
1035,
2326,
1035,
8313,
1035,
4132,
1035,
10651,
1035,
5884,
1035,
3328,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
4132,
1035,
10651,
1035,
5884,
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... |
sensu/sensu | lib/sensu/daemon.rb | Sensu.Daemon.setup_transport | def setup_transport
transport_name = @settings[:transport][:name]
transport_settings = @settings[transport_name]
@logger.debug("connecting to transport", {
:name => transport_name,
:settings => transport_settings
})
Transport.logger = @logger
Transport.connect(transport_name, transport_settings) do |connection|
@transport = connection
@transport.on_error do |error|
@logger.error("transport connection error", :error => error.to_s)
if @settings[:transport][:reconnect_on_error]
@transport.reconnect
else
stop
end
end
@transport.before_reconnect do
unless testing?
@logger.warn("reconnecting to transport")
pause
end
end
@transport.after_reconnect do
@logger.info("reconnected to transport")
resume
end
yield(@transport) if block_given?
end
end | ruby | def setup_transport
transport_name = @settings[:transport][:name]
transport_settings = @settings[transport_name]
@logger.debug("connecting to transport", {
:name => transport_name,
:settings => transport_settings
})
Transport.logger = @logger
Transport.connect(transport_name, transport_settings) do |connection|
@transport = connection
@transport.on_error do |error|
@logger.error("transport connection error", :error => error.to_s)
if @settings[:transport][:reconnect_on_error]
@transport.reconnect
else
stop
end
end
@transport.before_reconnect do
unless testing?
@logger.warn("reconnecting to transport")
pause
end
end
@transport.after_reconnect do
@logger.info("reconnected to transport")
resume
end
yield(@transport) if block_given?
end
end | [
"def",
"setup_transport",
"transport_name",
"=",
"@settings",
"[",
":transport",
"]",
"[",
":name",
"]",
"transport_settings",
"=",
"@settings",
"[",
"transport_name",
"]",
"@logger",
".",
"debug",
"(",
"\"connecting to transport\"",
",",
"{",
":name",
"=>",
"tran... | Set up the Sensu transport connection. Sensu uses a transport
API, allowing it to use various message brokers. By default,
Sensu will use the built-in "rabbitmq" transport. The Sensu
service will stop gracefully in the event of a transport error,
and pause/resume in the event of connectivity issues. This
method creates the transport instance variable: `@transport`.
https://github.com/sensu/sensu-transport
@yield [Object] passes initialized and connected Transport
connection object to the callback/block. | [
"Set",
"up",
"the",
"Sensu",
"transport",
"connection",
".",
"Sensu",
"uses",
"a",
"transport",
"API",
"allowing",
"it",
"to",
"use",
"various",
"message",
"brokers",
".",
"By",
"default",
"Sensu",
"will",
"use",
"the",
"built",
"-",
"in",
"rabbitmq",
"tra... | 51319e4b58c8d9986f101ad71ff729aa3e51e951 | https://github.com/sensu/sensu/blob/51319e4b58c8d9986f101ad71ff729aa3e51e951/lib/sensu/daemon.rb#L281-L311 | train | setup the transport object | [
30522,
13366,
16437,
1035,
3665,
3665,
1035,
2171,
1027,
1030,
10906,
1031,
1024,
3665,
1033,
1031,
1024,
2171,
1033,
3665,
1035,
10906,
1027,
1030,
10906,
1031,
3665,
1035,
2171,
1033,
1030,
8833,
4590,
1012,
2139,
8569,
2290,
1006,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cloudfoundry/bosh | src/bosh-director/lib/bosh/director/job_runner.rb | Bosh::Director.JobRunner.run_checkpointing | def run_checkpointing
# task check pointer is scoped to separate class to avoid
# the secondary thread and main thread modifying the same @task
# variable (and accidentally clobbering it in the process)
task_checkpointer = TaskCheckPointer.new(@task.id)
Thread.new do
with_thread_name("task:#{@task.id}-checkpoint") do
while true
sleep(Config.task_checkpoint_interval)
task_checkpointer.checkpoint
end
end
end
end | ruby | def run_checkpointing
# task check pointer is scoped to separate class to avoid
# the secondary thread and main thread modifying the same @task
# variable (and accidentally clobbering it in the process)
task_checkpointer = TaskCheckPointer.new(@task.id)
Thread.new do
with_thread_name("task:#{@task.id}-checkpoint") do
while true
sleep(Config.task_checkpoint_interval)
task_checkpointer.checkpoint
end
end
end
end | [
"def",
"run_checkpointing",
"# task check pointer is scoped to separate class to avoid",
"# the secondary thread and main thread modifying the same @task",
"# variable (and accidentally clobbering it in the process)",
"task_checkpointer",
"=",
"TaskCheckPointer",
".",
"new",
"(",
"@task",
".... | Spawns a thread that periodically updates task checkpoint time.
There is no need to kill this thread as job execution lifetime is the
same as worker process lifetime.
@return [Thread] Checkpoint thread | [
"Spawns",
"a",
"thread",
"that",
"periodically",
"updates",
"task",
"checkpoint",
"time",
".",
"There",
"is",
"no",
"need",
"to",
"kill",
"this",
"thread",
"as",
"job",
"execution",
"lifetime",
"is",
"the",
"same",
"as",
"worker",
"process",
"lifetime",
"."
... | 2eaa7100879ddd20cd909cd698514746195e28b7 | https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/job_runner.rb#L118-L131 | train | run checkpointing
Quartz | [
30522,
13366,
2448,
1035,
26520,
2075,
1001,
4708,
4638,
20884,
2003,
9531,
2094,
2000,
3584,
2465,
2000,
4468,
1001,
1996,
3905,
11689,
1998,
2364,
11689,
29226,
1996,
2168,
1030,
4708,
1001,
8023,
1006,
1998,
9554,
18856,
16429,
5677,
207... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
googleapis/google-cloud-ruby | google-cloud-trace/lib/google/cloud/trace/patches/active_call_with_trace.rb | GRPC.ActiveCallWithTrace.request_response | def request_response *args
Google::Cloud::Trace.in_span SPAN_NAME do |span|
if span && !args.empty?
grpc_request = args[0]
label_key = Google::Cloud::Trace::LabelKey::RPC_REQUEST_TYPE
span.labels[label_key] = grpc_request.class.name.gsub(/^.*::/, "")
end
super
end
end | ruby | def request_response *args
Google::Cloud::Trace.in_span SPAN_NAME do |span|
if span && !args.empty?
grpc_request = args[0]
label_key = Google::Cloud::Trace::LabelKey::RPC_REQUEST_TYPE
span.labels[label_key] = grpc_request.class.name.gsub(/^.*::/, "")
end
super
end
end | [
"def",
"request_response",
"*",
"args",
"Google",
"::",
"Cloud",
"::",
"Trace",
".",
"in_span",
"SPAN_NAME",
"do",
"|",
"span",
"|",
"if",
"span",
"&&",
"!",
"args",
".",
"empty?",
"grpc_request",
"=",
"args",
"[",
"0",
"]",
"label_key",
"=",
"Google",
... | Override GRPC::ActiveCall#request_response method. Wrap the original
method with a trace span that will get submitted with the overall request
trace span tree. | [
"Override",
"GRPC",
"::",
"ActiveCall#request_response",
"method",
".",
"Wrap",
"the",
"original",
"method",
"with",
"a",
"trace",
"span",
"that",
"will",
"get",
"submitted",
"with",
"the",
"overall",
"request",
"trace",
"span",
"tree",
"."
] | 846c1a57250ac860ef4de1b54853a480ab2ff702 | https://github.com/googleapis/google-cloud-ruby/blob/846c1a57250ac860ef4de1b54853a480ab2ff702/google-cloud-trace/lib/google/cloud/trace/patches/active_call_with_trace.rb#L30-L40 | train | This method is used to create a new instance of the class that is used to create the request response. | [
30522,
13366,
5227,
1035,
3433,
1008,
12098,
5620,
8224,
1024,
1024,
6112,
1024,
1024,
7637,
1012,
1999,
1035,
8487,
8487,
1035,
2171,
2079,
1064,
8487,
1064,
2065,
8487,
1004,
1004,
999,
12098,
5620,
1012,
4064,
1029,
24665,
15042,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.get_data_lake_store_account_with_http_info | def get_data_lake_store_account_with_http_info(resource_group_name, account_name, data_lake_store_account_name, custom_headers:nil)
get_data_lake_store_account_async(resource_group_name, account_name, data_lake_store_account_name, custom_headers:custom_headers).value!
end | ruby | def get_data_lake_store_account_with_http_info(resource_group_name, account_name, data_lake_store_account_name, custom_headers:nil)
get_data_lake_store_account_async(resource_group_name, account_name, data_lake_store_account_name, custom_headers:custom_headers).value!
end | [
"def",
"get_data_lake_store_account_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"data_lake_store_account_name",
",",
"custom_headers",
":",
"nil",
")",
"get_data_lake_store_account_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"data_la... | Gets the specified Data Lake Store account details in the specified Data Lake
Analytics account.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Analytics account.
@param account_name [String] The name of the Data Lake Analytics account from
which to retrieve the Data Lake Store account details.
@param data_lake_store_account_name [String] The name of the Data Lake Store
account to retrieve
@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",
"specified",
"Data",
"Lake",
"Store",
"account",
"details",
"in",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L824-L826 | train | Gets the specified Data Lake Store account. | [
30522,
13366,
2131,
1035,
2951,
1035,
2697,
1035,
3573,
1035,
4070,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
2951,
1035,
2697,
1035,
3573,
1035,
4070,
1035,
2171,
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/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.verify_domain_ownership | def verify_domain_ownership(resource_group_name, certificate_order_name, custom_headers:nil)
response = verify_domain_ownership_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
nil
end | ruby | def verify_domain_ownership(resource_group_name, certificate_order_name, custom_headers:nil)
response = verify_domain_ownership_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"verify_domain_ownership",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"verify_domain_ownership_async",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"custom_headers",
":custom_he... | Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param certificate_order_name [String] Name of the certificate order.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L1716-L1719 | train | Verify domain ownership of a certificate order. | [
30522,
13366,
20410,
1035,
5884,
1035,
6095,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8196,
1035,
2344,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
20410,
1035,
5884,
1035,
6095,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/instance.rb | Aws::AutoScaling.Instance.detach | def detach(options = {})
batch = []
options = Aws::Util.deep_merge(options,
auto_scaling_group_name: @group_name,
instance_ids: [@id]
)
resp = @client.detach_instances(options)
resp.data.activities.each do |a|
batch << Activity.new(
id: a.activity_id,
data: a,
client: @client
)
end
Activity::Collection.new([batch], size: batch.size)
end | ruby | def detach(options = {})
batch = []
options = Aws::Util.deep_merge(options,
auto_scaling_group_name: @group_name,
instance_ids: [@id]
)
resp = @client.detach_instances(options)
resp.data.activities.each do |a|
batch << Activity.new(
id: a.activity_id,
data: a,
client: @client
)
end
Activity::Collection.new([batch], size: batch.size)
end | [
"def",
"detach",
"(",
"options",
"=",
"{",
"}",
")",
"batch",
"=",
"[",
"]",
"options",
"=",
"Aws",
"::",
"Util",
".",
"deep_merge",
"(",
"options",
",",
"auto_scaling_group_name",
":",
"@group_name",
",",
"instance_ids",
":",
"[",
"@id",
"]",
")",
"re... | @example Request syntax with placeholder values
activity = instance.detach({
should_decrement_desired_capacity: false, # required
})
@param [Hash] options ({})
@option options [required, Boolean] :should_decrement_desired_capacity
Indicates whether the Auto Scaling group decrements the desired
capacity value by the number of instances detached.
@return [Activity::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/instance.rb#L240-L255 | train | Detaches the instance from the Auto Scaling group. | [
30522,
13366,
20010,
6776,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
1027,
1031,
1033,
7047,
1027,
22091,
2015,
1024,
1024,
21183,
4014,
1012,
2784,
1035,
13590,
1006,
7047,
1010,
8285,
1035,
25169,
1035,
2177,
1035,
2171,
1024,
1030,
2177... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb | Azure::Network::Mgmt::V2019_02_01.ApplicationGateways.list_available_request_headers | def list_available_request_headers(custom_headers:nil)
response = list_available_request_headers_async(custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_available_request_headers(custom_headers:nil)
response = list_available_request_headers_async(custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_available_request_headers",
"(",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_available_request_headers_async",
"(",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
"nil?",
"end"
] | Lists all available request headers.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Lists",
"all",
"available",
"request",
"headers",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb#L699-L702 | train | Gets the available request parameters. | [
30522,
13366,
2862,
1035,
2800,
1035,
5227,
1035,
20346,
2015,
1006,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2800,
1035,
5227,
1035,
20346,
2015,
1035,
2004,
6038,
2278,
1006,
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 | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.encrypt_with_http_info | def encrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
encrypt_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value!
end | ruby | def encrypt_with_http_info(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
encrypt_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value!
end | [
"def",
"encrypt_with_http_info",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"algorithm",
",",
"value",
",",
"custom_headers",
":",
"nil",
")",
"encrypt_async",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"algorithm",
",",... | Encrypts an arbitrary sequence of bytes using an encryption key that is
stored in a key vault.
The ENCRYPT operation encrypts an arbitrary sequence of bytes using an
encryption key that is stored in Azure Key Vault. Note that the ENCRYPT
operation only supports a single block of data, the size of which is
dependent on the target key and the encryption algorithm to be used. The
ENCRYPT operation is only strictly necessary for symmetric keys stored in
Azure Key Vault since protection with an asymmetric key can be performed
using public portion of the key. This operation is supported for asymmetric
keys as a convenience for callers that have a key-reference but do not have
access to the public key material. This operation requires the keys/encypt
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 [JsonWebKeyEncryptionAlgorithm] algorithm identifier.
Possible values include: 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5'
@param value
@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. | [
"Encrypts",
"an",
"arbitrary",
"sequence",
"of",
"bytes",
"using",
"an",
"encryption",
"key",
"that",
"is",
"stored",
"in",
"a",
"key",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L1364-L1366 | train | Encrypt the specified key. | [
30522,
13366,
4372,
26775,
22571,
2102,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
30524,
1010,
9896,
1010,
3643,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4372,
26775,
22571,
2102,
1035,
2004,
6038,
2278,
1006,
11632,
1035,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
googleapis/google-cloud-ruby | google-cloud-spanner/lib/google-cloud-spanner.rb | Google.Cloud.spanner | def spanner scope: nil, timeout: nil, client_config: nil
Google::Cloud.spanner @project, @keyfile, scope: scope,
timeout: (timeout || @timeout),
client_config: client_config
end | ruby | def spanner scope: nil, timeout: nil, client_config: nil
Google::Cloud.spanner @project, @keyfile, scope: scope,
timeout: (timeout || @timeout),
client_config: client_config
end | [
"def",
"spanner",
"scope",
":",
"nil",
",",
"timeout",
":",
"nil",
",",
"client_config",
":",
"nil",
"Google",
"::",
"Cloud",
".",
"spanner",
"@project",
",",
"@keyfile",
",",
"scope",
":",
"scope",
",",
"timeout",
":",
"(",
"timeout",
"||",
"@timeout",
... | Creates a new object for connecting to the Spanner service.
Each call creates a new connection.
For more information on connecting to Google Cloud see the
{file:AUTHENTICATION.md Authentication Guide}.
@param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
set of resources and operations that the connection can access. See
[Using OAuth 2.0 to Access Google
APIs](https://developers.google.com/identity/protocols/OAuth2).
The default scopes are:
* `https://www.googleapis.com/auth/spanner`
* `https://www.googleapis.com/auth/spanner.data`
@param [Integer] timeout Default timeout to use in requests. Optional.
@param [Hash] client_config A hash of values to override the default
behavior of the API client. Optional.
@return [Google::Cloud::Spanner::Project]
@example
require "google/cloud"
gcloud = Google::Cloud.new
spanner = gcloud.spanner
@example The default scope can be overridden with the `scope` option:
require "google/cloud"
gcloud = Google::Cloud.new
platform_scope = "https://www.googleapis.com/auth/cloud-platform"
spanner = gcloud.spanner scope: platform_scope | [
"Creates",
"a",
"new",
"object",
"for",
"connecting",
"to",
"the",
"Spanner",
"service",
".",
"Each",
"call",
"creates",
"a",
"new",
"connection",
"."
] | 846c1a57250ac860ef4de1b54853a480ab2ff702 | https://github.com/googleapis/google-cloud-ruby/blob/846c1a57250ac860ef4de1b54853a480ab2ff702/google-cloud-spanner/lib/google-cloud-spanner.rb#L64-L68 | train | Create a new instance of the Spanner object. | [
30522,
13366,
8487,
3678,
9531,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
9152,
2140,
1010,
7396,
1035,
9530,
8873,
2290,
1024,
9152,
2140,
8224,
1024,
1024,
6112,
1012,
8487,
3678,
1030,
2622,
1010,
1030,
3145,
8873,
2571,
1010,
9531,
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... |
square/connect-ruby-sdk | lib/square_connect/models/order_line_item.rb | SquareConnect.OrderLineItem.valid? | def valid?
return false if !@name.nil? && @name.to_s.length > 500
return false if @quantity.nil?
return false if @quantity.to_s.length > 5
return false if @quantity.to_s.length < 1
return false if !@note.nil? && @note.to_s.length > 500
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
return false if !@variation_name.nil? && @variation_name.to_s.length > 255
return true
end | ruby | def valid?
return false if !@name.nil? && @name.to_s.length > 500
return false if @quantity.nil?
return false if @quantity.to_s.length > 5
return false if @quantity.to_s.length < 1
return false if !@note.nil? && @note.to_s.length > 500
return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
return false if !@variation_name.nil? && @variation_name.to_s.length > 255
return true
end | [
"def",
"valid?",
"return",
"false",
"if",
"!",
"@name",
".",
"nil?",
"&&",
"@name",
".",
"to_s",
".",
"length",
">",
"500",
"return",
"false",
"if",
"@quantity",
".",
"nil?",
"return",
"false",
"if",
"@quantity",
".",
"to_s",
".",
"length",
">",
"5",
... | 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/order_line_item.rb#L198-L207 | train | Returns true if the object is valid for a given order object. | [
30522,
13366,
9398,
1029,
2709,
6270,
2065,
999,
1030,
2171,
1012,
9152,
2140,
1029,
1004,
1004,
1030,
2171,
1012,
2000,
1035,
1055,
1012,
3091,
1028,
3156,
2709,
6270,
2065,
1030,
11712,
1012,
9152,
2140,
1029,
2709,
6270,
2065,
1030,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/data_criteria.rb | HQMF2.DataCriteria.extract_variable_grouper | def extract_variable_grouper
return unless @variable
@variable = false
@id = "GROUP_#{@id}"
if @children_criteria.length == 1 && @children_criteria[0] =~ /GROUP_/
reference_criteria = @data_criteria_references[@children_criteria.first]
return if reference_criteria.nil?
duplicate_child_info(reference_criteria)
@definition = reference_criteria.definition
@status = reference_criteria.status
@children_criteria = []
end
@specific_occurrence = nil
@specific_occurrence_const = nil
# set the source data criteria id to the id for variables
@source_data_criteria = @id
DataCriteria.new(@entry, @data_criteria_references, @occurrences_map).extract_as_grouper
end | ruby | def extract_variable_grouper
return unless @variable
@variable = false
@id = "GROUP_#{@id}"
if @children_criteria.length == 1 && @children_criteria[0] =~ /GROUP_/
reference_criteria = @data_criteria_references[@children_criteria.first]
return if reference_criteria.nil?
duplicate_child_info(reference_criteria)
@definition = reference_criteria.definition
@status = reference_criteria.status
@children_criteria = []
end
@specific_occurrence = nil
@specific_occurrence_const = nil
# set the source data criteria id to the id for variables
@source_data_criteria = @id
DataCriteria.new(@entry, @data_criteria_references, @occurrences_map).extract_as_grouper
end | [
"def",
"extract_variable_grouper",
"return",
"unless",
"@variable",
"@variable",
"=",
"false",
"@id",
"=",
"\"GROUP_#{@id}\"",
"if",
"@children_criteria",
".",
"length",
"==",
"1",
"&&",
"@children_criteria",
"[",
"0",
"]",
"=~",
"/",
"/",
"reference_criteria",
"=... | Return a new DataCriteria instance with only grouper attributes set.
A grouper criteria allows multiple data criteria events to be contained in a single
logical set (a union or intersection of these multiple events - i.e. A during (B or C or D)).
Grouper criteria also provide a way to combine multiple criteria that reference a specific
occurrence of an event. | [
"Return",
"a",
"new",
"DataCriteria",
"instance",
"with",
"only",
"grouper",
"attributes",
"set",
".",
"A",
"grouper",
"criteria",
"allows",
"multiple",
"data",
"criteria",
"events",
"to",
"be",
"contained",
"in",
"a",
"single",
"logical",
"set",
"(",
"a",
"... | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/data_criteria.rb#L96-L113 | train | extract the grouper information from the data criteria | [
30522,
13366,
14817,
1035,
8023,
1035,
2177,
2121,
2709,
4983,
1030,
8023,
1030,
8023,
1027,
6270,
1030,
8909,
1027,
1000,
2177,
1035,
1001,
1063,
1030,
8909,
1065,
1000,
2065,
1030,
2336,
1035,
9181,
1012,
30524,
1013,
4431,
1035,
9181,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/current_user.rb | Aws::IAM.CurrentUser.signing_certificates | def signing_certificates(options = {})
batches = Enumerator.new do |y|
resp = @client.list_signing_certificates(options)
resp.each_page do |page|
batch = []
page.data.certificates.each do |c|
batch << SigningCertificate.new(
user_name: c.user_name,
id: c.certificate_id,
data: c,
client: @client
)
end
y.yield(batch)
end
end
SigningCertificate::Collection.new(batches)
end | ruby | def signing_certificates(options = {})
batches = Enumerator.new do |y|
resp = @client.list_signing_certificates(options)
resp.each_page do |page|
batch = []
page.data.certificates.each do |c|
batch << SigningCertificate.new(
user_name: c.user_name,
id: c.certificate_id,
data: c,
client: @client
)
end
y.yield(batch)
end
end
SigningCertificate::Collection.new(batches)
end | [
"def",
"signing_certificates",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"resp",
"=",
"@client",
".",
"list_signing_certificates",
"(",
"options",
")",
"resp",
".",
"each_page",
"do",
"|",
"page",
... | @example Request syntax with placeholder values
signing_certificates = current_user.signing_certificates({
user_name: "existingUserNameType",
})
@param [Hash] options ({})
@option options [String] :user_name
The name of the IAM user whose signing certificates you want to
examine.
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
@return [SigningCertificate::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/current_user.rb#L355-L372 | train | Get all signing certificates | [
30522,
13366,
6608,
1035,
17987,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
24501,
2361,
1027,
1030,
7396,
1012,
2862,
1035,
6608,
1035,
17987,
1006,
7047,
1007,
24501,
236... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_run_action_repetitions.rb | Azure::Logic::Mgmt::V2016_06_01.WorkflowRunActionRepetitions.list_with_http_info | def list_with_http_info(resource_group_name, workflow_name, run_name, action_name, custom_headers:nil)
list_async(resource_group_name, workflow_name, run_name, action_name, custom_headers:custom_headers).value!
end | ruby | def list_with_http_info(resource_group_name, workflow_name, run_name, action_name, custom_headers:nil)
list_async(resource_group_name, workflow_name, run_name, action_name, custom_headers:custom_headers).value!
end | [
"def",
"list_with_http_info",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"run_name",
",",
"action_name",
",",
"custom_headers",
":",
"nil",
")",
"list_async",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"run_name",
",",
"action_name",
",",
"cu... | Get all of a workflow run action repetitions.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param run_name [String] The workflow run name.
@param action_name [String] The workflow action name.
@param 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",
"all",
"of",
"a",
"workflow",
"run",
"action",
"repetitions",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_run_action_repetitions.rb#L53-L55 | train | Gets the list of the available data structures. | [
30522,
13366,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
2448,
1035,
2171,
1010,
2895,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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... |
guard/guard | lib/guard/dsl.rb | Guard.Dsl.notification | def notification(notifier, opts = {})
Guard.state.session.guardfile_notification = { notifier.to_sym => opts }
end | ruby | def notification(notifier, opts = {})
Guard.state.session.guardfile_notification = { notifier.to_sym => opts }
end | [
"def",
"notification",
"(",
"notifier",
",",
"opts",
"=",
"{",
"}",
")",
"Guard",
".",
"state",
".",
"session",
".",
"guardfile_notification",
"=",
"{",
"notifier",
".",
"to_sym",
"=>",
"opts",
"}",
"end"
] | Set notification options for the system notifications.
You can set multiple notifications, which allows you to show local
system notifications and remote notifications with separate libraries.
You can also pass `:off` as library to turn off notifications.
@example Define multiple notifications
notification :ruby_gntp
notification :ruby_gntp, host: '192.168.1.5'
@param [Symbol, String] notifier the name of the notifier to use
@param [Hash] opts the notification library options
@see Guard::Notifier for available notifier and its options. | [
"Set",
"notification",
"options",
"for",
"the",
"system",
"notifications",
".",
"You",
"can",
"set",
"multiple",
"notifications",
"which",
"allows",
"you",
"to",
"show",
"local",
"system",
"notifications",
"and",
"remote",
"notifications",
"with",
"separate",
"lib... | e2508cd83badf0d537dbaba35d307adc35d92e4f | https://github.com/guard/guard/blob/e2508cd83badf0d537dbaba35d307adc35d92e4f/lib/guard/dsl.rb#L75-L77 | train | Set the notification for the Guardfile | [
30522,
13366,
26828,
1006,
2025,
18095,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
3457,
1012,
2110,
1012,
5219,
1012,
3457,
8873,
2571,
1035,
26828,
1027,
1063,
2025,
18095,
1012,
2000,
1035,
25353,
2213,
1027,
1028,
23569,
2015,
1065,
220... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_stream_analytics/lib/2016-03-01/generated/azure_mgmt_stream_analytics/subscriptions.rb | Azure::StreamAnalytics::Mgmt::V2016_03_01.Subscriptions.list_quotas | def list_quotas(location, custom_headers:nil)
response = list_quotas_async(location, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_quotas(location, custom_headers:nil)
response = list_quotas_async(location, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_quotas",
"(",
"location",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_quotas_async",
"(",
"location",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
"nil?",
"end"
... | Retrieves the subscription's current quota information in a particular
region.
@param location [String] The region in which to retrieve the subscription's
quota information. You can find out which regions Azure Stream Analytics is
supported in here: https://azure.microsoft.com/en-us/regions/
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SubscriptionQuotasListResult] operation results. | [
"Retrieves",
"the",
"subscription",
"s",
"current",
"quota",
"information",
"in",
"a",
"particular",
"region",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stream_analytics/lib/2016-03-01/generated/azure_mgmt_stream_analytics/subscriptions.rb#L36-L39 | train | Gets the list of quotas for the specified location. | [
30522,
13366,
2862,
1035,
20563,
2015,
1006,
3295,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
20563,
2015,
1035,
2004,
6038,
2278,
1006,
3295,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_backups_from_backup_location | def get_backups_from_backup_location(get_backup_by_storage_query_description, timeout:60, continuation_token:nil, max_results:0, custom_headers:nil)
response = get_backups_from_backup_location_async(get_backup_by_storage_query_description, timeout:timeout, continuation_token:continuation_token, max_results:max_results, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_backups_from_backup_location(get_backup_by_storage_query_description, timeout:60, continuation_token:nil, max_results:0, custom_headers:nil)
response = get_backups_from_backup_location_async(get_backup_by_storage_query_description, timeout:timeout, continuation_token:continuation_token, max_results:max_results, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_backups_from_backup_location",
"(",
"get_backup_by_storage_query_description",
",",
"timeout",
":",
"60",
",",
"continuation_token",
":",
"nil",
",",
"max_results",
":",
"0",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_backups_from_backup_l... | Gets the list of backups available for the specified backed up entity at the
specified backup location.
Gets the list of backups available for the specified backed up entity
(Application, Service or Partition) at the specified backup location
(FileShare or Azure Blob Storage).
@param get_backup_by_storage_query_description
[GetBackupByStorageQueryDescription] Describes the filters and backup storage
details to be used for enumerating backups.
@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 continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PagedBackupInfoList] operation results. | [
"Gets",
"the",
"list",
"of",
"backups",
"available",
"for",
"the",
"specified",
"backed",
"up",
"entity",
"at",
"the",
"specified",
"backup",
"location",
"."
] | 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#L25970-L25973 | train | Gets the backup documents from the specified backup location. | [
30522,
13366,
2131,
1035,
10200,
2015,
1035,
2013,
1035,
10200,
1035,
3295,
1006,
2131,
1035,
10200,
1035,
2011,
1035,
5527,
1035,
23032,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
4098,
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... |
square/connect-ruby-sdk | lib/square_connect/models/transaction.rb | SquareConnect.Transaction.product= | def product=(product)
validator = EnumAttributeValidator.new('String', ["REGISTER", "EXTERNAL_API", "BILLING", "APPOINTMENTS", "INVOICES", "ONLINE_STORE", "PAYROLL", "OTHER"])
unless validator.valid?(product)
fail ArgumentError, "invalid value for 'product', must be one of #{validator.allowable_values}."
end
@product = product
end | ruby | def product=(product)
validator = EnumAttributeValidator.new('String', ["REGISTER", "EXTERNAL_API", "BILLING", "APPOINTMENTS", "INVOICES", "ONLINE_STORE", "PAYROLL", "OTHER"])
unless validator.valid?(product)
fail ArgumentError, "invalid value for 'product', must be one of #{validator.allowable_values}."
end
@product = product
end | [
"def",
"product",
"=",
"(",
"product",
")",
"validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"REGISTER\"",
",",
"\"EXTERNAL_API\"",
",",
"\"BILLING\"",
",",
"\"APPOINTMENTS\"",
",",
"\"INVOICES\"",
",",
"\"ONLINE_STORE\"",
",",
... | Custom attribute writer method checking allowed values (enum).
@param [Object] product Object to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"checking",
"allowed",
"values",
"(",
"enum",
")",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/transaction.rb#L170-L176 | train | Set the product of the resource. | [
30522,
13366,
4031,
1027,
1006,
4031,
1007,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
4236,
1000,
1010,
1000,
6327,
1035,
17928,
1000,
1010,
1000,
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... |
teamcapybara/capybara | lib/capybara/session/matchers.rb | Capybara.SessionMatchers.assert_no_current_path | def assert_no_current_path(path, **options)
_verify_current_path(path, options) do |query|
raise Capybara::ExpectationNotMet, query.negative_failure_message if query.resolves_for?(self)
end
end | ruby | def assert_no_current_path(path, **options)
_verify_current_path(path, options) do |query|
raise Capybara::ExpectationNotMet, query.negative_failure_message if query.resolves_for?(self)
end
end | [
"def",
"assert_no_current_path",
"(",
"path",
",",
"**",
"options",
")",
"_verify_current_path",
"(",
"path",
",",
"options",
")",
"do",
"|",
"query",
"|",
"raise",
"Capybara",
"::",
"ExpectationNotMet",
",",
"query",
".",
"negative_failure_message",
"if",
"quer... | Asserts that the page doesn't have the given path.
By default, if passed a full url this will compare against the full url,
if passed a path only the path+query portion will be compared, if passed a regexp
the comparison will depend on the :url option
@macro current_path_query_params
@raise [Capybara::ExpectationNotMet] if the assertion hasn't succeeded during wait time
@return [true] | [
"Asserts",
"that",
"the",
"page",
"doesn",
"t",
"have",
"the",
"given",
"path",
".",
"By",
"default",
"if",
"passed",
"a",
"full",
"url",
"this",
"will",
"compare",
"against",
"the",
"full",
"url",
"if",
"passed",
"a",
"path",
"only",
"the",
"path",
"+... | 3819078c820c5cd3be6f0bc9e8b1b0cc1190bc41 | https://github.com/teamcapybara/capybara/blob/3819078c820c5cd3be6f0bc9e8b1b0cc1190bc41/lib/capybara/session/matchers.rb#L38-L42 | train | Assert that the current path is not the current path. | [
30522,
13366,
20865,
1035,
2053,
1035,
2783,
1035,
4130,
1006,
4130,
1010,
1008,
1008,
7047,
1007,
1035,
20410,
1035,
2783,
1035,
4130,
1006,
4130,
1010,
7047,
1007,
2079,
1064,
23032,
1064,
5333,
6178,
2100,
20709,
1024,
1024,
17626,
17048... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kmuto/review | lib/epubmaker/epubcommon.rb | EPUBMaker.EPUBCommon.titlepage | def titlepage
@title = CGI.escapeHTML(@producer.config.name_of('title'))
@body = <<EOT
<h1 class="tp-title">#{@title}</h1>
EOT
if @producer.config['subtitle']
@body << <<EOT
<h2 class="tp-subtitle">#{CGI.escapeHTML(@producer.config.name_of('subtitle'))}</h2>
EOT
end
if @producer.config['aut']
@body << <<EOT
<p>
<br />
<br />
</p>
<h2 class="tp-author">#{CGI.escapeHTML(join_with_separator(@producer.config.names_of('aut'), ReVIEW::I18n.t('names_splitter')))}</h2>
EOT
end
publisher = @producer.config.names_of('pbl')
if publisher
@body << <<EOT
<p>
<br />
<br />
<br />
<br />
</p>
<h3 class="tp-publisher">#{CGI.escapeHTML(join_with_separator(publisher, ReVIEW::I18n.t('names_splitter')))}</h3>
EOT
end
@language = @producer.config['language']
@stylesheets = @producer.config['stylesheet']
tmplfile = if @producer.config['htmlversion'].to_i == 5
File.expand_path('./html/layout-html5.html.erb', ReVIEW::Template::TEMPLATE_DIR)
else
File.expand_path('./html/layout-xhtml1.html.erb', ReVIEW::Template::TEMPLATE_DIR)
end
tmpl = ReVIEW::Template.load(tmplfile)
tmpl.result(binding)
end | ruby | def titlepage
@title = CGI.escapeHTML(@producer.config.name_of('title'))
@body = <<EOT
<h1 class="tp-title">#{@title}</h1>
EOT
if @producer.config['subtitle']
@body << <<EOT
<h2 class="tp-subtitle">#{CGI.escapeHTML(@producer.config.name_of('subtitle'))}</h2>
EOT
end
if @producer.config['aut']
@body << <<EOT
<p>
<br />
<br />
</p>
<h2 class="tp-author">#{CGI.escapeHTML(join_with_separator(@producer.config.names_of('aut'), ReVIEW::I18n.t('names_splitter')))}</h2>
EOT
end
publisher = @producer.config.names_of('pbl')
if publisher
@body << <<EOT
<p>
<br />
<br />
<br />
<br />
</p>
<h3 class="tp-publisher">#{CGI.escapeHTML(join_with_separator(publisher, ReVIEW::I18n.t('names_splitter')))}</h3>
EOT
end
@language = @producer.config['language']
@stylesheets = @producer.config['stylesheet']
tmplfile = if @producer.config['htmlversion'].to_i == 5
File.expand_path('./html/layout-html5.html.erb', ReVIEW::Template::TEMPLATE_DIR)
else
File.expand_path('./html/layout-xhtml1.html.erb', ReVIEW::Template::TEMPLATE_DIR)
end
tmpl = ReVIEW::Template.load(tmplfile)
tmpl.result(binding)
end | [
"def",
"titlepage",
"@title",
"=",
"CGI",
".",
"escapeHTML",
"(",
"@producer",
".",
"config",
".",
"name_of",
"(",
"'title'",
")",
")",
"@body",
"=",
"<<EOT",
"#{",
"@title",
"}",
"EOT",
"if",
"@producer",
".",
"config",
"[",
"'subtitle'",
"]",
"@body",
... | Return title (copying) content.
NOTE: this method is not used yet.
see lib/review/epubmaker.rb#build_titlepage | [
"Return",
"title",
"(",
"copying",
")",
"content",
".",
"NOTE",
":",
"this",
"method",
"is",
"not",
"used",
"yet",
".",
"see",
"lib",
"/",
"review",
"/",
"epubmaker",
".",
"rb#build_titlepage"
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/epubcommon.rb#L163-L208 | train | Returns a new titlepage object. | [
30522,
13366,
2516,
13704,
1030,
2516,
1027,
1039,
5856,
1012,
4019,
11039,
19968,
1006,
1030,
3135,
1012,
9530,
8873,
2290,
1012,
2171,
1035,
1997,
1006,
1005,
2516,
1005,
1007,
1007,
1030,
2303,
1027,
1026,
1026,
1041,
4140,
1026,
1044,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_scheduler/lib/2016-03-01/generated/azure_mgmt_scheduler/jobs.rb | Azure::Scheduler::Mgmt::V2016_03_01.Jobs.patch_with_http_info | def patch_with_http_info(resource_group_name, job_collection_name, job_name, job, custom_headers:nil)
patch_async(resource_group_name, job_collection_name, job_name, job, custom_headers:custom_headers).value!
end | ruby | def patch_with_http_info(resource_group_name, job_collection_name, job_name, job, custom_headers:nil)
patch_async(resource_group_name, job_collection_name, job_name, job, custom_headers:custom_headers).value!
end | [
"def",
"patch_with_http_info",
"(",
"resource_group_name",
",",
"job_collection_name",
",",
"job_name",
",",
"job",
",",
"custom_headers",
":",
"nil",
")",
"patch_async",
"(",
"resource_group_name",
",",
"job_collection_name",
",",
"job_name",
",",
"job",
",",
"cust... | Patches an existing job.
@param resource_group_name [String] The resource group name.
@param job_collection_name [String] The job collection name.
@param job_name [String] The job name.
@param job [JobDefinition] The job definition.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Patches",
"an",
"existing",
"job",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_scheduler/lib/2016-03-01/generated/azure_mgmt_scheduler/jobs.rb#L266-L268 | train | Patch a job in a job collection. | [
30522,
13366,
8983,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3105,
1035,
3074,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
3105,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
8983,
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... |
watir/watir | lib/watir/elements/element.rb | Watir.Element.check_condition | def check_condition(condition, caller)
Watir.logger.debug "<- `Verifying precondition #{inspect}##{condition} for #{caller}`"
begin
condition.nil? ? assert_exists : send(condition)
Watir.logger.debug "<- `Verified precondition #{inspect}##{condition || 'assert_exists'}`"
rescue unknown_exception
raise unless condition.nil?
Watir.logger.debug "<- `Unable to satisfy precondition #{inspect}##{condition}`"
check_condition(:wait_for_exists, caller)
end
end | ruby | def check_condition(condition, caller)
Watir.logger.debug "<- `Verifying precondition #{inspect}##{condition} for #{caller}`"
begin
condition.nil? ? assert_exists : send(condition)
Watir.logger.debug "<- `Verified precondition #{inspect}##{condition || 'assert_exists'}`"
rescue unknown_exception
raise unless condition.nil?
Watir.logger.debug "<- `Unable to satisfy precondition #{inspect}##{condition}`"
check_condition(:wait_for_exists, caller)
end
end | [
"def",
"check_condition",
"(",
"condition",
",",
"caller",
")",
"Watir",
".",
"logger",
".",
"debug",
"\"<- `Verifying precondition #{inspect}##{condition} for #{caller}`\"",
"begin",
"condition",
".",
"nil?",
"?",
"assert_exists",
":",
"send",
"(",
"condition",
")",
... | rubocop:enable Metrics/AbcSize
rubocop:enable Metrics/MethodLength
rubocop:enable Metrics/PerceivedComplexity
rubocop:enable Metrics/CyclomaticComplexity: | [
"rubocop",
":",
"enable",
"Metrics",
"/",
"AbcSize",
"rubocop",
":",
"enable",
"Metrics",
"/",
"MethodLength",
"rubocop",
":",
"enable",
"Metrics",
"/",
"PerceivedComplexity",
"rubocop",
":",
"enable",
"Metrics",
"/",
"CyclomaticComplexity",
":"
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/elements/element.rb#L822-L833 | train | Verify that the given precondition is satisfied. | [
30522,
13366,
4638,
1035,
4650,
1006,
4650,
1010,
20587,
1007,
28194,
4313,
1012,
8833,
4590,
1012,
2139,
8569,
2290,
1000,
1026,
1011,
1036,
20410,
2075,
3653,
8663,
20562,
1001,
1063,
22459,
1065,
1001,
1001,
1063,
4650,
1065,
2005,
1001,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_networks.rb | Azure::Network::Mgmt::V2018_07_01.VirtualNetworks.list_usage_as_lazy | def list_usage_as_lazy(resource_group_name, virtual_network_name, custom_headers:nil)
response = list_usage_async(resource_group_name, virtual_network_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_usage_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_usage_as_lazy(resource_group_name, virtual_network_name, custom_headers:nil)
response = list_usage_async(resource_group_name, virtual_network_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_usage_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_usage_as_lazy",
"(",
"resource_group_name",
",",
"virtual_network_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_usage_async",
"(",
"resource_group_name",
",",
"virtual_network_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Lists usage stats.
@param resource_group_name [String] The name of the resource group.
@param virtual_network_name [String] The name of the virtual network.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VirtualNetworkListUsageResult] which provide lazy access to pages of
the response. | [
"Lists",
"usage",
"stats",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_networks.rb#L1227-L1236 | train | Gets the usage of the virtual network. | [
30522,
13366,
2862,
1035,
8192,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
2897,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
8192,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb | Azure::ContainerRegistry::Mgmt::V2018_02_01_preview.Builds.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:nil)
begin_update_async(resource_group_name, registry_name, build_id, build_update_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"registry_name",
",",
"build_id",
",",
"build_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"build_id",
",",
... | Patch the build properties.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param build_id [String] The build ID.
@param build_update_parameters [BuildUpdateParameters] The build update
properties.
@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. | [
"Patch",
"the",
"build",
"properties",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/builds.rb#L466-L468 | train | Updates a build s existing specification. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
3857,
1035,
8909,
1010,
3857,
1035,
10651,
1035,
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_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb | Azure::ApiManagement::Mgmt::V2016_10_10.ApiManagementServices.begin_update_hostname | def begin_update_hostname(resource_group_name, service_name, parameters, custom_headers:nil)
response = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update_hostname(resource_group_name, service_name, parameters, custom_headers:nil)
response = begin_update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update_hostname",
"(",
"resource_group_name",
",",
"service_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_hostname_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"parameters",
",",
"custom_h... | Creates, updates, or deletes the custom hostnames for an API Management
service. The custom hostname can be applied to the Proxy and Portal endpoint.
This is a long running operation and could take several minutes to complete.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param parameters [ApiManagementServiceUpdateHostnameParameters] Parameters
supplied to the UpdateHostname operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ApiManagementServiceResource] operation results. | [
"Creates",
"updates",
"or",
"deletes",
"the",
"custom",
"hostnames",
"for",
"an",
"API",
"Management",
"service",
".",
"The",
"custom",
"hostname",
"can",
"be",
"applied",
"to",
"the",
"Proxy",
"and",
"Portal",
"endpoint",
".",
"This",
"is",
"a",
"long",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb#L1568-L1571 | train | Updates the hostname of the specified App Service Environment. | [
30522,
13366,
4088,
1035,
10651,
1035,
3677,
18442,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
10651,
1035,
3677,
18442,
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... |
rails/rails | activerecord/lib/active_record/core.rb | ActiveRecord.Core.init_with | def init_with(coder, &block)
coder = LegacyYamlAdapter.convert(self.class, coder)
attributes = self.class.yaml_encoder.decode(coder)
init_with_attributes(attributes, coder["new_record"], &block)
end | ruby | def init_with(coder, &block)
coder = LegacyYamlAdapter.convert(self.class, coder)
attributes = self.class.yaml_encoder.decode(coder)
init_with_attributes(attributes, coder["new_record"], &block)
end | [
"def",
"init_with",
"(",
"coder",
",",
"&",
"block",
")",
"coder",
"=",
"LegacyYamlAdapter",
".",
"convert",
"(",
"self",
".",
"class",
",",
"coder",
")",
"attributes",
"=",
"self",
".",
"class",
".",
"yaml_encoder",
".",
"decode",
"(",
"coder",
")",
"... | New objects can be instantiated as either empty (pass no construction parameter) or pre-set with
attributes but not yet saved (pass a hash with key names matching the associated table column names).
In both instances, valid attribute keys are determined by the column names of the associated table --
hence you can't have attributes that aren't part of the table columns.
==== Example:
# Instantiates a single new object
User.new(first_name: 'Jamie')
Initialize an empty model object from +coder+. +coder+ should be
the result of previously encoding an Active Record model, using
#encode_with.
class Post < ActiveRecord::Base
end
old_post = Post.new(title: "hello world")
coder = {}
old_post.encode_with(coder)
post = Post.allocate
post.init_with(coder)
post.title # => 'hello world' | [
"New",
"objects",
"can",
"be",
"instantiated",
"as",
"either",
"empty",
"(",
"pass",
"no",
"construction",
"parameter",
")",
"or",
"pre",
"-",
"set",
"with",
"attributes",
"but",
"not",
"yet",
"saved",
"(",
"pass",
"a",
"hash",
"with",
"key",
"names",
"m... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/core.rb#L346-L350 | train | Initialize the object with the given coder. | [
30522,
13366,
1999,
4183,
1035,
2007,
1006,
3642,
2099,
1010,
1004,
3796,
1007,
3642,
2099,
1027,
8027,
14852,
27266,
9331,
3334,
1012,
10463,
1006,
2969,
1012,
2465,
1010,
3642,
2099,
1007,
12332,
1027,
2969,
1012,
2465,
1012,
8038,
19968,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_custom_prebuilt_domain | def delete_custom_prebuilt_domain(app_id, version_id, domain_name, custom_headers:nil)
response = delete_custom_prebuilt_domain_async(app_id, version_id, domain_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_custom_prebuilt_domain(app_id, version_id, domain_name, custom_headers:nil)
response = delete_custom_prebuilt_domain_async(app_id, version_id, domain_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_custom_prebuilt_domain",
"(",
"app_id",
",",
"version_id",
",",
"domain_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_custom_prebuilt_domain_async",
"(",
"app_id",
",",
"version_id",
",",
"domain_name",
",",
"custom_headers",
"... | Deletes a prebuilt domain's models in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param domain_name [String] Domain name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatus] operation results. | [
"Deletes",
"a",
"prebuilt",
"domain",
"s",
"models",
"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#L4890-L4893 | train | Deletes a prebuilt domain. | [
30522,
13366,
3972,
12870,
1035,
7661,
1035,
3653,
8569,
4014,
30524,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
7661,
1035,
3653,
8569,
4014,
2102,
1035,
5884,
1035,
2004,
6038,
2278,
1006,
10439,
1035,
8909,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | samples/Ruby/sinatra.rb | Sinatra.Base.process_route | def process_route(pattern, keys, conditions, block = nil, values = [])
route = @request.path_info
route = '/' if route.empty? and not settings.empty_path_info?
return unless match = pattern.match(route)
values += match.captures.to_a.map { |v| force_encoding URI.decode_www_form_component(v) if v }
if values.any?
original, @params = params, params.merge('splat' => [], 'captures' => values)
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
ensure
@params = original if original
end | ruby | def process_route(pattern, keys, conditions, block = nil, values = [])
route = @request.path_info
route = '/' if route.empty? and not settings.empty_path_info?
return unless match = pattern.match(route)
values += match.captures.to_a.map { |v| force_encoding URI.decode_www_form_component(v) if v }
if values.any?
original, @params = params, params.merge('splat' => [], 'captures' => values)
keys.zip(values) { |k,v| Array === @params[k] ? @params[k] << v : @params[k] = v if v }
end
catch(:pass) do
conditions.each { |c| throw :pass if c.bind(self).call == false }
block ? block[self, values] : yield(self, values)
end
ensure
@params = original if original
end | [
"def",
"process_route",
"(",
"pattern",
",",
"keys",
",",
"conditions",
",",
"block",
"=",
"nil",
",",
"values",
"=",
"[",
"]",
")",
"route",
"=",
"@request",
".",
"path_info",
"route",
"=",
"'/'",
"if",
"route",
".",
"empty?",
"and",
"not",
"settings"... | If the current request matches pattern and conditions, fill params
with keys and call the given block.
Revert params afterwards.
Returns pass block. | [
"If",
"the",
"current",
"request",
"matches",
"pattern",
"and",
"conditions",
"fill",
"params",
"with",
"keys",
"and",
"call",
"the",
"given",
"block",
".",
"Revert",
"params",
"afterwards",
"."
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/samples/Ruby/sinatra.rb#L865-L882 | train | Process the route | [
30522,
13366,
2832,
1035,
2799,
1006,
5418,
1010,
6309,
1010,
3785,
1010,
3796,
1027,
9152,
2140,
1010,
5300,
1027,
1031,
1033,
1007,
2799,
1027,
1030,
5227,
1012,
4130,
1035,
18558,
2799,
1027,
1005,
1013,
1005,
2065,
2799,
1012,
4064,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
awesome-print/awesome_print | lib/awesome_print/ext/active_record.rb | AwesomePrint.ActiveRecord.awesome_active_model_error | def awesome_active_model_error(object)
return object.inspect if !defined?(::ActiveSupport::OrderedHash)
return awesome_object(object) if @options[:raw]
object_dump = object.marshal_dump.first
data = if object_dump.class.column_names != object_dump.attributes.keys
object_dump.attributes
else
object_dump.class.column_names.inject(::ActiveSupport::OrderedHash.new) do |hash, name|
if object_dump.has_attribute?(name) || object_dump.new_record?
value = object_dump.respond_to?(name) ? object_dump.send(name) : object_dump.read_attribute(name)
hash[name.to_sym] = value
end
hash
end
end
data.merge!({details: object.details, messages: object.messages})
"#{object} " << awesome_hash(data)
end | ruby | def awesome_active_model_error(object)
return object.inspect if !defined?(::ActiveSupport::OrderedHash)
return awesome_object(object) if @options[:raw]
object_dump = object.marshal_dump.first
data = if object_dump.class.column_names != object_dump.attributes.keys
object_dump.attributes
else
object_dump.class.column_names.inject(::ActiveSupport::OrderedHash.new) do |hash, name|
if object_dump.has_attribute?(name) || object_dump.new_record?
value = object_dump.respond_to?(name) ? object_dump.send(name) : object_dump.read_attribute(name)
hash[name.to_sym] = value
end
hash
end
end
data.merge!({details: object.details, messages: object.messages})
"#{object} " << awesome_hash(data)
end | [
"def",
"awesome_active_model_error",
"(",
"object",
")",
"return",
"object",
".",
"inspect",
"if",
"!",
"defined?",
"(",
"::",
"ActiveSupport",
"::",
"OrderedHash",
")",
"return",
"awesome_object",
"(",
"object",
")",
"if",
"@options",
"[",
":raw",
"]",
"objec... | Format ActiveModel error object.
------------------------------------------------------------------------------ | [
"Format",
"ActiveModel",
"error",
"object",
".",
"------------------------------------------------------------------------------"
] | 4564fd74721562cbef2443f7d97109bf9192343d | https://github.com/awesome-print/awesome_print/blob/4564fd74721562cbef2443f7d97109bf9192343d/lib/awesome_print/ext/active_record.rb#L80-L99 | train | Returns a string representation of the object. | [
30522,
13366,
12476,
1035,
3161,
1035,
2944,
1035,
7561,
1006,
4874,
1007,
2709,
4874,
1012,
22459,
2065,
999,
4225,
1029,
1006,
1024,
1024,
3161,
6342,
9397,
11589,
1024,
1024,
3641,
14949,
2232,
1007,
2709,
12476,
1035,
4874,
1006,
4874,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_run_action_repetitions.rb | Azure::Logic::Mgmt::V2016_06_01.WorkflowRunActionRepetitions.list_expression_traces | def list_expression_traces(resource_group_name, workflow_name, run_name, action_name, repetition_name, custom_headers:nil)
response = list_expression_traces_async(resource_group_name, workflow_name, run_name, action_name, repetition_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_expression_traces(resource_group_name, workflow_name, run_name, action_name, repetition_name, custom_headers:nil)
response = list_expression_traces_async(resource_group_name, workflow_name, run_name, action_name, repetition_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_expression_traces",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"run_name",
",",
"action_name",
",",
"repetition_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_expression_traces_async",
"(",
"resource_group_name",
",",
"wor... | Lists a workflow run expression trace.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param run_name [String] The workflow run name.
@param action_name [String] The workflow action name.
@param repetition_name [String] The workflow repetition.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ExpressionTraces] operation results. | [
"Lists",
"a",
"workflow",
"run",
"expression",
"trace",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_run_action_repetitions.rb#L241-L244 | train | Gets the expression traces for a workflow run. | [
30522,
13366,
2862,
1035,
3670,
1035,
10279,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
2448,
1035,
2171,
1010,
2895,
1035,
2171,
1010,
23318,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | 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.update_service_with_http_info | def update_service_with_http_info(service_id, service_update_description, timeout:60, custom_headers:nil)
update_service_async(service_id, service_update_description, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def update_service_with_http_info(service_id, service_update_description, timeout:60, custom_headers:nil)
update_service_async(service_id, service_update_description, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"update_service_with_http_info",
"(",
"service_id",
",",
"service_update_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"update_service_async",
"(",
"service_id",
",",
"service_update_description",
",",
"timeout",
":",
"timeout",... | Updates a Service Fabric service using the specified update description.
This API allows updating properties of a running Service Fabric service. The
set of properties that can be updated are a subset of the properties that
were specified at the time of creating the service. The current set of
properties can be obtained using `GetServiceDescription` API. Please note
that updating the properties of a running service is different than upgrading
your application using `StartApplicationUpgrade` API. The upgrade is a long
running background operation that involves moving the application from one
version to another, one upgrade domain at a time, whereas update applies the
new properties immediately to 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 service_update_description [ServiceUpdateDescription] The information
necessary to update a service.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"a",
"Service",
"Fabric",
"service",
"using",
"the",
"specified",
"update",
"description",
"."
] | 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#L10584-L10586 | train | Updates a service. | [
30522,
13366,
10651,
1035,
2326,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2326,
1035,
8909,
1010,
2326,
1035,
10651,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
1035,
2326,
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... |
watir/watir | lib/watir/scroll.rb | Watir.Scroll.to | def to(param = :top)
args = @object.is_a?(Watir::Element) ? element_scroll(param) : browser_scroll(param)
raise ArgumentError, "Don't know how to scroll #{@object} to: #{param}!" if args.nil?
@object.browser.execute_script(*args)
self
end | ruby | def to(param = :top)
args = @object.is_a?(Watir::Element) ? element_scroll(param) : browser_scroll(param)
raise ArgumentError, "Don't know how to scroll #{@object} to: #{param}!" if args.nil?
@object.browser.execute_script(*args)
self
end | [
"def",
"to",
"(",
"param",
"=",
":top",
")",
"args",
"=",
"@object",
".",
"is_a?",
"(",
"Watir",
"::",
"Element",
")",
"?",
"element_scroll",
"(",
"param",
")",
":",
"browser_scroll",
"(",
"param",
")",
"raise",
"ArgumentError",
",",
"\"Don't know how to s... | Scrolls to specified location.
@param [Symbol] param | [
"Scrolls",
"to",
"specified",
"location",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/scroll.rb#L26-L32 | train | Scrolls the page to the specified position. | [
30522,
13366,
2000,
1006,
11498,
2213,
1027,
1024,
2327,
1007,
12098,
5620,
1027,
1030,
4874,
1012,
2003,
1035,
1037,
1029,
1006,
28194,
4313,
1024,
1024,
5783,
30524,
1001,
1063,
1030,
4874,
1065,
2000,
1024,
1001,
1063,
11498,
2213,
1065,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_by_billing_account_next | def list_by_billing_account_next(next_page_link, custom_headers:nil)
response = list_by_billing_account_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_billing_account_next(next_page_link, custom_headers:nil)
response = list_by_billing_account_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_billing_account_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_billing_account_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"un... | Lists the usage details by billingAccountId for a scope by current 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",
"by",
"billingAccountId",
"for",
"a",
"scope",
"by",
"current",
"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#L1420-L1423 | train | Gets the list of all the available advisors. | [
30522,
13366,
2862,
1035,
2011,
1035,
25640,
1035,
4070,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
25640,
1035,
4070,
1035,
2279,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/data/channel.rb | Discordrb.Channel.send_file | def send_file(file, caption: nil, tts: false, filename: nil, spoiler: nil)
@bot.send_file(@id, file, caption: caption, tts: tts, filename: filename, spoiler: spoiler)
end | ruby | def send_file(file, caption: nil, tts: false, filename: nil, spoiler: nil)
@bot.send_file(@id, file, caption: caption, tts: tts, filename: filename, spoiler: spoiler)
end | [
"def",
"send_file",
"(",
"file",
",",
"caption",
":",
"nil",
",",
"tts",
":",
"false",
",",
"filename",
":",
"nil",
",",
"spoiler",
":",
"nil",
")",
"@bot",
".",
"send_file",
"(",
"@id",
",",
"file",
",",
"caption",
":",
"caption",
",",
"tts",
":",... | Sends a file to this channel. If it is an image, it will be embedded.
@param file [File] The file to send. There's no clear size limit for this, you'll have to attempt it for yourself (most non-image files are fine, large images may fail to embed)
@param caption [string] The caption for the file.
@param tts [true, false] Whether or not this file's caption should be sent using Discord text-to-speech.
@param filename [String] Overrides the filename of the uploaded file
@param spoiler [true, false] Whether or not this file should appear as a spoiler.
@example Send a file from disk
channel.send_file(File.open('rubytaco.png', 'r')) | [
"Sends",
"a",
"file",
"to",
"this",
"channel",
".",
"If",
"it",
"is",
"an",
"image",
"it",
"will",
"be",
"embedded",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/channel.rb#L393-L395 | train | Send a file to the bot | [
30522,
13366,
4604,
1035,
5371,
1006,
5371,
1010,
14408,
3258,
1024,
9152,
2140,
1010,
23746,
2015,
1024,
6270,
1010,
5371,
18442,
1024,
9152,
2140,
1010,
27594,
2121,
1024,
9152,
2140,
1007,
1030,
28516,
1012,
4604,
1035,
5371,
1006,
1030,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
appsignal/rdkafka-ruby | lib/rdkafka/consumer.rb | Rdkafka.Consumer.subscription | def subscription
tpl = FFI::MemoryPointer.new(:pointer)
response = Rdkafka::Bindings.rd_kafka_subscription(@native_kafka, tpl)
if response != 0
raise Rdkafka::RdkafkaError.new(response)
end
tpl = tpl.read(:pointer).tap { |it| it.autorelease = false }
begin
Rdkafka::Consumer::TopicPartitionList.from_native_tpl(tpl)
ensure
Rdkafka::Bindings.rd_kafka_topic_partition_list_destroy(tpl)
end
end | ruby | def subscription
tpl = FFI::MemoryPointer.new(:pointer)
response = Rdkafka::Bindings.rd_kafka_subscription(@native_kafka, tpl)
if response != 0
raise Rdkafka::RdkafkaError.new(response)
end
tpl = tpl.read(:pointer).tap { |it| it.autorelease = false }
begin
Rdkafka::Consumer::TopicPartitionList.from_native_tpl(tpl)
ensure
Rdkafka::Bindings.rd_kafka_topic_partition_list_destroy(tpl)
end
end | [
"def",
"subscription",
"tpl",
"=",
"FFI",
"::",
"MemoryPointer",
".",
"new",
"(",
":pointer",
")",
"response",
"=",
"Rdkafka",
"::",
"Bindings",
".",
"rd_kafka_subscription",
"(",
"@native_kafka",
",",
"tpl",
")",
"if",
"response",
"!=",
"0",
"raise",
"Rdkaf... | Return the current subscription to topics and partitions
@raise [RdkafkaError] When getting the subscription fails.
@return [TopicPartitionList] | [
"Return",
"the",
"current",
"subscription",
"to",
"topics",
"and",
"partitions"
] | 87b3e0ddae5ea576847cb67228fcea06ec2a24d6 | https://github.com/appsignal/rdkafka-ruby/blob/87b3e0ddae5ea576847cb67228fcea06ec2a24d6/lib/rdkafka/consumer.rb#L104-L117 | train | Returns the next chunk of the subscription. | [
30522,
13366,
15002,
1056,
24759,
1027,
21461,
2072,
1024,
1024,
3638,
8400,
2121,
1012,
2047,
1006,
1024,
20884,
1007,
3433,
1027,
16428,
2912,
24316,
2050,
1024,
1024,
8031,
2015,
1012,
16428,
1035,
10556,
24316,
2050,
1035,
15002,
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... |
mikel/mail | lib/mail/utilities.rb | Mail.Utilities.quote_token | def quote_token( str )
if str.respond_to?(:force_encoding)
original_encoding = str.encoding
ascii_str = str.to_s.dup.force_encoding('ASCII-8BIT')
if token_safe?( ascii_str )
str
else
dquote(ascii_str).force_encoding(original_encoding)
end
else
token_safe?( str ) ? str : dquote(str)
end
end | ruby | def quote_token( str )
if str.respond_to?(:force_encoding)
original_encoding = str.encoding
ascii_str = str.to_s.dup.force_encoding('ASCII-8BIT')
if token_safe?( ascii_str )
str
else
dquote(ascii_str).force_encoding(original_encoding)
end
else
token_safe?( str ) ? str : dquote(str)
end
end | [
"def",
"quote_token",
"(",
"str",
")",
"if",
"str",
".",
"respond_to?",
"(",
":force_encoding",
")",
"original_encoding",
"=",
"str",
".",
"encoding",
"ascii_str",
"=",
"str",
".",
"to_s",
".",
"dup",
".",
"force_encoding",
"(",
"'ASCII-8BIT'",
")",
"if",
... | If the string supplied has TOKEN unsafe characters in it, will return the string quoted
in double quotes, otherwise returns the string unmodified | [
"If",
"the",
"string",
"supplied",
"has",
"TOKEN",
"unsafe",
"characters",
"in",
"it",
"will",
"return",
"the",
"string",
"quoted",
"in",
"double",
"quotes",
"otherwise",
"returns",
"the",
"string",
"unmodified"
] | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/utilities.rb#L44-L56 | train | Quote a string | [
30522,
13366,
14686,
1035,
19204,
1006,
2358,
2099,
1007,
2065,
2358,
2099,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
2486,
1035,
17181,
1007,
2434,
1035,
17181,
1027,
2358,
2099,
1012,
17181,
2004,
6895,
2072,
1035,
2358,
2099,
1027,
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... |
hashicorp/vault-ruby | lib/vault/api/sys/auth.rb | Vault.Sys.auth_tune | def auth_tune(path)
json = client.get("/v1/sys/auth/#{encode_path(path)}/tune")
return AuthConfig.decode(json)
rescue HTTPError => e
return nil if e.code == 404
raise
end | ruby | def auth_tune(path)
json = client.get("/v1/sys/auth/#{encode_path(path)}/tune")
return AuthConfig.decode(json)
rescue HTTPError => e
return nil if e.code == 404
raise
end | [
"def",
"auth_tune",
"(",
"path",
")",
"json",
"=",
"client",
".",
"get",
"(",
"\"/v1/sys/auth/#{encode_path(path)}/tune\"",
")",
"return",
"AuthConfig",
".",
"decode",
"(",
"json",
")",
"rescue",
"HTTPError",
"=>",
"e",
"return",
"nil",
"if",
"e",
".",
"code... | Read the given auth path's configuration.
@example
Vault.sys.auth_tune("github") #=> #<Vault::AuthConfig "default_lease_ttl"=3600, "max_lease_ttl"=7200>
@param [String] path
the path to retrieve configuration for
@return [AuthConfig]
configuration of the given auth path | [
"Read",
"the",
"given",
"auth",
"path",
"s",
"configuration",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/sys/auth.rb#L89-L95 | train | Get the auth tune for a given path | [
30522,
13366,
8740,
2705,
1035,
8694,
1006,
4130,
1007,
1046,
3385,
1027,
7396,
1012,
2131,
1006,
1000,
1013,
1058,
2487,
1013,
25353,
2015,
1013,
8740,
2705,
1013,
1001,
1063,
4372,
16044,
1035,
4130,
1006,
4130,
1007,
1065,
1013,
8694,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/template_scope.rb | Ufo.TemplateScope.load_variables_file | def load_variables_file(filename)
path = "#{Ufo.root}/.ufo/variables/#{filename}.rb"
instance_eval(IO.read(path), path) if File.exist?(path)
end | ruby | def load_variables_file(filename)
path = "#{Ufo.root}/.ufo/variables/#{filename}.rb"
instance_eval(IO.read(path), path) if File.exist?(path)
end | [
"def",
"load_variables_file",
"(",
"filename",
")",
"path",
"=",
"\"#{Ufo.root}/.ufo/variables/#{filename}.rb\"",
"instance_eval",
"(",
"IO",
".",
"read",
"(",
"path",
")",
",",
"path",
")",
"if",
"File",
".",
"exist?",
"(",
"path",
")",
"end"
] | Load the variables defined in ufo/variables/* to make available in the
template blocks in ufo/templates/*.
Example:
`ufo/variables/base.rb`:
@name = "docker-process-name"
@image = "docker-image-name"
`ufo/templates/main.json.erb`:
{
"containerDefinitions": [
{
"name": "<%= @name %>",
"image": "<%= @image %>",
....
}
NOTE: Only able to make instance variables avaialble with instance_eval
Wasnt able to make local variables available. | [
"Load",
"the",
"variables",
"defined",
"in",
"ufo",
"/",
"variables",
"/",
"*",
"to",
"make",
"available",
"in",
"the",
"template",
"blocks",
"in",
"ufo",
"/",
"templates",
"/",
"*",
"."
] | 16ac3dad28edcab2693c0e7d89a1971aca65b8f9 | https://github.com/tongueroo/ufo/blob/16ac3dad28edcab2693c0e7d89a1971aca65b8f9/lib/ufo/template_scope.rb#L35-L38 | train | Load the variables file | [
30522,
13366,
7170,
1035,
10857,
1035,
5371,
1006,
5371,
18442,
1007,
4130,
1027,
1000,
1001,
1063,
24321,
1012,
7117,
1065,
1013,
1012,
24321,
1013,
10857,
1013,
1001,
1063,
5371,
18442,
1065,
1012,
21144,
1000,
6013,
1035,
9345,
2140,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-sqs/lib/aws-sdk-sqs/queue.rb | Aws::SQS.Queue.send_messages | def send_messages(options = {})
options = options.merge(queue_url: @url)
resp = @client.send_message_batch(options)
resp.data
end | ruby | def send_messages(options = {})
options = options.merge(queue_url: @url)
resp = @client.send_message_batch(options)
resp.data
end | [
"def",
"send_messages",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"queue_url",
":",
"@url",
")",
"resp",
"=",
"@client",
".",
"send_message_batch",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
queue.send_messages({
entries: [ # required
{
id: "String", # required
message_body: "String", # required
delay_seconds: 1,
message_attributes: {
"String" => {
string_value: "String",
binary_value: "data",
string_list_values: ["String"],
binary_list_values: ["data"],
data_type: "String", # required
},
},
message_deduplication_id: "String",
message_group_id: "String",
},
],
})
@param [Hash] options ({})
@option options [required, Array<Types::SendMessageBatchRequestEntry>] :entries
A list of ` SendMessageBatchRequestEntry ` items.
@return [Types::SendMessageBatchResult] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-sqs/lib/aws-sdk-sqs/queue.rb#L547-L551 | train | Send messages to the queue | [
30522,
13366,
4604,
1035,
7696,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
24240,
1035,
24471,
2140,
1024,
1030,
24471,
2140,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
4604,
1035,
4471,
1035,
14108,
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... |
mojombo/chronic | lib/chronic/handlers.rb | Chronic.Handlers.handle_s_r_p | def handle_s_r_p(tokens, options)
span = Span.new(self.now, self.now + 1)
handle_srp(tokens, span, options)
end | ruby | def handle_s_r_p(tokens, options)
span = Span.new(self.now, self.now + 1)
handle_srp(tokens, span, options)
end | [
"def",
"handle_s_r_p",
"(",
"tokens",
",",
"options",
")",
"span",
"=",
"Span",
".",
"new",
"(",
"self",
".",
"now",
",",
"self",
".",
"now",
"+",
"1",
")",
"handle_srp",
"(",
"tokens",
",",
"span",
",",
"options",
")",
"end"
] | Handle scalar/repeater/pointer | [
"Handle",
"scalar",
"/",
"repeater",
"/",
"pointer"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L455-L459 | train | Handle the SRP and SRP tokens | [
30522,
13366,
5047,
1035,
1055,
1035,
1054,
1035,
1052,
1006,
19204,
2015,
1010,
7047,
1007,
8487,
1027,
8487,
1012,
2047,
1006,
2969,
1012,
2085,
1010,
2969,
1012,
2085,
1009,
1015,
1007,
5047,
1035,
5034,
2361,
1006,
19204,
2015,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/resource_health_metadata_operations.rb | Azure::Web::Mgmt::V2018_02_01.ResourceHealthMetadataOperations.list_by_site_slot_next | def list_by_site_slot_next(next_page_link, custom_headers:nil)
response = list_by_site_slot_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_site_slot_next(next_page_link, custom_headers:nil)
response = list_by_site_slot_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_site_slot_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_site_slot_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"re... | Gets the category of ResourceHealthMetadata to use for the given site as a
collection
Gets the category of ResourceHealthMetadata to use for the given site as a
collection
@param 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 [ResourceHealthMetadataCollection] operation results. | [
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
"as",
"a",
"collection"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/resource_health_metadata_operations.rb#L970-L973 | train | Gets the list of all the available adhoc terms. | [
30522,
13366,
2862,
1035,
2011,
1035,
2609,
1035,
10453,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
2609,
1035,
10453,
1035,
2279,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb | Azure::StorageSync::Mgmt::V2018_07_01.CloudEndpoints.pre_restore | def pre_restore(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:nil)
response = pre_restore_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def pre_restore(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:nil)
response = pre_restore_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"pre_restore",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"sync_group_name",
",",
"cloud_endpoint_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"pre_restore_async",
"(",
"resource_group_name",
",",
"sto... | Pre Restore a given CloudEndpoint.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param storage_sync_service_name [String] Name of Storage Sync Service
resource.
@param sync_group_name [String] Name of Sync Group resource.
@param cloud_endpoint_name [String] Name of Cloud Endpoint object.
@param parameters [PreRestoreRequest] Body of Cloud Endpoint object.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Pre",
"Restore",
"a",
"given",
"CloudEndpoint",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb#L455-L458 | train | Pre - restores the specified cloud endpoint. | [
30522,
13366,
3653,
1035,
9239,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5527,
1035,
26351,
1035,
2326,
1035,
2171,
1010,
26351,
1035,
2177,
1035,
2171,
1010,
6112,
1035,
2203,
8400,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jeremytregunna/ruby-trello | lib/trello/card.rb | Trello.Card.update! | def update!
@previously_changed = changes
# extract only new values to build payload
payload = Hash[changes.map { |key, values| [SYMBOL_TO_STRING[key.to_sym].to_sym, values[1]] }]
@changed_attributes.clear
client.put("/cards/#{id}", payload)
end | ruby | def update!
@previously_changed = changes
# extract only new values to build payload
payload = Hash[changes.map { |key, values| [SYMBOL_TO_STRING[key.to_sym].to_sym, values[1]] }]
@changed_attributes.clear
client.put("/cards/#{id}", payload)
end | [
"def",
"update!",
"@previously_changed",
"=",
"changes",
"# extract only new values to build payload",
"payload",
"=",
"Hash",
"[",
"changes",
".",
"map",
"{",
"|",
"key",
",",
"values",
"|",
"[",
"SYMBOL_TO_STRING",
"[",
"key",
".",
"to_sym",
"]",
".",
"to_sym"... | Update an existing record.
Warning: this updates all fields using values already in memory. If
an external resource has updated these fields, you should refresh!
this object before making your changes, and before updating the record.
@raise [Trello::Error] if the card could not be updated.
@return [String] The JSON representation of the updated card returned by
the Trello API. | [
"Update",
"an",
"existing",
"record",
"."
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/card.rb#L276-L283 | train | Update the current card object | [
30522,
13366,
10651,
999,
1030,
3130,
1035,
2904,
1027,
3431,
1001,
14817,
2069,
2047,
5300,
2000,
3857,
18093,
18093,
1027,
23325,
1031,
3431,
1012,
4949,
1063,
1064,
3145,
1010,
5300,
1064,
1031,
6454,
1035,
2000,
1035,
5164,
1031,
3145,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.hidden_field | def hidden_field(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'hidden_field_for', &block)
define_method(name) do
return platform.hidden_field_value_for identifier.clone unless block_given?
self.send("#{name}_element").value
end
end | ruby | def hidden_field(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'hidden_field_for', &block)
define_method(name) do
return platform.hidden_field_value_for identifier.clone unless block_given?
self.send("#{name}_element").value
end
end | [
"def",
"hidden_field",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'hidden_field_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
... | adds three methods to the page object - one to get the text from a hidden field,
another to retrieve the hidden field element, and another to check the hidden
field's existence.
@example
hidden_field(:user_id, :id => "user_identity")
# will generate 'user_id', 'user_id_element' and 'user_id?' methods
@param [String] the name used for the generated methods
@param [Hash] identifier how we find a hidden field.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"to",
"the",
"page",
"object",
"-",
"one",
"to",
"get",
"the",
"text",
"from",
"a",
"hidden",
"field",
"another",
"to",
"retrieve",
"the",
"hidden",
"field",
"element",
"and",
"another",
"to",
"check",
"the",
"hidden",
"field",
... | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L221-L227 | train | Creates a hidden field. | [
30522,
13366,
5023,
1035,
2492,
1006,
2171,
1010,
8909,
4765,
18095,
1027,
1063,
1024,
5950,
1027,
1028,
1014,
1065,
1010,
1004,
3796,
1007,
3115,
1035,
4725,
1006,
2171,
1010,
8909,
4765,
18095,
1010,
1005,
5023,
1035,
2492,
1035,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/gateway.rb | Discordrb.Gateway.send_packet | def send_packet(opcode, packet)
data = {
op: opcode,
d: packet
}
send(data.to_json)
end | ruby | def send_packet(opcode, packet)
data = {
op: opcode,
d: packet
}
send(data.to_json)
end | [
"def",
"send_packet",
"(",
"opcode",
",",
"packet",
")",
"data",
"=",
"{",
"op",
":",
"opcode",
",",
"d",
":",
"packet",
"}",
"send",
"(",
"data",
".",
"to_json",
")",
"end"
] | Sends a custom packet over the connection. This can be useful to implement future yet unimplemented functionality
or for testing. You probably shouldn't use this unless you know what you're doing.
@param opcode [Integer] The opcode the packet should be sent as. Can be one of {Opcodes} or a custom value if
necessary.
@param packet [Object] Some arbitrary JSON-serialisable data that should be sent as the `d` field. | [
"Sends",
"a",
"custom",
"packet",
"over",
"the",
"connection",
".",
"This",
"can",
"be",
"useful",
"to",
"implement",
"future",
"yet",
"unimplemented",
"functionality",
"or",
"for",
"testing",
".",
"You",
"probably",
"shouldn",
"t",
"use",
"this",
"unless",
... | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/gateway.rb#L406-L413 | train | Send a packet to the server | [
30522,
13366,
4604,
1035,
14771,
1006,
6728,
16044,
1010,
14771,
1007,
2951,
1027,
1063,
6728,
1024,
6728,
16044,
1010,
1040,
1024,
14771,
1065,
4604,
1006,
2951,
1012,
2000,
1035,
1046,
3385,
1007,
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_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_cluster_health_using_policy | def get_cluster_health_using_policy(nodes_health_state_filter:0, applications_health_state_filter:0, events_health_state_filter:0, exclude_health_statistics:false, include_system_application_health_statistics:false, cluster_health_policies:nil, timeout:60, custom_headers:nil)
response = get_cluster_health_using_policy_async(nodes_health_state_filter:nodes_health_state_filter, applications_health_state_filter:applications_health_state_filter, events_health_state_filter:events_health_state_filter, exclude_health_statistics:exclude_health_statistics, include_system_application_health_statistics:include_system_application_health_statistics, cluster_health_policies:cluster_health_policies, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_cluster_health_using_policy(nodes_health_state_filter:0, applications_health_state_filter:0, events_health_state_filter:0, exclude_health_statistics:false, include_system_application_health_statistics:false, cluster_health_policies:nil, timeout:60, custom_headers:nil)
response = get_cluster_health_using_policy_async(nodes_health_state_filter:nodes_health_state_filter, applications_health_state_filter:applications_health_state_filter, events_health_state_filter:events_health_state_filter, exclude_health_statistics:exclude_health_statistics, include_system_application_health_statistics:include_system_application_health_statistics, cluster_health_policies:cluster_health_policies, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_cluster_health_using_policy",
"(",
"nodes_health_state_filter",
":",
"0",
",",
"applications_health_state_filter",
":",
"0",
",",
"events_health_state_filter",
":",
"0",
",",
"exclude_health_statistics",
":",
"false",
",",
"include_system_application_health_statisti... | Gets the health of a Service Fabric cluster using the specified policy.
Gets the health of a Service Fabric cluster.
Use EventsHealthStateFilter to filter the collection of health events
reported on the cluster based on the health state.
Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to
filter the collection of nodes and applications returned based on their
aggregated health state.
Use ClusterHealthPolicies to override the health policies used to evaluate
the health.
@param nodes_health_state_filter [Integer] Allows filtering of the node
health state objects returned in the result of cluster health query
based on their health state. The possible values for this parameter include
integer value of one of the
following health states. Only nodes that match the filter are returned. All
nodes are used to evaluate the aggregated health state.
If not specified, all entries are returned.
The state values are flag based enumeration, so the value could be a
combination of these values obtained using bitwise 'OR' operator.
For example, if the provided value is 6 then health state of nodes with
HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param applications_health_state_filter [Integer] Allows filtering of the
application health state objects returned in the result of cluster health
query based on their health state.
The possible values for this parameter include integer value obtained from
members or bitwise operations
on members of HealthStateFilter enumeration. Only applications that match the
filter are returned.
All applications are used to evaluate the aggregated health state. If not
specified, all entries are returned.
The state values are flag based enumeration, so the value could be a
combination of these values obtained using bitwise 'OR' operator.
For example, if the provided value is 6 then health state of applications
with HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param events_health_state_filter [Integer] Allows filtering the collection
of HealthEvent objects returned based on health state.
The possible values for this parameter include integer value of one of the
following health states.
Only events that match the filter are returned. All events are used to
evaluate the aggregated health state.
If not specified, all entries are returned. The state values are flag based
enumeration, so the value could be a combination of these value obtained
using bitwise 'OR' operator. For example, If the provided value is 6 then all
of the events with HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param exclude_health_statistics [Boolean] Indicates whether the health
statistics should be returned as part of the query result. False by default.
The statistics show the number of children entities in health state Ok,
Warning, and Error.
@param include_system_application_health_statistics [Boolean] Indicates
whether the health statistics should include the fabric:/System application
health statistics. False by default.
If IncludeSystemApplicationHealthStatistics is set to true, the health
statistics include the entities that belong to the fabric:/System
application.
Otherwise, the query result includes health statistics only for user
applications.
The health statistics must be included in the query result for this parameter
to be applied.
@param cluster_health_policies [ClusterHealthPolicies] Describes the health
policies used to evaluate the cluster health.
If not present, the health evaluation uses the cluster health policy defined
in the cluster manifest or the default cluster health policy.
By default, each application is evaluated using its specific application
health policy, defined in the application manifest, or the default health
policy, if no policy is defined in manifest.
If the application health policy map is specified, and it has an entry for an
application, the specified application health policy
is used to evaluate the application health.
@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 [ClusterHealth] operation results. | [
"Gets",
"the",
"health",
"of",
"a",
"Service",
"Fabric",
"cluster",
"using",
"the",
"specified",
"policy",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L719-L722 | train | Gets cluster health using the specified policy. | [
30522,
13366,
2131,
1035,
9324,
1035,
2740,
1035,
2478,
1035,
3343,
1006,
14164,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
5097,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
2824,
1035,
2740,
1035,
2110,
1035,
11307,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.generate_thumbnail_in_stream_with_http_info | def generate_thumbnail_in_stream_with_http_info(width, height, image, smart_cropping:false, custom_headers:nil)
generate_thumbnail_in_stream_async(width, height, image, smart_cropping:smart_cropping, custom_headers:custom_headers).value!
end | ruby | def generate_thumbnail_in_stream_with_http_info(width, height, image, smart_cropping:false, custom_headers:nil)
generate_thumbnail_in_stream_async(width, height, image, smart_cropping:smart_cropping, custom_headers:custom_headers).value!
end | [
"def",
"generate_thumbnail_in_stream_with_http_info",
"(",
"width",
",",
"height",
",",
"image",
",",
"smart_cropping",
":",
"false",
",",
"custom_headers",
":",
"nil",
")",
"generate_thumbnail_in_stream_async",
"(",
"width",
",",
"height",
",",
"image",
",",
"smart... | This operation generates a thumbnail image with the user-specified width and
height. By default, the service analyzes the image, identifies the region of
interest (ROI), and generates smart cropping coordinates based on the ROI.
Smart cropping helps when you specify an aspect ratio that differs from that
of the input image.
A successful response contains the thumbnail image binary. If the request
failed, the response contains an error code and a message to help determine
what went wrong.
Upon failure, the error code and an error message are returned. The error
code could be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize,
InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or
InternalServerError.
@param width [Integer] Width of the thumbnail, in pixels. It must be between
1 and 1024. Recommended minimum of 50.
@param height [Integer] Height of the thumbnail, in pixels. It must be
between 1 and 1024. Recommended minimum of 50.
@param image An image stream.
@param smart_cropping [Boolean] Boolean flag for enabling smart cropping.
@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",
"thumbnail",
"image",
"with",
"the",
"user",
"-",
"specified",
"width",
"and",
"height",
".",
"By",
"default",
"the",
"service",
"analyzes",
"the",
"image",
"identifies",
"the",
"region",
"of",
"interest",
"(",
"ROI",
"... | 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#L2413-L2415 | train | Generates a thumbnail in a stream. | [
30522,
13366,
9699,
1035,
7639,
25464,
1035,
1999,
1035,
5460,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
9381,
1010,
4578,
1010,
3746,
1010,
6047,
1035,
10416,
4691,
1024,
6270,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
9699,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_association.rb | Aws::EC2.RouteTableAssociation.delete | def delete(options = {})
options = options.merge(association_id: @id)
resp = @client.disassociate_route_table(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(association_id: @id)
resp = @client.disassociate_route_table(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"association_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"disassociate_route_table",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
route_table_association.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] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/route_table_association.rb#L192-L196 | train | Delete the route table from the association | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2523,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
4487,
20939,
6499,
7405,
2618,
1035,
2799,
1035,
2795,
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_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_network_gateways.rb | Azure::Network::Mgmt::V2018_07_01.VirtualNetworkGateways.list_connections_next | def list_connections_next(next_page_link, custom_headers:nil)
response = list_connections_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_connections_next(next_page_link, custom_headers:nil)
response = list_connections_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_connections_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_connections_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"resp... | Gets all the connections in a virtual network gateway.
@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 [VirtualNetworkGatewayListConnectionsResult] operation results. | [
"Gets",
"all",
"the",
"connections",
"in",
"a",
"virtual",
"network",
"gateway",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_network_gateways.rb#L2430-L2433 | train | Gets the list of all the connections in a service resource group. | [
30522,
13366,
2862,
1035,
7264,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.list_custom_prebuilt_models | def list_custom_prebuilt_models(app_id, version_id, custom_headers:nil)
response = list_custom_prebuilt_models_async(app_id, version_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_custom_prebuilt_models(app_id, version_id, custom_headers:nil)
response = list_custom_prebuilt_models_async(app_id, version_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_custom_prebuilt_models",
"(",
"app_id",
",",
"version_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_custom_prebuilt_models_async",
"(",
"app_id",
",",
"version_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"respo... | Gets all prebuilt intent and entity model information used in a version of
this application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Gets",
"all",
"prebuilt",
"intent",
"and",
"entity",
"model",
"information",
"used",
"in",
"a",
"version",
"of",
"this",
"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#L4780-L4783 | train | Gets the list of all the models in a version of the application. | [
30522,
13366,
2862,
1035,
7661,
1035,
3653,
8569,
4014,
2102,
1035,
4275,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
7661,
1035,
3653,
8569,
4014,
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... |
kpumuk/meta-tags | lib/meta_tags/text_normalizer.rb | MetaTags.TextNormalizer.normalize_title | def normalize_title(site_title, title, separator, reverse = false)
title = cleanup_strings(title)
title.reverse! if reverse
site_title = cleanup_string(site_title)
separator = cleanup_string(separator, strip: false)
# Truncate title and site title
site_title, title = truncate_title(site_title, title, separator)
if site_title.present?
if reverse
title.push(site_title)
else
title.unshift(site_title)
end
end
safe_join(title, separator)
end | ruby | def normalize_title(site_title, title, separator, reverse = false)
title = cleanup_strings(title)
title.reverse! if reverse
site_title = cleanup_string(site_title)
separator = cleanup_string(separator, strip: false)
# Truncate title and site title
site_title, title = truncate_title(site_title, title, separator)
if site_title.present?
if reverse
title.push(site_title)
else
title.unshift(site_title)
end
end
safe_join(title, separator)
end | [
"def",
"normalize_title",
"(",
"site_title",
",",
"title",
",",
"separator",
",",
"reverse",
"=",
"false",
")",
"title",
"=",
"cleanup_strings",
"(",
"title",
")",
"title",
".",
"reverse!",
"if",
"reverse",
"site_title",
"=",
"cleanup_string",
"(",
"site_title... | rubocop:disable Style/ModuleFunction
Normalize title value.
@param [String] site_title site title.
@param [String, Array<String>] title title string.
@param [String] separator a string to join title parts with.
@param [true,false] reverse whether title should be reversed.
@return [Array<String>] array of title parts with tags removed. | [
"rubocop",
":",
"disable",
"Style",
"/",
"ModuleFunction",
"Normalize",
"title",
"value",
"."
] | 03585f95edf96cd17024c5c155ce46ec8bc47232 | https://github.com/kpumuk/meta-tags/blob/03585f95edf96cd17024c5c155ce46ec8bc47232/lib/meta_tags/text_normalizer.rb#L16-L34 | train | Normalize the title | [
30522,
13366,
3671,
4697,
1035,
2516,
1006,
2609,
1035,
2516,
1010,
2516,
1010,
19802,
25879,
2953,
1010,
7901,
1027,
6270,
1007,
2516,
1027,
27686,
1035,
7817,
1006,
2516,
1007,
2516,
1012,
7901,
999,
2065,
7901,
2609,
1035,
2516,
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_relay/lib/2016-07-01/generated/azure_mgmt_relay/hybrid_connections.rb | Azure::Relay::Mgmt::V2016_07_01.HybridConnections.list_post_authorization_rules_with_http_info | def list_post_authorization_rules_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:nil)
list_post_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:custom_headers).value!
end | ruby | def list_post_authorization_rules_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:nil)
list_post_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:custom_headers).value!
end | [
"def",
"list_post_authorization_rules_with_http_info",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"hybrid_connection_name",
",",
"custom_headers",
":",
"nil",
")",
"list_post_authorization_rules_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"hybri... | Authorization rules for a HybridConnection.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The Namespace Name
@param hybrid_connection_name [String] The hybrid connection name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Authorization",
"rules",
"for",
"a",
"HybridConnection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_relay/lib/2016-07-01/generated/azure_mgmt_relay/hybrid_connections.rb#L576-L578 | train | Gets the list of authorization rules for a hybrid connection. | [
30522,
13366,
2862,
1035,
2695,
1035,
20104,
1035,
3513,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
8893,
1035,
4434,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2015-06-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2015_06_01.KeyVaultClient.create_key | def create_key(vault_base_url, key_name, kty, key_size:nil, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil)
response = create_key_async(vault_base_url, key_name, kty, key_size:key_size, key_ops:key_ops, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_key(vault_base_url, key_name, kty, key_size:nil, key_ops:nil, key_attributes:nil, tags:nil, custom_headers:nil)
response = create_key_async(vault_base_url, key_name, kty, key_size:key_size, key_ops:key_ops, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_key",
"(",
"vault_base_url",
",",
"key_name",
",",
"kty",
",",
"key_size",
":",
"nil",
",",
"key_ops",
":",
"nil",
",",
"key_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create... | Creates a new, named, key in the specified vault.
@param vault_base_url [String] The vault name, e.g.
https://myvault.vault.azure.net
@param key_name [String] The name of the key
@param kty [JsonWebKeyType] The type of key to create. Valid key types, see
JsonWebKeyType. Supported JsonWebKey key types (kty) for Elliptic Curve, RSA,
HSM, Octet. Possible values include: 'EC', 'RSA', 'RSA-HSM', 'oct'
@param key_size [Integer] The key size in bits. e.g. 1024 or 2048.
@param key_ops [Array<JsonWebKeyOperation>]
@param key_attributes [KeyAttributes]
@param tags [Hash{String => String}] Application-specific metadata in the
form of key-value pairs
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [KeyBundle] operation results. | [
"Creates",
"a",
"new",
"named",
"key",
"in",
"the",
"specified",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2015-06-01/generated/azure_key_vault/key_vault_client.rb#L131-L134 | train | Creates a key in the specified vault. | [
30522,
13366,
3443,
1035,
3145,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
1047,
3723,
1010,
3145,
1035,
2946,
1024,
9152,
2140,
1010,
3145,
1035,
23092,
1024,
9152,
2140,
1010,
3145,
1035,
12332,
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... |
danger/danger | lib/danger/ci_source/teamcity.rb | Danger.TeamCity.bitbucket_pr_from_env | def bitbucket_pr_from_env(env)
branch_name = env["BITBUCKET_BRANCH_NAME"]
repo_slug = env["BITBUCKET_REPO_SLUG"]
begin
Danger::RequestSources::BitbucketCloudAPI.new(repo_slug, nil, branch_name, env).pull_request_id
rescue
raise "Failed to find a pull request for branch \"#{branch_name}\" on Bitbucket."
end
end | ruby | def bitbucket_pr_from_env(env)
branch_name = env["BITBUCKET_BRANCH_NAME"]
repo_slug = env["BITBUCKET_REPO_SLUG"]
begin
Danger::RequestSources::BitbucketCloudAPI.new(repo_slug, nil, branch_name, env).pull_request_id
rescue
raise "Failed to find a pull request for branch \"#{branch_name}\" on Bitbucket."
end
end | [
"def",
"bitbucket_pr_from_env",
"(",
"env",
")",
"branch_name",
"=",
"env",
"[",
"\"BITBUCKET_BRANCH_NAME\"",
"]",
"repo_slug",
"=",
"env",
"[",
"\"BITBUCKET_REPO_SLUG\"",
"]",
"begin",
"Danger",
"::",
"RequestSources",
"::",
"BitbucketCloudAPI",
".",
"new",
"(",
... | This is a little hacky, because Bitbucket doesn't provide us a PR id | [
"This",
"is",
"a",
"little",
"hacky",
"because",
"Bitbucket",
"doesn",
"t",
"provide",
"us",
"a",
"PR",
"id"
] | 0d6d09f2d949c287fe75202d947374042b0679f4 | https://github.com/danger/danger/blob/0d6d09f2d949c287fe75202d947374042b0679f4/lib/danger/ci_source/teamcity.rb#L149-L157 | train | Returns the pull request ID from the environment | [
30522,
13366,
2978,
24204,
3388,
1035,
10975,
1035,
2013,
1035,
4372,
2615,
1006,
4372,
2615,
1007,
3589,
1035,
2171,
1027,
4372,
2615,
1031,
1000,
2978,
24204,
3388,
1035,
3589,
1035,
2171,
1000,
1033,
16360,
2080,
1035,
23667,
1027,
4372,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/elastic_pools.rb | Azure::SQL::Mgmt::V2017_10_01_preview.ElasticPools.list_by_server | def list_by_server(resource_group_name, server_name, skip:nil, custom_headers:nil)
first_page = list_by_server_as_lazy(resource_group_name, server_name, skip:skip, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_server(resource_group_name, server_name, skip:nil, custom_headers:nil)
first_page = list_by_server_as_lazy(resource_group_name, server_name, skip:skip, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_server",
"(",
"resource_group_name",
",",
"server_name",
",",
"skip",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_server_as_lazy",
"(",
"resource_group_name",
",",
"server_name",
",",
"skip",
":",
"skip",
",",
... | Gets all elastic pools in a server.
@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 skip [Integer] The number of elements in the collection to skip.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<ElasticPool>] operation results. | [
"Gets",
"all",
"elastic",
"pools",
"in",
"a",
"server",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/elastic_pools.rb#L40-L43 | train | Gets all the segmentation terms of the server. | [
30522,
13366,
2862,
1035,
2011,
1035,
8241,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
13558,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2011,
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... |
markdownlint/markdownlint | lib/mdl/doc.rb | MarkdownLint.Doc.element_linenumber | def element_linenumber(element)
element = element.options if element.is_a?(Kramdown::Element)
element[:location]
end | ruby | def element_linenumber(element)
element = element.options if element.is_a?(Kramdown::Element)
element[:location]
end | [
"def",
"element_linenumber",
"(",
"element",
")",
"element",
"=",
"element",
".",
"options",
"if",
"element",
".",
"is_a?",
"(",
"Kramdown",
"::",
"Element",
")",
"element",
"[",
":location",
"]",
"end"
] | Returns the line number a given element is located on in the source
file. You can pass in either an element object or an options hash here. | [
"Returns",
"the",
"line",
"number",
"a",
"given",
"element",
"is",
"located",
"on",
"in",
"the",
"source",
"file",
".",
"You",
"can",
"pass",
"in",
"either",
"an",
"element",
"object",
"or",
"an",
"options",
"hash",
"here",
"."
] | a9e80fcf3989d73b654b00bb2225a00be53983e8 | https://github.com/markdownlint/markdownlint/blob/a9e80fcf3989d73b654b00bb2225a00be53983e8/lib/mdl/doc.rb#L131-L134 | train | Returns the linenumber of the element in the current document. | [
30522,
13366,
5783,
1035,
17517,
29440,
1006,
5783,
1007,
5783,
1027,
5783,
1012,
7047,
2065,
5783,
1012,
2003,
1035,
1037,
1029,
1006,
1047,
6444,
7698,
1024,
1024,
5783,
1007,
5783,
1031,
1024,
3295,
1033,
2203,
102,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.get_prebuilt_entity_role | def get_prebuilt_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = get_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_prebuilt_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = get_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_prebuilt_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_prebuilt_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",... | Get one role for a given prebuilt entity in a version of the application
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id entity ID.
@param role_id entity role ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EntityRole] operation results. | [
"Get",
"one",
"role",
"for",
"a",
"given",
"prebuilt",
"entity",
"in",
"a",
"version",
"of",
"the",
"application"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L9092-L9095 | train | Gets the role for a prebuilt entity. | [
30522,
13366,
2131,
1035,
3653,
8569,
4014,
2102,
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,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
zendesk/ruby-kafka | lib/kafka/cluster.rb | Kafka.Cluster.get_transaction_coordinator | def get_transaction_coordinator(transactional_id:)
@logger.debug "Getting transaction coordinator for `#{transactional_id}`"
refresh_metadata_if_necessary!
if transactional_id.nil?
# Get a random_broker
@logger.debug "Transaction ID is not available. Choose a random broker."
return random_broker
else
get_coordinator(Kafka::Protocol::COORDINATOR_TYPE_TRANSACTION, transactional_id)
end
end | ruby | def get_transaction_coordinator(transactional_id:)
@logger.debug "Getting transaction coordinator for `#{transactional_id}`"
refresh_metadata_if_necessary!
if transactional_id.nil?
# Get a random_broker
@logger.debug "Transaction ID is not available. Choose a random broker."
return random_broker
else
get_coordinator(Kafka::Protocol::COORDINATOR_TYPE_TRANSACTION, transactional_id)
end
end | [
"def",
"get_transaction_coordinator",
"(",
"transactional_id",
":",
")",
"@logger",
".",
"debug",
"\"Getting transaction coordinator for `#{transactional_id}`\"",
"refresh_metadata_if_necessary!",
"if",
"transactional_id",
".",
"nil?",
"# Get a random_broker",
"@logger",
".",
"de... | Finds the broker acting as the coordinator of the given transaction.
@param transactional_id: [String]
@return [Broker] the broker that's currently coordinator. | [
"Finds",
"the",
"broker",
"acting",
"as",
"the",
"coordinator",
"of",
"the",
"given",
"transaction",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/cluster.rb#L128-L140 | train | Get the coordinator for a given transaction ID | [
30522,
13366,
2131,
1035,
12598,
1035,
10669,
1006,
12598,
2389,
1035,
8909,
1024,
1007,
1030,
8833,
4590,
1012,
2139,
8569,
2290,
1000,
2893,
12598,
10669,
2005,
1036,
1001,
1063,
12598,
2389,
1035,
8909,
1065,
1036,
1000,
25416,
21898,
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_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb | Azure::EventGrid::Mgmt::V2019_02_01_preview.Topics.update_async | def update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil)
# Send request
promise = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic.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 update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:nil)
# Send request
promise = begin_update_async(resource_group_name, topic_name, topic_update_parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::EventGrid::Mgmt::V2019_02_01_preview::Models::Topic.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",
"update_async",
"(",
"resource_group_name",
",",
"topic_name",
",",
"topic_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_update_async",
"(",
"resource_group_name",
",",
"topic_name",
",",
"topic_update_paramete... | @param resource_group_name [String] The name of the resource group within the
user's subscription.
@param topic_name [String] Name of the topic
@param topic_update_parameters [TopicUpdateParameters] Topic update
information
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"resource",
"group",
"within",
"the",
"user",
"s",
"subscription",
".",
"@param",
"topic_name",
"[",
"String",
"]",
"Name",
"of",
"the",
"topic",
"@param",
"topic_update_parameters"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb#L247-L263 | train | Updates a topic. | [
30522,
13366,
10651,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8476,
1035,
2171,
1010,
8476,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_security_groups.rb | Azure::Network::Mgmt::V2019_02_01.ApplicationSecurityGroups.delete | def delete(resource_group_name, application_security_group_name, custom_headers:nil)
response = delete_async(resource_group_name, application_security_group_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, application_security_group_name, custom_headers:nil)
response = delete_async(resource_group_name, application_security_group_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"application_security_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"application_security_group_name",
",",
"custom_headers",
":custom_headers",
")",
... | Deletes the specified application security group.
@param resource_group_name [String] The name of the resource group.
@param application_security_group_name [String] The name of the application
security group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"application",
"security",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_security_groups.rb#L33-L36 | train | Deletes the specified application security group. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4646,
1035,
3036,
1035,
2177,
1035,
2171,
1010,
30524,
3036,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.start | def start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil)
response = start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value!
nil
end | ruby | def start(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil)
response = start_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"start",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"connection_monitor_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"start_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"connection_monitor_name",
",",
... | Starts 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. | [
"Starts",
"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#L277-L280 | train | Starts a connection monitor. | [
30522,
13366,
2707,
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,
2707,
1035,
2004,
6038,
2278,
1006,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Dynamoid/dynamoid | lib/dynamoid/adapter.rb | Dynamoid.Adapter.delete | def delete(table, ids, options = {})
range_key = options[:range_key] # array of range keys that matches the ids passed in
if ids.respond_to?(:each)
ids = if range_key.respond_to?(:each)
# turn ids into array of arrays each element being hash_key, range_key
ids.each_with_index.map { |id, i| [id, range_key[i]] }
else
range_key ? ids.map { |id| [id, range_key] } : ids
end
batch_delete_item(table => ids)
else
delete_item(table, ids, options)
end
end | ruby | def delete(table, ids, options = {})
range_key = options[:range_key] # array of range keys that matches the ids passed in
if ids.respond_to?(:each)
ids = if range_key.respond_to?(:each)
# turn ids into array of arrays each element being hash_key, range_key
ids.each_with_index.map { |id, i| [id, range_key[i]] }
else
range_key ? ids.map { |id| [id, range_key] } : ids
end
batch_delete_item(table => ids)
else
delete_item(table, ids, options)
end
end | [
"def",
"delete",
"(",
"table",
",",
"ids",
",",
"options",
"=",
"{",
"}",
")",
"range_key",
"=",
"options",
"[",
":range_key",
"]",
"# array of range keys that matches the ids passed in",
"if",
"ids",
".",
"respond_to?",
"(",
":each",
")",
"ids",
"=",
"if",
... | Delete an item from a table.
@param [String] table the name of the table to write the object to
@param [Array] ids to delete, can also be a string of just one id
@param [Array] range_key of the record to delete, can also be a string of just one range_key | [
"Delete",
"an",
"item",
"from",
"a",
"table",
"."
] | 9e3d006b039e45877b003564ded65509b10b6354 | https://github.com/Dynamoid/dynamoid/blob/9e3d006b039e45877b003564ded65509b10b6354/lib/dynamoid/adapter.rb#L98-L112 | train | Delete an item from the database | [
30522,
13366,
3972,
12870,
1006,
2795,
1010,
8909,
2015,
1010,
7047,
1027,
1063,
1065,
1007,
2846,
1035,
3145,
1027,
7047,
1031,
1024,
2846,
1035,
3145,
1033,
1001,
9140,
1997,
2846,
6309,
2008,
3503,
1996,
8909,
2015,
2979,
1999,
2065,
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... |
rails/rails | activerecord/lib/active_record/transactions.rb | ActiveRecord.Transactions.restore_transaction_record_state | def restore_transaction_record_state(force_restore_state = false)
if restore_state = @_start_transaction_state
if force_restore_state || restore_state[:level] <= 1
@new_record = restore_state[:new_record]
@destroyed = restore_state[:destroyed]
@attributes = restore_state[:attributes].map do |attr|
value = @attributes.fetch_value(attr.name)
attr = attr.with_value_from_user(value) if attr.value != value
attr
end
@mutations_from_database = nil
@mutations_before_last_save = nil
if @attributes.fetch_value(@primary_key) != restore_state[:id]
@attributes.write_from_user(@primary_key, restore_state[:id])
end
freeze if restore_state[:frozen?]
end
end
end | ruby | def restore_transaction_record_state(force_restore_state = false)
if restore_state = @_start_transaction_state
if force_restore_state || restore_state[:level] <= 1
@new_record = restore_state[:new_record]
@destroyed = restore_state[:destroyed]
@attributes = restore_state[:attributes].map do |attr|
value = @attributes.fetch_value(attr.name)
attr = attr.with_value_from_user(value) if attr.value != value
attr
end
@mutations_from_database = nil
@mutations_before_last_save = nil
if @attributes.fetch_value(@primary_key) != restore_state[:id]
@attributes.write_from_user(@primary_key, restore_state[:id])
end
freeze if restore_state[:frozen?]
end
end
end | [
"def",
"restore_transaction_record_state",
"(",
"force_restore_state",
"=",
"false",
")",
"if",
"restore_state",
"=",
"@_start_transaction_state",
"if",
"force_restore_state",
"||",
"restore_state",
"[",
":level",
"]",
"<=",
"1",
"@new_record",
"=",
"restore_state",
"["... | Restore the new record state and id of a record that was previously saved by a call to save_record_state. | [
"Restore",
"the",
"new",
"record",
"state",
"and",
"id",
"of",
"a",
"record",
"that",
"was",
"previously",
"saved",
"by",
"a",
"call",
"to",
"save_record_state",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/transactions.rb#L420-L438 | train | Restore the current transaction record state | [
30522,
13366,
9239,
1035,
12598,
1035,
2501,
1035,
2110,
1006,
2486,
1035,
9239,
1035,
2110,
1027,
6270,
1007,
2065,
9239,
1035,
2110,
1027,
1030,
1035,
2707,
1035,
12598,
1035,
2110,
2065,
2486,
1035,
9239,
1035,
2110,
1064,
1064,
9239,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | spaceship/lib/spaceship/tunes/tunes_client.rb | Spaceship.TunesClient.upload_trailer_preview | def upload_trailer_preview(app_version, upload_trailer_preview, device)
raise "app_version is required" unless app_version
raise "upload_trailer_preview is required" unless upload_trailer_preview
raise "device is required" unless device
du_client.upload_trailer_preview(app_version, upload_trailer_preview, content_provider_id, sso_token_for_image, device)
end | ruby | def upload_trailer_preview(app_version, upload_trailer_preview, device)
raise "app_version is required" unless app_version
raise "upload_trailer_preview is required" unless upload_trailer_preview
raise "device is required" unless device
du_client.upload_trailer_preview(app_version, upload_trailer_preview, content_provider_id, sso_token_for_image, device)
end | [
"def",
"upload_trailer_preview",
"(",
"app_version",
",",
"upload_trailer_preview",
",",
"device",
")",
"raise",
"\"app_version is required\"",
"unless",
"app_version",
"raise",
"\"upload_trailer_preview is required\"",
"unless",
"upload_trailer_preview",
"raise",
"\"device is re... | Uploads the trailer preview
@param app_version (AppVersion): The version of your app
@param upload_trailer_preview (UploadFile): The trailer preview to upload
@param device (string): The target device
@return [JSON] the response | [
"Uploads",
"the",
"trailer",
"preview"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/tunes/tunes_client.rb#L868-L874 | train | Upload a trailer preview to the specified device. | [
30522,
13366,
2039,
11066,
1035,
9117,
1035,
19236,
1006,
10439,
1035,
2544,
1010,
2039,
11066,
1035,
9117,
1035,
19236,
1010,
5080,
1007,
5333,
1000,
10439,
1035,
2544,
2003,
3223,
1000,
4983,
10439,
1035,
2544,
5333,
1000,
2039,
11066,
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... |
chanks/que | lib/que/job_buffer.rb | Que.JobBuffer.push | def push(*metajobs)
Que.internal_log(:job_buffer_push, self) do
{
maximum_size: maximum_size,
ids: metajobs.map(&:id),
current_queue: to_a,
}
end
sync do
return metajobs if _stopping?
@array.concat(metajobs).sort!
# Relying on the hash's contents being sorted, here.
priority_queues.reverse_each do |_, pq|
pq.waiting_count.times do
job = _shift_job(pq.priority)
break if job.nil? # False would mean we're stopping.
pq.push(job)
end
end
# If we passed the maximum buffer size, drop the lowest sort keys and
# return their ids to be unlocked.
overage = -_buffer_space
pop(overage) if overage > 0
end
end | ruby | def push(*metajobs)
Que.internal_log(:job_buffer_push, self) do
{
maximum_size: maximum_size,
ids: metajobs.map(&:id),
current_queue: to_a,
}
end
sync do
return metajobs if _stopping?
@array.concat(metajobs).sort!
# Relying on the hash's contents being sorted, here.
priority_queues.reverse_each do |_, pq|
pq.waiting_count.times do
job = _shift_job(pq.priority)
break if job.nil? # False would mean we're stopping.
pq.push(job)
end
end
# If we passed the maximum buffer size, drop the lowest sort keys and
# return their ids to be unlocked.
overage = -_buffer_space
pop(overage) if overage > 0
end
end | [
"def",
"push",
"(",
"*",
"metajobs",
")",
"Que",
".",
"internal_log",
"(",
":job_buffer_push",
",",
"self",
")",
"do",
"{",
"maximum_size",
":",
"maximum_size",
",",
"ids",
":",
"metajobs",
".",
"map",
"(",
":id",
")",
",",
"current_queue",
":",
"to_a",
... | Since we use a mutex, which is not reentrant, we have to be a little
careful to not call a method that locks the mutex when we've already
locked it. So, as a general rule, public methods handle locking the mutex
when necessary, while private methods handle the actual underlying data
changes. This lets us reuse those private methods without running into
locking issues. | [
"Since",
"we",
"use",
"a",
"mutex",
"which",
"is",
"not",
"reentrant",
"we",
"have",
"to",
"be",
"a",
"little",
"careful",
"to",
"not",
"call",
"a",
"method",
"that",
"locks",
"the",
"mutex",
"when",
"we",
"ve",
"already",
"locked",
"it",
".",
"So",
... | c7ae049db0ca13056a28c71ae610f8900f21feb4 | https://github.com/chanks/que/blob/c7ae049db0ca13056a28c71ae610f8900f21feb4/lib/que/job_buffer.rb#L46-L74 | train | Pushes the given metajobs to the queue. | [
30522,
13366,
5245,
1006,
1008,
18804,
5558,
5910,
1007,
10861,
1012,
4722,
1035,
8833,
1006,
1024,
3105,
1035,
17698,
1035,
5245,
1010,
2969,
1007,
2079,
1063,
4555,
1035,
2946,
1024,
4555,
1035,
2946,
1010,
8909,
2015,
1024,
18804,
5558,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/storage_accounts.rb | Azure::DataLakeAnalytics::Mgmt::V2016_11_01.StorageAccounts.get_with_http_info | def get_with_http_info(resource_group_name, account_name, storage_account_name, custom_headers:nil)
get_async(resource_group_name, account_name, storage_account_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, account_name, storage_account_name, custom_headers:nil)
get_async(resource_group_name, account_name, storage_account_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"storage_account_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"storage_account_name",
",",
"custom_headers",
":custom_he... | Gets the specified Azure Storage account linked to the given Data Lake
Analytics account.
@param resource_group_name [String] The name of the Azure resource group.
@param account_name [String] The name of the Data Lake Analytics account.
@param storage_account_name [String] The name of the Azure Storage account
for which to retrieve the details.
@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",
"specified",
"Azure",
"Storage",
"account",
"linked",
"to",
"the",
"given",
"Data",
"Lake",
"Analytics",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/storage_accounts.rb#L302-L304 | train | Gets the specified index of the specified storage account. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
abonas/kubeclient | lib/kubeclient/common.rb | Kubeclient.ClientMixin.get_entities | def get_entities(entity_type, resource_name, options = {})
params = {}
SEARCH_ARGUMENTS.each { |k, v| params[k] = options[v] if options[v] }
ns_prefix = build_namespace_prefix(options[:namespace])
response = handle_exception do
rest_client[ns_prefix + resource_name]
.get({ 'params' => params }.merge(@headers))
end
format_response(options[:as] || @as, response.body, entity_type)
end | ruby | def get_entities(entity_type, resource_name, options = {})
params = {}
SEARCH_ARGUMENTS.each { |k, v| params[k] = options[v] if options[v] }
ns_prefix = build_namespace_prefix(options[:namespace])
response = handle_exception do
rest_client[ns_prefix + resource_name]
.get({ 'params' => params }.merge(@headers))
end
format_response(options[:as] || @as, response.body, entity_type)
end | [
"def",
"get_entities",
"(",
"entity_type",
",",
"resource_name",
",",
"options",
"=",
"{",
"}",
")",
"params",
"=",
"{",
"}",
"SEARCH_ARGUMENTS",
".",
"each",
"{",
"|",
"k",
",",
"v",
"|",
"params",
"[",
"k",
"]",
"=",
"options",
"[",
"v",
"]",
"if... | Accepts the following options:
:namespace (string) - the namespace of the entity.
:label_selector (string) - a selector to restrict the list of returned objects by labels.
:field_selector (string) - a selector to restrict the list of returned objects by fields.
:limit (integer) - a maximum number of items to return in each response
:continue (string) - a token used to retrieve the next chunk of entities
:as (:raw|:ros) - defaults to :ros
:raw - return the raw response body as a string
:ros - return a collection of RecursiveOpenStruct objects | [
"Accepts",
"the",
"following",
"options",
":",
":",
"namespace",
"(",
"string",
")",
"-",
"the",
"namespace",
"of",
"the",
"entity",
".",
":",
"label_selector",
"(",
"string",
")",
"-",
"a",
"selector",
"to",
"restrict",
"the",
"list",
"of",
"returned",
... | 3630f6c82532fba04f3e1a62d6b99c6cf2910451 | https://github.com/abonas/kubeclient/blob/3630f6c82532fba04f3e1a62d6b99c6cf2910451/lib/kubeclient/common.rb#L324-L334 | train | Get all entities | [
30522,
13366,
2131,
1035,
11422,
1006,
9178,
1035,
2828,
1010,
7692,
1035,
2171,
1010,
7047,
1027,
1063,
1065,
1007,
11498,
5244,
1027,
1063,
1065,
3945,
1035,
9918,
1012,
2169,
1063,
1064,
1047,
1010,
1058,
1064,
11498,
5244,
1031,
1047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
daddyz/phonelib | lib/phonelib/phone_analyzer_helper.rb | Phonelib.PhoneAnalyzerHelper.country_or_default_country | def country_or_default_country(country)
country ||= (original_starts_with_plus? ? nil : Phonelib.default_country)
country && country.to_s.upcase
end | ruby | def country_or_default_country(country)
country ||= (original_starts_with_plus? ? nil : Phonelib.default_country)
country && country.to_s.upcase
end | [
"def",
"country_or_default_country",
"(",
"country",
")",
"country",
"||=",
"(",
"original_starts_with_plus?",
"?",
"nil",
":",
"Phonelib",
".",
"default_country",
")",
"country",
"&&",
"country",
".",
"to_s",
".",
"upcase",
"end"
] | Get country that was provided or default country in needable format
==== Attributes
* +country+ - country passed for parsing | [
"Get",
"country",
"that",
"was",
"provided",
"or",
"default",
"country",
"in",
"needable",
"format"
] | aa0023eab7c896b71275bf342bc7f49735cbdbbf | https://github.com/daddyz/phonelib/blob/aa0023eab7c896b71275bf342bc7f49735cbdbbf/lib/phonelib/phone_analyzer_helper.rb#L91-L94 | train | Returns the country or the default country | [
30522,
13366,
2406,
1035,
2030,
1035,
12398,
1035,
2406,
1006,
2406,
1007,
2406,
1064,
1064,
1027,
1006,
2434,
1035,
4627,
1035,
2007,
1035,
4606,
1029,
1029,
9152,
2140,
1024,
3042,
29521,
1012,
12398,
1035,
2406,
1007,
2406,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.suspend_service_backup_with_http_info | def suspend_service_backup_with_http_info(service_id, timeout:60, custom_headers:nil)
suspend_service_backup_async(service_id, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def suspend_service_backup_with_http_info(service_id, timeout:60, custom_headers:nil)
suspend_service_backup_async(service_id, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"suspend_service_backup_with_http_info",
"(",
"service_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"suspend_service_backup_async",
"(",
"service_id",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".",... | Suspends periodic backup for the specified Service Fabric service.
The service which is configured to take periodic backups, is suspended for
taking further backups till it is resumed again. This operation applies to
the entire service's hierarchy. It means all the partitions under this
service are now suspended for backup.
@param service_id [String] The identity of the service. This is typically the
full name of the service without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the service name is "fabric:/myapp/app1/svc1", the service
identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous
versions.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Suspends",
"periodic",
"backup",
"for",
"the",
"specified",
"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#L24517-L24519 | train | Suspend service backup of a Service Fabric service. | [
30522,
13366,
28324,
1035,
2326,
1035,
10200,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2326,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
28324,
1035,
2326,
1035,
10200,
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_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_triggers.rb | Azure::Logic::Mgmt::V2016_06_01.WorkflowTriggers.get_schema_json | def get_schema_json(resource_group_name, workflow_name, trigger_name, custom_headers:nil)
response = get_schema_json_async(resource_group_name, workflow_name, trigger_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_schema_json(resource_group_name, workflow_name, trigger_name, custom_headers:nil)
response = get_schema_json_async(resource_group_name, workflow_name, trigger_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_schema_json",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"trigger_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_schema_json_async",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"trigger_name",
",",
"custom_headers... | Get the trigger schema as JSON.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param trigger_name [String] The workflow trigger name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [JsonSchema] operation results. | [
"Get",
"the",
"trigger",
"schema",
"as",
"JSON",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_triggers.rb#L400-L403 | train | Gets the schema of the trigger. | [
30522,
13366,
2131,
1035,
8040,
28433,
1035,
1046,
3385,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
30524,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
8040,
28433,
1035,
1046,
3385,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
david942j/one_gadget | lib/one_gadget/helper.rb | OneGadget.Helper.architecture | def architecture(file)
return :invalid unless File.exist?(file)
f = File.open(file)
str = ELFTools::ELFFile.new(f).machine
{
'Advanced Micro Devices X86-64' => :amd64,
'Intel 80386' => :i386,
'ARM' => :arm,
'AArch64' => :aarch64,
'MIPS R3000' => :mips
}[str] || :unknown
rescue ELFTools::ELFError # not a valid ELF
:invalid
ensure
f&.close
end | ruby | def architecture(file)
return :invalid unless File.exist?(file)
f = File.open(file)
str = ELFTools::ELFFile.new(f).machine
{
'Advanced Micro Devices X86-64' => :amd64,
'Intel 80386' => :i386,
'ARM' => :arm,
'AArch64' => :aarch64,
'MIPS R3000' => :mips
}[str] || :unknown
rescue ELFTools::ELFError # not a valid ELF
:invalid
ensure
f&.close
end | [
"def",
"architecture",
"(",
"file",
")",
"return",
":invalid",
"unless",
"File",
".",
"exist?",
"(",
"file",
")",
"f",
"=",
"File",
".",
"open",
"(",
"file",
")",
"str",
"=",
"ELFTools",
"::",
"ELFFile",
".",
"new",
"(",
"f",
")",
".",
"machine",
"... | Fetch the ELF archiecture of +file+.
@param [String] file The target ELF filename.
@return [Symbol]
Currently supports amd64, i386, arm, aarch64, and mips.
@example
Helper.architecture('/bin/cat')
#=> :amd64 | [
"Fetch",
"the",
"ELF",
"archiecture",
"of",
"+",
"file",
"+",
"."
] | ff6ef04541e83441bfe3c2664a6febd1640f4263 | https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/helper.rb#L197-L213 | train | Returns the architecture of the ELF file | [
30522,
13366,
4294,
1006,
5371,
1007,
2709,
1024,
19528,
4983,
5371,
1012,
4839,
1029,
1006,
5371,
1007,
1042,
1027,
5371,
1012,
2330,
1006,
5371,
1007,
2358,
2099,
1027,
17163,
3406,
27896,
1024,
1024,
17163,
8873,
2571,
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... |
ruby/rake | lib/rake/packagetask.rb | Rake.PackageTask.define | def define
fail "Version required (or :noversion)" if @version.nil?
@version = nil if :noversion == @version
desc "Build all the packages"
task :package
desc "Force a rebuild of the package files"
task repackage: [:clobber_package, :package]
desc "Remove package products"
task :clobber_package do
rm_r package_dir rescue nil
end
task clobber: [:clobber_package]
[
[need_tar, tgz_file, "z"],
[need_tar_gz, tar_gz_file, "z"],
[need_tar_bz2, tar_bz2_file, "j"],
[need_tar_xz, tar_xz_file, "J"]
].each do |need, file, flag|
if need
task package: ["#{package_dir}/#{file}"]
file "#{package_dir}/#{file}" =>
[package_dir_path] + package_files do
chdir(package_dir) { sh @tar_command, "#{flag}cvf", file, package_name }
end
end
end
if need_zip
task package: ["#{package_dir}/#{zip_file}"]
file "#{package_dir}/#{zip_file}" =>
[package_dir_path] + package_files do
chdir(package_dir) { sh @zip_command, "-r", zip_file, package_name }
end
end
directory package_dir_path => @package_files do
@package_files.each do |fn|
f = File.join(package_dir_path, fn)
fdir = File.dirname(f)
mkdir_p(fdir) unless File.exist?(fdir)
if File.directory?(fn)
mkdir_p(f)
else
rm_f f
safe_ln(fn, f)
end
end
end
self
end | ruby | def define
fail "Version required (or :noversion)" if @version.nil?
@version = nil if :noversion == @version
desc "Build all the packages"
task :package
desc "Force a rebuild of the package files"
task repackage: [:clobber_package, :package]
desc "Remove package products"
task :clobber_package do
rm_r package_dir rescue nil
end
task clobber: [:clobber_package]
[
[need_tar, tgz_file, "z"],
[need_tar_gz, tar_gz_file, "z"],
[need_tar_bz2, tar_bz2_file, "j"],
[need_tar_xz, tar_xz_file, "J"]
].each do |need, file, flag|
if need
task package: ["#{package_dir}/#{file}"]
file "#{package_dir}/#{file}" =>
[package_dir_path] + package_files do
chdir(package_dir) { sh @tar_command, "#{flag}cvf", file, package_name }
end
end
end
if need_zip
task package: ["#{package_dir}/#{zip_file}"]
file "#{package_dir}/#{zip_file}" =>
[package_dir_path] + package_files do
chdir(package_dir) { sh @zip_command, "-r", zip_file, package_name }
end
end
directory package_dir_path => @package_files do
@package_files.each do |fn|
f = File.join(package_dir_path, fn)
fdir = File.dirname(f)
mkdir_p(fdir) unless File.exist?(fdir)
if File.directory?(fn)
mkdir_p(f)
else
rm_f f
safe_ln(fn, f)
end
end
end
self
end | [
"def",
"define",
"fail",
"\"Version required (or :noversion)\"",
"if",
"@version",
".",
"nil?",
"@version",
"=",
"nil",
"if",
":noversion",
"==",
"@version",
"desc",
"\"Build all the packages\"",
"task",
":package",
"desc",
"\"Force a rebuild of the package files\"",
"task"... | Create the tasks defined by this task library. | [
"Create",
"the",
"tasks",
"defined",
"by",
"this",
"task",
"library",
"."
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/packagetask.rb#L108-L162 | train | Define the task to be run | [
30522,
13366,
9375,
8246,
1000,
2544,
3223,
1006,
2030,
1024,
13292,
2545,
3258,
1007,
1000,
2065,
1030,
2544,
1012,
9152,
2140,
1029,
1030,
2544,
1027,
9152,
2140,
2065,
1024,
13292,
2545,
3258,
1027,
1027,
1030,
2544,
4078,
2278,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | samples/Ruby/sinatra.rb | Sinatra.Helpers.redirect | def redirect(uri, *args)
if env['HTTP_VERSION'] == 'HTTP/1.1' and env["REQUEST_METHOD"] != 'GET'
status 303
else
status 302
end
# According to RFC 2616 section 14.30, "the field value consists of a
# single absolute URI"
response['Location'] = uri(uri, settings.absolute_redirects?, settings.prefixed_redirects?)
halt(*args)
end | ruby | def redirect(uri, *args)
if env['HTTP_VERSION'] == 'HTTP/1.1' and env["REQUEST_METHOD"] != 'GET'
status 303
else
status 302
end
# According to RFC 2616 section 14.30, "the field value consists of a
# single absolute URI"
response['Location'] = uri(uri, settings.absolute_redirects?, settings.prefixed_redirects?)
halt(*args)
end | [
"def",
"redirect",
"(",
"uri",
",",
"*",
"args",
")",
"if",
"env",
"[",
"'HTTP_VERSION'",
"]",
"==",
"'HTTP/1.1'",
"and",
"env",
"[",
"\"REQUEST_METHOD\"",
"]",
"!=",
"'GET'",
"status",
"303",
"else",
"status",
"302",
"end",
"# According to RFC 2616 section 14... | Halt processing and redirect to the URI provided. | [
"Halt",
"processing",
"and",
"redirect",
"to",
"the",
"URI",
"provided",
"."
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/samples/Ruby/sinatra.rb#L167-L178 | train | Redirect to a URI | [
30522,
13366,
2417,
7442,
6593,
1006,
24471,
2072,
1010,
1008,
12098,
5620,
30524,
8299,
1035,
2544,
1005,
1033,
1027,
1027,
1005,
8299,
1013,
1015,
1012,
1015,
1005,
1998,
4372,
2615,
1031,
1000,
5227,
1035,
4118,
1000,
1033,
999,
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_network/lib/2018-12-01/generated/azure_mgmt_network/p2s_vpn_gateways.rb | Azure::Network::Mgmt::V2018_12_01.P2sVpnGateways.begin_update_tags | def begin_update_tags(resource_group_name, gateway_name, p2svpn_gateway_parameters, custom_headers:nil)
response = begin_update_tags_async(resource_group_name, gateway_name, p2svpn_gateway_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update_tags(resource_group_name, gateway_name, p2svpn_gateway_parameters, custom_headers:nil)
response = begin_update_tags_async(resource_group_name, gateway_name, p2svpn_gateway_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update_tags",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"p2svpn_gateway_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_tags_async",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"p2svpn_gateway_parameter... | Updates virtual wan p2s vpn gateway tags.
@param resource_group_name [String] The resource group name of the
P2SVpnGateway.
@param gateway_name [String] The name of the gateway.
@param p2svpn_gateway_parameters [TagsObject] Parameters supplied to update a
virtual wan p2s vpn gateway tags.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [P2SVpnGateway] operation results. | [
"Updates",
"virtual",
"wan",
"p2s",
"vpn",
"gateway",
"tags",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-12-01/generated/azure_mgmt_network/p2s_vpn_gateways.rb#L613-L616 | train | Updates a P2SVpnGateway tags. | [
30522,
13366,
4088,
1035,
10651,
1035,
22073,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11909,
1035,
2171,
1010,
1052,
2475,
2015,
2615,
2361,
2078,
1035,
11909,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
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... |
shugo/textbringer | lib/textbringer/buffer.rb | Textbringer.Buffer.save_point | def save_point
saved = new_mark
column = @goal_column
@save_point_level += 1
begin
yield(saved)
ensure
point_to_mark(saved)
saved.delete
@goal_column = column
@save_point_level -= 1
end
end | ruby | def save_point
saved = new_mark
column = @goal_column
@save_point_level += 1
begin
yield(saved)
ensure
point_to_mark(saved)
saved.delete
@goal_column = column
@save_point_level -= 1
end
end | [
"def",
"save_point",
"saved",
"=",
"new_mark",
"column",
"=",
"@goal_column",
"@save_point_level",
"+=",
"1",
"begin",
"yield",
"(",
"saved",
")",
"ensure",
"point_to_mark",
"(",
"saved",
")",
"saved",
".",
"delete",
"@goal_column",
"=",
"column",
"@save_point_l... | The buffer should not be modified in the given block
because current_line/current_column is not updated in save_point. | [
"The",
"buffer",
"should",
"not",
"be",
"modified",
"in",
"the",
"given",
"block",
"because",
"current_line",
"/",
"current_column",
"is",
"not",
"updated",
"in",
"save_point",
"."
] | dcea7a098b5e04335e73faee5616bd1678add7ec | https://github.com/shugo/textbringer/blob/dcea7a098b5e04335e73faee5616bd1678add7ec/lib/textbringer/buffer.rb#L798-L810 | train | Save a point to mark | [
30522,
13366,
3828,
1035,
2391,
5552,
1027,
2047,
1035,
2928,
5930,
1027,
1030,
3125,
1035,
5930,
1030,
3828,
1035,
2391,
1035,
2504,
1009,
1027,
1015,
4088,
10750,
1006,
5552,
1007,
5676,
2391,
1035,
2000,
1035,
2928,
1006,
5552,
1007,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | def begin_export(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
response = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_export(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
response = begin_export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_export",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_export_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
... | 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 [ImportExportResponse] operation results. | [
"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#L2004-L2007 | train | Export a database to a HDInsight database. | [
30522,
30524,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
3433,
1012,
2303,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sinatra/sinatra | sinatra-contrib/lib/sinatra/content_for.rb | Sinatra.ContentFor.content_for | def content_for(key, value = nil, options = {}, &block)
block ||= proc { |*| value }
clear_content_for(key) if options[:flush]
content_blocks[key.to_sym] << capture_later(&block)
end | ruby | def content_for(key, value = nil, options = {}, &block)
block ||= proc { |*| value }
clear_content_for(key) if options[:flush]
content_blocks[key.to_sym] << capture_later(&block)
end | [
"def",
"content_for",
"(",
"key",
",",
"value",
"=",
"nil",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"block",
"||=",
"proc",
"{",
"|",
"*",
"|",
"value",
"}",
"clear_content_for",
"(",
"key",
")",
"if",
"options",
"[",
":flush",
"]",
... | Capture a block of content to be rendered later. For example:
<% content_for :head do %>
<script type="text/javascript" src="/foo.js"></script>
<% end %>
You can also pass an immediate value instead of a block:
<% content_for :title, "foo" %>
You can call +content_for+ multiple times with the same key
(in the example +:head+), and when you render the blocks for
that key all of them will be rendered, in the same order you
captured them.
Your blocks can also receive values, which are passed to them
by <tt>yield_content</tt> | [
"Capture",
"a",
"block",
"of",
"content",
"to",
"be",
"rendered",
"later",
".",
"For",
"example",
":"
] | 1aa64f9858edc3f93cc8d46e26f724c1ae103b1c | https://github.com/sinatra/sinatra/blob/1aa64f9858edc3f93cc8d46e26f724c1ae103b1c/sinatra-contrib/lib/sinatra/content_for.rb#L131-L135 | train | Add a block to the content_for hash. | [
30522,
13366,
4180,
1035,
2005,
1006,
3145,
1010,
3643,
1027,
9152,
2140,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
3796,
1064,
1064,
1027,
4013,
2278,
1063,
1064,
1008,
1064,
3643,
1065,
3154,
1035,
4180,
1035,
2005,
1006,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/identity_provider.rb | Azure::ApiManagement::Mgmt::V2018_01_01.IdentityProvider.list_by_service | def list_by_service(resource_group_name, service_name, custom_headers:nil)
first_page = list_by_service_as_lazy(resource_group_name, service_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_service(resource_group_name, service_name, custom_headers:nil)
first_page = list_by_service_as_lazy(resource_group_name, service_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_service",
"(",
"resource_group_name",
",",
"service_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_service_as_lazy",
"(",
"resource_group_name",
",",
"service_name",
",",
"custom_headers",
":custom_headers",
")",
"first_page",
... | Lists a collection of Identity Provider configured in the specified 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 custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<IdentityProviderContract>] operation results. | [
"Lists",
"a",
"collection",
"of",
"Identity",
"Provider",
"configured",
"in",
"the",
"specified",
"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/identity_provider.rb#L35-L38 | train | Gets all the available advisors. | [
30522,
13366,
2862,
1035,
2011,
1035,
2326,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2011,
1035,
2326,
1035,
2004,
1035,
13971,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/registries.rb | Azure::ContainerRegistry::Mgmt::V2017_06_01_preview.Registries.begin_update | def begin_update(resource_group_name, registry_name, registry_update_parameters, custom_headers:nil)
response = begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update(resource_group_name, registry_name, registry_update_parameters, custom_headers:nil)
response = begin_update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_update_parameters",
... | Updates a container registry with the specified parameters.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param registry_update_parameters [RegistryUpdateParameters] The parameters
for updating a container registry.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Registry] operation results. | [
"Updates",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/registries.rb#L1068-L1071 | train | Updates a container registry. | [
30522,
13366,
4088,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
15584,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
10651,
1035,
2004,
6038,
227... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2017-10-12/generated/azure_mgmt_cdn/cdn_management_client.rb | Azure::CDN::Mgmt::V2017_10_12.CdnManagementClient.check_name_availability | def check_name_availability(check_name_availability_input, custom_headers:nil)
response = check_name_availability_async(check_name_availability_input, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def check_name_availability(check_name_availability_input, custom_headers:nil)
response = check_name_availability_async(check_name_availability_input, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"check_name_availability",
"(",
"check_name_availability_input",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"check_name_availability_async",
"(",
"check_name_availability_input",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
... | Check the availability of a resource name. This is needed for resources where
name is globally unique, such as a CDN endpoint.
@param check_name_availability_input [CheckNameAvailabilityInput] Input to
check.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CheckNameAvailabilityOutput] operation results. | [
"Check",
"the",
"availability",
"of",
"a",
"resource",
"name",
".",
"This",
"is",
"needed",
"for",
"resources",
"where",
"name",
"is",
"globally",
"unique",
"such",
"as",
"a",
"CDN",
"endpoint",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-10-12/generated/azure_mgmt_cdn/cdn_management_client.rb#L156-L159 | train | Checks whether the name of the resource group is available for use. | [
30522,
13366,
4638,
1035,
2171,
1035,
11343,
1006,
4638,
1035,
2171,
1035,
11343,
1035,
7953,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4638,
1035,
2171,
1035,
11343,
1035,
2004,
6038,
2278,
1006,
4638,
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_automation/lib/2015-10-31/generated/azure_mgmt_automation/connection_operations.rb | Azure::Automation::Mgmt::V2015_10_31.ConnectionOperations.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, automation_account_name, connection_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, automation_account_name, connection_name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, automation_account_name, connection_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, automation_account_name, connection_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"connection_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
... | Create or update a connection.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param connection_name [String] The parameters supplied to the create or
update connection operation.
@param parameters [ConnectionCreateOrUpdateParameters] The parameters
supplied to the create or update connection 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. | [
"Create",
"or",
"update",
"a",
"connection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/connection_operations.rb#L255-L257 | train | Creates or updates a connection. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
4434,
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... |
hashicorp/vagrant | lib/vagrant/bundler.rb | Vagrant.Bundler.generate_vagrant_set | def generate_vagrant_set
sets = [generate_builtin_set, generate_plugin_set]
if env_plugin_gem_path && env_plugin_gem_path.exist?
sets << generate_plugin_set(env_plugin_gem_path)
end
Gem::Resolver.compose_sets(*sets)
end | ruby | def generate_vagrant_set
sets = [generate_builtin_set, generate_plugin_set]
if env_plugin_gem_path && env_plugin_gem_path.exist?
sets << generate_plugin_set(env_plugin_gem_path)
end
Gem::Resolver.compose_sets(*sets)
end | [
"def",
"generate_vagrant_set",
"sets",
"=",
"[",
"generate_builtin_set",
",",
"generate_plugin_set",
"]",
"if",
"env_plugin_gem_path",
"&&",
"env_plugin_gem_path",
".",
"exist?",
"sets",
"<<",
"generate_plugin_set",
"(",
"env_plugin_gem_path",
")",
"end",
"Gem",
"::",
... | Generate the composite resolver set totally all of vagrant (builtin + plugin set) | [
"Generate",
"the",
"composite",
"resolver",
"set",
"totally",
"all",
"of",
"vagrant",
"(",
"builtin",
"+",
"plugin",
"set",
")"
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/bundler.rb#L396-L402 | train | Generate the vagrant set | [
30522,
13366,
9699,
1035,
12436,
18980,
1035,
2275,
4520,
1027,
1031,
9699,
1035,
2328,
2378,
1035,
2275,
1010,
9699,
1035,
13354,
2378,
1035,
2275,
1033,
2065,
4372,
2615,
1035,
13354,
2378,
1035,
17070,
1035,
4130,
1004,
1004,
4372,
2615,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.create_prebuilt_entity_role | def create_prebuilt_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
response = create_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_prebuilt_entity_role(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
response = create_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_prebuilt_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"entity_role_create_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_prebuilt_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
... | Create a role for a prebuilt entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity model ID.
@param entity_role_create_object [EntityRoleCreateObject] An entity role
object containing the name of role.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Uuid] operation results. | [
"Create",
"a",
"role",
"for",
"a",
"prebuilt",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L6464-L6467 | train | Creates an entity role for a given entity in a version of the application. | [
30522,
13366,
3443,
1035,
3653,
8569,
4014,
2102,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
30524,
1010,
9178,
1035,
8909,
1010,
9178,
1035,
2535,
1035,
3443,
1035,
4874,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/pdk | lib/pdk/report.rb | PDK.Report.write_text | def write_text(target = self.class.default_target)
# Open a File Object for IO if target is a string containing a filename or path
target = File.open(target, 'w') if target.is_a? String
coverage_report = nil
events.each do |_tool, tool_events|
tool_events.each do |event|
if event.rspec_puppet_coverage?
coverage_report = event.to_text
else
target.puts(event.to_text) unless event.pass?
end
end
end
ensure
target.puts "\n#{coverage_report}" if coverage_report
target.close if target.is_a? File
end | ruby | def write_text(target = self.class.default_target)
# Open a File Object for IO if target is a string containing a filename or path
target = File.open(target, 'w') if target.is_a? String
coverage_report = nil
events.each do |_tool, tool_events|
tool_events.each do |event|
if event.rspec_puppet_coverage?
coverage_report = event.to_text
else
target.puts(event.to_text) unless event.pass?
end
end
end
ensure
target.puts "\n#{coverage_report}" if coverage_report
target.close if target.is_a? File
end | [
"def",
"write_text",
"(",
"target",
"=",
"self",
".",
"class",
".",
"default_target",
")",
"# Open a File Object for IO if target is a string containing a filename or path",
"target",
"=",
"File",
".",
"open",
"(",
"target",
",",
"'w'",
")",
"if",
"target",
".",
"is... | Renders the report as plain text.
This report is designed for interactive use by a human and so excludes
all passing events in order to be consise.
@param target [#write] an IO object that the report will be written to.
Defaults to PDK::Report.default_target. | [
"Renders",
"the",
"report",
"as",
"plain",
"text",
"."
] | 0d864aff62ffef04b5104addf399d0476afd71e7 | https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/report.rb#L93-L110 | train | Write the text to the target file | [
30522,
13366,
4339,
1035,
3793,
1006,
4539,
1027,
2969,
1012,
2465,
1012,
12398,
1035,
4539,
1007,
1001,
2330,
1037,
5371,
4874,
2005,
22834,
2065,
4539,
2003,
1037,
5164,
4820,
1037,
5371,
18442,
2030,
4130,
4539,
1027,
5371,
1012,
2330,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_by_enrollment_account | def list_by_enrollment_account(enrollment_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil)
first_page = list_by_enrollment_account_as_lazy(enrollment_account_id, expand:expand, filter:filter, skiptoken:skiptoken, top:top, query_options:query_options, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_enrollment_account(enrollment_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil)
first_page = list_by_enrollment_account_as_lazy(enrollment_account_id, expand:expand, filter:filter, skiptoken:skiptoken, top:top, query_options:query_options, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_enrollment_account",
"(",
"enrollment_account_id",
",",
"expand",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"skiptoken",
":",
"nil",
",",
"top",
":",
"nil",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_pa... | Lists the usage details by enrollmentAccountId for a scope by current billing
period. Usage details are available via this API only for May 1, 2014 or
later.
@param enrollment_account_id [String] EnrollmentAccount ID
@param expand [String] May be used to expand the
properties/additionalProperties or properties/meterDetails within a list of
usage details. By default, these fields are not included when listing usage
details.
@param filter [String] May be used to filter usageDetails by
properties/usageEnd (Utc time), properties/usageStart (Utc time),
properties/resourceGroup, properties/instanceName, properties/instanceId or
tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does
not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair
string where key and value is separated by a colon (:).
@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 most
recent N usageDetails.
@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 [Array<UsageDetail>] operation results. | [
"Lists",
"the",
"usage",
"details",
"by",
"enrollmentAccountId",
"for",
"a",
"scope",
"by",
"current",
"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#L950-L953 | train | Gets all the items in a given enrollment account. | [
30522,
13366,
2862,
1035,
2011,
1035,
10316,
1035,
4070,
1006,
10316,
1035,
4070,
1035,
8909,
1010,
7818,
1024,
9152,
2140,
1010,
11307,
1024,
9152,
2140,
1010,
13558,
18715,
2368,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
23032... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github-changelog-generator/github-changelog-generator | lib/github_changelog_generator/reader.rb | GitHubChangelogGenerator.Reader.parse_heading | def parse_heading(heading)
captures = { "version" => nil, "url" => nil, "date" => nil }
@heading_structures.each do |regexp|
matches = Regexp.new(regexp).match(heading)
if matches
captures.merge!(Hash[matches.names.zip(matches.captures)])
break
end
end
captures
end | ruby | def parse_heading(heading)
captures = { "version" => nil, "url" => nil, "date" => nil }
@heading_structures.each do |regexp|
matches = Regexp.new(regexp).match(heading)
if matches
captures.merge!(Hash[matches.names.zip(matches.captures)])
break
end
end
captures
end | [
"def",
"parse_heading",
"(",
"heading",
")",
"captures",
"=",
"{",
"\"version\"",
"=>",
"nil",
",",
"\"url\"",
"=>",
"nil",
",",
"\"date\"",
"=>",
"nil",
"}",
"@heading_structures",
".",
"each",
"do",
"|",
"regexp",
"|",
"matches",
"=",
"Regexp",
".",
"n... | Parse a single heading and return a Hash
The following heading structures are currently valid:
- ## [v1.0.2](https://github.com/zanui/chef-thumbor/tree/v1.0.1) (2015-03-24)
- ## [v1.0.2](https://github.com/zanui/chef-thumbor/tree/v1.0.1)
- ## v1.0.2 (2015-03-24)
- ## v1.0.2
@param [String] heading Heading from the ChangeLog File
@return [Hash] Returns a structured Hash with version, url and date | [
"Parse",
"a",
"single",
"heading",
"and",
"return",
"a",
"Hash"
] | f18c64b5cc0d7473b059275b88385ac11ca8b564 | https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/reader.rb#L53-L65 | train | Parse a heading string into a hash of captures | [
30522,
13366,
11968,
3366,
1035,
5825,
1006,
5825,
1007,
19566,
1027,
1063,
1000,
2544,
1000,
1027,
1028,
9152,
2140,
1010,
1000,
24471,
2140,
1000,
1027,
1028,
9152,
2140,
1010,
1000,
3058,
1000,
1027,
1028,
9152,
2140,
1065,
1030,
5825,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.create_prebuilt_entity_role_with_http_info | def create_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
create_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end | ruby | def create_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
create_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end | [
"def",
"create_prebuilt_entity_role_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"entity_role_create_object",
",",
"custom_headers",
":",
"nil",
")",
"create_prebuilt_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",... | Create a role for a prebuilt entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity model ID.
@param entity_role_create_object [EntityRoleCreateObject] An entity role
object containing the name of role.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Create",
"a",
"role",
"for",
"a",
"prebuilt",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L6482-L6484 | train | Creates an entity role for a given entity in a version of the application. | [
30522,
13366,
3443,
1035,
3653,
8569,
4014,
2102,
1035,
9178,
1035,
2535,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
9178,
1035,
2535,
1035,
3443,
1035,
4874,
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... |
brianmario/mysql2 | lib/mysql2/error.rb | Mysql2.Error.clean_message | def clean_message(message)
if @server_version && @server_version > 50500
message.encode(ENCODE_OPTS)
else
message.encode(Encoding::UTF_8, ENCODE_OPTS)
end
end | ruby | def clean_message(message)
if @server_version && @server_version > 50500
message.encode(ENCODE_OPTS)
else
message.encode(Encoding::UTF_8, ENCODE_OPTS)
end
end | [
"def",
"clean_message",
"(",
"message",
")",
"if",
"@server_version",
"&&",
"@server_version",
">",
"50500",
"message",
".",
"encode",
"(",
"ENCODE_OPTS",
")",
"else",
"message",
".",
"encode",
"(",
"Encoding",
"::",
"UTF_8",
",",
"ENCODE_OPTS",
")",
"end",
... | In MySQL 5.5+ error messages are always constructed server-side as UTF-8
then returned in the encoding set by the `character_set_results` system
variable.
See http://dev.mysql.com/doc/refman/5.5/en/charset-errors.html for
more context.
Before MySQL 5.5 error message template strings are in whatever encoding
is associated with the error message language.
See http://dev.mysql.com/doc/refman/5.1/en/error-message-language.html
for more information.
The issue is that the user-data inserted in the message could potentially
be in any encoding MySQL supports and is insert into the latin1, euckr or
koi8r string raw. Meaning there's a high probability the string will be
corrupt encoding-wise.
See http://dev.mysql.com/doc/refman/5.1/en/charset-errors.html for
more information.
So in an attempt to make sure the error message string is always in a valid
encoding, we'll assume UTF-8 and clean the string of anything that's not a
valid UTF-8 character.
Returns a valid UTF-8 string. | [
"In",
"MySQL",
"5",
".",
"5",
"+",
"error",
"messages",
"are",
"always",
"constructed",
"server",
"-",
"side",
"as",
"UTF",
"-",
"8",
"then",
"returned",
"in",
"the",
"encoding",
"set",
"by",
"the",
"character_set_results",
"system",
"variable",
"."
] | c8c346db72b5505740065d9de79b4a52081d5a57 | https://github.com/brianmario/mysql2/blob/c8c346db72b5505740065d9de79b4a52081d5a57/lib/mysql2/error.rb#L92-L98 | train | clean message | [
30522,
13366,
4550,
1035,
4471,
1006,
4471,
1007,
2065,
1030,
8241,
1035,
2544,
1004,
1004,
1030,
8241,
1035,
2544,
1028,
28952,
8889,
4471,
1012,
4372,
16044,
1006,
4372,
16044,
1035,
23569,
2015,
1007,
2842,
4471,
1012,
4372,
16044,
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... |
jeremytregunna/ruby-trello | lib/trello/card.rb | Trello.Card.attachments | def attachments
attachments = Attachment.from_response client.get("/cards/#{id}/attachments")
MultiAssociation.new(self, attachments).proxy
end | ruby | def attachments
attachments = Attachment.from_response client.get("/cards/#{id}/attachments")
MultiAssociation.new(self, attachments).proxy
end | [
"def",
"attachments",
"attachments",
"=",
"Attachment",
".",
"from_response",
"client",
".",
"get",
"(",
"\"/cards/#{id}/attachments\"",
")",
"MultiAssociation",
".",
"new",
"(",
"self",
",",
"attachments",
")",
".",
"proxy",
"end"
] | Retrieve a list of attachments | [
"Retrieve",
"a",
"list",
"of",
"attachments"
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/card.rb#L437-L440 | train | Returns the array of attachment objects for this card | [
30522,
13366,
14449,
2015,
14449,
2015,
1027,
14449,
1012,
2013,
1035,
3433,
7396,
1012,
2131,
1006,
1000,
1013,
5329,
1013,
1001,
1063,
8909,
1065,
1013,
14449,
2015,
1000,
1007,
4800,
12054,
10085,
18963,
1012,
2047,
30524,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_media_services/lib/2015-10-01/generated/azure_mgmt_media_services/media_service_operations.rb | Azure::MediaServices::Mgmt::V2015_10_01.MediaServiceOperations.create | def create(resource_group_name, media_service_name, parameters, custom_headers:nil)
response = create_async(resource_group_name, media_service_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create(resource_group_name, media_service_name, parameters, custom_headers:nil)
response = create_async(resource_group_name, media_service_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create",
"(",
"resource_group_name",
",",
"media_service_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_async",
"(",
"resource_group_name",
",",
"media_service_name",
",",
"parameters",
",",
"custom_headers",
":custo... | Creates a Media Service.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param media_service_name [String] Name of the Media Service.
@param parameters [MediaService] Media Service properties needed for
creation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MediaService] operation results. | [
"Creates",
"a",
"Media",
"Service",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_media_services/lib/2015-10-01/generated/azure_mgmt_media_services/media_service_operations.rb#L327-L330 | train | Creates a new Central Search Search | [
30522,
13366,
3443,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2865,
1035,
2326,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
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... |
puppetlabs/puppet | lib/puppet/util.rb | Puppet.Util.uri_to_path | def uri_to_path(uri)
return unless uri.is_a?(URI)
# CGI.unescape doesn't handle space rules properly in uri paths
# URI.unescape does, but returns strings in their original encoding
path = URI.unescape(uri.path.encode(Encoding::UTF_8))
if Puppet::Util::Platform.windows? && uri.scheme == 'file'
if uri.host
path = "//#{uri.host}" + path # UNC
else
path.sub!(/^\//, '')
end
end
path
end | ruby | def uri_to_path(uri)
return unless uri.is_a?(URI)
# CGI.unescape doesn't handle space rules properly in uri paths
# URI.unescape does, but returns strings in their original encoding
path = URI.unescape(uri.path.encode(Encoding::UTF_8))
if Puppet::Util::Platform.windows? && uri.scheme == 'file'
if uri.host
path = "//#{uri.host}" + path # UNC
else
path.sub!(/^\//, '')
end
end
path
end | [
"def",
"uri_to_path",
"(",
"uri",
")",
"return",
"unless",
"uri",
".",
"is_a?",
"(",
"URI",
")",
"# CGI.unescape doesn't handle space rules properly in uri paths",
"# URI.unescape does, but returns strings in their original encoding",
"path",
"=",
"URI",
".",
"unescape",
"(",... | Get the path component of a URI | [
"Get",
"the",
"path",
"component",
"of",
"a",
"URI"
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util.rb#L351-L367 | train | Convert a URI to a path | [
30522,
13366,
24471,
2072,
1035,
2000,
1035,
4130,
1006,
24471,
2072,
1007,
2709,
4983,
24471,
2072,
1012,
2003,
1035,
1037,
1029,
1006,
24471,
2072,
1007,
1001,
1039,
5856,
1012,
16655,
15782,
5051,
2987,
1005,
1056,
5047,
2686,
3513,
7919... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/node_reports.rb | Azure::Automation::Mgmt::V2015_10_31.NodeReports.list_by_node | def list_by_node(resource_group_name, automation_account_name, node_id, filter:nil, custom_headers:nil)
first_page = list_by_node_as_lazy(resource_group_name, automation_account_name, node_id, filter:filter, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_node(resource_group_name, automation_account_name, node_id, filter:nil, custom_headers:nil)
first_page = list_by_node_as_lazy(resource_group_name, automation_account_name, node_id, filter:filter, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_node",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"node_id",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_node_as_lazy",
"(",
"resource_group_name",
",",
"automation_account_name",
... | Retrieve the Dsc node report list by node id.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param node_id [String] The parameters supplied to the list operation.
@param filter [String] The filter to apply on the operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<DscNodeReport>] operation results. | [
"Retrieve",
"the",
"Dsc",
"node",
"report",
"list",
"by",
"node",
"id",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/node_reports.rb#L36-L39 | train | Gets the list of all the segmentation of the node. | [
30522,
13366,
2862,
1035,
2011,
1035,
13045,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
13045,
1035,
8909,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/time_with_zone.rb | ActiveSupport.TimeWithZone.change | def change(options)
if options[:zone] && options[:offset]
raise ArgumentError, "Can't change both :offset and :zone at the same time: #{options.inspect}"
end
new_time = time.change(options)
if options[:zone]
new_zone = ::Time.find_zone(options[:zone])
elsif options[:offset]
new_zone = ::Time.find_zone(new_time.utc_offset)
end
new_zone ||= time_zone
periods = new_zone.periods_for_local(new_time)
self.class.new(nil, new_zone, new_time, periods.include?(period) ? period : nil)
end | ruby | def change(options)
if options[:zone] && options[:offset]
raise ArgumentError, "Can't change both :offset and :zone at the same time: #{options.inspect}"
end
new_time = time.change(options)
if options[:zone]
new_zone = ::Time.find_zone(options[:zone])
elsif options[:offset]
new_zone = ::Time.find_zone(new_time.utc_offset)
end
new_zone ||= time_zone
periods = new_zone.periods_for_local(new_time)
self.class.new(nil, new_zone, new_time, periods.include?(period) ? period : nil)
end | [
"def",
"change",
"(",
"options",
")",
"if",
"options",
"[",
":zone",
"]",
"&&",
"options",
"[",
":offset",
"]",
"raise",
"ArgumentError",
",",
"\"Can't change both :offset and :zone at the same time: #{options.inspect}\"",
"end",
"new_time",
"=",
"time",
".",
"change"... | Returns a new +ActiveSupport::TimeWithZone+ where one or more of the elements have
been changed according to the +options+ parameter. The time options (<tt>:hour</tt>,
<tt>:min</tt>, <tt>:sec</tt>, <tt>:usec</tt>, <tt>:nsec</tt>) reset cascadingly,
so if only the hour is passed, then minute, sec, usec and nsec is set to 0. If the
hour and minute is passed, then sec, usec and nsec is set to 0. The +options+
parameter takes a hash with any of these keys: <tt>:year</tt>, <tt>:month</tt>,
<tt>:day</tt>, <tt>:hour</tt>, <tt>:min</tt>, <tt>:sec</tt>, <tt>:usec</tt>,
<tt>:nsec</tt>, <tt>:offset</tt>, <tt>:zone</tt>. Pass either <tt>:usec</tt>
or <tt>:nsec</tt>, not both. Similarly, pass either <tt>:zone</tt> or
<tt>:offset</tt>, not both.
t = Time.zone.now # => Fri, 14 Apr 2017 11:45:15 EST -05:00
t.change(year: 2020) # => Tue, 14 Apr 2020 11:45:15 EST -05:00
t.change(hour: 12) # => Fri, 14 Apr 2017 12:00:00 EST -05:00
t.change(min: 30) # => Fri, 14 Apr 2017 11:30:00 EST -05:00
t.change(offset: "-10:00") # => Fri, 14 Apr 2017 11:45:15 HST -10:00
t.change(zone: "Hawaii") # => Fri, 14 Apr 2017 11:45:15 HST -10:00 | [
"Returns",
"a",
"new",
"+",
"ActiveSupport",
"::",
"TimeWithZone",
"+",
"where",
"one",
"or",
"more",
"of",
"the",
"elements",
"have",
"been",
"changed",
"according",
"to",
"the",
"+",
"options",
"+",
"parameter",
".",
"The",
"time",
"options",
"(",
"<tt",... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/time_with_zone.rb#L362-L379 | train | Change the time of the calendar to the new time. | [
30522,
13366,
2689,
1006,
7047,
1007,
2065,
7047,
1031,
1024,
4224,
1033,
1004,
1004,
7047,
1031,
1024,
16396,
1033,
5333,
6685,
2121,
29165,
1010,
1000,
2064,
1005,
1056,
2689,
2119,
1024,
16396,
1998,
1024,
4224,
2012,
1996,
2168,
2051,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/webhooks.rb | Azure::ContainerRegistry::Mgmt::V2017_06_01_preview.Webhooks.begin_update | def begin_update(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
response = begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:nil)
response = begin_update_async(resource_group_name, registry_name, webhook_name, webhook_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update",
"(",
"resource_group_name",
",",
"registry_name",
",",
"webhook_name",
",",
"webhook_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"webhook... | Updates a webhook with the specified parameters.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param webhook_name [String] The name of the webhook.
@param webhook_update_parameters [WebhookUpdateParameters] The parameters for
updating a webhook.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Webhook] operation results. | [
"Updates",
"a",
"webhook",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/webhooks.rb#L921-L924 | train | Updates a webhook. | [
30522,
13366,
4088,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
4773,
6806,
6559,
1035,
2171,
1010,
4773,
6806,
6559,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachineScaleSets.begin_update_instances | def begin_update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
response = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
response = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update_instances",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_instances_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_id... | Upgrades one or more virtual machines to the latest SKU set in the VM scale
set model.
@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_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
of virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusResponse] operation results. | [
"Upgrades",
"one",
"or",
"more",
"virtual",
"machines",
"to",
"the",
"latest",
"SKU",
"set",
"in",
"the",
"VM",
"scale",
"set",
"model",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1693-L1696 | train | Updates a set of virtual machines in a VM scale set. | [
30522,
13366,
4088,
1035,
10651,
1035,
12107,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
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 | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.set_sas_definition_with_http_info | def set_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, parameters, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
set_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, parameters, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value!
end | ruby | def set_sas_definition_with_http_info(vault_base_url, storage_account_name, sas_definition_name, parameters, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
set_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, parameters, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value!
end | [
"def",
"set_sas_definition_with_http_info",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"sas_definition_name",
",",
"parameters",
",",
"sas_definition_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"set_sas_definit... | Creates or updates a new SAS definition for the specified storage account.
This operation requires the storage/setsas permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param storage_account_name [String] The name of the storage account.
@param sas_definition_name [String] The name of the SAS definition.
@param parameters [Hash{String => String}] Sas definition creation metadata
in the form of key-value pairs.
@param sas_definition_attributes [SasDefinitionAttributes] The attributes of
the SAS definition.
@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. | [
"Creates",
"or",
"updates",
"a",
"new",
"SAS",
"definition",
"for",
"the",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"setsas",
"permission",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L8017-L8019 | train | Sets the specified SAS definition. | [
30522,
13366,
2275,
1035,
21871,
1035,
6210,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
21871,
1035,
6210,
1035,
2171,
1010,
11709,
1010,
21871,
1035,
6210,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_store/lib/2015-10-01-preview/generated/azure_mgmt_datalake_store/account.rb | Azure::DataLakeStore::Mgmt::V2015_10_01_preview.Account.create_or_update_firewall_rule_with_http_info | def create_or_update_firewall_rule_with_http_info(resource_group_name, account_name, name, parameters, custom_headers:nil)
create_or_update_firewall_rule_async(resource_group_name, account_name, name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_or_update_firewall_rule_with_http_info(resource_group_name, account_name, name, parameters, custom_headers:nil)
create_or_update_firewall_rule_async(resource_group_name, account_name, name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_firewall_rule_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_firewall_rule_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"na... | Creates or updates the specified firewall rule.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Store account.
@param account_name [String] The name of the Data Lake Store account to which
to add the firewall rule.
@param name [String] The name of the firewall rule to create or update.
@param parameters [FirewallRule] Parameters supplied to create the create
firewall rule.
@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",
"the",
"specified",
"firewall",
"rule",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_store/lib/2015-10-01-preview/generated/azure_mgmt_datalake_store/account.rb#L356-L358 | train | Creates or updates a firewall rule. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2543,
9628,
1035,
3627,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
2171,
1010,
11709,
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... |
grpc/grpc | src/ruby/lib/grpc/generic/rpc_server.rb | GRPC.RpcServer.available? | def available?(an_rpc)
return an_rpc if @pool.ready_for_work?
GRPC.logger.warn('no free worker threads currently')
noop = proc { |x| x }
# Create a new active call that knows that metadata hasn't been
# sent yet
c = ActiveCall.new(an_rpc.call, noop, noop, an_rpc.deadline,
metadata_received: true, started: false)
c.send_status(GRPC::Core::StatusCodes::RESOURCE_EXHAUSTED,
'No free threads in thread pool')
nil
end | ruby | def available?(an_rpc)
return an_rpc if @pool.ready_for_work?
GRPC.logger.warn('no free worker threads currently')
noop = proc { |x| x }
# Create a new active call that knows that metadata hasn't been
# sent yet
c = ActiveCall.new(an_rpc.call, noop, noop, an_rpc.deadline,
metadata_received: true, started: false)
c.send_status(GRPC::Core::StatusCodes::RESOURCE_EXHAUSTED,
'No free threads in thread pool')
nil
end | [
"def",
"available?",
"(",
"an_rpc",
")",
"return",
"an_rpc",
"if",
"@pool",
".",
"ready_for_work?",
"GRPC",
".",
"logger",
".",
"warn",
"(",
"'no free worker threads currently'",
")",
"noop",
"=",
"proc",
"{",
"|",
"x",
"|",
"x",
"}",
"# Create a new active ca... | Sends RESOURCE_EXHAUSTED if there are too many unprocessed jobs | [
"Sends",
"RESOURCE_EXHAUSTED",
"if",
"there",
"are",
"too",
"many",
"unprocessed",
"jobs"
] | f3937f0e55227a4ef3a23f895d3b204a947610f8 | https://github.com/grpc/grpc/blob/f3937f0e55227a4ef3a23f895d3b204a947610f8/src/ruby/lib/grpc/generic/rpc_server.rb#L419-L431 | train | Returns an active call object | [
30522,
13366,
2800,
1029,
1006,
2019,
1035,
1054,
15042,
1007,
2709,
2019,
1035,
1054,
15042,
2065,
1030,
4770,
1012,
3201,
1035,
2005,
1035,
2147,
1029,
24665,
15042,
1012,
30524,
2489,
7309,
16457,
2747,
1005,
1007,
2053,
7361,
1027,
4013... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
refinery/refinerycms | core/app/helpers/refinery/meta_helper.rb | Refinery.MetaHelper.page_title | def page_title(options = {})
object = options.fetch(:object, @meta)
options.delete(:object)
options = Refinery::Pages.page_title.merge(options)
title = []
objects = (options[:chain_page_title] and object.respond_to?(:ancestors)) ? [object.ancestors, object] : [object]
objects.flatten.compact.each do |obj|
obj_title = obj.title if obj.title
# Only link when the object responds to a url method.
if options[:link] && obj.respond_to?(:url)
title << link_to(obj_title, obj.url)
else
title << obj_title
end
end
final_title = title.pop
if (options[:page_title][:wrap_if_not_chained] and title.empty?) and options[:page_title][:tag].present?
css = " class='#{options[:page_title][:class]}'" if options[:page_title][:class].present?
final_title = "<#{options[:page_title][:tag]}#{css}>#{final_title}</#{options[:page_title][:tag]}>"
end
if title.empty?
final_title.to_s.html_safe
else
tag = "<#{options[:ancestors][:tag]} class='#{options[:ancestors][:class]}'>"
tag << title.join(options[:ancestors][:separator])
tag << options[:ancestors][:separator]
tag << "</#{options[:ancestors][:tag]}>#{final_title}"
tag.html_safe
end
end | ruby | def page_title(options = {})
object = options.fetch(:object, @meta)
options.delete(:object)
options = Refinery::Pages.page_title.merge(options)
title = []
objects = (options[:chain_page_title] and object.respond_to?(:ancestors)) ? [object.ancestors, object] : [object]
objects.flatten.compact.each do |obj|
obj_title = obj.title if obj.title
# Only link when the object responds to a url method.
if options[:link] && obj.respond_to?(:url)
title << link_to(obj_title, obj.url)
else
title << obj_title
end
end
final_title = title.pop
if (options[:page_title][:wrap_if_not_chained] and title.empty?) and options[:page_title][:tag].present?
css = " class='#{options[:page_title][:class]}'" if options[:page_title][:class].present?
final_title = "<#{options[:page_title][:tag]}#{css}>#{final_title}</#{options[:page_title][:tag]}>"
end
if title.empty?
final_title.to_s.html_safe
else
tag = "<#{options[:ancestors][:tag]} class='#{options[:ancestors][:class]}'>"
tag << title.join(options[:ancestors][:separator])
tag << options[:ancestors][:separator]
tag << "</#{options[:ancestors][:tag]}>#{final_title}"
tag.html_safe
end
end | [
"def",
"page_title",
"(",
"options",
"=",
"{",
"}",
")",
"object",
"=",
"options",
".",
"fetch",
"(",
":object",
",",
"@meta",
")",
"options",
".",
"delete",
"(",
":object",
")",
"options",
"=",
"Refinery",
"::",
"Pages",
".",
"page_title",
".",
"merge... | you can override the object used for the title by supplying options[:object] | [
"you",
"can",
"override",
"the",
"object",
"used",
"for",
"the",
"title",
"by",
"supplying",
"options",
"[",
":",
"object",
"]"
] | 67f117f937c5264ec0aeabe8e7eac1d562c5bc7b | https://github.com/refinery/refinerycms/blob/67f117f937c5264ec0aeabe8e7eac1d562c5bc7b/core/app/helpers/refinery/meta_helper.rb#L15-L49 | train | Returns the page title for the object. | [
30522,
13366,
3931,
1035,
2516,
1006,
7047,
1027,
1063,
1065,
1007,
4874,
1027,
7047,
1012,
18584,
1006,
1024,
4874,
1010,
1030,
18804,
1007,
7047,
1012,
3972,
12870,
1006,
1024,
4874,
1007,
7047,
1027,
21034,
1024,
1024,
5530,
1012,
3931,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activemodel/lib/active_model/errors.rb | ActiveModel.Errors.import | def import(error, override_options = {})
[:attribute, :type].each do |key|
if override_options.key?(key)
override_options[key] = override_options[key].to_sym
end
end
@errors.append(NestedError.new(@base, error, override_options))
end | ruby | def import(error, override_options = {})
[:attribute, :type].each do |key|
if override_options.key?(key)
override_options[key] = override_options[key].to_sym
end
end
@errors.append(NestedError.new(@base, error, override_options))
end | [
"def",
"import",
"(",
"error",
",",
"override_options",
"=",
"{",
"}",
")",
"[",
":attribute",
",",
":type",
"]",
".",
"each",
"do",
"|",
"key",
"|",
"if",
"override_options",
".",
"key?",
"(",
"key",
")",
"override_options",
"[",
"key",
"]",
"=",
"o... | Imports one error
Imported errors are wrapped as a NestedError,
providing access to original error object.
If attribute or type needs to be overriden, use `override_options`.
override_options - Hash
@option override_options [Symbol] :attribute Override the attribute the error belongs to
@option override_options [Symbol] :type Override type of the error. | [
"Imports",
"one",
"error",
"Imported",
"errors",
"are",
"wrapped",
"as",
"a",
"NestedError",
"providing",
"access",
"to",
"original",
"error",
"object",
".",
"If",
"attribute",
"or",
"type",
"needs",
"to",
"be",
"overriden",
"use",
"override_options",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activemodel/lib/active_model/errors.rb#L121-L128 | train | Import an error into the current object. | [
30522,
13366,
12324,
1006,
7561,
1010,
2058,
15637,
1035,
7047,
1027,
1063,
1065,
1007,
1031,
30524,
1031,
3145,
1033,
1027,
2058,
15637,
1035,
7047,
1031,
3145,
1033,
1012,
2000,
1035,
25353,
2213,
2203,
2203,
1030,
10697,
1012,
10439,
104... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.