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 r... | [
"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 t... | [
"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("password... | 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("password... | [
"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 =... | [
"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 implem... | [
"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.ne... | 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.ne... | [
"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... | [
"@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(... | 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(... | [
"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 ... | [
"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 [... | [
"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_hea... | 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_hea... | [
"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 applicat... | [
"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] || @def... | 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] || @def... | [
"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
... | 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
... | [
"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}... | [
"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
'/s... | [
"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.... | [
"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 => Stri... | [
"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 d... | [
"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 ... | [
"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... | [
"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],
... | 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],
... | [
"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_protectab... | [
"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_... | 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_... | [
"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 indicati... | [
"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'
... | [
"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 Ma... | [
"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 c... | [
"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_he... | 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_he... | [
"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 cr... | [
"@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]
... | 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]
... | [
"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] :allocat... | [
"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,
... | 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,
... | [
"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 storag... | [
"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 ... | [
"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"... | 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"... | [
"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
ca... | [
"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) }
... | 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) }
... | [
"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
... | 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
... | [
"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
@exam... | [
"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: exec... | 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: exec... | [
"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)
e... | 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)
e... | [
"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 C... | [
"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 respons... | 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 respons... | [
"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 [Applicatio... | [
"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... | 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... | [
"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 [... | [
"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[:ro... | 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[:ro... | [
"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 c... | 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 c... | [
"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 targe... | [
"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|... | 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|... | [
"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?
... | 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?
... | [
"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_netwo... | [
"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_rea... | 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_rea... | [
"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 s... | [
"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... | [
"@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_hea... | 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_hea... | [
"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.
@para... | [
"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
... | 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
... | [
"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 fa... | [
"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 H... | [
"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] i... | [
"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... | [
"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 iden... | [
"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.
... | [
"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,
tim... | 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,
tim... | [
"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... | [
"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... | [
"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... | 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... | [
"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::Fi... | [
"@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 |l... | 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 |l... | [
"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 ... | [
"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, e... | 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, e... | [
"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 UT... | [
"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).
branche... | 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).
branche... | [
"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 targe... | [
"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... | [
"@!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 white... | 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 white... | [
"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
... | 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
... | [
"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 s... | [
"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 has... | [
"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 ... | [
"@!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[... | 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[... | [
"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.