repo stringclasses 237 values | path stringlengths 11 168 | func_name stringlengths 10 147 | original_string stringlengths 79 124k | language stringclasses 1 value | code stringlengths 79 124k | code_tokens listlengths 16 45.3k | docstring stringlengths 4 23.5k | docstring_tokens listlengths 1 452 | sha stringclasses 237 values | url stringlengths 95 268 | partition stringclasses 1 value | summary stringlengths 8 229 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fastlane/fastlane | deliver/lib/deliver/runner.rb | Deliver.Runner.verify_version | def verify_version
app_version = options[:app_version]
UI.message("Making sure the latest version on App Store Connect matches '#{app_version}' from the ipa file...")
changed = options[:app].ensure_version!(app_version, platform: options[:platform])
if changed
UI.success("Successfully set the version to '#{app_version}'")
else
UI.success("'#{app_version}' is the latest version on App Store Connect")
end
end | ruby | def verify_version
app_version = options[:app_version]
UI.message("Making sure the latest version on App Store Connect matches '#{app_version}' from the ipa file...")
changed = options[:app].ensure_version!(app_version, platform: options[:platform])
if changed
UI.success("Successfully set the version to '#{app_version}'")
else
UI.success("'#{app_version}' is the latest version on App Store Connect")
end
end | [
"def",
"verify_version",
"app_version",
"=",
"options",
"[",
":app_version",
"]",
"UI",
".",
"message",
"(",
"\"Making sure the latest version on App Store Connect matches '#{app_version}' from the ipa file...\"",
")",
"changed",
"=",
"options",
"[",
":app",
"]",
".",
"ensu... | Make sure the version on App Store Connect matches the one in the ipa
If not, the new version will automatically be created | [
"Make",
"sure",
"the",
"version",
"on",
"App",
"Store",
"Connect",
"matches",
"the",
"one",
"in",
"the",
"ipa",
"If",
"not",
"the",
"new",
"version",
"will",
"automatically",
"be",
"created"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/deliver/lib/deliver/runner.rb#L88-L99 | train | verify the version of the app | [
30522,
13366,
20410,
1035,
2544,
10439,
1035,
2544,
1027,
7047,
1031,
1024,
10439,
1035,
2544,
1033,
21318,
1012,
4471,
1006,
1000,
2437,
2469,
1996,
6745,
2544,
2006,
10439,
3573,
7532,
3503,
1005,
1001,
1063,
10439,
1035,
2544,
1065,
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_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/server_endpoints.rb | Azure::StorageSync::Mgmt::V2018_07_01.ServerEndpoints.begin_update | def begin_update(resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters:nil, custom_headers:nil)
response = begin_update_async(resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters:parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update(resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters:nil, custom_headers:nil)
response = begin_update_async(resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters:parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"sync_group_name",
",",
"server_endpoint_name",
",",
"parameters",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_async",
"(",
"resource_group_n... | Patch a given ServerEndpoint.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param storage_sync_service_name [String] Name of Storage Sync Service
resource.
@param sync_group_name [String] Name of Sync Group resource.
@param server_endpoint_name [String] Name of Server Endpoint object.
@param parameters [ServerEndpointUpdateParameters] Any of the properties
applicable in PUT request.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ServerEndpoint] operation results. | [
"Patch",
"a",
"given",
"ServerEndpoint",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/server_endpoints.rb#L585-L588 | train | Updates a server endpoint in a sync group. | [
30522,
13366,
4088,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5527,
1035,
26351,
1035,
2326,
1035,
2171,
1010,
26351,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2203,
8400,
1035,
2171,
1010,
11709,
1024,
9152,
2140,
1010,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb | Azure::SQL::Mgmt::V2014_04_01.Databases.list_by_recommended_elastic_pool_with_http_info | def list_by_recommended_elastic_pool_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:nil)
list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:custom_headers).value!
end | ruby | def list_by_recommended_elastic_pool_with_http_info(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:nil)
list_by_recommended_elastic_pool_async(resource_group_name, server_name, recommended_elastic_pool_name, custom_headers:custom_headers).value!
end | [
"def",
"list_by_recommended_elastic_pool_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"recommended_elastic_pool_name",
",",
"custom_headers",
":",
"nil",
")",
"list_by_recommended_elastic_pool_async",
"(",
"resource_group_name",
",",
"server_name",
",",
... | Returns a list of databases inside a recommended elastic pool.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param recommended_elastic_pool_name [String] The name of the recommended
elastic pool to be retrieved.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Returns",
"a",
"list",
"of",
"databases",
"inside",
"a",
"recommended",
"elastic",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb#L892-L894 | train | Gets the list of all the elastic pool resources in a server. | [
30522,
13366,
2862,
1035,
2011,
1035,
6749,
1035,
21274,
1035,
4770,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
6749,
1035,
21274,
1035,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb | Azure::CDN::Mgmt::V2015_06_01.Endpoints.begin_purge_content | def begin_purge_content(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers:nil)
response = begin_purge_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_purge_content(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers:nil)
response = begin_purge_content_async(endpoint_name, content_file_paths, profile_name, resource_group_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_purge_content",
"(",
"endpoint_name",
",",
"content_file_paths",
",",
"profile_name",
",",
"resource_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_purge_content_async",
"(",
"endpoint_name",
",",
"content_file_paths",
",",
"p... | Forcibly purges CDN endpoint content.
@param endpoint_name [String] Name of the endpoint within the CDN profile.
@param content_file_paths [PurgeParameters] The path to the content to be
purged. Path can describe a file or directory.
@param profile_name [String] Name of the CDN profile within the resource
group.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Forcibly",
"purges",
"CDN",
"endpoint",
"content",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb#L1259-L1262 | train | Purges the content of the specified endpoint. | [
30522,
13366,
4088,
1035,
24694,
1035,
4180,
1006,
2203,
8400,
1035,
2171,
1010,
4180,
1035,
5371,
1035,
10425,
1010,
6337,
1035,
2171,
1010,
7692,
1035,
2177,
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... |
decidim/decidim | decidim-core/app/helpers/decidim/component_path_helper.rb | Decidim.ComponentPathHelper.manage_component_path | def manage_component_path(component)
current_params = try(:params) || {}
EngineRouter.admin_proxy(component).root_path(locale: current_params[:locale])
end | ruby | def manage_component_path(component)
current_params = try(:params) || {}
EngineRouter.admin_proxy(component).root_path(locale: current_params[:locale])
end | [
"def",
"manage_component_path",
"(",
"component",
")",
"current_params",
"=",
"try",
"(",
":params",
")",
"||",
"{",
"}",
"EngineRouter",
".",
"admin_proxy",
"(",
"component",
")",
".",
"root_path",
"(",
"locale",
":",
"current_params",
"[",
":locale",
"]",
... | Returns the defined admin root path for a given component.
component - the Component we want to find the root path for.
Returns a relative url. | [
"Returns",
"the",
"defined",
"admin",
"root",
"path",
"for",
"a",
"given",
"component",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/component_path_helper.rb#L31-L34 | train | manage_component_path returns the root path for the given component | [
30522,
13366,
6133,
1035,
6922,
1035,
4130,
1006,
6922,
1007,
2783,
1035,
11498,
5244,
1027,
3046,
1006,
1024,
11498,
5244,
1007,
1064,
1064,
1063,
1065,
3194,
22494,
3334,
1012,
4748,
10020,
1035,
24540,
1006,
6922,
1007,
1012,
7117,
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 | supply/lib/supply/uploader.rb | Supply.Uploader.check_superseded_tracks | def check_superseded_tracks(apk_version_codes)
UI.message("Checking superseded tracks, uploading '#{apk_version_codes}' to '#{Supply.config[:track]}'...")
max_apk_version_code = apk_version_codes.max
max_tracks_version_code = nil
tracks = ["production", "rollout", "beta", "alpha", "internal"]
config_track_index = tracks.index(Supply.config[:track])
# Custom "closed" tracks are now allowed (https://support.google.com/googleplay/android-developer/answer/3131213)
# Custom tracks have an equal level with alpha (alpha is considered a closed track as well)
# If a track index is not found, we will assume is a custom track so an alpha index is given
config_track_index = tracks.index("alpha") unless config_track_index
tracks.each_index do |track_index|
track = tracks[track_index]
track_version_codes = client.track_version_codes(track).sort
UI.verbose("Found '#{track_version_codes}' on track '#{track}'")
next if track_index.eql?(config_track_index)
next if track_version_codes.empty?
if max_tracks_version_code.nil?
max_tracks_version_code = track_version_codes.max
end
removed_version_codes = track_version_codes.take_while do |v|
v < max_tracks_version_code || (v < max_apk_version_code && track_index > config_track_index)
end
next if removed_version_codes.empty?
keep_version_codes = track_version_codes - removed_version_codes
max_tracks_version_code = keep_version_codes[0] unless keep_version_codes.empty?
client.update_track(track, 1.0, keep_version_codes)
UI.message("Superseded track '#{track}', removed '#{removed_version_codes}'")
end
end | ruby | def check_superseded_tracks(apk_version_codes)
UI.message("Checking superseded tracks, uploading '#{apk_version_codes}' to '#{Supply.config[:track]}'...")
max_apk_version_code = apk_version_codes.max
max_tracks_version_code = nil
tracks = ["production", "rollout", "beta", "alpha", "internal"]
config_track_index = tracks.index(Supply.config[:track])
# Custom "closed" tracks are now allowed (https://support.google.com/googleplay/android-developer/answer/3131213)
# Custom tracks have an equal level with alpha (alpha is considered a closed track as well)
# If a track index is not found, we will assume is a custom track so an alpha index is given
config_track_index = tracks.index("alpha") unless config_track_index
tracks.each_index do |track_index|
track = tracks[track_index]
track_version_codes = client.track_version_codes(track).sort
UI.verbose("Found '#{track_version_codes}' on track '#{track}'")
next if track_index.eql?(config_track_index)
next if track_version_codes.empty?
if max_tracks_version_code.nil?
max_tracks_version_code = track_version_codes.max
end
removed_version_codes = track_version_codes.take_while do |v|
v < max_tracks_version_code || (v < max_apk_version_code && track_index > config_track_index)
end
next if removed_version_codes.empty?
keep_version_codes = track_version_codes - removed_version_codes
max_tracks_version_code = keep_version_codes[0] unless keep_version_codes.empty?
client.update_track(track, 1.0, keep_version_codes)
UI.message("Superseded track '#{track}', removed '#{removed_version_codes}'")
end
end | [
"def",
"check_superseded_tracks",
"(",
"apk_version_codes",
")",
"UI",
".",
"message",
"(",
"\"Checking superseded tracks, uploading '#{apk_version_codes}' to '#{Supply.config[:track]}'...\"",
")",
"max_apk_version_code",
"=",
"apk_version_codes",
".",
"max",
"max_tracks_version_code... | Remove any version codes that is:
- Lesser than the greatest of any later (i.e. production) track
- Or lesser than the currently being uploaded if it's in an earlier (i.e. alpha) track | [
"Remove",
"any",
"version",
"codes",
"that",
"is",
":",
"-",
"Lesser",
"than",
"the",
"greatest",
"of",
"any",
"later",
"(",
"i",
".",
"e",
".",
"production",
")",
"track",
"-",
"Or",
"lesser",
"than",
"the",
"currently",
"being",
"uploaded",
"if",
"it... | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/supply/lib/supply/uploader.rb#L237-L273 | train | Check that the apk version codes are valid for the track | [
30522,
13366,
4638,
1035,
19886,
1035,
3162,
1006,
9706,
2243,
1035,
2544,
1035,
9537,
1007,
21318,
1012,
4471,
1006,
1000,
9361,
19886,
3162,
1010,
2039,
18570,
1005,
1001,
1063,
9706,
2243,
1035,
2544,
1035,
9537,
1065,
1005,
2000,
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 | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.list_models_with_http_info | def list_models_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_models_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | ruby | def list_models_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_models_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | [
"def",
"list_models_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"0",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"list_models_async",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"skip",
",",
"take",
":"... | Gets information about all the intent and entity models in a version of the
application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param skip [Integer] The number of entries to skip. Default value is 0.
@param take [Integer] The number of entries to return. Maximum page size is
500. Default is 100.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"information",
"about",
"all",
"the",
"intent",
"and",
"entity",
"models",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L1595-L1597 | train | Gets the list of models for the application version. | [
30522,
13366,
2862,
1035,
4275,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
13558,
1024,
1014,
1010,
2202,
1024,
2531,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
1035,
4275,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_advisor/lib/2017-04-19/generated/azure_mgmt_advisor/configurations.rb | Azure::Advisor::Mgmt::V2017_04_19.Configurations.create_in_resource_group | def create_in_resource_group(config_contract, resource_group, custom_headers:nil)
response = create_in_resource_group_async(config_contract, resource_group, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_in_resource_group(config_contract, resource_group, custom_headers:nil)
response = create_in_resource_group_async(config_contract, resource_group, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_in_resource_group",
"(",
"config_contract",
",",
"resource_group",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_in_resource_group_async",
"(",
"config_contract",
",",
"resource_group",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Create/Overwrite Azure Advisor configuration.
@param config_contract [ConfigData] The Azure Advisor configuration data
structure.
@param resource_group [String] The name of the Azure resource group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ARMErrorResponseBody] operation results. | [
"Create",
"/",
"Overwrite",
"Azure",
"Advisor",
"configuration",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_advisor/lib/2017-04-19/generated/azure_mgmt_advisor/configurations.rb#L323-L326 | train | Creates a new virtual network interface in the specified resource group. | [
30522,
13366,
3443,
1035,
1999,
1035,
7692,
1035,
2177,
1006,
9530,
8873,
2290,
1035,
3206,
1010,
7692,
1035,
2177,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
1999,
1035,
7692,
1035,
2177,
1035,
2004,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/instance_profile.rb | Aws::IAM.InstanceProfile.remove_role | def remove_role(options = {})
options = options.merge(instance_profile_name: @name)
resp = @client.remove_role_from_instance_profile(options)
resp.data
end | ruby | def remove_role(options = {})
options = options.merge(instance_profile_name: @name)
resp = @client.remove_role_from_instance_profile(options)
resp.data
end | [
"def",
"remove_role",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"instance_profile_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"remove_role_from_instance_profile",
"(",
"options",
")",
"resp",
".",
"data",
"e... | @example Request syntax with placeholder values
instance_profile.remove_role({
role_name: "roleNameType", # required
})
@param [Hash] options ({})
@option options [required, String] :role_name
The name of the role to remove.
This parameter allows (through its [regex pattern][1]) a string of
characters consisting of upper and lowercase alphanumeric characters
with no spaces. You can also include any of the following characters:
\_+=,.@-
[1]: http://wikipedia.org/wiki/regex
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/instance_profile.rb#L291-L295 | train | Remove a role from the instance profile | [
30522,
13366,
6366,
1035,
2535,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
6013,
1035,
6337,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
6366,
1035,
2535,
1035,
2013,
1035,
6013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.Draw.text | def text(x, y, text)
Kernel.raise ArgumentError, 'missing text argument' if text.to_s.empty?
if text.length > 2 && /\A(?:\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})\z/.match(text)
# text already quoted
elsif !text['\'']
text = '\'' + text + '\''
elsif !text['"']
text = '"' + text + '"'
elsif !(text['{'] || text['}'])
text = '{' + text + '}'
else
# escape existing braces, surround with braces
text = '{' + text.gsub(/[}]/) { |b| '\\' + b } + '}'
end
primitive "text #{x},#{y} #{text}"
end | ruby | def text(x, y, text)
Kernel.raise ArgumentError, 'missing text argument' if text.to_s.empty?
if text.length > 2 && /\A(?:\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})\z/.match(text)
# text already quoted
elsif !text['\'']
text = '\'' + text + '\''
elsif !text['"']
text = '"' + text + '"'
elsif !(text['{'] || text['}'])
text = '{' + text + '}'
else
# escape existing braces, surround with braces
text = '{' + text.gsub(/[}]/) { |b| '\\' + b } + '}'
end
primitive "text #{x},#{y} #{text}"
end | [
"def",
"text",
"(",
"x",
",",
"y",
",",
"text",
")",
"Kernel",
".",
"raise",
"ArgumentError",
",",
"'missing text argument'",
"if",
"text",
".",
"to_s",
".",
"empty?",
"if",
"text",
".",
"length",
">",
"2",
"&&",
"/",
"\\A",
"\\\"",
"\\\"",
"\\\"",
"... | Draw text at position x,y. Add quotes to text that is not already quoted. | [
"Draw",
"text",
"at",
"position",
"x",
"y",
".",
"Add",
"quotes",
"to",
"text",
"that",
"is",
"not",
"already",
"quoted",
"."
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L594-L609 | train | Returns the text of the given point. | [
30522,
13366,
3793,
1006,
1060,
1010,
1061,
1010,
3793,
1007,
16293,
1012,
5333,
6685,
2121,
29165,
1010,
1005,
4394,
3793,
6685,
1005,
2065,
3793,
1012,
2000,
1035,
1055,
1012,
4064,
1029,
2065,
3793,
1012,
3091,
1028,
1016,
1004,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
toptal/chewy | lib/chewy/query.rb | Chewy.Query.aggregations | def aggregations(params = nil)
@_named_aggs ||= _build_named_aggs
@_fully_qualified_named_aggs ||= _build_fqn_aggs
if params
params = {params => @_named_aggs[params]} if params.is_a?(Symbol)
params = {params => _get_fully_qualified_named_agg(params)} if params.is_a?(String) && params =~ /\A\S+#\S+\.\S+\z/
chain { criteria.update_aggregations params }
else
_response['aggregations'] || {}
end
end | ruby | def aggregations(params = nil)
@_named_aggs ||= _build_named_aggs
@_fully_qualified_named_aggs ||= _build_fqn_aggs
if params
params = {params => @_named_aggs[params]} if params.is_a?(Symbol)
params = {params => _get_fully_qualified_named_agg(params)} if params.is_a?(String) && params =~ /\A\S+#\S+\.\S+\z/
chain { criteria.update_aggregations params }
else
_response['aggregations'] || {}
end
end | [
"def",
"aggregations",
"(",
"params",
"=",
"nil",
")",
"@_named_aggs",
"||=",
"_build_named_aggs",
"@_fully_qualified_named_aggs",
"||=",
"_build_fqn_aggs",
"if",
"params",
"params",
"=",
"{",
"params",
"=>",
"@_named_aggs",
"[",
"params",
"]",
"}",
"if",
"params"... | Sets elasticsearch `aggregations` search request param
@example
UsersIndex.filter{ name == 'Johny' }.aggregations(category_id: {terms: {field: 'category_ids'}})
# => {body: {
query: {...},
aggregations: {
terms: {
field: 'category_ids'
}
}
}} | [
"Sets",
"elasticsearch",
"aggregations",
"search",
"request",
"param"
] | cb1bb3efb1bd8a31e7e31add6072189cb1f4f01b | https://github.com/toptal/chewy/blob/cb1bb3efb1bd8a31e7e31add6072189cb1f4f01b/lib/chewy/query.rb#L568-L578 | train | Returns the aggregated terms for the current request. | [
30522,
13366,
28041,
2015,
1006,
11498,
5244,
1027,
9152,
2140,
1007,
1030,
1035,
2315,
1035,
12943,
5620,
1064,
1064,
1027,
1035,
3857,
1035,
2315,
1035,
12943,
5620,
1030,
1035,
3929,
1035,
4591,
1035,
2315,
1035,
12943,
5620,
1064,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb | Aws::RDS.Resource.db_security_groups | def db_security_groups(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_db_security_groups(options)
resp.each_page do |page|
batch = []
page.data.db_security_groups.each do |d|
batch << DBSecurityGroup.new(
name: d.db_security_group_name,
data: d,
client: @client
)
end
y.yield(batch)
end
end
DBSecurityGroup::Collection.new(batches)
end | ruby | def db_security_groups(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_db_security_groups(options)
resp.each_page do |page|
batch = []
page.data.db_security_groups.each do |d|
batch << DBSecurityGroup.new(
name: d.db_security_group_name,
data: d,
client: @client
)
end
y.yield(batch)
end
end
DBSecurityGroup::Collection.new(batches)
end | [
"def",
"db_security_groups",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"resp",
"=",
"@client",
".",
"describe_db_security_groups",
"(",
"options",
")",
"resp",
".",
"each_page",
"do",
"|",
"page",
... | @example Request syntax with placeholder values
db_security_groups = rds.db_security_groups({
db_security_group_name: "String",
filters: [
{
name: "String", # required
values: ["String"], # required
},
],
})
@param [Hash] options ({})
@option options [String] :db_security_group_name
The name of the DB security group to return details for.
@option options [Array<Types::Filter>] :filters
This parameter is not currently supported.
@return [DBSecurityGroup::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb#L1972-L1988 | train | Returns a collection of DBSecurityGroup objects. | [
30522,
13366,
16962,
1035,
3036,
1035,
2967,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
24501,
2361,
1027,
1030,
7396,
1012,
6235,
1035,
16962,
1035,
3036,
1035,
2967,
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... |
ruckus/quickbooks-ruby | lib/quickbooks/util/name_entity.rb | NameEntity.PermitAlterations.valid_for_deletion? | def valid_for_deletion?
return false if(id.nil? || sync_token.nil?)
id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
end | ruby | def valid_for_deletion?
return false if(id.nil? || sync_token.nil?)
id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
end | [
"def",
"valid_for_deletion?",
"return",
"false",
"if",
"(",
"id",
".",
"nil?",
"||",
"sync_token",
".",
"nil?",
")",
"id",
".",
"to_i",
">",
"0",
"&&",
"!",
"sync_token",
".",
"to_s",
".",
"empty?",
"&&",
"sync_token",
".",
"to_i",
">=",
"0",
"end"
] | To delete an account Intuit requires we provide Id and SyncToken fields | [
"To",
"delete",
"an",
"account",
"Intuit",
"requires",
"we",
"provide",
"Id",
"and",
"SyncToken",
"fields"
] | b3b742389c438351f0826013e128ba706f1ed41c | https://github.com/ruckus/quickbooks-ruby/blob/b3b742389c438351f0826013e128ba706f1ed41c/lib/quickbooks/util/name_entity.rb#L80-L83 | train | Returns true if the object is valid for deletion | [
30522,
13366,
9398,
1035,
2005,
1035,
3972,
20624,
2239,
1029,
2709,
6270,
2065,
1006,
8909,
1012,
9152,
2140,
1029,
1064,
1064,
26351,
1035,
19204,
1012,
9152,
2140,
1029,
1007,
8909,
1012,
2000,
1035,
1045,
1028,
1014,
1004,
1004,
999,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb | Azure::SQL::Mgmt::V2014_04_01.Databases.list_by_server_with_http_info | def list_by_server_with_http_info(resource_group_name, server_name, expand:nil, filter:nil, custom_headers:nil)
list_by_server_async(resource_group_name, server_name, expand:expand, filter:filter, custom_headers:custom_headers).value!
end | ruby | def list_by_server_with_http_info(resource_group_name, server_name, expand:nil, filter:nil, custom_headers:nil)
list_by_server_async(resource_group_name, server_name, expand:expand, filter:filter, custom_headers:custom_headers).value!
end | [
"def",
"list_by_server_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"expand",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_by_server_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"expand... | Returns a list of databases in a server.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param expand [String] A comma separated list of child objects to expand in
the response. Possible properties: serviceTierAdvisors,
transparentDataEncryption.
@param filter [String] An OData filter expression that describes a subset of
databases to return.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Returns",
"a",
"list",
"of",
"databases",
"in",
"a",
"server",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb#L462-L464 | train | Gets the list of all the segmentation elements in a server. | [
30522,
13366,
2862,
1035,
2011,
1035,
8241,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7818,
1024,
9152,
2140,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | app/models/concerns/hyrax/collection_behavior.rb | Hyrax.CollectionBehavior.reset_access_controls! | def reset_access_controls!
update!(edit_users: permission_template_edit_users,
edit_groups: permission_template_edit_groups,
read_users: permission_template_read_users,
read_groups: (permission_template_read_groups + visibility_group).uniq)
end | ruby | def reset_access_controls!
update!(edit_users: permission_template_edit_users,
edit_groups: permission_template_edit_groups,
read_users: permission_template_read_users,
read_groups: (permission_template_read_groups + visibility_group).uniq)
end | [
"def",
"reset_access_controls!",
"update!",
"(",
"edit_users",
":",
"permission_template_edit_users",
",",
"edit_groups",
":",
"permission_template_edit_groups",
",",
"read_users",
":",
"permission_template_read_users",
",",
"read_groups",
":",
"(",
"permission_template_read_gr... | Calculate and update who should have read/edit access to the collections based on who
has access in PermissionTemplateAccess | [
"Calculate",
"and",
"update",
"who",
"should",
"have",
"read",
"/",
"edit",
"access",
"to",
"the",
"collections",
"based",
"on",
"who",
"has",
"access",
"in",
"PermissionTemplateAccess"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/models/concerns/hyrax/collection_behavior.rb#L137-L142 | train | Reset the access controls for the current user and group | [
30522,
13366,
25141,
1035,
3229,
1035,
7711,
999,
10651,
999,
1006,
10086,
1035,
5198,
1024,
6656,
1035,
23561,
1035,
10086,
1035,
5198,
1010,
10086,
1035,
2967,
1024,
6656,
1035,
23561,
1035,
10086,
1035,
2967,
1010,
3191,
1035,
5198,
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... |
samvera/hyrax | app/models/concerns/hyrax/ability.rb | Hyrax.Ability.trophy_abilities | def trophy_abilities
can [:create, :destroy], Trophy do |t|
doc = ActiveFedora::Base.search_by_id(t.work_id, fl: 'depositor_ssim')
current_user.user_key == doc.fetch('depositor_ssim').first
end
end | ruby | def trophy_abilities
can [:create, :destroy], Trophy do |t|
doc = ActiveFedora::Base.search_by_id(t.work_id, fl: 'depositor_ssim')
current_user.user_key == doc.fetch('depositor_ssim').first
end
end | [
"def",
"trophy_abilities",
"can",
"[",
":create",
",",
":destroy",
"]",
",",
"Trophy",
"do",
"|",
"t",
"|",
"doc",
"=",
"ActiveFedora",
"::",
"Base",
".",
"search_by_id",
"(",
"t",
".",
"work_id",
",",
"fl",
":",
"'depositor_ssim'",
")",
"current_user",
... | We check based on the depositor, because the depositor may not have edit
access to the work if it went through a mediated deposit workflow that
removes edit access for the depositor. | [
"We",
"check",
"based",
"on",
"the",
"depositor",
"because",
"the",
"depositor",
"may",
"not",
"have",
"edit",
"access",
"to",
"the",
"work",
"if",
"it",
"went",
"through",
"a",
"mediated",
"deposit",
"workflow",
"that",
"removes",
"edit",
"access",
"for",
... | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/models/concerns/hyrax/ability.rb#L162-L167 | train | returns a list of all the trophyabilities that can be used to create or destroy a trophy | [
30522,
13366,
5384,
1035,
7590,
2064,
1031,
1024,
3443,
1010,
1024,
6033,
1033,
1010,
5384,
2079,
1064,
1056,
1064,
9986,
1027,
3161,
25031,
6525,
1024,
1024,
2918,
1012,
3945,
1035,
2011,
1035,
8909,
1006,
1056,
1012,
2147,
1035,
8909,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.add_composite_entity_child_with_http_info | def add_composite_entity_child_with_http_info(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:nil)
add_composite_entity_child_async(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:custom_headers).value!
end | ruby | def add_composite_entity_child_with_http_info(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:nil)
add_composite_entity_child_async(app_id, version_id, c_entity_id, composite_child_model_create_object, custom_headers:custom_headers).value!
end | [
"def",
"add_composite_entity_child_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"c_entity_id",
",",
"composite_child_model_create_object",
",",
"custom_headers",
":",
"nil",
")",
"add_composite_entity_child_async",
"(",
"app_id",
",",
"version_id",
",",
"c_entity... | Creates a single child in an existing composite entity model in a version of
the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param c_entity_id The composite entity extractor ID.
@param composite_child_model_create_object [CompositeChildModelCreateObject]
A model object containing the name of the new composite child model.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"a",
"single",
"child",
"in",
"an",
"existing",
"composite",
"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#L5452-L5454 | train | Adds a composite entity child to the application version. | [
30522,
13366,
5587,
1035,
12490,
1035,
9178,
1035,
2775,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
1039,
1035,
9178,
1035,
8909,
1010,
12490,
1035,
2775,
1035,
2944,
1035,
3443,
1035,
4874,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/overcommit | lib/overcommit/hook_context/base.rb | Overcommit::HookContext.Base.filter_nonexistent | def filter_nonexistent(modified_files)
modified_files.select do |file|
File.exist?(file) || Overcommit::Utils.broken_symlink?(file)
end
end | ruby | def filter_nonexistent(modified_files)
modified_files.select do |file|
File.exist?(file) || Overcommit::Utils.broken_symlink?(file)
end
end | [
"def",
"filter_nonexistent",
"(",
"modified_files",
")",
"modified_files",
".",
"select",
"do",
"|",
"file",
"|",
"File",
".",
"exist?",
"(",
"file",
")",
"||",
"Overcommit",
"::",
"Utils",
".",
"broken_symlink?",
"(",
"file",
")",
"end",
"end"
] | Filter out non-existent files (unless it's a broken symlink, in which case
it's a file that points to a non-existent file). This could happen if a
file was renamed as part of an amendment, leading to the old file no
longer existing. | [
"Filter",
"out",
"non",
"-",
"existent",
"files",
"(",
"unless",
"it",
"s",
"a",
"broken",
"symlink",
"in",
"which",
"case",
"it",
"s",
"a",
"file",
"that",
"points",
"to",
"a",
"non",
"-",
"existent",
"file",
")",
".",
"This",
"could",
"happen",
"if... | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/hook_context/base.rb#L124-L128 | train | Filter nonexistent files | [
30522,
13366,
11307,
1035,
3904,
9048,
16173,
2102,
1006,
6310,
1035,
6764,
1007,
6310,
1035,
6764,
1012,
7276,
2079,
1064,
5371,
1064,
5371,
1012,
4839,
1029,
1006,
5371,
1007,
1064,
1064,
2058,
9006,
22930,
1024,
1024,
21183,
12146,
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... |
decidim/decidim | decidim-core/app/uploaders/decidim/application_uploader.rb | Decidim.ApplicationUploader.store_dir | def store_dir
default_path = "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
return File.join(Decidim.base_uploads_path, default_path) if Decidim.base_uploads_path.present?
default_path
end | ruby | def store_dir
default_path = "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
return File.join(Decidim.base_uploads_path, default_path) if Decidim.base_uploads_path.present?
default_path
end | [
"def",
"store_dir",
"default_path",
"=",
"\"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}\"",
"return",
"File",
".",
"join",
"(",
"Decidim",
".",
"base_uploads_path",
",",
"default_path",
")",
"if",
"Decidim",
".",
"base_uploads_path",
".",
"present?",
... | Override the directory where uploaded files will be stored.
This is a sensible default for uploaders that are meant to be mounted: | [
"Override",
"the",
"directory",
"where",
"uploaded",
"files",
"will",
"be",
"stored",
".",
"This",
"is",
"a",
"sensible",
"default",
"for",
"uploaders",
"that",
"are",
"meant",
"to",
"be",
"mounted",
":"
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/uploaders/decidim/application_uploader.rb#L10-L15 | train | Returns the path to the directory containing the file that is stored in the correct order. | [
30522,
13366,
3573,
1035,
16101,
12398,
1035,
4130,
1027,
1000,
2039,
11066,
2015,
1013,
1001,
1063,
2944,
1012,
2465,
1012,
2000,
1035,
1055,
1012,
2104,
9363,
2890,
1065,
1013,
1001,
1063,
5614,
1035,
2004,
1065,
1013,
1001,
1063,
2944,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/data_criteria_helpers/dc_definition_from_template_or_type_extract.rb | HQMF2.DataCriteriaTypeAndDefinitionExtraction.extract_information_for_specific_variable | def extract_information_for_specific_variable
reference = @entry.at_xpath('./*/cda:outboundRelationship/cda:criteriaReference',
HQMF2::Document::NAMESPACES)
if reference
ref_id = strip_tokens(
"#{HQMF2::Utilities.attr_val(reference, 'cda:id/@extension')}_#{HQMF2::Utilities.attr_val(reference, 'cda:id/@root')}")
end
reference_criteria = @data_criteria_references[ref_id] if ref_id
# if the reference is derived, pull from the original variable
if reference_criteria && reference_criteria.definition == 'derived'
reference_criteria = @data_criteria_references["GROUP_#{ref_id}"]
end
return unless reference_criteria
handle_specific_variable_ref(reference_criteria)
end | ruby | def extract_information_for_specific_variable
reference = @entry.at_xpath('./*/cda:outboundRelationship/cda:criteriaReference',
HQMF2::Document::NAMESPACES)
if reference
ref_id = strip_tokens(
"#{HQMF2::Utilities.attr_val(reference, 'cda:id/@extension')}_#{HQMF2::Utilities.attr_val(reference, 'cda:id/@root')}")
end
reference_criteria = @data_criteria_references[ref_id] if ref_id
# if the reference is derived, pull from the original variable
if reference_criteria && reference_criteria.definition == 'derived'
reference_criteria = @data_criteria_references["GROUP_#{ref_id}"]
end
return unless reference_criteria
handle_specific_variable_ref(reference_criteria)
end | [
"def",
"extract_information_for_specific_variable",
"reference",
"=",
"@entry",
".",
"at_xpath",
"(",
"'./*/cda:outboundRelationship/cda:criteriaReference'",
",",
"HQMF2",
"::",
"Document",
"::",
"NAMESPACES",
")",
"if",
"reference",
"ref_id",
"=",
"strip_tokens",
"(",
"\... | Extracts information from a reference for a specific | [
"Extracts",
"information",
"from",
"a",
"reference",
"for",
"a",
"specific"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/data_criteria_helpers/dc_definition_from_template_or_type_extract.rb#L73-L87 | train | Extract information for a specific variable | [
30522,
13366,
14817,
1035,
2592,
1035,
2005,
1035,
3563,
1035,
8023,
4431,
1027,
1030,
4443,
1012,
2012,
1035,
26726,
8988,
1006,
1005,
1012,
1013,
1008,
1013,
3729,
2050,
1024,
2041,
15494,
16570,
10708,
5605,
1013,
3729,
2050,
1024,
9181,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb | Azure::Labservices::Mgmt::V2018_10_15.GlobalUsers.register | def register(user_name, register_payload, custom_headers:nil)
response = register_async(user_name, register_payload, custom_headers:custom_headers).value!
nil
end | ruby | def register(user_name, register_payload, custom_headers:nil)
response = register_async(user_name, register_payload, custom_headers:custom_headers).value!
nil
end | [
"def",
"register",
"(",
"user_name",
",",
"register_payload",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"register_async",
"(",
"user_name",
",",
"register_payload",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Register a user to a managed lab
@param user_name [String] The name of the user.
@param register_payload [RegisterPayload] Represents payload for Register
action.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Register",
"a",
"user",
"to",
"a",
"managed",
"lab"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb#L638-L641 | train | Registers a user with the specified user name. | [
30522,
13366,
4236,
1006,
5310,
1035,
2171,
1010,
4236,
1035,
18093,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4236,
1035,
2004,
6038,
2278,
1006,
5310,
1035,
2171,
1010,
4236,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_dns/lib/2017-09-01/generated/azure_mgmt_dns/record_sets.rb | Azure::Dns::Mgmt::V2017_09_01.RecordSets.update_with_http_info | def update_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:nil, custom_headers:nil)
update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:if_match, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:nil, custom_headers:nil)
update_async(resource_group_name, zone_name, relative_record_set_name, record_type, parameters, if_match:if_match, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"zone_name",
",",
"relative_record_set_name",
",",
"record_type",
",",
"parameters",
",",
"if_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
... | Updates a record set within a DNS zone.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param zone_name [String] The name of the DNS zone (without a terminating
dot).
@param relative_record_set_name [String] The name of the record set, relative
to the name of the zone.
@param record_type [RecordType] The type of DNS record in this record set.
Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR',
'SOA', 'SRV', 'TXT'
@param parameters [RecordSet] Parameters supplied to the Update operation.
@param if_match [String] The etag of the record set. Omit this value to
always overwrite the current record set. Specify the last-seen etag value to
prevent accidentally overwritting concurrent changes.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"a",
"record",
"set",
"within",
"a",
"DNS",
"zone",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_dns/lib/2017-09-01/generated/azure_mgmt_dns/record_sets.rb#L71-L73 | train | Updates a record set. | [
30522,
13366,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4224,
1035,
2171,
1010,
5816,
1035,
2501,
1035,
2275,
1035,
2171,
1010,
2501,
1035,
2828,
1010,
11709,
1010,
2065,
1035,
2674,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_backup/lib/2016-12-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb | Azure::RecoveryServicesBackup::Mgmt::V2016_12_01.ProtectionContainers.register_with_http_info | def register_with_http_info(vault_name, resource_group_name, fabric_name, container_name, parameters, custom_headers:nil)
register_async(vault_name, resource_group_name, fabric_name, container_name, parameters, custom_headers:custom_headers).value!
end | ruby | def register_with_http_info(vault_name, resource_group_name, fabric_name, container_name, parameters, custom_headers:nil)
register_async(vault_name, resource_group_name, fabric_name, container_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"register_with_http_info",
"(",
"vault_name",
",",
"resource_group_name",
",",
"fabric_name",
",",
"container_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"register_async",
"(",
"vault_name",
",",
"resource_group_name",
",",
"fabric_name",
... | Registers the container with Recovery Services vault.
This is an asynchronous operation. To track the operation status, use
location header to call get latest status of
the operation.
@param vault_name [String] The name of the recovery services vault.
@param resource_group_name [String] The name of the resource group where the
recovery services vault is present.
@param fabric_name [String] Fabric name associated with the container.
@param container_name [String] Name of the container to be registered.
@param parameters [ProtectionContainerResource] Request body for operation
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Registers",
"the",
"container",
"with",
"Recovery",
"Services",
"vault",
".",
"This",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"track",
"the",
"operation",
"status",
"use",
"location",
"header",
"to",
"call",
"get",
"latest",
"status",
"of",
"the",... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_backup/lib/2016-12-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb#L176-L178 | train | Registers a container in the specified vault. | [
30522,
13366,
4236,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
8313,
1035,
2171,
1010,
11661,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4236,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | app/helpers/hyrax/hyrax_helper_behavior.rb | Hyrax.HyraxHelperBehavior.license_links | def license_links(options)
service = Hyrax.config.license_service_class.new
to_sentence(options[:value].map { |right| link_to service.label(right), right })
end | ruby | def license_links(options)
service = Hyrax.config.license_service_class.new
to_sentence(options[:value].map { |right| link_to service.label(right), right })
end | [
"def",
"license_links",
"(",
"options",
")",
"service",
"=",
"Hyrax",
".",
"config",
".",
"license_service_class",
".",
"new",
"to_sentence",
"(",
"options",
"[",
":value",
"]",
".",
"map",
"{",
"|",
"right",
"|",
"link_to",
"service",
".",
"label",
"(",
... | A Blacklight index field helper_method
@param [Hash] options from blacklight helper_method invocation. Maps license URIs to links with labels.
@return [ActiveSupport::SafeBuffer] license links, html_safe | [
"A",
"Blacklight",
"index",
"field",
"helper_method"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/helpers/hyrax/hyrax_helper_behavior.rb#L204-L207 | train | Link to license_service_class | [
30522,
13366,
6105,
1035,
6971,
1006,
7047,
1007,
2326,
1027,
1044,
19563,
2595,
1012,
9530,
8873,
2290,
1012,
6105,
1035,
2326,
1035,
2465,
1012,
2047,
2000,
1035,
6251,
1006,
7047,
1031,
1024,
3643,
1033,
1012,
4949,
1063,
1064,
2157,
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 | data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.update_iteration_with_http_info | def update_iteration_with_http_info(project_id, iteration_id, updated_iteration, custom_headers:nil)
update_iteration_async(project_id, iteration_id, updated_iteration, custom_headers:custom_headers).value!
end | ruby | def update_iteration_with_http_info(project_id, iteration_id, updated_iteration, custom_headers:nil)
update_iteration_async(project_id, iteration_id, updated_iteration, custom_headers:custom_headers).value!
end | [
"def",
"update_iteration_with_http_info",
"(",
"project_id",
",",
"iteration_id",
",",
"updated_iteration",
",",
"custom_headers",
":",
"nil",
")",
"update_iteration_async",
"(",
"project_id",
",",
"iteration_id",
",",
"updated_iteration",
",",
"custom_headers",
":custom_... | Update a specific iteration.
@param project_id Project id.
@param iteration_id Iteration id.
@param updated_iteration [Iteration] The updated iteration model.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Update",
"a",
"specific",
"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#L3711-L3713 | train | Updates an iteration. | [
30522,
13366,
10651,
1035,
27758,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2622,
1035,
8909,
1010,
27758,
1035,
8909,
1010,
7172,
1035,
27758,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
1035,
27758,
1035,
2004,
6038,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vault-ruby | lib/vault/persistent.rb | Vault.PersistentHTTP.proxy_bypass? | def proxy_bypass? host, port
host = host.downcase
host_port = [host, port].join ':'
@no_proxy.each do |name|
return true if host[-name.length, name.length] == name or
host_port[-name.length, name.length] == name
end
false
end | ruby | def proxy_bypass? host, port
host = host.downcase
host_port = [host, port].join ':'
@no_proxy.each do |name|
return true if host[-name.length, name.length] == name or
host_port[-name.length, name.length] == name
end
false
end | [
"def",
"proxy_bypass?",
"host",
",",
"port",
"host",
"=",
"host",
".",
"downcase",
"host_port",
"=",
"[",
"host",
",",
"port",
"]",
".",
"join",
"':'",
"@no_proxy",
".",
"each",
"do",
"|",
"name",
"|",
"return",
"true",
"if",
"host",
"[",
"-",
"name"... | Returns true when proxy should by bypassed for host. | [
"Returns",
"true",
"when",
"proxy",
"should",
"by",
"bypassed",
"for",
"host",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/persistent.rb#L868-L878 | train | Returns true if the proxy bypasses the specified host and port | [
30522,
13366,
24540,
1035,
11826,
1029,
3677,
1010,
3417,
3677,
1027,
3677,
1012,
2091,
18382,
3677,
1035,
3417,
1027,
1031,
3677,
1010,
3417,
1033,
1012,
3693,
1005,
1024,
1005,
1030,
2053,
1035,
24540,
1012,
2169,
2079,
1064,
2171,
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... |
sds/scss-lint | lib/scss_lint/linter/space_after_comma.rb | SCSSLint.Linter::SpaceAfterComma.check_invocation | def check_invocation(node, type)
args = sort_args_by_position(node.args,
node.splat,
node.keywords.values,
node.kwarg_splat)
check_commas_after_args(args, "#{type} arguments")
end | ruby | def check_invocation(node, type)
args = sort_args_by_position(node.args,
node.splat,
node.keywords.values,
node.kwarg_splat)
check_commas_after_args(args, "#{type} arguments")
end | [
"def",
"check_invocation",
"(",
"node",
",",
"type",
")",
"args",
"=",
"sort_args_by_position",
"(",
"node",
".",
"args",
",",
"node",
".",
"splat",
",",
"node",
".",
"keywords",
".",
"values",
",",
"node",
".",
"kwarg_splat",
")",
"check_commas_after_args",... | Check arguments passed to a function/mixin invocation | [
"Check",
"arguments",
"passed",
"to",
"a",
"function",
"/",
"mixin",
"invocation"
] | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/linter/space_after_comma.rb#L44-L51 | train | Check invocation of a method | [
30522,
13366,
4638,
1035,
1999,
19152,
1006,
13045,
1010,
2828,
1007,
12098,
5620,
1027,
4066,
1035,
12098,
5620,
1035,
2011,
1035,
2597,
1006,
13045,
1012,
12098,
5620,
1010,
13045,
1012,
11867,
20051,
1010,
13045,
1012,
3145,
22104,
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... |
danger/danger | lib/danger/plugin_support/plugin_linter.rb | Danger.PluginLinter.lint | def lint
json.each do |plugin|
apply_rules(plugin, "class", class_rules)
plugin[:methods].each do |method|
apply_rules(method, "method", method_rules)
end
plugin[:attributes].each do |method_hash|
method_name = method_hash.keys.first
method = method_hash[method_name]
value = method[:write] || method[:read]
apply_rules(value, "attribute", method_rules)
end
end
end | ruby | def lint
json.each do |plugin|
apply_rules(plugin, "class", class_rules)
plugin[:methods].each do |method|
apply_rules(method, "method", method_rules)
end
plugin[:attributes].each do |method_hash|
method_name = method_hash.keys.first
method = method_hash[method_name]
value = method[:write] || method[:read]
apply_rules(value, "attribute", method_rules)
end
end
end | [
"def",
"lint",
"json",
".",
"each",
"do",
"|",
"plugin",
"|",
"apply_rules",
"(",
"plugin",
",",
"\"class\"",
",",
"class_rules",
")",
"plugin",
"[",
":methods",
"]",
".",
"each",
"do",
"|",
"method",
"|",
"apply_rules",
"(",
"method",
",",
"\"method\"",... | Lints the current JSON, looking at:
* Class rules
* Method rules
* Attribute rules | [
"Lints",
"the",
"current",
"JSON",
"looking",
"at",
":",
"*",
"Class",
"rules",
"*",
"Method",
"rules",
"*",
"Attribute",
"rules"
] | 0d6d09f2d949c287fe75202d947374042b0679f4 | https://github.com/danger/danger/blob/0d6d09f2d949c287fe75202d947374042b0679f4/lib/danger/plugin_support/plugin_linter.rb#L33-L49 | train | lint the given json | [
30522,
13366,
11409,
2102,
1046,
3385,
1012,
2169,
2079,
1064,
13354,
2378,
1064,
6611,
1035,
3513,
1006,
13354,
2378,
1010,
1000,
2465,
1000,
1010,
2465,
1035,
3513,
1007,
13354,
2378,
1031,
1024,
4725,
1033,
1012,
2169,
2079,
1064,
4118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_management/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/entities.rb | Azure::ResourcesManagement::Mgmt::V2018_01_01_preview.Entities.list | def list(group_name:nil, cache_control:'no-cache', custom_headers:nil)
first_page = list_as_lazy(group_name:group_name, cache_control:cache_control, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list(group_name:nil, cache_control:'no-cache', custom_headers:nil)
first_page = list_as_lazy(group_name:group_name, cache_control:cache_control, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list",
"(",
"group_name",
":",
"nil",
",",
"cache_control",
":",
"'no-cache'",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_as_lazy",
"(",
"group_name",
":group_name",
",",
"cache_control",
":cache_control",
",",
"custom_headers",
":cus... | List all entities (Management Groups, Subscriptions, etc.) for the
authenticated user.
@param group_name [String] A filter which allows the call to be filtered for
a specific group.
@param cache_control [String] Indicates that the request shouldn't utilize
any caches.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<EntityInfo>] operation results. | [
"List",
"all",
"entities",
"(",
"Management",
"Groups",
"Subscriptions",
"etc",
".",
")",
"for",
"the",
"authenticated",
"user",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources_management/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/entities.rb#L42-L45 | train | Gets all the available advisors. | [
30522,
13366,
2862,
1006,
2177,
1035,
2171,
1024,
9152,
2140,
1010,
17053,
1035,
2491,
1024,
1005,
2053,
1011,
17053,
1005,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2004,
1035,
13971,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/tag.rb | Aws::EC2.Tag.delete | def delete(options = {})
options = Aws::Util.deep_merge(options,
resources: [@resource_id],
tags: [{
key: @key,
value: @value
}]
)
resp = @client.delete_tags(options)
resp.data
end | ruby | def delete(options = {})
options = Aws::Util.deep_merge(options,
resources: [@resource_id],
tags: [{
key: @key,
value: @value
}]
)
resp = @client.delete_tags(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"Aws",
"::",
"Util",
".",
"deep_merge",
"(",
"options",
",",
"resources",
":",
"[",
"@resource_id",
"]",
",",
"tags",
":",
"[",
"{",
"key",
":",
"@key",
",",
"value",
":",
"@value... | @!group Actions
@example Request syntax with placeholder values
tag.delete({
dry_run: false,
tags: [
{
key: "String",
value: "String",
},
],
})
@param [Hash] options ({})
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@option options [Array<Types::Tag>] :tags
The tags to delete. Specify a tag key and an optional tag value to
delete specific tags. If you specify a tag key without a tag value, we
delete any tag with this key regardless of its value. If you specify a
tag key with an empty string as the tag value, we delete the tag only
if its value is an empty string.
If you omit this parameter, we delete all user-defined tags for the
specified resources. We do not delete AWS-generated tags (tags that
have the `aws:` prefix).
@return [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/tag.rb#L224-L234 | train | Delete the tags | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
22091,
2015,
1024,
1024,
21183,
4014,
1012,
2784,
1035,
13590,
1006,
7047,
1010,
4219,
1024,
1031,
1030,
7692,
1035,
8909,
1033,
1010,
22073,
1024,
1031,
1063,
3145,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb | Azure::CognitiveServices::Face::V1_0.LargePersonGroupPerson.update_face_with_http_info | def update_face_with_http_info(large_person_group_id, person_id, persisted_face_id, user_data:nil, custom_headers:nil)
update_face_async(large_person_group_id, person_id, persisted_face_id, user_data:user_data, custom_headers:custom_headers).value!
end | ruby | def update_face_with_http_info(large_person_group_id, person_id, persisted_face_id, user_data:nil, custom_headers:nil)
update_face_async(large_person_group_id, person_id, persisted_face_id, user_data:user_data, custom_headers:custom_headers).value!
end | [
"def",
"update_face_with_http_info",
"(",
"large_person_group_id",
",",
"person_id",
",",
"persisted_face_id",
",",
"user_data",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"update_face_async",
"(",
"large_person_group_id",
",",
"person_id",
",",
"persisted_face... | Update a person persisted face's userData field.
@param large_person_group_id [String] Id referencing a particular large
person group.
@param person_id Id referencing a particular person.
@param persisted_face_id Id referencing a particular persistedFaceId of an
existing face.
@param user_data [String] User-provided data attached to the face. The size
limit is 1KB.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Update",
"a",
"person",
"persisted",
"face",
"s",
"userData",
"field",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb#L792-L794 | train | Updates a persisted face. | [
30522,
13366,
10651,
1035,
2227,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2312,
1035,
2711,
1035,
2177,
1035,
8909,
30524,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
1035,
2227,
1035,
2004,
6038,
2278,
1006,
2312,
1035,
2711,
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... |
jnunemaker/httparty | lib/httparty.rb | HTTParty.ClassMethods.http_proxy | def http_proxy(addr = nil, port = nil, user = nil, pass = nil)
default_options[:http_proxyaddr] = addr
default_options[:http_proxyport] = port
default_options[:http_proxyuser] = user
default_options[:http_proxypass] = pass
end | ruby | def http_proxy(addr = nil, port = nil, user = nil, pass = nil)
default_options[:http_proxyaddr] = addr
default_options[:http_proxyport] = port
default_options[:http_proxyuser] = user
default_options[:http_proxypass] = pass
end | [
"def",
"http_proxy",
"(",
"addr",
"=",
"nil",
",",
"port",
"=",
"nil",
",",
"user",
"=",
"nil",
",",
"pass",
"=",
"nil",
")",
"default_options",
"[",
":http_proxyaddr",
"]",
"=",
"addr",
"default_options",
"[",
":http_proxyport",
"]",
"=",
"port",
"defau... | Allows setting http proxy information to be used
class Foo
include HTTParty
http_proxy 'http://foo.com', 80, 'user', 'pass'
end | [
"Allows",
"setting",
"http",
"proxy",
"information",
"to",
"be",
"used"
] | b4099defba01231d2faaaa2660476f867e096bfb | https://github.com/jnunemaker/httparty/blob/b4099defba01231d2faaaa2660476f867e096bfb/lib/httparty.rb#L95-L100 | train | Set http proxy options | [
30522,
13366,
8299,
1035,
24540,
1006,
5587,
2099,
1027,
9152,
2140,
1010,
3417,
1027,
9152,
2140,
1010,
5310,
1027,
9152,
2140,
1010,
3413,
1027,
9152,
2140,
1007,
12398,
1035,
7047,
1031,
1024,
8299,
1035,
24540,
4215,
13626,
1033,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachineScaleSets.begin_restart_with_http_info | def begin_restart_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
end | ruby | def begin_restart_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
begin_restart_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
end | [
"def",
"begin_restart_with_http_info",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"begin_restart_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
":... | Restarts one or more virtual machines in 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.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Restarts",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1499-L1501 | train | Restarts a virtual machine in a VM scale set. | [
30522,
13366,
4088,
1035,
23818,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
1024,
9152,
2140,
1010,
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... |
github-changelog-generator/github-changelog-generator | lib/github_changelog_generator/generator/generator_processor.rb | GitHubChangelogGenerator.Generator.filter_merged_pull_requests | def filter_merged_pull_requests(pull_requests)
print "Fetching merged dates...\r" if options[:verbose]
closed_pull_requests = @fetcher.fetch_closed_pull_requests
pull_requests.each do |pr|
fetched_pr = closed_pull_requests.find do |fpr|
fpr["number"] == pr["number"]
end
if fetched_pr
pr["merged_at"] = fetched_pr["merged_at"]
closed_pull_requests.delete(fetched_pr)
end
end
pull_requests.reject! do |pr|
pr["merged_at"].nil?
end
pull_requests
end | ruby | def filter_merged_pull_requests(pull_requests)
print "Fetching merged dates...\r" if options[:verbose]
closed_pull_requests = @fetcher.fetch_closed_pull_requests
pull_requests.each do |pr|
fetched_pr = closed_pull_requests.find do |fpr|
fpr["number"] == pr["number"]
end
if fetched_pr
pr["merged_at"] = fetched_pr["merged_at"]
closed_pull_requests.delete(fetched_pr)
end
end
pull_requests.reject! do |pr|
pr["merged_at"].nil?
end
pull_requests
end | [
"def",
"filter_merged_pull_requests",
"(",
"pull_requests",
")",
"print",
"\"Fetching merged dates...\\r\"",
"if",
"options",
"[",
":verbose",
"]",
"closed_pull_requests",
"=",
"@fetcher",
".",
"fetch_closed_pull_requests",
"pull_requests",
".",
"each",
"do",
"|",
"pr",
... | This method filter only merged PR and
fetch missing required attributes for pull requests
:merged_at - is a date, when issue PR was merged.
More correct to use merged date, rather than closed date. | [
"This",
"method",
"filter",
"only",
"merged",
"PR",
"and",
"fetch",
"missing",
"required",
"attributes",
"for",
"pull",
"requests",
":",
"merged_at",
"-",
"is",
"a",
"date",
"when",
"issue",
"PR",
"was",
"merged",
".",
"More",
"correct",
"to",
"use",
"merg... | f18c64b5cc0d7473b059275b88385ac11ca8b564 | https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/generator/generator_processor.rb#L215-L234 | train | Filter out pull requests that have merged dates | [
30522,
13366,
11307,
1035,
5314,
1035,
4139,
1035,
11186,
1006,
4139,
1035,
11186,
1007,
6140,
1000,
18584,
2075,
5314,
5246,
1012,
1012,
1012,
1032,
1054,
1000,
2065,
7047,
1031,
1024,
12034,
9232,
1033,
2701,
1035,
4139,
1035,
11186,
3052... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_intents_with_http_info | def list_intents_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_intents_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | ruby | def list_intents_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_intents_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | [
"def",
"list_intents_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"0",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"list_intents_async",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"skip",
",",
"take",
"... | Gets information about the intent models in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param skip [Integer] The number of entries to skip. Default value is 0.
@param take [Integer] The number of entries to return. Maximum page size is
500. Default is 100.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"information",
"about",
"the",
"intent",
"models",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L167-L169 | train | Gets the list of intents for the application version. | [
30522,
13366,
2862,
1035,
7848,
2015,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
13558,
1024,
1014,
1010,
2202,
1024,
2531,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jekyll/jekyll-admin | lib/jekyll-admin/file_helper.rb | JekyllAdmin.FileHelper.write_file | def write_file(path, content)
Jekyll.logger.debug "WRITING:", path
path = sanitized_path(path)
FileUtils.mkdir_p File.dirname(path)
File.open(path, "wb") do |file|
file.write(content)
end
# we should fully process in dev mode for tests to pass
if ENV["RACK_ENV"] == "production"
site.read
else
site.process
end
end | ruby | def write_file(path, content)
Jekyll.logger.debug "WRITING:", path
path = sanitized_path(path)
FileUtils.mkdir_p File.dirname(path)
File.open(path, "wb") do |file|
file.write(content)
end
# we should fully process in dev mode for tests to pass
if ENV["RACK_ENV"] == "production"
site.read
else
site.process
end
end | [
"def",
"write_file",
"(",
"path",
",",
"content",
")",
"Jekyll",
".",
"logger",
".",
"debug",
"\"WRITING:\"",
",",
"path",
"path",
"=",
"sanitized_path",
"(",
"path",
")",
"FileUtils",
".",
"mkdir_p",
"File",
".",
"dirname",
"(",
"path",
")",
"File",
"."... | Write a file to disk with the given content | [
"Write",
"a",
"file",
"to",
"disk",
"with",
"the",
"given",
"content"
] | bc053b3b93faba679e8666091c42c47970e3bb5e | https://github.com/jekyll/jekyll-admin/blob/bc053b3b93faba679e8666091c42c47970e3bb5e/lib/jekyll-admin/file_helper.rb#L17-L30 | train | Write a file to the given path. | [
30522,
13366,
4339,
1035,
5371,
1006,
4130,
1010,
4180,
1007,
15333,
4801,
3363,
1012,
8833,
4590,
1012,
2139,
8569,
2290,
1000,
3015,
1024,
1000,
1010,
4130,
4130,
1027,
2624,
25090,
5422,
1035,
4130,
1006,
4130,
1007,
5371,
21823,
4877,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_detectors_slot_with_http_info | def list_site_detectors_slot_with_http_info(resource_group_name, site_name, diagnostic_category, slot, custom_headers:nil)
list_site_detectors_slot_async(resource_group_name, site_name, diagnostic_category, slot, custom_headers:custom_headers).value!
end | ruby | def list_site_detectors_slot_with_http_info(resource_group_name, site_name, diagnostic_category, slot, custom_headers:nil)
list_site_detectors_slot_async(resource_group_name, site_name, diagnostic_category, slot, custom_headers:custom_headers).value!
end | [
"def",
"list_site_detectors_slot_with_http_info",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_category",
",",
"slot",
",",
"custom_headers",
":",
"nil",
")",
"list_site_detectors_slot_async",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_... | Get Detectors
Get Detectors
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param diagnostic_category [String] Diagnostic Category
@param slot [String] Slot Name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Get",
"Detectors"
] | 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#L2203-L2205 | train | Gets the list of site detectors. | [
30522,
13366,
2862,
1035,
2609,
1035,
25971,
1035,
10453,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
10453,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
guard/guard | lib/guard/cli.rb | Guard.CLI.list | def list
Cli::Environments::EvaluateOnly.new(options).evaluate
DslDescriber.new.list
end | ruby | def list
Cli::Environments::EvaluateOnly.new(options).evaluate
DslDescriber.new.list
end | [
"def",
"list",
"Cli",
"::",
"Environments",
"::",
"EvaluateOnly",
".",
"new",
"(",
"options",
")",
".",
"evaluate",
"DslDescriber",
".",
"new",
".",
"list",
"end"
] | List the Guard plugins that are available for use in your system and
marks those that are currently used in your `Guardfile`.
@see Guard::DslDescriber.list | [
"List",
"the",
"Guard",
"plugins",
"that",
"are",
"available",
"for",
"use",
"in",
"your",
"system",
"and",
"marks",
"those",
"that",
"are",
"currently",
"used",
"in",
"your",
"Guardfile",
"."
] | e2508cd83badf0d537dbaba35d307adc35d92e4f | https://github.com/guard/guard/blob/e2508cd83badf0d537dbaba35d307adc35d92e4f/lib/guard/cli.rb#L132-L135 | train | List the sequence of documents in the current project. | [
30522,
13366,
2862,
18856,
2072,
1024,
1024,
10058,
1024,
1024,
16157,
2239,
2135,
1012,
2047,
1006,
7047,
1007,
1012,
16157,
16233,
17920,
29234,
2099,
1012,
2047,
1012,
2862,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/labs.rb | Azure::Labservices::Mgmt::V2018_10_15.Labs.begin_delete | def begin_delete(resource_group_name, lab_account_name, lab_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, lab_account_name, lab_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, lab_account_name, lab_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
"custom_headers",
":c... | Delete lab. This operation can take a while to complete
@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 custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"lab",
".",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb#L697-L700 | train | Deletes a lab s elastic search. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
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... |
rails/rails | activerecord/lib/active_record/migration.rb | ActiveRecord.Migrator.migrate_without_lock | def migrate_without_lock
if invalid_target?
raise UnknownMigrationVersionError.new(@target_version)
end
result = runnable.each do |migration|
execute_migration_in_transaction(migration, @direction)
end
record_environment
result
end | ruby | def migrate_without_lock
if invalid_target?
raise UnknownMigrationVersionError.new(@target_version)
end
result = runnable.each do |migration|
execute_migration_in_transaction(migration, @direction)
end
record_environment
result
end | [
"def",
"migrate_without_lock",
"if",
"invalid_target?",
"raise",
"UnknownMigrationVersionError",
".",
"new",
"(",
"@target_version",
")",
"end",
"result",
"=",
"runnable",
".",
"each",
"do",
"|",
"migration",
"|",
"execute_migration_in_transaction",
"(",
"migration",
... | Used for running multiple migrations up to or down to a certain value. | [
"Used",
"for",
"running",
"multiple",
"migrations",
"up",
"to",
"or",
"down",
"to",
"a",
"certain",
"value",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/migration.rb#L1265-L1276 | train | Execute all migrations without locking the environment | [
30522,
13366,
22806,
1035,
2302,
1035,
5843,
2065,
19528,
1035,
4539,
1029,
5333,
4242,
4328,
29397,
27774,
2121,
29165,
1012,
2047,
1006,
1030,
4539,
1035,
2544,
1007,
2203,
2765,
1027,
2448,
22966,
1012,
2169,
2079,
1064,
9230,
1064,
1538... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/runner.rb | HamlLint.Runner.run | def run(options = {})
@config = load_applicable_config(options)
@files = extract_applicable_files(config, options)
@linter_selector = HamlLint::LinterSelector.new(config, options)
@fail_fast = options.fetch(:fail_fast, false)
report(options)
end | ruby | def run(options = {})
@config = load_applicable_config(options)
@files = extract_applicable_files(config, options)
@linter_selector = HamlLint::LinterSelector.new(config, options)
@fail_fast = options.fetch(:fail_fast, false)
report(options)
end | [
"def",
"run",
"(",
"options",
"=",
"{",
"}",
")",
"@config",
"=",
"load_applicable_config",
"(",
"options",
")",
"@files",
"=",
"extract_applicable_files",
"(",
"config",
",",
"options",
")",
"@linter_selector",
"=",
"HamlLint",
"::",
"LinterSelector",
".",
"n... | Runs the appropriate linters against the desired files given the specified
options.
@param [Hash] options
@option options :config_file [String] path of configuration file to load
@option options :config [HamlLint::Configuration] configuration to use
@option options :excluded_files [Array<String>]
@option options :included_linters [Array<String>]
@option options :excluded_linters [Array<String>]
@option options :fail_fast [true, false] flag for failing after first failure
@option options :fail_level
@option options :reporter [HamlLint::Reporter]
@return [HamlLint::Report] a summary of all lints found | [
"Runs",
"the",
"appropriate",
"linters",
"against",
"the",
"desired",
"files",
"given",
"the",
"specified",
"options",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/runner.rb#L19-L26 | train | Runs the linters | [
30522,
13366,
2448,
1006,
7047,
1027,
1063,
1065,
1007,
1030,
9530,
8873,
2290,
1027,
7170,
1035,
12711,
1035,
9530,
8873,
2290,
1006,
7047,
1007,
1030,
6764,
1027,
14817,
1035,
12711,
1035,
6764,
1006,
9530,
8873,
2290,
1010,
7047,
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... |
fastlane/fastlane | spaceship/lib/spaceship/two_step_or_factor_client.rb | Spaceship.Client.request_two_factor_code_from_phone | def request_two_factor_code_from_phone(phone_id, phone_number, code_length)
# Request code
r = request(:put) do |req|
req.url("https://idmsa.apple.com/appleauth/auth/verify/phone")
req.headers['Content-Type'] = 'application/json'
req.body = { "phoneNumber" => { "id" => phone_id }, "mode" => "sms" }.to_json
update_request_headers(req)
end
# we use `Spaceship::TunesClient.new.handle_itc_response`
# since this might be from the Dev Portal, but for 2 step
Spaceship::TunesClient.new.handle_itc_response(r.body)
puts("Successfully requested text message to #{phone_number}")
code = ask_for_2fa_code("Please enter the #{code_length} digit code you received at #{phone_number}:")
return { "securityCode" => { "code" => code.to_s }, "phoneNumber" => { "id" => phone_id }, "mode" => "sms" }.to_json
end | ruby | def request_two_factor_code_from_phone(phone_id, phone_number, code_length)
# Request code
r = request(:put) do |req|
req.url("https://idmsa.apple.com/appleauth/auth/verify/phone")
req.headers['Content-Type'] = 'application/json'
req.body = { "phoneNumber" => { "id" => phone_id }, "mode" => "sms" }.to_json
update_request_headers(req)
end
# we use `Spaceship::TunesClient.new.handle_itc_response`
# since this might be from the Dev Portal, but for 2 step
Spaceship::TunesClient.new.handle_itc_response(r.body)
puts("Successfully requested text message to #{phone_number}")
code = ask_for_2fa_code("Please enter the #{code_length} digit code you received at #{phone_number}:")
return { "securityCode" => { "code" => code.to_s }, "phoneNumber" => { "id" => phone_id }, "mode" => "sms" }.to_json
end | [
"def",
"request_two_factor_code_from_phone",
"(",
"phone_id",
",",
"phone_number",
",",
"code_length",
")",
"# Request code",
"r",
"=",
"request",
"(",
":put",
")",
"do",
"|",
"req",
"|",
"req",
".",
"url",
"(",
"\"https://idmsa.apple.com/appleauth/auth/verify/phone\"... | this is used in two places: after choosing a phone number and when a phone number is set via ENV var | [
"this",
"is",
"used",
"in",
"two",
"places",
":",
"after",
"choosing",
"a",
"phone",
"number",
"and",
"when",
"a",
"phone",
"number",
"is",
"set",
"via",
"ENV",
"var"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/two_step_or_factor_client.rb#L255-L273 | train | Request the two factor code from a phone number | [
30522,
13366,
5227,
1035,
2048,
1035,
5387,
1035,
3642,
1035,
2013,
1035,
3042,
1006,
3042,
1035,
8909,
1010,
3042,
1035,
2193,
1010,
3642,
1035,
3091,
1007,
1001,
5227,
3642,
1054,
1027,
5227,
1006,
1024,
2404,
1007,
2079,
1064,
2128,
41... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chanks/que | lib/que/job_methods.rb | Que.JobMethods._run | def _run(args: nil, reraise_errors: false)
if args.nil? && que_target
args = que_target.que_attrs.fetch(:args)
end
run(*args)
default_resolve_action if que_target && !que_target.que_resolved
rescue => error
raise error unless que_target
que_target.que_error = error
run_error_notifier =
begin
handle_error(error)
rescue => error_2
Que.notify_error(error_2, que_target.que_attrs)
true
end
Que.notify_error(error, que_target.que_attrs) if run_error_notifier
retry_in_default_interval unless que_target.que_resolved
raise error if reraise_errors
end | ruby | def _run(args: nil, reraise_errors: false)
if args.nil? && que_target
args = que_target.que_attrs.fetch(:args)
end
run(*args)
default_resolve_action if que_target && !que_target.que_resolved
rescue => error
raise error unless que_target
que_target.que_error = error
run_error_notifier =
begin
handle_error(error)
rescue => error_2
Que.notify_error(error_2, que_target.que_attrs)
true
end
Que.notify_error(error, que_target.que_attrs) if run_error_notifier
retry_in_default_interval unless que_target.que_resolved
raise error if reraise_errors
end | [
"def",
"_run",
"(",
"args",
":",
"nil",
",",
"reraise_errors",
":",
"false",
")",
"if",
"args",
".",
"nil?",
"&&",
"que_target",
"args",
"=",
"que_target",
".",
"que_attrs",
".",
"fetch",
"(",
":args",
")",
"end",
"run",
"(",
"args",
")",
"default_reso... | Note that we delegate almost all methods to the result of the que_target
method, which could be one of a few things, depending on the circumstance.
Run the job with error handling and cleanup logic. Optionally support
overriding the args, because it's necessary when jobs are invoked from
ActiveJob. | [
"Note",
"that",
"we",
"delegate",
"almost",
"all",
"methods",
"to",
"the",
"result",
"of",
"the",
"que_target",
"method",
"which",
"could",
"be",
"one",
"of",
"a",
"few",
"things",
"depending",
"on",
"the",
"circumstance",
".",
"Run",
"the",
"job",
"with",... | c7ae049db0ca13056a28c71ae610f8900f21feb4 | https://github.com/chanks/que/blob/c7ae049db0ca13056a28c71ae610f8900f21feb4/lib/que/job_methods.rb#L42-L66 | train | Run the action. | [
30522,
13366,
1035,
2448,
1006,
12098,
5620,
1024,
9152,
2140,
1010,
2128,
14995,
3366,
1035,
10697,
1024,
6270,
1007,
2065,
12098,
5620,
1012,
9152,
2140,
1029,
1004,
1004,
10861,
1035,
30524,
12098,
5620,
1007,
12398,
1035,
10663,
1035,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | 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.copy_image_store_content_with_http_info | def copy_image_store_content_with_http_info(image_store_copy_description, timeout:60, custom_headers:nil)
copy_image_store_content_async(image_store_copy_description, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def copy_image_store_content_with_http_info(image_store_copy_description, timeout:60, custom_headers:nil)
copy_image_store_content_async(image_store_copy_description, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"copy_image_store_content_with_http_info",
"(",
"image_store_copy_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"copy_image_store_content_async",
"(",
"image_store_copy_description",
",",
"timeout",
":",
"timeout",
",",
"custom_head... | Copies image store content internally
Copies the image store content from the source image store relative path to
the destination image store relative path.
@param image_store_copy_description [ImageStoreCopyDescription] Describes the
copy description for the image store.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Copies",
"image",
"store",
"content",
"internally"
] | 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#L19644-L19646 | train | Copies the image store content to an image store. | [
30522,
13366,
6100,
1035,
3746,
1035,
3573,
1035,
4180,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
3746,
1035,
3573,
1035,
6100,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
6100,
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... |
activeadmin/activeadmin | lib/active_admin/namespace.rb | ActiveAdmin.Namespace.build_menu | def build_menu(name = DEFAULT_MENU)
@menus.before_build do |menus|
menus.menu name do |menu|
yield menu
end
end
end | ruby | def build_menu(name = DEFAULT_MENU)
@menus.before_build do |menus|
menus.menu name do |menu|
yield menu
end
end
end | [
"def",
"build_menu",
"(",
"name",
"=",
"DEFAULT_MENU",
")",
"@menus",
".",
"before_build",
"do",
"|",
"menus",
"|",
"menus",
".",
"menu",
"name",
"do",
"|",
"menu",
"|",
"yield",
"menu",
"end",
"end",
"end"
] | Add a callback to be ran when we build the menu
@param [Symbol] name The name of the menu. Default: :default
@yield [ActiveAdmin::Menu] The block to be ran when the menu is built
@return [void] | [
"Add",
"a",
"callback",
"to",
"be",
"ran",
"when",
"we",
"build",
"the",
"menu"
] | 0759c8dcf97865748c9344459162ac3c7e65a6cd | https://github.com/activeadmin/activeadmin/blob/0759c8dcf97865748c9344459162ac3c7e65a6cd/lib/active_admin/namespace.rb#L135-L141 | train | Creates a new menu with the given name. | [
30522,
13366,
3857,
1035,
12183,
1006,
2171,
1027,
12398,
1035,
12183,
1007,
1030,
12183,
2015,
1012,
2077,
1035,
3857,
2079,
1064,
12183,
2015,
1064,
12183,
2015,
1012,
12183,
2171,
2079,
1064,
12183,
1064,
10750,
12183,
2203,
2203,
2203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.delete_instances | def delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
response = delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
nil
end | ruby | def delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
response = delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete_instances",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_instances_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
",",
... | Deletes virtual machines in 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.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
of virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"virtual",
"machines",
"in",
"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#L300-L303 | train | Deletes a set of virtual machines in a VM scale set. | [
30522,
13366,
3972,
12870,
1035,
12107,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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... |
scenic-views/scenic | lib/scenic/statements.rb | Scenic.Statements.replace_view | def replace_view(name, version: nil, revert_to_version: nil, materialized: false)
if version.blank?
raise ArgumentError, "version is required"
end
if materialized
raise ArgumentError, "Cannot replace materialized views"
end
sql_definition = definition(name, version)
Scenic.database.replace_view(name, sql_definition)
end | ruby | def replace_view(name, version: nil, revert_to_version: nil, materialized: false)
if version.blank?
raise ArgumentError, "version is required"
end
if materialized
raise ArgumentError, "Cannot replace materialized views"
end
sql_definition = definition(name, version)
Scenic.database.replace_view(name, sql_definition)
end | [
"def",
"replace_view",
"(",
"name",
",",
"version",
":",
"nil",
",",
"revert_to_version",
":",
"nil",
",",
"materialized",
":",
"false",
")",
"if",
"version",
".",
"blank?",
"raise",
"ArgumentError",
",",
"\"version is required\"",
"end",
"if",
"materialized",
... | Update a database view to a new version using `CREATE OR REPLACE VIEW`.
The existing view is replaced using the supplied `version`
parameter.
Does not work with materialized views due to lack of database support.
@param name [String, Symbol] The name of the database view.
@param version [Fixnum] The version number of the view.
@param revert_to_version [Fixnum] The version number to rollback to on
`rake db rollback`
@return The database response from executing the create statement.
@example
replace_view :engagement_reports, version: 3, revert_to_version: 2 | [
"Update",
"a",
"database",
"view",
"to",
"a",
"new",
"version",
"using",
"CREATE",
"OR",
"REPLACE",
"VIEW",
"."
] | cc6adbde2bded9c895c41025d371c4c0f34c9253 | https://github.com/scenic-views/scenic/blob/cc6adbde2bded9c895c41025d371c4c0f34c9253/lib/scenic/statements.rb#L135-L147 | train | Replace a view in the database | [
30522,
13366,
5672,
1035,
3193,
1006,
2171,
1010,
2544,
1024,
9152,
2140,
1010,
7065,
8743,
1035,
2000,
1035,
2544,
1024,
9152,
2140,
1010,
27075,
1024,
6270,
1007,
2065,
2544,
1012,
8744,
1029,
5333,
6685,
2121,
29165,
1010,
1000,
2544,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lostisland/faraday | lib/faraday/request.rb | Faraday.Request.url | def url(path, params = nil)
if path.respond_to? :query
if (query = path.query)
path = path.dup
path.query = nil
end
else
anchor_index = path.index('#')
path = path.slice(0, anchor_index) unless anchor_index.nil?
path, query = path.split('?', 2)
end
self.path = path
self.params.merge_query query, options.params_encoder
self.params.update(params) if params
end | ruby | def url(path, params = nil)
if path.respond_to? :query
if (query = path.query)
path = path.dup
path.query = nil
end
else
anchor_index = path.index('#')
path = path.slice(0, anchor_index) unless anchor_index.nil?
path, query = path.split('?', 2)
end
self.path = path
self.params.merge_query query, options.params_encoder
self.params.update(params) if params
end | [
"def",
"url",
"(",
"path",
",",
"params",
"=",
"nil",
")",
"if",
"path",
".",
"respond_to?",
":query",
"if",
"(",
"query",
"=",
"path",
".",
"query",
")",
"path",
"=",
"path",
".",
"dup",
"path",
".",
"query",
"=",
"nil",
"end",
"else",
"anchor_ind... | Update path and params.
@param path [URI, String]
@param params [Hash, nil]
@return [void] | [
"Update",
"path",
"and",
"params",
"."
] | 3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70 | https://github.com/lostisland/faraday/blob/3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70/lib/faraday/request.rb#L86-L100 | train | Returns a url for the current request. | [
30522,
13366,
24471,
2140,
1006,
4130,
1010,
11498,
5244,
1027,
9152,
2140,
1007,
2065,
4130,
1012,
6869,
1035,
2000,
1029,
1024,
23032,
2065,
1006,
23032,
1027,
4130,
1012,
23032,
1007,
4130,
1027,
4130,
1012,
4241,
2361,
4130,
1012,
23032... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.get_public_encryption_key | def get_public_encryption_key(resource_group_name, manager_name, custom_headers:nil)
response = get_public_encryption_key_async(resource_group_name, manager_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_public_encryption_key(resource_group_name, manager_name, custom_headers:nil)
response = get_public_encryption_key_async(resource_group_name, manager_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_public_encryption_key",
"(",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_public_encryption_key_async",
"(",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":custom_headers",
")",
... | Returns the symmetric encrypted public encryption key of the manager.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SymmetricEncryptedSecret] operation results. | [
"Returns",
"the",
"symmetric",
"encrypted",
"public",
"encryption",
"key",
"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#L1379-L1382 | train | Gets the public encryption key of the specified managed database. | [
30522,
13366,
2131,
1035,
2270,
1035,
21999,
1035,
3145,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2270,
1035,
21999,
1035,
3145,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/puppet | lib/puppet/environments.rb | Puppet::Environments.EnvironmentCreator.for | def for(module_path, manifest)
Puppet::Node::Environment.create(:anonymous,
module_path.split(File::PATH_SEPARATOR),
manifest)
end | ruby | def for(module_path, manifest)
Puppet::Node::Environment.create(:anonymous,
module_path.split(File::PATH_SEPARATOR),
manifest)
end | [
"def",
"for",
"(",
"module_path",
",",
"manifest",
")",
"Puppet",
"::",
"Node",
"::",
"Environment",
".",
"create",
"(",
":anonymous",
",",
"module_path",
".",
"split",
"(",
"File",
"::",
"PATH_SEPARATOR",
")",
",",
"manifest",
")",
"end"
] | Create an anonymous environment.
@param module_path [String] A list of module directories separated by the
PATH_SEPARATOR
@param manifest [String] The path to the manifest
@return A new environment with the `name` `:anonymous`
@api private | [
"Create",
"an",
"anonymous",
"environment",
"."
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/environments.rb#L21-L25 | train | Creates a new environment for the given module path and manifest | [
30522,
13366,
2005,
1006,
11336,
1035,
4130,
1010,
19676,
1007,
13997,
1024,
1024,
13045,
1024,
1024,
4044,
1012,
3443,
1006,
1024,
10812,
1010,
11336,
1035,
4130,
1012,
3975,
1006,
5371,
1024,
1024,
4130,
1035,
19802,
25879,
2953,
1007,
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... |
guard/guard | lib/guard/commander.rb | Guard.Commander.pause | def pause(expected = nil)
paused = listener.paused?
states = { paused: true, unpaused: false, toggle: !paused }
pause = states[expected || :toggle]
fail ArgumentError, "invalid mode: #{expected.inspect}" if pause.nil?
return if pause == paused
listener.public_send(pause ? :pause : :start)
UI.info "File event handling has been #{pause ? 'paused' : 'resumed'}"
end | ruby | def pause(expected = nil)
paused = listener.paused?
states = { paused: true, unpaused: false, toggle: !paused }
pause = states[expected || :toggle]
fail ArgumentError, "invalid mode: #{expected.inspect}" if pause.nil?
return if pause == paused
listener.public_send(pause ? :pause : :start)
UI.info "File event handling has been #{pause ? 'paused' : 'resumed'}"
end | [
"def",
"pause",
"(",
"expected",
"=",
"nil",
")",
"paused",
"=",
"listener",
".",
"paused?",
"states",
"=",
"{",
"paused",
":",
"true",
",",
"unpaused",
":",
"false",
",",
"toggle",
":",
"!",
"paused",
"}",
"pause",
"=",
"states",
"[",
"expected",
"|... | Pause Guard listening to file changes. | [
"Pause",
"Guard",
"listening",
"to",
"file",
"changes",
"."
] | e2508cd83badf0d537dbaba35d307adc35d92e4f | https://github.com/guard/guard/blob/e2508cd83badf0d537dbaba35d307adc35d92e4f/lib/guard/commander.rb#L88-L97 | train | Pause the file | [
30522,
13366,
8724,
1006,
3517,
1027,
9152,
2140,
1007,
5864,
1027,
19373,
1012,
5864,
1029,
2163,
1027,
1063,
5864,
1024,
2995,
1010,
4895,
4502,
13901,
1024,
6270,
1010,
2000,
24679,
1024,
999,
5864,
1065,
8724,
1027,
2163,
1031,
3517,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb | Azure::CDN::Mgmt::V2017_04_02.CustomDomains.enable_custom_https | def enable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:nil)
response = enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def enable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:nil)
response = enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"enable_custom_https",
"(",
"resource_group_name",
",",
"profile_name",
",",
"endpoint_name",
",",
"custom_domain_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"enable_custom_https_async",
"(",
"resource_group_name",
",",
"profile_name",
",",
"e... | Enable https delivery of the custom domain.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param profile_name [String] Name of the CDN profile which is unique within
the resource group.
@param endpoint_name [String] Name of the endpoint under the profile which is
unique globally.
@param custom_domain_name [String] Name of the custom domain within an
endpoint.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CustomDomain] operation results. | [
"Enable",
"https",
"delivery",
"of",
"the",
"custom",
"domain",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb#L492-L495 | train | Enables the specified CDN endpoint for CDN authentication. | [
30522,
13366,
9585,
1035,
7661,
1035,
16770,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
2203,
8400,
1035,
2171,
1010,
7661,
1035,
5884,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.reissue | def reissue(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil)
response = reissue_async(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:custom_headers).value!
nil
end | ruby | def reissue(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil)
response = reissue_async(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:custom_headers).value!
nil
end | [
"def",
"reissue",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"reissue_certificate_order_request",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"reissue_async",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"reissue_certific... | Reissue an existing certificate order.
Reissue an existing certificate order.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param certificate_order_name [String] Name of the certificate order.
@param reissue_certificate_order_request [ReissueCertificateOrderRequest]
Parameters for the reissue.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Reissue",
"an",
"existing",
"certificate",
"order",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L1192-L1195 | train | Reissues a certificate order. | [
30522,
13366,
17173,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8196,
1035,
2344,
1035,
2171,
1010,
17173,
1035,
8196,
1035,
2344,
1035,
5227,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
17173,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_consumption/lib/2018-01-31/generated/azure_mgmt_consumption/price_sheet.rb | Azure::Consumption::Mgmt::V2018_01_31.PriceSheet.get_with_http_info | def get_with_http_info(expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
get_async(expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(expand:nil, skiptoken:nil, top:nil, custom_headers:nil)
get_async(expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"expand",
":",
"nil",
",",
"skiptoken",
":",
"nil",
",",
"top",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"expand",
":",
"expand",
",",
"skiptoken",
":",
"skiptoken",
",",
"top",
":",
"top",
... | Gets the price sheet for a scope by subscriptionId. Price sheet is available
via this API only for May 1, 2014 or later.
@param expand [String] May be used to expand the properties/meterDetails
within a price sheet. By default, these fields are not included when
returning price sheet.
@param skiptoken [String] Skiptoken is only used if a previous operation
returned a partial result. If a previous response contains a nextLink
element, the value of the nextLink element will include a skiptoken parameter
that specifies a starting point to use for subsequent calls.
@param top [Integer] May be used to limit the number of results to the top N
results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"price",
"sheet",
"for",
"a",
"scope",
"by",
"subscriptionId",
".",
"Price",
"sheet",
"is",
"available",
"via",
"this",
"API",
"only",
"for",
"May",
"1",
"2014",
"or",
"later",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_consumption/lib/2018-01-31/generated/azure_mgmt_consumption/price_sheet.rb#L66-L68 | train | Gets the list of the specified image. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7818,
1024,
9152,
2140,
1010,
13558,
18715,
2368,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
6038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb | Azure::CDN::Mgmt::V2017_04_02.Endpoints.update | def update(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:nil)
response = update_async(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:nil)
response = update_async(resource_group_name, profile_name, endpoint_name, endpoint_update_properties, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update",
"(",
"resource_group_name",
",",
"profile_name",
",",
"endpoint_name",
",",
"endpoint_update_properties",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"resource_group_name",
",",
"profile_name",
",",
"endpoint_name",
"... | Updates an existing CDN endpoint with the specified endpoint name under the
specified subscription, resource group and profile. Only tags and Origin
HostHeader can be updated after creating an endpoint. To update origins, use
the Update Origin operation. To update custom domains, use the Update Custom
Domain operation.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param profile_name [String] Name of the CDN profile which is unique within
the resource group.
@param endpoint_name [String] Name of the endpoint under the profile which is
unique globally.
@param endpoint_update_properties [EndpointUpdateParameters] Endpoint update
properties
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Endpoint] operation results. | [
"Updates",
"an",
"existing",
"CDN",
"endpoint",
"with",
"the",
"specified",
"endpoint",
"name",
"under",
"the",
"specified",
"subscription",
"resource",
"group",
"and",
"profile",
".",
"Only",
"tags",
"and",
"Origin",
"HostHeader",
"can",
"be",
"updated",
"after... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb#L311-L314 | train | Updates an endpoint. | [
30522,
13366,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
2203,
8400,
1035,
2171,
1010,
2203,
8400,
1035,
10651,
1035,
5144,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
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... |
jekyll/jekyll | lib/jekyll/log_adapter.rb | Jekyll.LogAdapter.message | def message(topic, message = nil)
raise ArgumentError, "block or message, not both" if block_given? && message
message = yield if block_given?
message = message.to_s.gsub(%r!\s+!, " ")
topic = formatted_topic(topic, block_given?)
out = topic + message
messages << out
out
end | ruby | def message(topic, message = nil)
raise ArgumentError, "block or message, not both" if block_given? && message
message = yield if block_given?
message = message.to_s.gsub(%r!\s+!, " ")
topic = formatted_topic(topic, block_given?)
out = topic + message
messages << out
out
end | [
"def",
"message",
"(",
"topic",
",",
"message",
"=",
"nil",
")",
"raise",
"ArgumentError",
",",
"\"block or message, not both\"",
"if",
"block_given?",
"&&",
"message",
"message",
"=",
"yield",
"if",
"block_given?",
"message",
"=",
"message",
".",
"to_s",
".",
... | Internal: Build a topic method
topic - the topic of the message, e.g. "Configuration file", "Deprecation", etc.
message - the message detail
Returns the formatted message | [
"Internal",
":",
"Build",
"a",
"topic",
"method"
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/log_adapter.rb#L106-L115 | train | Add a message to the message queue | [
30522,
13366,
4471,
1006,
8476,
1010,
4471,
1027,
9152,
30524,
1004,
4471,
4471,
1027,
10750,
2065,
3796,
1035,
2445,
1029,
4471,
1027,
4471,
1012,
2000,
1035,
1055,
1012,
28177,
12083,
1006,
1003,
1054,
999,
1032,
1055,
1009,
999,
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... |
appium/ruby_lib | lib/appium_lib/common/helper.rb | Appium.Common.xml_values | def xml_values(target)
lazy_load_strings
@lazy_load_strings.select { |_key, value| value.downcase.include? target.downcase }
end | ruby | def xml_values(target)
lazy_load_strings
@lazy_load_strings.select { |_key, value| value.downcase.include? target.downcase }
end | [
"def",
"xml_values",
"(",
"target",
")",
"lazy_load_strings",
"@lazy_load_strings",
".",
"select",
"{",
"|",
"_key",
",",
"value",
"|",
"value",
".",
"downcase",
".",
"include?",
"target",
".",
"downcase",
"}",
"end"
] | Search strings.xml's keys for target.
@param target [String] the target to search for in strings.xml keys
@return [Array] | [
"Search",
"strings",
".",
"xml",
"s",
"keys",
"for",
"target",
"."
] | 1f5898400dd1928bfe42ddd5f842d1f8738f2f76 | https://github.com/appium/ruby_lib/blob/1f5898400dd1928bfe42ddd5f842d1f8738f2f76/lib/appium_lib/common/helper.rb#L191-L194 | train | Returns the XML values for the given target. | [
30522,
13366,
20950,
1035,
5300,
1006,
4539,
1007,
13971,
1035,
7170,
1035,
7817,
1030,
13971,
1035,
7170,
1035,
7817,
1012,
7276,
1063,
1064,
1035,
3145,
1010,
3643,
1064,
3643,
1012,
2091,
18382,
1012,
2421,
1029,
4539,
1012,
2091,
18382,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_iot_central/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/apps.rb | Azure::IotCentral::Mgmt::V2017_07_01_privatepreview.Apps.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, resource_name, app_patch, custom_headers:nil)
begin_update_async(resource_group_name, resource_name, app_patch, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, resource_name, app_patch, custom_headers:nil)
begin_update_async(resource_group_name, resource_name, app_patch, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"resource_name",
",",
"app_patch",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"app_patch",
",",
"custom_headers",
":custom_head... | Update the metadata of an IoT Central application.
@param resource_group_name [String] The name of the resource group that
contains the IoT Central application.
@param resource_name [String] The ARM resource name of the IoT Central
application.
@param app_patch [AppPatch] The IoT Central application metadata and security
metadata.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Update",
"the",
"metadata",
"of",
"an",
"IoT",
"Central",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_central/lib/2017-07-01-privatepreview/generated/azure_mgmt_iot_central/apps.rb#L702-L704 | train | Updates an existing App Service Environment. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
10439,
1035,
8983,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
10651,
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... |
jnunemaker/httparty | lib/httparty.rb | HTTParty.ClassMethods.get | def get(path, options = {}, &block)
perform_request Net::HTTP::Get, path, options, &block
end | ruby | def get(path, options = {}, &block)
perform_request Net::HTTP::Get, path, options, &block
end | [
"def",
"get",
"(",
"path",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"perform_request",
"Net",
"::",
"HTTP",
"::",
"Get",
",",
"path",
",",
"options",
",",
"block",
"end"
] | Allows making a get request to a url.
class Foo
include HTTParty
end
# Simple get with full url
Foo.get('http://foo.com/resource.json')
# Simple get with full url and query parameters
# ie: http://foo.com/resource.json?limit=10
Foo.get('http://foo.com/resource.json', query: {limit: 10}) | [
"Allows",
"making",
"a",
"get",
"request",
"to",
"a",
"url",
"."
] | b4099defba01231d2faaaa2660476f867e096bfb | https://github.com/jnunemaker/httparty/blob/b4099defba01231d2faaaa2660476f867e096bfb/lib/httparty.rb#L506-L508 | train | Perform a GET request to the specified path. | [
30522,
13366,
2131,
1006,
4130,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
4685,
1035,
5227,
5658,
1024,
1024,
8299,
1024,
1024,
2131,
1010,
4130,
1010,
7047,
1010,
1004,
3796,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_tables.rb | Azure::Network::Mgmt::V2018_07_01.RouteTables.begin_delete | def begin_delete(resource_group_name, route_table_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, route_table_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, route_table_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, route_table_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"route_table_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"route_table_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Deletes the specified route table.
@param resource_group_name [String] The name of the resource group.
@param route_table_name [String] The name of the route table.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"route",
"table",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_tables.rb#L430-L433 | train | Deletes a route table. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2799,
1035,
2795,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/replication_network_mappings.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2016_08_10.ReplicationNetworkMappings.list_by_replication_networks_as_lazy | def list_by_replication_networks_as_lazy(fabric_name, network_name, custom_headers:nil)
response = list_by_replication_networks_async(fabric_name, network_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_replication_networks_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_replication_networks_as_lazy(fabric_name, network_name, custom_headers:nil)
response = list_by_replication_networks_async(fabric_name, network_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_replication_networks_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_replication_networks_as_lazy",
"(",
"fabric_name",
",",
"network_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_replication_networks_async",
"(",
"fabric_name",
",",
"network_name",
",",
"custom_headers",
":custom_headers",
")",
"... | Gets all the network mappings under a network.
Lists all ASR network mappings for the specified network.
@param fabric_name [String] Primary fabric name.
@param network_name [String] Primary network name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [NetworkMappingCollection] which provide lazy access to pages of the
response. | [
"Gets",
"all",
"the",
"network",
"mappings",
"under",
"a",
"network",
"."
] | 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/replication_network_mappings.rb#L1004-L1013 | train | Gets all the network connectivity rules. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
6125,
1035,
2004,
1035,
13971,
1006,
8313,
1035,
2171,
1010,
2897,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
21647,
1035,
6125,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
backup/backup | lib/backup/splitter.rb | Backup.Splitter.after_packaging | def after_packaging
suffixes = chunk_suffixes
first_suffix = "a" * suffix_length
if suffixes == [first_suffix]
FileUtils.mv(
File.join(Config.tmp_path, "#{package.basename}-#{first_suffix}"),
File.join(Config.tmp_path, package.basename)
)
else
package.chunk_suffixes = suffixes
end
end | ruby | def after_packaging
suffixes = chunk_suffixes
first_suffix = "a" * suffix_length
if suffixes == [first_suffix]
FileUtils.mv(
File.join(Config.tmp_path, "#{package.basename}-#{first_suffix}"),
File.join(Config.tmp_path, package.basename)
)
else
package.chunk_suffixes = suffixes
end
end | [
"def",
"after_packaging",
"suffixes",
"=",
"chunk_suffixes",
"first_suffix",
"=",
"\"a\"",
"*",
"suffix_length",
"if",
"suffixes",
"==",
"[",
"first_suffix",
"]",
"FileUtils",
".",
"mv",
"(",
"File",
".",
"join",
"(",
"Config",
".",
"tmp_path",
",",
"\"#{packa... | Finds the resulting files from the packaging procedure
and stores an Array of suffixes used in @package.chunk_suffixes.
If the @chunk_size was never reached and only one file
was written, that file will be suffixed with '-aa' (or -a; -aaa; etc
depending upon suffix_length). In which case, it will simply
remove the suffix from the filename. | [
"Finds",
"the",
"resulting",
"files",
"from",
"the",
"packaging",
"procedure",
"and",
"stores",
"an",
"Array",
"of",
"suffixes",
"used",
"in"
] | 64370f925e859f858766b674717a3dbee0de7a26 | https://github.com/backup/backup/blob/64370f925e859f858766b674717a3dbee0de7a26/lib/backup/splitter.rb#L46-L57 | train | Packaging the current package into the correct directory. | [
30522,
13366,
2044,
1035,
14793,
16809,
2229,
1027,
20000,
1035,
16809,
2229,
2034,
1035,
16809,
1027,
1000,
1037,
1000,
1008,
16809,
1035,
3091,
2065,
16809,
2229,
1027,
1027,
1031,
2034,
1035,
16809,
1033,
5371,
21823,
4877,
1012,
19842,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
googleapis/google-cloud-ruby | google-cloud-bigtable/lib/google-cloud-bigtable.rb | Google.Cloud.bigtable | def bigtable scope: nil, timeout: nil, credentials: nil, client_config: nil
Google::Cloud.bigtable(
project_id: @project,
credentials: (credentials || @keyfile),
scope: scope,
timeout: (timeout || @timeout),
client_config: client_config
)
end | ruby | def bigtable scope: nil, timeout: nil, credentials: nil, client_config: nil
Google::Cloud.bigtable(
project_id: @project,
credentials: (credentials || @keyfile),
scope: scope,
timeout: (timeout || @timeout),
client_config: client_config
)
end | [
"def",
"bigtable",
"scope",
":",
"nil",
",",
"timeout",
":",
"nil",
",",
"credentials",
":",
"nil",
",",
"client_config",
":",
"nil",
"Google",
"::",
"Cloud",
".",
"bigtable",
"(",
"project_id",
":",
"@project",
",",
"credentials",
":",
"(",
"credentials",... | Creates a new object for connecting to the Cloud Bigtable service.
For more information on connecting to Google Cloud Platform, see the
{file:AUTHENTICATION.md Authentication Guide}.
@param scope [Array<String>]
The OAuth 2.0 scopes controlling the set of resources and operations
that the connection can access. See [Using OAuth 2.0 to Access Google
APIs](https://developers.google.com/identity/protocols/OAuth2).
The OAuth scopes for this service. This parameter is ignored if an
updater_proc is supplied.
@param timeout [Integer]
The default timeout, in seconds, for calls made through this client.
@param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
Provides the means for authenticating requests made by the client. This parameter can
be one of the following types.
`Google::Auth::Credentials` uses the properties of its represented keyfile for
authenticating requests made by this client.
`String` will be treated as the path to the keyfile to use to construct
credentials for this client.
`Hash` will be treated as the contents of a keyfile to use to construct
credentials for this client.
`GRPC::Core::Channel` will be used to make calls through.
`GRPC::Core::ChannelCredentials` will be used to set up the gRPC client. The channel credentials
should already be composed with a `GRPC::Core::CallCredentials` object.
`Proc` will be used as an updater_proc for the gRPC channel. The proc transforms the
metadata for requests, generally, to give OAuth credentials.
@param client_config [Hash]
A hash for call options for each method.
See Google::Gax#construct_settings for the structure of
this data. Falls back to the default config if not specified
or the specified config is missing data points.
@return [Google::Cloud::Bigtable::Project]
@example
require "google/cloud"
gcloud = Google::Cloud.new
bigtable = gcloud.bigtable | [
"Creates",
"a",
"new",
"object",
"for",
"connecting",
"to",
"the",
"Cloud",
"Bigtable",
"service",
"."
] | 846c1a57250ac860ef4de1b54853a480ab2ff702 | https://github.com/googleapis/google-cloud-ruby/blob/846c1a57250ac860ef4de1b54853a480ab2ff702/google-cloud-bigtable/lib/google-cloud-bigtable.rb#L71-L79 | train | Create a bigtable client | [
30522,
13366,
2502,
10880,
9531,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
9152,
2140,
1010,
22496,
1024,
9152,
2140,
1010,
7396,
1035,
9530,
8873,
2290,
1024,
9152,
2140,
8224,
1024,
1024,
6112,
1012,
2502,
10880,
1006,
2622,
1035,
8909,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Tag.get_by_product_with_http_info | def get_by_product_with_http_info(resource_group_name, service_name, product_id, tag_id, custom_headers:nil)
get_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers:custom_headers).value!
end | ruby | def get_by_product_with_http_info(resource_group_name, service_name, product_id, tag_id, custom_headers:nil)
get_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers:custom_headers).value!
end | [
"def",
"get_by_product_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"product_id",
",",
"tag_id",
",",
"custom_headers",
":",
"nil",
")",
"get_by_product_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"product_id",
",",
"tag_id",
... | Get tag associated with the Product.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param product_id [String] Product identifier. Must be unique in the current
API Management service instance.
@param tag_id [String] Tag identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Get",
"tag",
"associated",
"with",
"the",
"Product",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb#L2263-L2265 | train | Gets the product s attributes. | [
30522,
13366,
2131,
1035,
2011,
1035,
4031,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
4031,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
7661,
1035,
30524,
2131,
1035,
2011,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github-changelog-generator/github-changelog-generator | lib/github_changelog_generator/generator/generator.rb | GitHubChangelogGenerator.Generator.compound_changelog | def compound_changelog
@options.load_custom_ruby_files
fetch_and_filter_tags
fetch_issues_and_pr
log = ""
log += @options[:frontmatter] if @options[:frontmatter]
log += "#{options[:header]}\n\n"
log += if @options[:unreleased_only]
generate_entry_between_tags(@filtered_tags[0], nil)
else
generate_entries_for_all_tags
end
log += File.read(@options[:base]) if File.file?(@options[:base])
credit_line = "\n\n\\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*"
log.gsub!(/#{credit_line}(\n)?/, "") # Remove old credit lines
log += "#{credit_line}\n"
@log = log
end | ruby | def compound_changelog
@options.load_custom_ruby_files
fetch_and_filter_tags
fetch_issues_and_pr
log = ""
log += @options[:frontmatter] if @options[:frontmatter]
log += "#{options[:header]}\n\n"
log += if @options[:unreleased_only]
generate_entry_between_tags(@filtered_tags[0], nil)
else
generate_entries_for_all_tags
end
log += File.read(@options[:base]) if File.file?(@options[:base])
credit_line = "\n\n\\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*"
log.gsub!(/#{credit_line}(\n)?/, "") # Remove old credit lines
log += "#{credit_line}\n"
@log = log
end | [
"def",
"compound_changelog",
"@options",
".",
"load_custom_ruby_files",
"fetch_and_filter_tags",
"fetch_issues_and_pr",
"log",
"=",
"\"\"",
"log",
"+=",
"@options",
"[",
":frontmatter",
"]",
"if",
"@options",
"[",
":frontmatter",
"]",
"log",
"+=",
"\"#{options[:header]}... | A Generator responsible for all logic, related with changelog generation from ready-to-parse issues
Example:
generator = GitHubChangelogGenerator::Generator.new
content = generator.compound_changelog
Main function to start changelog generation
@return [String] Generated changelog file | [
"A",
"Generator",
"responsible",
"for",
"all",
"logic",
"related",
"with",
"changelog",
"generation",
"from",
"ready",
"-",
"to",
"-",
"parse",
"issues"
] | f18c64b5cc0d7473b059275b88385ac11ca8b564 | https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/generator/generator.rb#L44-L66 | train | Generate the Changelog. | [
30522,
13366,
7328,
1035,
2689,
21197,
1030,
7047,
1012,
7170,
1035,
7661,
1035,
10090,
1035,
6764,
18584,
1035,
1998,
1035,
11307,
1035,
22073,
18584,
1035,
3314,
1035,
1998,
1035,
10975,
8833,
1027,
1000,
1000,
8833,
1009,
1027,
1030,
704... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/rake | lib/rake/application.rb | Rake.Application.have_rakefile | def have_rakefile # :nodoc:
@rakefiles.each do |fn|
if File.exist?(fn)
others = FileList.glob(fn, File::FNM_CASEFOLD)
return others.size == 1 ? others.first : fn
elsif fn == ""
return fn
end
end
return nil
end | ruby | def have_rakefile # :nodoc:
@rakefiles.each do |fn|
if File.exist?(fn)
others = FileList.glob(fn, File::FNM_CASEFOLD)
return others.size == 1 ? others.first : fn
elsif fn == ""
return fn
end
end
return nil
end | [
"def",
"have_rakefile",
"# :nodoc:",
"@rakefiles",
".",
"each",
"do",
"|",
"fn",
"|",
"if",
"File",
".",
"exist?",
"(",
"fn",
")",
"others",
"=",
"FileList",
".",
"glob",
"(",
"fn",
",",
"File",
"::",
"FNM_CASEFOLD",
")",
"return",
"others",
".",
"size... | True if one of the files in RAKEFILES is in the current directory.
If a match is found, it is copied into @rakefile. | [
"True",
"if",
"one",
"of",
"the",
"files",
"in",
"RAKEFILES",
"is",
"in",
"the",
"current",
"directory",
".",
"If",
"a",
"match",
"is",
"found",
"it",
"is",
"copied",
"into"
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/application.rb#L274-L284 | train | Returns the unique identifier for the rake file | [
30522,
13366,
2031,
1035,
26008,
8873,
2571,
1001,
1024,
7293,
10085,
1024,
1030,
26008,
8873,
4244,
1012,
2169,
2079,
1064,
1042,
2078,
1064,
2065,
5371,
1012,
4839,
1029,
1006,
1042,
2078,
1007,
2500,
1027,
5371,
9863,
1012,
1043,
4135,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.generate_random_id | def generate_random_id(method)
data = File.open("/dev/urandom", "rb") do |f|
f.read(64)
end
case method
when :base64
data = base64(data)
data.gsub!("+", '')
data.gsub!("/", '')
data.gsub!(/==$/, '')
return data
when :hex
return data.unpack('H*')[0]
else
raise ArgumentError, "Invalid method #{method.inspect}"
end
end | ruby | def generate_random_id(method)
data = File.open("/dev/urandom", "rb") do |f|
f.read(64)
end
case method
when :base64
data = base64(data)
data.gsub!("+", '')
data.gsub!("/", '')
data.gsub!(/==$/, '')
return data
when :hex
return data.unpack('H*')[0]
else
raise ArgumentError, "Invalid method #{method.inspect}"
end
end | [
"def",
"generate_random_id",
"(",
"method",
")",
"data",
"=",
"File",
".",
"open",
"(",
"\"/dev/urandom\"",
",",
"\"rb\"",
")",
"do",
"|",
"f",
"|",
"f",
".",
"read",
"(",
"64",
")",
"end",
"case",
"method",
"when",
":base64",
"data",
"=",
"base64",
... | Generate a long, cryptographically secure random ID string, which
is also a valid filename. | [
"Generate",
"a",
"long",
"cryptographically",
"secure",
"random",
"ID",
"string",
"which",
"is",
"also",
"a",
"valid",
"filename",
"."
] | 970964b53e0ba86959acdf40f06c99b0c4a128ca | https://github.com/phusion/passenger/blob/970964b53e0ba86959acdf40f06c99b0c4a128ca/src/ruby_supportlib/phusion_passenger/utils.rb#L44-L60 | train | Generate a random ID for the current process | [
30522,
13366,
9699,
1035,
6721,
1035,
8909,
1006,
4118,
1007,
2951,
1027,
5371,
1012,
2330,
1006,
1000,
1013,
16475,
1013,
24471,
28574,
2213,
1000,
1010,
1000,
21144,
1000,
1007,
2079,
1064,
1042,
1064,
1042,
1012,
3191,
1006,
4185,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.get_site_diagnostic_category | def get_site_diagnostic_category(resource_group_name, site_name, diagnostic_category, custom_headers:nil)
response = get_site_diagnostic_category_async(resource_group_name, site_name, diagnostic_category, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_site_diagnostic_category(resource_group_name, site_name, diagnostic_category, custom_headers:nil)
response = get_site_diagnostic_category_async(resource_group_name, site_name, diagnostic_category, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_site_diagnostic_category",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_category",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_site_diagnostic_category_async",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_cat... | Get Diagnostics Category
Get Diagnostics Category
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param diagnostic_category [String] Diagnostic Category
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DiagnosticCategory] operation results. | [
"Get",
"Diagnostics",
"Category"
] | 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#L586-L589 | train | Gets the diagnostic category for a site. | [
30522,
13366,
2131,
1035,
2609,
1035,
16474,
1035,
4696,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2609,
1035,
16474,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hanami/hanami | lib/hanami/early_hints.rb | Hanami.EarlyHints.send_early_hints_response | def send_early_hints_response(env, link)
env[RACK_EARLY_HINTS_ENV_KEY].call("Link" => link)
rescue NoMethodError => exception
raise exception if env.key?(RACK_EARLY_HINTS_ENV_KEY)
raise NotSupportedByServerError
end | ruby | def send_early_hints_response(env, link)
env[RACK_EARLY_HINTS_ENV_KEY].call("Link" => link)
rescue NoMethodError => exception
raise exception if env.key?(RACK_EARLY_HINTS_ENV_KEY)
raise NotSupportedByServerError
end | [
"def",
"send_early_hints_response",
"(",
"env",
",",
"link",
")",
"env",
"[",
"RACK_EARLY_HINTS_ENV_KEY",
"]",
".",
"call",
"(",
"\"Link\"",
"=>",
"link",
")",
"rescue",
"NoMethodError",
"=>",
"exception",
"raise",
"exception",
"if",
"env",
".",
"key?",
"(",
... | Tries to send an Early Hints (103) HTTP response for a batch of assets
@param env [Hash] Rack env
@param link [String] the serialized HTTP `Link` headers
@raise [Hanami::EarlyHints::NotSupportedByServerError] if the current Ruby
server doesn't support Early Hints
@since 1.2.0
@api private | [
"Tries",
"to",
"send",
"an",
"Early",
"Hints",
"(",
"103",
")",
"HTTP",
"response",
"for",
"a",
"batch",
"of",
"assets"
] | 8c6e5147e92ef869b25379448572da3698eacfdc | https://github.com/hanami/hanami/blob/8c6e5147e92ef869b25379448572da3698eacfdc/lib/hanami/early_hints.rb#L122-L127 | train | Send early hints response to the specified link. | [
30522,
13366,
4604,
1035,
2220,
1035,
20385,
1035,
3433,
1006,
4372,
2615,
1010,
4957,
1007,
4372,
2615,
1031,
14513,
1035,
2220,
1035,
20385,
1035,
4372,
2615,
1035,
3145,
1033,
1012,
2655,
1006,
1000,
4957,
1000,
1027,
1028,
4957,
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... |
fastlane/fastlane | snapshot/lib/snapshot/runner.rb | Snapshot.Runner.verify_helper_is_current | def verify_helper_is_current
return if Snapshot.config[:skip_helper_version_check]
current_version = version_of_bundled_helper
UI.verbose("Checking that helper files contain #{current_version}")
helper_files = Update.find_helper
if helper_files.empty?
UI.error("Your Snapshot Helper file is missing, please place a copy")
UI.error("in your project directory")
UI.message("More information about Snapshot setup can be found here:")
UI.message("https://docs.fastlane.tools/actions/snapshot/#quick-start")
UI.user_error!("Please add a Snapshot Helper file to your project")
return
end
helper_files.each do |path|
content = File.read(path)
unless content.include?(current_version)
UI.error("Your '#{path}' is outdated, please run `fastlane snapshot update`")
UI.error("to update your Helper file")
UI.user_error!("Please update your Snapshot Helper file using `fastlane snapshot update`")
end
end
end | ruby | def verify_helper_is_current
return if Snapshot.config[:skip_helper_version_check]
current_version = version_of_bundled_helper
UI.verbose("Checking that helper files contain #{current_version}")
helper_files = Update.find_helper
if helper_files.empty?
UI.error("Your Snapshot Helper file is missing, please place a copy")
UI.error("in your project directory")
UI.message("More information about Snapshot setup can be found here:")
UI.message("https://docs.fastlane.tools/actions/snapshot/#quick-start")
UI.user_error!("Please add a Snapshot Helper file to your project")
return
end
helper_files.each do |path|
content = File.read(path)
unless content.include?(current_version)
UI.error("Your '#{path}' is outdated, please run `fastlane snapshot update`")
UI.error("to update your Helper file")
UI.user_error!("Please update your Snapshot Helper file using `fastlane snapshot update`")
end
end
end | [
"def",
"verify_helper_is_current",
"return",
"if",
"Snapshot",
".",
"config",
"[",
":skip_helper_version_check",
"]",
"current_version",
"=",
"version_of_bundled_helper",
"UI",
".",
"verbose",
"(",
"\"Checking that helper files contain #{current_version}\"",
")",
"helper_files"... | rubocop:disable Style/Next | [
"rubocop",
":",
"disable",
"Style",
"/",
"Next"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/snapshot/lib/snapshot/runner.rb#L119-L143 | train | Checks if the current helper file is the same as the one in the project directory. | [
30522,
13366,
20410,
1035,
2393,
2121,
1035,
2003,
1035,
2783,
2709,
2065,
20057,
12326,
1012,
9530,
8873,
2290,
1031,
1024,
13558,
1035,
2393,
2121,
1035,
2544,
1035,
4638,
1033,
2783,
1035,
2544,
1027,
2544,
1035,
1997,
1035,
24378,
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... |
sds/scss-lint | lib/scss_lint/linter.rb | SCSSLint.Linter.location_from_range | def location_from_range(range) # rubocop:disable Metrics/AbcSize
length = if range.start_pos.line == range.end_pos.line
range.end_pos.offset - range.start_pos.offset
else
line_source = engine.lines[range.start_pos.line - 1]
line_source.length - range.start_pos.offset + 1
end
# Workaround for https://github.com/sds/scss-lint/issues/887 to acount for
# https://github.com/sass/sass/issues/2284.
length = 1 if length < 1
Location.new(range.start_pos.line, range.start_pos.offset, length)
end | ruby | def location_from_range(range) # rubocop:disable Metrics/AbcSize
length = if range.start_pos.line == range.end_pos.line
range.end_pos.offset - range.start_pos.offset
else
line_source = engine.lines[range.start_pos.line - 1]
line_source.length - range.start_pos.offset + 1
end
# Workaround for https://github.com/sds/scss-lint/issues/887 to acount for
# https://github.com/sass/sass/issues/2284.
length = 1 if length < 1
Location.new(range.start_pos.line, range.start_pos.offset, length)
end | [
"def",
"location_from_range",
"(",
"range",
")",
"# rubocop:disable Metrics/AbcSize",
"length",
"=",
"if",
"range",
".",
"start_pos",
".",
"line",
"==",
"range",
".",
"end_pos",
".",
"line",
"range",
".",
"end_pos",
".",
"offset",
"-",
"range",
".",
"start_pos... | Extract {SCSSLint::Location} from a {Sass::Source::Range}.
@param range [Sass::Source::Range]
@return [SCSSLint::Location] | [
"Extract",
"{",
"SCSSLint",
"::",
"Location",
"}",
"from",
"a",
"{",
"Sass",
"::",
"Source",
"::",
"Range",
"}",
"."
] | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/linter.rb#L70-L83 | train | Returns a location from a range of positions | [
30522,
13366,
3295,
1035,
2013,
1035,
2846,
1006,
2846,
1007,
1001,
14548,
24163,
2361,
1024,
4487,
19150,
12046,
2015,
1013,
5925,
5332,
4371,
3091,
1027,
2065,
2846,
1012,
2707,
1035,
13433,
2015,
1012,
2240,
1027,
1027,
2846,
1012,
2203,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
watir/watir | lib/watir/elements/select.rb | Watir.Select.select_all! | def select_all!(*str_or_rx)
results = str_or_rx.flatten.map { |v| select_by!(v, :multiple) }
results.first
end | ruby | def select_all!(*str_or_rx)
results = str_or_rx.flatten.map { |v| select_by!(v, :multiple) }
results.first
end | [
"def",
"select_all!",
"(",
"*",
"str_or_rx",
")",
"results",
"=",
"str_or_rx",
".",
"flatten",
".",
"map",
"{",
"|",
"v",
"|",
"select_by!",
"(",
"v",
",",
":multiple",
")",
"}",
"results",
".",
"first",
"end"
] | Uses JavaScript to select all options whose text matches the given string.
@param [String, Regexp] str_or_rx
@raise [Watir::Exception::NoValueFoundException] if the value does not exist. | [
"Uses",
"JavaScript",
"to",
"select",
"all",
"options",
"whose",
"text",
"matches",
"the",
"given",
"string",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/elements/select.rb#L69-L72 | train | Select all elements in the list | [
30522,
13366,
7276,
1035,
2035,
999,
1006,
1008,
2358,
2099,
1035,
2030,
1035,
1054,
2595,
1007,
3463,
1027,
2358,
2099,
1035,
2030,
1035,
1054,
2595,
1012,
4257,
6528,
1012,
4949,
1063,
1064,
1058,
1064,
7276,
1035,
2011,
999,
1006,
1058... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/group.rb | Aws::IAM.Group.update | def update(options = {})
options = options.merge(group_name: @name)
resp = @client.update_group(options)
Group.new(
name: options[:new_group_name],
client: @client
)
end | ruby | def update(options = {})
options = options.merge(group_name: @name)
resp = @client.update_group(options)
Group.new(
name: options[:new_group_name],
client: @client
)
end | [
"def",
"update",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"group_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"update_group",
"(",
"options",
")",
"Group",
".",
"new",
"(",
"name",
":",
"options",
"[... | @example Request syntax with placeholder values
group = group.update({
new_path: "pathType",
new_group_name: "groupNameType",
})
@param [Hash] options ({})
@option options [String] :new_path
New path for the IAM group. Only include this if changing the group's
path.
This parameter allows (through its [regex pattern][1]) a string of
characters consisting of either a forward slash (/) by itself or a
string that must begin and end with forward slashes. In addition, it
can contain any ASCII character from the ! (\\u0021) through the DEL
character (\\u007F), including most punctuation characters, digits,
and upper and lowercased letters.
[1]: http://wikipedia.org/wiki/regex
@option options [String] :new_group_name
New name for the IAM group. Only include this if changing the group's
name.
This parameter allows (through its [regex pattern][1]) a string of
characters consisting of upper and lowercase alphanumeric characters
with no spaces. You can also include any of the following characters:
\_+=,.@-
[1]: http://wikipedia.org/wiki/regex
@return [Group] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/group.rb#L431-L438 | train | Update the group | [
30522,
13366,
10651,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2177,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
10651,
1035,
2177,
1006,
7047,
1007,
2177,
1012,
2047,
1006,
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_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Devices.begin_failover | def begin_failover(source_device_name, parameters, resource_group_name, manager_name, custom_headers:nil)
response = begin_failover_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_failover(source_device_name, parameters, resource_group_name, manager_name, custom_headers:nil)
response = begin_failover_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_failover",
"(",
"source_device_name",
",",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_failover_async",
"(",
"source_device_name",
",",
"parameters",
",",
"resource_group_na... | Failovers a set of volume containers from a specified source device to a
target device.
@param source_device_name [String] The source device name on which failover
is performed.
@param parameters [FailoverRequest] FailoverRequest containing the source
device and the list of volume containers to be failed over.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Failovers",
"a",
"set",
"of",
"volume",
"containers",
"from",
"a",
"specified",
"source",
"device",
"to",
"a",
"target",
"device",
"."
] | 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/devices.rb#L1667-L1670 | train | Gets the next chunk of the image from the source device. | [
30522,
13366,
4088,
1035,
8246,
7840,
1006,
3120,
1035,
5080,
1035,
2171,
1010,
11709,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
8246,
7840,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
resque/resque | lib/resque/job.rb | Resque.Job.fail | def fail(exception)
begin
run_failure_hooks(exception)
rescue Exception => e
raise e
ensure
Failure.create \
:payload => payload,
:exception => exception,
:worker => worker,
:queue => queue
end
end | ruby | def fail(exception)
begin
run_failure_hooks(exception)
rescue Exception => e
raise e
ensure
Failure.create \
:payload => payload,
:exception => exception,
:worker => worker,
:queue => queue
end
end | [
"def",
"fail",
"(",
"exception",
")",
"begin",
"run_failure_hooks",
"(",
"exception",
")",
"rescue",
"Exception",
"=>",
"e",
"raise",
"e",
"ensure",
"Failure",
".",
"create",
":payload",
"=>",
"payload",
",",
":exception",
"=>",
"exception",
",",
":worker",
... | Given an exception object, hands off the needed parameters to
the Failure module. | [
"Given",
"an",
"exception",
"object",
"hands",
"off",
"the",
"needed",
"parameters",
"to",
"the",
"Failure",
"module",
"."
] | adb633a0f6b98b1eb5a5a85bb36ebac9309978fd | https://github.com/resque/resque/blob/adb633a0f6b98b1eb5a5a85bb36ebac9309978fd/lib/resque/job.rb#L232-L244 | train | fails the request | [
30522,
13366,
8246,
1006,
6453,
1007,
4088,
2448,
1035,
4945,
1035,
18008,
1006,
6453,
1007,
5343,
6453,
1027,
1028,
1041,
5333,
1041,
5676,
4945,
1012,
3443,
1032,
1024,
18093,
1027,
1028,
18093,
1010,
1024,
6453,
1027,
1028,
6453,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.update_certificate | def update_certificate(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
response = update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_certificate(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
response = update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_certificate",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"name",
",",
"key_vault_certificate",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_certificate_async",
"(",
"resource_group_name",
",",
"certificate_order_name",... | Creates or updates a certificate and associates with key vault secret.
Creates or updates a certificate and associates with key vault secret.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param certificate_order_name [String] Name of the certificate order.
@param name [String] Name of the certificate.
@param key_vault_certificate [AppServiceCertificatePatchResource] Key vault
certificate resource Id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [AppServiceCertificateResource] operation results. | [
"Creates",
"or",
"updates",
"a",
"certificate",
"and",
"associates",
"with",
"key",
"vault",
"secret",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L1062-L1065 | train | Updates a certificate in an existing certificate order. | [
30522,
13366,
10651,
1035,
8196,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8196,
1035,
2344,
1035,
2171,
1010,
2171,
1010,
3145,
1035,
11632,
1035,
8196,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
8196,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/scopes.rb | Github.Client::Scopes.list | def list(*args)
arguments(args)
params = arguments.params
token = args.shift
if token.is_a?(Hash) && !params['token'].nil?
token = params.delete('token')
elsif token.nil?
token = oauth_token
end
if token.nil?
raise ArgumentError, 'Access token required'
end
headers = { 'Authorization' => "token #{token}" }
params['headers'] = headers
response = get_request("/user", params)
response.headers.oauth_scopes.split(',').map(&:strip)
end | ruby | def list(*args)
arguments(args)
params = arguments.params
token = args.shift
if token.is_a?(Hash) && !params['token'].nil?
token = params.delete('token')
elsif token.nil?
token = oauth_token
end
if token.nil?
raise ArgumentError, 'Access token required'
end
headers = { 'Authorization' => "token #{token}" }
params['headers'] = headers
response = get_request("/user", params)
response.headers.oauth_scopes.split(',').map(&:strip)
end | [
"def",
"list",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
")",
"params",
"=",
"arguments",
".",
"params",
"token",
"=",
"args",
".",
"shift",
"if",
"token",
".",
"is_a?",
"(",
"Hash",
")",
"&&",
"!",
"params",
"[",
"'token'",
"]",
".",
"nil?"... | Check what OAuth scopes you have.
@see https://developer.github.com/v3/oauth/#scopes
@example
github = Github.new oauth_token: 'e72e16c7e42f292c6912e7710c838347ae17'
github.scopes.all
@example
github = Github.new
github.scopes.list 'e72e16c7e42f292c6912e7710c838347ae17'
@example
github = Github.new
github.scopes.list token: 'e72e16c7e42f292c6912e7710c838347ae17'
@api public | [
"Check",
"what",
"OAuth",
"scopes",
"you",
"have",
"."
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/scopes.rb#L24-L43 | train | Get a list of all users | [
30522,
13366,
2862,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
19204,
1027,
12098,
5620,
1012,
5670,
2065,
19204,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
1004,
1004,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/licensed | lib/licensed/dependency.rb | Licensed.Dependency.notice_contents | def notice_contents
Dir.glob(dir_path.join("*"))
.grep(LEGAL_FILES_PATTERN)
.select { |path| File.file?(path) }
.sort # sorted by the path
.map { |path| { "sources" => normalize_source_path(path), "text" => File.read(path).rstrip } }
.select { |notice| notice["text"].length > 0 } # files with content only
end | ruby | def notice_contents
Dir.glob(dir_path.join("*"))
.grep(LEGAL_FILES_PATTERN)
.select { |path| File.file?(path) }
.sort # sorted by the path
.map { |path| { "sources" => normalize_source_path(path), "text" => File.read(path).rstrip } }
.select { |notice| notice["text"].length > 0 } # files with content only
end | [
"def",
"notice_contents",
"Dir",
".",
"glob",
"(",
"dir_path",
".",
"join",
"(",
"\"*\"",
")",
")",
".",
"grep",
"(",
"LEGAL_FILES_PATTERN",
")",
".",
"select",
"{",
"|",
"path",
"|",
"File",
".",
"file?",
"(",
"path",
")",
"}",
".",
"sort",
"# sorte... | Returns legal notices found at the dependency path | [
"Returns",
"legal",
"notices",
"found",
"at",
"the",
"dependency",
"path"
] | afba288df344e001d43e94ad9217635a011b79c2 | https://github.com/github/licensed/blob/afba288df344e001d43e94ad9217635a011b79c2/lib/licensed/dependency.rb#L81-L88 | train | Returns the array of notice objects | [
30522,
13366,
5060,
1035,
8417,
16101,
1012,
1043,
4135,
2497,
1006,
16101,
1035,
4130,
1012,
3693,
1006,
1000,
1008,
1000,
1007,
1007,
1012,
24665,
13699,
1006,
3423,
1035,
6764,
1035,
5418,
1007,
1012,
7276,
1063,
1064,
4130,
1064,
5371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/protocol/base_protocol.rb | Thrift.BaseProtocol.write_field | def write_field(*args)
if args.size == 3
# handles the documented method signature - write_field(field_info, fid, value)
field_info = args[0]
fid = args[1]
value = args[2]
elsif args.size == 4
# handles the deprecated method signature - write_field(name, type, fid, value)
field_info = {:name => args[0], :type => args[1]}
fid = args[2]
value = args[3]
else
raise ArgumentError, "wrong number of arguments (#{args.size} for 3)"
end
write_field_begin(field_info[:name], field_info[:type], fid)
write_type(field_info, value)
write_field_end
end | ruby | def write_field(*args)
if args.size == 3
# handles the documented method signature - write_field(field_info, fid, value)
field_info = args[0]
fid = args[1]
value = args[2]
elsif args.size == 4
# handles the deprecated method signature - write_field(name, type, fid, value)
field_info = {:name => args[0], :type => args[1]}
fid = args[2]
value = args[3]
else
raise ArgumentError, "wrong number of arguments (#{args.size} for 3)"
end
write_field_begin(field_info[:name], field_info[:type], fid)
write_type(field_info, value)
write_field_end
end | [
"def",
"write_field",
"(",
"*",
"args",
")",
"if",
"args",
".",
"size",
"==",
"3",
"# handles the documented method signature - write_field(field_info, fid, value)",
"field_info",
"=",
"args",
"[",
"0",
"]",
"fid",
"=",
"args",
"[",
"1",
"]",
"value",
"=",
"args... | Writes a field based on the field information, field ID and value.
field_info - A Hash containing the definition of the field:
:name - The name of the field.
:type - The type of the field, which must be a Thrift::Types constant.
:binary - A Boolean flag that indicates if Thrift::Types::STRING is a binary string (string without encoding).
fid - The ID of the field.
value - The field's value to write; object type varies based on :type.
Returns nothing. | [
"Writes",
"a",
"field",
"based",
"on",
"the",
"field",
"information",
"field",
"ID",
"and",
"value",
"."
] | 27d8387c49a49fcf193893f834e9766ae0b051c1 | https://github.com/apache/thrift/blob/27d8387c49a49fcf193893f834e9766ae0b051c1/lib/rb/lib/thrift/protocol/base_protocol.rb#L225-L243 | train | Write a field. | [
30522,
13366,
4339,
1035,
2492,
1006,
1008,
12098,
5620,
1007,
2065,
12098,
5620,
1012,
2946,
1027,
1027,
1017,
1001,
16024,
1996,
8832,
4118,
8085,
1011,
4339,
1035,
2492,
1006,
2492,
1035,
18558,
1010,
10882,
2094,
1010,
3643,
1007,
2492,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/pops/merge_strategy.rb | Puppet::Pops.MergeStrategy.merge | def merge(e1, e2)
checked_merge(
assert_type('The first element of the merge', value_t, e1),
assert_type('The second element of the merge', value_t, e2))
end | ruby | def merge(e1, e2)
checked_merge(
assert_type('The first element of the merge', value_t, e1),
assert_type('The second element of the merge', value_t, e2))
end | [
"def",
"merge",
"(",
"e1",
",",
"e2",
")",
"checked_merge",
"(",
"assert_type",
"(",
"'The first element of the merge'",
",",
"value_t",
",",
"e1",
")",
",",
"assert_type",
"(",
"'The second element of the merge'",
",",
"value_t",
",",
"e2",
")",
")",
"end"
] | Create a new instance of this strategy configured with the given _options_
@param merge_options [Hash<String,Object>] Merge options
Merges the elements of _e1_ and _e2_ according to the rules of this strategy and options given when this
instance was created
@param e1 [Object] The first element
@param e2 [Object] The second element
@return [Object] The result of the merge | [
"Create",
"a",
"new",
"instance",
"of",
"this",
"strategy",
"configured",
"with",
"the",
"given",
"_options_",
"@param",
"merge_options",
"[",
"Hash<String",
"Object",
">",
"]",
"Merge",
"options",
"Merges",
"the",
"elements",
"of",
"_e1_",
"and",
"_e2_",
"acc... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/pops/merge_strategy.rb#L91-L95 | train | Merge two arrays of elements | [
30522,
13366,
13590,
1006,
1041,
2487,
1010,
1041,
2475,
1007,
7039,
1035,
13590,
1006,
20865,
1035,
2828,
1006,
1005,
1996,
2034,
5783,
1997,
1996,
13590,
1005,
1010,
3643,
1035,
1056,
1010,
1041,
2487,
1007,
1010,
20865,
1035,
2828,
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... |
gocardless/hutch | lib/hutch/broker.rb | Hutch.Broker.set_up_api_connection | def set_up_api_connection
logger.info "connecting to rabbitmq HTTP API (#{api_config.sanitized_uri})"
with_authentication_error_handler do
with_connection_error_handler do
@api_client = CarrotTop.new(host: api_config.host, port: api_config.port,
user: api_config.username, password: api_config.password,
ssl: api_config.ssl)
@api_client.exchanges
end
end
end | ruby | def set_up_api_connection
logger.info "connecting to rabbitmq HTTP API (#{api_config.sanitized_uri})"
with_authentication_error_handler do
with_connection_error_handler do
@api_client = CarrotTop.new(host: api_config.host, port: api_config.port,
user: api_config.username, password: api_config.password,
ssl: api_config.ssl)
@api_client.exchanges
end
end
end | [
"def",
"set_up_api_connection",
"logger",
".",
"info",
"\"connecting to rabbitmq HTTP API (#{api_config.sanitized_uri})\"",
"with_authentication_error_handler",
"do",
"with_connection_error_handler",
"do",
"@api_client",
"=",
"CarrotTop",
".",
"new",
"(",
"host",
":",
"api_config... | Set up the connection to the RabbitMQ management API. Unfortunately, this
is necessary to do a few things that are impossible over AMQP. E.g.
listing queues and bindings. | [
"Set",
"up",
"the",
"connection",
"to",
"the",
"RabbitMQ",
"management",
"API",
".",
"Unfortunately",
"this",
"is",
"necessary",
"to",
"do",
"a",
"few",
"things",
"that",
"are",
"impossible",
"over",
"AMQP",
".",
"E",
".",
"g",
".",
"listing",
"queues",
... | 9314b3b8c84abeb78170730757f3eb8ccc4f54c5 | https://github.com/gocardless/hutch/blob/9314b3b8c84abeb78170730757f3eb8ccc4f54c5/lib/hutch/broker.rb#L144-L155 | train | set up the connection to rabbitmq API | [
30522,
13366,
2275,
1035,
2039,
1035,
17928,
1035,
4434,
8833,
4590,
1012,
18558,
1000,
7176,
2000,
10442,
2213,
4160,
8299,
17928,
1006,
1001,
1063,
17928,
1035,
9530,
8873,
2290,
1012,
2624,
25090,
5422,
1035,
24471,
2072,
1065,
1007,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-09-30/generated/azure_mgmt_compute/disks.rb | Azure::Compute::Mgmt::V2018_09_30.Disks.begin_revoke_access | def begin_revoke_access(resource_group_name, disk_name, custom_headers:nil)
response = begin_revoke_access_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_revoke_access(resource_group_name, disk_name, custom_headers:nil)
response = begin_revoke_access_async(resource_group_name, disk_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_revoke_access",
"(",
"resource_group_name",
",",
"disk_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_revoke_access_async",
"(",
"resource_group_name",
",",
"disk_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Revokes access to a disk.
@param resource_group_name [String] The name of the resource group.
@param disk_name [String] The name of the managed disk that is being created.
The name can't be changed after the disk is created. Supported characters for
the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Revokes",
"access",
"to",
"a",
"disk",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-09-30/generated/azure_mgmt_compute/disks.rb#L982-L985 | train | Revokes access to a disk. | [
30522,
13366,
4088,
1035,
7065,
11045,
1035,
3229,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9785,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
7065,
11045,
1035,
3229,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/overcommit | lib/overcommit/hook/pre_commit/yard_coverage.rb | Overcommit::Hook::PreCommit.YardCoverage.error_messages | def error_messages(yard_coverage, error_text)
first_message = "You have a #{yard_coverage}% yard documentation coverage. "\
"#{config['min_coverage_percentage']}% is the minimum required."
# Add the undocumented objects text as error messages
messages = [Overcommit::Hook::Message.new(:error, nil, nil, first_message)]
errors = error_text.strip.split("\n")
errors.each do |undocumented_object|
undocumented_object_message, file_info = undocumented_object.split(/:?\s+/)
file_info_match = file_info.match(/^\(([^:]+):(\d+)\)/)
# In case any compacted error does not follow the format, ignore it
if file_info_match
file = file_info_match.captures[0]
line = file_info_match.captures[1]
messages << Overcommit::Hook::Message.new(
:error, file, line, "#{file}:#{line}: #{undocumented_object_message}"
)
end
end
messages
end | ruby | def error_messages(yard_coverage, error_text)
first_message = "You have a #{yard_coverage}% yard documentation coverage. "\
"#{config['min_coverage_percentage']}% is the minimum required."
# Add the undocumented objects text as error messages
messages = [Overcommit::Hook::Message.new(:error, nil, nil, first_message)]
errors = error_text.strip.split("\n")
errors.each do |undocumented_object|
undocumented_object_message, file_info = undocumented_object.split(/:?\s+/)
file_info_match = file_info.match(/^\(([^:]+):(\d+)\)/)
# In case any compacted error does not follow the format, ignore it
if file_info_match
file = file_info_match.captures[0]
line = file_info_match.captures[1]
messages << Overcommit::Hook::Message.new(
:error, file, line, "#{file}:#{line}: #{undocumented_object_message}"
)
end
end
messages
end | [
"def",
"error_messages",
"(",
"yard_coverage",
",",
"error_text",
")",
"first_message",
"=",
"\"You have a #{yard_coverage}% yard documentation coverage. \"",
"\"#{config['min_coverage_percentage']}% is the minimum required.\"",
"# Add the undocumented objects text as error messages",
"messa... | Create the error messages | [
"Create",
"the",
"error",
"messages"
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/hook/pre_commit/yard_coverage.rb#L66-L88 | train | Returns an array of error messages | [
30522,
13366,
7561,
1035,
7696,
1006,
4220,
1035,
6325,
1010,
7561,
1035,
3793,
1007,
2034,
1035,
4471,
1027,
1000,
2017,
2031,
1037,
1001,
1063,
4220,
1035,
6325,
1065,
1003,
4220,
12653,
6325,
1012,
1000,
1032,
1000,
1001,
1063,
9530,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
boazsegev/combine_pdf | lib/combine_pdf/pdf_public.rb | CombinePDF.PDF.remove | def remove(page_index)
catalog = rebuild_catalog
pages_array = catalog[:Pages][:referenced_object][:Kids]
removed_page = pages_array.delete_at page_index
catalog[:Pages][:referenced_object][:Count] = pages_array.length
removed_page
end | ruby | def remove(page_index)
catalog = rebuild_catalog
pages_array = catalog[:Pages][:referenced_object][:Kids]
removed_page = pages_array.delete_at page_index
catalog[:Pages][:referenced_object][:Count] = pages_array.length
removed_page
end | [
"def",
"remove",
"(",
"page_index",
")",
"catalog",
"=",
"rebuild_catalog",
"pages_array",
"=",
"catalog",
"[",
":Pages",
"]",
"[",
":referenced_object",
"]",
"[",
":Kids",
"]",
"removed_page",
"=",
"pages_array",
".",
"delete_at",
"page_index",
"catalog",
"[",
... | removes a PDF page from the file and the catalog
returns the removed page.
returns nil if failed or if out of bounds.
page_index:: the page's index in the zero (0) based page array. negative numbers represent a count backwards (-1 being the end of the page array and 0 being the begining). | [
"removes",
"a",
"PDF",
"page",
"from",
"the",
"file",
"and",
"the",
"catalog"
] | 09054051019c069f551f3e60be789577c0f93900 | https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/pdf_public.rb#L346-L352 | train | Remove a page from the catalog | [
30522,
13366,
6366,
1006,
3931,
1035,
5950,
1007,
12105,
1027,
14591,
1035,
12105,
5530,
1035,
9140,
1027,
12105,
1031,
1024,
5530,
1033,
1031,
1024,
14964,
1035,
4874,
1033,
1031,
1024,
4268,
1033,
3718,
1035,
3931,
1027,
5530,
1035,
9140,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/api/actions.rb | Github.API.module_methods_in | def module_methods_in(klass)
klass.included_modules.each_with_object([]) do |mod, accumulator|
if mod.to_s =~ /#{klass}/
mod.instance_methods(false).each do |method|
accumulator << method
end
end
accumulator
end
end | ruby | def module_methods_in(klass)
klass.included_modules.each_with_object([]) do |mod, accumulator|
if mod.to_s =~ /#{klass}/
mod.instance_methods(false).each do |method|
accumulator << method
end
end
accumulator
end
end | [
"def",
"module_methods_in",
"(",
"klass",
")",
"klass",
".",
"included_modules",
".",
"each_with_object",
"(",
"[",
"]",
")",
"do",
"|",
"mod",
",",
"accumulator",
"|",
"if",
"mod",
".",
"to_s",
"=~",
"/",
"#{",
"klass",
"}",
"/",
"mod",
".",
"instance... | Finds methods included through class modules
@param [Class] klass
The klass to inspect for methods.
@api private | [
"Finds",
"methods",
"included",
"through",
"class",
"modules"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/api/actions.rb#L49-L58 | train | Returns all the methods in the given class. | [
30522,
13366,
11336,
1035,
4725,
1035,
1999,
1006,
1047,
27102,
1007,
1047,
27102,
1012,
2443,
1035,
14184,
1012,
2169,
1035,
2007,
1035,
4874,
1006,
1031,
1033,
1007,
2079,
1064,
16913,
1010,
16222,
2819,
20350,
1064,
2065,
16913,
1012,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2016-12-01/generated/azure_mgmt_network/network_interfaces.rb | Azure::Network::Mgmt::V2016_12_01.NetworkInterfaces.begin_get_effective_route_table | def begin_get_effective_route_table(resource_group_name, network_interface_name, custom_headers:nil)
response = begin_get_effective_route_table_async(resource_group_name, network_interface_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_get_effective_route_table(resource_group_name, network_interface_name, custom_headers:nil)
response = begin_get_effective_route_table_async(resource_group_name, network_interface_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_get_effective_route_table",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_get_effective_route_table_async",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"custom_headers... | Gets all route tables applied to a network interface.
@param resource_group_name [String] The name of the resource group.
@param network_interface_name [String] The name of the network interface.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EffectiveRouteListResult] operation results. | [
"Gets",
"all",
"route",
"tables",
"applied",
"to",
"a",
"network",
"interface",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2016-12-01/generated/azure_mgmt_network/network_interfaces.rb#L969-L972 | train | Gets the effective route table for the specified network interface. | [
30522,
13366,
4088,
1035,
2131,
1035,
4621,
1035,
2799,
1035,
2795,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
8278,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
2131,
1035,
4621,
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... |
petergoldstein/dalli | lib/dalli/client.rb | Dalli.Client.replace | def replace(key, value, ttl=nil, options=nil)
perform(:replace, key, value, ttl_or_default(ttl), 0, options)
end | ruby | def replace(key, value, ttl=nil, options=nil)
perform(:replace, key, value, ttl_or_default(ttl), 0, options)
end | [
"def",
"replace",
"(",
"key",
",",
"value",
",",
"ttl",
"=",
"nil",
",",
"options",
"=",
"nil",
")",
"perform",
"(",
":replace",
",",
"key",
",",
"value",
",",
"ttl_or_default",
"(",
"ttl",
")",
",",
"0",
",",
"options",
")",
"end"
] | Conditionally add a key/value pair, only if the key already exists
on the server. Returns truthy if the operation succeeded. | [
"Conditionally",
"add",
"a",
"key",
"/",
"value",
"pair",
"only",
"if",
"the",
"key",
"already",
"exists",
"on",
"the",
"server",
".",
"Returns",
"truthy",
"if",
"the",
"operation",
"succeeded",
"."
] | 5755dbfd06e333a8239f976d4b10492b4555b726 | https://github.com/petergoldstein/dalli/blob/5755dbfd06e333a8239f976d4b10492b4555b726/lib/dalli/client.rb#L143-L145 | train | Replace a value in the index. | [
30522,
13366,
5672,
1006,
3145,
1010,
3643,
1010,
23746,
2140,
1027,
9152,
2140,
1010,
7047,
1027,
9152,
2140,
1007,
4685,
1006,
1024,
5672,
1010,
3145,
1010,
3643,
1010,
23746,
2140,
1035,
2030,
1035,
12398,
1006,
23746,
2140,
1007,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/registered_servers.rb | Azure::StorageSync::Mgmt::V2018_07_01.RegisteredServers.list_by_storage_sync_service | def list_by_storage_sync_service(resource_group_name, storage_sync_service_name, custom_headers:nil)
response = list_by_storage_sync_service_async(resource_group_name, storage_sync_service_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_storage_sync_service(resource_group_name, storage_sync_service_name, custom_headers:nil)
response = list_by_storage_sync_service_async(resource_group_name, storage_sync_service_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_storage_sync_service",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_storage_sync_service_async",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"custom_headers... | Get a given registered server list.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param storage_sync_service_name [String] Name of Storage Sync Service
resource.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RegisteredServerArray] operation results. | [
"Get",
"a",
"given",
"registered",
"server",
"list",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/registered_servers.rb#L36-L39 | train | Gets the list of all the available virtual network endpoints. | [
30522,
13366,
2862,
1035,
2011,
1035,
5527,
1035,
26351,
1035,
2326,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5527,
1035,
26351,
1035,
2326,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/duration.rb | ActiveSupport.Duration.+ | def +(other)
if Duration === other
parts = @parts.dup
other.parts.each do |(key, value)|
parts[key] += value
end
Duration.new(value + other.value, parts)
else
seconds = @parts[:seconds] + other
Duration.new(value + other, @parts.merge(seconds: seconds))
end
end | ruby | def +(other)
if Duration === other
parts = @parts.dup
other.parts.each do |(key, value)|
parts[key] += value
end
Duration.new(value + other.value, parts)
else
seconds = @parts[:seconds] + other
Duration.new(value + other, @parts.merge(seconds: seconds))
end
end | [
"def",
"+",
"(",
"other",
")",
"if",
"Duration",
"===",
"other",
"parts",
"=",
"@parts",
".",
"dup",
"other",
".",
"parts",
".",
"each",
"do",
"|",
"(",
"key",
",",
"value",
")",
"|",
"parts",
"[",
"key",
"]",
"+=",
"value",
"end",
"Duration",
".... | Compares one Duration with another or a Numeric to this Duration.
Numeric values are treated as seconds.
Adds another Duration or a Numeric to this Duration. Numeric values
are treated as seconds. | [
"Compares",
"one",
"Duration",
"with",
"another",
"or",
"a",
"Numeric",
"to",
"this",
"Duration",
".",
"Numeric",
"values",
"are",
"treated",
"as",
"seconds",
".",
"Adds",
"another",
"Duration",
"or",
"a",
"Numeric",
"to",
"this",
"Duration",
".",
"Numeric",... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/duration.rb#L238-L249 | train | Add two Duration objects. | [
30522,
13366,
1009,
1006,
2060,
1007,
2065,
9367,
1027,
1027,
1027,
2060,
3033,
1027,
1030,
3033,
1012,
4241,
2361,
2060,
1012,
3033,
1012,
2169,
2079,
1064,
1006,
3145,
1010,
3643,
1007,
1064,
3033,
1031,
3145,
1033,
1009,
1027,
3643,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb | Axlsx.WorksheetHyperlinks.to_xml_string | def to_xml_string(str='')
return if empty?
str << '<hyperlinks>'
each { |hyperlink| hyperlink.to_xml_string(str) }
str << '</hyperlinks>'
end | ruby | def to_xml_string(str='')
return if empty?
str << '<hyperlinks>'
each { |hyperlink| hyperlink.to_xml_string(str) }
str << '</hyperlinks>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"return",
"if",
"empty?",
"str",
"<<",
"'<hyperlinks>'",
"each",
"{",
"|",
"hyperlink",
"|",
"hyperlink",
".",
"to_xml_string",
"(",
"str",
")",
"}",
"str",
"<<",
"'</hyperlinks>'",
"end"
] | seralize the collection of hyperlinks
@return [String] | [
"seralize",
"the",
"collection",
"of",
"hyperlinks"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb#L31-L36 | train | Convert the hyperlinks to XML string. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
2709,
2065,
4064,
1029,
2358,
2099,
1026,
1026,
1005,
1026,
23760,
13767,
2015,
1028,
1005,
2169,
1063,
1064,
23760,
13767,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/path_dependency_utils.rb | Sprockets.PathDependencyUtils.stat_sorted_tree_with_dependencies | def stat_sorted_tree_with_dependencies(dir)
deps = Set.new([build_file_digest_uri(dir)])
results = stat_sorted_tree(dir).map do |path, stat|
deps << build_file_digest_uri(path) if stat.directory?
[path, stat]
end
return results, deps
end | ruby | def stat_sorted_tree_with_dependencies(dir)
deps = Set.new([build_file_digest_uri(dir)])
results = stat_sorted_tree(dir).map do |path, stat|
deps << build_file_digest_uri(path) if stat.directory?
[path, stat]
end
return results, deps
end | [
"def",
"stat_sorted_tree_with_dependencies",
"(",
"dir",
")",
"deps",
"=",
"Set",
".",
"new",
"(",
"[",
"build_file_digest_uri",
"(",
"dir",
")",
"]",
")",
"results",
"=",
"stat_sorted_tree",
"(",
"dir",
")",
".",
"map",
"do",
"|",
"path",
",",
"stat",
"... | Internal: List directory filenames and associated Stats under an entire
directory tree.
See PathUtils#stat_sorted_tree
dir - A String directory
Returns an Array of filenames and a Set of dependency URIs. | [
"Internal",
":",
"List",
"directory",
"filenames",
"and",
"associated",
"Stats",
"under",
"an",
"entire",
"directory",
"tree",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/path_dependency_utils.rb#L68-L75 | train | Returns a sorted tree of files with dependencies | [
30522,
13366,
28093,
1035,
19616,
1035,
3392,
1035,
2007,
1035,
12530,
15266,
1006,
16101,
1007,
2139,
4523,
1027,
2275,
1012,
2047,
1006,
1031,
3857,
1035,
5371,
1035,
17886,
1035,
24471,
2072,
1006,
16101,
1007,
1033,
1007,
3463,
1027,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
castwide/solargraph | lib/solargraph/api_map.rb | Solargraph.ApiMap.get_complex_type_methods | def get_complex_type_methods type, context = '', internal = false
# This method does not qualify the complex type's namespace because
# it can cause conflicts between similar names, e.g., `Foo` vs.
# `Other::Foo`. It still takes a context argument to determine whether
# protected and private methods are visible.
return [] if type.undefined? || type.void?
result = []
if type.duck_type?
type.select(&:duck_type?).each do |t|
result.push Pin::DuckMethod.new(nil, t.tag[1..-1])
end
result.concat get_methods('Object')
else
unless type.nil? || type.name == 'void'
visibility = [:public]
if type.namespace == context || super_and_sub?(type.namespace, context)
visibility.push :protected
visibility.push :private if internal
end
result.concat get_methods(type.namespace, scope: type.scope, visibility: visibility)
end
end
result
end | ruby | def get_complex_type_methods type, context = '', internal = false
# This method does not qualify the complex type's namespace because
# it can cause conflicts between similar names, e.g., `Foo` vs.
# `Other::Foo`. It still takes a context argument to determine whether
# protected and private methods are visible.
return [] if type.undefined? || type.void?
result = []
if type.duck_type?
type.select(&:duck_type?).each do |t|
result.push Pin::DuckMethod.new(nil, t.tag[1..-1])
end
result.concat get_methods('Object')
else
unless type.nil? || type.name == 'void'
visibility = [:public]
if type.namespace == context || super_and_sub?(type.namespace, context)
visibility.push :protected
visibility.push :private if internal
end
result.concat get_methods(type.namespace, scope: type.scope, visibility: visibility)
end
end
result
end | [
"def",
"get_complex_type_methods",
"type",
",",
"context",
"=",
"''",
",",
"internal",
"=",
"false",
"# This method does not qualify the complex type's namespace because",
"# it can cause conflicts between similar names, e.g., `Foo` vs.",
"# `Other::Foo`. It still takes a context argument ... | Get an array of method pins for a complex type.
The type's namespace and the context should be fully qualified. If the
context matches the namespace type or is a subclass of the type,
protected methods are included in the results. If protected methods are
included and internal is true, private methods are also included.
@example
api_map = Solargraph::ApiMap.new
type = Solargraph::ComplexType.parse('String')
api_map.get_complex_type_methods(type)
@param type [Solargraph::ComplexType] The complex type of the namespace
@param context [String] The context from which the type is referenced
@param internal [Boolean] True to include private methods
@return [Array<Solargraph::Pin::Base>] | [
"Get",
"an",
"array",
"of",
"method",
"pins",
"for",
"a",
"complex",
"type",
"."
] | 47badb5d151aca775ccbe6c470236089eae7839d | https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/api_map.rb#L321-L344 | train | Returns the methods of a complex type. | [
30522,
13366,
2131,
1035,
3375,
1035,
2828,
1035,
4725,
2828,
1010,
6123,
1027,
1005,
1005,
1010,
4722,
1027,
6270,
1001,
30524,
3375,
2828,
1005,
1055,
3415,
15327,
2138,
1001,
2009,
2064,
3426,
9755,
2090,
2714,
3415,
1010,
1041,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/instance.rb | Aws::EC2.Instance.password_data | def password_data(options = {})
options = options.merge(instance_id: @id)
resp = @client.get_password_data(options)
resp.data
end | ruby | def password_data(options = {})
options = options.merge(instance_id: @id)
resp = @client.get_password_data(options)
resp.data
end | [
"def",
"password_data",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"instance_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"get_password_data",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
instance.password_data({
dry_run: false,
})
@param [Hash] options ({})
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@return [Types::GetPasswordDataResult] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/instance.rb#L955-L959 | train | Get the password data for this instance | [
30522,
13366,
20786,
1035,
2951,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
6013,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
2131,
1035,
20786,
1035,
2951,
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... |
zendesk/ruby-kafka | lib/kafka/offset_manager.rb | Kafka.OffsetManager.seek_to | def seek_to(topic, partition, offset)
@processed_offsets[topic] ||= {}
@processed_offsets[topic][partition] = offset
@fetcher.seek(topic, partition, offset)
end | ruby | def seek_to(topic, partition, offset)
@processed_offsets[topic] ||= {}
@processed_offsets[topic][partition] = offset
@fetcher.seek(topic, partition, offset)
end | [
"def",
"seek_to",
"(",
"topic",
",",
"partition",
",",
"offset",
")",
"@processed_offsets",
"[",
"topic",
"]",
"||=",
"{",
"}",
"@processed_offsets",
"[",
"topic",
"]",
"[",
"partition",
"]",
"=",
"offset",
"@fetcher",
".",
"seek",
"(",
"topic",
",",
"pa... | Move the consumer's position in the partition to the specified offset.
@param topic [String] the name of the topic.
@param partition [Integer] the partition number.
@param offset [Integer] the offset that the consumer position should be moved to.
@return [nil] | [
"Move",
"the",
"consumer",
"s",
"position",
"in",
"the",
"partition",
"to",
"the",
"specified",
"offset",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/offset_manager.rb#L83-L88 | train | Seeks to the specified offset in the partition. | [
30522,
13366,
6148,
1035,
2000,
1006,
8476,
1010,
13571,
1010,
16396,
1007,
1030,
13995,
1035,
16396,
2015,
1031,
8476,
1033,
1064,
1064,
1027,
1063,
1065,
1030,
13995,
1035,
16396,
2015,
1031,
8476,
1033,
1031,
13571,
1033,
1027,
16396,
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_compute/lib/2018-09-30/generated/azure_mgmt_compute/disks.rb | Azure::Compute::Mgmt::V2018_09_30.Disks.update | def update(resource_group_name, disk_name, disk, custom_headers:nil)
response = update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update(resource_group_name, disk_name, disk, custom_headers:nil)
response = update_async(resource_group_name, disk_name, disk, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update",
"(",
"resource_group_name",
",",
"disk_name",
",",
"disk",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"resource_group_name",
",",
"disk_name",
",",
"disk",
",",
"custom_headers",
":custom_headers",
")",
".",
"v... | Updates (patches) a disk.
@param resource_group_name [String] The name of the resource group.
@param disk_name [String] The name of the managed disk that is being created.
The name can't be changed after the disk is created. Supported characters for
the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters.
@param disk [DiskUpdate] Disk object supplied in the body of the Patch disk
operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Disk] operation results. | [
"Updates",
"(",
"patches",
")",
"a",
"disk",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-09-30/generated/azure_mgmt_compute/disks.rb#L88-L91 | train | Updates a disk in a specified resource group. | [
30522,
13366,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9785,
1035,
2171,
1010,
9785,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9785,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/replication_network_mappings.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2016_08_10.ReplicationNetworkMappings.list_by_replication_networks_next | def list_by_replication_networks_next(next_page_link, custom_headers:nil)
response = list_by_replication_networks_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_replication_networks_next(next_page_link, custom_headers:nil)
response = list_by_replication_networks_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_replication_networks_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_replication_networks_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"bo... | Gets all the network mappings under a network.
Lists all ASR network mappings for the specified network.
@param next_page_link [String] The NextLink from the previous successful call
to List operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [NetworkMappingCollection] operation results. | [
"Gets",
"all",
"the",
"network",
"mappings",
"under",
"a",
"network",
"."
] | 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/replication_network_mappings.rb#L887-L890 | train | Gets the list of all the network networks in a replication network. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
6125,
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,
6125,
1035,
2279,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activerecord/lib/active_record/relation/batches.rb | ActiveRecord.Batches.in_batches | def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil)
relation = self
unless block_given?
return BatchEnumerator.new(of: of, start: start, finish: finish, relation: self)
end
if arel.orders.present?
act_on_ignored_order(error_on_ignore)
end
batch_limit = of
if limit_value
remaining = limit_value
batch_limit = remaining if remaining < batch_limit
end
relation = relation.reorder(batch_order).limit(batch_limit)
relation = apply_limits(relation, start, finish)
relation.skip_query_cache! # Retaining the results in the query cache would undermine the point of batching
batch_relation = relation
loop do
if load
records = batch_relation.records
ids = records.map(&:id)
yielded_relation = where(primary_key => ids)
yielded_relation.load_records(records)
else
ids = batch_relation.pluck(primary_key)
yielded_relation = where(primary_key => ids)
end
break if ids.empty?
primary_key_offset = ids.last
raise ArgumentError.new("Primary key not included in the custom select clause") unless primary_key_offset
yield yielded_relation
break if ids.length < batch_limit
if limit_value
remaining -= ids.length
if remaining == 0
# Saves a useless iteration when the limit is a multiple of the
# batch size.
break
elsif remaining < batch_limit
relation = relation.limit(remaining)
end
end
batch_relation = relation.where(
bind_attribute(primary_key, primary_key_offset) { |attr, bind| attr.gt(bind) }
)
end
end | ruby | def in_batches(of: 1000, start: nil, finish: nil, load: false, error_on_ignore: nil)
relation = self
unless block_given?
return BatchEnumerator.new(of: of, start: start, finish: finish, relation: self)
end
if arel.orders.present?
act_on_ignored_order(error_on_ignore)
end
batch_limit = of
if limit_value
remaining = limit_value
batch_limit = remaining if remaining < batch_limit
end
relation = relation.reorder(batch_order).limit(batch_limit)
relation = apply_limits(relation, start, finish)
relation.skip_query_cache! # Retaining the results in the query cache would undermine the point of batching
batch_relation = relation
loop do
if load
records = batch_relation.records
ids = records.map(&:id)
yielded_relation = where(primary_key => ids)
yielded_relation.load_records(records)
else
ids = batch_relation.pluck(primary_key)
yielded_relation = where(primary_key => ids)
end
break if ids.empty?
primary_key_offset = ids.last
raise ArgumentError.new("Primary key not included in the custom select clause") unless primary_key_offset
yield yielded_relation
break if ids.length < batch_limit
if limit_value
remaining -= ids.length
if remaining == 0
# Saves a useless iteration when the limit is a multiple of the
# batch size.
break
elsif remaining < batch_limit
relation = relation.limit(remaining)
end
end
batch_relation = relation.where(
bind_attribute(primary_key, primary_key_offset) { |attr, bind| attr.gt(bind) }
)
end
end | [
"def",
"in_batches",
"(",
"of",
":",
"1000",
",",
"start",
":",
"nil",
",",
"finish",
":",
"nil",
",",
"load",
":",
"false",
",",
"error_on_ignore",
":",
"nil",
")",
"relation",
"=",
"self",
"unless",
"block_given?",
"return",
"BatchEnumerator",
".",
"ne... | Yields ActiveRecord::Relation objects to work with a batch of records.
Person.where("age > 21").in_batches do |relation|
relation.delete_all
sleep(10) # Throttle the delete queries
end
If you do not provide a block to #in_batches, it will return a
BatchEnumerator which is enumerable.
Person.in_batches.each_with_index do |relation, batch_index|
puts "Processing relation ##{batch_index}"
relation.delete_all
end
Examples of calling methods on the returned BatchEnumerator object:
Person.in_batches.delete_all
Person.in_batches.update_all(awesome: true)
Person.in_batches.each_record(&:party_all_night!)
==== Options
* <tt>:of</tt> - Specifies the size of the batch. Defaults to 1000.
* <tt>:load</tt> - Specifies if the relation should be loaded. Defaults to false.
* <tt>:start</tt> - Specifies the primary key value to start from, inclusive of the value.
* <tt>:finish</tt> - Specifies the primary key value to end at, inclusive of the value.
* <tt>:error_on_ignore</tt> - Overrides the application config to specify if an error should be raised when
an order is present in the relation.
Limits are honored, and if present there is no requirement for the batch
size, it can be less than, equal, or greater than the limit.
The options +start+ and +finish+ are especially useful if you want
multiple workers dealing with the same processing queue. You can make
worker 1 handle all the records between id 1 and 9999 and worker 2
handle from 10000 and beyond by setting the +:start+ and +:finish+
option on each worker.
# Let's process from record 10_000 on.
Person.in_batches(start: 10_000).update_all(awesome: true)
An example of calling where query method on the relation:
Person.in_batches.each do |relation|
relation.update_all('age = age + 1')
relation.where('age > 21').update_all(should_party: true)
relation.where('age <= 21').delete_all
end
NOTE: If you are going to iterate through each record, you should call
#each_record on the yielded BatchEnumerator:
Person.in_batches.each_record(&:party_all_night!)
NOTE: It's not possible to set the order. That is automatically set to
ascending on the primary key ("id ASC") to make the batch ordering
consistent. Therefore the primary key must be orderable, e.g. an integer
or a string.
NOTE: By its nature, batch processing is subject to race conditions if
other processes are modifying the database. | [
"Yields",
"ActiveRecord",
"::",
"Relation",
"objects",
"to",
"work",
"with",
"a",
"batch",
"of",
"records",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/relation/batches.rb#L201-L258 | train | Yields the results of the batching of the relation in batches. | [
30522,
13366,
1999,
1035,
14108,
2229,
1006,
1997,
1024,
6694,
1010,
2707,
1024,
9152,
2140,
1010,
3926,
1024,
9152,
2140,
1010,
7170,
1024,
6270,
1010,
7561,
1035,
2006,
1035,
8568,
1024,
9152,
2140,
1007,
7189,
1027,
2969,
4983,
3796,
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... |
Katello/katello | app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb | Katello.Api::Rhsm::CandlepinProxiesController.server_status | def server_status
candlepin_response = Resources::Candlepin::CandlepinPing.ping
status = { :managerCapabilities => candlepin_response['managerCapabilities'] + ["combined_reporting"],
:result => candlepin_response['result'],
:rulesSource => candlepin_response['rulesSource'],
:rulesVersion => candlepin_response['rulesVersion'],
:standalone => candlepin_response['standalone'],
:timeUTC => Time.now.getutc,
:version => Katello::VERSION }
render :json => status
end | ruby | def server_status
candlepin_response = Resources::Candlepin::CandlepinPing.ping
status = { :managerCapabilities => candlepin_response['managerCapabilities'] + ["combined_reporting"],
:result => candlepin_response['result'],
:rulesSource => candlepin_response['rulesSource'],
:rulesVersion => candlepin_response['rulesVersion'],
:standalone => candlepin_response['standalone'],
:timeUTC => Time.now.getutc,
:version => Katello::VERSION }
render :json => status
end | [
"def",
"server_status",
"candlepin_response",
"=",
"Resources",
"::",
"Candlepin",
"::",
"CandlepinPing",
".",
"ping",
"status",
"=",
"{",
":managerCapabilities",
"=>",
"candlepin_response",
"[",
"'managerCapabilities'",
"]",
"+",
"[",
"\"combined_reporting\"",
"]",
"... | api :GET, "/status", N_("Shows version information")
description N_("This service is available for unauthenticated users") | [
"api",
":",
"GET",
"/",
"status",
"N_",
"(",
"Shows",
"version",
"information",
")",
"description",
"N_",
"(",
"This",
"service",
"is",
"available",
"for",
"unauthenticated",
"users",
")"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb#L242-L253 | train | Returns the server status | [
30522,
13366,
8241,
1035,
3570,
13541,
8091,
1035,
3433,
1027,
4219,
1024,
1024,
13541,
8091,
1024,
1024,
13541,
8091,
4691,
1012,
17852,
3570,
1027,
1063,
1024,
3208,
17695,
28518,
15909,
3111,
1027,
1028,
13541,
8091,
1035,
3433,
1031,
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 | runtime/ms_rest_azure/lib/ms_rest_azure/azure_service_client.rb | MsRestAzure.AzureServiceClient.get_async_with_async_operation_deserialization | def get_async_with_async_operation_deserialization(request)
result = get_async_common(request)
result.body = AsyncOperationStatus.deserialize_object(result.body)
result
end | ruby | def get_async_with_async_operation_deserialization(request)
result = get_async_common(request)
result.body = AsyncOperationStatus.deserialize_object(result.body)
result
end | [
"def",
"get_async_with_async_operation_deserialization",
"(",
"request",
")",
"result",
"=",
"get_async_common",
"(",
"request",
")",
"result",
".",
"body",
"=",
"AsyncOperationStatus",
".",
"deserialize_object",
"(",
"result",
".",
"body",
")",
"result",
"end"
] | Retrieves data by given URL.
@param request [MsRest::HttpOperationRequest] the URL.
@return [MsRest::HttpOperationResponse] the response. | [
"Retrieves",
"data",
"by",
"given",
"URL",
".",
"@param",
"request",
"[",
"MsRest",
"::",
"HttpOperationRequest",
"]",
"the",
"URL",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/runtime/ms_rest_azure/lib/ms_rest_azure/azure_service_client.rb#L245-L251 | train | Get the async with async operation deserialization | [
30522,
13366,
2131,
1035,
2004,
6038,
2278,
1035,
2007,
1035,
2004,
6038,
2278,
1035,
3169,
1035,
4078,
11610,
22731,
1006,
5227,
1007,
2765,
1027,
2131,
1035,
2004,
6038,
2278,
1035,
2691,
1006,
5227,
1007,
2765,
1012,
2303,
1027,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/kpi.rb | Azure::CustomerInsights::Mgmt::V2017_01_01.Kpi.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, hub_name, kpi_name, custom_headers:nil)
begin_delete_async(resource_group_name, hub_name, kpi_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, hub_name, kpi_name, custom_headers:nil)
begin_delete_async(resource_group_name, hub_name, kpi_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"hub_name",
",",
"kpi_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"hub_name",
",",
"kpi_name",
",",
"custom_headers",
":custom_headers",
")",... | Deletes a KPI in the hub.
@param resource_group_name [String] The name of the resource group.
@param hub_name [String] The name of the hub.
@param kpi_name [String] The name of the KPI.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"a",
"KPI",
"in",
"the",
"hub",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/kpi.rb#L527-L529 | train | Deletes a KPI. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9594,
1035,
2171,
1010,
1047,
8197,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
3972,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.