repo stringclasses 235 values | path stringlengths 11 168 | func_name stringlengths 12 143 | original_string stringlengths 83 6.91k | language stringclasses 1 value | code stringlengths 83 6.91k | code_tokens sequencelengths 15 1.01k | docstring stringlengths 5 25.7k | docstring_tokens sequencelengths 1 427 | sha stringclasses 235 values | url stringlengths 99 268 | partition stringclasses 1 value | summary stringlengths 7 202 | input_ids sequencelengths 502 502 | token_type_ids sequencelengths 502 502 | attention_mask sequencelengths 502 502 | labels sequencelengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/registries.rb | Azure::ContainerRegistry::Mgmt::V2017_06_01_preview.Registries.regenerate_credential_with_http_info | def regenerate_credential_with_http_info(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:nil)
regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:custom_headers).value!
end | ruby | def regenerate_credential_with_http_info(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:nil)
regenerate_credential_async(resource_group_name, registry_name, regenerate_credential_parameters, custom_headers:custom_headers).value!
end | [
"def",
"regenerate_credential_with_http_info",
"(",
"resource_group_name",
",",
"registry_name",
",",
"regenerate_credential_parameters",
",",
"custom_headers",
":",
"nil",
")",
"regenerate_credential_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"regenerate_cr... | Regenerates one of the login credentials for the specified container
registry.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param regenerate_credential_parameters [RegenerateCredentialParameters]
Specifies name of the password which should be regenerated -- password or
password2.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Regenerates",
"one",
"of",
"the",
"login",
"credentials",
"for",
"the",
"specified",
"container",
"registry",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/registries.rb#L668-L670 | train | Regenerate credential for a container registry. | [
30522,
13366,
19723,
24454,
3686,
1035,
13675,
14728,
19909,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
19723,
24454,
3686,
1035,
13675,
14728,
19909,
1035,
11709,
1010,
7661,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.list_by_sync_group_with_http_info | def list_by_sync_group_with_http_info(resource_group_name, storage_sync_service_name, sync_group_name, custom_headers:nil)
list_by_sync_group_async(resource_group_name, storage_sync_service_name, sync_group_name, custom_headers:custom_headers).value!
end | ruby | def list_by_sync_group_with_http_info(resource_group_name, storage_sync_service_name, sync_group_name, custom_headers:nil)
list_by_sync_group_async(resource_group_name, storage_sync_service_name, sync_group_name, custom_headers:custom_headers).value!
end | [
"def",
"list_by_sync_group_with_http_info",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"sync_group_name",
",",
"custom_headers",
":",
"nil",
")",
"list_by_sync_group_async",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"sync_group_n... | Get a ServerEndpoint 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 sync_group_name [String] Name of Sync Group resource.
@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",
"a",
"ServerEndpoint",
"list",
"."
] | 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#L320-L322 | train | Gets the list of all the documents in a sync group. | [
30522,
13366,
2862,
1035,
2011,
1035,
26351,
1035,
2177,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5527,
1035,
26351,
1035,
2326,
1035,
2171,
1010,
26351,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_chaos_events | def get_chaos_events(continuation_token:nil, start_time_utc:nil, end_time_utc:nil, max_results:0, timeout:60, custom_headers:nil)
response = get_chaos_events_async(continuation_token:continuation_token, start_time_utc:start_time_utc, end_time_utc:end_time_utc, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_chaos_events(continuation_token:nil, start_time_utc:nil, end_time_utc:nil, max_results:0, timeout:60, custom_headers:nil)
response = get_chaos_events_async(continuation_token:continuation_token, start_time_utc:start_time_utc, end_time_utc:end_time_utc, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_chaos_events",
"(",
"continuation_token",
":",
"nil",
",",
"start_time_utc",
":",
"nil",
",",
"end_time_utc",
":",
"nil",
",",
"max_results",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_chaos... | Gets the next segment of the Chaos events based on the continuation token or
the time range.
To get the next segment of the Chaos events, you can specify the
ContinuationToken. To get the start of a new segment of Chaos events, you can
specify the time range
through StartTimeUtc and EndTimeUtc. You cannot specify both the
ContinuationToken and the time range in the same call.
When there are more than 100 Chaos events, the Chaos events are returned in
multiple segments where a segment contains no more than 100 Chaos events and
to get the next segment you make a call to this API with the continuation
token.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param start_time_utc [String] The Windows file time representing the start
time of the time range for which a Chaos report is to be generated. Please
consult [DateTime.ToFileTimeUtc
Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx)
for details.
@param end_time_utc [String] The Windows file time representing the end time
of the time range for which a Chaos report is to be generated. Please consult
[DateTime.ToFileTimeUtc
Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx)
for details.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ChaosEventsSegment] operation results. | [
"Gets",
"the",
"next",
"segment",
"of",
"the",
"Chaos",
"events",
"based",
"on",
"the",
"continuation",
"token",
"or",
"the",
"time",
"range",
"."
] | 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#L18792-L18795 | train | Gets the chaos events for a given Continuation Token. | [
30522,
13366,
2131,
1035,
8488,
1035,
2824,
1006,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
2707,
1035,
2051,
1035,
11396,
1024,
9152,
2140,
1010,
2203,
1035,
2051,
1035,
11396,
1024,
9152,
2140,
1010,
4098,
1035,
3463,
1024,
1014,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_key_with_http_info | def get_key_with_http_info(vault_base_url, key_name, key_version, custom_headers:nil)
get_key_async(vault_base_url, key_name, key_version, custom_headers:custom_headers).value!
end | ruby | def get_key_with_http_info(vault_base_url, key_name, key_version, custom_headers:nil)
get_key_async(vault_base_url, key_name, key_version, custom_headers:custom_headers).value!
end | [
"def",
"get_key_with_http_info",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"custom_headers",
":",
"nil",
")",
"get_key_async",
"(",
"vault_base_url",
",",
"key_name",
",",
"key_version",
",",
"custom_headers",
":custom_headers",
")",
".",
"val... | Gets the public part of a stored key.
The get key operation is applicable to all key types. If the requested key is
symmetric, then no key material is released in the response. This operation
requires the keys/get permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param key_name [String] The name of the key to get.
@param key_version [String] Adding the version parameter retrieves a specific
version of a key.
@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",
"public",
"part",
"of",
"a",
"stored",
"key",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L718-L720 | train | Gets the key associated with the specified key version. | [
30522,
13366,
2131,
1035,
3145,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
3145,
1035,
2544,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
3145,
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... |
seejohnrun/ice_cube | lib/ice_cube/schedule.rb | IceCube.Schedule.conflicts_with? | def conflicts_with?(other_schedule, closing_time = nil)
closing_time = TimeUtil.ensure_time(closing_time)
unless terminating? || other_schedule.terminating? || closing_time
raise ArgumentError, "One or both schedules must be terminating to use #conflicts_with?"
end
# Pick the terminating schedule, and other schedule
# No need to reverse if terminating? or there is a closing time
terminating_schedule = self
unless terminating? || closing_time
terminating_schedule, other_schedule = other_schedule, terminating_schedule
end
# Go through each occurrence of the terminating schedule and determine
# if the other occurs at that time
#
last_time = nil
terminating_schedule.each_occurrence do |time|
if closing_time && time > closing_time
last_time = closing_time
break
end
last_time = time
return true if other_schedule.occurring_at?(time)
end
# Due to durations, we need to walk up to the end time, and verify in the
# other direction
if last_time
last_time += terminating_schedule.duration
other_schedule.each_occurrence do |time|
break if time > last_time
return true if terminating_schedule.occurring_at?(time)
end
end
# No conflict, return false
false
end | ruby | def conflicts_with?(other_schedule, closing_time = nil)
closing_time = TimeUtil.ensure_time(closing_time)
unless terminating? || other_schedule.terminating? || closing_time
raise ArgumentError, "One or both schedules must be terminating to use #conflicts_with?"
end
# Pick the terminating schedule, and other schedule
# No need to reverse if terminating? or there is a closing time
terminating_schedule = self
unless terminating? || closing_time
terminating_schedule, other_schedule = other_schedule, terminating_schedule
end
# Go through each occurrence of the terminating schedule and determine
# if the other occurs at that time
#
last_time = nil
terminating_schedule.each_occurrence do |time|
if closing_time && time > closing_time
last_time = closing_time
break
end
last_time = time
return true if other_schedule.occurring_at?(time)
end
# Due to durations, we need to walk up to the end time, and verify in the
# other direction
if last_time
last_time += terminating_schedule.duration
other_schedule.each_occurrence do |time|
break if time > last_time
return true if terminating_schedule.occurring_at?(time)
end
end
# No conflict, return false
false
end | [
"def",
"conflicts_with?",
"(",
"other_schedule",
",",
"closing_time",
"=",
"nil",
")",
"closing_time",
"=",
"TimeUtil",
".",
"ensure_time",
"(",
"closing_time",
")",
"unless",
"terminating?",
"||",
"other_schedule",
".",
"terminating?",
"||",
"closing_time",
"raise"... | Determine if this schedule conflicts with another schedule
@param [IceCube::Schedule] other_schedule - The schedule to compare to
@param [Time] closing_time - the last time to consider
@return [Boolean] whether or not the schedules conflict at all | [
"Determine",
"if",
"this",
"schedule",
"conflicts",
"with",
"another",
"schedule"
] | fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd | https://github.com/seejohnrun/ice_cube/blob/fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd/lib/ice_cube/schedule.rb#L257-L291 | train | Returns true if this schedule conflicts with another schedule | [
30522,
13366,
9755,
1035,
2007,
1029,
1006,
2060,
1035,
6134,
1010,
5494,
1035,
2051,
1027,
9152,
2140,
1007,
5494,
1035,
2051,
1027,
2051,
21823,
2140,
1012,
5676,
1035,
2051,
1006,
5494,
1035,
2051,
1007,
4983,
23552,
1029,
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... |
cloudfoundry/bosh | src/bosh-director/lib/bosh/director/job_runner.rb | Bosh::Director.JobRunner.log_exception | def log_exception(exception)
# Event log is being used here to propagate the error.
# It's up to event log renderer to find the error and
# signal it properly.
director_error = DirectorError.create_from_exception(exception)
Config.event_log.log_error(director_error)
end | ruby | def log_exception(exception)
# Event log is being used here to propagate the error.
# It's up to event log renderer to find the error and
# signal it properly.
director_error = DirectorError.create_from_exception(exception)
Config.event_log.log_error(director_error)
end | [
"def",
"log_exception",
"(",
"exception",
")",
"# Event log is being used here to propagate the error.",
"# It's up to event log renderer to find the error and",
"# signal it properly.",
"director_error",
"=",
"DirectorError",
".",
"create_from_exception",
"(",
"exception",
")",
"Con... | Logs the exception in the event log
@param [Exception] exception | [
"Logs",
"the",
"exception",
"in",
"the",
"event",
"log"
] | 2eaa7100879ddd20cd909cd698514746195e28b7 | https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/job_runner.rb#L159-L165 | train | Log the exception. | [
30522,
13366,
8833,
1035,
6453,
1006,
6453,
1007,
1001,
2724,
8833,
2003,
2108,
2109,
2182,
2000,
17678,
16098,
2618,
1996,
7561,
1012,
1001,
2009,
1005,
1055,
2039,
2000,
2724,
8833,
17552,
2121,
2000,
2424,
1996,
7561,
1998,
1001,
4742,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/core_ext/range/include_time_with_zone.rb | ActiveSupport.IncludeTimeWithZone.include? | def include?(value)
if first.is_a?(TimeWithZone)
cover?(value)
elsif last.is_a?(TimeWithZone)
cover?(value)
else
super
end
end | ruby | def include?(value)
if first.is_a?(TimeWithZone)
cover?(value)
elsif last.is_a?(TimeWithZone)
cover?(value)
else
super
end
end | [
"def",
"include?",
"(",
"value",
")",
"if",
"first",
".",
"is_a?",
"(",
"TimeWithZone",
")",
"cover?",
"(",
"value",
")",
"elsif",
"last",
".",
"is_a?",
"(",
"TimeWithZone",
")",
"cover?",
"(",
"value",
")",
"else",
"super",
"end",
"end"
] | :nodoc:
Extends the default Range#include? to support ActiveSupport::TimeWithZone.
(1.hour.ago..1.hour.from_now).include?(Time.current) # => true | [
":",
"nodoc",
":",
"Extends",
"the",
"default",
"Range#include?",
"to",
"support",
"ActiveSupport",
"::",
"TimeWithZone",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/core_ext/range/include_time_with_zone.rb#L11-L19 | train | Returns true if the time range contains the value. | [
30522,
13366,
2421,
1029,
1006,
3643,
1007,
2065,
2034,
1012,
2003,
1035,
1037,
1029,
1006,
2051,
24415,
15975,
1007,
3104,
1029,
1006,
3643,
1007,
3449,
5332,
2546,
2197,
1012,
2003,
1035,
1037,
1029,
1006,
2051,
24415,
15975,
1007,
3104,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/express_route_circuits.rb | Azure::Network::Mgmt::V2019_02_01.ExpressRouteCircuits.get_peering_stats | def get_peering_stats(resource_group_name, circuit_name, peering_name, custom_headers:nil)
response = get_peering_stats_async(resource_group_name, circuit_name, peering_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_peering_stats(resource_group_name, circuit_name, peering_name, custom_headers:nil)
response = get_peering_stats_async(resource_group_name, circuit_name, peering_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_peering_stats",
"(",
"resource_group_name",
",",
"circuit_name",
",",
"peering_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_peering_stats_async",
"(",
"resource_group_name",
",",
"circuit_name",
",",
"peering_name",
",",
"custom_heade... | Gets all stats from an express route circuit in a resource group.
@param resource_group_name [String] The name of the resource group.
@param circuit_name [String] The name of the express route circuit.
@param peering_name [String] The name of the peering.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ExpressRouteCircuitStats] operation results. | [
"Gets",
"all",
"stats",
"from",
"an",
"express",
"route",
"circuit",
"in",
"a",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/express_route_circuits.rb#L490-L493 | train | Gets the stats for the specified express route circuit. | [
30522,
13366,
2131,
1035,
16740,
1035,
26319,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4984,
1035,
2171,
1010,
16740,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
16740,
1035,
26319,
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... |
mhenrixon/sidekiq-unique-jobs | lib/sidekiq_unique_jobs/scripts.rb | SidekiqUniqueJobs.Scripts.handle_error | def handle_error(ex, file_name)
if ex.message == "NOSCRIPT No matching script. Please use EVAL."
SCRIPT_SHAS.delete(file_name)
return yield if block_given?
end
raise ScriptError, file_name: file_name, source_exception: ex
end | ruby | def handle_error(ex, file_name)
if ex.message == "NOSCRIPT No matching script. Please use EVAL."
SCRIPT_SHAS.delete(file_name)
return yield if block_given?
end
raise ScriptError, file_name: file_name, source_exception: ex
end | [
"def",
"handle_error",
"(",
"ex",
",",
"file_name",
")",
"if",
"ex",
".",
"message",
"==",
"\"NOSCRIPT No matching script. Please use EVAL.\"",
"SCRIPT_SHAS",
".",
"delete",
"(",
"file_name",
")",
"return",
"yield",
"if",
"block_given?",
"end",
"raise",
"ScriptError... | Handle errors to allow retrying errors that need retrying
@param [Redis::CommandError] ex exception to handle
@param [Symbol] file_name the name of the lua script
@return [void]
@yieldreturn [void] yields back to the caller when NOSCRIPT is raised | [
"Handle",
"errors",
"to",
"allow",
"retrying",
"errors",
"that",
"need",
"retrying"
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/scripts.rb#L87-L94 | train | Handle error | [
30522,
13366,
5047,
1035,
7561,
1006,
4654,
1010,
5371,
1035,
2171,
1007,
2065,
4654,
1012,
4471,
1027,
1027,
1000,
16839,
23235,
2053,
9844,
5896,
1012,
3531,
2224,
9345,
2140,
1012,
1000,
5896,
1035,
21146,
2015,
1012,
3972,
12870,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_regex_entity_role_with_http_info | def delete_regex_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
delete_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end | ruby | def delete_regex_entity_role_with_http_info(app_id, version_id, entity_id, role_id, custom_headers:nil)
delete_regex_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
end | [
"def",
"delete_regex_entity_role_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"delete_regex_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"... | Delete a role for a given regular expression in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity ID.
@param role_id The entity role Id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Delete",
"a",
"role",
"for",
"a",
"given",
"regular",
"expression",
"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#L9949-L9951 | train | Deletes a regex entity role. | [
30522,
13366,
3972,
12870,
1035,
19723,
10288,
1035,
9178,
1035,
2535,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
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... |
puppetlabs/puppet | lib/puppet/util/logging.rb | Puppet::Util.Logging.log_deprecations_to_file | def log_deprecations_to_file(deprecations_file, pattern = nil)
# this method may get called lots and lots of times (e.g., from spec_helper config.after) without the global
# list of deprecation warnings being cleared out. We don't want to keep logging the same offenders over and over,
# so, we need to keep track of what we've logged.
#
# It'd be nice if we could just clear out the list of deprecation warnings, but then the very next spec might
# find the same offender, and we'd end up logging it again.
$logged_deprecation_warnings ||= {}
# Deprecation messages are UTF-8 as they are produced by Ruby
Puppet::FileSystem.open(deprecations_file, nil, "a:UTF-8") do |f|
if ($deprecation_warnings) then
$deprecation_warnings.each do |offender, message|
if (! $logged_deprecation_warnings.has_key?(offender)) then
$logged_deprecation_warnings[offender] = true
if ((pattern.nil?) || (message =~ pattern)) then
f.puts(message)
f.puts(offender)
f.puts()
end
end
end
end
end
end | ruby | def log_deprecations_to_file(deprecations_file, pattern = nil)
# this method may get called lots and lots of times (e.g., from spec_helper config.after) without the global
# list of deprecation warnings being cleared out. We don't want to keep logging the same offenders over and over,
# so, we need to keep track of what we've logged.
#
# It'd be nice if we could just clear out the list of deprecation warnings, but then the very next spec might
# find the same offender, and we'd end up logging it again.
$logged_deprecation_warnings ||= {}
# Deprecation messages are UTF-8 as they are produced by Ruby
Puppet::FileSystem.open(deprecations_file, nil, "a:UTF-8") do |f|
if ($deprecation_warnings) then
$deprecation_warnings.each do |offender, message|
if (! $logged_deprecation_warnings.has_key?(offender)) then
$logged_deprecation_warnings[offender] = true
if ((pattern.nil?) || (message =~ pattern)) then
f.puts(message)
f.puts(offender)
f.puts()
end
end
end
end
end
end | [
"def",
"log_deprecations_to_file",
"(",
"deprecations_file",
",",
"pattern",
"=",
"nil",
")",
"# this method may get called lots and lots of times (e.g., from spec_helper config.after) without the global",
"# list of deprecation warnings being cleared out. We don't want to keep logging the same... | TODO: determine whether there might be a potential use for adding a puppet configuration option that would
enable this deprecation logging.
utility method that can be called, e.g., from spec_helper config.after, when tracking down calls to deprecated
code.
Parameters:
[deprecations_file] relative or absolute path of a file to log the deprecations to
[pattern] (default nil) if specified, will only log deprecations whose message matches the provided pattern | [
"TODO",
":",
"determine",
"whether",
"there",
"might",
"be",
"a",
"potential",
"use",
"for",
"adding",
"a",
"puppet",
"configuration",
"option",
"that",
"would",
"enable",
"this",
"deprecation",
"logging",
".",
"utility",
"method",
"that",
"can",
"be",
"called... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/logging.rb#L216-L240 | train | Logs deprecation warnings to a file | [
30522,
13366,
8833,
1035,
2139,
28139,
10719,
2015,
1035,
2000,
1035,
5371,
1006,
2139,
28139,
10719,
2015,
1035,
5371,
1010,
5418,
1027,
9152,
2140,
1007,
1001,
2023,
4118,
2089,
2131,
2170,
7167,
1998,
7167,
1997,
2335,
1006,
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... |
roo-rb/roo | lib/roo/open_office.rb | Roo.OpenOffice.formulas | def formulas(sheet = nil)
sheet ||= default_sheet
read_cells(sheet)
return [] unless @formula[sheet]
@formula[sheet].each.collect do |elem|
[elem[0][0], elem[0][1], elem[1]]
end
end | ruby | def formulas(sheet = nil)
sheet ||= default_sheet
read_cells(sheet)
return [] unless @formula[sheet]
@formula[sheet].each.collect do |elem|
[elem[0][0], elem[0][1], elem[1]]
end
end | [
"def",
"formulas",
"(",
"sheet",
"=",
"nil",
")",
"sheet",
"||=",
"default_sheet",
"read_cells",
"(",
"sheet",
")",
"return",
"[",
"]",
"unless",
"@formula",
"[",
"sheet",
"]",
"@formula",
"[",
"sheet",
"]",
".",
"each",
".",
"collect",
"do",
"|",
"ele... | returns each formula in the selected sheet as an array of elements
[row, col, formula] | [
"returns",
"each",
"formula",
"in",
"the",
"selected",
"sheet",
"as",
"an",
"array",
"of",
"elements",
"[",
"row",
"col",
"formula",
"]"
] | 4ec1104f0c3c2a29711c0c907371cd2be12bcc3c | https://github.com/roo-rb/roo/blob/4ec1104f0c3c2a29711c0c907371cd2be12bcc3c/lib/roo/open_office.rb#L124-L131 | train | Returns an array of the formula objects in the given sheet. | [
30522,
13366,
25814,
1006,
7123,
1027,
9152,
2140,
1007,
7123,
1064,
1064,
1027,
12398,
1035,
7123,
3191,
1035,
4442,
1006,
7123,
1007,
2709,
1031,
1033,
4983,
1030,
5675,
1031,
7123,
1033,
1030,
5675,
1031,
7123,
1033,
1012,
2169,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_storage_accounts_as_lazy | def get_storage_accounts_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_storage_accounts_as_lazy_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def get_storage_accounts_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_storage_accounts_as_lazy_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"get_storage_accounts_as_lazy",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"get_storage_accounts_as_lazy_as_lazy",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_head... | List storage accounts managed by the specified key vault. This operation
requires the storage/list permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param maxresults [Integer] Maximum number of results to return in a page. If
not specified the service will return up to 25 results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [StorageListResult] operation results. | [
"List",
"storage",
"accounts",
"managed",
"by",
"the",
"specified",
"key",
"vault",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"list",
"permission",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L10553-L10556 | train | Gets all the Azure Storage accounts in a specified vault. | [
30522,
13366,
2131,
1035,
5527,
1035,
6115,
1035,
2004,
1035,
13971,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
30524,
2015,
1024... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Features.list_application_version_pattern_features_with_http_info | def list_application_version_pattern_features_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_application_version_pattern_features_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | ruby | def list_application_version_pattern_features_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_application_version_pattern_features_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | [
"def",
"list_application_version_pattern_features_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"0",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"list_application_version_pattern_features_async",
"(",
"app_id",
",",
"version_i... | [DEPRECATED NOTICE: This operation will soon be removed] Gets all the pattern
features.
@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. | [
"[",
"DEPRECATED",
"NOTICE",
":",
"This",
"operation",
"will",
"soon",
"be",
"removed",
"]",
"Gets",
"all",
"the",
"pattern",
"features",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb#L57-L59 | train | Gets the list of pattern features for the application version. | [
30522,
13366,
2862,
1035,
4646,
1035,
2544,
1035,
5418,
1035,
2838,
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,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_web_worker_usages_with_http_info | def list_web_worker_usages_with_http_info(resource_group_name, name, worker_pool_name, custom_headers:nil)
list_web_worker_usages_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
end | ruby | def list_web_worker_usages_with_http_info(resource_group_name, name, worker_pool_name, custom_headers:nil)
list_web_worker_usages_async(resource_group_name, name, worker_pool_name, custom_headers:custom_headers).value!
end | [
"def",
"list_web_worker_usages_with_http_info",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"custom_headers",
":",
"nil",
")",
"list_web_worker_usages_async",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"custom_headers",... | Get usage metrics for a worker pool of an App Service Environment.
Get usage metrics for a worker pool of an App Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param worker_pool_name [String] Name of the worker pool.
@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",
"usage",
"metrics",
"for",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L4064-L4066 | train | Gets the list of worker usages for a worker pool. | [
30522,
13366,
2862,
1035,
4773,
1035,
7309,
1035,
8192,
2015,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7309,
1035,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
gocardless/hutch | lib/hutch/broker.rb | Hutch.Broker.bindings | def bindings
results = Hash.new { |hash, key| hash[key] = [] }
api_client.bindings.each do |binding|
next if binding['destination'] == binding['routing_key']
next unless binding['source'] == @config[:mq_exchange]
next unless binding['vhost'] == @config[:mq_vhost]
results[binding['destination']] << binding['routing_key']
end
results
end | ruby | def bindings
results = Hash.new { |hash, key| hash[key] = [] }
api_client.bindings.each do |binding|
next if binding['destination'] == binding['routing_key']
next unless binding['source'] == @config[:mq_exchange]
next unless binding['vhost'] == @config[:mq_vhost]
results[binding['destination']] << binding['routing_key']
end
results
end | [
"def",
"bindings",
"results",
"=",
"Hash",
".",
"new",
"{",
"|",
"hash",
",",
"key",
"|",
"hash",
"[",
"key",
"]",
"=",
"[",
"]",
"}",
"api_client",
".",
"bindings",
".",
"each",
"do",
"|",
"binding",
"|",
"next",
"if",
"binding",
"[",
"'destinatio... | Return a mapping of queue names to the routing keys they're bound to. | [
"Return",
"a",
"mapping",
"of",
"queue",
"names",
"to",
"the",
"routing",
"keys",
"they",
"re",
"bound",
"to",
"."
] | 9314b3b8c84abeb78170730757f3eb8ccc4f54c5 | https://github.com/gocardless/hutch/blob/9314b3b8c84abeb78170730757f3eb8ccc4f54c5/lib/hutch/broker.rb#L182-L191 | train | Returns a hash of all the bindings that are available for the current connection | [
30522,
13366,
8031,
2015,
3463,
1027,
23325,
1012,
2047,
1063,
1064,
23325,
1010,
3145,
1064,
23325,
1031,
3145,
1033,
1027,
1031,
1033,
1065,
17928,
1035,
7396,
1012,
8031,
2015,
1012,
2169,
2079,
1064,
8031,
1064,
2279,
2065,
8031,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/sprockets | lib/sprockets/path_utils.rb | Sprockets.PathUtils.path_parents | def path_parents(path, root = nil)
root = "#{root}#{File::SEPARATOR}" if root
parents = []
loop do
parent = File.dirname(path)
break if parent == path
break if root && !path.start_with?(root)
parents << path = parent
end
parents
end | ruby | def path_parents(path, root = nil)
root = "#{root}#{File::SEPARATOR}" if root
parents = []
loop do
parent = File.dirname(path)
break if parent == path
break if root && !path.start_with?(root)
parents << path = parent
end
parents
end | [
"def",
"path_parents",
"(",
"path",
",",
"root",
"=",
"nil",
")",
"root",
"=",
"\"#{root}#{File::SEPARATOR}\"",
"if",
"root",
"parents",
"=",
"[",
"]",
"loop",
"do",
"parent",
"=",
"File",
".",
"dirname",
"(",
"path",
")",
"break",
"if",
"parent",
"==",
... | Internal: Returns all parents for path
path - String absolute filename or directory
root - String path to stop at (default: system root)
Returns an Array of String paths. | [
"Internal",
":",
"Returns",
"all",
"parents",
"for",
"path"
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/path_utils.rb#L252-L264 | train | Get the parents of a given path. | [
30522,
13366,
4130,
1035,
3008,
1006,
4130,
1010,
7117,
1027,
9152,
2140,
1007,
7117,
1027,
1000,
1001,
1063,
7117,
1065,
1001,
1063,
5371,
1024,
1024,
19802,
25879,
2953,
1065,
1000,
2065,
7117,
3008,
1027,
1031,
1033,
7077,
2079,
6687,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_consumption/lib/2018-06-30/generated/azure_mgmt_consumption/usage_details.rb | Azure::Consumption::Mgmt::V2018_06_30.UsageDetails.list_by_enrollment_account | def list_by_enrollment_account(enrollment_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil)
first_page = list_by_enrollment_account_as_lazy(enrollment_account_id, expand:expand, filter:filter, skiptoken:skiptoken, top:top, query_options:query_options, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_enrollment_account(enrollment_account_id, expand:nil, filter:nil, skiptoken:nil, top:nil, query_options:nil, custom_headers:nil)
first_page = list_by_enrollment_account_as_lazy(enrollment_account_id, expand:expand, filter:filter, skiptoken:skiptoken, top:top, query_options:query_options, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_enrollment_account",
"(",
"enrollment_account_id",
",",
"expand",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"skiptoken",
":",
"nil",
",",
"top",
":",
"nil",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_pa... | Lists the usage details by enrollmentAccountId for a scope by current billing
period. Usage details are available via this API only for May 1, 2014 or
later.
@param enrollment_account_id [String] EnrollmentAccount ID
@param expand [String] May be used to expand the
properties/additionalProperties or properties/meterDetails within a list of
usage details. By default, these fields are not included when listing usage
details.
@param filter [String] May be used to filter usageDetails by
properties/usageEnd (Utc time), properties/usageStart (Utc time),
properties/resourceGroup, properties/instanceName, properties/instanceId or
tags. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does
not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair
string where key and value is separated by a colon (:).
@param skiptoken [String] Skiptoken is only used if a previous operation
returned a partial result. If a previous response contains a nextLink
element, the value of the nextLink element will include a skiptoken parameter
that specifies a starting point to use for subsequent calls.
@param top [Integer] May be used to limit the number of results to the most
recent N usageDetails.
@param query_options [QueryOptions] Additional parameters for the operation
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<UsageDetail>] operation results. | [
"Lists",
"the",
"usage",
"details",
"by",
"enrollmentAccountId",
"for",
"a",
"scope",
"by",
"current",
"billing",
"period",
".",
"Usage",
"details",
"are",
"available",
"via",
"this",
"API",
"only",
"for",
"May",
"1",
"2014",
"or",
"later",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_consumption/lib/2018-06-30/generated/azure_mgmt_consumption/usage_details.rb#L950-L953 | train | Gets all the items in a given enrollment account. | [
30522,
13366,
2862,
1035,
2011,
1035,
10316,
1035,
4070,
1006,
10316,
1035,
4070,
1035,
8909,
1010,
7818,
1024,
9152,
2140,
1010,
11307,
1024,
9152,
2140,
1010,
13558,
18715,
2368,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
23032... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
TrestleAdmin/trestle | app/helpers/trestle/pagination_helper.rb | Trestle.PaginationHelper.page_entries_info | def page_entries_info(collection, options = {})
entry_name = options[:entry_name] || "entry"
entry_name = entry_name.pluralize unless collection.total_count == 1
if collection.total_pages < 2
t('trestle.helpers.page_entries_info.one_page.display_entries', entry_name: entry_name, count: collection.total_count, default: "Displaying <strong>all %{count}</strong> %{entry_name}")
else
first = number_with_delimiter(collection.offset_value + 1)
last = number_with_delimiter((sum = collection.offset_value + collection.limit_value) > collection.total_count ? collection.total_count : sum)
total = number_with_delimiter(collection.total_count)
t('trestle.helpers.page_entries_info.more_pages.display_entries', entry_name: entry_name, first: first, last: last, total: total, default: "Displaying %{entry_name} <strong>%{first} - %{last}</strong> of <b>%{total}</b>")
end.html_safe
end | ruby | def page_entries_info(collection, options = {})
entry_name = options[:entry_name] || "entry"
entry_name = entry_name.pluralize unless collection.total_count == 1
if collection.total_pages < 2
t('trestle.helpers.page_entries_info.one_page.display_entries', entry_name: entry_name, count: collection.total_count, default: "Displaying <strong>all %{count}</strong> %{entry_name}")
else
first = number_with_delimiter(collection.offset_value + 1)
last = number_with_delimiter((sum = collection.offset_value + collection.limit_value) > collection.total_count ? collection.total_count : sum)
total = number_with_delimiter(collection.total_count)
t('trestle.helpers.page_entries_info.more_pages.display_entries', entry_name: entry_name, first: first, last: last, total: total, default: "Displaying %{entry_name} <strong>%{first} - %{last}</strong> of <b>%{total}</b>")
end.html_safe
end | [
"def",
"page_entries_info",
"(",
"collection",
",",
"options",
"=",
"{",
"}",
")",
"entry_name",
"=",
"options",
"[",
":entry_name",
"]",
"||",
"\"entry\"",
"entry_name",
"=",
"entry_name",
".",
"pluralize",
"unless",
"collection",
".",
"total_count",
"==",
"1... | Custom version of Kaminari's page_entries_info helper to use a
Trestle-scoped I18n key and add a delimiter to the total count. | [
"Custom",
"version",
"of",
"Kaminari",
"s",
"page_entries_info",
"helper",
"to",
"use",
"a",
"Trestle",
"-",
"scoped",
"I18n",
"key",
"and",
"add",
"a",
"delimiter",
"to",
"the",
"total",
"count",
"."
] | fd5b8aeb5077e13d539cb5ddd99db1dd279f19ca | https://github.com/TrestleAdmin/trestle/blob/fd5b8aeb5077e13d539cb5ddd99db1dd279f19ca/app/helpers/trestle/pagination_helper.rb#L5-L18 | train | Returns a list of page entries info | [
30522,
13366,
3931,
1035,
10445,
1035,
18558,
1006,
3074,
1010,
7047,
1027,
1063,
1065,
1007,
4443,
1035,
2171,
1027,
7047,
1031,
1024,
4443,
1035,
2171,
1033,
1064,
1064,
1000,
4443,
1000,
4443,
1035,
2171,
1027,
4443,
1035,
2171,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.ImageList.set_current | def set_current(current)
if length.zero?
self.scene = nil
return
# Don't bother looking for current image
elsif scene.nil? || scene >= length
self.scene = length - 1
return
elsif !current.nil?
# Find last instance of "current" in the list.
# If "current" isn't in the list, set current to last image.
self.scene = length - 1
each_with_index do |f, i|
self.scene = i if f.__id__ == current
end
return
end
self.scene = length - 1
end | ruby | def set_current(current)
if length.zero?
self.scene = nil
return
# Don't bother looking for current image
elsif scene.nil? || scene >= length
self.scene = length - 1
return
elsif !current.nil?
# Find last instance of "current" in the list.
# If "current" isn't in the list, set current to last image.
self.scene = length - 1
each_with_index do |f, i|
self.scene = i if f.__id__ == current
end
return
end
self.scene = length - 1
end | [
"def",
"set_current",
"(",
"current",
")",
"if",
"length",
".",
"zero?",
"self",
".",
"scene",
"=",
"nil",
"return",
"# Don't bother looking for current image",
"elsif",
"scene",
".",
"nil?",
"||",
"scene",
">=",
"length",
"self",
".",
"scene",
"=",
"length",
... | Find old current image, update scene number
current is the id of the old current image. | [
"Find",
"old",
"current",
"image",
"update",
"scene",
"number",
"current",
"is",
"the",
"id",
"of",
"the",
"old",
"current",
"image",
"."
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L1248-L1266 | train | Set current image | [
30522,
13366,
2275,
1035,
2783,
1006,
2783,
1007,
2065,
3091,
1012,
5717,
1029,
2969,
1012,
3496,
1027,
9152,
2140,
2709,
1001,
2123,
1005,
1056,
8572,
2559,
2005,
2783,
3746,
3449,
5332,
2546,
3496,
1012,
9152,
2140,
1029,
1064,
1064,
34... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sinatra/sinatra | lib/sinatra/base.rb | Sinatra.Templates.find_template | def find_template(views, name, engine)
yield ::File.join(views, "#{name}.#{@preferred_extension}")
if Tilt.respond_to?(:mappings)
Tilt.mappings.each do |ext, engines|
next unless ext != @preferred_extension and engines.include? engine
yield ::File.join(views, "#{name}.#{ext}")
end
else
Tilt.default_mapping.extensions_for(engine).each do |ext|
yield ::File.join(views, "#{name}.#{ext}") unless ext == @preferred_extension
end
end
end | ruby | def find_template(views, name, engine)
yield ::File.join(views, "#{name}.#{@preferred_extension}")
if Tilt.respond_to?(:mappings)
Tilt.mappings.each do |ext, engines|
next unless ext != @preferred_extension and engines.include? engine
yield ::File.join(views, "#{name}.#{ext}")
end
else
Tilt.default_mapping.extensions_for(engine).each do |ext|
yield ::File.join(views, "#{name}.#{ext}") unless ext == @preferred_extension
end
end
end | [
"def",
"find_template",
"(",
"views",
",",
"name",
",",
"engine",
")",
"yield",
"::",
"File",
".",
"join",
"(",
"views",
",",
"\"#{name}.#{@preferred_extension}\"",
")",
"if",
"Tilt",
".",
"respond_to?",
"(",
":mappings",
")",
"Tilt",
".",
"mappings",
".",
... | Calls the given block for every possible template file in views,
named name.ext, where ext is registered on engine. | [
"Calls",
"the",
"given",
"block",
"for",
"every",
"possible",
"template",
"file",
"in",
"views",
"named",
"name",
".",
"ext",
"where",
"ext",
"is",
"registered",
"on",
"engine",
"."
] | 1aa64f9858edc3f93cc8d46e26f724c1ae103b1c | https://github.com/sinatra/sinatra/blob/1aa64f9858edc3f93cc8d46e26f724c1ae103b1c/lib/sinatra/base.rb#L786-L799 | train | Find the template with the given name. | [
30522,
13366,
2424,
1035,
23561,
1006,
5328,
1010,
2171,
1010,
3194,
1007,
10750,
1024,
1024,
5371,
1012,
3693,
1006,
5328,
1010,
1000,
1001,
1063,
2171,
1065,
1012,
1001,
1063,
1030,
6871,
1035,
5331,
1065,
1000,
1007,
2065,
17010,
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... |
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... |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 5