repo stringclasses 235
values | path stringlengths 11 168 | func_name stringlengths 12 143 | original_string stringlengths 83 6.91k | language stringclasses 1
value | code stringlengths 83 6.91k | code_tokens listlengths 15 1.01k | docstring stringlengths 5 25.7k | docstring_tokens listlengths 1 427 | sha stringclasses 235
values | url stringlengths 99 268 | partition stringclasses 1
value | summary stringlengths 7 202 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/recovery_points.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2016_08_10.RecoveryPoints.list_by_replication_protected_items_next | def list_by_replication_protected_items_next(next_page_link, custom_headers:nil)
response = list_by_replication_protected_items_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_replication_protected_items_next(next_page_link, custom_headers:nil)
response = list_by_replication_protected_items_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_replication_protected_items_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_replication_protected_items_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response"... | Get recovery points for a replication protected item.
Lists the available recovery points for a replication protected item.
@param next_page_link [String] The NextLink from the previous successful call
to List operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added t... | [
"Get",
"recovery",
"points",
"for",
"a",
"replication",
"protected",
"item",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/recovery_points.rb#L254-L257 | train | Gets the list of all protected items in a service group. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
5123,
1035,
5167,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
21647,
1035,
5123,
1035,
5167,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/managers.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Managers.update_extended_info_with_http_info | def update_extended_info_with_http_info(parameters, resource_group_name, manager_name, if_match, custom_headers:nil)
update_extended_info_async(parameters, resource_group_name, manager_name, if_match, custom_headers:custom_headers).value!
end | ruby | def update_extended_info_with_http_info(parameters, resource_group_name, manager_name, if_match, custom_headers:nil)
update_extended_info_async(parameters, resource_group_name, manager_name, if_match, custom_headers:custom_headers).value!
end | [
"def",
"update_extended_info_with_http_info",
"(",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"if_match",
",",
"custom_headers",
":",
"nil",
")",
"update_extended_info_async",
"(",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
","... | Updates the extended info of the manager.
@param parameters [ManagerExtendedInfo] The manager extended information.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param if_match [String] Pass the ETag of ExtendedInfo fetched from GET call
@param custom_h... | [
"Updates",
"the",
"extended",
"info",
"of",
"the",
"manager",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/managers.rb#L1096-L1098 | train | Updates the extended information of the specified resource group. | [
30522,
13366,
10651,
1035,
3668,
1035,
18558,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11709,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
2065,
1035,
2674,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
etewiah/property_web_builder | app/controllers/pwb/import/translations_controller.rb | Pwb.Import::TranslationsController.multiple | def multiple
I18n::Backend::ActiveRecord::Translation.import(params[:file])
return render json: { "success": true }, status: :ok, head: :no_content
# redirect_to root_url, notice: "I18n::Backend::ActiveRecord::Translations imported."
end | ruby | def multiple
I18n::Backend::ActiveRecord::Translation.import(params[:file])
return render json: { "success": true }, status: :ok, head: :no_content
# redirect_to root_url, notice: "I18n::Backend::ActiveRecord::Translations imported."
end | [
"def",
"multiple",
"I18n",
"::",
"Backend",
"::",
"ActiveRecord",
"::",
"Translation",
".",
"import",
"(",
"params",
"[",
":file",
"]",
")",
"return",
"render",
"json",
":",
"{",
"\"success\"",
":",
"true",
"}",
",",
"status",
":",
":ok",
",",
"head",
... | http://localhost:3000/import/translations/multiple | [
"http",
":",
"//",
"localhost",
":",
"3000",
"/",
"import",
"/",
"translations",
"/",
"multiple"
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/controllers/pwb/import/translations_controller.rb#L5-L11 | train | Import the translations | [
30522,
13366,
3674,
1045,
15136,
2078,
1024,
1024,
2067,
10497,
1024,
1024,
3161,
2890,
27108,
2094,
1024,
1024,
5449,
1012,
12324,
1006,
11498,
5244,
1031,
1024,
5371,
1033,
1007,
2709,
17552,
1046,
3385,
1024,
1063,
1000,
3112,
1000,
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... |
twitter/secure_headers | lib/secure_headers/view_helper.rb | SecureHeaders.ViewHelpers.nonced_javascript_include_tag | def nonced_javascript_include_tag(*args, &block)
opts = extract_options(args).merge(nonce: _content_security_policy_nonce(:script))
javascript_include_tag(*args, opts, &block)
end | ruby | def nonced_javascript_include_tag(*args, &block)
opts = extract_options(args).merge(nonce: _content_security_policy_nonce(:script))
javascript_include_tag(*args, opts, &block)
end | [
"def",
"nonced_javascript_include_tag",
"(",
"*",
"args",
",",
"&",
"block",
")",
"opts",
"=",
"extract_options",
"(",
"args",
")",
".",
"merge",
"(",
"nonce",
":",
"_content_security_policy_nonce",
"(",
":script",
")",
")",
"javascript_include_tag",
"(",
"args"... | Public: create a script src tag using the content security policy nonce.
Instructs secure_headers to append a nonce to script-src directive.
Returns an html-safe script tag with the nonce attribute. | [
"Public",
":",
"create",
"a",
"script",
"src",
"tag",
"using",
"the",
"content",
"security",
"policy",
"nonce",
".",
"Instructs",
"secure_headers",
"to",
"append",
"a",
"nonce",
"to",
"script",
"-",
"src",
"directive",
"."
] | 543e6712aadae08f1653ed973e6b6204f7eac26a | https://github.com/twitter/secure_headers/blob/543e6712aadae08f1653ed973e6b6204f7eac26a/lib/secure_headers/view_helper.rb#L39-L43 | train | Returns the nonced javascript include tag for the given arguments. | [
30522,
13366,
2512,
11788,
1035,
9262,
22483,
1035,
2421,
1035,
6415,
1006,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
23569,
2015,
1027,
14817,
1035,
7047,
1006,
12098,
5620,
1007,
1012,
13590,
1006,
2512,
3401,
1024,
1035,
4180,
1035,
303... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_store/lib/2016-11-01/generated/azure_mgmt_datalake_store/trusted_id_providers.rb | Azure::DataLakeStore::Mgmt::V2016_11_01.TrustedIdProviders.get_with_http_info | def get_with_http_info(resource_group_name, account_name, trusted_id_provider_name, custom_headers:nil)
get_async(resource_group_name, account_name, trusted_id_provider_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, account_name, trusted_id_provider_name, custom_headers:nil)
get_async(resource_group_name, account_name, trusted_id_provider_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"trusted_id_provider_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"trusted_id_provider_name",
",",
"custom_headers",
":c... | Gets the specified Data Lake Store trusted identity provider.
@param resource_group_name [String] The name of the Azure resource group.
@param account_name [String] The name of the Data Lake Store account.
@param trusted_id_provider_name [String] The name of the trusted identity
provider to retrieve.
@param custo... | [
"Gets",
"the",
"specified",
"Data",
"Lake",
"Store",
"trusted",
"identity",
"provider",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_store/lib/2016-11-01/generated/azure_mgmt_datalake_store/trusted_id_providers.rb#L267-L269 | train | Gets the specified trusted id specification. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
9480,
1035,
8909,
1035,
10802,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby-git/ruby-git | lib/git/base.rb | Git.Base.commit_all | def commit_all(message, opts = {})
opts = {:add_all => true}.merge(opts)
self.lib.commit(message, opts)
end | ruby | def commit_all(message, opts = {})
opts = {:add_all => true}.merge(opts)
self.lib.commit(message, opts)
end | [
"def",
"commit_all",
"(",
"message",
",",
"opts",
"=",
"{",
"}",
")",
"opts",
"=",
"{",
":add_all",
"=>",
"true",
"}",
".",
"merge",
"(",
"opts",
")",
"self",
".",
"lib",
".",
"commit",
"(",
"message",
",",
"opts",
")",
"end"
] | commits all pending changes in the index file to the git repository,
but automatically adds all modified files without having to explicitly
calling @git.add() on them. | [
"commits",
"all",
"pending",
"changes",
"in",
"the",
"index",
"file",
"to",
"the",
"git",
"repository",
"but",
"automatically",
"adds",
"all",
"modified",
"files",
"without",
"having",
"to",
"explicitly",
"calling"
] | 9bd4407c56068e1604f14a1b6c0c5a84868e6378 | https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/base.rb#L299-L302 | train | Commit all changes to the database | [
30522,
13366,
10797,
1035,
2035,
1006,
4471,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
23569,
2015,
1027,
1063,
1024,
5587,
1035,
2035,
1027,
1028,
2995,
1065,
1012,
13590,
1006,
23569,
2015,
1007,
2969,
1012,
5622,
2497,
1012,
10797,
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.parse_uri_query_params | def parse_uri_query_params(query)
query.to_s.split('&'.freeze).reduce({}) do |h, p|
k, v = p.split('='.freeze, 2)
v = URI::Generic::DEFAULT_PARSER.unescape(v) if v
h[k.to_sym] = v || true
h
end
end | ruby | def parse_uri_query_params(query)
query.to_s.split('&'.freeze).reduce({}) do |h, p|
k, v = p.split('='.freeze, 2)
v = URI::Generic::DEFAULT_PARSER.unescape(v) if v
h[k.to_sym] = v || true
h
end
end | [
"def",
"parse_uri_query_params",
"(",
"query",
")",
"query",
".",
"to_s",
".",
"split",
"(",
"'&'",
".",
"freeze",
")",
".",
"reduce",
"(",
"{",
"}",
")",
"do",
"|",
"h",
",",
"p",
"|",
"k",
",",
"v",
"=",
"p",
".",
"split",
"(",
"'='",
".",
... | Internal: Parse query string into hash of params
query - String query string
Return Hash of params. | [
"Internal",
":",
"Parse",
"query",
"string",
"into",
"hash",
"of",
"params"
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/uri_utils.rb#L182-L189 | train | Parse URI query params | [
30522,
13366,
11968,
3366,
1035,
24471,
2072,
1035,
23032,
1035,
11498,
5244,
1006,
23032,
1007,
23032,
1012,
2000,
1035,
1055,
1012,
3975,
1006,
1005,
1004,
1005,
1012,
13184,
1007,
1012,
5547,
1006,
1063,
1065,
1007,
2079,
1064,
1044,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.restart_node | def restart_node(node_name, restart_node_description, timeout:60, custom_headers:nil)
response = restart_node_async(node_name, restart_node_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def restart_node(node_name, restart_node_description, timeout:60, custom_headers:nil)
response = restart_node_async(node_name, restart_node_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"restart_node",
"(",
"node_name",
",",
"restart_node_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"restart_node_async",
"(",
"node_name",
",",
"restart_node_description",
",",
"timeout",
":",
"timeout",
"... | Restarts a Service Fabric cluster node.
Restarts a Service Fabric cluster node that is already started.
@param node_name [String] The name of the node.
@param restart_node_description [RestartNodeDescription] The instance of the
node to be restarted and a flag indicating the need to take dump of the
fabric proce... | [
"Restarts",
"a",
"Service",
"Fabric",
"cluster",
"node",
"."
] | 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#L4531-L4534 | train | Restarts a node. | [
30522,
13366,
23818,
1035,
13045,
1006,
13045,
1035,
2171,
1010,
23818,
1035,
13045,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
23818,
1035,
13045,
1035,
2004,
6038,
2278,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cypriss/mutations | lib/mutations/model_filter.rb | Mutations.ModelFilter.initialize_constants! | def initialize_constants!
@initialize_constants ||= begin
class_const = options[:class] || @name.to_s.camelize
class_const = class_const.constantize if class_const.is_a?(String)
options[:class] = class_const
if options[:builder]
options[:builder] = options[:builder].cons... | ruby | def initialize_constants!
@initialize_constants ||= begin
class_const = options[:class] || @name.to_s.camelize
class_const = class_const.constantize if class_const.is_a?(String)
options[:class] = class_const
if options[:builder]
options[:builder] = options[:builder].cons... | [
"def",
"initialize_constants!",
"@initialize_constants",
"||=",
"begin",
"class_const",
"=",
"options",
"[",
":class",
"]",
"||",
"@name",
".",
"to_s",
".",
"camelize",
"class_const",
"=",
"class_const",
".",
"constantize",
"if",
"class_const",
".",
"is_a?",
"(",
... | Initialize the model class and builder | [
"Initialize",
"the",
"model",
"class",
"and",
"builder"
] | c9948325648d0ea85420963829d1a4d6b4f17bd9 | https://github.com/cypriss/mutations/blob/c9948325648d0ea85420963829d1a4d6b4f17bd9/lib/mutations/model_filter.rb#L16-L33 | train | Initialize the constants for the object. | [
30522,
13366,
3988,
4697,
1035,
5377,
2015,
999,
1030,
3988,
4697,
1035,
5377,
2015,
1064,
1064,
1027,
4088,
2465,
1035,
9530,
3367,
1027,
7047,
1031,
1024,
2465,
1033,
1064,
1064,
1030,
2171,
1012,
2000,
1035,
1055,
1012,
19130,
4697,
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 | management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachines.begin_redeploy | def begin_redeploy(resource_group_name, vm_name, custom_headers:nil)
response = begin_redeploy_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_redeploy(resource_group_name, vm_name, custom_headers:nil)
response = begin_redeploy_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_redeploy",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_redeploy_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
... | The operation to redeploy a virtual machine.
@param resource_group_name [String] The name of the resource group.
@param vm_name [String] The name of the virtual machine.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusRespons... | [
"The",
"operation",
"to",
"redeploy",
"a",
"virtual",
"machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb#L1778-L1781 | train | Redeploy a virtual machine. | [
30522,
13366,
4088,
1035,
2417,
13699,
4135,
2100,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
2417,
13699,
4135,
2100,
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... |
ruby2d/ruby2d | lib/ruby2d/color.rb | Ruby2D.Color.hex_to_f | def hex_to_f(h)
h = (h[1..-1]).chars.each_slice(2).map(&:join)
a = []
h.each do |el|
a.push(el.to_i(16))
end
a.push(255)
return to_f(a)
end | ruby | def hex_to_f(h)
h = (h[1..-1]).chars.each_slice(2).map(&:join)
a = []
h.each do |el|
a.push(el.to_i(16))
end
a.push(255)
return to_f(a)
end | [
"def",
"hex_to_f",
"(",
"h",
")",
"h",
"=",
"(",
"h",
"[",
"1",
"..",
"-",
"1",
"]",
")",
".",
"chars",
".",
"each_slice",
"(",
"2",
")",
".",
"map",
"(",
":join",
")",
"a",
"=",
"[",
"]",
"h",
".",
"each",
"do",
"|",
"el",
"|",
"a",
".... | Convert from hex value (e.g. #FFF000) to Float (0.0..1.0) | [
"Convert",
"from",
"hex",
"value",
"(",
"e",
".",
"g",
".",
"#FFF000",
")",
"to",
"Float",
"(",
"0",
".",
"0",
"..",
"1",
".",
"0",
")"
] | 43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4 | https://github.com/ruby2d/ruby2d/blob/43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4/lib/ruby2d/color.rb#L120-L130 | train | Convert hex string to float | [
30522,
13366,
2002,
2595,
1035,
2000,
1035,
1042,
1006,
1044,
1007,
1044,
1027,
1006,
1044,
1031,
1015,
1012,
1012,
1011,
1015,
1033,
1007,
1012,
25869,
2015,
1012,
2169,
1035,
14704,
1006,
1016,
1007,
1012,
4949,
1006,
1004,
1024,
3693,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb | Azure::Labservices::Mgmt::V2018_10_15.Environments.claim_with_http_info | def claim_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
end | ruby | def claim_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
claim_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
end | [
"def",
"claim_with_http_info",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
"environment_setting_name",
",",
"environment_name",
",",
"custom_headers",
":",
"nil",
")",
"claim_async",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
... | Claims the environment and assigns it to the user
@param resource_group_name [String] The name of the resource group.
@param lab_account_name [String] The name of the lab Account.
@param lab_name [String] The name of the lab.
@param environment_setting_name [String] The name of the environment Setting.
@param env... | [
"Claims",
"the",
"environment",
"and",
"assigns",
"it",
"to",
"the",
"user"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb#L569-L571 | train | Claim a given environment. | [
30522,
13366,
4366,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
1035,
2171,
1010,
4044,
1035,
4292,
1035,
2171,
1010,
4044,
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... |
oauth-xx/oauth2 | lib/oauth2/mac_token.rb | OAuth2.MACToken.header | def header(verb, url)
timestamp = Time.now.utc.to_i
nonce = Digest::MD5.hexdigest([timestamp, SecureRandom.hex].join(':'))
uri = URI.parse(url)
raise(ArgumentError, "could not parse \"#{url}\" into URI") unless uri.is_a?(URI::HTTP)
mac = signature(timestamp, nonce, verb, uri)
"MA... | ruby | def header(verb, url)
timestamp = Time.now.utc.to_i
nonce = Digest::MD5.hexdigest([timestamp, SecureRandom.hex].join(':'))
uri = URI.parse(url)
raise(ArgumentError, "could not parse \"#{url}\" into URI") unless uri.is_a?(URI::HTTP)
mac = signature(timestamp, nonce, verb, uri)
"MA... | [
"def",
"header",
"(",
"verb",
",",
"url",
")",
"timestamp",
"=",
"Time",
".",
"now",
".",
"utc",
".",
"to_i",
"nonce",
"=",
"Digest",
"::",
"MD5",
".",
"hexdigest",
"(",
"[",
"timestamp",
",",
"SecureRandom",
".",
"hex",
"]",
".",
"join",
"(",
"':'... | Generate the MAC header
@param [Symbol] verb the HTTP request method
@param [String] url the HTTP URL path of the request | [
"Generate",
"the",
"MAC",
"header"
] | f08ff9da169136ab133aa2faab0d74a4407deffb | https://github.com/oauth-xx/oauth2/blob/f08ff9da169136ab133aa2faab0d74a4407deffb/lib/oauth2/mac_token.rb#L61-L72 | train | Returns the header for the given verb and url | [
30522,
13366,
20346,
1006,
12034,
1010,
24471,
2140,
1007,
2335,
15464,
2361,
1027,
2051,
1012,
2085,
1012,
11396,
1012,
2000,
1035,
1045,
2512,
3401,
1027,
17886,
1024,
1024,
9108,
2629,
1012,
2002,
2595,
4305,
8449,
2102,
1006,
1031,
2335... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.create_custom_prebuilt_entity_role_with_http_info | def create_custom_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
create_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end | ruby | def create_custom_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, entity_role_create_object, custom_headers:nil)
create_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, entity_role_create_object, custom_headers:custom_headers).value!
end | [
"def",
"create_custom_prebuilt_entity_role_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"entity_role_create_object",
",",
"custom_headers",
":",
"nil",
")",
"create_custom_prebuilt_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"enti... | Create a role for a prebuilt entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity model ID.
@param entity_role_create_object [EntityRoleCreateObject] An entity role
object containing the name of role.
@param custom_header... | [
"Create",
"a",
"role",
"for",
"a",
"prebuilt",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L7850-L7852 | train | Creates an entity role for a given prebuilt entity. | [
30522,
13366,
3443,
1035,
7661,
1035,
3653,
8569,
4014,
2102,
1035,
9178,
1035,
2535,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
9178,
1035,
2535,
1035,
3443,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/fast_file.rb | Fastlane.FastFile.lane | def lane(lane_name, &block)
UI.user_error!("You have to pass a block using 'do' for lane '#{lane_name}'. Make sure you read the docs on GitHub.") unless block
self.runner.add_lane(Lane.new(platform: self.current_platform,
block: block,
... | ruby | def lane(lane_name, &block)
UI.user_error!("You have to pass a block using 'do' for lane '#{lane_name}'. Make sure you read the docs on GitHub.") unless block
self.runner.add_lane(Lane.new(platform: self.current_platform,
block: block,
... | [
"def",
"lane",
"(",
"lane_name",
",",
"&",
"block",
")",
"UI",
".",
"user_error!",
"(",
"\"You have to pass a block using 'do' for lane '#{lane_name}'. Make sure you read the docs on GitHub.\"",
")",
"unless",
"block",
"self",
".",
"runner",
".",
"add_lane",
"(",
"Lane",
... | @!group DSL
User defines a new lane | [
"@!group",
"DSL"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/fast_file.rb#L78-L88 | train | Add a lane to the runner | [
30522,
13366,
4644,
1006,
4644,
1035,
2171,
1010,
1004,
3796,
1007,
21318,
1012,
5310,
1035,
7561,
999,
1006,
1000,
2017,
2031,
2000,
3413,
1037,
3796,
2478,
1005,
2079,
1005,
2005,
4644,
1005,
1001,
1063,
4644,
1035,
2171,
1065,
1005,
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... |
mikel/mail | lib/mail/network/retriever_methods/pop3.rb | Mail.POP3.start | def start(config = Configuration.instance, &block)
raise ArgumentError.new("Mail::Retrievable#pop3_start takes a block") unless block_given?
pop3 = Net::POP3.new(settings[:address], settings[:port], false)
pop3.enable_ssl(OpenSSL::SSL::VERIFY_NONE) if settings[:enable_ssl]
pop3.read_timeout... | ruby | def start(config = Configuration.instance, &block)
raise ArgumentError.new("Mail::Retrievable#pop3_start takes a block") unless block_given?
pop3 = Net::POP3.new(settings[:address], settings[:port], false)
pop3.enable_ssl(OpenSSL::SSL::VERIFY_NONE) if settings[:enable_ssl]
pop3.read_timeout... | [
"def",
"start",
"(",
"config",
"=",
"Configuration",
".",
"instance",
",",
"&",
"block",
")",
"raise",
"ArgumentError",
".",
"new",
"(",
"\"Mail::Retrievable#pop3_start takes a block\"",
")",
"unless",
"block_given?",
"pop3",
"=",
"Net",
"::",
"POP3",
".",
"new"... | Start a POP3 session and ensure that it will be closed in any case. Any messages
marked for deletion via #find_and_delete or with the :delete_after_find option
will be deleted when the session is closed. | [
"Start",
"a",
"POP3",
"session",
"and",
"ensure",
"that",
"it",
"will",
"be",
"closed",
"in",
"any",
"case",
".",
"Any",
"messages",
"marked",
"for",
"deletion",
"via",
"#find_and_delete",
"or",
"with",
"the",
":",
"delete_after_find",
"option",
"will",
"be"... | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/network/retriever_methods/pop3.rb#L127-L140 | train | Start a pop3 connection | [
30522,
13366,
2707,
1006,
9530,
8873,
2290,
1027,
9563,
1012,
6013,
1010,
1004,
3796,
1007,
5333,
6685,
2121,
29165,
1012,
2047,
1006,
1000,
5653,
1024,
1024,
2128,
18886,
13331,
3468,
1001,
3769,
2509,
1035,
2707,
3138,
1037,
3796,
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... |
square/connect-ruby-sdk | lib/square_connect/api/v1_items_api.rb | SquareConnect.V1ItemsApi.create_page | def create_page(location_id, body, opts = {})
data, _status_code, _headers = create_page_with_http_info(location_id, body, opts)
return data
end | ruby | def create_page(location_id, body, opts = {})
data, _status_code, _headers = create_page_with_http_info(location_id, body, opts)
return data
end | [
"def",
"create_page",
"(",
"location_id",
",",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"create_page_with_http_info",
"(",
"location_id",
",",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | CreatePage
Creates a Favorites page in Square Register.
@param location_id The ID of the location to create an item for.
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [V1Page] | [
"CreatePage",
"Creates",
"a",
"Favorites",
"page",
"in",
"Square",
"Register",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L573-L576 | train | Creates a page of data | [
30522,
13366,
3443,
1035,
3931,
1006,
3295,
1035,
8909,
1010,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
3443,
1035,
3931,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_tasks.rb | Azure::ContainerRegistry::Mgmt::V2018_02_01_preview.BuildTasks.begin_delete | def begin_delete(resource_group_name, registry_name, build_task_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, registry_name, build_task_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, registry_name, build_task_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"registry_name",
",",
"build_task_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"build_task_name",
",",
"custom_headers... | Deletes a specified build task.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param build_task_name [String] The name of the container registry build
task.
@param custom_headers [Hash{... | [
"Deletes",
"a",
"specified",
"build",
"task",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_tasks.rb#L639-L642 | train | Deletes a build task. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
3857,
1035,
4708,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/role.rb | Aws::IAM.Role.attach_policy | def attach_policy(options = {})
options = options.merge(role_name: @name)
resp = @client.attach_role_policy(options)
resp.data
end | ruby | def attach_policy(options = {})
options = options.merge(role_name: @name)
resp = @client.attach_role_policy(options)
resp.data
end | [
"def",
"attach_policy",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"role_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"attach_role_policy",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
role.attach_policy({
policy_arn: "arnType", # required
})
@param [Hash] options ({})
@option options [required, String] :policy_arn
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, ... | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/role.rb#L275-L279 | train | Attach policy to a role | [
30522,
13366,
22476,
1035,
3343,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2535,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
22476,
1035,
2535,
1035,
3343,
1006,
7047,
1007,
24501,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | actionview/lib/action_view/template/resolver.rb | ActionView.PathResolver.extract_handler_and_format_and_variant | def extract_handler_and_format_and_variant(path)
pieces = File.basename(path).split(".")
pieces.shift
extension = pieces.pop
handler = Template.handler_for_extension(extension)
format, variant = pieces.last.split(EXTENSIONS[:variants], 2) if pieces.last
format = if form... | ruby | def extract_handler_and_format_and_variant(path)
pieces = File.basename(path).split(".")
pieces.shift
extension = pieces.pop
handler = Template.handler_for_extension(extension)
format, variant = pieces.last.split(EXTENSIONS[:variants], 2) if pieces.last
format = if form... | [
"def",
"extract_handler_and_format_and_variant",
"(",
"path",
")",
"pieces",
"=",
"File",
".",
"basename",
"(",
"path",
")",
".",
"split",
"(",
"\".\"",
")",
"pieces",
".",
"shift",
"extension",
"=",
"pieces",
".",
"pop",
"handler",
"=",
"Template",
".",
"... | Extract handler, formats and variant from path. If a format cannot be found neither
from the path, or the handler, we should return the array of formats given
to the resolver. | [
"Extract",
"handler",
"formats",
"and",
"variant",
"from",
"path",
".",
"If",
"a",
"format",
"cannot",
"be",
"found",
"neither",
"from",
"the",
"path",
"or",
"the",
"handler",
"we",
"should",
"return",
"the",
"array",
"of",
"formats",
"given",
"to",
"the",... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/template/resolver.rb#L275-L295 | train | Extract handler and format and variant from a path | [
30522,
13366,
14817,
1035,
28213,
1035,
1998,
1035,
4289,
1035,
1998,
1035,
8349,
1006,
4130,
1007,
4109,
1027,
5371,
1012,
2918,
18442,
1006,
4130,
1007,
1012,
3975,
1006,
1000,
1012,
1000,
1007,
4109,
1012,
5670,
5331,
1027,
4109,
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... |
piotrmurach/github | lib/github_api/normalizer.rb | Github.Normalizer.normalize! | def normalize!(params)
case params
when Hash
params.keys.each do |k|
params[k.to_s] = params.delete(k)
normalize!(params[k.to_s])
end
when Array
params.map! do |el|
normalize!(el)
end
end
params
end | ruby | def normalize!(params)
case params
when Hash
params.keys.each do |k|
params[k.to_s] = params.delete(k)
normalize!(params[k.to_s])
end
when Array
params.map! do |el|
normalize!(el)
end
end
params
end | [
"def",
"normalize!",
"(",
"params",
")",
"case",
"params",
"when",
"Hash",
"params",
".",
"keys",
".",
"each",
"do",
"|",
"k",
"|",
"params",
"[",
"k",
".",
"to_s",
"]",
"=",
"params",
".",
"delete",
"(",
"k",
")",
"normalize!",
"(",
"params",
"[",... | Turns any keys from nested hashes including nested arrays into strings | [
"Turns",
"any",
"keys",
"from",
"nested",
"hashes",
"including",
"nested",
"arrays",
"into",
"strings"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/normalizer.rb#L8-L21 | train | Normalize the params | [
30522,
13366,
3671,
4697,
999,
1006,
11498,
5244,
1007,
2553,
11498,
5244,
2043,
23325,
11498,
5244,
1012,
6309,
1012,
2169,
2079,
1064,
1047,
1064,
11498,
5244,
1031,
1047,
1012,
2000,
1035,
1055,
1033,
1027,
11498,
5244,
1012,
3972,
12870... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_backup_short_term_retention_policies.rb | Azure::SQL::Mgmt::V2017_03_01_preview.ManagedBackupShortTermRetentionPolicies.list_by_database | def list_by_database(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
first_page = list_by_database_as_lazy(resource_group_name, managed_instance_name, database_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_database(resource_group_name, managed_instance_name, database_name, custom_headers:nil)
first_page = list_by_database_as_lazy(resource_group_name, managed_instance_name, database_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_database",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"database_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_database_as_lazy",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"database_name",
... | Gets a managed database's short term retention policy list.
@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 dat... | [
"Gets",
"a",
"managed",
"database",
"s",
"short",
"term",
"retention",
"policy",
"list",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/managed_backup_short_term_retention_policies.rb#L247-L250 | train | Gets all the managed instance s managed databases. | [
30522,
13366,
2862,
1035,
2011,
1035,
7809,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
6013,
1035,
2171,
1010,
30524,
1024,
7661,
1035,
20346,
2015,
1007,
2034,
1035,
3931,
1012,
2131,
1035,
2035,
1035,
5167,
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... |
rails/rails | activerecord/lib/active_record/transactions.rb | ActiveRecord.Transactions.committed! | def committed!(should_run_callbacks: true) #:nodoc:
if should_run_callbacks && trigger_transactional_callbacks?
@_committed_already_called = true
_run_commit_without_transaction_enrollment_callbacks
_run_commit_callbacks
end
ensure
@_committed_already_called = false
f... | ruby | def committed!(should_run_callbacks: true) #:nodoc:
if should_run_callbacks && trigger_transactional_callbacks?
@_committed_already_called = true
_run_commit_without_transaction_enrollment_callbacks
_run_commit_callbacks
end
ensure
@_committed_already_called = false
f... | [
"def",
"committed!",
"(",
"should_run_callbacks",
":",
"true",
")",
"#:nodoc:",
"if",
"should_run_callbacks",
"&&",
"trigger_transactional_callbacks?",
"@_committed_already_called",
"=",
"true",
"_run_commit_without_transaction_enrollment_callbacks",
"_run_commit_callbacks",
"end",... | Call the #after_commit callbacks.
Ensure that it is not called if the object was never persisted (failed create),
but call it after the commit of a destroyed object. | [
"Call",
"the",
"#after_commit",
"callbacks",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/transactions.rb#L335-L344 | train | Called when the record has been committed. | [
30522,
13366,
5462,
999,
1006,
2323,
1035,
2448,
1035,
2655,
12221,
1024,
2995,
1007,
1001,
1024,
7293,
10085,
1024,
2065,
2323,
1035,
2448,
1035,
2655,
12221,
1004,
1004,
9495,
1035,
12598,
2389,
1035,
2655,
12221,
1029,
1030,
1035,
5462,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
phusion/passenger | src/ruby_supportlib/phusion_passenger/utils.rb | PhusionPassenger.Utils.global_backtrace_report | def global_backtrace_report
if Kernel.respond_to?(:caller_for_all_threads)
all_thread_stacks = caller_for_all_threads
elsif Thread.respond_to?(:list) && Thread.public_method_defined?(:backtrace)
all_thread_stacks = {}
Thread.list.each do |thread|
all_thread_stacks[thread] =... | ruby | def global_backtrace_report
if Kernel.respond_to?(:caller_for_all_threads)
all_thread_stacks = caller_for_all_threads
elsif Thread.respond_to?(:list) && Thread.public_method_defined?(:backtrace)
all_thread_stacks = {}
Thread.list.each do |thread|
all_thread_stacks[thread] =... | [
"def",
"global_backtrace_report",
"if",
"Kernel",
".",
"respond_to?",
"(",
":caller_for_all_threads",
")",
"all_thread_stacks",
"=",
"caller_for_all_threads",
"elsif",
"Thread",
".",
"respond_to?",
"(",
":list",
")",
"&&",
"Thread",
".",
"public_method_defined?",
"(",
... | Returns a string which reports the backtraces for all threads,
or if that's not supported the backtrace for the current thread. | [
"Returns",
"a",
"string",
"which",
"reports",
"the",
"backtraces",
"for",
"all",
"threads",
"or",
"if",
"that",
"s",
"not",
"supported",
"the",
"backtrace",
"for",
"the",
"current",
"thread",
"."
] | 970964b53e0ba86959acdf40f06c99b0c4a128ca | https://github.com/phusion/passenger/blob/970964b53e0ba86959acdf40f06c99b0c4a128ca/src/ruby_supportlib/phusion_passenger/utils.rb#L201-L238 | train | Returns a string containing the backtrace dump for the current thread. | [
30522,
13366,
3795,
1035,
2067,
6494,
3401,
1035,
3189,
2065,
16293,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
20587,
30524,
1035,
4225,
1029,
1006,
1024,
2067,
6494,
3401,
1007,
2035,
1035,
11689,
1035,
20829,
1027,
1063,
1065,
11689,
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 | 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_replica_health_using_policy_with_http_info | def get_replica_health_using_policy_with_http_info(partition_id, replica_id, events_health_state_filter:0, application_health_policy:nil, timeout:60, custom_headers:nil)
get_replica_health_using_policy_async(partition_id, replica_id, events_health_state_filter:events_health_state_filter, application_health_policy... | ruby | def get_replica_health_using_policy_with_http_info(partition_id, replica_id, events_health_state_filter:0, application_health_policy:nil, timeout:60, custom_headers:nil)
get_replica_health_using_policy_async(partition_id, replica_id, events_health_state_filter:events_health_state_filter, application_health_policy... | [
"def",
"get_replica_health_using_policy_with_http_info",
"(",
"partition_id",
",",
"replica_id",
",",
"events_health_state_filter",
":",
"0",
",",
"application_health_policy",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_replica_he... | Gets the health of a Service Fabric stateful service replica or stateless
service instance using the specified policy.
Gets the health of a Service Fabric stateful service replica or stateless
service instance.
Use EventsHealthStateFilter to filter the collection of health events
reported on the cluster based on ... | [
"Gets",
"the",
"health",
"of",
"a",
"Service",
"Fabric",
"stateful",
"service",
"replica",
"or",
"stateless",
"service",
"instance",
"using",
"the",
"specified",
"policy",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L14960-L14962 | train | Gets the health of the replica using the specified policy. | [
30522,
13366,
2131,
1035,
15059,
1035,
2740,
1035,
2478,
1035,
3343,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
15059,
1035,
8909,
1010,
2824,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
4646,
1035,
2740,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vault-ruby | lib/vault/persistent.rb | Vault.PersistentHTTP.request_failed | def request_failed exception, req, connection # :nodoc:
due_to = "(due to #{exception.message} - #{exception.class})"
message = "too many connection resets #{due_to} #{error_message connection}"
finish connection
raise Error, message, exception.backtrace
end | ruby | def request_failed exception, req, connection # :nodoc:
due_to = "(due to #{exception.message} - #{exception.class})"
message = "too many connection resets #{due_to} #{error_message connection}"
finish connection
raise Error, message, exception.backtrace
end | [
"def",
"request_failed",
"exception",
",",
"req",
",",
"connection",
"# :nodoc:",
"due_to",
"=",
"\"(due to #{exception.message} - #{exception.class})\"",
"message",
"=",
"\"too many connection resets #{due_to} #{error_message connection}\"",
"finish",
"connection",
"raise",
"Error... | Raises an Error for +exception+ which resulted from attempting the request
+req+ on the +connection+.
Finishes the +connection+. | [
"Raises",
"an",
"Error",
"for",
"+",
"exception",
"+",
"which",
"resulted",
"from",
"attempting",
"the",
"request",
"+",
"req",
"+",
"on",
"the",
"+",
"connection",
"+",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/persistent.rb#L992-L999 | train | Raises an exception if the connection has been reset | [
30522,
13366,
5227,
1035,
3478,
6453,
1010,
2128,
4160,
1010,
4434,
1001,
1024,
7293,
10085,
1024,
2349,
1035,
2000,
1027,
1000,
1006,
2349,
2000,
1001,
1063,
6453,
1012,
4471,
1065,
1011,
1001,
1063,
6453,
1012,
2465,
1065,
1007,
1000,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachines.capture | def capture(resource_group_name, vm_name, parameters, custom_headers:nil)
response = capture_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def capture(resource_group_name, vm_name, parameters, custom_headers:nil)
response = capture_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"capture",
"(",
"resource_group_name",
",",
"vm_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"capture_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",
... | Captures the VM by copying virtual hard disks of the VM and outputs a
template that can be used to create similar VMs.
@param resource_group_name [String] The name of the resource group.
@param vm_name [String] The name of the virtual machine.
@param parameters [VirtualMachineCaptureParameters] Parameters supplied... | [
"Captures",
"the",
"VM",
"by",
"copying",
"virtual",
"hard",
"disks",
"of",
"the",
"VM",
"and",
"outputs",
"a",
"template",
"that",
"can",
"be",
"used",
"to",
"create",
"similar",
"VMs",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb#L135-L138 | train | Capture virtual machine image. | [
30522,
13366,
5425,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
5425,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/network_interface.rb | Aws::EC2.NetworkInterface.delete | def delete(options = {})
options = options.merge(network_interface_id: @id)
resp = @client.delete_network_interface(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(network_interface_id: @id)
resp = @client.delete_network_interface(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"network_interface_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"delete_network_interface",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
network_interface.delete({
dry_run: false,
})
@param [Hash] options ({})
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you ... | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/network_interface.rb#L378-L382 | train | Delete a network interface | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2897,
1035,
8278,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
2897,
1035,
8278,
1006,
7047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/thrift | lib/rb/lib/thrift/transport/base_transport.rb | Thrift.BaseTransport.read_into_buffer | def read_into_buffer(buffer, size)
tmp = read_all(size)
i = 0
tmp.each_byte do |byte|
Bytes.set_string_byte(buffer, i, byte)
i += 1
end
i
end | ruby | def read_into_buffer(buffer, size)
tmp = read_all(size)
i = 0
tmp.each_byte do |byte|
Bytes.set_string_byte(buffer, i, byte)
i += 1
end
i
end | [
"def",
"read_into_buffer",
"(",
"buffer",
",",
"size",
")",
"tmp",
"=",
"read_all",
"(",
"size",
")",
"i",
"=",
"0",
"tmp",
".",
"each_byte",
"do",
"|",
"byte",
"|",
"Bytes",
".",
"set_string_byte",
"(",
"buffer",
",",
"i",
",",
"byte",
")",
"i",
"... | Reads size bytes and copies them into buffer[0..size]. | [
"Reads",
"size",
"bytes",
"and",
"copies",
"them",
"into",
"buffer",
"[",
"0",
"..",
"size",
"]",
"."
] | 27d8387c49a49fcf193893f834e9766ae0b051c1 | https://github.com/apache/thrift/blob/27d8387c49a49fcf193893f834e9766ae0b051c1/lib/rb/lib/thrift/transport/base_transport.rb#L72-L80 | train | Read the data into the buffer. | [
30522,
13366,
3191,
1035,
2046,
1035,
17698,
1006,
17698,
1010,
2946,
1007,
1056,
8737,
1027,
3191,
1035,
2035,
1006,
2946,
1007,
1045,
1027,
1014,
1056,
8737,
1012,
2169,
1035,
24880,
2079,
1064,
24880,
1064,
27507,
1012,
2275,
1035,
5164,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_closed_list | def delete_closed_list(app_id, version_id, cl_entity_id, custom_headers:nil)
response = delete_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_closed_list(app_id, version_id, cl_entity_id, custom_headers:nil)
response = delete_closed_list_async(app_id, version_id, cl_entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_closed_list",
"(",
"app_id",
",",
"version_id",
",",
"cl_entity_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_closed_list_async",
"(",
"app_id",
",",
"version_id",
",",
"cl_entity_id",
",",
"custom_headers",
":custom_headers",
... | Deletes a list entity model from a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param cl_entity_id The list entity model ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Opera... | [
"Deletes",
"a",
"list",
"entity",
"model",
"from",
"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#L3348-L3351 | train | Deletes a list entity from the application version of the application. | [
30522,
13366,
3972,
12870,
1035,
2701,
1035,
2862,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
18856,
1035,
9178,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2701,
30524,
1885... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/base.rb | Git.Base.push | def push(remote = 'origin', branch = 'master', opts = {})
# Small hack to keep backwards compatibility with the 'push(remote, branch, tags)' method signature.
opts = {:tags => opts} if [true, false].include?(opts)
self.lib.push(remote, branch, opts)
end | ruby | def push(remote = 'origin', branch = 'master', opts = {})
# Small hack to keep backwards compatibility with the 'push(remote, branch, tags)' method signature.
opts = {:tags => opts} if [true, false].include?(opts)
self.lib.push(remote, branch, opts)
end | [
"def",
"push",
"(",
"remote",
"=",
"'origin'",
",",
"branch",
"=",
"'master'",
",",
"opts",
"=",
"{",
"}",
")",
"# Small hack to keep backwards compatibility with the 'push(remote, branch, tags)' method signature.",
"opts",
"=",
"{",
":tags",
"=>",
"opts",
"}",
"if",
... | pushes changes to a remote repository - easiest if this is a cloned repository,
otherwise you may have to run something like this first to setup the push parameters:
@git.config('remote.remote-name.push', 'refs/heads/master:refs/heads/master') | [
"pushes",
"changes",
"to",
"a",
"remote",
"repository",
"-",
"easiest",
"if",
"this",
"is",
"a",
"cloned",
"repository",
"otherwise",
"you",
"may",
"have",
"to",
"run",
"something",
"like",
"this",
"first",
"to",
"setup",
"the",
"push",
"parameters",
":"
] | 9bd4407c56068e1604f14a1b6c0c5a84868e6378 | https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/base.rb#L325-L330 | train | Pushes to the remote repository. | [
30522,
13366,
5245,
1006,
6556,
1027,
1005,
4761,
1005,
1010,
3589,
1027,
1005,
3040,
1005,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
1001,
2235,
20578,
2000,
2562,
11043,
21778,
2007,
1996,
1005,
5245,
1006,
6556,
1010,
3589,
1010,
22073,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
apache/thrift | lib/rb/lib/thrift/transport/buffered_transport.rb | Thrift.BufferedTransport.read_into_buffer | def read_into_buffer(buffer, size)
i = 0
while i < size
# If the read buffer is exhausted, try to read up to DEFAULT_BUFFER more bytes into it.
if @index >= @rbuf.size
@rbuf = @transport.read(DEFAULT_BUFFER)
@index = 0
end
# The read buffer has some data ... | ruby | def read_into_buffer(buffer, size)
i = 0
while i < size
# If the read buffer is exhausted, try to read up to DEFAULT_BUFFER more bytes into it.
if @index >= @rbuf.size
@rbuf = @transport.read(DEFAULT_BUFFER)
@index = 0
end
# The read buffer has some data ... | [
"def",
"read_into_buffer",
"(",
"buffer",
",",
"size",
")",
"i",
"=",
"0",
"while",
"i",
"<",
"size",
"# If the read buffer is exhausted, try to read up to DEFAULT_BUFFER more bytes into it.",
"if",
"@index",
">=",
"@rbuf",
".",
"size",
"@rbuf",
"=",
"@transport",
"."... | Reads a number of bytes from the transport into the buffer passed.
buffer - The String (byte buffer) to write data to; this is assumed to have a BINARY encoding.
size - The number of bytes to read from the transport and write to the buffer.
Returns the number of bytes read. | [
"Reads",
"a",
"number",
"of",
"bytes",
"from",
"the",
"transport",
"into",
"the",
"buffer",
"passed",
"."
] | 27d8387c49a49fcf193893f834e9766ae0b051c1 | https://github.com/apache/thrift/blob/27d8387c49a49fcf193893f834e9766ae0b051c1/lib/rb/lib/thrift/transport/buffered_transport.rb#L77-L93 | train | Read the data into the given buffer. | [
30522,
13366,
3191,
1035,
2046,
1035,
17698,
1006,
17698,
1010,
2946,
1007,
1045,
1027,
1014,
2096,
1045,
1026,
2946,
1001,
2065,
1996,
3191,
17698,
2003,
9069,
1010,
3046,
2000,
3191,
2039,
2000,
12398,
1035,
17698,
2062,
27507,
2046,
2009... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uken/fluent-plugin-elasticsearch | lib/fluent/plugin/out_elasticsearch.rb | Fluent::Plugin.ElasticsearchOutput.append_record_to_messages | def append_record_to_messages(op, meta, header, record, msgs)
case op
when UPDATE_OP, UPSERT_OP
if meta.has_key?(ID_FIELD)
header[UPDATE_OP] = meta
msgs << @dump_proc.call(header) << BODY_DELIMITER
msgs << @dump_proc.call(update_body(record, op)) << BODY_DELIMITER
... | ruby | def append_record_to_messages(op, meta, header, record, msgs)
case op
when UPDATE_OP, UPSERT_OP
if meta.has_key?(ID_FIELD)
header[UPDATE_OP] = meta
msgs << @dump_proc.call(header) << BODY_DELIMITER
msgs << @dump_proc.call(update_body(record, op)) << BODY_DELIMITER
... | [
"def",
"append_record_to_messages",
"(",
"op",
",",
"meta",
",",
"header",
",",
"record",
",",
"msgs",
")",
"case",
"op",
"when",
"UPDATE_OP",
",",
"UPSERT_OP",
"if",
"meta",
".",
"has_key?",
"(",
"ID_FIELD",
")",
"header",
"[",
"UPDATE_OP",
"]",
"=",
"m... | append_record_to_messages adds a record to the bulk message
payload to be submitted to Elasticsearch. Records that do
not include '_id' field are skipped when 'write_operation'
is configured for 'create' or 'update'
returns 'true' if record was appended to the bulk message
and 'false' otherwise | [
"append_record_to_messages",
"adds",
"a",
"record",
"to",
"the",
"bulk",
"message",
"payload",
"to",
"be",
"submitted",
"to",
"Elasticsearch",
".",
"Records",
"that",
"do",
"not",
"include",
"_id",
"field",
"are",
"skipped",
"when",
"write_operation",
"is",
"con... | 9f9e51ddd012acb36c7f9d7a16e00970004098bc | https://github.com/uken/fluent-plugin-elasticsearch/blob/9f9e51ddd012acb36c7f9d7a16e00970004098bc/lib/fluent/plugin/out_elasticsearch.rb#L492-L515 | train | Append the record to the messages | [
30522,
13366,
10439,
10497,
1035,
2501,
1035,
2000,
1035,
7696,
1006,
6728,
1010,
18804,
1010,
20346,
1010,
2501,
1010,
5796,
5620,
1007,
2553,
6728,
2043,
10651,
1035,
6728,
1010,
11139,
8743,
1035,
6728,
2065,
18804,
1012,
2038,
1035,
314... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.list_entity_suggestions | def list_entity_suggestions(app_id, version_id, entity_id, take:100, custom_headers:nil)
response = list_entity_suggestions_async(app_id, version_id, entity_id, take:take, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_entity_suggestions(app_id, version_id, entity_id, take:100, custom_headers:nil)
response = list_entity_suggestions_async(app_id, version_id, entity_id, take:take, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_entity_suggestions",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_entity_suggestions_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"tak... | Get suggested example utterances that would improve the accuracy of the
entity model in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The target entity extractor model to enhance.
@param take [Integer] The number of entries to return. M... | [
"Get",
"suggested",
"example",
"utterances",
"that",
"would",
"improve",
"the",
"accuracy",
"of",
"the",
"entity",
"model",
"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#L3977-L3980 | train | Gets a list of entity suggestions for a version of the application. | [
30522,
13366,
2862,
1035,
9178,
1035,
15690,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2202,
1024,
2531,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
9178,
1035,
15690,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_authorization/lib/2018-09-01-preview/generated/azure_mgmt_authorization/role_assignments.rb | Azure::Authorization::Mgmt::V2018_09_01_preview.RoleAssignments.list_for_resource_group | def list_for_resource_group(resource_group_name, filter:nil, custom_headers:nil)
first_page = list_for_resource_group_as_lazy(resource_group_name, filter:filter, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_for_resource_group(resource_group_name, filter:nil, custom_headers:nil)
first_page = list_for_resource_group_as_lazy(resource_group_name, filter:filter, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_for_resource_group",
"(",
"resource_group_name",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_for_resource_group_as_lazy",
"(",
"resource_group_name",
",",
"filter",
":",
"filter",
",",
"custom_headers",
":cu... | Gets role assignments for a resource group.
@param resource_group_name [String] The name of the resource group.
@param filter [String] The filter to apply on the operation. Use
$filter=atScope() to return all role assignments at or above the scope. Use
$filter=principalId eq {id} to return all role assignments at,... | [
"Gets",
"role",
"assignments",
"for",
"a",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_authorization/lib/2018-09-01-preview/generated/azure_mgmt_authorization/role_assignments.rb#L163-L166 | train | Gets all the segmentation products under a resource group. | [
30522,
13366,
2862,
1035,
2005,
1035,
7692,
1035,
2177,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2005,
1035,
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... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.get_tagged_images | def get_tagged_images(project_id, iteration_id:nil, tag_ids:nil, order_by:nil, take:50, skip:0, custom_headers:nil)
response = get_tagged_images_async(project_id, iteration_id:iteration_id, tag_ids:tag_ids, order_by:order_by, take:take, skip:skip, custom_headers:custom_headers).value!
response.body unless r... | ruby | def get_tagged_images(project_id, iteration_id:nil, tag_ids:nil, order_by:nil, take:50, skip:0, custom_headers:nil)
response = get_tagged_images_async(project_id, iteration_id:iteration_id, tag_ids:tag_ids, order_by:order_by, take:take, skip:skip, custom_headers:custom_headers).value!
response.body unless r... | [
"def",
"get_tagged_images",
"(",
"project_id",
",",
"iteration_id",
":",
"nil",
",",
"tag_ids",
":",
"nil",
",",
"order_by",
":",
"nil",
",",
"take",
":",
"50",
",",
"skip",
":",
"0",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_tagged_i... | Get tagged images for a given project iteration.
This API supports batching and range selection. By default it will only
return first 50 images matching images.
Use the {take} and {skip} parameters to control how many images to return in
a given batch.
The filtering is on an and/or relationship. For example, if t... | [
"Get",
"tagged",
"images",
"for",
"a",
"given",
"project",
"iteration",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb#L956-L959 | train | Gets the images tagged in a project. | [
30522,
13366,
2131,
1035,
26610,
1035,
4871,
1006,
2622,
1035,
8909,
30524,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
26610,
1035,
4871,
1035,
2004,
6038,
2278,
1006,
2622,
1035,
8909,
1010,
27758,
1035,
8909,
1024,
27758,
1035,
8909,
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... |
decidim/decidim | decidim-core/app/helpers/decidim/icon_helper.rb | Decidim.IconHelper.manifest_icon | def manifest_icon(manifest, options = {})
if manifest.icon
external_icon manifest.icon, options
else
icon "question-mark", options
end
end | ruby | def manifest_icon(manifest, options = {})
if manifest.icon
external_icon manifest.icon, options
else
icon "question-mark", options
end
end | [
"def",
"manifest_icon",
"(",
"manifest",
",",
"options",
"=",
"{",
"}",
")",
"if",
"manifest",
".",
"icon",
"external_icon",
"manifest",
".",
"icon",
",",
"options",
"else",
"icon",
"\"question-mark\"",
",",
"options",
"end",
"end"
] | Public: Returns an icon given an instance of a Manifest. It defaults to
a question mark when no icon is found.
manifest - The manifest to generate the icon for.
options - a Hash with options
Returns an HTML tag with the icon. | [
"Public",
":",
"Returns",
"an",
"icon",
"given",
"an",
"instance",
"of",
"a",
"Manifest",
".",
"It",
"defaults",
"to",
"a",
"question",
"mark",
"when",
"no",
"icon",
"is",
"found",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/icon_helper.rb#L26-L32 | train | Returns the icon for the given manifest | [
30522,
13366,
19676,
1035,
12696,
1006,
19676,
1010,
7047,
1027,
1063,
1065,
1007,
2065,
19676,
1012,
12696,
6327,
1035,
12696,
19676,
1012,
12696,
1010,
7047,
2842,
12696,
1000,
3160,
1011,
2928,
1000,
1010,
7047,
2203,
2203,
102,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/user.rb | Aws::IAM.User.attach_policy | def attach_policy(options = {})
options = options.merge(user_name: @name)
resp = @client.attach_user_policy(options)
resp.data
end | ruby | def attach_policy(options = {})
options = options.merge(user_name: @name)
resp = @client.attach_user_policy(options)
resp.data
end | [
"def",
"attach_policy",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"user_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"attach_user_policy",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
user.attach_policy({
policy_arn: "arnType", # required
})
@param [Hash] options ({})
@option options [required, String] :policy_arn
The Amazon Resource Name (ARN) of the IAM policy you want to attach.
For more information about ARNs, see [Amazon Resou... | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/user.rb#L338-L342 | train | Attach policy to a user | [
30522,
13366,
22476,
1035,
3343,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
5310,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
22476,
1035,
5310,
1035,
3343,
1006,
7047,
1007,
24501,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/logger.rb | Discordrb.Logger.mode= | def mode=(value)
case value
when :debug
@enabled_modes = %i[debug good info warn error out in ratelimit]
when :verbose
@enabled_modes = %i[good info warn error out in ratelimit]
when :normal
@enabled_modes = %i[info warn error ratelimit]
when :quiet
@enabled... | ruby | def mode=(value)
case value
when :debug
@enabled_modes = %i[debug good info warn error out in ratelimit]
when :verbose
@enabled_modes = %i[good info warn error out in ratelimit]
when :normal
@enabled_modes = %i[info warn error ratelimit]
when :quiet
@enabled... | [
"def",
"mode",
"=",
"(",
"value",
")",
"case",
"value",
"when",
":debug",
"@enabled_modes",
"=",
"%i[",
"debug",
"good",
"info",
"warn",
"error",
"out",
"in",
"ratelimit",
"]",
"when",
":verbose",
"@enabled_modes",
"=",
"%i[",
"good",
"info",
"warn",
"erro... | Sets the logging mode
Possible modes are:
* :debug logs everything
* :verbose logs everything except for debug messages
* :normal logs useful information, warnings and errors
* :quiet only logs warnings and errors
* :silent logs nothing
@param value [Symbol] What logging mode to use | [
"Sets",
"the",
"logging",
"mode",
"Possible",
"modes",
"are",
":",
"*",
":",
"debug",
"logs",
"everything",
"*",
":",
"verbose",
"logs",
"everything",
"except",
"for",
"debug",
"messages",
"*",
":",
"normal",
"logs",
"useful",
"information",
"warnings",
"and... | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/logger.rb#L66-L79 | train | Set the mode of the object. | [
30522,
13366,
5549,
1027,
1006,
3643,
1007,
2553,
3643,
2043,
1024,
2139,
8569,
2290,
1030,
9124,
1035,
11583,
1027,
1003,
1045,
1031,
2139,
8569,
2290,
2204,
18558,
11582,
7561,
2041,
1999,
3446,
17960,
4183,
1033,
2043,
1024,
12034,
9232,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slim-template/slim | lib/slim/parser.rb | Slim.Parser.syntax_error! | def syntax_error!(message)
raise SyntaxError.new(message, options[:file], @orig_line, @lineno,
@orig_line && @line ? @orig_line.size - @line.size : 0)
rescue SyntaxError => ex
# HACK: Manipulate stacktrace for Rails and other frameworks
# to find the right file.
e... | ruby | def syntax_error!(message)
raise SyntaxError.new(message, options[:file], @orig_line, @lineno,
@orig_line && @line ? @orig_line.size - @line.size : 0)
rescue SyntaxError => ex
# HACK: Manipulate stacktrace for Rails and other frameworks
# to find the right file.
e... | [
"def",
"syntax_error!",
"(",
"message",
")",
"raise",
"SyntaxError",
".",
"new",
"(",
"message",
",",
"options",
"[",
":file",
"]",
",",
"@orig_line",
",",
"@lineno",
",",
"@orig_line",
"&&",
"@line",
"?",
"@orig_line",
".",
"size",
"-",
"@line",
".",
"s... | Helper for raising exceptions | [
"Helper",
"for",
"raising",
"exceptions"
] | ae8e7338fcfb67256d2f6b50c64fc317210e31a2 | https://github.com/slim-template/slim/blob/ae8e7338fcfb67256d2f6b50c64fc317210e31a2/lib/slim/parser.rb#L523-L531 | train | Raise a syntax error | [
30522,
13366,
20231,
1035,
7561,
999,
1006,
4471,
1007,
5333,
20231,
2121,
29165,
1012,
2047,
1006,
4471,
1010,
7047,
1031,
1024,
5371,
1033,
1010,
1030,
2030,
8004,
1035,
2240,
1010,
1030,
17517,
2080,
1010,
1030,
2030,
8004,
1035,
2240,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/logging.rb | Puppet::Util.Logging.log_exception | def log_exception(exception, message = :default, options = {})
trace = Puppet[:trace] || options[:trace]
level = options[:level] || :err
if message == :default && exception.is_a?(Puppet::ParseErrorWithIssue)
# Retain all detailed info and keep plain message and stacktrace separate
backtrace = []... | ruby | def log_exception(exception, message = :default, options = {})
trace = Puppet[:trace] || options[:trace]
level = options[:level] || :err
if message == :default && exception.is_a?(Puppet::ParseErrorWithIssue)
# Retain all detailed info and keep plain message and stacktrace separate
backtrace = []... | [
"def",
"log_exception",
"(",
"exception",
",",
"message",
"=",
":default",
",",
"options",
"=",
"{",
"}",
")",
"trace",
"=",
"Puppet",
"[",
":trace",
"]",
"||",
"options",
"[",
":trace",
"]",
"level",
"=",
"options",
"[",
":level",
"]",
"||",
":err",
... | Log an exception via Puppet.err. Will also log the backtrace if Puppet[:trace] is set.
Parameters:
[exception] an Exception to log
[message] an optional String overriding the message to be logged; by default, we log Exception.message.
If you pass a String here, your string will be logged instead. You may also ... | [
"Log",
"an",
"exception",
"via",
"Puppet",
".",
"err",
".",
"Will",
"also",
"log",
"the",
"backtrace",
"if",
"Puppet",
"[",
":",
"trace",
"]",
"is",
"set",
".",
"Parameters",
":",
"[",
"exception",
"]",
"an",
"Exception",
"to",
"log",
"[",
"message",
... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/logging.rb#L50-L72 | train | Log an exception | [
30522,
13366,
8833,
1035,
6453,
1006,
6453,
1010,
4471,
1027,
1024,
12398,
1010,
7047,
1027,
1063,
1065,
1007,
7637,
1027,
13997,
1031,
1024,
7637,
1033,
1064,
1064,
7047,
1031,
1024,
7637,
1033,
2504,
1027,
7047,
1031,
1024,
2504,
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... |
jeremytregunna/ruby-trello | lib/trello/client.rb | Trello.Client.find | def find(path, id, params = {})
response = get("/#{path.to_s.pluralize}/#{id}", params)
trello_class = class_from_path(path)
trello_class.parse response do |data|
data.client = self
end
end | ruby | def find(path, id, params = {})
response = get("/#{path.to_s.pluralize}/#{id}", params)
trello_class = class_from_path(path)
trello_class.parse response do |data|
data.client = self
end
end | [
"def",
"find",
"(",
"path",
",",
"id",
",",
"params",
"=",
"{",
"}",
")",
"response",
"=",
"get",
"(",
"\"/#{path.to_s.pluralize}/#{id}\"",
",",
"params",
")",
"trello_class",
"=",
"class_from_path",
"(",
"path",
")",
"trello_class",
".",
"parse",
"response"... | Finds given resource by id
Examples:
client.find(:board, "board1234")
client.find(:member, "user1234") | [
"Finds",
"given",
"resource",
"by",
"id"
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/client.rb#L43-L49 | train | Find a single resource by its ID | [
30522,
13366,
2424,
1006,
4130,
1010,
8909,
1010,
11498,
5244,
1027,
1063,
1065,
1007,
3433,
1027,
2131,
1006,
1000,
1013,
1001,
1063,
4130,
1012,
2000,
1035,
1055,
1012,
13994,
4697,
1065,
1013,
1001,
1063,
8909,
1065,
1000,
1010,
11498,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jnunemaker/httparty | lib/httparty.rb | HTTParty.ClassMethods.head | def head(path, options = {}, &block)
ensure_method_maintained_across_redirects options
perform_request Net::HTTP::Head, path, options, &block
end | ruby | def head(path, options = {}, &block)
ensure_method_maintained_across_redirects options
perform_request Net::HTTP::Head, path, options, &block
end | [
"def",
"head",
"(",
"path",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"ensure_method_maintained_across_redirects",
"options",
"perform_request",
"Net",
"::",
"HTTP",
"::",
"Head",
",",
"path",
",",
"options",
",",
"block",
"end"
] | Perform a HEAD request to a path | [
"Perform",
"a",
"HEAD",
"request",
"to",
"a",
"path"
] | b4099defba01231d2faaaa2660476f867e096bfb | https://github.com/jnunemaker/httparty/blob/b4099defba01231d2faaaa2660476f867e096bfb/lib/httparty.rb#L552-L555 | train | Perform a HEAD request | [
30522,
13366,
2132,
1006,
4130,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
5676,
1035,
4118,
1035,
5224,
1035,
2408,
1035,
2417,
7442,
16649,
7047,
4685,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
adimichele/hubspot-ruby | lib/hubspot/contact_list.rb | Hubspot.ContactList.add | def add(contacts)
contact_ids = [contacts].flatten.uniq.compact.map(&:id)
response = Hubspot::Connection.post_json(ADD_CONTACT_PATH, params: { list_id: @id }, body: { vids: contact_ids })
response['updated'].sort == contact_ids.sort
end | ruby | def add(contacts)
contact_ids = [contacts].flatten.uniq.compact.map(&:id)
response = Hubspot::Connection.post_json(ADD_CONTACT_PATH, params: { list_id: @id }, body: { vids: contact_ids })
response['updated'].sort == contact_ids.sort
end | [
"def",
"add",
"(",
"contacts",
")",
"contact_ids",
"=",
"[",
"contacts",
"]",
".",
"flatten",
".",
"uniq",
".",
"compact",
".",
"map",
"(",
":id",
")",
"response",
"=",
"Hubspot",
"::",
"Connection",
".",
"post_json",
"(",
"ADD_CONTACT_PATH",
",",
"param... | {http://developers.hubspot.com/docs/methods/lists/add_contact_to_list} | [
"{",
"http",
":",
"//",
"developers",
".",
"hubspot",
".",
"com",
"/",
"docs",
"/",
"methods",
"/",
"lists",
"/",
"add_contact_to_list",
"}"
] | 8eb0a64dd0c14c79e631e81bfdc169583e775a46 | https://github.com/adimichele/hubspot-ruby/blob/8eb0a64dd0c14c79e631e81bfdc169583e775a46/lib/hubspot/contact_list.rb#L102-L106 | train | Add a list of contacts to the list | [
30522,
13366,
5587,
1006,
10402,
1007,
3967,
1035,
8909,
2015,
1027,
1031,
10402,
1033,
1012,
4257,
6528,
1012,
4895,
18515,
1012,
9233,
1012,
4949,
1006,
1004,
1024,
8909,
1007,
3433,
1027,
9594,
13102,
4140,
1024,
1024,
4434,
1012,
2695,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.cell | def cell(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'cell_for', &block)
define_method("#{name}") do
return platform.cell_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | ruby | def cell(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'cell_for', &block)
define_method("#{name}") do
return platform.cell_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | [
"def",
"cell",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'cell_for'",
",",
"block",
")",
"define_method",
"(",
"\"#{name}\"",
")",
"do",
"return",... | adds three methods - one to retrieve the text from a table cell,
another to return the table cell element, and another to check the cell's
existence.
@example
cell(:total, :id => 'total_cell')
# will generate 'total', 'total_element', and 'total?' methods
@param [Symbol] the name used for the generated meth... | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"text",
"from",
"a",
"table",
"cell",
"another",
"to",
"return",
"the",
"table",
"cell",
"element",
"and",
"another",
"to",
"check",
"the",
"cell",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L514-L520 | train | Creates a cell for the given name. | [
30522,
13366,
3526,
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,
3526,
1035,
2005,
1005,
1010,
1004,
3796,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/population_criteria.rb | HQMF2.PopulationCriteria.handle_observation_criteria | def handle_observation_criteria
exp = @entry.at_xpath('./cda:measureObservationDefinition/cda:value/cda:expression/@value',
HQMF2::Document::NAMESPACES)
# Measure Observations criteria rely on computed expressions. If it doesn't have one,
# then it is likely formatted impr... | ruby | def handle_observation_criteria
exp = @entry.at_xpath('./cda:measureObservationDefinition/cda:value/cda:expression/@value',
HQMF2::Document::NAMESPACES)
# Measure Observations criteria rely on computed expressions. If it doesn't have one,
# then it is likely formatted impr... | [
"def",
"handle_observation_criteria",
"exp",
"=",
"@entry",
".",
"at_xpath",
"(",
"'./cda:measureObservationDefinition/cda:value/cda:expression/@value'",
",",
"HQMF2",
"::",
"Document",
"::",
"NAMESPACES",
")",
"# Measure Observations criteria rely on computed expressions. If it does... | extracts out any measure observation definitons, creating from them the proper criteria to generate a precondition | [
"extracts",
"out",
"any",
"measure",
"observation",
"definitons",
"creating",
"from",
"them",
"the",
"proper",
"criteria",
"to",
"generate",
"a",
"precondition"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/population_criteria.rb#L69-L81 | train | Handle Measure Observations criteria | [
30522,
13366,
5047,
1035,
8089,
1035,
9181,
4654,
2361,
1027,
1030,
4443,
1012,
2012,
1035,
26726,
8988,
1006,
1005,
1012,
1013,
3729,
2050,
1024,
5468,
16429,
8043,
21596,
3207,
16294,
22753,
1013,
3729,
2050,
1024,
3643,
1013,
3729,
2050,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_hub/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb | Azure::EventHub::Mgmt::V2018_01_01_preview.Namespaces.get_ip_filter_rule | def get_ip_filter_rule(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:nil)
response = get_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_ip_filter_rule(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:nil)
response = get_ip_filter_rule_async(resource_group_name, namespace_name, ip_filter_rule_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_ip_filter_rule",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"ip_filter_rule_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_ip_filter_rule_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"ip_filter_rule_name",
... | Gets an IpFilterRule for a Namespace by rule name.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param namespace_name [String] The Namespace name
@param ip_filter_rule_name [String] The IP Filter Rule name.
@param custom_headers [Hash{String => String}] A hash of c... | [
"Gets",
"an",
"IpFilterRule",
"for",
"a",
"Namespace",
"by",
"rule",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_hub/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb#L844-L847 | train | Gets the specified ip filter rule. | [
30522,
13366,
2131,
1035,
12997,
1035,
11307,
1035,
3627,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
12997,
1035,
11307,
1035,
3627,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/volume.rb | Aws::EC2.Volume.delete | def delete(options = {})
options = options.merge(volume_id: @id)
resp = @client.delete_volume(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(volume_id: @id)
resp = @client.delete_volume(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"volume_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"delete_volume",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
volume.delete({
dry_run: false,
})
@param [Hash] options ({})
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the re... | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/volume.rb#L367-L371 | train | Delete a volume | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
3872,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
3872,
1006,
7047,
1007,
24501,
2361,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/uri.rb | Mongo.URI.auth_mech_props | def auth_mech_props(value)
properties = hash_extractor('authMechanismProperties', value)
if properties[:canonicalize_host_name]
properties.merge!(canonicalize_host_name:
%w(true TRUE).include?(properties[:canonicalize_host_name]))
end
properties
end | ruby | def auth_mech_props(value)
properties = hash_extractor('authMechanismProperties', value)
if properties[:canonicalize_host_name]
properties.merge!(canonicalize_host_name:
%w(true TRUE).include?(properties[:canonicalize_host_name]))
end
properties
end | [
"def",
"auth_mech_props",
"(",
"value",
")",
"properties",
"=",
"hash_extractor",
"(",
"'authMechanismProperties'",
",",
"value",
")",
"if",
"properties",
"[",
":canonicalize_host_name",
"]",
"properties",
".",
"merge!",
"(",
"canonicalize_host_name",
":",
"%w(",
"t... | Auth mechanism properties extractor.
@param value [ String ] The auth mechanism properties string.
@return [ Hash ] The auth mechanism properties hash. | [
"Auth",
"mechanism",
"properties",
"extractor",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/uri.rb#L666-L673 | train | Extract the properties of the authentication mechanism. | [
30522,
13366,
8740,
2705,
1035,
2033,
2818,
1035,
24387,
1006,
3643,
1007,
5144,
1027,
23325,
1035,
14817,
2953,
1006,
1005,
8740,
2705,
4168,
14856,
2964,
21572,
4842,
7368,
1005,
1010,
3643,
1007,
2065,
5144,
1031,
1024,
18562,
30524,
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... |
watir/watir | lib/watir/elements/select.rb | Watir.Select.include? | def include?(str_or_rx)
option(text: str_or_rx).exist? || option(label: str_or_rx).exist?
end | ruby | def include?(str_or_rx)
option(text: str_or_rx).exist? || option(label: str_or_rx).exist?
end | [
"def",
"include?",
"(",
"str_or_rx",
")",
"option",
"(",
"text",
":",
"str_or_rx",
")",
".",
"exist?",
"||",
"option",
"(",
"label",
":",
"str_or_rx",
")",
".",
"exist?",
"end"
] | Returns true if the select list has one or more options where text or label matches the given value.
@param [String, Regexp] str_or_rx
@return [Boolean] | [
"Returns",
"true",
"if",
"the",
"select",
"list",
"has",
"one",
"or",
"more",
"options",
"where",
"text",
"or",
"label",
"matches",
"the",
"given",
"value",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/elements/select.rb#L20-L22 | train | Returns true if the option with the given text or label exists in the current object. | [
30522,
13366,
2421,
1029,
1006,
2358,
2099,
1035,
2030,
1035,
1054,
2595,
1007,
5724,
1006,
3793,
1024,
2358,
2099,
1035,
2030,
1035,
1054,
2595,
1007,
1012,
4839,
1029,
1064,
1064,
5724,
1006,
3830,
1024,
2358,
2099,
1035,
2030,
1035,
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_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb | Azure::SQL::Mgmt::V2017_03_01_preview.LongTermRetentionBackups.begin_delete_with_http_info | def begin_delete_with_http_info(location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers:nil)
begin_delete_async(location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers:nil)
begin_delete_async(location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"location_name",
",",
"long_term_retention_server_name",
",",
"long_term_retention_database_name",
",",
"backup_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"location_name",
",",
"long_term_retention_server... | Deletes a long term retention backup.
@param location_name [String] The location of the database
@param long_term_retention_server_name [String] The name of the server
@param long_term_retention_database_name [String] The name of the database
@param backup_name [String] The backup name.
@param custom_headers [Has... | [
"Deletes",
"a",
"long",
"term",
"retention",
"backup",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb#L518-L520 | train | Deletes a long term retention policy. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
3295,
1035,
2171,
1010,
2146,
1035,
2744,
1035,
20125,
1035,
8241,
1035,
2171,
1010,
2146,
1035,
2744,
1035,
20125,
1035,
7809,
1035,
2171,
1010,
10200,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_reservations/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb | Azure::Reservations::Mgmt::V2017_11_01.Reservation.begin_split | def begin_split(reservation_order_id, body, custom_headers:nil)
response = begin_split_async(reservation_order_id, body, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_split(reservation_order_id, body, custom_headers:nil)
response = begin_split_async(reservation_order_id, body, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_split",
"(",
"reservation_order_id",
",",
"body",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_split_async",
"(",
"reservation_order_id",
",",
"body",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"... | Split the `Reservation`.
Split a `Reservation` into two `Reservation`s with specified quantity
distribution.
@param reservation_order_id [String] Order Id of the reservation
@param body [SplitRequest] Information needed to Split a reservation item
@param custom_headers [Hash{String => String}] A hash of custom... | [
"Split",
"the",
"Reservation",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_reservations/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb#L515-L518 | train | Splits the given reservation order by the number of words in the body. | [
30522,
13366,
4088,
1035,
3975,
1006,
11079,
1035,
2344,
1035,
8909,
1010,
2303,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3975,
1035,
2004,
6038,
2278,
1006,
11079,
1035,
2344,
1035,
8909,
1010,
2303,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.span | def span(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'span_for', &block)
define_method(name) do
return platform.span_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | ruby | def span(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'span_for', &block)
define_method(name) do
return platform.span_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | [
"def",
"span",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'span_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
"return",
"pla... | adds three methods - one to retrieve the text from a span,
another to return the span element, and another to check the span's existence.
@example
span(:alert, :id => 'alert')
# will generate 'alert', 'alert_element', and 'alert?' methods
@param [Symbol] the name used for the generated methods
@param [Hash]... | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"text",
"from",
"a",
"span",
"another",
"to",
"return",
"the",
"span",
"element",
"and",
"another",
"to",
"check",
"the",
"span",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L472-L478 | train | Creates a span method. | [
30522,
13366,
8487,
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,
8487,
1035,
2005,
1005,
1010,
1004,
3796,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.backup_key | def backup_key(vault_base_url, key_name, custom_headers:nil)
response = backup_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def backup_key(vault_base_url, key_name, custom_headers:nil)
response = backup_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"backup_key",
"(",
"vault_base_url",
",",
"key_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"backup_key_async",
"(",
"vault_base_url",
",",
"key_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",... | Requests that a backup of the specified key be downloaded to the client.
The Key Backup operation exports a key from Azure Key Vault in a protected
form. Note that this operation does NOT return key material in a form that
can be used outside the Azure Key Vault system, the returned key material is
either protecte... | [
"Requests",
"that",
"a",
"backup",
"of",
"the",
"specified",
"key",
"be",
"downloaded",
"to",
"the",
"client",
"."
] | 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#L1046-L1049 | train | Backup a key. | [
30522,
13366,
10200,
1035,
3145,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10200,
1035,
3145,
1035,
2004,
6038,
2278,
1006,
11632,
1035,
2918,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_term.rb | Azure::CognitiveServices::ContentModerator::V1_0.ListManagementTerm.delete_term_with_http_info | def delete_term_with_http_info(list_id, term, language, custom_headers:nil)
delete_term_async(list_id, term, language, custom_headers:custom_headers).value!
end | ruby | def delete_term_with_http_info(list_id, term, language, custom_headers:nil)
delete_term_async(list_id, term, language, custom_headers:custom_headers).value!
end | [
"def",
"delete_term_with_http_info",
"(",
"list_id",
",",
"term",
",",
"language",
",",
"custom_headers",
":",
"nil",
")",
"delete_term_async",
"(",
"list_id",
",",
"term",
",",
"language",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"end"
] | Deletes a term from the list with list Id equal to the list Id passed.
@param list_id [String] List Id of the image list.
@param term [String] Term to be deleted
@param language [String] Language of the terms.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP r... | [
"Deletes",
"a",
"term",
"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#L147-L149 | train | Deletes a list term. | [
30522,
13366,
3972,
12870,
1035,
2744,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2862,
1035,
8909,
1010,
2744,
1010,
2653,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3972,
12870,
1035,
2744,
1035,
2004,
6038,
2278,
1006,
2862,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/drawing/vml_drawing.rb | Axlsx.VmlDrawing.to_xml_string | def to_xml_string(str = '')
str << <<BAD_PROGRAMMER
<xml xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel">
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="#{@comments.worksheet.index+1}"/>
</o:shapelayout>
<v... | ruby | def to_xml_string(str = '')
str << <<BAD_PROGRAMMER
<xml xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel">
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="#{@comments.worksheet.index+1}"/>
</o:shapelayout>
<v... | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"str",
"<<",
"<<BAD_PROGRAMMER",
"#{",
"@comments",
".",
"worksheet",
".",
"index",
"+",
"1",
"}",
"BAD_PROGRAMMER",
"@comments",
".",
"each",
"{",
"|",
"comment",
"|",
"comment",
".",
"vml_shape",
".",
... | serialize the vml_drawing to xml.
@param [String] str
@return [String] | [
"serialize",
"the",
"vml_drawing",
"to",
"xml",
"."
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/vml_drawing.rb#L22-L39 | train | Convert the cell to XML | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
2358,
2099,
1026,
1026,
1026,
1026,
2919,
1035,
20273,
1026,
20950,
20950,
3619,
1024,
1058,
1027,
1000,
24471,
2078,
1024,
8040,
28433,
2015,
1011,
7513... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/racc | lib/racc/state.rb | Racc.State.srules | def srules
@srules ||= begin
closure.each_with_object(Hash.new { |h,k| h[k] = [] }) do |ptr, table|
next if ptr.reduce? || ptr.symbol.nonterminal?
table[ptr.symbol] << ptr
end
end
end | ruby | def srules
@srules ||= begin
closure.each_with_object(Hash.new { |h,k| h[k] = [] }) do |ptr, table|
next if ptr.reduce? || ptr.symbol.nonterminal?
table[ptr.symbol] << ptr
end
end
end | [
"def",
"srules",
"@srules",
"||=",
"begin",
"closure",
".",
"each_with_object",
"(",
"Hash",
".",
"new",
"{",
"|",
"h",
",",
"k",
"|",
"h",
"[",
"k",
"]",
"=",
"[",
"]",
"}",
")",
"do",
"|",
"ptr",
",",
"table",
"|",
"next",
"if",
"ptr",
".",
... | {Sym -> LocationPointers within rules which direct us to shift that Sym} | [
"{",
"Sym",
"-",
">",
"LocationPointers",
"within",
"rules",
"which",
"direct",
"us",
"to",
"shift",
"that",
"Sym",
"}"
] | d3244edfa11dd6e86e43f570c6444d41c7e3552a | https://github.com/ruby/racc/blob/d3244edfa11dd6e86e43f570c6444d41c7e3552a/lib/racc/state.rb#L547-L554 | train | Returns the array of the srules that are used to generate the result. | [
30522,
13366,
5034,
16308,
1030,
5034,
16308,
1064,
1064,
1027,
4088,
8503,
1012,
2169,
1035,
2007,
1035,
4874,
1006,
23325,
1012,
2047,
1063,
1064,
1044,
1010,
1047,
1064,
1044,
1031,
1047,
1033,
1027,
1031,
1033,
1065,
1007,
2079,
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 | management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/recovery_points.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2016_08_10.RecoveryPoints.list_by_replication_protected_items | def list_by_replication_protected_items(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:nil)
first_page = list_by_replication_protected_items_as_lazy(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:custom_headers)
first_page.get_a... | ruby | def list_by_replication_protected_items(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:nil)
first_page = list_by_replication_protected_items_as_lazy(fabric_name, protection_container_name, replicated_protected_item_name, custom_headers:custom_headers)
first_page.get_a... | [
"def",
"list_by_replication_protected_items",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"replicated_protected_item_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_replication_protected_items_as_lazy",
"(",
"fabric_name",
",",
"protect... | Get recovery points for a replication protected item.
Lists the available recovery points for a replication protected item.
@param fabric_name [String] The fabric name.
@param protection_container_name [String] The protection container name.
@param replicated_protected_item_name [String] The replication protected... | [
"Get",
"recovery",
"points",
"for",
"a",
"replication",
"protected",
"item",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/recovery_points.rb#L149-L152 | train | Gets all the items in the specified protection container. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
5123,
1035,
5167,
1006,
8313,
1035,
2171,
1010,
3860,
1035,
11661,
1035,
2171,
1010,
28024,
2094,
1035,
5123,
1035,
8875,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/session.rb | Mongo.Session.start_transaction | def start_transaction(options = nil)
if options
Lint.validate_read_concern_option(options[:read_concern])
end
check_if_ended!
if within_states?(STARTING_TRANSACTION_STATE, TRANSACTION_IN_PROGRESS_STATE)
raise Mongo::Error::InvalidTransactionOperation.new(
Mongo::Error... | ruby | def start_transaction(options = nil)
if options
Lint.validate_read_concern_option(options[:read_concern])
end
check_if_ended!
if within_states?(STARTING_TRANSACTION_STATE, TRANSACTION_IN_PROGRESS_STATE)
raise Mongo::Error::InvalidTransactionOperation.new(
Mongo::Error... | [
"def",
"start_transaction",
"(",
"options",
"=",
"nil",
")",
"if",
"options",
"Lint",
".",
"validate_read_concern_option",
"(",
"options",
"[",
":read_concern",
"]",
")",
"end",
"check_if_ended!",
"if",
"within_states?",
"(",
"STARTING_TRANSACTION_STATE",
",",
"TRAN... | Places subsequent operations in this session into a new transaction.
Note that the transaction will not be started on the server until an
operation is performed after start_transaction is called.
@example Start a new transaction
session.start_transaction(options)
@param [ Hash ] options The options for the tr... | [
"Places",
"subsequent",
"operations",
"in",
"this",
"session",
"into",
"a",
"new",
"transaction",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/session.rb#L580-L602 | train | Start a new transaction | [
30522,
13366,
2707,
1035,
12598,
1006,
7047,
1027,
9152,
2140,
1007,
2065,
7047,
11409,
2102,
1012,
9398,
3686,
1035,
3191,
1035,
5142,
1035,
5724,
1006,
7047,
1031,
1024,
3191,
1035,
5142,
1033,
1007,
2203,
4638,
1035,
2065,
1035,
3092,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
petergoldstein/dalli | lib/dalli/client.rb | Dalli.Client.perform | def perform(*all_args)
return yield if block_given?
op, key, *args = *all_args
key = key.to_s
key = validate_key(key)
begin
server = ring.server_for_key(key)
ret = server.request(op, key, *args)
ret
rescue NetworkError => e
Dalli.logger.debug { e.insp... | ruby | def perform(*all_args)
return yield if block_given?
op, key, *args = *all_args
key = key.to_s
key = validate_key(key)
begin
server = ring.server_for_key(key)
ret = server.request(op, key, *args)
ret
rescue NetworkError => e
Dalli.logger.debug { e.insp... | [
"def",
"perform",
"(",
"*",
"all_args",
")",
"return",
"yield",
"if",
"block_given?",
"op",
",",
"key",
",",
"*",
"args",
"=",
"all_args",
"key",
"=",
"key",
".",
"to_s",
"key",
"=",
"validate_key",
"(",
"key",
")",
"begin",
"server",
"=",
"ring",
".... | Chokepoint method for instrumentation | [
"Chokepoint",
"method",
"for",
"instrumentation"
] | 5755dbfd06e333a8239f976d4b10492b4555b726 | https://github.com/petergoldstein/dalli/blob/5755dbfd06e333a8239f976d4b10492b4555b726/lib/dalli/client.rb#L360-L375 | train | Perform a request to the server. | [
30522,
13366,
4685,
1006,
1008,
2035,
1035,
12098,
5620,
1007,
2709,
10750,
2065,
3796,
1035,
2445,
1029,
6728,
1010,
3145,
1010,
1008,
12098,
5620,
1027,
1008,
2035,
1035,
12098,
5620,
3145,
1027,
3145,
1012,
2000,
1035,
1055,
3145,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/server.rb | Mongo.Server.start_monitoring | def start_monitoring
publish_sdam_event(
Monitoring::SERVER_OPENING,
Monitoring::Event::ServerOpening.new(address, cluster.topology)
)
if options[:monitoring_io] != false
monitor.run!
ObjectSpace.define_finalizer(self, self.class.finalize(monitor))
end
end | ruby | def start_monitoring
publish_sdam_event(
Monitoring::SERVER_OPENING,
Monitoring::Event::ServerOpening.new(address, cluster.topology)
)
if options[:monitoring_io] != false
monitor.run!
ObjectSpace.define_finalizer(self, self.class.finalize(monitor))
end
end | [
"def",
"start_monitoring",
"publish_sdam_event",
"(",
"Monitoring",
"::",
"SERVER_OPENING",
",",
"Monitoring",
"::",
"Event",
"::",
"ServerOpening",
".",
"new",
"(",
"address",
",",
"cluster",
".",
"topology",
")",
")",
"if",
"options",
"[",
":monitoring_io",
"]... | Start monitoring the server.
Used internally by the driver to add a server to a cluster
while delaying monitoring until the server is in the cluster.
@api private | [
"Start",
"monitoring",
"the",
"server",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/server.rb#L225-L234 | train | Start monitoring | [
30522,
13366,
2707,
1035,
8822,
10172,
1035,
17371,
3286,
1035,
2724,
1006,
8822,
1024,
1024,
8241,
1035,
3098,
1010,
8822,
1024,
1024,
2724,
1024,
1024,
8241,
26915,
2075,
1012,
2047,
1006,
4769,
1010,
9324,
1012,
19587,
1007,
1007,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb | Azure::MixedReality::Mgmt::V2019_02_28_preview.SpatialAnchorsAccounts.regenerate_keys | def regenerate_keys(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:nil)
response = regenerate_keys_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:custom_headers).value!
response.body u... | ruby | def regenerate_keys(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:nil)
response = regenerate_keys_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:custom_headers).value!
response.body u... | [
"def",
"regenerate_keys",
"(",
"resource_group_name",
",",
"spatial_anchors_account_name",
",",
"spatial_anchors_account_key_regenerate",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"regenerate_keys_async",
"(",
"resource_group_name",
",",
"spatial_anchors_account_... | Regenerate 1 Key of a Spatial Anchors Account
@param resource_group_name [String] Name of an Azure resource group.
@param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
Anchors Account.
@param spatial_anchors_account_key_regenerate
[SpatialAnchorsAccountKeyRegenerateRequest] Specifying whi... | [
"Regenerate",
"1",
"Key",
"of",
"a",
"Spatial",
"Anchors",
"Account"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb#L745-L748 | train | Regenerate the key for the specified spatial anchors account. | [
30522,
13366,
19723,
24454,
3686,
1035,
6309,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
13589,
1035,
24674,
1035,
4070,
1035,
2171,
1010,
13589,
1035,
24674,
1035,
4070,
1035,
3145,
1035,
19723,
24454,
3686,
1010,
7661,
1035,
20346,
2015,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.list_site_detector_responses | def list_site_detector_responses(resource_group_name, site_name, custom_headers:nil)
first_page = list_site_detector_responses_as_lazy(resource_group_name, site_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_site_detector_responses(resource_group_name, site_name, custom_headers:nil)
first_page = list_site_detector_responses_as_lazy(resource_group_name, site_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_site_detector_responses",
"(",
"resource_group_name",
",",
"site_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_site_detector_responses_as_lazy",
"(",
"resource_group_name",
",",
"site_name",
",",
"custom_headers",
":custom_headers",
")... | List Site Detector Responses
List Site Detector Responses
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [A... | [
"List",
"Site",
"Detector",
"Responses"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L259-L262 | train | Gets all the detector responses for a site. | [
30522,
13366,
2862,
1035,
2609,
1035,
19034,
1035,
10960,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2609,
1035,
19034,
1035,
10960,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_graph_rbac/lib/1.6/generated/azure_graph_rbac/service_principals.rb | Azure::GraphRbac::V1_6.ServicePrincipals.list_password_credentials | def list_password_credentials(object_id, custom_headers:nil)
response = list_password_credentials_async(object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_password_credentials(object_id, custom_headers:nil)
response = list_password_credentials_async(object_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_password_credentials",
"(",
"object_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_password_credentials_async",
"(",
"object_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"respon... | Gets the passwordCredentials associated with a service principal.
@param object_id [String] The object ID of the service principal.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PasswordCredentialListResult] operation results. | [
"Gets",
"the",
"passwordCredentials",
"associated",
"with",
"a",
"service",
"principal",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/service_principals.rb#L668-L671 | train | Gets the password credentials for the specified object. | [
30522,
13366,
2862,
1035,
20786,
1035,
22496,
1006,
4874,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
20786,
1035,
22496,
1035,
2004,
6038,
2278,
1006,
4874,
1035,
8909,
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... |
sporkmonger/addressable | lib/addressable/uri.rb | Addressable.URI.to_s | def to_s
if self.scheme == nil && self.path != nil && !self.path.empty? &&
self.path =~ NORMPATH
raise InvalidURIError,
"Cannot assemble URI string with ambiguous path: '#{self.path}'"
end
@uri_string ||= begin
uri_string = String.new
uri_string << "#{self.s... | ruby | def to_s
if self.scheme == nil && self.path != nil && !self.path.empty? &&
self.path =~ NORMPATH
raise InvalidURIError,
"Cannot assemble URI string with ambiguous path: '#{self.path}'"
end
@uri_string ||= begin
uri_string = String.new
uri_string << "#{self.s... | [
"def",
"to_s",
"if",
"self",
".",
"scheme",
"==",
"nil",
"&&",
"self",
".",
"path",
"!=",
"nil",
"&&",
"!",
"self",
".",
"path",
".",
"empty?",
"&&",
"self",
".",
"path",
"=~",
"NORMPATH",
"raise",
"InvalidURIError",
",",
"\"Cannot assemble URI string with... | Converts the URI to a <code>String</code>.
@return [String] The URI's <code>String</code> representation. | [
"Converts",
"the",
"URI",
"to",
"a",
"<code",
">",
"String<",
"/",
"code",
">",
"."
] | 5894c95a7768435cb46d1355954611dbd194832e | https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/uri.rb#L2315-L2331 | train | Returns a new URI object with the given URI. | [
30522,
13366,
2000,
1035,
1055,
2065,
2969,
1012,
5679,
1027,
1027,
9152,
2140,
1004,
1004,
2969,
1012,
4130,
999,
1027,
9152,
2140,
1004,
1004,
999,
2969,
1012,
4130,
1012,
4064,
1029,
1004,
1004,
2969,
1012,
4130,
1027,
1066,
13373,
150... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/pull_requests/reviews.rb | Github.Client::PullRequests::Reviews.dismiss | def dismiss(*args)
arguments(args, required: [:user, :repo, :number, :id])
params = arguments.params
params["accept"] ||= PREVIEW_MEDIA
put_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/reviews/#{arguments.id}/dismissals", params)
end | ruby | def dismiss(*args)
arguments(args, required: [:user, :repo, :number, :id])
params = arguments.params
params["accept"] ||= PREVIEW_MEDIA
put_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/reviews/#{arguments.id}/dismissals", params)
end | [
"def",
"dismiss",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
",",
":number",
",",
":id",
"]",
")",
"params",
"=",
"arguments",
".",
"params",
"params",
"[",
"\"accept\"",
"]",
"||=",
"PREVIEW_MEDI... | @option params [String] :message
Optional string - Reason for dismissal
@example
github = Github.new oauth_token: '...'
github.pull_requests.reviews.dismiss 'user-name', 'repo-name', 'number', 'review-id'
message: "I can't get to this right now."
@api public | [
"@option",
"params",
"[",
"String",
"]",
":",
"message",
"Optional",
"string",
"-",
"Reason",
"for",
"dismissal"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/pull_requests/reviews.rb#L130-L137 | train | Dismiss a review | [
30522,
13366,
19776,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1010,
1024,
2193,
1010,
1024,
8909,
1033,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
11498,
524... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
libgit2/rugged | lib/rugged/submodule_collection.rb | Rugged.SubmoduleCollection.clone_submodule | def clone_submodule(repo, fetch_options)
# the remote was just added by setup_add, no need to check presence
repo.remotes['origin'].fetch(fetch_options)
repo.branches.create('master','origin/master')
repo.branches['master'].upstream = repo.branches['origin/master']
repo.checkout_head(str... | ruby | def clone_submodule(repo, fetch_options)
# the remote was just added by setup_add, no need to check presence
repo.remotes['origin'].fetch(fetch_options)
repo.branches.create('master','origin/master')
repo.branches['master'].upstream = repo.branches['origin/master']
repo.checkout_head(str... | [
"def",
"clone_submodule",
"(",
"repo",
",",
"fetch_options",
")",
"# the remote was just added by setup_add, no need to check presence",
"repo",
".",
"remotes",
"[",
"'origin'",
"]",
".",
"fetch",
"(",
"fetch_options",
")",
"repo",
".",
"branches",
".",
"create",
"(",... | currently libgit2's `git_submodule_add_setup` initializes a repo
with a workdir for the submodule. libgit2's `git_clone` however
requires the target for the clone to be an empty dir.
This provides a ghetto clone implementation that:
1. fetches the remote
2. sets up a master branch to be tracking origin/master
3.... | [
"currently",
"libgit2",
"s",
"git_submodule_add_setup",
"initializes",
"a",
"repo",
"with",
"a",
"workdir",
"for",
"the",
"submodule",
".",
"libgit2",
"s",
"git_clone",
"however",
"requires",
"the",
"target",
"for",
"the",
"clone",
"to",
"be",
"an",
"empty",
"... | 33873e5df2bd38501814182ff79609ed4bd88012 | https://github.com/libgit2/rugged/blob/33873e5df2bd38501814182ff79609ed4bd88012/lib/rugged/submodule_collection.rb#L43-L51 | train | Clone the submodule | [
30522,
13366,
17598,
1035,
4942,
5302,
8566,
2571,
1006,
16360,
2080,
1010,
18584,
1035,
7047,
1007,
1001,
1996,
6556,
2001,
2074,
2794,
2011,
16437,
1035,
5587,
1010,
2053,
2342,
2000,
4638,
3739,
16360,
2080,
1012,
6556,
2015,
1031,
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_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.begin_resume | def begin_resume(resource_group_name, name, custom_headers:nil)
first_page = begin_resume_as_lazy(resource_group_name, name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def begin_resume(resource_group_name, name, custom_headers:nil)
first_page = begin_resume_as_lazy(resource_group_name, name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"begin_resume",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"begin_resume_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
"first_page",
".",
"get_all_items... | Resume an App Service Environment.
Resume an App Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added... | [
"Resume",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L4635-L4638 | train | Resumes a virtual machine from a resource group. | [
30522,
13366,
4088,
1035,
13746,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
4088,
1035,
13746,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_scans.rb | Azure::SQL::Mgmt::V2017_10_01_preview.ManagedDatabaseVulnerabilityAssessmentScans.initiate_scan_async | def initiate_scan_async(resource_group_name, managed_instance_name, database_name, scan_id, custom_headers:nil)
# Send request
promise = begin_initiate_scan_async(resource_group_name, managed_instance_name, database_name, scan_id, custom_headers:custom_headers)
promise = promise.then do |response|
... | ruby | def initiate_scan_async(resource_group_name, managed_instance_name, database_name, scan_id, custom_headers:nil)
# Send request
promise = begin_initiate_scan_async(resource_group_name, managed_instance_name, database_name, scan_id, custom_headers:custom_headers)
promise = promise.then do |response|
... | [
"def",
"initiate_scan_async",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"database_name",
",",
"scan_id",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_initiate_scan_async",
"(",
"resource_group_name",
",",
"managed_i... | @param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param managed_instance_name [String] The name of the managed instance.
@param database_name [String] The name of the database.
@param scan_id ... | [
"@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",
"por... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_database_vulnerability_assessment_scans.rb#L272-L286 | train | Initializes a scan of a managed database. | [
30522,
13366,
17820,
1035,
13594,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
6013,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
13594,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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... |
ffaker/ffaker | lib/ffaker/identification_kr.rb | FFaker.IdentificationKr.rrn | def rrn
birth = fetch_sample([*Date.new(1970, 1, 1)..Date.new(1999, 12, 31)]).strftime('%y%d%m')
sex = fetch_sample([1, 2])
loc = FFaker.numerify("#{fetch_sample([*'00'..'95'])}###")
a, b, c, d, e, f, g, h, i, j, k, l = "#{birth}#{sex}#{loc}".split(//).map(&:to_i)
checksum = (11 - (2 * a +... | ruby | def rrn
birth = fetch_sample([*Date.new(1970, 1, 1)..Date.new(1999, 12, 31)]).strftime('%y%d%m')
sex = fetch_sample([1, 2])
loc = FFaker.numerify("#{fetch_sample([*'00'..'95'])}###")
a, b, c, d, e, f, g, h, i, j, k, l = "#{birth}#{sex}#{loc}".split(//).map(&:to_i)
checksum = (11 - (2 * a +... | [
"def",
"rrn",
"birth",
"=",
"fetch_sample",
"(",
"[",
"Date",
".",
"new",
"(",
"1970",
",",
"1",
",",
"1",
")",
"..",
"Date",
".",
"new",
"(",
"1999",
",",
"12",
",",
"31",
")",
"]",
")",
".",
"strftime",
"(",
"'%y%d%m'",
")",
"sex",
"=",
"fe... | Resident Registration Number
http://ko.wikipedia.org/wiki/%EC%A3%BC%EB%AF%BC%EB%93%B1%EB%A1%9D%EB%B2%88%ED%98%B8 | [
"Resident",
"Registration",
"Number",
"http",
":",
"//",
"ko",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"%EC%A3%BC%EB%AF%BC%EB%93%B1%EB%A1%9D%EB%B2%88%ED%98%B8"
] | 9570ac54874fec66a99b9c86401fb878f1e3e951 | https://github.com/ffaker/ffaker/blob/9570ac54874fec66a99b9c86401fb878f1e3e951/lib/ffaker/identification_kr.rb#L10-L17 | train | Returns the unique identifier for the record | [
30522,
13366,
25269,
2078,
4182,
1027,
18584,
1035,
7099,
1006,
1031,
1008,
3058,
1012,
2047,
1006,
3359,
1010,
1015,
1010,
1015,
1007,
1012,
1012,
3058,
1012,
2047,
1006,
2639,
1010,
2260,
1010,
2861,
1007,
1033,
1007,
1012,
2358,
12881,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.radio_button | def radio_button(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'radio_button_for', &block)
define_method("select_#{name}") do
return platform.select_radio(identifier.clone) unless block_given?
self.send("#{name}_element").select
end
define_method("#{n... | ruby | def radio_button(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'radio_button_for', &block)
define_method("select_#{name}") do
return platform.select_radio(identifier.clone) unless block_given?
self.send("#{name}_element").select
end
define_method("#{n... | [
"def",
"radio_button",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'radio_button_for'",
",",
"block",
")",
"define_method",
"(",
"\"select_#{name}\"",
"... | adds four methods - one to select, another to return if a radio button
is selected, another method to return a PageObject::Elements::RadioButton
object representing the radio button element, and another to check
the radio button's existence.
@example
radio_button(:north, :id => "north")
# will generate 'sele... | [
"adds",
"four",
"methods",
"-",
"one",
"to",
"select",
"another",
"to",
"return",
"if",
"a",
"radio",
"button",
"is",
"selected",
"another",
"method",
"to",
"return",
"a",
"PageObject",
"::",
"Elements",
"::",
"RadioButton",
"object",
"representing",
"the",
... | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L357-L367 | train | Creates a radio button | [
30522,
13366,
2557,
1035,
6462,
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,
2557,
1035,
6462,
1035,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/psych | lib/psych/scalar_scanner.rb | Psych.ScalarScanner.tokenize | def tokenize string
return nil if string.empty?
return string if @string_cache.key?(string)
return @symbol_cache[string] if @symbol_cache.key?(string)
case string
# Check for a String type, being careful not to get caught by hash keys, hex values, and
# special floats (e.g., -.inf).... | ruby | def tokenize string
return nil if string.empty?
return string if @string_cache.key?(string)
return @symbol_cache[string] if @symbol_cache.key?(string)
case string
# Check for a String type, being careful not to get caught by hash keys, hex values, and
# special floats (e.g., -.inf).... | [
"def",
"tokenize",
"string",
"return",
"nil",
"if",
"string",
".",
"empty?",
"return",
"string",
"if",
"@string_cache",
".",
"key?",
"(",
"string",
")",
"return",
"@symbol_cache",
"[",
"string",
"]",
"if",
"@symbol_cache",
".",
"key?",
"(",
"string",
")",
... | Create a new scanner
Tokenize +string+ returning the Ruby object | [
"Create",
"a",
"new",
"scanner",
"Tokenize",
"+",
"string",
"+",
"returning",
"the",
"Ruby",
"object"
] | f3a37e6bc1c2a98bfc9fafc389ea05622c744af9 | https://github.com/ruby/psych/blob/f3a37e6bc1c2a98bfc9fafc389ea05622c744af9/lib/psych/scalar_scanner.rb#L32-L111 | train | Parse a string into a Hash. | [
30522,
13366,
19204,
4697,
5164,
2709,
9152,
2140,
2065,
5164,
1012,
4064,
1029,
2709,
5164,
2065,
1030,
5164,
1035,
17053,
1012,
3145,
1029,
1006,
5164,
1007,
2709,
1030,
6454,
1035,
17053,
1031,
5164,
1033,
2065,
1030,
6454,
1035,
17053,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongoid | lib/mongoid/fields.rb | Mongoid.Fields.apply_default | def apply_default(name)
unless attributes.key?(name)
if field = fields[name]
default = field.eval_default(self)
unless default.nil? || field.lazy?
attribute_will_change!(name)
attributes[name] = default
end
end
end
end | ruby | def apply_default(name)
unless attributes.key?(name)
if field = fields[name]
default = field.eval_default(self)
unless default.nil? || field.lazy?
attribute_will_change!(name)
attributes[name] = default
end
end
end
end | [
"def",
"apply_default",
"(",
"name",
")",
"unless",
"attributes",
".",
"key?",
"(",
"name",
")",
"if",
"field",
"=",
"fields",
"[",
"name",
"]",
"default",
"=",
"field",
".",
"eval_default",
"(",
"self",
")",
"unless",
"default",
".",
"nil?",
"||",
"fi... | Applies a single default value for the given name.
@example Apply a single default.
model.apply_default("name")
@param [ String ] name The name of the field.
@since 2.4.0 | [
"Applies",
"a",
"single",
"default",
"value",
"for",
"the",
"given",
"name",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/fields.rb#L101-L111 | train | Apply default value to the object | [
30522,
13366,
6611,
1035,
12398,
1006,
2171,
1007,
4983,
12332,
1012,
3145,
1029,
1006,
2171,
1007,
2065,
2492,
1027,
4249,
1031,
2171,
1033,
12398,
1027,
2492,
1012,
9345,
2140,
1035,
12398,
1006,
2969,
1007,
4983,
12398,
1012,
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... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.ImageList.is_an_image_array | def is_an_image_array(ary)
Kernel.raise ArgumentError, "Magick::ImageList or array of Magick::Images required (#{ary.class} given)" unless ary.respond_to? :each
ary.each { |obj| is_an_image obj }
true
end | ruby | def is_an_image_array(ary)
Kernel.raise ArgumentError, "Magick::ImageList or array of Magick::Images required (#{ary.class} given)" unless ary.respond_to? :each
ary.each { |obj| is_an_image obj }
true
end | [
"def",
"is_an_image_array",
"(",
"ary",
")",
"Kernel",
".",
"raise",
"ArgumentError",
",",
"\"Magick::ImageList or array of Magick::Images required (#{ary.class} given)\"",
"unless",
"ary",
".",
"respond_to?",
":each",
"ary",
".",
"each",
"{",
"|",
"obj",
"|",
"is_an_im... | Ensure array is always an array of Magick::Image objects | [
"Ensure",
"array",
"is",
"always",
"an",
"array",
"of",
"Magick",
"::",
"Image",
"objects"
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L1240-L1244 | train | Returns true if the array is an image array | [
30522,
13366,
2003,
1035,
2019,
1035,
3746,
1035,
9140,
1006,
12098,
2100,
1007,
16293,
1012,
5333,
6685,
2121,
29165,
1010,
1000,
3894,
2243,
1024,
1024,
3746,
9863,
2030,
9140,
1997,
3894,
2243,
1024,
1024,
4871,
3223,
1006,
1001,
1063,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/users.rb | Azure::Labservices::Mgmt::V2018_10_15.Users.create_or_update | def create_or_update(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:nil)
response = create_or_update_async(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:nil)
response = create_or_update_async(resource_group_name, lab_account_name, lab_name, user_name, user, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
"user_name",
",",
"user",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"resource_group_name",
",",
"lab_account_name",
",",... | Create or replace an existing User.
@param resource_group_name [String] The name of the resource group.
@param lab_account_name [String] The name of the lab Account.
@param lab_name [String] The name of the lab.
@param user_name [String] The name of the user.
@param user [User] The User registered to a lab
@para... | [
"Create",
"or",
"replace",
"an",
"existing",
"User",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/users.rb#L260-L263 | train | Creates or updates a user in a lab. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
1035,
2171,
1010,
5310,
1035,
2171,
1010,
5310,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | frameit/lib/frameit/screenshot.rb | Frameit.Screenshot.device_name | def device_name
# rubocop:disable Require/MissingRequireStatement
sizes = Deliver::AppScreenshot::ScreenSize
case @screen_size
when sizes::IOS_65
return 'iPhone XS Max'
when sizes::IOS_61
return 'iPhone XR'
when sizes::IOS_58
return Frameit.config[:use_legacy_... | ruby | def device_name
# rubocop:disable Require/MissingRequireStatement
sizes = Deliver::AppScreenshot::ScreenSize
case @screen_size
when sizes::IOS_65
return 'iPhone XS Max'
when sizes::IOS_61
return 'iPhone XR'
when sizes::IOS_58
return Frameit.config[:use_legacy_... | [
"def",
"device_name",
"# rubocop:disable Require/MissingRequireStatement",
"sizes",
"=",
"Deliver",
"::",
"AppScreenshot",
"::",
"ScreenSize",
"case",
"@screen_size",
"when",
"sizes",
"::",
"IOS_65",
"return",
"'iPhone XS Max'",
"when",
"sizes",
"::",
"IOS_61",
"return",
... | the color to use for the frame (from Frameit::Color)
path: Path to screenshot
color: Color to use for the frame
Device name for a given screen size. Used to use the correct template | [
"the",
"color",
"to",
"use",
"for",
"the",
"frame",
"(",
"from",
"Frameit",
"::",
"Color",
")",
"path",
":",
"Path",
"to",
"screenshot",
"color",
":",
"Color",
"to",
"use",
"for",
"the",
"frame",
"Device",
"name",
"for",
"a",
"given",
"screen",
"size",... | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/frameit/lib/frameit/screenshot.rb#L28-L56 | train | Returns the device name for the current screen size. | [
30522,
13366,
5080,
1035,
2171,
1001,
14548,
24163,
2361,
1024,
4487,
19150,
5478,
1013,
4394,
2890,
15549,
28533,
3686,
3672,
10826,
1027,
8116,
1024,
1024,
18726,
24410,
19040,
1024,
1024,
12117,
4697,
2553,
1030,
3898,
1035,
2946,
2043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2018-04-01/generated/azure_mgmt_compute/log_analytics.rb | Azure::Compute::Mgmt::V2018_04_01.LogAnalytics.export_throttled_requests | def export_throttled_requests(parameters, location, custom_headers:nil)
response = export_throttled_requests_async(parameters, location, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def export_throttled_requests(parameters, location, custom_headers:nil)
response = export_throttled_requests_async(parameters, location, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"export_throttled_requests",
"(",
"parameters",
",",
"location",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"export_throttled_requests_async",
"(",
"parameters",
",",
"location",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"respo... | Export logs that show total throttled Api requests for this subscription in
the given time window.
@param parameters [ThrottledRequestsInput] Parameters supplied to the
LogAnalytics getThrottledRequests Api.
@param location [String] The location upon which virtual-machine-sizes is
queried.
@param custom_headers ... | [
"Export",
"logs",
"that",
"show",
"total",
"throttled",
"Api",
"requests",
"for",
"this",
"subscription",
"in",
"the",
"given",
"time",
"window",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/log_analytics.rb#L84-L87 | train | Export the throttling requests for the specified subscription. | [
30522,
13366,
9167,
1035,
24420,
2094,
1035,
11186,
1006,
11709,
1010,
3295,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
9167,
1035,
24420,
2094,
1035,
11186,
1035,
2004,
6038,
2278,
1006,
11709,
1010,
3295,
1010,
766... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/client.rb | Mongo.Client.list_mongo_databases | def list_mongo_databases(filter = {}, opts = {})
database_names(filter, opts).collect do |name|
Database.new(self, name, options)
end
end | ruby | def list_mongo_databases(filter = {}, opts = {})
database_names(filter, opts).collect do |name|
Database.new(self, name, options)
end
end | [
"def",
"list_mongo_databases",
"(",
"filter",
"=",
"{",
"}",
",",
"opts",
"=",
"{",
"}",
")",
"database_names",
"(",
"filter",
",",
"opts",
")",
".",
"collect",
"do",
"|",
"name",
"|",
"Database",
".",
"new",
"(",
"self",
",",
"name",
",",
"options",... | Returns a list of Mongo::Database objects.
@example Get a list of Mongo::Database objects.
client.list_mongo_databases
@param [ Hash ] filter The filter criteria for getting a list of databases.
@param [ Hash ] opts The command options.
@return [ Array<Mongo::Database> ] The list of database objects.
@since... | [
"Returns",
"a",
"list",
"of",
"Mongo",
"::",
"Database",
"objects",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/client.rb#L629-L633 | train | Returns a list of all the databases in the database system. | [
30522,
13366,
2862,
1035,
12256,
3995,
1035,
17881,
1006,
11307,
1027,
1063,
1065,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
7809,
1035,
3415,
1006,
11307,
1010,
23569,
2015,
1007,
1012,
8145,
2079,
1064,
2171,
1064,
7809,
1012,
2047,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | 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_event_list | def get_partition_event_list(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)
response = get_partition_event_list_async(partition_id, start_time_utc, end_time_utc, timeout:timeout, events_types_filter:eve... | ruby | def get_partition_event_list(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)
response = get_partition_event_list_async(partition_id, start_time_utc, end_time_utc, timeout:timeout, events_types_filter:eve... | [
"def",
"get_partition_event_list",
"(",
"partition_id",
",",
"start_time_utc",
",",
"end_time_utc",
",",
"timeout",
":",
"60",
",",
"events_types_filter",
":",
"nil",
",",
"exclude_analysis_events",
":",
"nil",
",",
"skip_correlation_lookup",
":",
"nil",
",",
"custo... | Gets a Partition-related events.
The response is list of PartitionEvent objects.
@param partition_id The identity of the partition.
@param start_time_utc [String] The start time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param end_time_utc [String] The end time of a lookup query in ISO UTC
yyyy-MM-ddTH... | [
"Gets",
"a",
"Partition",
"-",
"related",
"events",
"."
] | 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#L28532-L28535 | train | Gets the list of events for the specified partition. | [
30522,
13366,
2131,
1035,
13571,
1035,
2724,
1035,
2862,
1006,
13571,
1035,
8909,
1010,
2707,
1035,
2051,
1035,
11396,
1010,
2203,
1035,
2051,
1035,
11396,
1010,
2051,
5833,
1024,
3438,
1010,
2824,
1035,
4127,
1035,
11307,
1024,
9152,
2140,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"parameters",
",",
"custom_headers",
":c... | Update a VM scale set.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set to create or
update.
@param parameters [VirtualMachineScaleSetUpdate] The scale set object.
@param custom_headers [Hash{String => String}] A hash of custom head... | [
"Update",
"a",
"VM",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1383-L1385 | train | Updates a virtual machine scale set. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongoid | lib/mongoid/attributes.rb | Mongoid.Attributes.typed_value_for | def typed_value_for(key, value)
fields.key?(key) ? fields[key].mongoize(value) : value.mongoize
end | ruby | def typed_value_for(key, value)
fields.key?(key) ? fields[key].mongoize(value) : value.mongoize
end | [
"def",
"typed_value_for",
"(",
"key",
",",
"value",
")",
"fields",
".",
"key?",
"(",
"key",
")",
"?",
"fields",
"[",
"key",
"]",
".",
"mongoize",
"(",
"value",
")",
":",
"value",
".",
"mongoize",
"end"
] | Return the typecasted value for a field.
@example Get the value typecasted.
person.typed_value_for(:title, :sir)
@param [ String, Symbol ] key The field name.
@param [ Object ] value The uncast value.
@return [ Object ] The cast value.
@since 1.0.0 | [
"Return",
"the",
"typecasted",
"value",
"for",
"a",
"field",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/attributes.rb#L287-L289 | train | Returns the value for the given key. | [
30522,
13366,
21189,
1035,
3643,
1035,
2005,
1006,
3145,
1010,
3643,
1007,
4249,
1012,
3145,
1029,
1006,
3145,
1007,
1029,
4249,
1031,
3145,
1033,
1012,
12256,
3995,
4697,
1006,
3643,
1007,
1024,
3643,
1012,
12256,
3995,
4697,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.start_partition_restart_with_http_info | def start_partition_restart_with_http_info(service_id, partition_id, operation_id, restart_partition_mode, timeout:60, custom_headers:nil)
start_partition_restart_async(service_id, partition_id, operation_id, restart_partition_mode, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def start_partition_restart_with_http_info(service_id, partition_id, operation_id, restart_partition_mode, timeout:60, custom_headers:nil)
start_partition_restart_async(service_id, partition_id, operation_id, restart_partition_mode, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"start_partition_restart_with_http_info",
"(",
"service_id",
",",
"partition_id",
",",
"operation_id",
",",
"restart_partition_mode",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"start_partition_restart_async",
"(",
"service_id",
",",
"part... | This API will restart some or all replicas or instances of the specified
partition.
This API is useful for testing failover.
If used to target a stateless service partition, RestartPartitionMode must be
AllReplicasOrInstances.
Call the GetPartitionRestartProgress API using the same OperationId to get
the progr... | [
"This",
"API",
"will",
"restart",
"some",
"or",
"all",
"replicas",
"or",
"instances",
"of",
"the",
"specified",
"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#L21357-L21359 | train | Restarts the specified partition. | [
30522,
13366,
2707,
1035,
13571,
1035,
23818,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2326,
1035,
8909,
1010,
13571,
1035,
8909,
1010,
3169,
1035,
8909,
1010,
23818,
1035,
13571,
1035,
5549,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | samples/Ruby/sinatra.rb | Sinatra.Helpers.send_file | def send_file(path, opts={})
if opts[:type] or not response['Content-Type']
content_type opts[:type] || File.extname(path), :default => 'application/octet-stream'
end
if opts[:disposition] == 'attachment' || opts[:filename]
attachment opts[:filename] || path
elsif opts[:disposit... | ruby | def send_file(path, opts={})
if opts[:type] or not response['Content-Type']
content_type opts[:type] || File.extname(path), :default => 'application/octet-stream'
end
if opts[:disposition] == 'attachment' || opts[:filename]
attachment opts[:filename] || path
elsif opts[:disposit... | [
"def",
"send_file",
"(",
"path",
",",
"opts",
"=",
"{",
"}",
")",
"if",
"opts",
"[",
":type",
"]",
"or",
"not",
"response",
"[",
"'Content-Type'",
"]",
"content_type",
"opts",
"[",
":type",
"]",
"||",
"File",
".",
"extname",
"(",
"path",
")",
",",
... | Use the contents of the file at +path+ as the response body. | [
"Use",
"the",
"contents",
"of",
"the",
"file",
"at",
"+",
"path",
"+",
"as",
"the",
"response",
"body",
"."
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/samples/Ruby/sinatra.rb#L266-L287 | train | Send a file to the client | [
30522,
13366,
4604,
1035,
5371,
1006,
4130,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2065,
23569,
2015,
1031,
1024,
2828,
1033,
2030,
2025,
3433,
1031,
1005,
4180,
1011,
2828,
1005,
1033,
4180,
1035,
2828,
23569,
2015,
1031,
1024,
2828,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2017-03-01/generated/azure_mgmt_api_management/diagnostic.rb | Azure::ApiManagement::Mgmt::V2017_03_01.Diagnostic.head_with_http_info | def head_with_http_info(resource_group_name, service_name, diagnostic_id, custom_headers:nil)
head_async(resource_group_name, service_name, diagnostic_id, custom_headers:custom_headers).value!
end | ruby | def head_with_http_info(resource_group_name, service_name, diagnostic_id, custom_headers:nil)
head_async(resource_group_name, service_name, diagnostic_id, custom_headers:custom_headers).value!
end | [
"def",
"head_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"diagnostic_id",
",",
"custom_headers",
":",
"nil",
")",
"head_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"diagnostic_id",
",",
"custom_headers",
":custom_headers",
")... | Gets the entity state (Etag) version of the Diagnostic specified by its
identifier.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param diagnostic_id [String] Diagnostic identifier. Must be unique in the
current API Manage... | [
"Gets",
"the",
"entity",
"state",
"(",
"Etag",
")",
"version",
"of",
"the",
"Diagnostic",
"specified",
"by",
"its",
"identifier",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2017-03-01/generated/azure_mgmt_api_management/diagnostic.rb#L169-L171 | train | Gets the diagnostic specification. | [
30522,
13366,
2132,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
16474,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2132,
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... |
savonrb/savon | lib/savon/options.rb | Savon.GlobalOptions.log_level | def log_level(level)
levels = { :debug => 0, :info => 1, :warn => 2, :error => 3, :fatal => 4 }
unless levels.include? level
raise ArgumentError, "Invalid log level: #{level.inspect}\n" \
"Expected one of: #{levels.keys.inspect}"
end
@options[:logger].level... | ruby | def log_level(level)
levels = { :debug => 0, :info => 1, :warn => 2, :error => 3, :fatal => 4 }
unless levels.include? level
raise ArgumentError, "Invalid log level: #{level.inspect}\n" \
"Expected one of: #{levels.keys.inspect}"
end
@options[:logger].level... | [
"def",
"log_level",
"(",
"level",
")",
"levels",
"=",
"{",
":debug",
"=>",
"0",
",",
":info",
"=>",
"1",
",",
":warn",
"=>",
"2",
",",
":error",
"=>",
"3",
",",
":fatal",
"=>",
"4",
"}",
"unless",
"levels",
".",
"include?",
"level",
"raise",
"Argum... | Changes the Logger's log level. | [
"Changes",
"the",
"Logger",
"s",
"log",
"level",
"."
] | 0fa08fc30ecce2cd1109474bfcc14abf13a0c297 | https://github.com/savonrb/savon/blob/0fa08fc30ecce2cd1109474bfcc14abf13a0c297/lib/savon/options.rb#L206-L215 | train | Sets the log level for this logger. | [
30522,
13366,
8833,
1035,
2504,
1006,
2504,
1007,
3798,
1027,
1063,
1024,
2139,
8569,
2290,
1027,
1028,
1014,
1010,
1024,
18558,
1027,
1028,
1015,
1010,
1024,
11582,
1027,
1028,
1016,
1010,
1024,
7561,
1027,
1028,
1017,
1010,
1024,
10611,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
grpc/grpc | src/ruby/lib/grpc/generic/active_call.rb | GRPC.ActiveCall.send_status | def send_status(code = OK, details = '', assert_finished = false,
metadata: {})
send_initial_metadata
ops = {
SEND_STATUS_FROM_SERVER => Struct::Status.new(code, details, metadata)
}
ops[RECV_CLOSE_ON_SERVER] = nil if assert_finished
@call.run_batch(ops)
s... | ruby | def send_status(code = OK, details = '', assert_finished = false,
metadata: {})
send_initial_metadata
ops = {
SEND_STATUS_FROM_SERVER => Struct::Status.new(code, details, metadata)
}
ops[RECV_CLOSE_ON_SERVER] = nil if assert_finished
@call.run_batch(ops)
s... | [
"def",
"send_status",
"(",
"code",
"=",
"OK",
",",
"details",
"=",
"''",
",",
"assert_finished",
"=",
"false",
",",
"metadata",
":",
"{",
"}",
")",
"send_initial_metadata",
"ops",
"=",
"{",
"SEND_STATUS_FROM_SERVER",
"=>",
"Struct",
"::",
"Status",
".",
"n... | send_status sends a status to the remote endpoint.
@param code [int] the status code to send
@param details [String] details
@param assert_finished [true, false] when true(default), waits for
FINISHED.
@param metadata [Hash] metadata to send to the server. If a value is a
list, mulitple metadata for its key are ... | [
"send_status",
"sends",
"a",
"status",
"to",
"the",
"remote",
"endpoint",
"."
] | f3937f0e55227a4ef3a23f895d3b204a947610f8 | https://github.com/grpc/grpc/blob/f3937f0e55227a4ef3a23f895d3b204a947610f8/src/ruby/lib/grpc/generic/active_call.rb#L206-L217 | train | Send a status message to the server | [
30522,
13366,
4604,
1035,
3570,
1006,
3642,
1027,
7929,
1010,
4751,
1027,
1005,
1005,
1010,
20865,
1035,
2736,
1027,
6270,
1010,
27425,
1024,
1063,
30524,
2358,
6820,
6593,
1024,
1024,
3570,
1012,
2047,
1006,
3642,
1010,
4751,
1010,
27425,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb | Azure::Batch::Mgmt::V2017_09_01.PoolOperations.disable_auto_scale_with_http_info | def disable_auto_scale_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
disable_auto_scale_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
end | ruby | def disable_auto_scale_with_http_info(resource_group_name, account_name, pool_name, custom_headers:nil)
disable_auto_scale_async(resource_group_name, account_name, pool_name, custom_headers:custom_headers).value!
end | [
"def",
"disable_auto_scale_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"custom_headers",
":",
"nil",
")",
"disable_auto_scale_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"custom_headers",
":c... | Disables automatic scaling for a pool.
@param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param pool_name [String] The pool name. This must be unique within the
account.
@param custom_headers [Hash{Strin... | [
"Disables",
"automatic",
"scaling",
"for",
"a",
"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#L557-L559 | train | Disables auto scale of the specified pool. | [
30522,
13366,
4487,
19150,
1035,
8285,
1035,
4094,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4487,
19150,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
david942j/one_gadget | lib/one_gadget/helper.rb | OneGadget.Helper.comments_of_file | def comments_of_file(file)
File.readlines(file).map { |s| s[2..-1].rstrip if s.start_with?('# ') }.compact
end | ruby | def comments_of_file(file)
File.readlines(file).map { |s| s[2..-1].rstrip if s.start_with?('# ') }.compact
end | [
"def",
"comments_of_file",
"(",
"file",
")",
"File",
".",
"readlines",
"(",
"file",
")",
".",
"map",
"{",
"|",
"s",
"|",
"s",
"[",
"2",
"..",
"-",
"1",
"]",
".",
"rstrip",
"if",
"s",
".",
"start_with?",
"(",
"'# '",
")",
"}",
".",
"compact",
"e... | Fetch lines start with '#'.
@param [String] file
Filename.
@return [Array<String>]
Lines of comments. | [
"Fetch",
"lines",
"start",
"with",
"#",
"."
] | ff6ef04541e83441bfe3c2664a6febd1640f4263 | https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/helper.rb#L37-L39 | train | Returns the comments of the file | [
30522,
13366,
7928,
1035,
1997,
1035,
5371,
1006,
5371,
1007,
5371,
1012,
3191,
12735,
1006,
5371,
1007,
1012,
4949,
1063,
1064,
1055,
1064,
1055,
1031,
1016,
1012,
1012,
1011,
1015,
1033,
1012,
12667,
24901,
2065,
1055,
1012,
2707,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.get_intent_with_http_info | def get_intent_with_http_info(app_id, version_id, intent_id, custom_headers:nil)
get_intent_async(app_id, version_id, intent_id, custom_headers:custom_headers).value!
end | ruby | def get_intent_with_http_info(app_id, version_id, intent_id, custom_headers:nil)
get_intent_async(app_id, version_id, intent_id, custom_headers:custom_headers).value!
end | [
"def",
"get_intent_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"intent_id",
",",
"custom_headers",
":",
"nil",
")",
"get_intent_async",
"(",
"app_id",
",",
"version_id",
",",
"intent_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"e... | Gets information about the intent model 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 custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return... | [
"Gets",
"information",
"about",
"the",
"intent",
"model",
"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#L1839-L1841 | train | Gets the intent for the application version. | [
30522,
13366,
2131,
1035,
7848,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
7848,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
7848,
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 | 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.create_service_from_template | def create_service_from_template(application_id, service_from_template_description, timeout:60, custom_headers:nil)
response = create_service_from_template_async(application_id, service_from_template_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def create_service_from_template(application_id, service_from_template_description, timeout:60, custom_headers:nil)
response = create_service_from_template_async(application_id, service_from_template_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"create_service_from_template",
"(",
"application_id",
",",
"service_from_template_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_service_from_template_async",
"(",
"application_id",
",",
"service_from_templa... | Creates a Service Fabric service from the service template.
Creates a Service Fabric service from the service template defined in the
application manifest. A service template contains the properties that will be
same for the service instance of the same type. The API allows overriding the
properties that are usual... | [
"Creates",
"a",
"Service",
"Fabric",
"service",
"from",
"the",
"service",
"template",
"."
] | 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#L10260-L10263 | train | Creates a service from a template. | [
30522,
13366,
3443,
1035,
2326,
1035,
2013,
1035,
23561,
1006,
4646,
1035,
8909,
1010,
2326,
1035,
2013,
1035,
23561,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.get_custom_entity_role | def get_custom_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = get_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_custom_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = get_custom_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_custom_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_custom_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
... | Get one role for a given prebuilt entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id entity ID.
@param role_id entity role ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP ... | [
"Get",
"one",
"role",
"for",
"a",
"given",
"prebuilt",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L10967-L10970 | train | Gets the role for an entity in a version of the application. | [
30522,
13366,
2131,
1035,
7661,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
7661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
deivid-rodriguez/byebug | lib/byebug/history.rb | Byebug.History.restore | def restore
return unless File.exist?(Setting[:histfile])
File.readlines(Setting[:histfile]).reverse_each { |l| push(l.chomp) }
end | ruby | def restore
return unless File.exist?(Setting[:histfile])
File.readlines(Setting[:histfile]).reverse_each { |l| push(l.chomp) }
end | [
"def",
"restore",
"return",
"unless",
"File",
".",
"exist?",
"(",
"Setting",
"[",
":histfile",
"]",
")",
"File",
".",
"readlines",
"(",
"Setting",
"[",
":histfile",
"]",
")",
".",
"reverse_each",
"{",
"|",
"l",
"|",
"push",
"(",
"l",
".",
"chomp",
")... | Restores history from disk. | [
"Restores",
"history",
"from",
"disk",
"."
] | bf41a63858a648baa7fb621600d6451786d1572a | https://github.com/deivid-rodriguez/byebug/blob/bf41a63858a648baa7fb621600d6451786d1572a/lib/byebug/history.rb#L36-L40 | train | Restore the
file | [
30522,
13366,
9239,
2709,
4983,
5371,
1012,
4839,
1029,
1006,
4292,
1031,
1024,
2010,
24475,
9463,
1033,
1007,
5371,
1012,
3191,
12735,
1006,
4292,
1031,
1024,
2010,
24475,
9463,
1033,
1007,
1012,
7901,
1035,
2169,
1063,
1064,
1048,
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_replica_info_list | def get_replica_info_list(partition_id, continuation_token:nil, timeout:60, custom_headers:nil)
response = get_replica_info_list_async(partition_id, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_replica_info_list(partition_id, continuation_token:nil, timeout:60, custom_headers:nil)
response = get_replica_info_list_async(partition_id, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_replica_info_list",
"(",
"partition_id",
",",
"continuation_token",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_replica_info_list_async",
"(",
"partition_id",
",",
"continuation_token",
":continuatio... | Gets the information about replicas of a Service Fabric service partition.
The GetReplicas endpoint returns information about the replicas of the
specified partition. The response includes the id, role, status, health, node
name, uptime, and other details about the replica.
@param partition_id The identity of the... | [
"Gets",
"the",
"information",
"about",
"replicas",
"of",
"a",
"Service",
"Fabric",
"service",
"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#L14447-L14450 | train | Gets the replica info list for a partition. | [
30522,
13366,
2131,
1035,
15059,
1035,
18558,
1035,
2862,
1006,
13571,
1035,
8909,
1010,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
1505... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/utils.rb | Sprockets.Utils.dfs | def dfs(initial)
nodes, seen = Set.new, Set.new
stack = Array(initial).reverse
while node = stack.pop
if seen.include?(node)
nodes.add(node)
else
seen.add(node)
stack.push(node)
stack.concat(Array(yield node).reverse)
end
end
... | ruby | def dfs(initial)
nodes, seen = Set.new, Set.new
stack = Array(initial).reverse
while node = stack.pop
if seen.include?(node)
nodes.add(node)
else
seen.add(node)
stack.push(node)
stack.concat(Array(yield node).reverse)
end
end
... | [
"def",
"dfs",
"(",
"initial",
")",
"nodes",
",",
"seen",
"=",
"Set",
".",
"new",
",",
"Set",
".",
"new",
"stack",
"=",
"Array",
"(",
"initial",
")",
".",
"reverse",
"while",
"node",
"=",
"stack",
".",
"pop",
"if",
"seen",
".",
"include?",
"(",
"n... | Internal: Post-order Depth-First search algorithm.
Used for resolving asset dependencies.
initial - Initial Array of nodes to traverse.
block -
node - Current node to get children of
Returns a Set of nodes. | [
"Internal",
":",
"Post",
"-",
"order",
"Depth",
"-",
"First",
"search",
"algorithm",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/utils.rb#L157-L172 | train | Return a new set of nodes with the same name as the given initial. | [
30522,
13366,
1040,
10343,
1006,
3988,
1007,
14164,
1010,
2464,
1027,
2275,
1012,
2047,
1010,
2275,
1012,
2047,
9991,
1027,
9140,
1006,
3988,
1007,
1012,
7901,
2096,
13045,
1027,
9991,
1012,
3769,
2065,
2464,
1012,
2421,
1029,
1006,
13045,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
norman/friendly_id | lib/friendly_id/slugged.rb | FriendlyId.Slugged.normalize_friendly_id | def normalize_friendly_id(value)
value = value.to_s.parameterize
value = value[0...friendly_id_config.slug_limit] if friendly_id_config.slug_limit
value
end | ruby | def normalize_friendly_id(value)
value = value.to_s.parameterize
value = value[0...friendly_id_config.slug_limit] if friendly_id_config.slug_limit
value
end | [
"def",
"normalize_friendly_id",
"(",
"value",
")",
"value",
"=",
"value",
".",
"to_s",
".",
"parameterize",
"value",
"=",
"value",
"[",
"0",
"...",
"friendly_id_config",
".",
"slug_limit",
"]",
"if",
"friendly_id_config",
".",
"slug_limit",
"value",
"end"
] | Process the given value to make it suitable for use as a slug.
This method is not intended to be invoked directly; FriendlyId uses it
internally to process strings into slugs.
However, if FriendlyId's default slug generation doesn't suit your needs,
you can override this method in your model class to control exac... | [
"Process",
"the",
"given",
"value",
"to",
"make",
"it",
"suitable",
"for",
"use",
"as",
"a",
"slug",
"."
] | 67422c04e1bfed4207b2a04826bc67ec0e231ce7 | https://github.com/norman/friendly_id/blob/67422c04e1bfed4207b2a04826bc67ec0e231ce7/lib/friendly_id/slugged.rb#L290-L294 | train | Normalize the value to a string. | [
30522,
13366,
3671,
4697,
1035,
5379,
1035,
8909,
1006,
3643,
1007,
3643,
1027,
3643,
1012,
2000,
1035,
1055,
1012,
16381,
4697,
3643,
1027,
3643,
1031,
1014,
1012,
1012,
1012,
5379,
1035,
8909,
1035,
9530,
8873,
2290,
1012,
23667,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb | Azure::Resources::Mgmt::V2016_02_01.Resources.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, p... | ruby | def begin_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil)
begin_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, p... | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"resource_provider_namespace",
",",
"parent_resource_path",
",",
"resource_type",
",",
"resource_name",
",",
"api_version",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async"... | Updates a resource.
@param resource_group_name [String] The name of the resource group for the
resource. The name is case insensitive.
@param resource_provider_namespace [String] The namespace of the resource
provider.
@param parent_resource_path [String] The parent resource identity.
@param resource_type [Strin... | [
"Updates",
"a",
"resource",
"."
] | 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#L805-L807 | train | Updates a resource in the specified resource group. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
10802,
1035,
3415,
15327,
1010,
6687,
1035,
7692,
1035,
4130,
1010,
7692,
1035,
2828,
1010,
7692,
1035,
2171,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | frameit/lib/frameit/editor.rb | Frameit.Editor.generate_background | def generate_background
background = MiniMagick::Image.open(fetch_config['background'])
if background.height != screenshot.size[1]
background.resize("#{screenshot.size[0]}x#{screenshot.size[1]}^") # `^` says it should fill area
background.merge!(["-gravity", "center", "-crop", "#{screenshot... | ruby | def generate_background
background = MiniMagick::Image.open(fetch_config['background'])
if background.height != screenshot.size[1]
background.resize("#{screenshot.size[0]}x#{screenshot.size[1]}^") # `^` says it should fill area
background.merge!(["-gravity", "center", "-crop", "#{screenshot... | [
"def",
"generate_background",
"background",
"=",
"MiniMagick",
"::",
"Image",
".",
"open",
"(",
"fetch_config",
"[",
"'background'",
"]",
")",
"if",
"background",
".",
"height",
"!=",
"screenshot",
".",
"size",
"[",
"1",
"]",
"background",
".",
"resize",
"("... | Returns a correctly sized background image | [
"Returns",
"a",
"correctly",
"sized",
"background",
"image"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/frameit/lib/frameit/editor.rb#L251-L259 | train | Generate the background image for the image | [
30522,
13366,
9699,
1035,
4281,
4281,
1027,
7163,
2863,
12863,
2243,
1024,
1024,
3746,
1012,
2330,
1006,
18584,
1035,
9530,
8873,
2290,
1031,
1005,
4281,
1005,
1033,
1007,
2065,
4281,
1012,
4578,
999,
1027,
12117,
12326,
1012,
2946,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.get_tagged_image_count | def get_tagged_image_count(project_id, iteration_id:nil, tag_ids:nil, custom_headers:nil)
response = get_tagged_image_count_async(project_id, iteration_id:iteration_id, tag_ids:tag_ids, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_tagged_image_count(project_id, iteration_id:nil, tag_ids:nil, custom_headers:nil)
response = get_tagged_image_count_async(project_id, iteration_id:iteration_id, tag_ids:tag_ids, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_tagged_image_count",
"(",
"project_id",
",",
"iteration_id",
":",
"nil",
",",
"tag_ids",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_tagged_image_count_async",
"(",
"project_id",
",",
"iteration_id",
":iteration_id",
",",
... | Gets the number of images tagged with the provided {tagIds}.
The filtering is on an and/or relationship. For example, if the provided tag
ids are for the "Dog" and
"Cat" tags, then only images tagged with Dog and/or Cat will be returned
@param project_id The project id.
@param iteration_id The iteration id. Defa... | [
"Gets",
"the",
"number",
"of",
"images",
"tagged",
"with",
"the",
"provided",
"{",
"tagIds",
"}",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb#L319-L322 | train | Gets the number of images tagged by a given project iteration. | [
30522,
13366,
2131,
1035,
26610,
1035,
3746,
1035,
4175,
1006,
2622,
1035,
8909,
1010,
27758,
1035,
8909,
1024,
9152,
2140,
1010,
6415,
1035,
8909,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
bblimke/webmock | lib/webmock/request_pattern.rb | WebMock.BodyPattern.matching_body_hashes? | def matching_body_hashes?(query_parameters, pattern, content_type)
return false unless query_parameters.is_a?(Hash)
return false unless query_parameters.keys.sort == pattern.keys.sort
query_parameters.each do |key, actual|
expected = pattern[key]
if actual.is_a?(Hash) && expected.is_a... | ruby | def matching_body_hashes?(query_parameters, pattern, content_type)
return false unless query_parameters.is_a?(Hash)
return false unless query_parameters.keys.sort == pattern.keys.sort
query_parameters.each do |key, actual|
expected = pattern[key]
if actual.is_a?(Hash) && expected.is_a... | [
"def",
"matching_body_hashes?",
"(",
"query_parameters",
",",
"pattern",
",",
"content_type",
")",
"return",
"false",
"unless",
"query_parameters",
".",
"is_a?",
"(",
"Hash",
")",
"return",
"false",
"unless",
"query_parameters",
".",
"keys",
".",
"sort",
"==",
"... | Compare two hashes for equality
For two hashes to match they must have the same length and all
values must match when compared using `#===`.
The following hashes are examples of matches:
{a: /\d+/} and {a: '123'}
{a: '123'} and {a: '123'}
{a: {b: /\d+/}} and {a: {b: '123'}}
{a: {b: 'wow'}} ... | [
"Compare",
"two",
"hashes",
"for",
"equality"
] | c0bcc09af372286cd110ec4159112ce583007951 | https://github.com/bblimke/webmock/blob/c0bcc09af372286cd110ec4159112ce583007951/lib/webmock/request_pattern.rb#L310-L324 | train | Returns true if the query parameters match the pattern. | [
30522,
13366,
9844,
1035,
2303,
1035,
23325,
2229,
1029,
1006,
23032,
1035,
11709,
1010,
5418,
1010,
4180,
1035,
2828,
1007,
2709,
6270,
4983,
23032,
1035,
11709,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
2709,
6270,
4983,
23032,
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... |
sds/haml-lint | lib/haml_lint/linter.rb | HamlLint.Linter.inline_content_is_string? | def inline_content_is_string?(node)
tag_with_inline_content = tag_with_inline_text(node)
inline_content = inline_node_content(node)
index = tag_with_inline_content.rindex(inline_content) - 1
%w[' "].include?(tag_with_inline_content[index])
end | ruby | def inline_content_is_string?(node)
tag_with_inline_content = tag_with_inline_text(node)
inline_content = inline_node_content(node)
index = tag_with_inline_content.rindex(inline_content) - 1
%w[' "].include?(tag_with_inline_content[index])
end | [
"def",
"inline_content_is_string?",
"(",
"node",
")",
"tag_with_inline_content",
"=",
"tag_with_inline_text",
"(",
"node",
")",
"inline_content",
"=",
"inline_node_content",
"(",
"node",
")",
"index",
"=",
"tag_with_inline_content",
".",
"rindex",
"(",
"inline_content",... | Returns whether the inline content for a node is a string.
For example, the following node has a literal string:
%tag= "A literal #{string}"
whereas this one does not:
%tag A literal #{string}
@param node [HamlLint::Tree::Node]
@return [true,false] | [
"Returns",
"whether",
"the",
"inline",
"content",
"for",
"a",
"node",
"is",
"a",
"string",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/linter.rb#L118-L125 | train | Returns true if the inline content of the node is a string. | [
30522,
13366,
23881,
1035,
4180,
1035,
2003,
1035,
5164,
1029,
1006,
13045,
1007,
6415,
1035,
2007,
1035,
23881,
1035,
4180,
1027,
6415,
1035,
2007,
1035,
23881,
1035,
3793,
1006,
13045,
1007,
23881,
1035,
4180,
1027,
23881,
1035,
13045,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.