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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
elastic/apm-agent-ruby | lib/elastic_apm/instrumenter.rb | ElasticAPM.Instrumenter.set_tag | def set_tag(key, value)
return unless current_transaction
key = key.to_s.gsub(/[\."\*]/, '_').to_sym
current_transaction.context.tags[key] = value.to_s
end | ruby | def set_tag(key, value)
return unless current_transaction
key = key.to_s.gsub(/[\."\*]/, '_').to_sym
current_transaction.context.tags[key] = value.to_s
end | [
"def",
"set_tag",
"(",
"key",
",",
"value",
")",
"return",
"unless",
"current_transaction",
"key",
"=",
"key",
".",
"to_s",
".",
"gsub",
"(",
"/",
"\\.",
"\\*",
"/",
",",
"'_'",
")",
".",
"to_sym",
"current_transaction",
".",
"context",
".",
"tags",
"[... | metadata | [
"metadata"
] | 82190d1a9ba22af3b2c2c6fe6d23cc471f2e7ff6 | https://github.com/elastic/apm-agent-ruby/blob/82190d1a9ba22af3b2c2c6fe6d23cc471f2e7ff6/lib/elastic_apm/instrumenter.rb#L188-L193 | train | Set a tag | [
30522,
13366,
2275,
1035,
6415,
1006,
3145,
1010,
3643,
1007,
2709,
4983,
2783,
1035,
12598,
3145,
1027,
3145,
1012,
2000,
1035,
1055,
1012,
28177,
12083,
1006,
1013,
1031,
1032,
1012,
1000,
1032,
1008,
1033,
1013,
1010,
1005,
1035,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/load_balancer_probes.rb | Azure::Network::Mgmt::V2018_07_01.LoadBalancerProbes.get_with_http_info | def get_with_http_info(resource_group_name, load_balancer_name, probe_name, custom_headers:nil)
get_async(resource_group_name, load_balancer_name, probe_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, load_balancer_name, probe_name, custom_headers:nil)
get_async(resource_group_name, load_balancer_name, probe_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"load_balancer_name",
",",
"probe_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"load_balancer_name",
",",
"probe_name",
",",
"custom_headers",
":custom_headers",
... | Gets load balancer probe.
@param resource_group_name [String] The name of the resource group.
@param load_balancer_name [String] The name of the load balancer.
@param probe_name [String] The name of the probe.
@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",
"load",
"balancer",
"probe",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/load_balancer_probes.rb#L143-L145 | train | Gets the specified load balancer probe. | [
30522,
13366,
2131,
1035,
30524,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7170,
1035,
5703,
2099,
1035,
2171,
1010,
15113,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
2203,
102,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_repair_task_list_with_http_info | def get_repair_task_list_with_http_info(task_id_filter:nil, state_filter:nil, executor_filter:nil, custom_headers:nil)
get_repair_task_list_async(task_id_filter:task_id_filter, state_filter:state_filter, executor_filter:executor_filter, custom_headers:custom_headers).value!
end | ruby | def get_repair_task_list_with_http_info(task_id_filter:nil, state_filter:nil, executor_filter:nil, custom_headers:nil)
get_repair_task_list_async(task_id_filter:task_id_filter, state_filter:state_filter, executor_filter:executor_filter, custom_headers:custom_headers).value!
end | [
"def",
"get_repair_task_list_with_http_info",
"(",
"task_id_filter",
":",
"nil",
",",
"state_filter",
":",
"nil",
",",
"executor_filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_repair_task_list_async",
"(",
"task_id_filter",
":task_id_filter",
",",
"... | Gets a list of repair tasks matching the given filters.
This API supports the Service Fabric platform; it is not meant to be used
directly from your code.
@param task_id_filter [String] The repair task ID prefix to be matched.
@param state_filter [Integer] A bitwise-OR of the following values,
specifying which task states should be included in the result list.
- 1 - Created
- 2 - Claimed
- 4 - Preparing
- 8 - Approved
- 16 - Executing
- 32 - Restoring
- 64 - Completed
@param executor_filter [String] The name of the repair executor whose claimed
tasks should be included in the list.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"a",
"list",
"of",
"repair",
"tasks",
"matching",
"the",
"given",
"filters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L14013-L14015 | train | Gets the list of tasks that are currently in the current task list. | [
30522,
13366,
2131,
1035,
7192,
1035,
4708,
1035,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
4708,
1035,
8909,
1035,
11307,
1024,
9152,
2140,
1010,
2110,
1035,
11307,
1024,
9152,
2140,
1010,
4654,
8586,
16161,
2099,
1035,
11307,
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... |
mikker/passwordless | app/mailers/passwordless/mailer.rb | Passwordless.Mailer.magic_link | def magic_link(session)
@session = session
@magic_link = send(Passwordless.mounted_as)
.token_sign_in_url(session.token)
email_field = @session.authenticatable.class.passwordless_email_field
mail(
to: @session.authenticatable.send(email_field),
subject: I18n.t("passwordless.mailer.subject")
)
end | ruby | def magic_link(session)
@session = session
@magic_link = send(Passwordless.mounted_as)
.token_sign_in_url(session.token)
email_field = @session.authenticatable.class.passwordless_email_field
mail(
to: @session.authenticatable.send(email_field),
subject: I18n.t("passwordless.mailer.subject")
)
end | [
"def",
"magic_link",
"(",
"session",
")",
"@session",
"=",
"session",
"@magic_link",
"=",
"send",
"(",
"Passwordless",
".",
"mounted_as",
")",
".",
"token_sign_in_url",
"(",
"session",
".",
"token",
")",
"email_field",
"=",
"@session",
".",
"authenticatable",
... | Sends a magic link (secret token) email.
@param session [Session] A Passwordless Session | [
"Sends",
"a",
"magic",
"link",
"(",
"secret",
"token",
")",
"email",
"."
] | 80d3e00c78114aed01f336514a236dfc17d0a91a | https://github.com/mikker/passwordless/blob/80d3e00c78114aed01f336514a236dfc17d0a91a/app/mailers/passwordless/mailer.rb#L10-L21 | train | send magic link to the session | [
30522,
13366,
3894,
1035,
4957,
1006,
5219,
1007,
1030,
5219,
1027,
5219,
1030,
3894,
1035,
4957,
1027,
4604,
1006,
20786,
3238,
1012,
5614,
1035,
2004,
1007,
1012,
19204,
1035,
3696,
1035,
1999,
1035,
24471,
2140,
1006,
5219,
1012,
19204,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.update_intent_with_http_info | def update_intent_with_http_info(app_id, version_id, intent_id, model_update_object, custom_headers:nil)
update_intent_async(app_id, version_id, intent_id, model_update_object, custom_headers:custom_headers).value!
end | ruby | def update_intent_with_http_info(app_id, version_id, intent_id, model_update_object, custom_headers:nil)
update_intent_async(app_id, version_id, intent_id, model_update_object, custom_headers:custom_headers).value!
end | [
"def",
"update_intent_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"intent_id",
",",
"model_update_object",
",",
"custom_headers",
":",
"nil",
")",
"update_intent_async",
"(",
"app_id",
",",
"version_id",
",",
"intent_id",
",",
"model_update_object",
",",
... | Updates the name of an intent in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param intent_id The intent classifier ID.
@param model_update_object [ModelUpdateObject] A model object containing the
new intent 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. | [
"Updates",
"the",
"name",
"of",
"an",
"intent",
"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#L1938-L1940 | train | Updates an intent. | [
30522,
13366,
10651,
1035,
7848,
30524,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
7848,
1035,
8909,
1010,
2944,
1035,
10651,
1035,
4874,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
1035,
7848,
1035,
2004,
6038,
2278,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/puppet | lib/puppet/network/http/connection.rb | Puppet::Network::HTTP.Connection.request_get | def request_get(*args, &block)
with_connection(@site) do |http|
resp = http.request_get(*args, &block)
Puppet.debug("HTTP GET #{@site}#{args.first.split('?').first} returned #{resp.code} #{resp.message}")
resp
end
end | ruby | def request_get(*args, &block)
with_connection(@site) do |http|
resp = http.request_get(*args, &block)
Puppet.debug("HTTP GET #{@site}#{args.first.split('?').first} returned #{resp.code} #{resp.message}")
resp
end
end | [
"def",
"request_get",
"(",
"*",
"args",
",",
"&",
"block",
")",
"with_connection",
"(",
"@site",
")",
"do",
"|",
"http",
"|",
"resp",
"=",
"http",
".",
"request_get",
"(",
"args",
",",
"block",
")",
"Puppet",
".",
"debug",
"(",
"\"HTTP GET #{@site}#{args... | TODO: These are proxies for the Net::HTTP#request_* methods, which are
almost the same as the "get", "post", etc. methods that we've ported above,
but they are able to accept a code block and will yield to it, which is
necessary to stream responses, e.g. file content. For now
we're not funneling these proxy implementations through our #request
method above, so they will not inherit the same error handling. In the
future we may want to refactor these so that they are funneled through
that method and do inherit the error handling. | [
"TODO",
":",
"These",
"are",
"proxies",
"for",
"the",
"Net",
"::",
"HTTP#request_",
"*",
"methods",
"which",
"are",
"almost",
"the",
"same",
"as",
"the",
"get",
"post",
"etc",
".",
"methods",
"that",
"we",
"ve",
"ported",
"above",
"but",
"they",
"are",
... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/network/http/connection.rb#L143-L149 | train | Request a GET request | [
30522,
13366,
5227,
1035,
2131,
1006,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
2007,
1035,
4434,
1006,
1030,
2609,
1007,
2079,
1064,
8299,
1064,
24501,
2361,
1027,
8299,
1012,
5227,
1035,
2131,
1006,
1008,
12098,
5620,
1010,
1004,
3796,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | deliver/lib/deliver/html_generator.rb | Deliver.HtmlGenerator.render_relative_path | def render_relative_path(export_path, path)
export_path = Pathname.new(export_path)
path = Pathname.new(path).relative_path_from(export_path)
return path.to_path
end | ruby | def render_relative_path(export_path, path)
export_path = Pathname.new(export_path)
path = Pathname.new(path).relative_path_from(export_path)
return path.to_path
end | [
"def",
"render_relative_path",
"(",
"export_path",
",",
"path",
")",
"export_path",
"=",
"Pathname",
".",
"new",
"(",
"export_path",
")",
"path",
"=",
"Pathname",
".",
"new",
"(",
"path",
")",
".",
"relative_path_from",
"(",
"export_path",
")",
"return",
"pa... | Returns a path relative to FastlaneFolder.path
This is needed as the Preview.html file is located inside FastlaneFolder.path | [
"Returns",
"a",
"path",
"relative",
"to",
"FastlaneFolder",
".",
"path",
"This",
"is",
"needed",
"as",
"the",
"Preview",
".",
"html",
"file",
"is",
"located",
"inside",
"FastlaneFolder",
".",
"path"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/deliver/lib/deliver/html_generator.rb#L37-L41 | train | render relative path to export_path | [
30522,
13366,
17552,
1035,
5816,
1035,
4130,
1006,
9167,
1035,
4130,
1010,
4130,
1007,
9167,
1035,
4130,
1027,
4130,
18442,
1012,
2047,
1006,
9167,
1035,
4130,
1007,
4130,
1027,
4130,
18442,
1012,
2047,
1006,
4130,
1007,
1012,
5816,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb | Aws::EC2.Vpc.subnets | def subnets(options = {})
batches = Enumerator.new do |y|
batch = []
options = Aws::Util.deep_merge(options, filters: [{
name: "vpc-id",
values: [@id]
}])
resp = @client.describe_subnets(options)
resp.data.subnets.each do |s|
batch << Subnet.new(
id: s.subnet_id,
data: s,
client: @client
)
end
y.yield(batch)
end
Subnet::Collection.new(batches)
end | ruby | def subnets(options = {})
batches = Enumerator.new do |y|
batch = []
options = Aws::Util.deep_merge(options, filters: [{
name: "vpc-id",
values: [@id]
}])
resp = @client.describe_subnets(options)
resp.data.subnets.each do |s|
batch << Subnet.new(
id: s.subnet_id,
data: s,
client: @client
)
end
y.yield(batch)
end
Subnet::Collection.new(batches)
end | [
"def",
"subnets",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"batch",
"=",
"[",
"]",
"options",
"=",
"Aws",
"::",
"Util",
".",
"deep_merge",
"(",
"options",
",",
"filters",
":",
"[",
"{",
"n... | @example Request syntax with placeholder values
subnets = vpc.subnets({
filters: [
{
name: "String",
values: ["String"],
},
],
subnet_ids: ["String"],
dry_run: false,
})
@param [Hash] options ({})
@option options [Array<Types::Filter>] :filters
One or more filters.
* `availability-zone` - The Availability Zone for the subnet. You can
also use `availabilityZone` as the filter name.
* `availability-zone-id` - The ID of the Availability Zone for the
subnet. You can also use `availabilityZoneId` as the filter name.
* `available-ip-address-count` - The number of IPv4 addresses in the
subnet that are available.
* `cidr-block` - The IPv4 CIDR block of the subnet. The CIDR block you
specify must exactly match the subnet's CIDR block for information
to be returned for the subnet. You can also use `cidr` or
`cidrBlock` as the filter names.
* `default-for-az` - Indicates whether this is the default subnet for
the Availability Zone. You can also use `defaultForAz` as the filter
name.
* `ipv6-cidr-block-association.ipv6-cidr-block` - An IPv6 CIDR block
associated with the subnet.
* `ipv6-cidr-block-association.association-id` - An association ID for
an IPv6 CIDR block associated with the subnet.
* `ipv6-cidr-block-association.state` - The state of an IPv6 CIDR
block associated with the subnet.
* `owner-id` - The ID of the AWS account that owns the subnet.
* `state` - The state of the subnet (`pending` \| `available`).
* `subnet-arn` - The Amazon Resource Name (ARN) of the subnet.
* `subnet-id` - The ID of the subnet.
* `tag`\:<key> - The key/value combination of a tag assigned to
the resource. Use the tag key in the filter name and the tag value
as the filter value. For example, to find all resources that have a
tag with the key `Owner` and the value `TeamA`, specify `tag:Owner`
for the filter name and `TeamA` for the filter value.
* `tag-key` - The key of a tag assigned to the resource. Use this
filter to find all resources assigned a tag with a specific key,
regardless of the tag value.
* `vpc-id` - The ID of the VPC for the subnet.
@option options [Array<String>] :subnet_ids
One or more subnet IDs.
Default: Describes all your subnets.
@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 [Subnet::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb#L1827-L1845 | train | Returns a list of subnets for this VPC | [
30522,
13366,
4942,
22781,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
14108,
1027,
1031,
1033,
7047,
1027,
22091,
2015,
1024,
1024,
21183,
4014,
1012,
2784,
1035,
13590,
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... |
rails/sprockets | lib/sprockets/encoding_utils.rb | Sprockets.EncodingUtils.unmarshaled_deflated | def unmarshaled_deflated(str, window_bits = -Zlib::MAX_WBITS)
major, minor = str[0], str[1]
if major && major.ord == Marshal::MAJOR_VERSION &&
minor && minor.ord <= Marshal::MINOR_VERSION
marshaled = str
else
begin
marshaled = Zlib::Inflate.new(window_bits).inflate(str)
rescue Zlib::DataError
marshaled = str
end
end
Marshal.load(marshaled)
end | ruby | def unmarshaled_deflated(str, window_bits = -Zlib::MAX_WBITS)
major, minor = str[0], str[1]
if major && major.ord == Marshal::MAJOR_VERSION &&
minor && minor.ord <= Marshal::MINOR_VERSION
marshaled = str
else
begin
marshaled = Zlib::Inflate.new(window_bits).inflate(str)
rescue Zlib::DataError
marshaled = str
end
end
Marshal.load(marshaled)
end | [
"def",
"unmarshaled_deflated",
"(",
"str",
",",
"window_bits",
"=",
"-",
"Zlib",
"::",
"MAX_WBITS",
")",
"major",
",",
"minor",
"=",
"str",
"[",
"0",
"]",
",",
"str",
"[",
"1",
"]",
"if",
"major",
"&&",
"major",
".",
"ord",
"==",
"Marshal",
"::",
"... | Internal: Unmarshal optionally deflated data.
Checks leading marshal header to see if the bytes are uncompressed
otherwise inflate the data an unmarshal.
str - Marshaled String
window_bits - Integer deflate window size. See ZLib::Inflate.new()
Returns unmarshaled Object or raises an Exception. | [
"Internal",
":",
"Unmarshal",
"optionally",
"deflated",
"data",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/encoding_utils.rb#L39-L52 | train | Unmarshalls a deflated string into a new object. | [
30522,
13366,
4895,
7849,
7377,
3709,
1035,
13366,
13776,
1006,
2358,
2099,
1010,
3332,
1035,
9017,
1027,
1011,
1062,
29521,
1024,
1024,
4098,
1035,
25610,
12762,
1007,
2350,
1010,
3576,
1027,
2358,
2099,
1031,
1014,
1033,
1010,
2358,
2099,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term.rb | Azure::CognitiveServices::ContentModerator::V1_0.ListManagementTerm.get_all_terms_with_http_info | def get_all_terms_with_http_info(list_id, language, offset:nil, limit:nil, custom_headers:nil)
get_all_terms_async(list_id, language, offset:offset, limit:limit, custom_headers:custom_headers).value!
end | ruby | def get_all_terms_with_http_info(list_id, language, offset:nil, limit:nil, custom_headers:nil)
get_all_terms_async(list_id, language, offset:offset, limit:limit, custom_headers:custom_headers).value!
end | [
"def",
"get_all_terms_with_http_info",
"(",
"list_id",
",",
"language",
",",
"offset",
":",
"nil",
",",
"limit",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_all_terms_async",
"(",
"list_id",
",",
"language",
",",
"offset",
":",
"offset",
",",
"l... | Gets all terms from the list with list Id equal to the list Id passed.
@param list_id [String] List Id of the image list.
@param language [String] Language of the terms.
@param offset [Integer] The pagination start index.
@param limit [Integer] The max limit.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"all",
"terms",
"from",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"the",
"list",
"Id",
"passed",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term.rb#L252-L254 | train | Gets all terms of a list. | [
30522,
13366,
2131,
1035,
2035,
1035,
3408,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2862,
1035,
8909,
1010,
2653,
1010,
16396,
1024,
9152,
2140,
1010,
5787,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
forward3d/rbhive | lib/rbhive/t_c_l_i_connection.rb | RBHive.TCLIConnection.parse_sasl_params | def parse_sasl_params(sasl_params)
# Symbilize keys in a hash
if sasl_params.kind_of?(Hash)
return sasl_params.inject({}) do |memo,(k,v)|
memo[k.to_sym] = v;
memo
end
end
return nil
end | ruby | def parse_sasl_params(sasl_params)
# Symbilize keys in a hash
if sasl_params.kind_of?(Hash)
return sasl_params.inject({}) do |memo,(k,v)|
memo[k.to_sym] = v;
memo
end
end
return nil
end | [
"def",
"parse_sasl_params",
"(",
"sasl_params",
")",
"# Symbilize keys in a hash",
"if",
"sasl_params",
".",
"kind_of?",
"(",
"Hash",
")",
"return",
"sasl_params",
".",
"inject",
"(",
"{",
"}",
")",
"do",
"|",
"memo",
",",
"(",
"k",
",",
"v",
")",
"|",
"... | Processes SASL connection params and returns a hash with symbol keys or a nil | [
"Processes",
"SASL",
"connection",
"params",
"and",
"returns",
"a",
"hash",
"with",
"symbol",
"keys",
"or",
"a",
"nil"
] | a630b57332f2face03501da3ecad2905c78056fa | https://github.com/forward3d/rbhive/blob/a630b57332f2face03501da3ecad2905c78056fa/lib/rbhive/t_c_l_i_connection.rb#L135-L144 | train | Parse sasl parameters | [
30522,
13366,
11968,
3366,
1035,
21871,
2140,
1035,
11498,
5244,
1006,
21871,
2140,
1035,
11498,
5244,
1007,
1001,
25353,
14905,
18622,
4371,
6309,
1999,
1037,
23325,
2065,
21871,
2140,
1035,
11498,
5244,
1012,
2785,
1035,
1997,
1029,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_tables.rb | Azure::Network::Mgmt::V2018_07_01.RouteTables.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, route_table_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, route_table_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, route_table_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, route_table_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"route_table_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"route_table_name",
",",
"parameters",
",",
"cust... | Create or updates a route table in a specified resource group.
@param resource_group_name [String] The name of the resource group.
@param route_table_name [String] The name of the route table.
@param parameters [RouteTable] Parameters supplied to the create or update
route table 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",
"updates",
"a",
"route",
"table",
"in",
"a",
"specified",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_tables.rb#L531-L533 | train | Creates or updates a route table in the specified resource group. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2799,
1035,
2795,
1035,
2171,
1010,
11709,
1010,
30524,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_application_backup_configuration_info | def get_application_backup_configuration_info(application_id, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
response = get_application_backup_configuration_info_async(application_id, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_application_backup_configuration_info(application_id, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
response = get_application_backup_configuration_info_async(application_id, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_application_backup_configuration_info",
"(",
"application_id",
",",
"continuation_token",
":",
"nil",
",",
"max_results",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_application_backup_configuration_info... | Gets the Service Fabric application backup configuration information.
Gets the Service Fabric backup configuration information for the application
and the services and partitions under this application.
@param application_id [String] The identity of the application. This is
typically the full name of the application without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the application name is "fabric:/myapp/app1", the application
identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PagedBackupConfigurationInfoList] operation results. | [
"Gets",
"the",
"Service",
"Fabric",
"application",
"backup",
"configuration",
"information",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L23222-L23225 | train | Gets the backup configuration information for the application. | [
30522,
13366,
2131,
1035,
4646,
1035,
10200,
1035,
9563,
1035,
18558,
1006,
4646,
1035,
8909,
1010,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
4098,
1035,
3463,
1024,
1014,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby2d/ruby2d | lib/ruby2d/sprite.rb | Ruby2D.Sprite.set_frame | def set_frame
frames = @animations[@playing_animation]
case frames
when Range
reset_clipping_rect
@clip_x = @current_frame * @clip_width
when Array
f = frames[@current_frame]
@clip_x = f[:x] || @defaults[:clip_x]
@clip_y = f[:y] || @defaults[:clip_y]
@clip_width = f[:width] || @defaults[:clip_width]
@clip_height = f[:height] || @defaults[:clip_height]
@frame_time = f[:time] || @defaults[:frame_time]
end
end | ruby | def set_frame
frames = @animations[@playing_animation]
case frames
when Range
reset_clipping_rect
@clip_x = @current_frame * @clip_width
when Array
f = frames[@current_frame]
@clip_x = f[:x] || @defaults[:clip_x]
@clip_y = f[:y] || @defaults[:clip_y]
@clip_width = f[:width] || @defaults[:clip_width]
@clip_height = f[:height] || @defaults[:clip_height]
@frame_time = f[:time] || @defaults[:frame_time]
end
end | [
"def",
"set_frame",
"frames",
"=",
"@animations",
"[",
"@playing_animation",
"]",
"case",
"frames",
"when",
"Range",
"reset_clipping_rect",
"@clip_x",
"=",
"@current_frame",
"*",
"@clip_width",
"when",
"Array",
"f",
"=",
"frames",
"[",
"@current_frame",
"]",
"@cli... | Set the position of the clipping retangle based on the current frame | [
"Set",
"the",
"position",
"of",
"the",
"clipping",
"retangle",
"based",
"on",
"the",
"current",
"frame"
] | 43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4 | https://github.com/ruby2d/ruby2d/blob/43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4/lib/ruby2d/sprite.rb#L198-L212 | train | set the current frame of the animation | [
30522,
13366,
2275,
1035,
4853,
11048,
1027,
1030,
7284,
2015,
1031,
1030,
2652,
1035,
7284,
1033,
2553,
11048,
2043,
2846,
25141,
1035,
12528,
4691,
1035,
28667,
2102,
1030,
12528,
1035,
1060,
1027,
1030,
2783,
1035,
4853,
1008,
1030,
1252... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
huginn/huginn | app/concerns/liquid_interpolatable.rb | LiquidInterpolatable.Filters.unescape_replacement | def unescape_replacement(s)
s.gsub(/\\(?:([\d+&`'\\]|k<\w+>)|u\{([[:xdigit:]]+)\}|x([[:xdigit:]]{2})|(.))/) {
if c = $1
BACKSLASH + c
elsif c = ($2 && [$2.to_i(16)].pack('U')) ||
($3 && [$3.to_i(16)].pack('C'))
if c == BACKSLASH
BACKSLASH + c
else
c
end
else
UNESCAPE[$4] || $4
end
}
end | ruby | def unescape_replacement(s)
s.gsub(/\\(?:([\d+&`'\\]|k<\w+>)|u\{([[:xdigit:]]+)\}|x([[:xdigit:]]{2})|(.))/) {
if c = $1
BACKSLASH + c
elsif c = ($2 && [$2.to_i(16)].pack('U')) ||
($3 && [$3.to_i(16)].pack('C'))
if c == BACKSLASH
BACKSLASH + c
else
c
end
else
UNESCAPE[$4] || $4
end
}
end | [
"def",
"unescape_replacement",
"(",
"s",
")",
"s",
".",
"gsub",
"(",
"/",
"\\\\",
"\\d",
"\\\\",
"\\w",
"\\{",
"\\}",
"/",
")",
"{",
"if",
"c",
"=",
"$1",
"BACKSLASH",
"+",
"c",
"elsif",
"c",
"=",
"(",
"$2",
"&&",
"[",
"$2",
".",
"to_i",
"(",
... | Unescape a replacement text for use in the second argument of
gsub/sub. The following escape sequences are recognized:
- "\\" (backslash itself)
- "\a" (alert)
- "\b" (backspace)
- "\e" (escape)
- "\f" (form feed)
- "\n" (new line)
- "\r" (carriage return)
- "\s" (space)
- "\t" (horizontal tab)
- "\u{XXXX}" (unicode codepoint)
- "\v" (vertical tab)
- "\xXX" (hexadecimal character)
- "\1".."\9" (numbered capture groups)
- "\+" (last capture group)
- "\k<name>" (named capture group)
- "\&" or "\0" (complete matched text)
- "\`" (string before match)
- "\'" (string after match)
Octal escape sequences are deliberately unsupported to avoid
conflict with numbered capture groups. Rather obscure Emacs
style character codes ("\C-x", "\M-\C-x" etc.) are also omitted
from this implementation. | [
"Unescape",
"a",
"replacement",
"text",
"for",
"use",
"in",
"the",
"second",
"argument",
"of",
"gsub",
"/",
"sub",
".",
"The",
"following",
"escape",
"sequences",
"are",
"recognized",
":"
] | 01e18fef7b6bd827a5d48a89391e460b5fb1bee3 | https://github.com/huginn/huginn/blob/01e18fef7b6bd827a5d48a89391e460b5fb1bee3/app/concerns/liquid_interpolatable.rb#L338-L353 | train | Unescapes a replacement string | [
30522,
13366,
16655,
15782,
5051,
1035,
6110,
1006,
1055,
1007,
1055,
1012,
28177,
12083,
1006,
1013,
1032,
1032,
1006,
1029,
1024,
1006,
1031,
1032,
1040,
1009,
1004,
1036,
1005,
1032,
1032,
1033,
1064,
1047,
1026,
1032,
1059,
1009,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb | Azure::EventGrid::Mgmt::V2018_01_01.EventSubscriptions.begin_update | def begin_update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
response = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
response = begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update",
"(",
"scope",
",",
"event_subscription_name",
",",
"event_subscription_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_async",
"(",
"scope",
",",
"event_subscription_name",
",",
"event_subscription_update_par... | Update an event subscription
Asynchronously updates an existing event subscription.
@param scope [String] The scope of existing event subscription. The scope can
be a subscription, or a resource group, or a top level resource belonging to
a resource provider namespace, or an EventGrid topic. For example, use
'/subscriptions/{subscriptionId}/' for a subscription,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
resource group, and
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
for a resource, and
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
for an EventGrid topic.
@param event_subscription_name [String] Name of the event subscription to be
created
@param event_subscription_update_parameters
[EventSubscriptionUpdateParameters] Updated event subscription information
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EventSubscription] operation results. | [
"Update",
"an",
"event",
"subscription"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb#L1690-L1693 | train | Updates an existing event subscription. | [
30522,
13366,
4088,
1035,
10651,
1006,
9531,
1010,
2724,
1035,
15002,
1035,
2171,
1010,
2724,
1035,
15002,
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... |
SamSaffron/message_bus | lib/message_bus/http_client.rb | MessageBus.HTTPClient.unsubscribe | def unsubscribe(channel, &callback)
if callback
@channels[channel].callbacks.delete(callback)
remove_channel(channel) if @channels[channel].callbacks.empty?
else
remove_channel(channel)
end
stop if @channels.empty?
@status
end | ruby | def unsubscribe(channel, &callback)
if callback
@channels[channel].callbacks.delete(callback)
remove_channel(channel) if @channels[channel].callbacks.empty?
else
remove_channel(channel)
end
stop if @channels.empty?
@status
end | [
"def",
"unsubscribe",
"(",
"channel",
",",
"&",
"callback",
")",
"if",
"callback",
"@channels",
"[",
"channel",
"]",
".",
"callbacks",
".",
"delete",
"(",
"callback",
")",
"remove_channel",
"(",
"channel",
")",
"if",
"@channels",
"[",
"channel",
"]",
".",
... | unsubscribes from a channel
@example Unsubscribing from a channel
client = MessageBus::HTTPClient.new('http://some.test.com')
callback = -> { |payload| puts payload }
client.subscribe("/test", &callback)
client.unsubscribe("/test")
If a callback is given, only the specific callback will be unsubscribed.
@example Unsubscribing a callback from a channel
client.unsubscribe("/test", &callback)
When the client does not have any channels left, it will stop polling and
waits until a new subscription is started.
@param channel [String] channel to unsubscribe
@yield [data, global_id, message_id] specific callback to unsubscribe
@return [Integer] the current status of the client | [
"unsubscribes",
"from",
"a",
"channel"
] | 90fba639eb5d332ca8e87fd35f1d603a5743076d | https://github.com/SamSaffron/message_bus/blob/90fba639eb5d332ca8e87fd35f1d603a5743076d/lib/message_bus/http_client.rb#L201-L211 | train | Unsubscribe from a channel | [
30522,
13366,
4895,
6342,
5910,
26775,
20755,
1006,
3149,
1010,
1004,
2655,
5963,
1007,
2065,
2655,
5963,
1030,
30524,
1030,
3570,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
appium/ruby_lib | lib/appium_lib/driver.rb | Appium.Driver.set_implicit_wait | def set_implicit_wait(wait)
@driver.manage.timeouts.implicit_wait = wait
rescue Selenium::WebDriver::Error::UnknownError => e
unless e.message.include?('The operation requested is not yet implemented by Espresso driver')
raise ::Appium::Core::Error::ServerError
end
{}
end | ruby | def set_implicit_wait(wait)
@driver.manage.timeouts.implicit_wait = wait
rescue Selenium::WebDriver::Error::UnknownError => e
unless e.message.include?('The operation requested is not yet implemented by Espresso driver')
raise ::Appium::Core::Error::ServerError
end
{}
end | [
"def",
"set_implicit_wait",
"(",
"wait",
")",
"@driver",
".",
"manage",
".",
"timeouts",
".",
"implicit_wait",
"=",
"wait",
"rescue",
"Selenium",
"::",
"WebDriver",
"::",
"Error",
"::",
"UnknownError",
"=>",
"e",
"unless",
"e",
".",
"message",
".",
"include?... | To ignore error for Espresso Driver | [
"To",
"ignore",
"error",
"for",
"Espresso",
"Driver"
] | 1f5898400dd1928bfe42ddd5f842d1f8738f2f76 | https://github.com/appium/ruby_lib/blob/1f5898400dd1928bfe42ddd5f842d1f8738f2f76/lib/appium_lib/driver.rb#L561-L569 | train | Set the implicit wait for the operation to be performed. | [
30522,
13366,
2275,
1035,
24655,
1035,
3524,
1006,
3524,
1007,
1030,
4062,
1012,
6133,
1012,
2051,
12166,
1012,
24655,
1035,
3524,
1027,
3524,
5343,
7367,
7770,
5007,
1024,
1024,
4773,
23663,
2099,
1024,
1024,
7561,
1024,
1024,
4242,
2121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/managed_instances.rb | Azure::SQL::Mgmt::V2015_05_01_preview.ManagedInstances.begin_delete | def begin_delete(resource_group_name, managed_instance_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, managed_instance_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, managed_instance_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Deletes a managed instance.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param managed_instance_name [String] The name of the managed instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"a",
"managed",
"instance",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/managed_instances.rb#L676-L679 | train | Deletes the managed instance. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
6013,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb | Azure::Batch::Mgmt::V2017_09_01.PoolOperations.stop_resize | def stop_resize(resource_group_name, account_name, pool_name, custom_headers:nil)
response = stop_resize_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def stop_resize(resource_group_name, account_name, pool_name, custom_headers:nil)
response = stop_resize_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"stop_resize",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"stop_resize_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"custom_headers",
":custom_he... | Stops an ongoing resize operation on the pool.
This does not restore the pool to its previous state before the resize
operation: it only stops any further changes being made, and the pool
maintains its current state. After stopping, the pool stabilizes at the
number of nodes it was at when the stop operation was done. During the stop
operation, the pool allocation state changes first to stopping and then to
steady. A resize operation need not be an explicit resize pool request; this
API can also be used to halt the initial sizing of the pool when it is
created.
@param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param pool_name [String] The pool name. This must be unique within the
account.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Pool] operation results. | [
"Stops",
"an",
"ongoing",
"resize",
"operation",
"on",
"the",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb#L656-L659 | train | Stops resize of a managed pool. | [
30522,
13366,
2644,
1035,
24501,
4697,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2644,
1035,
24501,
4697,
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/2017-10-01/generated/azure_mgmt_container_registry/registries.rb | Azure::ContainerRegistry::Mgmt::V2017_10_01.Registries.update_policies | def update_policies(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
response = update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_policies(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
response = update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_policies",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_policies_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_policies_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_policie... | Updates the policies for the specified container registry.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param registry_policies_update_parameters [RegistryPolicies] The parameters
for updating policies of a container registry.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RegistryPolicies] operation results. | [
"Updates",
"the",
"policies",
"for",
"the",
"specified",
"container",
"registry",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb#L1011-L1014 | train | Updates the policies of the specified container registry. | [
30522,
13366,
10651,
1035,
6043,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
15584,
1035,
6043,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
6043,
1035,
200... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.begin_verify_ipflow | def begin_verify_ipflow(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_verify_ipflow(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = begin_verify_ipflow_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_verify_ipflow",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_verify_ipflow_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",... | Verify IP flow from the specified VM to a location given the currently
configured NSG rules.
@param resource_group_name [String] The name of the resource group.
@param network_watcher_name [String] The name of the network watcher.
@param parameters [VerificationIPFlowParameters] Parameters that define the
IP flow to be verified.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VerificationIPFlowResult] operation results. | [
"Verify",
"IP",
"flow",
"from",
"the",
"specified",
"VM",
"to",
"a",
"location",
"given",
"the",
"currently",
"configured",
"NSG",
"rules",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L1284-L1287 | train | Verify IP flow. | [
30522,
13366,
4088,
1035,
20410,
1035,
12997,
12314,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
20410,
1035,
1299... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmosolgo/graphql-ruby | spec/support/jazz.rb | Jazz.Query.inspect_input | def inspect_input(input:)
[
input.class.name,
input.helper_method,
# Access by method
input.string_value,
# Access by key:
input[:string_value],
input.key?(:string_value).to_s,
# ~~Access by legacy key~~ # not anymore
input[:string_value],
input.ensemble,
input.key?(:ensemble).to_s,
]
end | ruby | def inspect_input(input:)
[
input.class.name,
input.helper_method,
# Access by method
input.string_value,
# Access by key:
input[:string_value],
input.key?(:string_value).to_s,
# ~~Access by legacy key~~ # not anymore
input[:string_value],
input.ensemble,
input.key?(:ensemble).to_s,
]
end | [
"def",
"inspect_input",
"(",
"input",
":",
")",
"[",
"input",
".",
"class",
".",
"name",
",",
"input",
".",
"helper_method",
",",
"# Access by method",
"input",
".",
"string_value",
",",
"# Access by key:",
"input",
"[",
":string_value",
"]",
",",
"input",
"... | This is for testing input object behavior | [
"This",
"is",
"for",
"testing",
"input",
"object",
"behavior"
] | d5be13a816f220b9efbabeaa69a3e56fedf311f5 | https://github.com/rmosolgo/graphql-ruby/blob/d5be13a816f220b9efbabeaa69a3e56fedf311f5/spec/support/jazz.rb#L390-L404 | train | Inspect the input object | [
30522,
13366,
22459,
1035,
7953,
1006,
7953,
1024,
1007,
1031,
7953,
1012,
2465,
1012,
2171,
1010,
7953,
1012,
2393,
2121,
1035,
4118,
1010,
1001,
3229,
2011,
4118,
7953,
1012,
5164,
1035,
3643,
1010,
1001,
3229,
2011,
3145,
1024,
7953,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_containers.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationProtectionContainers.begin_discover_protectable_item_with_http_info | def begin_discover_protectable_item_with_http_info(fabric_name, protection_container_name, discover_protectable_item_request, custom_headers:nil)
begin_discover_protectable_item_async(fabric_name, protection_container_name, discover_protectable_item_request, custom_headers:custom_headers).value!
end | ruby | def begin_discover_protectable_item_with_http_info(fabric_name, protection_container_name, discover_protectable_item_request, custom_headers:nil)
begin_discover_protectable_item_async(fabric_name, protection_container_name, discover_protectable_item_request, custom_headers:custom_headers).value!
end | [
"def",
"begin_discover_protectable_item_with_http_info",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"discover_protectable_item_request",
",",
"custom_headers",
":",
"nil",
")",
"begin_discover_protectable_item_async",
"(",
"fabric_name",
",",
"protection_container_n... | Adds a protectable item to the replication protection container.
The operation to a add a protectable item to a protection container(Add
physical server.)
@param fabric_name [String] The name of the fabric.
@param protection_container_name [String] The name of the protection
container.
@param discover_protectable_item_request [DiscoverProtectableItemRequest] The
request object to add a protectable item.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Adds",
"a",
"protectable",
"item",
"to",
"the",
"replication",
"protection",
"container",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_containers.rb#L652-L654 | train | Discovers the protection container of the specified protection container. | [
30522,
13366,
4088,
1035,
7523,
1035,
4047,
3085,
1035,
8875,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
8313,
1035,
2171,
1010,
3860,
1035,
11661,
1035,
2171,
1010,
7523,
1035,
4047,
3085,
1035,
8875,
1035,
5227,
1010,
30524,
4047,
3085,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
licensee/licensee | lib/licensee/content_helper.rb | Licensee.ContentHelper.similarity | def similarity(other)
overlap = (wordset & other.wordset).size
total = wordset.size + other.wordset.size
100.0 * (overlap * 2.0 / total)
end | ruby | def similarity(other)
overlap = (wordset & other.wordset).size
total = wordset.size + other.wordset.size
100.0 * (overlap * 2.0 / total)
end | [
"def",
"similarity",
"(",
"other",
")",
"overlap",
"=",
"(",
"wordset",
"&",
"other",
".",
"wordset",
")",
".",
"size",
"total",
"=",
"wordset",
".",
"size",
"+",
"other",
".",
"wordset",
".",
"size",
"100.0",
"*",
"(",
"overlap",
"*",
"2.0",
"/",
... | Given another license or project file, calculates the similarity
as a percentage of words in common | [
"Given",
"another",
"license",
"or",
"project",
"file",
"calculates",
"the",
"similarity",
"as",
"a",
"percentage",
"of",
"words",
"in",
"common"
] | e181f73f529f9cefa91096817a9c13b9e1608599 | https://github.com/licensee/licensee/blob/e181f73f529f9cefa91096817a9c13b9e1608599/lib/licensee/content_helper.rb#L117-L121 | train | Similarity of two words | [
30522,
13366,
14402,
1006,
2060,
1007,
17702,
1027,
1006,
2616,
3388,
1004,
2060,
1012,
2616,
3388,
1007,
1012,
2946,
2561,
1027,
2616,
3388,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/models/v1_update_order_request.rb | SquareConnect.V1UpdateOrderRequest.valid? | def valid?
return false if @action.nil?
action_validator = EnumAttributeValidator.new('String', ["COMPLETE", "CANCEL", "REFUND"])
return false unless action_validator.valid?(@action)
return true
end | ruby | def valid?
return false if @action.nil?
action_validator = EnumAttributeValidator.new('String', ["COMPLETE", "CANCEL", "REFUND"])
return false unless action_validator.valid?(@action)
return true
end | [
"def",
"valid?",
"return",
"false",
"if",
"@action",
".",
"nil?",
"action_validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"COMPLETE\"",
",",
"\"CANCEL\"",
",",
"\"REFUND\"",
"]",
")",
"return",
"false",
"unless",
"action_valid... | Check to see if the all the properties in the model are valid
@return true if the model is valid | [
"Check",
"to",
"see",
"if",
"the",
"all",
"the",
"properties",
"in",
"the",
"model",
"are",
"valid"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/v1_update_order_request.rb#L117-L122 | train | Checks if the action is valid for the current request. | [
30522,
13366,
9398,
1029,
2709,
6270,
2065,
1030,
2895,
1012,
9152,
2140,
1029,
2895,
1035,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
3143,
1000,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/face.rb | Azure::CognitiveServices::Face::V1_0.Face.detect_with_stream | def detect_with_stream(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
response = detect_with_stream_async(image, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, recognition_model:recognition_model, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def detect_with_stream(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
response = detect_with_stream_async(image, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, recognition_model:recognition_model, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"detect_with_stream",
"(",
"image",
",",
"return_face_id",
":",
"true",
",",
"return_face_landmarks",
":",
"false",
",",
"return_face_attributes",
":",
"nil",
",",
"recognition_model",
":",
"nil",
",",
"return_recognition_model",
":",
"false",
",",
"custom_he... | Detect human faces in an image and returns face locations, and optionally
with faceIds, landmarks, and attributes.
@param image An image stream.
@param return_face_id [Boolean] A value indicating whether the operation
should return faceIds of detected faces.
@param return_face_landmarks [Boolean] A value indicating whether the
operation should return landmarks of the detected faces.
@param return_face_attributes [Array<FaceAttributeType>] Analyze and return
the one or more specified face attributes in the comma-separated string like
"returnFaceAttributes=age,gender". Supported face attributes include age,
gender, headPose, smile, facialHair, glasses and emotion. Note that each face
attribute analysis has additional computational and time cost.
@param recognition_model [RecognitionModel] Name of recognition model.
Recognition model is used when the face features are extracted and associated
with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
model name can be provided when performing Face - Detect or (Large)FaceList -
Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
if latest model needed, please explicitly specify the model you need.
Possible values include: 'recognition_01', 'recognition_02'
@param return_recognition_model [Boolean] A value indicating whether the
operation should return 'recognitionModel' in response.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Detect",
"human",
"faces",
"in",
"an",
"image",
"and",
"returns",
"face",
"locations",
"and",
"optionally",
"with",
"faceIds",
"landmarks",
"and",
"attributes",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/face.rb#L1272-L1275 | train | Detects a single face in an image. | [
30522,
13366,
11487,
1035,
2007,
1035,
5460,
1006,
3746,
1010,
2709,
1035,
2227,
1035,
8909,
1024,
2995,
1010,
2709,
1035,
2227,
1035,
16209,
1024,
6270,
1010,
2709,
1035,
2227,
1035,
12332,
1024,
9152,
2140,
1010,
5038,
1035,
2944,
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... |
colszowka/simplecov | lib/simplecov/source_file.rb | SimpleCov.SourceFile.round_float | def round_float(float, places)
factor = Float(10 * places)
Float((float * factor).round / factor)
end | ruby | def round_float(float, places)
factor = Float(10 * places)
Float((float * factor).round / factor)
end | [
"def",
"round_float",
"(",
"float",
",",
"places",
")",
"factor",
"=",
"Float",
"(",
"10",
"*",
"places",
")",
"Float",
"(",
"(",
"float",
"*",
"factor",
")",
".",
"round",
"/",
"factor",
")",
"end"
] | ruby 1.9 could use Float#round(places) instead
@return [Float] | [
"ruby",
"1",
".",
"9",
"could",
"use",
"Float#round",
"(",
"places",
")",
"instead"
] | 8f6978a2513f10c4dd8d7dd7eed666fe3f2b55c2 | https://github.com/colszowka/simplecov/blob/8f6978a2513f10c4dd8d7dd7eed666fe3f2b55c2/lib/simplecov/source_file.rb#L198-L201 | train | Round a float to the nearest number of places | [
30522,
13366,
2461,
1035,
14257,
1006,
14257,
1010,
3182,
1007,
5387,
1027,
14257,
1006,
2184,
1008,
3182,
1007,
14257,
1006,
1006,
14257,
1008,
5387,
1007,
1012,
2461,
1013,
5387,
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,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/client/activity/starring.rb | Github.Client::Activity::Starring.starring? | def starring?(*args)
arguments(args, required: [:user, :repo])
get_request("/user/starred/#{arguments.user}/#{arguments.repo}", arguments.params)
true
rescue Github::Error::NotFound
false
end | ruby | def starring?(*args)
arguments(args, required: [:user, :repo])
get_request("/user/starred/#{arguments.user}/#{arguments.repo}", arguments.params)
true
rescue Github::Error::NotFound
false
end | [
"def",
"starring?",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
"]",
")",
"get_request",
"(",
"\"/user/starred/#{arguments.user}/#{arguments.repo}\"",
",",
"arguments",
".",
"params",
")",
"true",
"rescue",
... | Check if you are starring a repository
@see https://developer.github.com/v3/activity/starring/#check-if-you-are-starring-a-repository
@example
github = Github.new
github.activity.starring.starring? 'user-name', 'repo-name'
@example
github.activity.starring.starring? user: 'user-name', repo: 'repo-name'
@return [Boolean]
Returns true if this repo is starred by you, false otherwise.
@api public | [
"Check",
"if",
"you",
"are",
"starring",
"a",
"repository"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/activity/starring.rb#L81-L88 | train | Returns whether or not a given repository is starred | [
30522,
13366,
4626,
1029,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1033,
1007,
2131,
1035,
5227,
1006,
1000,
1013,
5310,
1013,
5652,
1013,
1001,
1063,
9918,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/network_status.rb | Azure::ApiManagement::Mgmt::V2016_10_10.NetworkStatus.get_by_service | def get_by_service(resource_group_name, service_name, custom_headers:nil)
response = get_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_service(resource_group_name, service_name, custom_headers:nil)
response = get_by_service_async(resource_group_name, service_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_service",
"(",
"resource_group_name",
",",
"service_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_service_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"r... | Gets the Connectivity Status to the external resources on which the Api
Management service depends from inside the Cloud Service. This also returns
the DNS Servers as visible to the CloudService.
@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 [NetworkStatusContract] operation results. | [
"Gets",
"the",
"Connectivity",
"Status",
"to",
"the",
"external",
"resources",
"on",
"which",
"the",
"Api",
"Management",
"service",
"depends",
"from",
"inside",
"the",
"Cloud",
"Service",
".",
"This",
"also",
"returns",
"the",
"DNS",
"Servers",
"as",
"visible... | 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/network_status.rb#L36-L39 | train | Gets the specified service. | [
30522,
13366,
2131,
1035,
2011,
1035,
2326,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2011,
1035,
2326,
1035,
2004,
6038,
2278,
1006,
7692,
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_compute/lib/2017-03-30/generated/azure_mgmt_compute/disks.rb | Azure::Compute::Mgmt::V2017_03_30.Disks.begin_revoke_access | def begin_revoke_access(resource_group_name, disk_name, custom_headers:nil)
response = begin_revoke_access_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_revoke_access(resource_group_name, disk_name, custom_headers:nil)
response = begin_revoke_access_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_revoke_access",
"(",
"resource_group_name",
",",
"disk_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_revoke_access_async",
"(",
"resource_group_name",
",",
"disk_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Revokes access to a disk.
@param resource_group_name [String] The name of the resource group.
@param disk_name [String] The name of the managed disk that is being created.
The name can't be changed after the disk is created. Supported characters for
the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusResponse] operation results. | [
"Revokes",
"access",
"to",
"a",
"disk",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2017-03-30/generated/azure_mgmt_compute/disks.rb#L1002-L1005 | train | Revokes access to a disk. | [
30522,
13366,
4088,
1035,
7065,
11045,
1035,
3229,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9785,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
7065,
11045,
1035,
3229,
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_network/lib/2019-02-01/generated/azure_mgmt_network/network_interface_tap_configurations.rb | Azure::Network::Mgmt::V2019_02_01.NetworkInterfaceTapConfigurations.create_or_update_async | def create_or_update_async(resource_group_name, network_interface_name, tap_configuration_name, tap_configuration_parameters, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, network_interface_name, tap_configuration_name, tap_configuration_parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Network::Mgmt::V2019_02_01::Models::NetworkInterfaceTapConfiguration.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def create_or_update_async(resource_group_name, network_interface_name, tap_configuration_name, tap_configuration_parameters, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, network_interface_name, tap_configuration_name, tap_configuration_parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Network::Mgmt::V2019_02_01::Models::NetworkInterfaceTapConfiguration.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"create_or_update_async",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"tap_configuration_name",
",",
"tap_configuration_parameters",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_or_update_async",
"(",
"reso... | @param resource_group_name [String] The name of the resource group.
@param network_interface_name [String] The name of the network interface.
@param tap_configuration_name [String] The name of the tap configuration.
@param tap_configuration_parameters [NetworkInterfaceTapConfiguration]
Parameters supplied to the create or update tap configuration operation.
@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",
".",
"@param",
"network_interface_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"network",
"interface",
".",
"@param",
"tap_configuration_name",
"[",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/network_interface_tap_configurations.rb#L190-L206 | train | Creates or updates a network interface tap configuration. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
8278,
1035,
2171,
1010,
11112,
1035,
9563,
1035,
2171,
1010,
11112,
1035,
9563,
1035,
11709,
1010,
7661,
1035,
20346,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SamSaffron/memory_profiler | lib/memory_profiler/results.rb | MemoryProfiler.Results.pretty_print | def pretty_print(io = $stdout, **options)
# Handle the special case that Ruby PrettyPrint expects `pretty_print`
# to be a customized pretty printing function for a class
return io.pp_object(self) if defined?(PP) && io.is_a?(PP)
io = File.open(options[:to_file], "w") if options[:to_file]
color_output = options.fetch(:color_output) { io.respond_to?(:isatty) && io.isatty }
@colorize = color_output ? Polychrome.new : Monochrome.new
if options[:scale_bytes]
total_allocated_output = scale_bytes(total_allocated_memsize)
total_retained_output = scale_bytes(total_retained_memsize)
else
total_allocated_output = "#{total_allocated_memsize} bytes"
total_retained_output = "#{total_retained_memsize} bytes"
end
io.puts "Total allocated: #{total_allocated_output} (#{total_allocated} objects)"
io.puts "Total retained: #{total_retained_output} (#{total_retained} objects)"
if options[:detailed_report] != false
io.puts
TYPES.each do |type|
METRICS.each do |metric|
NAMES.each do |name|
scale_data = metric == "memory" && options[:scale_bytes]
dump "#{type} #{metric} by #{name}", self.send("#{type}_#{metric}_by_#{name}"), io, scale_data
end
end
end
end
io.puts
dump_strings(io, "Allocated", strings_allocated, limit: options[:allocated_strings])
io.puts
dump_strings(io, "Retained", strings_retained, limit: options[:retained_strings])
io.close if io.is_a? File
end | ruby | def pretty_print(io = $stdout, **options)
# Handle the special case that Ruby PrettyPrint expects `pretty_print`
# to be a customized pretty printing function for a class
return io.pp_object(self) if defined?(PP) && io.is_a?(PP)
io = File.open(options[:to_file], "w") if options[:to_file]
color_output = options.fetch(:color_output) { io.respond_to?(:isatty) && io.isatty }
@colorize = color_output ? Polychrome.new : Monochrome.new
if options[:scale_bytes]
total_allocated_output = scale_bytes(total_allocated_memsize)
total_retained_output = scale_bytes(total_retained_memsize)
else
total_allocated_output = "#{total_allocated_memsize} bytes"
total_retained_output = "#{total_retained_memsize} bytes"
end
io.puts "Total allocated: #{total_allocated_output} (#{total_allocated} objects)"
io.puts "Total retained: #{total_retained_output} (#{total_retained} objects)"
if options[:detailed_report] != false
io.puts
TYPES.each do |type|
METRICS.each do |metric|
NAMES.each do |name|
scale_data = metric == "memory" && options[:scale_bytes]
dump "#{type} #{metric} by #{name}", self.send("#{type}_#{metric}_by_#{name}"), io, scale_data
end
end
end
end
io.puts
dump_strings(io, "Allocated", strings_allocated, limit: options[:allocated_strings])
io.puts
dump_strings(io, "Retained", strings_retained, limit: options[:retained_strings])
io.close if io.is_a? File
end | [
"def",
"pretty_print",
"(",
"io",
"=",
"$stdout",
",",
"**",
"options",
")",
"# Handle the special case that Ruby PrettyPrint expects `pretty_print`",
"# to be a customized pretty printing function for a class",
"return",
"io",
".",
"pp_object",
"(",
"self",
")",
"if",
"defin... | Output the results of the report
@param [Hash] options the options for output
@option opts [String] :to_file a path to your log file
@option opts [Boolean] :color_output a flag for whether to colorize output
@option opts [Integer] :retained_strings how many retained strings to print
@option opts [Integer] :allocated_strings how many allocated strings to print
@option opts [Boolean] :detailed_report should report include detailed information
@option opts [Boolean] :scale_bytes calculates unit prefixes for the numbers of bytes | [
"Output",
"the",
"results",
"of",
"the",
"report"
] | bd87ff68559623d12c827800ee795475db4d5b8b | https://github.com/SamSaffron/memory_profiler/blob/bd87ff68559623d12c827800ee795475db4d5b8b/lib/memory_profiler/results.rb#L107-L146 | train | Prints the results of the object to the given io. | [
30522,
13366,
3492,
1035,
6140,
1006,
22834,
1027,
1002,
2358,
26797,
2102,
1010,
1008,
1008,
7047,
1007,
1001,
5047,
1996,
2569,
2553,
2008,
10090,
3492,
16550,
24273,
1036,
3492,
1035,
6140,
1036,
1001,
2000,
2022,
1037,
28749,
3492,
8021... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
appium/ruby_lib | lib/appium_lib/driver.rb | Appium.Driver.driver_attributes | def driver_attributes
# rubocop:disable Layout/AlignHash
{
caps: @core.caps,
automation_name: @core.automation_name,
custom_url: @core.custom_url,
export_session: @core.export_session,
export_session_path: @core.export_session_path,
default_wait: @core.default_wait,
sauce_username: @sauce.username,
sauce_access_key: @sauce.access_key,
sauce_endpoint: @sauce.endpoint,
port: @core.port,
device: @core.device,
debug: @appium_debug,
listener: @listener,
wait_timeout: @core.wait_timeout,
wait_interval: @core.wait_interval
}
# rubocop:enable Layout/AlignHash
end | ruby | def driver_attributes
# rubocop:disable Layout/AlignHash
{
caps: @core.caps,
automation_name: @core.automation_name,
custom_url: @core.custom_url,
export_session: @core.export_session,
export_session_path: @core.export_session_path,
default_wait: @core.default_wait,
sauce_username: @sauce.username,
sauce_access_key: @sauce.access_key,
sauce_endpoint: @sauce.endpoint,
port: @core.port,
device: @core.device,
debug: @appium_debug,
listener: @listener,
wait_timeout: @core.wait_timeout,
wait_interval: @core.wait_interval
}
# rubocop:enable Layout/AlignHash
end | [
"def",
"driver_attributes",
"# rubocop:disable Layout/AlignHash",
"{",
"caps",
":",
"@core",
".",
"caps",
",",
"automation_name",
":",
"@core",
".",
"automation_name",
",",
"custom_url",
":",
"@core",
".",
"custom_url",
",",
"export_session",
":",
"@core",
".",
"e... | Returns a hash of the driver attributes | [
"Returns",
"a",
"hash",
"of",
"the",
"driver",
"attributes"
] | 1f5898400dd1928bfe42ddd5f842d1f8738f2f76 | https://github.com/appium/ruby_lib/blob/1f5898400dd1928bfe42ddd5f842d1f8738f2f76/lib/appium_lib/driver.rb#L273-L293 | train | Returns a hash of driver attributes for the driver. | [
30522,
13366,
4062,
1035,
12332,
1001,
14548,
24163,
2361,
1024,
4487,
19150,
9621,
1013,
25705,
14949,
2232,
1063,
9700,
1024,
1030,
4563,
1012,
9700,
1010,
19309,
1035,
2171,
1024,
1030,
4563,
1012,
19309,
1035,
2171,
1010,
7661,
1035,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.restore_partition_with_http_info | def restore_partition_with_http_info(partition_id, restore_partition_description, restore_timeout:10, timeout:60, custom_headers:nil)
restore_partition_async(partition_id, restore_partition_description, restore_timeout:restore_timeout, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def restore_partition_with_http_info(partition_id, restore_partition_description, restore_timeout:10, timeout:60, custom_headers:nil)
restore_partition_async(partition_id, restore_partition_description, restore_timeout:restore_timeout, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"restore_partition_with_http_info",
"(",
"partition_id",
",",
"restore_partition_description",
",",
"restore_timeout",
":",
"10",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"restore_partition_async",
"(",
"partition_id",
",",
"restore_part... | Triggers restore of the state of the partition using the specified restore
partition description.
Restores the state of a of the stateful persisted partition using the
specified backup point. In case the partition is already being periodically
backed up, then by default the backup point is looked for in the storage
specified in backup policy. One can also override the same by specifying the
backup storage details as part of the restore partition description in body.
Once the restore is initiated, its progress can be tracked using the
GetRestoreProgress operation.
In case, the operation times out, specify a greater restore timeout value in
the query parameter.
@param partition_id The identity of the partition.
@param restore_partition_description [RestorePartitionDescription] Describes
the parameters to restore the partition.
@param restore_timeout [Integer] Specifies the maximum amount of time to
wait, in minutes, for the restore operation to complete. Post that, the
operation returns back with timeout error. However, in certain corner cases
it could be that the restore operation goes through even though it completes
with timeout. In case of timeout error, its recommended to invoke this
operation again with a greater timeout value. the default value for the same
is 10 minutes.
@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. | [
"Triggers",
"restore",
"of",
"the",
"state",
"of",
"the",
"partition",
"using",
"the",
"specified",
"restore",
"partition",
"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#L25738-L25740 | train | Restores the specified partition. | [
30522,
13366,
9239,
1035,
13571,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
9239,
1035,
13571,
1035,
6412,
1010,
9239,
1035,
2051,
5833,
1024,
2184,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
scenic-views/scenic | lib/scenic/statements.rb | Scenic.Statements.drop_view | def drop_view(name, revert_to_version: nil, materialized: false)
if materialized
Scenic.database.drop_materialized_view(name)
else
Scenic.database.drop_view(name)
end
end | ruby | def drop_view(name, revert_to_version: nil, materialized: false)
if materialized
Scenic.database.drop_materialized_view(name)
else
Scenic.database.drop_view(name)
end
end | [
"def",
"drop_view",
"(",
"name",
",",
"revert_to_version",
":",
"nil",
",",
"materialized",
":",
"false",
")",
"if",
"materialized",
"Scenic",
".",
"database",
".",
"drop_materialized_view",
"(",
"name",
")",
"else",
"Scenic",
".",
"database",
".",
"drop_view"... | Drop a database view by name.
@param name [String, Symbol] The name of the database view.
@param revert_to_version [Fixnum] Used to reverse the `drop_view` command
on `rake db:rollback`. The provided version will be passed as the
`version` argument to {#create_view}.
@param materialized [Boolean] Set to true if dropping a meterialized view.
defaults to false.
@return The database response from executing the drop statement.
@example Drop a view, rolling back to version 3 on rollback
drop_view(:users_who_recently_logged_in, revert_to_version: 3) | [
"Drop",
"a",
"database",
"view",
"by",
"name",
"."
] | cc6adbde2bded9c895c41025d371c4c0f34c9253 | https://github.com/scenic-views/scenic/blob/cc6adbde2bded9c895c41025d371c4c0f34c9253/lib/scenic/statements.rb#L63-L69 | train | Drop a view from the database | [
30522,
13366,
4530,
1035,
3193,
1006,
2171,
1010,
7065,
8743,
1035,
2000,
1035,
2544,
1024,
9152,
2140,
1010,
27075,
1024,
6270,
1007,
2065,
27075,
12916,
1012,
7809,
1012,
4530,
1035,
27075,
1035,
3193,
1006,
2171,
1007,
2842,
12916,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/bot.rb | Discordrb.Bot.prune_empty_groups | def prune_empty_groups
@channels.each_value do |channel|
channel.leave_group if channel.group? && channel.recipients.empty?
end
end | ruby | def prune_empty_groups
@channels.each_value do |channel|
channel.leave_group if channel.group? && channel.recipients.empty?
end
end | [
"def",
"prune_empty_groups",
"@channels",
".",
"each_value",
"do",
"|",
"channel",
"|",
"channel",
".",
"leave_group",
"if",
"channel",
".",
"group?",
"&&",
"channel",
".",
"recipients",
".",
"empty?",
"end",
"end"
] | Makes the bot leave any groups with no recipients remaining | [
"Makes",
"the",
"bot",
"leave",
"any",
"groups",
"with",
"no",
"recipients",
"remaining"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L694-L698 | train | Prune empty groups from the current channel. | [
30522,
13366,
10975,
9816,
1035,
4064,
1035,
2967,
1030,
6833,
1012,
2169,
1035,
3643,
2079,
1064,
3149,
1064,
3149,
1012,
2681,
1035,
2177,
2065,
3149,
1012,
2177,
1029,
1004,
1004,
3149,
1012,
15991,
1012,
4064,
1029,
2203,
2203,
102,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | railties/lib/rails/application.rb | Rails.Application.env_config | def env_config
@app_env_config ||= begin
super.merge(
"action_dispatch.parameter_filter" => config.filter_parameters,
"action_dispatch.redirect_filter" => config.filter_redirect,
"action_dispatch.secret_key_base" => secret_key_base,
"action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions,
"action_dispatch.show_detailed_exceptions" => config.consider_all_requests_local,
"action_dispatch.logger" => Rails.logger,
"action_dispatch.backtrace_cleaner" => Rails.backtrace_cleaner,
"action_dispatch.key_generator" => key_generator,
"action_dispatch.http_auth_salt" => config.action_dispatch.http_auth_salt,
"action_dispatch.signed_cookie_salt" => config.action_dispatch.signed_cookie_salt,
"action_dispatch.encrypted_cookie_salt" => config.action_dispatch.encrypted_cookie_salt,
"action_dispatch.encrypted_signed_cookie_salt" => config.action_dispatch.encrypted_signed_cookie_salt,
"action_dispatch.authenticated_encrypted_cookie_salt" => config.action_dispatch.authenticated_encrypted_cookie_salt,
"action_dispatch.use_authenticated_cookie_encryption" => config.action_dispatch.use_authenticated_cookie_encryption,
"action_dispatch.encrypted_cookie_cipher" => config.action_dispatch.encrypted_cookie_cipher,
"action_dispatch.signed_cookie_digest" => config.action_dispatch.signed_cookie_digest,
"action_dispatch.cookies_serializer" => config.action_dispatch.cookies_serializer,
"action_dispatch.cookies_digest" => config.action_dispatch.cookies_digest,
"action_dispatch.cookies_rotations" => config.action_dispatch.cookies_rotations,
"action_dispatch.use_cookies_with_metadata" => config.action_dispatch.use_cookies_with_metadata,
"action_dispatch.content_security_policy" => config.content_security_policy,
"action_dispatch.content_security_policy_report_only" => config.content_security_policy_report_only,
"action_dispatch.content_security_policy_nonce_generator" => config.content_security_policy_nonce_generator
)
end
end | ruby | def env_config
@app_env_config ||= begin
super.merge(
"action_dispatch.parameter_filter" => config.filter_parameters,
"action_dispatch.redirect_filter" => config.filter_redirect,
"action_dispatch.secret_key_base" => secret_key_base,
"action_dispatch.show_exceptions" => config.action_dispatch.show_exceptions,
"action_dispatch.show_detailed_exceptions" => config.consider_all_requests_local,
"action_dispatch.logger" => Rails.logger,
"action_dispatch.backtrace_cleaner" => Rails.backtrace_cleaner,
"action_dispatch.key_generator" => key_generator,
"action_dispatch.http_auth_salt" => config.action_dispatch.http_auth_salt,
"action_dispatch.signed_cookie_salt" => config.action_dispatch.signed_cookie_salt,
"action_dispatch.encrypted_cookie_salt" => config.action_dispatch.encrypted_cookie_salt,
"action_dispatch.encrypted_signed_cookie_salt" => config.action_dispatch.encrypted_signed_cookie_salt,
"action_dispatch.authenticated_encrypted_cookie_salt" => config.action_dispatch.authenticated_encrypted_cookie_salt,
"action_dispatch.use_authenticated_cookie_encryption" => config.action_dispatch.use_authenticated_cookie_encryption,
"action_dispatch.encrypted_cookie_cipher" => config.action_dispatch.encrypted_cookie_cipher,
"action_dispatch.signed_cookie_digest" => config.action_dispatch.signed_cookie_digest,
"action_dispatch.cookies_serializer" => config.action_dispatch.cookies_serializer,
"action_dispatch.cookies_digest" => config.action_dispatch.cookies_digest,
"action_dispatch.cookies_rotations" => config.action_dispatch.cookies_rotations,
"action_dispatch.use_cookies_with_metadata" => config.action_dispatch.use_cookies_with_metadata,
"action_dispatch.content_security_policy" => config.content_security_policy,
"action_dispatch.content_security_policy_report_only" => config.content_security_policy_report_only,
"action_dispatch.content_security_policy_nonce_generator" => config.content_security_policy_nonce_generator
)
end
end | [
"def",
"env_config",
"@app_env_config",
"||=",
"begin",
"super",
".",
"merge",
"(",
"\"action_dispatch.parameter_filter\"",
"=>",
"config",
".",
"filter_parameters",
",",
"\"action_dispatch.redirect_filter\"",
"=>",
"config",
".",
"filter_redirect",
",",
"\"action_dispatch.... | Stores some of the Rails initial environment parameters which
will be used by middlewares and engines to configure themselves. | [
"Stores",
"some",
"of",
"the",
"Rails",
"initial",
"environment",
"parameters",
"which",
"will",
"be",
"used",
"by",
"middlewares",
"and",
"engines",
"to",
"configure",
"themselves",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/railties/lib/rails/application.rb#L248-L276 | train | Returns the environment configuration for the application. | [
30522,
13366,
4372,
2615,
1035,
9530,
8873,
2290,
1030,
10439,
1035,
4372,
2615,
1035,
9530,
8873,
2290,
1064,
1064,
1027,
4088,
3565,
1012,
13590,
1006,
1000,
2895,
1035,
18365,
1012,
16381,
1035,
11307,
1000,
1027,
1028,
9530,
8873,
2290,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hanami/hanami | lib/hanami/application_configuration.rb | Hanami.ApplicationConfiguration.routes | def routes(path = nil, &blk)
if path or block_given?
@routes = Config::Routes.new(root, path, &blk)
else
@routes
end
end | ruby | def routes(path = nil, &blk)
if path or block_given?
@routes = Config::Routes.new(root, path, &blk)
else
@routes
end
end | [
"def",
"routes",
"(",
"path",
"=",
"nil",
",",
"&",
"blk",
")",
"if",
"path",
"or",
"block_given?",
"@routes",
"=",
"Config",
"::",
"Routes",
".",
"new",
"(",
"root",
",",
"path",
",",
"blk",
")",
"else",
"@routes",
"end",
"end"
] | Application routes.
Specify a set of routes for the application, by passing a block, or a
relative path where to find the file that describes them.
By default it's `nil`.
This is part of a DSL, for this reason when this method is called with
an argument, it will set the corresponding instance variable. When
called without, it will return the already set value, or the default.
@overload routes(blk)
Specify a set of routes in the given block
@param blk [Proc] the routes definitions
@overload routes(path)
Specify a relative path where to find the routes file
@param path [String] the relative path
@overload routes
Gets the value
@return [Hanami::Config::Routes] the set of routes
@since 0.1.0
@see http://rdoc.info/gems/hanami-router/Hanami/Router
@example Getting the value
require 'hanami'
module Bookshelf
class Application < Hanami::Application
end
end
Bookshelf::Application.configuration.routes
# => nil
@example Setting the value, by passing a block
require 'hanami'
module Bookshelf
class Application < Hanami::Application
configure do
routes do
get '/', to: 'dashboard#index'
resources :books
end
end
end
end
Bookshelf::Application.configuration.routes
# => #<Hanami::Config::Routes:0x007ff50a991388 @blk=#<Proc:0x007ff50a991338@(irb):4>, @path=#<Pathname:.>>
@example Setting the value, by passing a relative path
require 'hanami'
module Bookshelf
class Application < Hanami::Application
configure do
routes 'config/routes'
end
end
end
Bookshelf::Application.configuration.routes
# => #<Hanami::Config::Routes:0x007ff50a991388 @blk=nil, @path=#<Pathname:config/routes.rb>> | [
"Application",
"routes",
"."
] | 8c6e5147e92ef869b25379448572da3698eacfdc | https://github.com/hanami/hanami/blob/8c6e5147e92ef869b25379448572da3698eacfdc/lib/hanami/application_configuration.rb#L583-L589 | train | Returns a new instance of the routes class. | [
30522,
13366,
5847,
1006,
4130,
1027,
9152,
2140,
1010,
1004,
1038,
13687,
1007,
2065,
4130,
2030,
3796,
1035,
2445,
1029,
1030,
5847,
1027,
9530,
8873,
2290,
1024,
1024,
5847,
1012,
2047,
1006,
7117,
1010,
4130,
1010,
1004,
1038,
13687,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | actionview/lib/action_view/renderer/template_renderer.rb | ActionView.TemplateRenderer.render_template | def render_template(view, template, layout_name, locals)
render_with_layout(view, template, layout_name, locals) do |layout|
instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do
template.render(view, locals) { |*name| view._layout_for(*name) }
end
end
end | ruby | def render_template(view, template, layout_name, locals)
render_with_layout(view, template, layout_name, locals) do |layout|
instrument(:template, identifier: template.identifier, layout: layout.try(:virtual_path)) do
template.render(view, locals) { |*name| view._layout_for(*name) }
end
end
end | [
"def",
"render_template",
"(",
"view",
",",
"template",
",",
"layout_name",
",",
"locals",
")",
"render_with_layout",
"(",
"view",
",",
"template",
",",
"layout_name",
",",
"locals",
")",
"do",
"|",
"layout",
"|",
"instrument",
"(",
":template",
",",
"identi... | Renders the given template. A string representing the layout can be
supplied as well. | [
"Renders",
"the",
"given",
"template",
".",
"A",
"string",
"representing",
"the",
"layout",
"can",
"be",
"supplied",
"as",
"well",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/renderer/template_renderer.rb#L56-L62 | train | Renders a template with the given name. | [
30522,
13366,
17552,
1035,
23561,
1006,
3193,
1010,
23561,
1010,
9621,
1035,
2171,
1010,
10575,
1007,
17552,
1035,
2007,
1035,
9621,
1006,
3193,
1010,
23561,
1010,
9621,
1035,
2171,
1010,
10575,
1007,
2079,
1064,
9621,
1064,
6602,
1006,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
httprb/http | lib/http/redirector.rb | HTTP.Redirector.redirect_to | def redirect_to(uri)
raise StateError, "no Location header in redirect" unless uri
verb = @request.verb
code = @response.status.code
if UNSAFE_VERBS.include?(verb) && STRICT_SENSITIVE_CODES.include?(code)
raise StateError, "can't follow #{@response.status} redirect" if @strict
verb = :get
end
verb = :get if !SEE_OTHER_ALLOWED_VERBS.include?(verb) && 303 == code
@request.redirect(uri, verb)
end | ruby | def redirect_to(uri)
raise StateError, "no Location header in redirect" unless uri
verb = @request.verb
code = @response.status.code
if UNSAFE_VERBS.include?(verb) && STRICT_SENSITIVE_CODES.include?(code)
raise StateError, "can't follow #{@response.status} redirect" if @strict
verb = :get
end
verb = :get if !SEE_OTHER_ALLOWED_VERBS.include?(verb) && 303 == code
@request.redirect(uri, verb)
end | [
"def",
"redirect_to",
"(",
"uri",
")",
"raise",
"StateError",
",",
"\"no Location header in redirect\"",
"unless",
"uri",
"verb",
"=",
"@request",
".",
"verb",
"code",
"=",
"@response",
".",
"status",
".",
"code",
"if",
"UNSAFE_VERBS",
".",
"include?",
"(",
"v... | Redirect policy for follow
@return [Request] | [
"Redirect",
"policy",
"for",
"follow"
] | f37a10ea4fab3ee411907ea2e4251ddf0ca33a93 | https://github.com/httprb/http/blob/f37a10ea4fab3ee411907ea2e4251ddf0ca33a93/lib/http/redirector.rb#L84-L98 | train | redirect to URI | [
30522,
13366,
2417,
7442,
6593,
1035,
2000,
1006,
24471,
2072,
1007,
5333,
2110,
2121,
29165,
1010,
1000,
2053,
3295,
20346,
1999,
2417,
7442,
6593,
1000,
4983,
24471,
2072,
12034,
1027,
1030,
5227,
1012,
12034,
3642,
1027,
1030,
3433,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
DataDog/dogstatsd-ruby | lib/datadog/statsd.rb | Datadog.Statsd.histogram | def histogram(stat, value, opts=EMPTY_OPTIONS)
send_stats stat, value, HISTOGRAM_TYPE, opts
end | ruby | def histogram(stat, value, opts=EMPTY_OPTIONS)
send_stats stat, value, HISTOGRAM_TYPE, opts
end | [
"def",
"histogram",
"(",
"stat",
",",
"value",
",",
"opts",
"=",
"EMPTY_OPTIONS",
")",
"send_stats",
"stat",
",",
"value",
",",
"HISTOGRAM_TYPE",
",",
"opts",
"end"
] | Sends a value to be tracked as a histogram to the statsd server.
@param [String] stat stat name.
@param [Numeric] value histogram value.
@param [Hash] opts the options to create the metric with
@option opts [Numeric] :sample_rate sample rate, 1 for always
@option opts [Array<String>] :tags An array of tags
@example Report the current user count:
$statsd.histogram('user.count', User.count) | [
"Sends",
"a",
"value",
"to",
"be",
"tracked",
"as",
"a",
"histogram",
"to",
"the",
"statsd",
"server",
"."
] | 0ea2a4d011958ad0d092654cae950e64b6475077 | https://github.com/DataDog/dogstatsd-ruby/blob/0ea2a4d011958ad0d092654cae950e64b6475077/lib/datadog/statsd.rb#L308-L310 | train | Send a histogram to the server | [
30522,
13366,
2010,
3406,
13113,
1006,
28093,
1010,
3643,
1010,
23569,
2015,
1027,
4064,
1035,
7047,
1007,
4604,
1035,
26319,
28093,
1010,
3643,
1010,
2010,
3406,
13113,
1035,
2828,
1010,
23569,
2015,
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... |
rails/sprockets | lib/sprockets/manifest.rb | Sprockets.Manifest.find | def find(*args)
unless environment
raise Error, "manifest requires environment for compilation"
end
return to_enum(__method__, *args) unless block_given?
environment = self.environment.cached
promises = args.flatten.map do |path|
Concurrent::Promise.execute(executor: executor) do
environment.find_all_linked_assets(path) do |asset|
yield asset
end
end
end
promises.each(&:wait!)
nil
end | ruby | def find(*args)
unless environment
raise Error, "manifest requires environment for compilation"
end
return to_enum(__method__, *args) unless block_given?
environment = self.environment.cached
promises = args.flatten.map do |path|
Concurrent::Promise.execute(executor: executor) do
environment.find_all_linked_assets(path) do |asset|
yield asset
end
end
end
promises.each(&:wait!)
nil
end | [
"def",
"find",
"(",
"*",
"args",
")",
"unless",
"environment",
"raise",
"Error",
",",
"\"manifest requires environment for compilation\"",
"end",
"return",
"to_enum",
"(",
"__method__",
",",
"args",
")",
"unless",
"block_given?",
"environment",
"=",
"self",
".",
"... | Public: Find all assets matching pattern set in environment.
Returns Enumerator of Assets. | [
"Public",
":",
"Find",
"all",
"assets",
"matching",
"pattern",
"set",
"in",
"environment",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/manifest.rb#L115-L133 | train | Find all linked assets in the manifest. | [
30522,
13366,
2424,
1006,
1008,
12098,
5620,
1007,
4983,
4044,
5333,
7561,
1010,
1000,
19676,
5942,
4044,
2005,
6268,
1000,
2203,
2709,
2000,
1035,
4372,
2819,
1006,
1035,
1035,
4118,
1035,
1035,
1010,
1008,
12098,
5620,
1007,
4983,
3796,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/sprockets | lib/sprockets/bower.rb | Sprockets.Bower.read_bower_main | def read_bower_main(dirname, filename)
bower = JSON.parse(File.read(filename), create_additions: false)
case bower['main']
when String
yield File.expand_path(bower['main'], dirname)
when Array
bower['main'].each do |name|
yield File.expand_path(name, dirname)
end
end
end | ruby | def read_bower_main(dirname, filename)
bower = JSON.parse(File.read(filename), create_additions: false)
case bower['main']
when String
yield File.expand_path(bower['main'], dirname)
when Array
bower['main'].each do |name|
yield File.expand_path(name, dirname)
end
end
end | [
"def",
"read_bower_main",
"(",
"dirname",
",",
"filename",
")",
"bower",
"=",
"JSON",
".",
"parse",
"(",
"File",
".",
"read",
"(",
"filename",
")",
",",
"create_additions",
":",
"false",
")",
"case",
"bower",
"[",
"'main'",
"]",
"when",
"String",
"yield"... | Internal: Read bower.json's main directive.
dirname - String path to component directory.
filename - String path to bower.json.
Returns nothing. | [
"Internal",
":",
"Read",
"bower",
".",
"json",
"s",
"main",
"directive",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/bower.rb#L48-L59 | train | Reads the main file from the bower. json file | [
30522,
13366,
3191,
1035,
6812,
2121,
1035,
2364,
1006,
16101,
18442,
1010,
5371,
18442,
1007,
6812,
2121,
1027,
1046,
3385,
1012,
11968,
3366,
1006,
5371,
1012,
3191,
1006,
5371,
18442,
1007,
1010,
3443,
1035,
13134,
1024,
6270,
1007,
2553... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kmuto/review | lib/epubmaker/producer.rb | EPUBMaker.Producer.coverimage | def coverimage
return nil unless config['coverimage']
@contents.each do |item|
if item.media.start_with?('image') && item.file =~ /#{config['coverimage']}\Z/
return item.file
end
end
nil
end | ruby | def coverimage
return nil unless config['coverimage']
@contents.each do |item|
if item.media.start_with?('image') && item.file =~ /#{config['coverimage']}\Z/
return item.file
end
end
nil
end | [
"def",
"coverimage",
"return",
"nil",
"unless",
"config",
"[",
"'coverimage'",
"]",
"@contents",
".",
"each",
"do",
"|",
"item",
"|",
"if",
"item",
".",
"media",
".",
"start_with?",
"(",
"'image'",
")",
"&&",
"item",
".",
"file",
"=~",
"/",
"#{",
"conf... | Construct producer object.
+config+ takes initial parameter hash. This parameters can be overriden by EPUBMaker#load or EPUBMaker#merge_config.
+version+ takes EPUB version (default is 2). | [
"Construct",
"producer",
"object",
".",
"+",
"config",
"+",
"takes",
"initial",
"parameter",
"hash",
".",
"This",
"parameters",
"can",
"be",
"overriden",
"by",
"EPUBMaker#load",
"or",
"EPUBMaker#merge_config",
".",
"+",
"version",
"+",
"takes",
"EPUB",
"version"... | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/producer.rb#L66-L74 | train | Returns the file containing the cover image. | [
30522,
13366,
3104,
9581,
3351,
2709,
9152,
2140,
4983,
9530,
8873,
2290,
1031,
1005,
3104,
9581,
3351,
1005,
1033,
1030,
8417,
1012,
2169,
2079,
1064,
8875,
1064,
2065,
8875,
1012,
2865,
1012,
2707,
1035,
2007,
1029,
1006,
1005,
3746,
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/api/v1_employees_api.rb | SquareConnect.V1EmployeesApi.create_employee | def create_employee(body, opts = {})
data, _status_code, _headers = create_employee_with_http_info(body, opts)
return data
end | ruby | def create_employee(body, opts = {})
data, _status_code, _headers = create_employee_with_http_info(body, opts)
return data
end | [
"def",
"create_employee",
"(",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"create_employee_with_http_info",
"(",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | CreateEmployee
Use the CreateEmployee endpoint to add an employee to a Square account. Employees created with the Connect API have an initial status of `INACTIVE`. Inactive employees cannot sign in to Square Point of Sale until they are activated from the Square Dashboard. Employee status cannot be changed with the Connect API. <aside class=\"important\"> Employee entities cannot be deleted. To disable employee profiles, set the employee's status to <code>INACTIVE</code> </aside>
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [V1Employee] | [
"CreateEmployee",
"Use",
"the",
"CreateEmployee",
"endpoint",
"to",
"add",
"an",
"employee",
"to",
"a",
"Square",
"account",
".",
"Employees",
"created",
"with",
"the",
"Connect",
"API",
"have",
"an",
"initial",
"status",
"of",
"INACTIVE",
".",
"Inactive",
"em... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_employees_api.rb#L25-L28 | train | Creates an employee | [
30522,
13366,
3443,
1035,
7904,
1006,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
3443,
1035,
7904,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2303,
1010,
23569,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.backend_health_on_demand | def backend_health_on_demand(resource_group_name, application_gateway_name, probe_request, expand:nil, custom_headers:nil)
response = backend_health_on_demand_async(resource_group_name, application_gateway_name, probe_request, expand:expand, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def backend_health_on_demand(resource_group_name, application_gateway_name, probe_request, expand:nil, custom_headers:nil)
response = backend_health_on_demand_async(resource_group_name, application_gateway_name, probe_request, expand:expand, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"backend_health_on_demand",
"(",
"resource_group_name",
",",
"application_gateway_name",
",",
"probe_request",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"backend_health_on_demand_async",
"(",
"resource_group_name",
",",
"... | Gets the backend health for given combination of backend pool and http
setting of the specified application gateway in a resource group.
@param resource_group_name [String] The name of the resource group.
@param application_gateway_name [String] The name of the application gateway.
@param probe_request [ApplicationGatewayOnDemandProbe] Request body for
on-demand test probe operation.
@param expand [String] Expands BackendAddressPool and BackendHttpSettings
referenced in backend health.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ApplicationGatewayBackendHealthOnDemand] operation results. | [
"Gets",
"the",
"backend",
"health",
"for",
"given",
"combination",
"of",
"backend",
"pool",
"and",
"http",
"setting",
"of",
"the",
"specified",
"application",
"gateway",
"in",
"a",
"resource",
"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_gateways.rb#L556-L559 | train | Gets the health of the specified application gateway in a resource group. | [
30522,
13366,
2067,
10497,
1035,
2740,
1035,
2006,
1035,
5157,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4646,
1035,
11909,
1035,
2171,
1010,
15113,
1035,
5227,
1010,
7818,
1024,
9152,
2140,
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 | data/azure_cognitiveservices_localsearch/lib/1.0/generated/azure_cognitiveservices_localsearch/local.rb | Azure::CognitiveServices::LocalSearch::V1_0.Local.search | def search(query, accept_language:nil, pragma:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, market:'en-us', local_categories:nil, local_circular_view:nil, local_map_view:nil, count:nil, first:nil, response_format:nil, safe_search:nil, set_lang:nil, custom_headers:nil)
response = search_async(query, accept_language:accept_language, pragma:pragma, user_agent:user_agent, client_id:client_id, client_ip:client_ip, location:location, country_code:country_code, market:market, local_categories:local_categories, local_circular_view:local_circular_view, local_map_view:local_map_view, count:count, first:first, response_format:response_format, safe_search:safe_search, set_lang:set_lang, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def search(query, accept_language:nil, pragma:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, market:'en-us', local_categories:nil, local_circular_view:nil, local_map_view:nil, count:nil, first:nil, response_format:nil, safe_search:nil, set_lang:nil, custom_headers:nil)
response = search_async(query, accept_language:accept_language, pragma:pragma, user_agent:user_agent, client_id:client_id, client_ip:client_ip, location:location, country_code:country_code, market:market, local_categories:local_categories, local_circular_view:local_circular_view, local_map_view:local_map_view, count:count, first:first, response_format:response_format, safe_search:safe_search, set_lang:set_lang, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"search",
"(",
"query",
",",
"accept_language",
":",
"nil",
",",
"pragma",
":",
"nil",
",",
"user_agent",
":",
"nil",
",",
"client_id",
":",
"nil",
",",
"client_ip",
":",
"nil",
",",
"location",
":",
"nil",
",",
"country_code",
":",
"nil",
",",
... | The Local Search API lets you send a search query to Bing and get back search
results that include local businesses such as restaurants, hotels, retail
stores, or other local businesses. The query can specify the name of the
local business or it can ask for a list (for example, restaurants near me).
@param query [String] The user's search term.
@param accept_language [String] A comma-delimited list of one or more
languages to use for user interface strings. The list is in decreasing order
of preference. For additional information, including expected format, see
[RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This
header and the setLang query parameter are mutually exclusive; do not specify
both. If you set this header, you must also specify the cc query parameter.
Bing will use the first supported language it finds from the list, and
combine that language with the cc parameter value to determine the market to
return results for. If the list does not include a supported language, Bing
will find the closest language and market that supports the request, and may
use an aggregated or default market for the results instead of a specified
one. You should use this header and the cc query parameter only if you
specify multiple languages; otherwise, you should use the mkt and setLang
query parameters. A user interface string is a string that's used as a label
in a user interface. There are very few user interface strings in the JSON
response objects. Any links in the response objects to Bing.com properties
will apply the specified language.
@param pragma [String] By default, Bing returns cached content, if available.
To prevent Bing from returning cached content, set the Pragma header to
no-cache (for example, Pragma: no-cache).
@param user_agent [String] The user agent originating the request. Bing uses
the user agent to provide mobile users with an optimized experience. Although
optional, you are strongly encouraged to always specify this header. The
user-agent should be the same string that any commonly used browser would
send. For information about user agents, see [RFC
2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
@param client_id [String] Bing uses this header to provide users with
consistent behavior across Bing API calls. Bing often flights new features
and improvements, and it uses the client ID as a key for assigning traffic on
different flights. If you do not use the same client ID for a user across
multiple requests, then Bing may assign the user to multiple conflicting
flights. Being assigned to multiple conflicting flights can lead to an
inconsistent user experience. For example, if the second request has a
different flight assignment than the first, the experience may be unexpected.
Also, Bing can use the client ID to tailor web results to that client ID’s
search history, providing a richer experience for the user. Bing also uses
this header to help improve result rankings by analyzing the activity
generated by a client ID. The relevance improvements help with better quality
of results delivered by Bing APIs and in turn enables higher click-through
rates for the API consumer. IMPORTANT: Although optional, you should consider
this header required. Persisting the client ID across multiple requests for
the same end user and device combination enables 1) the API consumer to
receive a consistent user experience, and 2) higher click-through rates via
better quality of results from the Bing APIs. Each user that uses your
application on the device must have a unique, Bing generated client ID. If
you do not include this header in the request, Bing generates an ID and
returns it in the X-MSEdge-ClientID response header. The only time that you
should NOT include this header in a request is the first time the user uses
your app on that device. Use the client ID for each Bing API request that
your app makes for this user on the device. Persist the client ID. To persist
the ID in a browser app, use a persistent HTTP cookie to ensure the ID is
used across all sessions. Do not use a session cookie. For other apps such as
mobile apps, use the device's persistent storage to persist the ID. The next
time the user uses your app on that device, get the client ID that you
persisted. Bing responses may or may not include this header. If the response
includes this header, capture the client ID and use it for all subsequent
Bing requests for the user on that device. If you include the
X-MSEdge-ClientID, you must not include cookies in the request.
@param client_ip [String] The IPv4 or IPv6 address of the client device. The
IP address is used to discover the user's location. Bing uses the location
information to determine safe search behavior. Although optional, you are
encouraged to always specify this header and the X-Search-Location header. Do
not obfuscate the address (for example, by changing the last octet to 0).
Obfuscating the address results in the location not being anywhere near the
device's actual location, which may result in Bing serving erroneous results.
@param location [String] A semicolon-delimited list of key/value pairs that
describe the client's geographical location. Bing uses the location
information to determine safe search behavior and to return relevant local
content. Specify the key/value pair as <key>:<value>. The following are the
keys that you use to specify the user's location. lat (required): The
latitude of the client's location, in degrees. The latitude must be greater
than or equal to -90.0 and less than or equal to +90.0. Negative values
indicate southern latitudes and positive values indicate northern latitudes.
long (required): The longitude of the client's location, in degrees. The
longitude must be greater than or equal to -180.0 and less than or equal to
+180.0. Negative values indicate western longitudes and positive values
indicate eastern longitudes. re (required): The radius, in meters, which
specifies the horizontal accuracy of the coordinates. Pass the value returned
by the device's location service. Typical values might be 22m for GPS/Wi-Fi,
380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts
(optional): The UTC UNIX timestamp of when the client was at the location.
(The UNIX timestamp is the number of seconds since January 1, 1970.) head
(optional): The client's relative heading or direction of travel. Specify the
direction of travel as degrees from 0 through 360, counting clockwise
relative to true north. Specify this key only if the sp key is nonzero. sp
(optional): The horizontal velocity (speed), in meters per second, that the
client device is traveling. alt (optional): The altitude of the client
device, in meters. are (optional): The radius, in meters, that specifies the
vertical accuracy of the coordinates. Specify this key only if you specify
the alt key. Although many of the keys are optional, the more information
that you provide, the more accurate the location results are. Although
optional, you are encouraged to always specify the user's geographical
location. Providing the location is especially important if the client's IP
address does not accurately reflect the user's physical location (for
example, if the client uses VPN). For optimal results, you should include
this header and the X-MSEdge-ClientIP header, but at a minimum, you should
include this header.
@param country_code [String] A 2-character country code of the country where
the results come from. This API supports only the United States market. If
you specify this query parameter, it must be set to us. If you set this
parameter, you must also specify the Accept-Language header. Bing uses the
first supported language it finds from the languages list, and combine that
language with the country code that you specify to determine the market to
return results for. If the languages list does not include a supported
language, Bing finds the closest language and market that supports the
request, or it may use an aggregated or default market for the results
instead of a specified one. You should use this query parameter and the
Accept-Language query parameter only if you specify multiple languages;
otherwise, you should use the mkt and setLang query parameters. This
parameter and the mkt query parameter are mutually exclusive—do not specify
both.
@param market [String] The market where the results come from. You are
strongly encouraged to always specify the market, if known. Specifying the
market helps Bing route the request and return an appropriate and optimal
response. This parameter and the cc query parameter are mutually exclusive—do
not specify both.
@param local_categories [String] comma-delimited list of business categories
to search for. Supported categories can be high-level such as EatDrink, Shop,
SeeDo.
@param local_circular_view [String] Preferred location to search around,
expressed as Latitude, longitude and radius in meters. For example
47.61503,-122.1719,5000. Note that circular view should only be used to
indicate a search around a point on the map, not as an approximation for a
view port of a map rectangle.
@param local_map_view [String] Preferred bounding box for results, specified
in NW_latitude, NW_Longitude, SE_Latitude, SE_Longitude format. For example
47.64,-122.13,47.63,-122.12. These values are lat, long pairs for the
Northwest corner and the Southeast corner of a rectangle.
@param count [String] Preferred number of results to return. If not
specified, then Bing returns 1-20 of the most relevant results.
@param first [String] First result to return. zero-based. default is 0.
@param response_format [Array<ResponseFormat>] The media type to use for the
response. The following are the possible case-insensitive values: JSON,
JSONLD. The default is JSON. If you specify JSONLD, the response body
includes JSON-LD objects that contain the search results.
@param safe_search [SafeSearch] A filter used to filter adult content. Off:
Return webpages with adult text, images, or videos. Moderate: Return webpages
with adult text, but not adult images or videos. Strict: Do not return
webpages with adult text, images, or videos. The default is Moderate. If the
request comes from a market that Bing's adult policy requires that safeSearch
is set to Strict, Bing ignores the safeSearch value and uses Strict. If you
use the site: query operator, there is the chance that the response may
contain adult content regardless of what the safeSearch query parameter is
set to. Use site: only if you are aware of the content on the site and your
scenario supports the possibility of adult content. Possible values include:
'Off', 'Moderate', 'Strict'
@param set_lang [String] The language to use for user interface strings.
Specify the language using the ISO 639-1 2-letter language code. For example,
the language code for English is EN. The default is EN (English). Although
optional, you should always specify the language. Typically, you set setLang
to the same language specified by mkt unless the user wants the user
interface strings displayed in a different language. This parameter and the
Accept-Language header are mutually exclusive; do not specify both. A user
interface string is a string that's used as a label in a user interface.
There are few user interface strings in the JSON response objects. Also, any
links to Bing.com properties in the response objects apply the specified
language.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SearchResponse] operation results. | [
"The",
"Local",
"Search",
"API",
"lets",
"you",
"send",
"a",
"search",
"query",
"to",
"Bing",
"and",
"get",
"back",
"search",
"results",
"that",
"include",
"local",
"businesses",
"such",
"as",
"restaurants",
"hotels",
"retail",
"stores",
"or",
"other",
"loca... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_localsearch/lib/1.0/generated/azure_cognitiveservices_localsearch/local.rb#L197-L200 | train | Search for a given search query. | [
30522,
13366,
3945,
1006,
23032,
1010,
5138,
1035,
2653,
1024,
9152,
2140,
1010,
10975,
8490,
2863,
1024,
9152,
2140,
1010,
5310,
1035,
4005,
1024,
9152,
2140,
1010,
7396,
1035,
8909,
1024,
9152,
2140,
1010,
7396,
1035,
30524,
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... |
tongueroo/jets | lib/jets/resource/lambda/function.rb | Jets::Resource::Lambda.Function.class_properties | def class_properties
# klass is PostsController, HardJob, GameRule, Hello or HelloFunction
klass = Jets::Klass.from_task(@task)
class_properties = lookup_class_properties(klass)
if klass.build_class_iam?
iam_policy = Jets::Resource::Iam::ClassRole.new(klass)
class_properties[:role] = "!GetAtt #{iam_policy.logical_id}.Arn"
end
class_properties
end | ruby | def class_properties
# klass is PostsController, HardJob, GameRule, Hello or HelloFunction
klass = Jets::Klass.from_task(@task)
class_properties = lookup_class_properties(klass)
if klass.build_class_iam?
iam_policy = Jets::Resource::Iam::ClassRole.new(klass)
class_properties[:role] = "!GetAtt #{iam_policy.logical_id}.Arn"
end
class_properties
end | [
"def",
"class_properties",
"# klass is PostsController, HardJob, GameRule, Hello or HelloFunction",
"klass",
"=",
"Jets",
"::",
"Klass",
".",
"from_task",
"(",
"@task",
")",
"class_properties",
"=",
"lookup_class_properties",
"(",
"klass",
")",
"if",
"klass",
".",
"build_... | Class properties example:
class PostsController < ApplicationController
class_timeout 22
...
end
Also handles iam policy override at the class level. Example:
class_iam_policy("logs:*") | [
"Class",
"properties",
"example",
":"
] | 46943a519224067e58aa3e2d5656e3ca083150f9 | https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/resource/lambda/function.rb#L71-L82 | train | Returns the class properties for the task | [
30522,
13366,
2465,
1035,
5144,
1001,
1047,
27102,
2003,
8466,
8663,
13181,
10820,
1010,
2524,
5558,
2497,
1010,
27911,
9307,
1010,
7592,
2030,
7592,
11263,
27989,
1047,
27102,
1027,
9924,
1024,
1024,
1047,
27102,
1012,
2013,
1035,
4708,
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... |
danger/danger | lib/danger/danger_core/dangerfile.rb | Danger.Dangerfile.parse | def parse(path, contents = nil)
print_known_info if verbose
contents ||= File.open(path, "r:utf-8", &:read)
# Work around for Rubinius incomplete encoding in 1.9 mode
if contents.respond_to?(:encoding) && contents.encoding.name != "UTF-8"
contents.encode!("UTF-8")
end
if contents.tr!("“”‘’‛", %(""'''))
# Changes have been made
ui.puts "Your #{path.basename} has had smart quotes sanitised. " \
"To avoid issues in the future, you should not use " \
"TextEdit for editing it. If you are not using TextEdit, " \
"you should turn off smart quotes in your editor of choice.".red
end
if contents.include?("puts")
ui.puts "You used `puts` in your Dangerfile. To print out text to GitHub use `message` instead"
end
self.defined_in_file = path
instance_eval do
# rubocop:disable Lint/RescueException
begin
eval_file(contents, path)
rescue Exception => e
message = "Invalid `#{path.basename}` file: #{e.message}"
raise DSLError.new(message, path, e.backtrace, contents)
end
# rubocop:enable Lint/RescueException
end
end | ruby | def parse(path, contents = nil)
print_known_info if verbose
contents ||= File.open(path, "r:utf-8", &:read)
# Work around for Rubinius incomplete encoding in 1.9 mode
if contents.respond_to?(:encoding) && contents.encoding.name != "UTF-8"
contents.encode!("UTF-8")
end
if contents.tr!("“”‘’‛", %(""'''))
# Changes have been made
ui.puts "Your #{path.basename} has had smart quotes sanitised. " \
"To avoid issues in the future, you should not use " \
"TextEdit for editing it. If you are not using TextEdit, " \
"you should turn off smart quotes in your editor of choice.".red
end
if contents.include?("puts")
ui.puts "You used `puts` in your Dangerfile. To print out text to GitHub use `message` instead"
end
self.defined_in_file = path
instance_eval do
# rubocop:disable Lint/RescueException
begin
eval_file(contents, path)
rescue Exception => e
message = "Invalid `#{path.basename}` file: #{e.message}"
raise DSLError.new(message, path, e.backtrace, contents)
end
# rubocop:enable Lint/RescueException
end
end | [
"def",
"parse",
"(",
"path",
",",
"contents",
"=",
"nil",
")",
"print_known_info",
"if",
"verbose",
"contents",
"||=",
"File",
".",
"open",
"(",
"path",
",",
"\"r:utf-8\"",
",",
":read",
")",
"# Work around for Rubinius incomplete encoding in 1.9 mode",
"if",
"con... | Parses the file at a path, optionally takes the content of the file for DI | [
"Parses",
"the",
"file",
"at",
"a",
"path",
"optionally",
"takes",
"the",
"content",
"of",
"the",
"file",
"for",
"DI"
] | 0d6d09f2d949c287fe75202d947374042b0679f4 | https://github.com/danger/danger/blob/0d6d09f2d949c287fe75202d947374042b0679f4/lib/danger/danger_core/dangerfile.rb#L174-L207 | train | Parse a file | [
30522,
13366,
11968,
3366,
1006,
4130,
1010,
8417,
1027,
9152,
2140,
1007,
6140,
1035,
2124,
1035,
18558,
2065,
12034,
9232,
8417,
1064,
1064,
1027,
5371,
1012,
2330,
1006,
4130,
1010,
1000,
1054,
1024,
21183,
2546,
1011,
1022,
1000,
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... |
puppetlabs/puppet | lib/puppet/util/rdoc/generators/puppet_generator.rb | Generators.HTMLPuppetNode.http_url | def http_url(full_name, prefix)
path = full_name.dup
path.gsub!(/<<\s*(\w*)/) { "from-#$1" } if path['<<']
File.join(prefix, path.split("::").collect { |p| Digest::MD5.hexdigest(p) }) + ".html"
end | ruby | def http_url(full_name, prefix)
path = full_name.dup
path.gsub!(/<<\s*(\w*)/) { "from-#$1" } if path['<<']
File.join(prefix, path.split("::").collect { |p| Digest::MD5.hexdigest(p) }) + ".html"
end | [
"def",
"http_url",
"(",
"full_name",
",",
"prefix",
")",
"path",
"=",
"full_name",
".",
"dup",
"path",
".",
"gsub!",
"(",
"/",
"\\s",
"\\w",
"/",
")",
"{",
"\"from-#$1\"",
"}",
"if",
"path",
"[",
"'<<'",
"]",
"File",
".",
"join",
"(",
"prefix",
","... | return the relative file name to store this class in,
which is also its url | [
"return",
"the",
"relative",
"file",
"name",
"to",
"store",
"this",
"class",
"in",
"which",
"is",
"also",
"its",
"url"
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/rdoc/generators/puppet_generator.rb#L482-L486 | train | Returns the url for the given full name | [
30522,
13366,
8299,
1035,
24471,
2140,
1006,
2440,
1035,
2171,
1010,
17576,
1007,
4130,
1027,
2440,
1035,
2171,
1012,
4241,
2361,
4130,
1012,
28177,
12083,
999,
1006,
1013,
1026,
1026,
1032,
1055,
1008,
1006,
1032,
1059,
1008,
1007,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.decrypt | def decrypt(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
response = decrypt_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def decrypt(vault_base_url, key_name, key_version, algorithm, value, custom_headers:nil)
response = decrypt_async(vault_base_url, key_name, key_version, algorithm, value, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"decrypt",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"algorithm",
",",
"value",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"decrypt_async",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"algorithm",
... | Decrypts a single block of encrypted data.
The DECRYPT operation decrypts a well-formed block of ciphertext using the
target encryption key and specified algorithm. This operation is the reverse
of the ENCRYPT operation; only a single block of data may be decrypted, the
size of this block is dependent on the target key and the algorithm to be
used. The DECRYPT operation applies to asymmetric and symmetric keys stored
in Azure Key Vault since it uses the private portion of the key. This
operation requires the keys/decrypt 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 [KeyOperationResult] operation results. | [
"Decrypts",
"a",
"single",
"block",
"of",
"encrypted",
"data",
"."
] | 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#L1487-L1490 | train | Decrypts the specified key. | [
30522,
13366,
11703,
2854,
13876,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
3145,
1035,
2544,
1010,
9896,
1010,
3643,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
11703,
2854,
13876,
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... |
palkan/logidze | lib/logidze/model.rb | Logidze.Model.diff_from | def diff_from(ts = nil, version: nil, time: nil)
Deprecations.show_ts_deprecation_for("#diff_from") if ts
time ||= ts
time = parse_time(time) if time
changes = log_data.diff_from(time: time, version: version).tap do |v|
deserialize_changes!(v)
end
changes.delete_if { |k, _v| deleted_column?(k) }
{ "id" => id, "changes" => changes }
end | ruby | def diff_from(ts = nil, version: nil, time: nil)
Deprecations.show_ts_deprecation_for("#diff_from") if ts
time ||= ts
time = parse_time(time) if time
changes = log_data.diff_from(time: time, version: version).tap do |v|
deserialize_changes!(v)
end
changes.delete_if { |k, _v| deleted_column?(k) }
{ "id" => id, "changes" => changes }
end | [
"def",
"diff_from",
"(",
"ts",
"=",
"nil",
",",
"version",
":",
"nil",
",",
"time",
":",
"nil",
")",
"Deprecations",
".",
"show_ts_deprecation_for",
"(",
"\"#diff_from\"",
")",
"if",
"ts",
"time",
"||=",
"ts",
"time",
"=",
"parse_time",
"(",
"time",
")",... | Return diff object representing changes since specified time.
@example
post.diff_from(time: 2.days.ago) # or post.diff_from(version: 2)
#=> { "id" => 1, "changes" => { "title" => { "old" => "Hello!", "new" => "World" } } } | [
"Return",
"diff",
"object",
"representing",
"changes",
"since",
"specified",
"time",
"."
] | ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8 | https://github.com/palkan/logidze/blob/ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8/lib/logidze/model.rb#L134-L145 | train | Returns a hash of the diff from the log data. | [
30522,
13366,
4487,
4246,
1035,
2013,
1006,
24529,
1027,
9152,
2140,
1010,
2544,
1024,
9152,
2140,
1010,
2051,
1024,
9152,
2140,
1007,
2139,
28139,
10719,
2015,
1012,
2265,
1035,
24529,
1035,
2139,
28139,
10719,
1035,
2005,
1006,
1000,
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_network_gateway_connections.rb | Azure::Network::Mgmt::V2018_07_01.VirtualNetworkGatewayConnections.begin_set_shared_key | def begin_set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers:nil)
response = begin_set_shared_key_async(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_set_shared_key(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers:nil)
response = begin_set_shared_key_async(resource_group_name, virtual_network_gateway_connection_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_set_shared_key",
"(",
"resource_group_name",
",",
"virtual_network_gateway_connection_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_set_shared_key_async",
"(",
"resource_group_name",
",",
"virtual_network_gateway_connect... | The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual
network gateway connection shared key for passed virtual network gateway
connection in the specified resource group through Network resource provider.
@param resource_group_name [String] The name of the resource group.
@param virtual_network_gateway_connection_name [String] The virtual network
gateway connection name.
@param parameters [ConnectionSharedKey] Parameters supplied to the Begin Set
Virtual Network Gateway connection Shared key operation throughNetwork
resource provider.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ConnectionSharedKey] operation results. | [
"The",
"Put",
"VirtualNetworkGatewayConnectionSharedKey",
"operation",
"sets",
"the",
"virtual",
"network",
"gateway",
"connection",
"shared",
"key",
"for",
"passed",
"virtual",
"network",
"gateway",
"connection",
"in",
"the",
"specified",
"resource",
"group",
"through"... | 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_gateway_connections.rb#L884-L887 | train | Sets the virtual network gateway connection shared key. | [
30522,
13366,
4088,
1035,
2275,
1035,
4207,
1035,
3145,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
2897,
1035,
11909,
1035,
4434,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/tree/node.rb | HamlLint::Tree.Node.nontrivial_end_line | def nontrivial_end_line
if (last_child = children.last)
last_child.line_numbers.end - 1
elsif successor
successor.line_numbers.begin - 1
else
@document.source_lines.count
end
end | ruby | def nontrivial_end_line
if (last_child = children.last)
last_child.line_numbers.end - 1
elsif successor
successor.line_numbers.begin - 1
else
@document.source_lines.count
end
end | [
"def",
"nontrivial_end_line",
"if",
"(",
"last_child",
"=",
"children",
".",
"last",
")",
"last_child",
".",
"line_numbers",
".",
"end",
"-",
"1",
"elsif",
"successor",
"successor",
".",
"line_numbers",
".",
"begin",
"-",
"1",
"else",
"@document",
".",
"sour... | Discovers the end line of the node when there are no lines.
@return [Integer] the end line of the node | [
"Discovers",
"the",
"end",
"line",
"of",
"the",
"node",
"when",
"there",
"are",
"no",
"lines",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/tree/node.rb#L163-L171 | train | Returns the number of nontrivial end lines of the document. | [
30522,
13366,
2512,
18886,
18660,
1035,
2203,
1035,
2240,
2065,
1006,
2197,
1035,
2775,
1027,
2336,
1012,
2197,
1007,
2197,
1035,
2775,
1012,
2240,
1035,
3616,
1012,
2203,
1011,
1015,
3449,
5332,
2546,
6332,
6332,
1012,
2240,
1035,
3616,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/row.rb | Axlsx.Row.style= | def style=(style)
each_with_index do | cell, index |
cell.style = style.is_a?(Array) ? style[index] : style
end
end | ruby | def style=(style)
each_with_index do | cell, index |
cell.style = style.is_a?(Array) ? style[index] : style
end
end | [
"def",
"style",
"=",
"(",
"style",
")",
"each_with_index",
"do",
"|",
"cell",
",",
"index",
"|",
"cell",
".",
"style",
"=",
"style",
".",
"is_a?",
"(",
"Array",
")",
"?",
"style",
"[",
"index",
"]",
":",
"style",
"end",
"end"
] | sets the style for every cell in this row | [
"sets",
"the",
"style",
"for",
"every",
"cell",
"in",
"this",
"row"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/row.rb#L114-L118 | train | Set the style of the cell. | [
30522,
13366,
2806,
1027,
1006,
2806,
1007,
2169,
1035,
2007,
1035,
5950,
2079,
1064,
3526,
1010,
5950,
1064,
3526,
1012,
2806,
1027,
2806,
1012,
2003,
1035,
1037,
1029,
1006,
9140,
1007,
1029,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
danger/danger | lib/danger/danger_core/dangerfile.rb | Danger.Dangerfile.refresh_plugins | def refresh_plugins
plugins = Plugin.all_plugins
plugins.each do |klass|
next if klass.respond_to?(:singleton_class?) && klass.singleton_class?
plugin = klass.new(self)
next if plugin.nil? || @plugins[klass]
name = plugin.class.instance_name
self.class.send(:attr_reader, name)
instance_variable_set("@#{name}", plugin)
@plugins[klass] = plugin
@core_plugins << plugin if self.class.core_plugin_classes.include? klass
end
end | ruby | def refresh_plugins
plugins = Plugin.all_plugins
plugins.each do |klass|
next if klass.respond_to?(:singleton_class?) && klass.singleton_class?
plugin = klass.new(self)
next if plugin.nil? || @plugins[klass]
name = plugin.class.instance_name
self.class.send(:attr_reader, name)
instance_variable_set("@#{name}", plugin)
@plugins[klass] = plugin
@core_plugins << plugin if self.class.core_plugin_classes.include? klass
end
end | [
"def",
"refresh_plugins",
"plugins",
"=",
"Plugin",
".",
"all_plugins",
"plugins",
".",
"each",
"do",
"|",
"klass",
"|",
"next",
"if",
"klass",
".",
"respond_to?",
"(",
":singleton_class?",
")",
"&&",
"klass",
".",
"singleton_class?",
"plugin",
"=",
"klass",
... | cork_board not being set comes from plugins #585
Iterate through available plugin classes and initialize them with
a reference to this Dangerfile | [
"cork_board",
"not",
"being",
"set",
"comes",
"from",
"plugins",
"#585",
"Iterate",
"through",
"available",
"plugin",
"classes",
"and",
"initialize",
"them",
"with",
"a",
"reference",
"to",
"this",
"Dangerfile"
] | 0d6d09f2d949c287fe75202d947374042b0679f4 | https://github.com/danger/danger/blob/0d6d09f2d949c287fe75202d947374042b0679f4/lib/danger/danger_core/dangerfile.rb#L92-L106 | train | Refresh the plugin objects from the plugin object. | [
30522,
13366,
25416,
21898,
1035,
13354,
7076,
13354,
7076,
1027,
13354,
2378,
1012,
2035,
1035,
13354,
7076,
13354,
7076,
1012,
2169,
2079,
1064,
1047,
27102,
1064,
2279,
2065,
1047,
27102,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
28159,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/tag.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Tag.detach_from_api | def detach_from_api(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers:nil)
response = detach_from_api_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers:custom_headers).value!
nil
end | ruby | def detach_from_api(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers:nil)
response = detach_from_api_async(resource_group_name, service_name, api_id, tag_id, if_match, custom_headers:custom_headers).value!
nil
end | [
"def",
"detach_from_api",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"tag_id",
",",
"if_match",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"detach_from_api_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id"... | Detach the tag from the Api.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param api_id [String] API revision identifier. Must be unique in the current
API Management service instance. Non-current revision has ;rev=n as a suffix
where n is the revision number.
@param tag_id [String] Tag identifier. Must be unique in the current API
Management service instance.
@param if_match [String] ETag of the Entity. ETag should match the current
entity state from the header response of the GET request or it should be *
for unconditional update.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Detach",
"the",
"tag",
"from",
"the",
"Api",
"."
] | 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/tag.rb#L1208-L1211 | train | Detaches the specified tag from the API. | [
30522,
13366,
20010,
6776,
1035,
2013,
1035,
17928,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
17928,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
2065,
1035,
2674,
1010,
7661,
1035,
20346,
30524,
8909,
1010,
2065,
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/elements/select.rb | Watir.Select.select | def select(*str_or_rx)
results = str_or_rx.flatten.map { |v| select_by v }
results.first
end | ruby | def select(*str_or_rx)
results = str_or_rx.flatten.map { |v| select_by v }
results.first
end | [
"def",
"select",
"(",
"*",
"str_or_rx",
")",
"results",
"=",
"str_or_rx",
".",
"flatten",
".",
"map",
"{",
"|",
"v",
"|",
"select_by",
"v",
"}",
"results",
".",
"first",
"end"
] | Select the option whose text or label matches the given string.
@param [String, Regexp] str_or_rx
@raise [Watir::Exception::NoValueFoundException] if the value does not exist.
@return [String] The text of the option selected. If multiple options match, returns the first match. | [
"Select",
"the",
"option",
"whose",
"text",
"or",
"label",
"matches",
"the",
"given",
"string",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/elements/select.rb#L32-L35 | train | Select the first element of the list | [
30522,
13366,
7276,
1006,
1008,
2358,
2099,
1035,
2030,
1035,
1054,
2595,
1007,
3463,
1027,
2358,
2099,
1035,
2030,
1035,
1054,
2595,
1012,
4257,
6528,
1012,
4949,
1063,
1064,
1058,
1064,
7276,
1035,
2011,
1058,
1065,
3463,
1012,
2034,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-glacier/lib/aws-sdk-glacier/multipart_upload.rb | Aws::Glacier.MultipartUpload.complete | def complete(options = {})
options = options.merge(
account_id: @account_id,
vault_name: @vault_name,
upload_id: @id
)
resp = @client.complete_multipart_upload(options)
resp.data
end | ruby | def complete(options = {})
options = options.merge(
account_id: @account_id,
vault_name: @vault_name,
upload_id: @id
)
resp = @client.complete_multipart_upload(options)
resp.data
end | [
"def",
"complete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"account_id",
":",
"@account_id",
",",
"vault_name",
":",
"@vault_name",
",",
"upload_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"complete_multipar... | @example Request syntax with placeholder values
multipart_upload.complete({
archive_size: 1,
checksum: "string",
})
@param [Hash] options ({})
@option options [Integer] :archive_size
The total size, in bytes, of the entire archive. This value should be
the sum of all the sizes of the individual parts that you uploaded.
@option options [String] :checksum
The SHA256 tree hash of the entire archive. It is the tree hash of
SHA256 tree hash of the individual parts. If the value you specify in
the request does not match the SHA256 tree hash of the final assembled
archive as computed by Amazon Glacier, Amazon Glacier returns an error
and the request fails.
@return [Types::ArchiveCreationOutput] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-glacier/lib/aws-sdk-glacier/multipart_upload.rb#L236-L244 | train | Complete the multipart upload | [
30522,
13366,
3143,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
4070,
1035,
8909,
1024,
1030,
4070,
1035,
8909,
1010,
11632,
1035,
2171,
1024,
1030,
11632,
1035,
2171,
1010,
2039,
11066,
1035,
8909,
1024,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb | Azure::Resources::Mgmt::V2016_02_01.Resources.delete_with_http_info | def delete_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:nil)
delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"resource_provider_namespace",
",",
"parent_resource_path",
",",
"resource_type",
",",
"resource_name",
",",
"api_version",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
... | Delete resource and all of its resources.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param resource_provider_namespace [String] Resource identity.
@param parent_resource_path [String] Resource identity.
@param resource_type [String] Resource identity.
@param resource_name [String] Resource identity.
@param api_version [String]
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Delete",
"resource",
"and",
"all",
"of",
"its",
"resources",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb#L298-L300 | train | Deletes a resource from the specified resource group. | [
30522,
13366,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
10802,
1035,
3415,
15327,
1010,
6687,
1035,
7692,
1035,
4130,
1010,
7692,
1035,
2828,
1010,
7692,
1035,
2171,
1010,
17928,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mhenrixon/sidekiq-unique-jobs | lib/sidekiq_unique_jobs/locksmith.rb | SidekiqUniqueJobs.Locksmith.locked? | def locked?(token = nil)
token ||= jid
convert_legacy_lock(token)
redis(redis_pool) { |conn| conn.hexists(grabbed_key, token) }
end | ruby | def locked?(token = nil)
token ||= jid
convert_legacy_lock(token)
redis(redis_pool) { |conn| conn.hexists(grabbed_key, token) }
end | [
"def",
"locked?",
"(",
"token",
"=",
"nil",
")",
"token",
"||=",
"jid",
"convert_legacy_lock",
"(",
"token",
")",
"redis",
"(",
"redis_pool",
")",
"{",
"|",
"conn",
"|",
"conn",
".",
"hexists",
"(",
"grabbed_key",
",",
"token",
")",
"}",
"end"
] | @param [String] token the unique token to check for a lock.
nil will default to the jid provided in the initializer
@return [true, false]
Checks if this instance is considered locked
@param [<type>] token <description>
@return [<type>] <description> | [
"@param",
"[",
"String",
"]",
"token",
"the",
"unique",
"token",
"to",
"check",
"for",
"a",
"lock",
".",
"nil",
"will",
"default",
"to",
"the",
"jid",
"provided",
"in",
"the",
"initializer",
"@return",
"[",
"true",
"false",
"]"
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/locksmith.rb#L113-L118 | train | Returns whether the lock is currently locked. | [
30522,
13366,
5299,
1029,
1006,
19204,
1027,
9152,
2140,
1007,
19204,
1064,
1064,
1027,
10147,
2094,
10463,
1035,
8027,
1035,
5843,
1006,
19204,
1007,
2417,
2483,
1006,
2417,
2483,
1035,
4770,
1007,
1063,
1064,
9530,
2078,
1064,
9530,
2078,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
httprb/http | lib/http/chainable.rb | HTTP.Chainable.basic_auth | def basic_auth(opts)
user = opts.fetch :user
pass = opts.fetch :pass
auth("Basic " + Base64.strict_encode64("#{user}:#{pass}"))
end | ruby | def basic_auth(opts)
user = opts.fetch :user
pass = opts.fetch :pass
auth("Basic " + Base64.strict_encode64("#{user}:#{pass}"))
end | [
"def",
"basic_auth",
"(",
"opts",
")",
"user",
"=",
"opts",
".",
"fetch",
":user",
"pass",
"=",
"opts",
".",
"fetch",
":pass",
"auth",
"(",
"\"Basic \"",
"+",
"Base64",
".",
"strict_encode64",
"(",
"\"#{user}:#{pass}\"",
")",
")",
"end"
] | Make a request with the given Basic authorization header
@see http://tools.ietf.org/html/rfc2617
@param [#fetch] opts
@option opts [#to_s] :user
@option opts [#to_s] :pass | [
"Make",
"a",
"request",
"with",
"the",
"given",
"Basic",
"authorization",
"header"
] | f37a10ea4fab3ee411907ea2e4251ddf0ca33a93 | https://github.com/httprb/http/blob/f37a10ea4fab3ee411907ea2e4251ddf0ca33a93/lib/http/chainable.rb#L211-L216 | train | basic auth | [
30522,
13366,
3937,
1035,
8740,
2705,
1006,
23569,
2015,
1007,
5310,
1027,
23569,
2015,
1012,
18584,
1024,
5310,
3413,
1027,
23569,
2015,
1012,
18584,
1024,
3413,
8740,
2705,
1006,
1000,
3937,
1000,
1009,
2918,
21084,
1012,
9384,
1035,
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... |
meew0/discordrb | lib/discordrb/data/channel.rb | Discordrb.Channel.prune | def prune(amount, strict = false, &block)
raise ArgumentError, 'Can only delete between 1 and 100 messages!' unless amount.between?(1, 100)
messages =
if block_given?
history(amount).select(&block).map(&:id)
else
history_ids(amount)
end
case messages.size
when 0
0
when 1
API::Channel.delete_message(@bot.token, @id, messages.first)
1
else
bulk_delete(messages, strict)
end
end | ruby | def prune(amount, strict = false, &block)
raise ArgumentError, 'Can only delete between 1 and 100 messages!' unless amount.between?(1, 100)
messages =
if block_given?
history(amount).select(&block).map(&:id)
else
history_ids(amount)
end
case messages.size
when 0
0
when 1
API::Channel.delete_message(@bot.token, @id, messages.first)
1
else
bulk_delete(messages, strict)
end
end | [
"def",
"prune",
"(",
"amount",
",",
"strict",
"=",
"false",
",",
"&",
"block",
")",
"raise",
"ArgumentError",
",",
"'Can only delete between 1 and 100 messages!'",
"unless",
"amount",
".",
"between?",
"(",
"1",
",",
"100",
")",
"messages",
"=",
"if",
"block_gi... | Delete the last N messages on this channel.
@param amount [Integer] The amount of message history to consider for pruning. Must be a value between 2 and 100 (Discord limitation)
@param strict [true, false] Whether an error should be raised when a message is reached that is too old to be bulk
deleted. If this is false only a warning message will be output to the console.
@raise [ArgumentError] if the amount of messages is not a value between 2 and 100
@yield [message] Yields each message in this channels history for filtering the messages to delete
@example Pruning messages from a specific user ID
channel.prune(100) { |m| m.author.id == 83283213010599936 }
@return [Integer] The amount of messages that were successfully deleted | [
"Delete",
"the",
"last",
"N",
"messages",
"on",
"this",
"channel",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/channel.rb#L570-L589 | train | Delete messages from the channel. | [
30522,
13366,
10975,
9816,
1006,
3815,
1010,
9384,
1027,
6270,
1010,
1004,
3796,
1007,
5333,
6685,
2121,
29165,
1010,
1005,
2064,
2069,
3972,
12870,
2090,
1015,
1998,
2531,
7696,
999,
1005,
4983,
3815,
1012,
2090,
1029,
1006,
1015,
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/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.list_hosting_environment_detector_responses | def list_hosting_environment_detector_responses(resource_group_name, name, custom_headers:nil)
first_page = list_hosting_environment_detector_responses_as_lazy(resource_group_name, name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_hosting_environment_detector_responses(resource_group_name, name, custom_headers:nil)
first_page = list_hosting_environment_detector_responses_as_lazy(resource_group_name, name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_hosting_environment_detector_responses",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_hosting_environment_detector_responses_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":c... | List Hosting Environment Detector Responses
List Hosting Environment Detector Responses
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Site Name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<DetectorResponse>] operation results. | [
"List",
"Hosting",
"Environment",
"Detector",
"Responses"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L37-L40 | train | Gets all the detected applications in a hosting environment. | [
30522,
13366,
2862,
1035,
9936,
1035,
4044,
1035,
19034,
1035,
10960,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
9936,
1035,
4044,
1035,
19034,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.h1 | def h1(name, identifier={:index => 0}, &block)
standard_methods(name, identifier,'h1_for', &block)
define_method(name) do
return platform.h1_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | ruby | def h1(name, identifier={:index => 0}, &block)
standard_methods(name, identifier,'h1_for', &block)
define_method(name) do
return platform.h1_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | [
"def",
"h1",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'h1_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
"return",
"platfor... | adds three methods - one to retrieve the text of a h1 element, another to
retrieve a h1 element, and another to check for it's existence.
@example
h1(:title, :id => 'title')
# will generate 'title', 'title_element', and 'title?' methods
@param [Symbol] the name used for the generated methods
@param [Hash] identifier how we find a H1. You can use a multiple parameters
by combining of any of the following except xpath.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"text",
"of",
"a",
"h1",
"element",
"another",
"to",
"retrieve",
"a",
"h1",
"element",
"and",
"another",
"to",
"check",
"for",
"it",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L662-L668 | train | Creates a new H1 element. | [
30522,
13366,
1044,
2487,
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,
1044,
2487,
1035,
2005,
1005,
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... |
danger/danger | lib/danger/plugin_support/gems_resolver.rb | Danger.GemsResolver.call | def call
path_gems = []
Bundler.with_clean_env do
Dir.chdir(dir) do
create_gemfile_from_gem_names
`bundle install --path vendor/gems`
path_gems = all_gems_metadata
end
end
return path_gems
end | ruby | def call
path_gems = []
Bundler.with_clean_env do
Dir.chdir(dir) do
create_gemfile_from_gem_names
`bundle install --path vendor/gems`
path_gems = all_gems_metadata
end
end
return path_gems
end | [
"def",
"call",
"path_gems",
"=",
"[",
"]",
"Bundler",
".",
"with_clean_env",
"do",
"Dir",
".",
"chdir",
"(",
"dir",
")",
"do",
"create_gemfile_from_gem_names",
"`",
"`",
"path_gems",
"=",
"all_gems_metadata",
"end",
"end",
"return",
"path_gems",
"end"
] | Returns an Array of paths (plugin lib file paths) and gems (of metadata) | [
"Returns",
"an",
"Array",
"of",
"paths",
"(",
"plugin",
"lib",
"file",
"paths",
")",
"and",
"gems",
"(",
"of",
"metadata",
")"
] | 0d6d09f2d949c287fe75202d947374042b0679f4 | https://github.com/danger/danger/blob/0d6d09f2d949c287fe75202d947374042b0679f4/lib/danger/plugin_support/gems_resolver.rb#L11-L23 | train | Call the gem install command | [
30522,
13366,
2655,
4130,
1035,
20296,
1027,
1031,
1033,
14012,
2099,
1012,
2007,
1035,
4550,
1035,
4372,
2615,
2079,
16101,
1012,
10381,
4305,
2099,
1006,
16101,
1007,
2079,
3443,
1035,
17070,
8873,
2571,
1035,
2013,
1035,
17070,
1035,
341... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
norman/friendly_id | lib/friendly_id/configuration.rb | FriendlyId.Configuration.use | def use(*modules)
modules.to_a.flatten.compact.map do |object|
mod = get_module(object)
mod.setup(@model_class) if mod.respond_to?(:setup)
@model_class.send(:include, mod) unless uses? object
end
end | ruby | def use(*modules)
modules.to_a.flatten.compact.map do |object|
mod = get_module(object)
mod.setup(@model_class) if mod.respond_to?(:setup)
@model_class.send(:include, mod) unless uses? object
end
end | [
"def",
"use",
"(",
"*",
"modules",
")",
"modules",
".",
"to_a",
".",
"flatten",
".",
"compact",
".",
"map",
"do",
"|",
"object",
"|",
"mod",
"=",
"get_module",
"(",
"object",
")",
"mod",
".",
"setup",
"(",
"@model_class",
")",
"if",
"mod",
".",
"re... | Lets you specify the addon modules to use with FriendlyId.
This method is invoked by {FriendlyId::Base#friendly_id friendly_id} when
passing the `:use` option, or when using {FriendlyId::Base#friendly_id
friendly_id} with a block.
@example
class Book < ActiveRecord::Base
extend FriendlyId
friendly_id :name, :use => :slugged
end
@param [#to_s,Module] modules Arguments should be Modules, or symbols or
strings that correspond with the name of an addon to use with FriendlyId.
By default FriendlyId provides `:slugged`, `:history`, `:simple_i18n`,
and `:scoped`. | [
"Lets",
"you",
"specify",
"the",
"addon",
"modules",
"to",
"use",
"with",
"FriendlyId",
"."
] | 67422c04e1bfed4207b2a04826bc67ec0e231ce7 | https://github.com/norman/friendly_id/blob/67422c04e1bfed4207b2a04826bc67ec0e231ce7/lib/friendly_id/configuration.rb#L52-L58 | train | Use the given modules | [
30522,
13366,
2224,
1006,
1008,
14184,
1007,
14184,
1012,
2000,
1035,
1037,
1012,
4257,
6528,
1012,
9233,
1012,
4949,
2079,
1064,
4874,
1064,
16913,
1027,
2131,
1035,
11336,
1006,
4874,
1007,
16913,
1012,
16437,
1006,
1030,
2944,
1035,
2465... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-07-07/generated/azure_mgmt_api_management/group_users.rb | Azure::ApiManagement::Mgmt::V2016_07_07.GroupUsers.remove_with_http_info | def remove_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers:nil)
remove_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value!
end | ruby | def remove_with_http_info(resource_group_name, service_name, group_id, uid, custom_headers:nil)
remove_async(resource_group_name, service_name, group_id, uid, custom_headers:custom_headers).value!
end | [
"def",
"remove_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"group_id",
",",
"uid",
",",
"custom_headers",
":",
"nil",
")",
"remove_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"group_id",
",",
"uid",
",",
"custom_headers",... | Remove existing user from existing group.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param group_id [String] Group identifier. Must be unique in the current API
Management service instance.
@param uid [String] User identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Remove",
"existing",
"user",
"from",
"existing",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-07-07/generated/azure_mgmt_api_management/group_users.rb#L336-L338 | train | Removes the specified resource from the group. | [
30522,
13366,
6366,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
2177,
1035,
8909,
1010,
21318,
2094,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
6366,
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... |
dry-rb/dry-initializer | lib/dry/initializer/dsl.rb | Dry::Initializer.DSL.define | def define(procedure = nil, &block)
config = Config.new(null: null)
config.instance_exec(&(procedure || block))
config.mixin.include Mixin::Root
config.mixin
end | ruby | def define(procedure = nil, &block)
config = Config.new(null: null)
config.instance_exec(&(procedure || block))
config.mixin.include Mixin::Root
config.mixin
end | [
"def",
"define",
"(",
"procedure",
"=",
"nil",
",",
"&",
"block",
")",
"config",
"=",
"Config",
".",
"new",
"(",
"null",
":",
"null",
")",
"config",
".",
"instance_exec",
"(",
"(",
"procedure",
"||",
"block",
")",
")",
"config",
".",
"mixin",
".",
... | Returns mixin module to be included to target class by hand
@return [Module]
@yield proc defining params and options | [
"Returns",
"mixin",
"module",
"to",
"be",
"included",
"to",
"target",
"class",
"by",
"hand"
] | 422d331468602ff0d3543fbb336b784343e5cc31 | https://github.com/dry-rb/dry-initializer/blob/422d331468602ff0d3543fbb336b784343e5cc31/lib/dry/initializer/dsl.rb#L24-L29 | train | Define a new mixin | [
30522,
13366,
9375,
1006,
7709,
1027,
9152,
2140,
1010,
1004,
3796,
1007,
9530,
8873,
2290,
1027,
9530,
8873,
2290,
1012,
2047,
1006,
19701,
1024,
19701,
1007,
9530,
8873,
2290,
1012,
6013,
1035,
4654,
8586,
1006,
1004,
1006,
7709,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_application_manifest | def get_application_manifest(application_type_name, application_type_version, timeout:60, custom_headers:nil)
response = get_application_manifest_async(application_type_name, application_type_version, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_application_manifest(application_type_name, application_type_version, timeout:60, custom_headers:nil)
response = get_application_manifest_async(application_type_name, application_type_version, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_application_manifest",
"(",
"application_type_name",
",",
"application_type_version",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_application_manifest_async",
"(",
"application_type_name",
",",
"application_type_versi... | Gets the manifest describing an application type.
Gets the manifest describing an application type. The response contains the
application manifest XML as a string.
@param application_type_name [String] The name of the application type.
@param application_type_version [String] The version of the application type.
@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 [ApplicationTypeManifest] operation results. | [
"Gets",
"the",
"manifest",
"describing",
"an",
"application",
"type",
"."
] | 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#L9563-L9566 | train | Gets the manifest of the specified application type. | [
30522,
13366,
2131,
1035,
4646,
1035,
19676,
1006,
4646,
1035,
2828,
1035,
2171,
1010,
4646,
1035,
2828,
1035,
2544,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
4646,
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... |
mojombo/chronic | lib/chronic/handlers.rb | Chronic.Handlers.handle_rmn_od | def handle_rmn_od(tokens, options)
month = tokens[0].get_tag(RepeaterMonthName)
day = tokens[1].get_tag(OrdinalDay).type
return if month_overflow?(self.now.year, month.index, day)
handle_m_d(month, day, tokens[2..tokens.size], options)
end | ruby | def handle_rmn_od(tokens, options)
month = tokens[0].get_tag(RepeaterMonthName)
day = tokens[1].get_tag(OrdinalDay).type
return if month_overflow?(self.now.year, month.index, day)
handle_m_d(month, day, tokens[2..tokens.size], options)
end | [
"def",
"handle_rmn_od",
"(",
"tokens",
",",
"options",
")",
"month",
"=",
"tokens",
"[",
"0",
"]",
".",
"get_tag",
"(",
"RepeaterMonthName",
")",
"day",
"=",
"tokens",
"[",
"1",
"]",
".",
"get_tag",
"(",
"OrdinalDay",
")",
".",
"type",
"return",
"if",
... | Handle repeater-month-name/ordinal-day | [
"Handle",
"repeater",
"-",
"month",
"-",
"name",
"/",
"ordinal",
"-",
"day"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L44-L51 | train | Handle the RMN OD tokens | [
30522,
13366,
5047,
1035,
28549,
2078,
1035,
1051,
2094,
1006,
19204,
2015,
1010,
7047,
1007,
3204,
1027,
19204,
2015,
1031,
1014,
1033,
1012,
2131,
1035,
6415,
1006,
9377,
2121,
9629,
7295,
14074,
1007,
2154,
1027,
19204,
2015,
1031,
1015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.query_watermark_offsets | def query_watermark_offsets(topic, partition, timeout_ms=200)
low = FFI::MemoryPointer.new(:int64, 1)
high = FFI::MemoryPointer.new(:int64, 1)
response = Rdkafka::Bindings.rd_kafka_query_watermark_offsets(
@native_kafka,
topic,
partition,
low,
high,
timeout_ms
)
if response != 0
raise Rdkafka::RdkafkaError.new(response, "Error querying watermark offsets for partition #{partition} of #{topic}")
end
return low.read_int64, high.read_int64
end | ruby | def query_watermark_offsets(topic, partition, timeout_ms=200)
low = FFI::MemoryPointer.new(:int64, 1)
high = FFI::MemoryPointer.new(:int64, 1)
response = Rdkafka::Bindings.rd_kafka_query_watermark_offsets(
@native_kafka,
topic,
partition,
low,
high,
timeout_ms
)
if response != 0
raise Rdkafka::RdkafkaError.new(response, "Error querying watermark offsets for partition #{partition} of #{topic}")
end
return low.read_int64, high.read_int64
end | [
"def",
"query_watermark_offsets",
"(",
"topic",
",",
"partition",
",",
"timeout_ms",
"=",
"200",
")",
"low",
"=",
"FFI",
"::",
"MemoryPointer",
".",
"new",
"(",
":int64",
",",
"1",
")",
"high",
"=",
"FFI",
"::",
"MemoryPointer",
".",
"new",
"(",
":int64"... | Query broker for low (oldest/beginning) and high (newest/end) offsets for a partition.
@param topic [String] The topic to query
@param partition [Integer] The partition to query
@param timeout_ms [Integer] The timeout for querying the broker
@raise [RdkafkaError] When querying the broker fails.
@return [Integer] The low and high watermark | [
"Query",
"broker",
"for",
"low",
"(",
"oldest",
"/",
"beginning",
")",
"and",
"high",
"(",
"newest",
"/",
"end",
")",
"offsets",
"for",
"a",
"partition",
"."
] | 87b3e0ddae5ea576847cb67228fcea06ec2a24d6 | https://github.com/appsignal/rdkafka-ruby/blob/87b3e0ddae5ea576847cb67228fcea06ec2a24d6/lib/rdkafka/consumer.rb#L188-L205 | train | Query watermark offsets for a topic and partition | [
30522,
13366,
23032,
1035,
2300,
10665,
1035,
16396,
2015,
1006,
8476,
1010,
13571,
1010,
2051,
5833,
1035,
5796,
1027,
3263,
1007,
2659,
1027,
21461,
2072,
1024,
1024,
3638,
8400,
2121,
1012,
2047,
1006,
1024,
20014,
21084,
1010,
1015,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/quota_by_period_keys.rb | Azure::ApiManagement::Mgmt::V2018_01_01.QuotaByPeriodKeys.update_with_http_info | def update_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:nil)
update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:nil)
update_async(resource_group_name, service_name, quota_counter_key, quota_period_key, parameters, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"quota_counter_key",
",",
"quota_period_key",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"quota_co... | Updates an existing quota counter value 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 quota_counter_key [String] Quota counter key identifier.This is the
result of expression defined in counter-key attribute of the quota-by-key
policy.For Example, if you specify counter-key="boo" in the policy, then it’s
accessible by "boo" counter key. But if it’s defined as
counter-key="@("b"+"a")" then it will be accessible by "ba" key
@param quota_period_key [String] Quota period key identifier.
@param parameters [QuotaCounterValueContractProperties] The value of the
Quota counter to be applied on the specified period.
@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",
"an",
"existing",
"quota",
"counter",
"value",
"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/quota_by_period_keys.rb#L182-L184 | train | Updates a service s quota specification. | [
30522,
13366,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
20563,
1035,
4675,
1035,
3145,
1010,
20563,
1035,
2558,
1035,
3145,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/db_parameter_group_family.rb | Aws::RDS.DBParameterGroupFamily.engine_default_parameters | def engine_default_parameters(options = {})
batches = Enumerator.new do |y|
options = options.merge(db_parameter_group_family: @name)
resp = @client.describe_engine_default_parameters(options)
resp.each_page do |page|
batch = []
page.data.engine_defaults.parameters.each do |p|
batch << Parameter.new(
name: p.parameter_name,
data: p,
client: @client
)
end
y.yield(batch)
end
end
Parameter::Collection.new(batches)
end | ruby | def engine_default_parameters(options = {})
batches = Enumerator.new do |y|
options = options.merge(db_parameter_group_family: @name)
resp = @client.describe_engine_default_parameters(options)
resp.each_page do |page|
batch = []
page.data.engine_defaults.parameters.each do |p|
batch << Parameter.new(
name: p.parameter_name,
data: p,
client: @client
)
end
y.yield(batch)
end
end
Parameter::Collection.new(batches)
end | [
"def",
"engine_default_parameters",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"options",
"=",
"options",
".",
"merge",
"(",
"db_parameter_group_family",
":",
"@name",
")",
"resp",
"=",
"@client",
"."... | @example Request syntax with placeholder values
engine_default_parameters = db_parameter_group_family.engine_default_parameters({
filters: [
{
name: "String", # required
values: ["String"], # required
},
],
})
@param [Hash] options ({})
@option options [Array<Types::Filter>] :filters
This parameter is not currently supported.
@return [Parameter::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_parameter_group_family.rb#L219-L236 | train | Returns a list of all engine default parameters | [
30522,
13366,
3194,
1035,
12398,
1035,
11709,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
7047,
1027,
7047,
1012,
13590,
1006,
16962,
1035,
16381,
1035,
2177,
1035,
2155,
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/api/labor_api.rb | SquareConnect.LaborApi.get_break_type | def get_break_type(id, opts = {})
data, _status_code, _headers = get_break_type_with_http_info(id, opts)
return data
end | ruby | def get_break_type(id, opts = {})
data, _status_code, _headers = get_break_type_with_http_info(id, opts)
return data
end | [
"def",
"get_break_type",
"(",
"id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"get_break_type_with_http_info",
"(",
"id",
",",
"opts",
")",
"return",
"data",
"end"
] | GetBreakType
Returns a single `BreakType` specified by id.
@param id UUID for the `BreakType` being retrieved.
@param [Hash] opts the optional parameters
@return [GetBreakTypeResponse] | [
"GetBreakType",
"Returns",
"a",
"single",
"BreakType",
"specified",
"by",
"id",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/labor_api.rb#L245-L248 | train | Returns the break type with the specified ID. | [
30522,
13366,
2131,
1035,
3338,
1035,
2828,
1006,
8909,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
2131,
1035,
3338,
1035,
2828,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Katello/katello | app/models/katello/rhsm_fact_parser.rb | Katello.RhsmFactParser.get_interfaces | def get_interfaces
mac_keys = facts.keys.select { |f| f =~ /net\.interface\..*\.mac_address/ }
names = mac_keys.map do |key|
key.sub('net.interface.', '').sub('.mac_address', '') if facts[key] != 'none'
end
names.compact
end | ruby | def get_interfaces
mac_keys = facts.keys.select { |f| f =~ /net\.interface\..*\.mac_address/ }
names = mac_keys.map do |key|
key.sub('net.interface.', '').sub('.mac_address', '') if facts[key] != 'none'
end
names.compact
end | [
"def",
"get_interfaces",
"mac_keys",
"=",
"facts",
".",
"keys",
".",
"select",
"{",
"|",
"f",
"|",
"f",
"=~",
"/",
"\\.",
"\\.",
"\\.",
"/",
"}",
"names",
"=",
"mac_keys",
".",
"map",
"do",
"|",
"key",
"|",
"key",
".",
"sub",
"(",
"'net.interface.'... | rubocop:disable Naming/AccessorMethodName: | [
"rubocop",
":",
"disable",
"Naming",
"/",
"AccessorMethodName",
":"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/rhsm_fact_parser.rb#L41-L47 | train | Get the interfaces that are available on the network. | [
30522,
13366,
2131,
1035,
19706,
6097,
1035,
6309,
1027,
8866,
1012,
6309,
1012,
7276,
1063,
1064,
1042,
1064,
1042,
1027,
1066,
1013,
5658,
1032,
1012,
8278,
1032,
1012,
1012,
1008,
1032,
1012,
6097,
1035,
4769,
1013,
1065,
3415,
1027,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_wans.rb | Azure::Network::Mgmt::V2018_07_01.VirtualWANs.delete | def delete(resource_group_name, virtual_wanname, custom_headers:nil)
response = delete_async(resource_group_name, virtual_wanname, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, virtual_wanname, custom_headers:nil)
response = delete_async(resource_group_name, virtual_wanname, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"virtual_wanname",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"virtual_wanname",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"en... | Deletes a VirtualWAN.
@param resource_group_name [String] The resource group name of the
VirtualWan.
@param virtual_wanname [String] The name of the VirtualWAN being deleted.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"a",
"VirtualWAN",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_wans.rb#L227-L230 | train | Deletes a virtual wan. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
10587,
4168,
1010,
30524,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
9152,
2140,
2203,
102,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/models/create_checkout_request.rb | SquareConnect.CreateCheckoutRequest.note= | def note=(note)
if !note.nil? && note.to_s.length > 60
fail ArgumentError, "invalid value for 'note', the character length must be smaller than or equal to 60."
end
@note = note
end | ruby | def note=(note)
if !note.nil? && note.to_s.length > 60
fail ArgumentError, "invalid value for 'note', the character length must be smaller than or equal to 60."
end
@note = note
end | [
"def",
"note",
"=",
"(",
"note",
")",
"if",
"!",
"note",
".",
"nil?",
"&&",
"note",
".",
"to_s",
".",
"length",
">",
"60",
"fail",
"ArgumentError",
",",
"\"invalid value for 'note', the character length must be smaller than or equal to 60.\"",
"end",
"@note",
"=",
... | Custom attribute writer method with validation
@param [Object] note Value to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"with",
"validation"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/create_checkout_request.rb#L227-L234 | train | Sets the note of the message. | [
30522,
13366,
3602,
1027,
1006,
3602,
1007,
2065,
999,
3602,
1012,
9152,
2140,
1029,
1004,
1004,
3602,
1012,
2000,
1035,
1055,
1012,
3091,
1028,
3438,
8246,
6685,
2121,
29165,
1010,
1000,
19528,
3643,
2005,
1005,
3602,
1005,
1010,
1996,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sunspot/sunspot | sunspot/lib/sunspot/setup.rb | Sunspot.Setup.stored_fields | def stored_fields(field_name, dynamic_field_name = nil)
@stored_field_factories_cache[field_name.to_sym].map do |field_factory|
if dynamic_field_name
field_factory.build(dynamic_field_name)
else
field_factory.build
end
end
end | ruby | def stored_fields(field_name, dynamic_field_name = nil)
@stored_field_factories_cache[field_name.to_sym].map do |field_factory|
if dynamic_field_name
field_factory.build(dynamic_field_name)
else
field_factory.build
end
end
end | [
"def",
"stored_fields",
"(",
"field_name",
",",
"dynamic_field_name",
"=",
"nil",
")",
"@stored_field_factories_cache",
"[",
"field_name",
".",
"to_sym",
"]",
".",
"map",
"do",
"|",
"field_factory",
"|",
"if",
"dynamic_field_name",
"field_factory",
".",
"build",
"... | Return one or more stored fields (can be either attribute or text fields)
for the given name. | [
"Return",
"one",
"or",
"more",
"stored",
"fields",
"(",
"can",
"be",
"either",
"attribute",
"or",
"text",
"fields",
")",
"for",
"the",
"given",
"name",
"."
] | 31dd76cd7a14a4ef7bd541de97483d8cd72ff685 | https://github.com/sunspot/sunspot/blob/31dd76cd7a14a4ef7bd541de97483d8cd72ff685/sunspot/lib/sunspot/setup.rb#L153-L161 | train | Returns the fields that are stored in the cache. | [
30522,
13366,
8250,
1035,
4249,
1006,
2492,
1035,
2171,
1010,
8790,
1035,
2492,
1035,
2171,
1027,
9152,
2140,
1007,
1030,
8250,
1035,
2492,
1035,
11123,
1035,
17053,
1031,
2492,
1035,
2171,
1012,
2000,
1035,
25353,
2213,
1033,
1012,
4949,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/config_server/variables_interpolator.rb | Bosh::Director::ConfigServer.VariablesInterpolator.interpolate_link_spec_properties | def interpolate_link_spec_properties(links_spec, consumer_variable_set)
if links_spec.nil?
return links_spec
end
errors = []
consumer_deployment_name = consumer_variable_set.deployment.name
links_spec_copy = Bosh::Common::DeepCopy.copy(links_spec)
links_spec_copy.each do |link_name, link_spec|
if link_spec.has_key?('properties') && !link_spec['properties'].nil?
begin
provider_deployment_name = link_spec['deployment_name']
if provider_deployment_name == consumer_deployment_name
interpolated_link_properties = @config_server_client.interpolate_with_versioning(link_spec['properties'], consumer_variable_set)
link_spec['properties'] = interpolated_link_properties
else
provider_deployment = get_deployment_by_name(provider_deployment_name)
provider_variable_set = provider_last_successful_variable_set(provider_deployment)
interpolated_link_properties = @config_server_client.interpolate_cross_deployment_link(link_spec['properties'], consumer_variable_set, provider_variable_set)
link_spec['properties'] = interpolated_link_properties
end
rescue Exception => e
header = "- Unable to interpolate link '#{link_name}' properties; provided by '#{link_spec['deployment_name']}' deployment. Errors are:"
errors << Bosh::Director::FormatterHelper.new.prepend_header_and_indent_body(header, e.message.strip, {:indent_by => 2})
end
end
end
raise errors.join("\n") unless errors.empty?
links_spec_copy
end | ruby | def interpolate_link_spec_properties(links_spec, consumer_variable_set)
if links_spec.nil?
return links_spec
end
errors = []
consumer_deployment_name = consumer_variable_set.deployment.name
links_spec_copy = Bosh::Common::DeepCopy.copy(links_spec)
links_spec_copy.each do |link_name, link_spec|
if link_spec.has_key?('properties') && !link_spec['properties'].nil?
begin
provider_deployment_name = link_spec['deployment_name']
if provider_deployment_name == consumer_deployment_name
interpolated_link_properties = @config_server_client.interpolate_with_versioning(link_spec['properties'], consumer_variable_set)
link_spec['properties'] = interpolated_link_properties
else
provider_deployment = get_deployment_by_name(provider_deployment_name)
provider_variable_set = provider_last_successful_variable_set(provider_deployment)
interpolated_link_properties = @config_server_client.interpolate_cross_deployment_link(link_spec['properties'], consumer_variable_set, provider_variable_set)
link_spec['properties'] = interpolated_link_properties
end
rescue Exception => e
header = "- Unable to interpolate link '#{link_name}' properties; provided by '#{link_spec['deployment_name']}' deployment. Errors are:"
errors << Bosh::Director::FormatterHelper.new.prepend_header_and_indent_body(header, e.message.strip, {:indent_by => 2})
end
end
end
raise errors.join("\n") unless errors.empty?
links_spec_copy
end | [
"def",
"interpolate_link_spec_properties",
"(",
"links_spec",
",",
"consumer_variable_set",
")",
"if",
"links_spec",
".",
"nil?",
"return",
"links_spec",
"end",
"errors",
"=",
"[",
"]",
"consumer_deployment_name",
"=",
"consumer_variable_set",
".",
"deployment",
".",
... | Note: The links properties will be interpolated in the context of the deployment that provides them
@param [Hash] links_spec Hash to be interpolated
@param [Bosh::Director::Models::VariableSet] consumer_variable_set
@return [Hash] A Deep copy of the interpolated links_spec. Only the properties for the links will be interpolated | [
"Note",
":",
"The",
"links",
"properties",
"will",
"be",
"interpolated",
"in",
"the",
"context",
"of",
"the",
"deployment",
"that",
"provides",
"them"
] | 2eaa7100879ddd20cd909cd698514746195e28b7 | https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/config_server/variables_interpolator.rb#L58-L91 | train | Interpolates the properties of a link spec | [
30522,
13366,
6970,
18155,
3686,
1035,
4957,
1035,
28699,
1035,
5144,
1006,
6971,
1035,
28699,
1010,
7325,
1035,
8023,
1035,
2275,
1007,
2065,
6971,
1035,
28699,
1012,
9152,
2140,
1029,
2709,
6971,
1035,
28699,
2203,
10697,
1027,
1031,
1033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/configuration.rb | HamlLint.Configuration.ensure_linter_include_exclude_arrays_exist | def ensure_linter_include_exclude_arrays_exist
@hash['linters'].each_key do |linter_name|
%w[include exclude].each do |option|
linter_config = @hash['linters'][linter_name]
linter_config[option] = Array(linter_config[option])
end
end
end | ruby | def ensure_linter_include_exclude_arrays_exist
@hash['linters'].each_key do |linter_name|
%w[include exclude].each do |option|
linter_config = @hash['linters'][linter_name]
linter_config[option] = Array(linter_config[option])
end
end
end | [
"def",
"ensure_linter_include_exclude_arrays_exist",
"@hash",
"[",
"'linters'",
"]",
".",
"each_key",
"do",
"|",
"linter_name",
"|",
"%w[",
"include",
"exclude",
"]",
".",
"each",
"do",
"|",
"option",
"|",
"linter_config",
"=",
"@hash",
"[",
"'linters'",
"]",
... | Ensure `include` and `exclude` options for linters are arrays
(since users can specify a single string glob pattern for convenience) | [
"Ensure",
"include",
"and",
"exclude",
"options",
"for",
"linters",
"are",
"arrays",
"(",
"since",
"users",
"can",
"specify",
"a",
"single",
"string",
"glob",
"pattern",
"for",
"convenience",
")"
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/configuration.rb#L116-L123 | train | Ensure that all linters include and exclude arrays exist | [
30522,
13366,
5676,
1035,
11409,
3334,
1035,
2421,
1035,
23329,
1035,
27448,
1035,
4839,
1030,
23325,
1031,
1005,
11409,
7747,
1005,
1033,
1012,
2169,
1035,
3145,
2079,
1064,
11409,
3334,
1035,
2171,
1064,
1003,
1059,
1031,
2421,
23329,
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... |
jekyll/jekyll | lib/jekyll/filters.rb | Jekyll.Filters.markdownify | def markdownify(input)
@context.registers[:site].find_converter_instance(
Jekyll::Converters::Markdown
).convert(input.to_s)
end | ruby | def markdownify(input)
@context.registers[:site].find_converter_instance(
Jekyll::Converters::Markdown
).convert(input.to_s)
end | [
"def",
"markdownify",
"(",
"input",
")",
"@context",
".",
"registers",
"[",
":site",
"]",
".",
"find_converter_instance",
"(",
"Jekyll",
"::",
"Converters",
"::",
"Markdown",
")",
".",
"convert",
"(",
"input",
".",
"to_s",
")",
"end"
] | Convert a Markdown string into HTML output.
input - The Markdown String to convert.
Returns the HTML formatted String. | [
"Convert",
"a",
"Markdown",
"string",
"into",
"HTML",
"output",
"."
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/filters.rb#L16-L20 | train | Convert a markdown string to a markdown string. | [
30522,
13366,
2928,
7698,
8757,
1006,
7953,
1007,
1030,
6123,
1012,
18687,
1031,
1024,
2609,
1033,
1012,
2424,
1035,
10463,
2121,
1035,
6013,
1006,
15333,
4801,
3363,
1024,
1024,
10463,
2545,
1024,
1024,
2928,
7698,
1007,
1012,
10463,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/sprockets | lib/sprockets/uri_utils.rb | Sprockets.URIUtils.join_file_uri | def join_file_uri(scheme, host, path, query)
str = String.new("#{scheme}://")
str << host if host
path = "/#{path}" unless path.start_with?("/".freeze)
str << URI::Generic::DEFAULT_PARSER.escape(path)
str << "?#{query}" if query
str
end | ruby | def join_file_uri(scheme, host, path, query)
str = String.new("#{scheme}://")
str << host if host
path = "/#{path}" unless path.start_with?("/".freeze)
str << URI::Generic::DEFAULT_PARSER.escape(path)
str << "?#{query}" if query
str
end | [
"def",
"join_file_uri",
"(",
"scheme",
",",
"host",
",",
"path",
",",
"query",
")",
"str",
"=",
"String",
".",
"new",
"(",
"\"#{scheme}://\"",
")",
"str",
"<<",
"host",
"if",
"host",
"path",
"=",
"\"/#{path}\"",
"unless",
"path",
".",
"start_with?",
"(",... | Internal: Join file: URI component parts into String.
Returns String. | [
"Internal",
":",
"Join",
"file",
":",
"URI",
"component",
"parts",
"into",
"String",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/uri_utils.rb#L62-L69 | train | Returns a string with the given scheme host path and query | [
30522,
13366,
3693,
1035,
5371,
1035,
24471,
2072,
1006,
5679,
1010,
3677,
1010,
4130,
1010,
23032,
1007,
2358,
2099,
1027,
5164,
1012,
2047,
1006,
1000,
1001,
1063,
5679,
1065,
1024,
1013,
1013,
1000,
1007,
2358,
2099,
1026,
1026,
3677,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_key_vault/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb | Azure::KeyVault::Mgmt::V2018_02_14.Vaults.check_name_availability | def check_name_availability(vault_name, custom_headers:nil)
response = check_name_availability_async(vault_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def check_name_availability(vault_name, custom_headers:nil)
response = check_name_availability_async(vault_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"check_name_availability",
"(",
"vault_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"check_name_availability_async",
"(",
"vault_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response... | Checks that the vault name is valid and is not already in use.
@param vault_name [VaultCheckNameAvailabilityParameters] The name of the
vault.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CheckNameAvailabilityResult] operation results. | [
"Checks",
"that",
"the",
"vault",
"name",
"is",
"valid",
"and",
"is",
"not",
"already",
"in",
"use",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_key_vault/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb#L999-L1002 | train | Checks if the name of the specified vault is available for use. | [
30522,
13366,
4638,
1035,
2171,
1035,
11343,
1006,
11632,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4638,
1035,
2171,
1035,
11343,
1035,
2004,
6038,
2278,
1006,
11632,
1035,
2171,
1010,
7661,
1035,
20346... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_partition_replicas_event_list_with_http_info | def get_partition_replicas_event_list_with_http_info(partition_id, start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
get_partition_replicas_event_list_async(partition_id, start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
end | ruby | def get_partition_replicas_event_list_with_http_info(partition_id, start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
get_partition_replicas_event_list_async(partition_id, start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
end | [
"def",
"get_partition_replicas_event_list_with_http_info",
"(",
"partition_id",
",",
"start_time_utc",
",",
"end_time_utc",
",",
"timeout",
":",
"60",
",",
"events_types_filter",
":",
"nil",
",",
"exclude_analysis_events",
":",
"nil",
",",
"skip_correlation_lookup",
":",
... | Gets all Replicas-related events for a Partition.
The response is list of ReplicaEvent objects.
@param partition_id The identity of the partition.
@param start_time_utc [String] The start time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param end_time_utc [String] The end time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@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 events_types_filter [String] This is a comma separated string
specifying the types of FabricEvents that should only be included in the
response.
@param exclude_analysis_events [Boolean] This param disables the retrieval of
AnalysisEvents if true is passed.
@param skip_correlation_lookup [Boolean] This param disables the search of
CorrelatedEvents information if true is passed. otherwise the
CorrelationEvents get processed and HasCorrelatedEvents field in every
FabricEvent gets populated.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"all",
"Replicas",
"-",
"related",
"events",
"for",
"a",
"Partition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L29056-L29058 | train | Gets the replicas of the specified partition. | [
30522,
13366,
2131,
1035,
13571,
1035,
15059,
2015,
1035,
2724,
1035,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
2707,
1035,
2051,
1035,
11396,
1010,
2203,
1035,
2051,
1035,
11396,
1010,
2051,
5833,
1024,
3438... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aasm/aasm | lib/aasm/localizer.rb | AASM.Localizer.i18n_klass | def i18n_klass(klass)
klass.model_name.respond_to?(:i18n_key) ? klass.model_name.i18n_key : klass.name.underscore
end | ruby | def i18n_klass(klass)
klass.model_name.respond_to?(:i18n_key) ? klass.model_name.i18n_key : klass.name.underscore
end | [
"def",
"i18n_klass",
"(",
"klass",
")",
"klass",
".",
"model_name",
".",
"respond_to?",
"(",
":i18n_key",
")",
"?",
"klass",
".",
"model_name",
".",
"i18n_key",
":",
"klass",
".",
"name",
".",
"underscore",
"end"
] | added for rails < 3.0.3 compatibility | [
"added",
"for",
"rails",
"<",
"3",
".",
"0",
".",
"3",
"compatibility"
] | 6a1000b489c6b2e205a7b142478a4b4e207c3dbd | https://github.com/aasm/aasm/blob/6a1000b489c6b2e205a7b142478a4b4e207c3dbd/lib/aasm/localizer.rb#L44-L46 | train | Returns the i18n_key for the given model | [
30522,
13366,
1045,
15136,
2078,
1035,
1047,
27102,
1006,
1047,
27102,
1007,
1047,
27102,
1012,
2944,
1035,
2171,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
1045,
15136,
2078,
1035,
3145,
1007,
1029,
1047,
27102,
1012,
2944,
1035,
2171,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | fastlane/lib/fastlane/server/socket_server.rb | Fastlane.SocketServer.send_response | def send_response(json)
UI.verbose("sending #{json}")
begin
@client.puts(json) # Send some json to the client
rescue Errno::EPIPE => e
UI.verbose(e)
return COMMAND_EXECUTION_STATE[:error]
end
return COMMAND_EXECUTION_STATE[:ready]
end | ruby | def send_response(json)
UI.verbose("sending #{json}")
begin
@client.puts(json) # Send some json to the client
rescue Errno::EPIPE => e
UI.verbose(e)
return COMMAND_EXECUTION_STATE[:error]
end
return COMMAND_EXECUTION_STATE[:ready]
end | [
"def",
"send_response",
"(",
"json",
")",
"UI",
".",
"verbose",
"(",
"\"sending #{json}\"",
")",
"begin",
"@client",
".",
"puts",
"(",
"json",
")",
"# Send some json to the client",
"rescue",
"Errno",
"::",
"EPIPE",
"=>",
"e",
"UI",
".",
"verbose",
"(",
"e",... | send json back to client | [
"send",
"json",
"back",
"to",
"client"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/server/socket_server.rb#L128-L137 | train | Send a response to the server | [
30522,
13366,
4604,
1035,
3433,
1006,
1046,
3385,
1007,
21318,
1012,
12034,
9232,
1006,
1000,
6016,
1001,
1063,
1046,
3385,
1065,
1000,
1007,
4088,
1030,
7396,
1012,
8509,
1006,
1046,
3385,
1007,
1001,
4604,
2070,
1046,
3385,
2000,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-git/ruby-git | lib/git/branches.rb | Git.Branches.[] | def [](branch_name)
@branches.values.inject(@branches) do |branches, branch|
branches[branch.full] ||= branch
# This is how Git (version 1.7.9.5) works.
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
branches[branch.full.sub('remotes/', '')] ||= branch if branch.full =~ /^remotes\/.+/
branches
end[branch_name.to_s]
end | ruby | def [](branch_name)
@branches.values.inject(@branches) do |branches, branch|
branches[branch.full] ||= branch
# This is how Git (version 1.7.9.5) works.
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
branches[branch.full.sub('remotes/', '')] ||= branch if branch.full =~ /^remotes\/.+/
branches
end[branch_name.to_s]
end | [
"def",
"[]",
"(",
"branch_name",
")",
"@branches",
".",
"values",
".",
"inject",
"(",
"@branches",
")",
"do",
"|",
"branches",
",",
"branch",
"|",
"branches",
"[",
"branch",
".",
"full",
"]",
"||=",
"branch",
"# This is how Git (version 1.7.9.5) works. ",
"# L... | Returns the target branch
Example:
Given (git branch -a):
master
remotes/working/master
g.branches['master'].full #=> 'master'
g.branches['working/master'].full => 'remotes/working/master'
g.branches['remotes/working/master'].full => 'remotes/working/master'
@param [#to_s] branch_name the target branch name.
@return [Git::Branch] the target branch. | [
"Returns",
"the",
"target",
"branch"
] | 9bd4407c56068e1604f14a1b6c0c5a84868e6378 | https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/branches.rb#L49-L59 | train | Returns the branch object for the given branch name. | [
30522,
13366,
1031,
1033,
1006,
3589,
1035,
2171,
1007,
1030,
5628,
1012,
5300,
1012,
1999,
20614,
1006,
1030,
5628,
1007,
2079,
1064,
5628,
1010,
3589,
1064,
5628,
1031,
3589,
1012,
2440,
1033,
1064,
1064,
1027,
3589,
1001,
2023,
2003,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
seejohnrun/ice_cube | lib/ice_cube/schedule.rb | IceCube.Schedule.last | def last(n = nil)
require_terminating_rules
occurrences = enumerate_occurrences(start_time).to_a
n.nil? ? occurrences.last : occurrences[-n..-1]
end | ruby | def last(n = nil)
require_terminating_rules
occurrences = enumerate_occurrences(start_time).to_a
n.nil? ? occurrences.last : occurrences[-n..-1]
end | [
"def",
"last",
"(",
"n",
"=",
"nil",
")",
"require_terminating_rules",
"occurrences",
"=",
"enumerate_occurrences",
"(",
"start_time",
")",
".",
"to_a",
"n",
".",
"nil?",
"?",
"occurrences",
".",
"last",
":",
"occurrences",
"[",
"-",
"n",
"..",
"-",
"1",
... | Get the final n occurrences of a terminating schedule
or the final one if no n is given | [
"Get",
"the",
"final",
"n",
"occurrences",
"of",
"a",
"terminating",
"schedule",
"or",
"the",
"final",
"one",
"if",
"no",
"n",
"is",
"given"
] | fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd | https://github.com/seejohnrun/ice_cube/blob/fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd/lib/ice_cube/schedule.rb#L306-L310 | train | Returns the last n occurrences of the rule | [
30522,
13366,
2197,
1006,
1050,
1027,
9152,
2140,
1007,
5478,
1035,
23552,
1035,
3513,
27247,
1027,
4372,
17897,
11657,
1035,
27247,
1006,
2707,
1035,
2051,
1007,
1012,
2000,
1035,
1037,
1050,
1012,
9152,
2140,
1029,
1029,
27247,
1012,
2197... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/dhcp_options.rb | Aws::EC2.DhcpOptions.associate_with_vpc | def associate_with_vpc(options = {})
options = options.merge(dhcp_options_id: @id)
resp = @client.associate_dhcp_options(options)
resp.data
end | ruby | def associate_with_vpc(options = {})
options = options.merge(dhcp_options_id: @id)
resp = @client.associate_dhcp_options(options)
resp.data
end | [
"def",
"associate_with_vpc",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"dhcp_options_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"associate_dhcp_options",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
dhcp_options.associate_with_vpc({
vpc_id: "String", # required
dry_run: false,
})
@param [Hash] options ({})
@option options [required, String] :vpc_id
The ID of the VPC.
@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/dhcp_options.rb#L199-L203 | train | Associate the DHCP options with a VPC | [
30522,
13366,
5482,
1035,
2007,
1035,
21210,
2278,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
28144,
21906,
1035,
7047,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
5482,
1035,
28144... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.center | def center
point = location
dimensions = size
Selenium::WebDriver::Point.new(point.x + (dimensions['width'] / 2),
point.y + (dimensions['height'] / 2))
end | ruby | def center
point = location
dimensions = size
Selenium::WebDriver::Point.new(point.x + (dimensions['width'] / 2),
point.y + (dimensions['height'] / 2))
end | [
"def",
"center",
"point",
"=",
"location",
"dimensions",
"=",
"size",
"Selenium",
"::",
"WebDriver",
"::",
"Point",
".",
"new",
"(",
"point",
".",
"x",
"+",
"(",
"dimensions",
"[",
"'width'",
"]",
"/",
"2",
")",
",",
"point",
".",
"y",
"+",
"(",
"d... | Get centre coordinates of element
@example
browser.button(name: "new_user_button").centre
@return [Selenium::WebDriver::Point] | [
"Get",
"centre",
"coordinates",
"of",
"element"
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/elements/element.rb#L425-L430 | train | Returns the center of the image in the specified region. | [
30522,
13366,
2415,
2391,
1027,
3295,
9646,
1027,
2946,
7367,
7770,
5007,
1024,
1024,
4773,
23663,
2099,
1024,
1024,
2391,
1012,
2047,
1006,
2391,
1012,
1060,
1009,
1006,
9646,
1031,
1005,
9381,
1005,
1033,
1013,
1016,
1007,
1010,
2391,
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... |
brianmario/mysql2 | lib/mysql2/client.rb | Mysql2.Client.parse_connect_attrs | def parse_connect_attrs(conn_attrs)
return {} if Mysql2::Client::CONNECT_ATTRS.zero?
conn_attrs ||= {}
conn_attrs[:program_name] ||= $PROGRAM_NAME
conn_attrs.each_with_object({}) do |(key, value), hash|
hash[key.to_s] = value.to_s
end
end | ruby | def parse_connect_attrs(conn_attrs)
return {} if Mysql2::Client::CONNECT_ATTRS.zero?
conn_attrs ||= {}
conn_attrs[:program_name] ||= $PROGRAM_NAME
conn_attrs.each_with_object({}) do |(key, value), hash|
hash[key.to_s] = value.to_s
end
end | [
"def",
"parse_connect_attrs",
"(",
"conn_attrs",
")",
"return",
"{",
"}",
"if",
"Mysql2",
"::",
"Client",
"::",
"CONNECT_ATTRS",
".",
"zero?",
"conn_attrs",
"||=",
"{",
"}",
"conn_attrs",
"[",
":program_name",
"]",
"||=",
"$PROGRAM_NAME",
"conn_attrs",
".",
"e... | Set default program_name in performance_schema.session_connect_attrs
and performance_schema.session_account_connect_attrs | [
"Set",
"default",
"program_name",
"in",
"performance_schema",
".",
"session_connect_attrs",
"and",
"performance_schema",
".",
"session_account_connect_attrs"
] | c8c346db72b5505740065d9de79b4a52081d5a57 | https://github.com/brianmario/mysql2/blob/c8c346db72b5505740065d9de79b4a52081d5a57/lib/mysql2/client.rb#L120-L127 | train | Parse connection attributes | [
30522,
13366,
11968,
3366,
1035,
7532,
1035,
2012,
16344,
2015,
1006,
9530,
2078,
1035,
2012,
16344,
2015,
1007,
2709,
1063,
1065,
2065,
2026,
2015,
4160,
2140,
2475,
1024,
1024,
7396,
1024,
1024,
7532,
1035,
2012,
16344,
2015,
1012,
5717,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
castwide/solargraph | lib/solargraph/library.rb | Solargraph.Library.delete | def delete filename
detach filename
result = false
mutex.synchronize do
result = workspace.remove(filename)
@synchronized = !result if synchronized?
end
result
end | ruby | def delete filename
detach filename
result = false
mutex.synchronize do
result = workspace.remove(filename)
@synchronized = !result if synchronized?
end
result
end | [
"def",
"delete",
"filename",
"detach",
"filename",
"result",
"=",
"false",
"mutex",
".",
"synchronize",
"do",
"result",
"=",
"workspace",
".",
"remove",
"(",
"filename",
")",
"@synchronized",
"=",
"!",
"result",
"if",
"synchronized?",
"end",
"result",
"end"
] | Delete a file from the library. Deleting a file will make it unavailable
for checkout and optionally remove it from the workspace unless the
workspace configuration determines that it should still exist.
@param filename [String]
@return [Boolean] True if the file was deleted | [
"Delete",
"a",
"file",
"from",
"the",
"library",
".",
"Deleting",
"a",
"file",
"will",
"make",
"it",
"unavailable",
"for",
"checkout",
"and",
"optionally",
"remove",
"it",
"from",
"the",
"workspace",
"unless",
"the",
"workspace",
"configuration",
"determines",
... | 47badb5d151aca775ccbe6c470236089eae7839d | https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/library.rb#L130-L138 | train | delete a file from the workspace | [
30522,
13366,
3972,
12870,
5371,
18442,
20010,
6776,
5371,
18442,
2765,
1027,
6270,
20101,
2595,
1012,
26351,
8093,
10698,
4371,
2079,
2765,
1027,
2573,
15327,
1012,
6366,
1006,
5371,
18442,
1007,
1030,
25549,
1027,
999,
2765,
2065,
25549,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/alias.rb | Vagrant.Alias.interpret | def interpret(line)
# is it a comment?
return nil if line.strip.start_with?("#")
keyword, command = line.split("=", 2).collect(&:strip)
# validate the keyword
if keyword.match(/\s/i)
raise Errors::AliasInvalidError, alias: line, message: "Alias keywords must not contain any whitespace."
end
[keyword, command]
end | ruby | def interpret(line)
# is it a comment?
return nil if line.strip.start_with?("#")
keyword, command = line.split("=", 2).collect(&:strip)
# validate the keyword
if keyword.match(/\s/i)
raise Errors::AliasInvalidError, alias: line, message: "Alias keywords must not contain any whitespace."
end
[keyword, command]
end | [
"def",
"interpret",
"(",
"line",
")",
"# is it a comment?",
"return",
"nil",
"if",
"line",
".",
"strip",
".",
"start_with?",
"(",
"\"#\"",
")",
"keyword",
",",
"command",
"=",
"line",
".",
"split",
"(",
"\"=\"",
",",
"2",
")",
".",
"collect",
"(",
":st... | This interprets a raw line from the aliases file. | [
"This",
"interprets",
"a",
"raw",
"line",
"from",
"the",
"aliases",
"file",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/alias.rb#L28-L40 | train | interpret a line of a alias | [
30522,
13366,
17841,
1006,
2240,
1007,
1001,
2003,
2009,
1037,
7615,
1029,
2709,
9152,
2140,
2065,
2240,
1012,
6167,
1012,
2707,
1035,
2007,
1029,
1006,
1000,
1001,
1000,
1007,
3145,
18351,
1010,
3094,
1027,
2240,
1012,
3975,
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... |
daddyz/phonelib | lib/phonelib/phone_analyzer.rb | Phonelib.PhoneAnalyzer.number_format | def number_format(national, format_data)
format_data && format_data.find do |format|
(format[Core::LEADING_DIGITS].nil? || \
national.match(cr("^(#{format[Core::LEADING_DIGITS]})"))) && \
national.match(cr("^(#{format[Core::PATTERN]})$"))
end || Core::DEFAULT_NUMBER_FORMAT
end | ruby | def number_format(national, format_data)
format_data && format_data.find do |format|
(format[Core::LEADING_DIGITS].nil? || \
national.match(cr("^(#{format[Core::LEADING_DIGITS]})"))) && \
national.match(cr("^(#{format[Core::PATTERN]})$"))
end || Core::DEFAULT_NUMBER_FORMAT
end | [
"def",
"number_format",
"(",
"national",
",",
"format_data",
")",
"format_data",
"&&",
"format_data",
".",
"find",
"do",
"|",
"format",
"|",
"(",
"format",
"[",
"Core",
"::",
"LEADING_DIGITS",
"]",
".",
"nil?",
"||",
"national",
".",
"match",
"(",
"cr",
... | Gets matched number formatting rule or default one
==== Attributes
* +national+ - national phone number
* +format_data+ - formatting data from country data | [
"Gets",
"matched",
"number",
"formatting",
"rule",
"or",
"default",
"one"
] | aa0023eab7c896b71275bf342bc7f49735cbdbbf | https://github.com/daddyz/phonelib/blob/aa0023eab7c896b71275bf342bc7f49735cbdbbf/lib/phonelib/phone_analyzer.rb#L184-L190 | train | Returns the number format for the national | [
30522,
13366,
2193,
1035,
4289,
1006,
2120,
1010,
4289,
1035,
2951,
1007,
4289,
1035,
2951,
1004,
1004,
4289,
1035,
2951,
1012,
2424,
2079,
1064,
4289,
1064,
1006,
4289,
1031,
4563,
1024,
1024,
2877,
1035,
16648,
1033,
1012,
9152,
2140,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rocketjob/symmetric-encryption | lib/symmetric_encryption/cipher.rb | SymmetricEncryption.Cipher.encrypt | def encrypt(str, random_iv: SymmetricEncryption.randomize_iv?, compress: false, header: always_add_header)
return if str.nil?
str = str.to_s
return str if str.empty?
encrypted = binary_encrypt(str, random_iv: random_iv, compress: compress, header: header)
encode(encrypted)
end | ruby | def encrypt(str, random_iv: SymmetricEncryption.randomize_iv?, compress: false, header: always_add_header)
return if str.nil?
str = str.to_s
return str if str.empty?
encrypted = binary_encrypt(str, random_iv: random_iv, compress: compress, header: header)
encode(encrypted)
end | [
"def",
"encrypt",
"(",
"str",
",",
"random_iv",
":",
"SymmetricEncryption",
".",
"randomize_iv?",
",",
"compress",
":",
"false",
",",
"header",
":",
"always_add_header",
")",
"return",
"if",
"str",
".",
"nil?",
"str",
"=",
"str",
".",
"to_s",
"return",
"st... | Encrypt and then encode a string
Returns data encrypted and then encoded according to the encoding setting
of this cipher
Returns nil if str is nil
Returns "" str is empty
Parameters
str [String]
String to be encrypted. If str is not a string, #to_s will be called on it
to convert it to a string
random_iv [true|false]
Whether the encypted value should use a random IV every time the
field is encrypted.
Notes:
* Setting random_iv to true will result in a different encrypted output for
the same input string.
* It is recommended to set this to true, except if it will be used as a lookup key.
* Only set to true if the field will never be used as a lookup key, since
the encrypted value needs to be same every time in this case.
* When random_iv is true it adds the random IV string to the header.
Default: false
Highly Recommended where feasible: true
compress [true|false]
Whether to compress str before encryption.
Default: false
Notes:
* Should only be used for large strings since compression overhead and
the overhead of adding the encryption header may exceed any benefits of
compression | [
"Encrypt",
"and",
"then",
"encode",
"a",
"string"
] | 064ba8d57ffac44a3ed80f5e76fa1a54d660ff98 | https://github.com/rocketjob/symmetric-encryption/blob/064ba8d57ffac44a3ed80f5e76fa1a54d660ff98/lib/symmetric_encryption/cipher.rb#L134-L142 | train | Encrypt a string using the symmetric encryption algorithm. | [
30522,
13366,
4372,
26775,
22571,
2102,
1006,
2358,
2099,
1010,
6721,
1035,
4921,
1024,
19490,
2368,
26775,
22571,
3508,
1012,
6721,
4697,
1035,
4921,
1029,
1010,
4012,
20110,
1024,
6270,
1010,
20346,
1024,
2467,
1035,
5587,
1035,
20346,
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_logic/lib/2015-02-01-preview/generated/azure_mgmt_logic/workflow_access_keys.rb | Azure::Logic::Mgmt::V2015_02_01_preview.WorkflowAccessKeys.regenerate_secret_key_with_http_info | def regenerate_secret_key_with_http_info(resource_group_name, workflow_name, access_key_name, parameters, custom_headers:nil)
regenerate_secret_key_async(resource_group_name, workflow_name, access_key_name, parameters, custom_headers:custom_headers).value!
end | ruby | def regenerate_secret_key_with_http_info(resource_group_name, workflow_name, access_key_name, parameters, custom_headers:nil)
regenerate_secret_key_async(resource_group_name, workflow_name, access_key_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"regenerate_secret_key_with_http_info",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"access_key_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"regenerate_secret_key_async",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"access_... | Regenerates secret key.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param access_key_name [String] The workflow access key name.
@param parameters [RegenerateSecretKeyParameters] The parameters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Regenerates",
"secret",
"key",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2015-02-01-preview/generated/azure_mgmt_logic/workflow_access_keys.rb#L542-L544 | train | Regenerate the secret key for the specified workflow. | [
30522,
13366,
19723,
24454,
3686,
1035,
3595,
1035,
3145,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
3229,
1035,
3145,
1035,
2171,
1010,
30524,
6038,
2278,
1006,
7692,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-sqs/lib/aws-sdk-sqs/resource.rb | Aws::SQS.Resource.create_queue | def create_queue(options = {})
resp = @client.create_queue(options)
Queue.new(
url: resp.data.queue_url,
client: @client
)
end | ruby | def create_queue(options = {})
resp = @client.create_queue(options)
Queue.new(
url: resp.data.queue_url,
client: @client
)
end | [
"def",
"create_queue",
"(",
"options",
"=",
"{",
"}",
")",
"resp",
"=",
"@client",
".",
"create_queue",
"(",
"options",
")",
"Queue",
".",
"new",
"(",
"url",
":",
"resp",
".",
"data",
".",
"queue_url",
",",
"client",
":",
"@client",
")",
"end"
] | @!group Actions
@example Request syntax with placeholder values
queue = sqs.create_queue({
queue_name: "String", # required
attributes: {
"All" => "String",
},
})
@param [Hash] options ({})
@option options [required, String] :queue_name
The name of the new queue. The following limits apply to this name:
* A queue name can have up to 80 characters.
* Valid values: alphanumeric characters, hyphens (`-`), and
underscores (`_`).
* A FIFO queue name must end with the `.fifo` suffix.
Queue URLs and names are case-sensitive.
@option options [Hash<String,String>] :attributes
A map of attributes with their corresponding values.
The following lists the names, descriptions, and values of the special
request parameters that the `CreateQueue` action uses:
* `DelaySeconds` - The length of time, in seconds, for which the
delivery of all messages in the queue is delayed. Valid values: An
integer from 0 to 900 seconds (15 minutes). Default: 0.
* `MaximumMessageSize` - The limit of how many bytes a message can
contain before Amazon SQS rejects it. Valid values: An integer from
1,024 bytes (1 KiB) to 262,144 bytes (256 KiB). Default: 262,144
(256 KiB).
* `MessageRetentionPeriod` - The length of time, in seconds, for which
Amazon SQS retains a message. Valid values: An integer from 60
seconds (1 minute) to 1,209,600 seconds (14 days). Default: 345,600
(4 days).
* `Policy` - The queue's policy. A valid AWS policy. For more
information about policy structure, see [Overview of AWS IAM
Policies][1] in the *Amazon IAM User Guide*.
* `ReceiveMessageWaitTimeSeconds` - The length of time, in seconds,
for which a ` ReceiveMessage ` action waits for a message to arrive.
Valid values: An integer from 0 to 20 (seconds). Default: 0.
* `RedrivePolicy` - The string that includes the parameters for the
dead-letter queue functionality of the source queue. For more
information about the redrive policy and dead-letter queues, see
[Using Amazon SQS Dead-Letter Queues][2] in the *Amazon Simple Queue
Service Developer Guide*.
* `deadLetterTargetArn` - The Amazon Resource Name (ARN) of the
dead-letter queue to which Amazon SQS moves messages after the
value of `maxReceiveCount` is exceeded.
* `maxReceiveCount` - The number of times a message is delivered to
the source queue before being moved to the dead-letter queue. When
the `ReceiveCount` for a message exceeds the `maxReceiveCount` for
a queue, Amazon SQS moves the message to the dead-letter-queue.
<note markdown="1"> The dead-letter queue of a FIFO queue must also be a FIFO queue.
Similarly, the dead-letter queue of a standard queue must also be a
standard queue.
</note>
* `VisibilityTimeout` - The visibility timeout for the queue, in
seconds. Valid values: An integer from 0 to 43,200 (12 hours).
Default: 30. For more information about the visibility timeout, see
[Visibility Timeout][3] in the *Amazon Simple Queue Service
Developer Guide*.
The following attributes apply only to [server-side-encryption][4]\:
* `KmsMasterKeyId` - The ID of an AWS-managed customer master key
(CMK) for Amazon SQS or a custom CMK. For more information, see [Key
Terms][5]. While the alias of the AWS-managed CMK for Amazon SQS is
always `alias/aws/sqs`, the alias of a custom CMK can, for example,
be `alias/MyAlias `. For more examples, see [KeyId][6] in the *AWS
Key Management Service API Reference*.
* `KmsDataKeyReusePeriodSeconds` - The length of time, in seconds, for
which Amazon SQS can reuse a [data key][7] to encrypt or decrypt
messages before calling AWS KMS again. An integer representing
seconds, between 60 seconds (1 minute) and 86,400 seconds (24
hours). Default: 300 (5 minutes). A shorter time period provides
better security but results in more calls to KMS which might incur
charges after Free Tier. For more information, see [How Does the
Data Key Reuse Period Work?][8].
The following attributes apply only to [FIFO (first-in-first-out)
queues][9]\:
* `FifoQueue` - Designates a queue as FIFO. Valid values: `true`,
`false`. You can provide this attribute only during queue creation.
You can't change it for an existing queue. When you set this
attribute, you must also provide the `MessageGroupId` for your
messages explicitly.
For more information, see [FIFO Queue Logic][10] in the *Amazon
Simple Queue Service Developer Guide*.
* `ContentBasedDeduplication` - Enables content-based deduplication.
Valid values: `true`, `false`. For more information, see
[Exactly-Once Processing][11] in the *Amazon Simple Queue Service
Developer Guide*.
* Every message must have a unique `MessageDeduplicationId`,
* You may provide a `MessageDeduplicationId` explicitly.
* If you aren't able to provide a `MessageDeduplicationId` and
you enable `ContentBasedDeduplication` for your queue, Amazon
SQS uses a SHA-256 hash to generate the `MessageDeduplicationId`
using the body of the message (but not the attributes of the
message).
* If you don't provide a `MessageDeduplicationId` and the queue
doesn't have `ContentBasedDeduplication` set, the action fails
with an error.
* If the queue has `ContentBasedDeduplication` set, your
`MessageDeduplicationId` overrides the generated one.
* When `ContentBasedDeduplication` is in effect, messages with
identical content sent within the deduplication interval are
treated as duplicates and only one copy of the message is
delivered.
* If you send one message with `ContentBasedDeduplication` enabled
and then another message with a `MessageDeduplicationId` that is
the same as the one generated for the first
`MessageDeduplicationId`, the two messages are treated as
duplicates and only one copy of the message is delivered.
[1]: http://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html
[2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
[3]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
[4]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html
[5]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms
[6]: http://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters
[7]: http://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys
[8]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work
[9]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html
[10]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic
[11]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
@return [Queue] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-sqs/lib/aws-sdk-sqs/resource.rb#L176-L182 | train | Create a queue | [
30522,
13366,
3443,
1035,
24240,
1006,
7047,
1027,
1063,
1065,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3443,
1035,
24240,
1006,
7047,
1007,
24240,
1012,
2047,
1006,
24471,
2140,
1024,
24501,
2361,
1012,
2951,
1012,
24240,
1035,
24471,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/tty-prompt | lib/tty/prompt.rb | TTY.Prompt.invoke_select | def invoke_select(object, question, *args, &block)
options = Utils.extract_options!(args)
choices = if block
[]
elsif args.empty?
possible = options.dup
options = {}
possible
elsif args.size == 1 && args[0].is_a?(Hash)
Utils.extract_options!(args)
else
args.flatten
end
list = object.new(self, options)
list.(question, choices, &block)
end | ruby | def invoke_select(object, question, *args, &block)
options = Utils.extract_options!(args)
choices = if block
[]
elsif args.empty?
possible = options.dup
options = {}
possible
elsif args.size == 1 && args[0].is_a?(Hash)
Utils.extract_options!(args)
else
args.flatten
end
list = object.new(self, options)
list.(question, choices, &block)
end | [
"def",
"invoke_select",
"(",
"object",
",",
"question",
",",
"*",
"args",
",",
"&",
"block",
")",
"options",
"=",
"Utils",
".",
"extract_options!",
"(",
"args",
")",
"choices",
"=",
"if",
"block",
"[",
"]",
"elsif",
"args",
".",
"empty?",
"possible",
"... | Invoke a list type of prompt
@example
prompt = TTY::Prompt.new
editors = %w(emacs nano vim)
prompt.invoke_select(EnumList, "Select editor: ", editors)
@return [String]
@api public | [
"Invoke",
"a",
"list",
"type",
"of",
"prompt"
] | b1ff627afff98fa6477e5ef3ac4a718c52eff05a | https://github.com/piotrmurach/tty-prompt/blob/b1ff627afff98fa6477e5ef3ac4a718c52eff05a/lib/tty/prompt.rb#L223-L239 | train | Invoke the given object with the given question and options. | [
30522,
13366,
1999,
6767,
3489,
1035,
7276,
1006,
4874,
1010,
3160,
1010,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
7047,
1027,
21183,
12146,
1012,
14817,
1035,
7047,
999,
1006,
12098,
5620,
1007,
9804,
1027,
2065,
3796,
1031,
1033,
3449,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.