repo stringclasses 235 values | path stringlengths 11 168 | func_name stringlengths 12 143 | original_string stringlengths 83 6.91k | language stringclasses 1 value | code stringlengths 83 6.91k | code_tokens listlengths 15 1.01k | docstring stringlengths 5 25.7k | docstring_tokens listlengths 1 427 | sha stringclasses 235 values | url stringlengths 99 268 | partition stringclasses 1 value | summary stringlengths 7 202 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | 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_service_type_info_by_name | def get_service_type_info_by_name(application_type_name, application_type_version, service_type_name, timeout:60, custom_headers:nil)
response = get_service_type_info_by_name_async(application_type_name, application_type_version, service_type_name, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_service_type_info_by_name(application_type_name, application_type_version, service_type_name, timeout:60, custom_headers:nil)
response = get_service_type_info_by_name_async(application_type_name, application_type_version, service_type_name, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_service_type_info_by_name",
"(",
"application_type_name",
",",
"application_type_version",
",",
"service_type_name",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_service_type_info_by_name_async",
"(",
"application_type... | Gets the information about a specific service type that is supported by a
provisioned application type in a Service Fabric cluster.
Gets the information about a specific service type that is supported by a
provisioned application type in a Service Fabric cluster. The provided
application type must exist. Otherwise, a 404 status is returned. A 204
response is returned if the specified service type is not found in the
cluster.
@param application_type_name [String] The name of the application type.
@param application_type_version [String] The version of the application type.
@param service_type_name [String] Specifies the name of a Service Fabric
service type.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ServiceTypeInfo] operation results. | [
"Gets",
"the",
"information",
"about",
"a",
"specific",
"service",
"type",
"that",
"is",
"supported",
"by",
"a",
"provisioned",
"application",
"type",
"in",
"a",
"Service",
"Fabric",
"cluster",
"."
] | 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#L5469-L5472 | train | Gets the information about the service type. | [
30522,
13366,
2131,
1035,
2326,
1035,
2828,
1035,
18558,
1035,
2011,
1035,
2171,
1006,
4646,
1035,
2828,
1035,
2171,
1010,
4646,
1035,
2828,
1035,
2544,
1010,
2326,
1035,
2828,
1035,
2171,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
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 | management/azure_mgmt_container_service/lib/2019-02-01/generated/azure_mgmt_container_service/managed_clusters.rb | Azure::ContainerService::Mgmt::V2019_02_01.ManagedClusters.get_upgrade_profile | def get_upgrade_profile(resource_group_name, resource_name, custom_headers:nil)
response = get_upgrade_profile_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_upgrade_profile(resource_group_name, resource_name, custom_headers:nil)
response = get_upgrade_profile_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_upgrade_profile",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_upgrade_profile_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"v... | Gets upgrade profile for a managed cluster.
Gets the details of the upgrade profile for a managed cluster with a
specified resource group and name.
@param resource_group_name [String] The name of the resource group.
@param resource_name [String] The name of the managed cluster resource.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ManagedClusterUpgradeProfile] operation results. | [
"Gets",
"upgrade",
"profile",
"for",
"a",
"managed",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_service/lib/2019-02-01/generated/azure_mgmt_container_service/managed_clusters.rb#L228-L231 | train | Gets the upgrade profile for a resource group. | [
30522,
13366,
2131,
1035,
12200,
1035,
6337,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
12200,
1035,
6337,
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 | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_composite_entity_child_with_http_info | def delete_composite_entity_child_with_http_info(app_id, version_id, c_entity_id, c_child_id, custom_headers:nil)
delete_composite_entity_child_async(app_id, version_id, c_entity_id, c_child_id, custom_headers:custom_headers).value!
end | ruby | def delete_composite_entity_child_with_http_info(app_id, version_id, c_entity_id, c_child_id, custom_headers:nil)
delete_composite_entity_child_async(app_id, version_id, c_entity_id, c_child_id, custom_headers:custom_headers).value!
end | [
"def",
"delete_composite_entity_child_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"c_entity_id",
",",
"c_child_id",
",",
"custom_headers",
":",
"nil",
")",
"delete_composite_entity_child_async",
"(",
"app_id",
",",
"version_id",
",",
"c_entity_id",
",",
"c_c... | Deletes a composite entity extractor child from 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 c_child_id The hierarchical entity extractor child 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. | [
"Deletes",
"a",
"composite",
"entity",
"extractor",
"child",
"from",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L5567-L5569 | train | Deletes a composite entity child. | [
30522,
13366,
3972,
12870,
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,
1039,
1035,
2775,
1035,
8909,
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 | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_application_backup_list_with_http_info | def get_application_backup_list_with_http_info(application_id, timeout:60, latest:false, start_date_time_filter:nil, end_date_time_filter:nil, continuation_token:nil, max_results:0, custom_headers:nil)
get_application_backup_list_async(application_id, timeout:timeout, latest:latest, start_date_time_filter:start_date_time_filter, end_date_time_filter:end_date_time_filter, continuation_token:continuation_token, max_results:max_results, custom_headers:custom_headers).value!
end | ruby | def get_application_backup_list_with_http_info(application_id, timeout:60, latest:false, start_date_time_filter:nil, end_date_time_filter:nil, continuation_token:nil, max_results:0, custom_headers:nil)
get_application_backup_list_async(application_id, timeout:timeout, latest:latest, start_date_time_filter:start_date_time_filter, end_date_time_filter:end_date_time_filter, continuation_token:continuation_token, max_results:max_results, custom_headers:custom_headers).value!
end | [
"def",
"get_application_backup_list_with_http_info",
"(",
"application_id",
",",
"timeout",
":",
"60",
",",
"latest",
":",
"false",
",",
"start_date_time_filter",
":",
"nil",
",",
"end_date_time_filter",
":",
"nil",
",",
"continuation_token",
":",
"nil",
",",
"max_r... | Gets the list of backups available for every partition in this application.
Returns a list of backups available for every partition in this Service
Fabric application. The server enumerates all the backups available at the
backup location configured in the backup policy. It also allows filtering of
the result based on start and end datetime or just fetching the latest
available backup for every partition.
@param application_id [String] The identity of the application. This is
typically the full name of the application without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the application name is "fabric:/myapp/app1", the application
identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions.
@param 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 latest [Boolean] Specifies whether to get only the most recent backup
available for a partition for the specified time range.
@param start_date_time_filter [DateTime] Specify the start date time from
which to enumerate backups, in datetime format. The date time must be
specified in ISO8601 format. This is an optional parameter. If not specified,
all backups from the beginning are enumerated.
@param end_date_time_filter [DateTime] Specify the end date time till which
to enumerate backups, in datetime format. The date time must be specified in
ISO8601 format. This is an optional parameter. If not specified, enumeration
is done till the most recent backup.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param 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",
"list",
"of",
"backups",
"available",
"for",
"every",
"partition",
"in",
"this",
"application",
"."
] | 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#L23457-L23459 | train | Gets the backup list of the applications. | [
30522,
13366,
2131,
1035,
4646,
30524,
1035,
11307,
1024,
9152,
2140,
1010,
2203,
1035,
3058,
1035,
2051,
1035,
11307,
1024,
9152,
2140,
1010,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
4098,
1035,
3463,
1024,
1014,
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_cognitiveservices_luisruntime/lib/3.0-preview/generated/azure_cognitiveservices_luisruntime/prediction_operations.rb | Azure::CognitiveServices::LuisRuntime::V3_0_preview.PredictionOperations.get_version_prediction_async | def get_version_prediction_async(app_id, version_id, prediction_request, verbose:nil, show_all_intents:nil, log:nil, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'app_id is nil' if app_id.nil?
fail ArgumentError, 'version_id is nil' if version_id.nil?
fail ArgumentError, 'prediction_request is nil' if prediction_request.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::CognitiveServices::LuisRuntime::V3_0_preview::Models::PredictionRequest.mapper()
request_content = @client.serialize(request_mapper, prediction_request)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'apps/{appId}/versions/{versionId}/predict'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'appId' => app_id,'versionId' => version_id},
query_params: {'verbose' => verbose,'show-all-intents' => show_all_intents,'log' => log},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:post, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::LuisRuntime::V3_0_preview::Models::PredictionResponse.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end | ruby | def get_version_prediction_async(app_id, version_id, prediction_request, verbose:nil, show_all_intents:nil, log:nil, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
fail ArgumentError, 'app_id is nil' if app_id.nil?
fail ArgumentError, 'version_id is nil' if version_id.nil?
fail ArgumentError, 'prediction_request is nil' if prediction_request.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
# Serialize Request
request_mapper = Azure::CognitiveServices::LuisRuntime::V3_0_preview::Models::PredictionRequest.mapper()
request_content = @client.serialize(request_mapper, prediction_request)
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
path_template = 'apps/{appId}/versions/{versionId}/predict'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'appId' => app_id,'versionId' => version_id},
query_params: {'verbose' => verbose,'show-all-intents' => show_all_intents,'log' => log},
body: request_content,
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:post, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::LuisRuntime::V3_0_preview::Models::PredictionResponse.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end | [
"def",
"get_version_prediction_async",
"(",
"app_id",
",",
"version_id",
",",
"prediction_request",
",",
"verbose",
":",
"nil",
",",
"show_all_intents",
":",
"nil",
",",
"log",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"fail",
"ArgumentError",
",",
"... | Gets the predictions for an application version.
@param app_id The application ID.
@param version_id [String] The application version ID.
@param prediction_request [PredictionRequest] The prediction request
parameters.
@param verbose [Boolean] Indicates whether to get extra metadata for the
entities predictions or not.
@param show_all_intents [Boolean] Indicates whether to return all the intents
in the response or just the top intent.
@param log [Boolean] Indicates whether to log the endpoint query or not.
@param [Hash{String => String}] A hash of custom headers that will be added
to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response. | [
"Gets",
"the",
"predictions",
"for",
"an",
"application",
"version",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisruntime/lib/3.0-preview/generated/azure_cognitiveservices_luisruntime/prediction_operations.rb#L84-L143 | train | Get the prediction for a version of the application. | [
30522,
13366,
2131,
1035,
2544,
1035,
17547,
1035,
2004,
6038,
2278,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
17547,
1035,
5227,
1010,
12034,
9232,
1024,
9152,
2140,
1010,
2265,
1035,
2035,
1035,
7848,
2015,
1024,
9152,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_operational_insights/lib/2015-03-20/generated/azure_mgmt_operational_insights/workspaces.rb | Azure::OperationalInsights::Mgmt::V2015_03_20.Workspaces.update_search_results_with_http_info | def update_search_results_with_http_info(resource_group_name, workspace_name, id, custom_headers:nil)
update_search_results_async(resource_group_name, workspace_name, id, custom_headers:custom_headers).value!
end | ruby | def update_search_results_with_http_info(resource_group_name, workspace_name, id, custom_headers:nil)
update_search_results_async(resource_group_name, workspace_name, id, custom_headers:custom_headers).value!
end | [
"def",
"update_search_results_with_http_info",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"id",
",",
"custom_headers",
":",
"nil",
")",
"update_search_results_async",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"id",
",",
"custom_headers",
":custo... | Gets updated search results for a given search query.
@param resource_group_name [String] The name of the resource group to get.
The name is case insensitive.
@param workspace_name [String] Log Analytics workspace name
@param id [String] The id of the search that will have results updated. You
can get the id from the response of the GetResults call.
@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",
"updated",
"search",
"results",
"for",
"a",
"given",
"search",
"query",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_operational_insights/lib/2015-03-20/generated/azure_mgmt_operational_insights/workspaces.rb#L309-L311 | train | Updates the search results of a given workspace. | [
30522,
13366,
10651,
1035,
3945,
1035,
3463,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2573,
15327,
1035,
2171,
1010,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
1035,
3945,
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... |
randym/axlsx | lib/axlsx/util/parser.rb | Axlsx.Parser.parse_value | def parse_value xpath
node = parser_xml.xpath(xpath)
return nil if node.empty?
node.text.strip
end | ruby | def parse_value xpath
node = parser_xml.xpath(xpath)
return nil if node.empty?
node.text.strip
end | [
"def",
"parse_value",
"xpath",
"node",
"=",
"parser_xml",
".",
"xpath",
"(",
"xpath",
")",
"return",
"nil",
"if",
"node",
".",
"empty?",
"node",
".",
"text",
".",
"strip",
"end"
] | return node text based on xpath | [
"return",
"node",
"text",
"based",
"on",
"xpath"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/util/parser.rb#L37-L41 | train | Parse the value from the XML document | [
30522,
13366,
11968,
3366,
1035,
3643,
26726,
8988,
13045,
1027,
11968,
8043,
1035,
20950,
1012,
26726,
8988,
1006,
26726,
8988,
1007,
2709,
9152,
2140,
2065,
13045,
1012,
4064,
1029,
13045,
1012,
3793,
1012,
6167,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/replications.rb | Azure::ContainerRegistry::Mgmt::V2017_06_01_preview.Replications.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers:nil)
begin_update_async(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers:nil)
begin_update_async(resource_group_name, registry_name, replication_name, replication_update_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"registry_name",
",",
"replication_name",
",",
"replication_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"repli... | Updates a replication for a container registry with the specified parameters.
@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 replication_name [String] The name of the replication.
@param replication_update_parameters [ReplicationUpdateParameters] The
parameters for updating a replication.
@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",
"replication",
"for",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | 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/replications.rb#L620-L622 | train | Updates a replication specification. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
21647,
1035,
2171,
1010,
21647,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rocketjob/symmetric-encryption | lib/symmetric_encryption/reader.rb | SymmetricEncryption.Reader.seek | def seek(amount, whence = IO::SEEK_SET)
offset = 0
case whence
when IO::SEEK_SET
offset = amount
rewind
when IO::SEEK_CUR
if amount >= 0
offset = amount
else
offset = @pos + amount
rewind
end
when IO::SEEK_END
rewind
# Read and decrypt entire file a block at a time to get its total
# unencrypted size
size = 0
until eof?
read_block
size += @read_buffer.size
@read_buffer.clear
end
rewind
offset = size + amount
else
raise(ArgumentError, "unknown whence:#{whence} supplied to seek()")
end
read(offset) if offset.positive?
0
end | ruby | def seek(amount, whence = IO::SEEK_SET)
offset = 0
case whence
when IO::SEEK_SET
offset = amount
rewind
when IO::SEEK_CUR
if amount >= 0
offset = amount
else
offset = @pos + amount
rewind
end
when IO::SEEK_END
rewind
# Read and decrypt entire file a block at a time to get its total
# unencrypted size
size = 0
until eof?
read_block
size += @read_buffer.size
@read_buffer.clear
end
rewind
offset = size + amount
else
raise(ArgumentError, "unknown whence:#{whence} supplied to seek()")
end
read(offset) if offset.positive?
0
end | [
"def",
"seek",
"(",
"amount",
",",
"whence",
"=",
"IO",
"::",
"SEEK_SET",
")",
"offset",
"=",
"0",
"case",
"whence",
"when",
"IO",
"::",
"SEEK_SET",
"offset",
"=",
"amount",
"rewind",
"when",
"IO",
"::",
"SEEK_CUR",
"if",
"amount",
">=",
"0",
"offset",... | Seeks to a given offset (Integer) in the stream according to the value of whence:
IO::SEEK_CUR | Seeks to _amount_ plus current position
--------------+----------------------------------------------------
IO::SEEK_END | Seeks to _amount_ plus end of stream (you probably
| want a negative value for _amount_)
--------------+----------------------------------------------------
IO::SEEK_SET | Seeks to the absolute location given by _amount_
WARNING: IO::SEEK_SET will jump to the beginning of the file and
then re-read upto the point specified
WARNING: IO::SEEK_END will read the entire file and then again
upto the point specified | [
"Seeks",
"to",
"a",
"given",
"offset",
"(",
"Integer",
")",
"in",
"the",
"stream",
"according",
"to",
"the",
"value",
"of",
"whence",
":",
"IO",
"::",
"SEEK_CUR",
"|",
"Seeks",
"to",
"_amount_",
"plus",
"current",
"position",
"--------------",
"+",
"------... | 064ba8d57ffac44a3ed80f5e76fa1a54d660ff98 | https://github.com/rocketjob/symmetric-encryption/blob/064ba8d57ffac44a3ed80f5e76fa1a54d660ff98/lib/symmetric_encryption/reader.rb#L274-L304 | train | Seek to the specified offset. | [
30522,
13366,
6148,
1006,
3815,
1010,
2043,
3401,
1027,
22834,
1024,
1024,
6148,
1035,
2275,
1007,
16396,
1027,
1014,
2553,
2043,
3401,
2043,
22834,
1024,
1024,
6148,
1035,
2275,
16396,
1027,
3815,
2128,
11101,
2043,
22834,
1024,
1024,
6148... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rubocop-hq/rubocop | lib/rubocop/processed_source.rb | RuboCop.ProcessedSource.parser_class | def parser_class(ruby_version)
case ruby_version
when 2.2
require 'parser/ruby22'
Parser::Ruby22
when 2.3
require 'parser/ruby23'
Parser::Ruby23
when 2.4
require 'parser/ruby24'
Parser::Ruby24
when 2.5
require 'parser/ruby25'
Parser::Ruby25
when 2.6
require 'parser/ruby26'
Parser::Ruby26
else
raise ArgumentError, "Unknown Ruby version: #{ruby_version.inspect}"
end
end | ruby | def parser_class(ruby_version)
case ruby_version
when 2.2
require 'parser/ruby22'
Parser::Ruby22
when 2.3
require 'parser/ruby23'
Parser::Ruby23
when 2.4
require 'parser/ruby24'
Parser::Ruby24
when 2.5
require 'parser/ruby25'
Parser::Ruby25
when 2.6
require 'parser/ruby26'
Parser::Ruby26
else
raise ArgumentError, "Unknown Ruby version: #{ruby_version.inspect}"
end
end | [
"def",
"parser_class",
"(",
"ruby_version",
")",
"case",
"ruby_version",
"when",
"2.2",
"require",
"'parser/ruby22'",
"Parser",
"::",
"Ruby22",
"when",
"2.3",
"require",
"'parser/ruby23'",
"Parser",
"::",
"Ruby23",
"when",
"2.4",
"require",
"'parser/ruby24'",
"Parse... | rubocop:disable Metrics/MethodLength | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"MethodLength"
] | 2a4f4f0fdac4e1bb25891fc312af2ea60c6aa2f0 | https://github.com/rubocop-hq/rubocop/blob/2a4f4f0fdac4e1bb25891fc312af2ea60c6aa2f0/lib/rubocop/processed_source.rb#L171-L191 | train | Returns the parser class for the given Ruby version. | [
30522,
13366,
11968,
8043,
1035,
2465,
1006,
10090,
1035,
2544,
1007,
2553,
10090,
1035,
2544,
2043,
1016,
1012,
1016,
5478,
1005,
11968,
8043,
1013,
10090,
19317,
1005,
11968,
8043,
1024,
1024,
10090,
19317,
2043,
1016,
1012,
1017,
5478,
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... |
bblimke/webmock | lib/webmock/util/hash_validator.rb | WebMock.HashValidator.validate_keys | def validate_keys(*valid_keys)
valid_keys.flatten!
@hash.each_key do |k|
unless valid_keys.include?(k)
raise ArgumentError.new("Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}")
end
end
end | ruby | def validate_keys(*valid_keys)
valid_keys.flatten!
@hash.each_key do |k|
unless valid_keys.include?(k)
raise ArgumentError.new("Unknown key: #{k.inspect}. Valid keys are: #{valid_keys.map(&:inspect).join(', ')}")
end
end
end | [
"def",
"validate_keys",
"(",
"*",
"valid_keys",
")",
"valid_keys",
".",
"flatten!",
"@hash",
".",
"each_key",
"do",
"|",
"k",
"|",
"unless",
"valid_keys",
".",
"include?",
"(",
"k",
")",
"raise",
"ArgumentError",
".",
"new",
"(",
"\"Unknown key: #{k.inspect}. ... | This code is based on https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/hash/keys.rb | [
"This",
"code",
"is",
"based",
"on",
"https",
":",
"//",
"github",
".",
"com",
"/",
"rails",
"/",
"rails",
"/",
"blob",
"/",
"master",
"/",
"activesupport",
"/",
"lib",
"/",
"active_support",
"/",
"core_ext",
"/",
"hash",
"/",
"keys",
".",
"rb"
] | c0bcc09af372286cd110ec4159112ce583007951 | https://github.com/bblimke/webmock/blob/c0bcc09af372286cd110ec4159112ce583007951/lib/webmock/util/hash_validator.rb#L8-L15 | train | Validate the keys of the hash | [
30522,
13366,
9398,
3686,
1035,
6309,
1006,
1008,
9398,
1035,
6309,
1007,
9398,
1035,
6309,
1012,
4257,
6528,
999,
1030,
23325,
1012,
2169,
1035,
3145,
2079,
1064,
1047,
1064,
4983,
9398,
1035,
6309,
1012,
2421,
1029,
1006,
1047,
1007,
53... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby-git/ruby-git | lib/git/branches.rb | Git.Branches.[] | def [](branch_name)
@branches.values.inject(@branches) do |branches, branch|
branches[branch.full] ||= branch
# This is how Git (version 1.7.9.5) works.
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
branches[branch.full.sub('remotes/', '')] ||= branch if branch.full =~ /^remotes\/.+/
branches
end[branch_name.to_s]
end | ruby | def [](branch_name)
@branches.values.inject(@branches) do |branches, branch|
branches[branch.full] ||= branch
# This is how Git (version 1.7.9.5) works.
# Lets you ignore the 'remotes' if its at the beginning of the branch full name (even if is not a real remote branch).
branches[branch.full.sub('remotes/', '')] ||= branch if branch.full =~ /^remotes\/.+/
branches
end[branch_name.to_s]
end | [
"def",
"[]",
"(",
"branch_name",
")",
"@branches",
".",
"values",
".",
"inject",
"(",
"@branches",
")",
"do",
"|",
"branches",
",",
"branch",
"|",
"branches",
"[",
"branch",
".",
"full",
"]",
"||=",
"branch",
"# This is how Git (version 1.7.9.5) works. ",
"# L... | Returns the target branch
Example:
Given (git branch -a):
master
remotes/working/master
g.branches['master'].full #=> 'master'
g.branches['working/master'].full => 'remotes/working/master'
g.branches['remotes/working/master'].full => 'remotes/working/master'
@param [#to_s] branch_name the target branch name.
@return [Git::Branch] the target branch. | [
"Returns",
"the",
"target",
"branch"
] | 9bd4407c56068e1604f14a1b6c0c5a84868e6378 | https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/branches.rb#L49-L59 | train | Returns the branch object for the given branch name. | [
30522,
13366,
1031,
1033,
1006,
3589,
1035,
2171,
1007,
1030,
5628,
1012,
5300,
1012,
1999,
20614,
1006,
1030,
5628,
1007,
2079,
1064,
5628,
1010,
3589,
1064,
5628,
1031,
3589,
1012,
2440,
1033,
1064,
1064,
1027,
3589,
1001,
2023,
2003,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/p2s_vpn_server_configurations.rb | Azure::Network::Mgmt::V2019_02_01.P2sVpnServerConfigurations.list_by_virtual_wan_as_lazy | def list_by_virtual_wan_as_lazy(resource_group_name, virtual_wan_name, custom_headers:nil)
response = list_by_virtual_wan_async(resource_group_name, virtual_wan_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_virtual_wan_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_virtual_wan_as_lazy(resource_group_name, virtual_wan_name, custom_headers:nil)
response = list_by_virtual_wan_async(resource_group_name, virtual_wan_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_virtual_wan_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_virtual_wan_as_lazy",
"(",
"resource_group_name",
",",
"virtual_wan_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_virtual_wan_async",
"(",
"resource_group_name",
",",
"virtual_wan_name",
",",
"custom_headers",
":custom_headers",
")... | Retrieves all P2SVpnServerConfigurations for a particular VirtualWan.
@param resource_group_name [String] The resource group name of the
VirtualWan.
@param virtual_wan_name [String] The name of the VirtualWan.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ListP2SVpnServerConfigurationsResult] which provide lazy access to
pages of the response. | [
"Retrieves",
"all",
"P2SVpnServerConfigurations",
"for",
"a",
"particular",
"VirtualWan",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/p2s_vpn_server_configurations.rb#L638-L647 | train | Gets the list of all the managed managed | [
30522,
13366,
2862,
1035,
2011,
1035,
7484,
1035,
14071,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
14071,
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... |
fastlane/fastlane | supply/lib/supply/client.rb | Supply.Client.abort_current_edit | def abort_current_edit
ensure_active_edit!
call_google_api { client.delete_edit(current_package_name, current_edit.id) }
self.current_edit = nil
self.current_package_name = nil
end | ruby | def abort_current_edit
ensure_active_edit!
call_google_api { client.delete_edit(current_package_name, current_edit.id) }
self.current_edit = nil
self.current_package_name = nil
end | [
"def",
"abort_current_edit",
"ensure_active_edit!",
"call_google_api",
"{",
"client",
".",
"delete_edit",
"(",
"current_package_name",
",",
"current_edit",
".",
"id",
")",
"}",
"self",
".",
"current_edit",
"=",
"nil",
"self",
".",
"current_package_name",
"=",
"nil",... | Aborts the current edit deleting all pending changes | [
"Aborts",
"the",
"current",
"edit",
"deleting",
"all",
"pending",
"changes"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/supply/lib/supply/client.rb#L144-L151 | train | Aborts the current edit object. | [
30522,
13366,
11113,
11589,
1035,
2783,
1035,
10086,
5676,
1035,
3161,
1035,
10086,
999,
2655,
1035,
8224,
1035,
17928,
1063,
7396,
1012,
3972,
12870,
1035,
10086,
1006,
2783,
1035,
7427,
1035,
2171,
1010,
2783,
1035,
10086,
1012,
8909,
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 | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb | Azure::CognitiveServices::Face::V1_0.SnapshotOperations.list | def list(type:nil, apply_scope:nil, custom_headers:nil)
response = list_async(type:type, apply_scope:apply_scope, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list(type:nil, apply_scope:nil, custom_headers:nil)
response = list_async(type:type, apply_scope:apply_scope, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list",
"(",
"type",
":",
"nil",
",",
"apply_scope",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_async",
"(",
"type",
":",
"type",
",",
"apply_scope",
":apply_scope",
",",
"custom_headers",
":custom_headers",
")",
".",
... | List all accessible snapshots with related information, including snapshots
that were taken by the user, or snapshots to be applied to the user
(subscription id was included in the applyScope in Snapshot - Take).
@param type [SnapshotObjectType] User specified object type as a search
filter. Possible values include: 'FaceList', 'LargeFaceList',
'LargePersonGroup', 'PersonGroup'
@param apply_scope User specified snapshot apply scopes as a search filter.
ApplyScope is an array of the target Azure subscription ids for the snapshot,
specified by the user who created the snapshot by Snapshot - Take.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"List",
"all",
"accessible",
"snapshots",
"with",
"related",
"information",
"including",
"snapshots",
"that",
"were",
"taken",
"by",
"the",
"user",
"or",
"snapshots",
"to",
"be",
"applied",
"to",
"the",
"user",
"(",
"subscription",
"id",
"was",
"included",
"in... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb#L263-L266 | train | Gets the list of all the available image types. | [
30522,
13366,
2862,
1006,
2828,
1024,
9152,
2140,
1010,
6611,
1035,
9531,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2004,
6038,
2278,
1006,
2828,
1024,
2828,
1010,
6611,
1035,
9531,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb | Azure::Labservices::Mgmt::V2018_10_15.Environments.begin_reset_password_with_http_info | def begin_reset_password_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
end | ruby | def begin_reset_password_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
begin_reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
end | [
"def",
"begin_reset_password_with_http_info",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
"environment_setting_name",
",",
"environment_name",
",",
"reset_password_payload",
",",
"custom_headers",
":",
"nil",
")",
"begin_reset_password_async",
"... | Resets the user password on an environment 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 environment_setting_name [String] The name of the environment Setting.
@param environment_name [String] The name of the environment.
@param reset_password_payload [ResetPasswordPayload] Represents the payload
for resetting passwords.
@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. | [
"Resets",
"the",
"user",
"password",
"on",
"an",
"environment",
"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/environments.rb#L900-L902 | train | Reset the password of the specified environment. | [
30522,
13366,
4088,
1035,
25141,
1035,
20786,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
1035,
2171,
1010,
4044,
1035,
4292,
1035,
2171,
1010,
4044,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/issues/milestones.rb | Github.Client::Issues::Milestones.create | def create(*args)
arguments(args, required: [:user, :repo]) do
permit VALID_MILESTONE_INPUTS
assert_required %w[ title ]
end
post_request("/repos/#{arguments.user}/#{arguments.repo}/milestones", arguments.params)
end | ruby | def create(*args)
arguments(args, required: [:user, :repo]) do
permit VALID_MILESTONE_INPUTS
assert_required %w[ title ]
end
post_request("/repos/#{arguments.user}/#{arguments.repo}/milestones", arguments.params)
end | [
"def",
"create",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
"]",
")",
"do",
"permit",
"VALID_MILESTONE_INPUTS",
"assert_required",
"%w[",
"title",
"]",
"end",
"post_request",
"(",
"\"/repos/#{arguments.us... | Create a milestone
@param [Hash] params
@option params [String] :title
Required string. The title of the milestone
@option params [String] :state
The state of the milestone. Either open or closed. Default: open.
@option params [String] :description
A description of the milestone
@option params [String] :due_on
The milestone due date. This is a timestamp in ISO 8601 format:
YYYY-MM-DDTHH:MM:SSZ.
@example
github = Github.new user: 'user-name', repo: 'repo-name'
github.issues.milestones.create title: 'hello-world',
state: "open or closed",
description: "String",
due_on: "Time"
@api public | [
"Create",
"a",
"milestone"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/issues/milestones.rb#L94-L101 | train | Create a new milestone | [
30522,
13366,
3443,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1033,
1007,
2079,
9146,
9398,
1035,
19199,
1035,
20407,
20865,
1035,
3223,
1003,
1059,
1031,
2516,
1033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_certificates_with_http_info | def get_certificates_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_certificates_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | ruby | def get_certificates_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_certificates_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | [
"def",
"get_certificates_with_http_info",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_certificates_async",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_headers",
":custom_headers",
")",
... | List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in
the specified key vault. This operation requires the certificates/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 [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"List",
"certificates",
"in",
"a",
"specified",
"key",
"vault"
] | 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#L4046-L4048 | train | Gets the certificates associated with the specified vault. | [
30522,
13366,
2131,
1035,
17987,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
17987,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | fastlane_core/lib/fastlane_core/project.rb | FastlaneCore.Project.project_paths | def project_paths
return @_project_paths if @_project_paths
if self.workspace?
# Find the xcodeproj file, as the information isn't included in the workspace file
# We have a reference to the workspace, let's find the xcodeproj file
# Use Xcodeproj gem here to
# * parse the contents.xcworkspacedata XML file
# * handle different types (group:, container: etc.) of file references and their paths
# for details see https://github.com/CocoaPods/Xcodeproj/blob/e0287156d426ba588c9234bb2a4c824149889860/lib/xcodeproj/workspace/file_reference.rb```
workspace_dir_path = File.expand_path("..", self.path)
file_references_paths = workspace.file_references.map { |fr| fr.absolute_path(workspace_dir_path) }
@_project_paths = file_references_paths.select do |current_match|
# Xcode workspaces can contain loose files now, so let's filter non-xcodeproj files.
current_match.end_with?(".xcodeproj")
end.reject do |current_match|
# We're not interested in a `Pods` project, as it doesn't contain any relevant information about code signing
current_match.end_with?("Pods/Pods.xcodeproj")
end
return @_project_paths
else
# Return the path as an array
return @_project_paths = [path]
end
end | ruby | def project_paths
return @_project_paths if @_project_paths
if self.workspace?
# Find the xcodeproj file, as the information isn't included in the workspace file
# We have a reference to the workspace, let's find the xcodeproj file
# Use Xcodeproj gem here to
# * parse the contents.xcworkspacedata XML file
# * handle different types (group:, container: etc.) of file references and their paths
# for details see https://github.com/CocoaPods/Xcodeproj/blob/e0287156d426ba588c9234bb2a4c824149889860/lib/xcodeproj/workspace/file_reference.rb```
workspace_dir_path = File.expand_path("..", self.path)
file_references_paths = workspace.file_references.map { |fr| fr.absolute_path(workspace_dir_path) }
@_project_paths = file_references_paths.select do |current_match|
# Xcode workspaces can contain loose files now, so let's filter non-xcodeproj files.
current_match.end_with?(".xcodeproj")
end.reject do |current_match|
# We're not interested in a `Pods` project, as it doesn't contain any relevant information about code signing
current_match.end_with?("Pods/Pods.xcodeproj")
end
return @_project_paths
else
# Return the path as an array
return @_project_paths = [path]
end
end | [
"def",
"project_paths",
"return",
"@_project_paths",
"if",
"@_project_paths",
"if",
"self",
".",
"workspace?",
"# Find the xcodeproj file, as the information isn't included in the workspace file",
"# We have a reference to the workspace, let's find the xcodeproj file",
"# Use Xcodeproj gem h... | Array of paths to all project files
(might be multiple, because of workspaces) | [
"Array",
"of",
"paths",
"to",
"all",
"project",
"files",
"(",
"might",
"be",
"multiple",
"because",
"of",
"workspaces",
")"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane_core/lib/fastlane_core/project.rb#L446-L471 | train | Find the project paths for this project | [
30522,
13366,
2622,
1035,
10425,
2709,
1030,
1035,
2622,
1035,
10425,
2065,
1030,
1035,
2622,
1035,
10425,
2065,
2969,
1012,
2573,
15327,
1029,
1001,
2424,
1996,
1060,
16044,
21572,
3501,
5371,
1010,
2004,
1996,
2592,
3475,
1005,
1056,
2443... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_automation/lib/2015-10-31/generated/azure_mgmt_automation/connection_operations.rb | Azure::Automation::Mgmt::V2015_10_31.ConnectionOperations.delete | def delete(resource_group_name, automation_account_name, connection_name, custom_headers:nil)
response = delete_async(resource_group_name, automation_account_name, connection_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete(resource_group_name, automation_account_name, connection_name, custom_headers:nil)
response = delete_async(resource_group_name, automation_account_name, connection_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"connection_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"connection_name",
",",
"custom... | Delete the connection.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param connection_name [String] The name of connection.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Connection] operation results. | [
"Delete",
"the",
"connection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/connection_operations.rb#L35-L38 | train | Deletes a connection from the specified Data Lake Store account. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
4434,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
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_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb | Azure::EventGrid::Mgmt::V2018_01_01.EventSubscriptions.list_global_by_resource_group_for_topic_type | def list_global_by_resource_group_for_topic_type(resource_group_name, topic_type_name, custom_headers:nil)
response = list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_global_by_resource_group_for_topic_type(resource_group_name, topic_type_name, custom_headers:nil)
response = list_global_by_resource_group_for_topic_type_async(resource_group_name, topic_type_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_global_by_resource_group_for_topic_type",
"(",
"resource_group_name",
",",
"topic_type_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_global_by_resource_group_for_topic_type_async",
"(",
"resource_group_name",
",",
"topic_type_name",
",",
"cu... | List all global event subscriptions under a resource group for a topic type
List all global event subscriptions under a resource group for a specific
topic type.
@param resource_group_name [String] The name of the resource group within the
user's subscription.
@param topic_type_name [String] Name of the topic type
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EventSubscriptionsListResult] operation results. | [
"List",
"all",
"global",
"event",
"subscriptions",
"under",
"a",
"resource",
"group",
"for",
"a",
"topic",
"type"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb#L783-L786 | train | Gets all the global policy rules for a topic type. | [
30522,
13366,
2862,
1035,
3795,
1035,
2011,
1035,
7692,
1035,
2177,
1035,
2005,
1035,
8476,
1035,
2828,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8476,
1035,
2828,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
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... |
hashicorp/vagrant | lib/vagrant/environment.rb | Vagrant.Environment.action_runner | def action_runner
@action_runner ||= Action::Runner.new do
{
action_runner: action_runner,
box_collection: boxes,
hook: method(:hook),
host: host,
machine_index: machine_index,
gems_path: gems_path,
home_path: home_path,
root_path: root_path,
tmp_path: tmp_path,
ui: @ui,
env: self
}
end
end | ruby | def action_runner
@action_runner ||= Action::Runner.new do
{
action_runner: action_runner,
box_collection: boxes,
hook: method(:hook),
host: host,
machine_index: machine_index,
gems_path: gems_path,
home_path: home_path,
root_path: root_path,
tmp_path: tmp_path,
ui: @ui,
env: self
}
end
end | [
"def",
"action_runner",
"@action_runner",
"||=",
"Action",
"::",
"Runner",
".",
"new",
"do",
"{",
"action_runner",
":",
"action_runner",
",",
"box_collection",
":",
"boxes",
",",
"hook",
":",
"method",
"(",
":hook",
")",
",",
"host",
":",
"host",
",",
"mac... | Action runner for executing actions in the context of this environment.
@return [Action::Runner] | [
"Action",
"runner",
"for",
"executing",
"actions",
"in",
"the",
"context",
"of",
"this",
"environment",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/environment.rb#L201-L217 | train | Returns the object containing the result of the action runner. | [
30522,
13366,
2895,
1035,
5479,
1030,
2895,
1035,
5479,
1064,
1064,
1027,
2895,
1024,
1024,
5479,
1012,
2047,
2079,
1063,
2895,
1035,
5479,
1024,
2895,
1035,
5479,
1010,
3482,
1035,
3074,
1024,
8378,
1010,
8103,
1024,
4118,
1006,
1024,
81... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/data_bar.rb | Axlsx.DataBar.color= | def color=(v)
@color = v if v.is_a? Color
self.color.rgb = v if v.is_a? String
@color
end | ruby | def color=(v)
@color = v if v.is_a? Color
self.color.rgb = v if v.is_a? String
@color
end | [
"def",
"color",
"=",
"(",
"v",
")",
"@color",
"=",
"v",
"if",
"v",
".",
"is_a?",
"Color",
"self",
".",
"color",
".",
"rgb",
"=",
"v",
"if",
"v",
".",
"is_a?",
"String",
"@color",
"end"
] | Sets the color for the data bars.
@param [Color|String] v The color object, or rgb string value to apply | [
"Sets",
"the",
"color",
"for",
"the",
"data",
"bars",
"."
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/data_bar.rb#L100-L104 | train | Set the color of the object | [
30522,
13366,
3609,
1027,
1006,
1058,
1007,
1030,
3609,
1027,
1058,
2065,
1058,
1012,
2003,
1035,
1037,
1029,
3609,
2969,
1012,
3609,
1012,
1054,
18259,
1027,
1058,
2065,
1058,
1012,
2003,
1035,
1037,
1029,
5164,
1030,
3609,
2203,
102,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/face_list_operations.rb | Azure::CognitiveServices::Face::V1_0.FaceListOperations.update | def update(face_list_id, name:nil, user_data:nil, custom_headers:nil)
response = update_async(face_list_id, name:name, user_data:user_data, custom_headers:custom_headers).value!
nil
end | ruby | def update(face_list_id, name:nil, user_data:nil, custom_headers:nil)
response = update_async(face_list_id, name:name, user_data:user_data, custom_headers:custom_headers).value!
nil
end | [
"def",
"update",
"(",
"face_list_id",
",",
"name",
":",
"nil",
",",
"user_data",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"face_list_id",
",",
"name",
":",
"name",
",",
"user_data",
":user_data",
",",
"custo... | Update information of a face list.
@param face_list_id [String] Id referencing a particular face list.
@param name [String] User defined name, maximum length is 128.
@param user_data [String] User specified data. Length should not exceed 16KB.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Update",
"information",
"of",
"a",
"face",
"list",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/face_list_operations.rb#L328-L331 | train | Updates a face list. | [
30522,
13366,
10651,
1006,
2227,
1035,
2862,
1035,
8909,
1010,
2171,
1024,
9152,
2140,
1010,
5310,
1035,
2951,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
2004,
6038,
2278,
1006,
2227,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kmuto/review | lib/epubmaker/epubv3.rb | EPUBMaker.EPUBv3.opf | def opf
@opf_metainfo = opf_metainfo
@opf_coverimage = opf_coverimage
@opf_manifest = opf_manifest
@opf_toc = opf_tocx
@package_attrs = ''
if @opf_prefix && @opf_prefix.size > 0
prefixes_str = @opf_prefix.map { |k, v| %Q(#{k}: #{v}) }.join(' ')
@package_attrs << %Q( prefix="#{prefixes_str}")
end
tmplfile = File.expand_path('./opf/epubv3.opf.erb', ReVIEW::Template::TEMPLATE_DIR)
ReVIEW::Template.load(tmplfile).result(binding)
end | ruby | def opf
@opf_metainfo = opf_metainfo
@opf_coverimage = opf_coverimage
@opf_manifest = opf_manifest
@opf_toc = opf_tocx
@package_attrs = ''
if @opf_prefix && @opf_prefix.size > 0
prefixes_str = @opf_prefix.map { |k, v| %Q(#{k}: #{v}) }.join(' ')
@package_attrs << %Q( prefix="#{prefixes_str}")
end
tmplfile = File.expand_path('./opf/epubv3.opf.erb', ReVIEW::Template::TEMPLATE_DIR)
ReVIEW::Template.load(tmplfile).result(binding)
end | [
"def",
"opf",
"@opf_metainfo",
"=",
"opf_metainfo",
"@opf_coverimage",
"=",
"opf_coverimage",
"@opf_manifest",
"=",
"opf_manifest",
"@opf_toc",
"=",
"opf_tocx",
"@package_attrs",
"=",
"''",
"if",
"@opf_prefix",
"&&",
"@opf_prefix",
".",
"size",
">",
"0",
"prefixes_s... | Construct object with parameter hash +config+ and message resource hash +res+.
Return opf file content. | [
"Construct",
"object",
"with",
"parameter",
"hash",
"+",
"config",
"+",
"and",
"message",
"resource",
"hash",
"+",
"res",
"+",
".",
"Return",
"opf",
"file",
"content",
"."
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/epubv3.rb#L27-L41 | train | Get the OIDC object for the OPF file. | [
30522,
13366,
6728,
2546,
1030,
6728,
2546,
1035,
18804,
2378,
14876,
1027,
6728,
2546,
1035,
18804,
2378,
14876,
1030,
6728,
2546,
1035,
3104,
9581,
3351,
1027,
6728,
2546,
1035,
3104,
9581,
3351,
1030,
6728,
2546,
1035,
19676,
1027,
6728,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/diagnostic.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Diagnostic.get_with_http_info | def get_with_http_info(resource_group_name, service_name, diagnostic_id, custom_headers:nil)
get_async(resource_group_name, service_name, diagnostic_id, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, service_name, diagnostic_id, custom_headers:nil)
get_async(resource_group_name, service_name, diagnostic_id, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"diagnostic_id",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"diagnostic_id",
",",
"custom_headers",
":custom_headers",
")",... | Gets the details of the Diagnostic specified by its identifier.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param diagnostic_id [String] Diagnostic identifier. Must be unique in the
current API 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. | [
"Gets",
"the",
"details",
"of",
"the",
"Diagnostic",
"specified",
"by",
"its",
"identifier",
"."
] | 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/diagnostic.rb#L265-L267 | train | Gets the diagnostic specification. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
16474,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
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... |
randym/axlsx | lib/axlsx/workbook/defined_names.rb | Axlsx.DefinedNames.to_xml_string | def to_xml_string(str = '')
return if empty?
str << '<definedNames>'
each { |defined_name| defined_name.to_xml_string(str) }
str << '</definedNames>'
end | ruby | def to_xml_string(str = '')
return if empty?
str << '<definedNames>'
each { |defined_name| defined_name.to_xml_string(str) }
str << '</definedNames>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"return",
"if",
"empty?",
"str",
"<<",
"'<definedNames>'",
"each",
"{",
"|",
"defined_name",
"|",
"defined_name",
".",
"to_xml_string",
"(",
"str",
")",
"}",
"str",
"<<",
"'</definedNames>'",
"end"
] | creates the DefinedNames object
Serialize to xml
@param [String] str
@return [String] | [
"creates",
"the",
"DefinedNames",
"object",
"Serialize",
"to",
"xml"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/defined_names.rb#L13-L18 | train | Convert the defined names 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,
4225,
18442,
2015,
1028,
1005,
2169,
1063,
1064,
4225,
1035,
2171,
1064,
4225,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
AaronLasseigne/active_interaction | lib/active_interaction/concerns/runnable.rb | ActiveInteraction.Runnable.compose | def compose(other, *args)
outcome = other.run(*args)
raise Interrupt, outcome.errors if outcome.invalid?
outcome.result
end | ruby | def compose(other, *args)
outcome = other.run(*args)
raise Interrupt, outcome.errors if outcome.invalid?
outcome.result
end | [
"def",
"compose",
"(",
"other",
",",
"*",
"args",
")",
"outcome",
"=",
"other",
".",
"run",
"(",
"args",
")",
"raise",
"Interrupt",
",",
"outcome",
".",
"errors",
"if",
"outcome",
".",
"invalid?",
"outcome",
".",
"result",
"end"
] | @param other [Class] The other interaction.
@param (see ClassMethods.run)
@return (see #result)
@raise [Interrupt] | [
"@param",
"other",
"[",
"Class",
"]",
"The",
"other",
"interaction",
".",
"@param",
"(",
"see",
"ClassMethods",
".",
"run",
")"
] | fdc00a041e939ef48948baa2f7fd1ce2e4d66982 | https://github.com/AaronLasseigne/active_interaction/blob/fdc00a041e939ef48948baa2f7fd1ce2e4d66982/lib/active_interaction/concerns/runnable.rb#L64-L70 | train | compose the two sequences of the same size. | [
30522,
13366,
17202,
1006,
2060,
1010,
1008,
12098,
5620,
1007,
9560,
1027,
2060,
1012,
2448,
1006,
1008,
12098,
5620,
1007,
5333,
17938,
1010,
9560,
1012,
10697,
2065,
9560,
1012,
19528,
1029,
9560,
1012,
2765,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
etewiah/property_web_builder | app/controllers/pwb/api_ext/v1/props_controller.rb | Pwb.ApiExt::V1::PropsController.cors_preflight_check | def cors_preflight_check
if request.method == :options
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'
headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'
headers['Access-Control-Max-Age'] = '1728000'
render text: '', content_type: 'text/plain'
end
end | ruby | def cors_preflight_check
if request.method == :options
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'
headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'
headers['Access-Control-Max-Age'] = '1728000'
render text: '', content_type: 'text/plain'
end
end | [
"def",
"cors_preflight_check",
"if",
"request",
".",
"method",
"==",
":options",
"headers",
"[",
"'Access-Control-Allow-Origin'",
"]",
"=",
"'*'",
"headers",
"[",
"'Access-Control-Allow-Methods'",
"]",
"=",
"'POST, GET, OPTIONS'",
"headers",
"[",
"'Access-Control-Allow-He... | If this is a preflight OPTIONS request, then short-circuit the
request, return only the necessary headers and return an empty
text/plain. | [
"If",
"this",
"is",
"a",
"preflight",
"OPTIONS",
"request",
"then",
"short",
"-",
"circuit",
"the",
"request",
"return",
"only",
"the",
"necessary",
"headers",
"and",
"return",
"an",
"empty",
"text",
"/",
"plain",
"."
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/controllers/pwb/api_ext/v1/props_controller.rb#L31-L39 | train | Check if the request is preflight | [
30522,
13366,
2522,
2869,
1035,
3653,
28968,
1035,
4638,
2065,
5227,
1012,
4118,
1027,
1027,
1024,
7047,
20346,
2015,
1031,
1005,
3229,
1011,
2491,
1011,
3499,
1011,
4761,
1005,
1033,
1027,
1005,
1008,
1005,
20346,
2015,
1031,
1005,
3229,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/client/pull_requests/reviews.rb | Github.Client::PullRequests::Reviews.update | def update(*args)
arguments(args, required: [:user, :repo, :number, :id])
params = arguments.params
params["accept"] ||= PREVIEW_MEDIA
post_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/reviews/#{arguments.id}/events", params)
end | ruby | def update(*args)
arguments(args, required: [:user, :repo, :number, :id])
params = arguments.params
params["accept"] ||= PREVIEW_MEDIA
post_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/reviews/#{arguments.id}/events", params)
end | [
"def",
"update",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
",",
":number",
",",
":id",
"]",
")",
"params",
"=",
"arguments",
".",
"params",
"params",
"[",
"\"accept\"",
"]",
"||=",
"PREVIEW_MEDIA... | Update a pull request review
@param [Hash] params
@option params [String] :state
Required string - The review action (event) to perform; can be one of
APPROVE, REQUEST_CHANGES, or COMMENT. If left blank, the API returns
HTTP 422 (Unrecognizable entity) and the review is left PENDING
@optoin params [String] :body
Optional string
@example
github = Github.new oauth_token: '...'
github.pull_requests.reviews.update 'user-name', 'repo-name', 'number', 'review-id'
body: "Update body",
event: "APPROVE"
@api public | [
"Update",
"a",
"pull",
"request",
"review"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/pull_requests/reviews.rb#L112-L119 | train | Update a review | [
30522,
13366,
10651,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1010,
1024,
2193,
1010,
1024,
8909,
1033,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
11498,
524... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | credentials_manager/lib/credentials_manager/account_manager.rb | CredentialsManager.AccountManager.options | def options
hash = {}
hash[:p] = ENV["FASTLANE_PATH"] if ENV["FASTLANE_PATH"]
hash[:P] = ENV["FASTLANE_PORT"] if ENV["FASTLANE_PORT"]
hash[:r] = ENV["FASTLANE_PROTOCOL"] if ENV["FASTLANE_PROTOCOL"]
hash.empty? ? nil : hash
end | ruby | def options
hash = {}
hash[:p] = ENV["FASTLANE_PATH"] if ENV["FASTLANE_PATH"]
hash[:P] = ENV["FASTLANE_PORT"] if ENV["FASTLANE_PORT"]
hash[:r] = ENV["FASTLANE_PROTOCOL"] if ENV["FASTLANE_PROTOCOL"]
hash.empty? ? nil : hash
end | [
"def",
"options",
"hash",
"=",
"{",
"}",
"hash",
"[",
":p",
"]",
"=",
"ENV",
"[",
"\"FASTLANE_PATH\"",
"]",
"if",
"ENV",
"[",
"\"FASTLANE_PATH\"",
"]",
"hash",
"[",
":P",
"]",
"=",
"ENV",
"[",
"\"FASTLANE_PORT\"",
"]",
"if",
"ENV",
"[",
"\"FASTLANE_POR... | Use env variables from this method to augment internet password item with additional data.
These variables are used by Xamarin Studio to authenticate Apple developers. | [
"Use",
"env",
"variables",
"from",
"this",
"method",
"to",
"augment",
"internet",
"password",
"item",
"with",
"additional",
"data",
".",
"These",
"variables",
"are",
"used",
"by",
"Xamarin",
"Studio",
"to",
"authenticate",
"Apple",
"developers",
"."
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/credentials_manager/lib/credentials_manager/account_manager.rb#L100-L106 | train | Returns the hash of the options for the current object. | [
30522,
13366,
7047,
23325,
1027,
1063,
1065,
23325,
1031,
1024,
1052,
1033,
1027,
4372,
2615,
1031,
1000,
3435,
20644,
1035,
4130,
1000,
1033,
2065,
4372,
2615,
1031,
1000,
3435,
20644,
1035,
4130,
1000,
1033,
23325,
1031,
1024,
1052,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Katello/katello | app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb | Katello.Api::Rhsm::CandlepinProxiesController.facts | def facts
User.current = User.anonymous_admin
async_task(::Actions::Katello::Host::Update, @host, rhsm_params)
update_host_registered_through(@host, request.headers)
render :json => {:content => _("Facts successfully updated.")}, :status => :ok
end | ruby | def facts
User.current = User.anonymous_admin
async_task(::Actions::Katello::Host::Update, @host, rhsm_params)
update_host_registered_through(@host, request.headers)
render :json => {:content => _("Facts successfully updated.")}, :status => :ok
end | [
"def",
"facts",
"User",
".",
"current",
"=",
"User",
".",
"anonymous_admin",
"async_task",
"(",
"::",
"Actions",
"::",
"Katello",
"::",
"Host",
"::",
"Update",
",",
"@host",
",",
"rhsm_params",
")",
"update_host_registered_through",
"(",
"@host",
",",
"request... | api :PUT, "/consumers/:id", N_("Update consumer information") | [
"api",
":",
"PUT",
"/",
"consumers",
"/",
":",
"id",
"N_",
"(",
"Update",
"consumer",
"information",
")"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb#L256-L261 | train | Updates the facts of the host. | [
30522,
13366,
8866,
5310,
1012,
2783,
1027,
5310,
1012,
10812,
1035,
4748,
10020,
2004,
6038,
2278,
1035,
4708,
1006,
1024,
1024,
4506,
1024,
1024,
5736,
7174,
1024,
1024,
3677,
1024,
1024,
10651,
1010,
1030,
3677,
1010,
1054,
7898,
2213,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/lib/ms_rest/retry_policy_middleware.rb | MsRest.RetryPolicyMiddleware.call | def call(request_env)
request_body = request_env[:body]
begin
request_env[:body] = request_body
@app.call(request_env).on_complete do |response_env|
status_code = response_env.status
if @times > 0 && (status_code == 408 || (status_code >= 500 && status_code != 501 && status_code != 505))
sleep @delay
fail 'faraday_retry'
end
end
rescue Exception => e
raise e if e.message != 'faraday_retry'
@times = @times - 1
retry
end
end | ruby | def call(request_env)
request_body = request_env[:body]
begin
request_env[:body] = request_body
@app.call(request_env).on_complete do |response_env|
status_code = response_env.status
if @times > 0 && (status_code == 408 || (status_code >= 500 && status_code != 501 && status_code != 505))
sleep @delay
fail 'faraday_retry'
end
end
rescue Exception => e
raise e if e.message != 'faraday_retry'
@times = @times - 1
retry
end
end | [
"def",
"call",
"(",
"request_env",
")",
"request_body",
"=",
"request_env",
"[",
":body",
"]",
"begin",
"request_env",
"[",
":body",
"]",
"=",
"request_body",
"@app",
".",
"call",
"(",
"request_env",
")",
".",
"on_complete",
"do",
"|",
"response_env",
"|",
... | Initializes a new instance of the RetryPolicyMiddleware class.
Performs request and response processing. | [
"Initializes",
"a",
"new",
"instance",
"of",
"the",
"RetryPolicyMiddleware",
"class",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/runtime/ms_rest/lib/ms_rest/retry_policy_middleware.rb#L23-L42 | train | Call the app | [
30522,
13366,
2655,
1006,
5227,
1035,
4372,
2615,
1007,
5227,
1035,
2303,
1027,
5227,
1035,
4372,
2615,
1031,
1024,
2303,
1033,
4088,
5227,
1035,
4372,
2615,
1031,
1024,
2303,
1033,
1027,
5227,
1035,
2303,
1030,
10439,
1012,
2655,
1006,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-10-01/generated/azure_mgmt_network/packet_captures.rb | Azure::Network::Mgmt::V2018_10_01.PacketCaptures.begin_create_with_http_info | def begin_create_with_http_info(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers:nil)
begin_create_async(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_with_http_info(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers:nil)
begin_create_async(resource_group_name, network_watcher_name, packet_capture_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_with_http_info",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"packet_capture_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"packet_... | Create and start a packet capture on the specified VM.
@param resource_group_name [String] The name of the resource group.
@param network_watcher_name [String] The name of the network watcher.
@param packet_capture_name [String] The name of the packet capture session.
@param parameters [PacketCapture] Parameters that define the create packet
capture operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Create",
"and",
"start",
"a",
"packet",
"capture",
"on",
"the",
"specified",
"VM",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/packet_captures.rb#L422-L424 | train | Creates a packet capture. | [
30522,
13366,
4088,
1035,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
14771,
1035,
5425,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
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... |
chef/chef-zero | lib/chef_zero/server.rb | ChefZero.Server.start | def start(publish = true)
publish = publish[:publish] if publish.is_a?(Hash) # Legacy API
if publish
output = publish.respond_to?(:puts) ? publish : STDOUT
output.puts <<-EOH.gsub(/^ {10}/, "")
>> Starting Chef Zero (v#{ChefZero::VERSION})...
EOH
end
thread = start_background
if publish
output = publish.respond_to?(:puts) ? publish : STDOUT
output.puts <<-EOH.gsub(/^ {10}/, "")
>> WEBrick (v#{WEBrick::VERSION}) on Rack (v#{Rack.release}) is listening at #{url}
>> Press CTRL+C to stop
EOH
end
%w{INT TERM}.each do |signal|
Signal.trap(signal) do
puts "\n>> Stopping Chef Zero..."
@server.shutdown
end
end
# Move the background process to the main thread
thread.join
end | ruby | def start(publish = true)
publish = publish[:publish] if publish.is_a?(Hash) # Legacy API
if publish
output = publish.respond_to?(:puts) ? publish : STDOUT
output.puts <<-EOH.gsub(/^ {10}/, "")
>> Starting Chef Zero (v#{ChefZero::VERSION})...
EOH
end
thread = start_background
if publish
output = publish.respond_to?(:puts) ? publish : STDOUT
output.puts <<-EOH.gsub(/^ {10}/, "")
>> WEBrick (v#{WEBrick::VERSION}) on Rack (v#{Rack.release}) is listening at #{url}
>> Press CTRL+C to stop
EOH
end
%w{INT TERM}.each do |signal|
Signal.trap(signal) do
puts "\n>> Stopping Chef Zero..."
@server.shutdown
end
end
# Move the background process to the main thread
thread.join
end | [
"def",
"start",
"(",
"publish",
"=",
"true",
")",
"publish",
"=",
"publish",
"[",
":publish",
"]",
"if",
"publish",
".",
"is_a?",
"(",
"Hash",
")",
"# Legacy API",
"if",
"publish",
"output",
"=",
"publish",
".",
"respond_to?",
"(",
":puts",
")",
"?",
"... | Start a Chef Zero server in the current thread. You can stop this server
by canceling the current thread.
@param [Boolean|IO] publish
publish the server information to the publish parameter or to STDOUT if it's "true"
@return [nil]
this method will block the main thread until interrupted | [
"Start",
"a",
"Chef",
"Zero",
"server",
"in",
"the",
"current",
"thread",
".",
"You",
"can",
"stop",
"this",
"server",
"by",
"canceling",
"the",
"current",
"thread",
"."
] | 5873d906942770a34f0cf0fed05973ec3240a275 | https://github.com/chef/chef-zero/blob/5873d906942770a34f0cf0fed05973ec3240a275/lib/chef_zero/server.rb#L228-L258 | train | Start the Chef Zero server | [
30522,
13366,
2707,
1006,
10172,
1027,
2995,
1007,
10172,
1027,
10172,
1031,
1024,
10172,
1033,
2065,
10172,
1012,
2003,
1035,
1037,
1029,
30524,
1026,
1026,
1011,
1041,
11631,
1012,
28177,
12083,
1006,
1013,
1034,
1063,
2184,
1065,
1013,
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.update_entity | def update_entity(app_id, version_id, entity_id, model_update_object, custom_headers:nil)
response = update_entity_async(app_id, version_id, entity_id, model_update_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_entity(app_id, version_id, entity_id, model_update_object, custom_headers:nil)
response = update_entity_async(app_id, version_id, entity_id, model_update_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_entity",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"model_update_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_entity_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"model_update_object",
... | Updates the name of an entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity extractor ID.
@param model_update_object [ModelUpdateObject] A model object containing the
new entity extractor name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatus] operation results. | [
"Updates",
"the",
"name",
"of",
"an",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L2229-L2232 | train | Updates an entity in a version of the application. | [
30522,
13366,
10651,
1035,
9178,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2944,
1035,
10651,
1035,
4874,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
9178,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb | Azure::MixedReality::Mgmt::V2019_02_28_preview.SpatialAnchorsAccounts.create | def create(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
response = create_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
response = create_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create",
"(",
"resource_group_name",
",",
"spatial_anchors_account_name",
",",
"spatial_anchors_account",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_async",
"(",
"resource_group_name",
",",
"spatial_anchors_account_name",
",",
"spatial_anchors_... | Creating or Updating a Spatial Anchors Account.
@param resource_group_name [String] Name of an Azure resource group.
@param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
Anchors Account.
@param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors
Account parameter.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SpatialAnchorsAccount] operation results. | [
"Creating",
"or",
"Updating",
"a",
"Spatial",
"Anchors",
"Account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb#L518-L521 | train | Creates a new HDInsight spatial anchors account. | [
30522,
13366,
3443,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
13589,
1035,
24674,
1035,
4070,
1035,
2171,
1010,
13589,
1035,
24674,
1035,
4070,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
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... |
puppetlabs/puppet | lib/puppet/network/http/connection.rb | Puppet::Network::HTTP.Connection.handle_retry_after | def handle_retry_after(response)
retry_after = response['Retry-After']
return response if retry_after.nil?
retry_sleep = parse_retry_after_header(retry_after)
# Recover remote hostname if Net::HTTPResponse was generated by a
# method that fills in the uri attribute.
#
server_hostname = if response.uri.is_a?(URI)
response.uri.host
else
# TRANSLATORS: Used in the phrase:
# "Received a response from the remote server."
_('the remote server')
end
if retry_sleep.nil?
Puppet.err(_('Received a %{status_code} response from %{server_hostname}, but the Retry-After header value of "%{retry_after}" could not be converted to an integer or RFC 2822 date.') %
{status_code: response.code,
server_hostname: server_hostname,
retry_after: retry_after.inspect})
return response
end
# Cap maximum sleep at the run interval of the Puppet agent.
retry_sleep = [retry_sleep, Puppet[:runinterval]].min
Puppet.warning(_('Received a %{status_code} response from %{server_hostname}. Sleeping for %{retry_sleep} seconds before retrying the request.') %
{status_code: response.code,
server_hostname: server_hostname,
retry_sleep: retry_sleep})
::Kernel.sleep(retry_sleep)
return nil
end | ruby | def handle_retry_after(response)
retry_after = response['Retry-After']
return response if retry_after.nil?
retry_sleep = parse_retry_after_header(retry_after)
# Recover remote hostname if Net::HTTPResponse was generated by a
# method that fills in the uri attribute.
#
server_hostname = if response.uri.is_a?(URI)
response.uri.host
else
# TRANSLATORS: Used in the phrase:
# "Received a response from the remote server."
_('the remote server')
end
if retry_sleep.nil?
Puppet.err(_('Received a %{status_code} response from %{server_hostname}, but the Retry-After header value of "%{retry_after}" could not be converted to an integer or RFC 2822 date.') %
{status_code: response.code,
server_hostname: server_hostname,
retry_after: retry_after.inspect})
return response
end
# Cap maximum sleep at the run interval of the Puppet agent.
retry_sleep = [retry_sleep, Puppet[:runinterval]].min
Puppet.warning(_('Received a %{status_code} response from %{server_hostname}. Sleeping for %{retry_sleep} seconds before retrying the request.') %
{status_code: response.code,
server_hostname: server_hostname,
retry_sleep: retry_sleep})
::Kernel.sleep(retry_sleep)
return nil
end | [
"def",
"handle_retry_after",
"(",
"response",
")",
"retry_after",
"=",
"response",
"[",
"'Retry-After'",
"]",
"return",
"response",
"if",
"retry_after",
".",
"nil?",
"retry_sleep",
"=",
"parse_retry_after_header",
"(",
"retry_after",
")",
"# Recover remote hostname if N... | Handles the Retry-After header of a HTTPResponse
This method checks the response for a Retry-After header and handles
it by sleeping for the indicated number of seconds. The response is
returned unmodified if no Retry-After header is present.
@param response [Net::HTTPResponse] A response received from the
HTTP client.
@return [nil] Sleeps and returns nil if the response contained a
Retry-After header that indicated the request should be retried.
@return [Net::HTTPResponse] Returns the `response` unmodified if
no Retry-After header was present or the Retry-After header could
not be parsed as an integer or RFC 2822 date. | [
"Handles",
"the",
"Retry",
"-",
"After",
"header",
"of",
"a",
"HTTPResponse"
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/network/http/connection.rb#L242-L278 | train | Handle the Retry - After header | [
30522,
13366,
5047,
1035,
2128,
11129,
1035,
2044,
1006,
3433,
1007,
2128,
11129,
1035,
2044,
1027,
3433,
1031,
1005,
2128,
11129,
1011,
2044,
1005,
1033,
2709,
3433,
2065,
2128,
11129,
1035,
2044,
1012,
9152,
2140,
1029,
2128,
11129,
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... |
sporkmonger/addressable | lib/addressable/uri.rb | Addressable.URI.hostname= | def hostname=(new_hostname)
if new_hostname &&
(new_hostname.respond_to?(:ipv4?) || new_hostname.respond_to?(:ipv6?))
new_hostname = new_hostname.to_s
elsif new_hostname && !new_hostname.respond_to?(:to_str)
raise TypeError, "Can't convert #{new_hostname.class} into String."
end
v = new_hostname ? new_hostname.to_str : nil
v = "[#{v}]" if /\A\[.*\]\z/ !~ v && /:/ =~ v
self.host = v
end | ruby | def hostname=(new_hostname)
if new_hostname &&
(new_hostname.respond_to?(:ipv4?) || new_hostname.respond_to?(:ipv6?))
new_hostname = new_hostname.to_s
elsif new_hostname && !new_hostname.respond_to?(:to_str)
raise TypeError, "Can't convert #{new_hostname.class} into String."
end
v = new_hostname ? new_hostname.to_str : nil
v = "[#{v}]" if /\A\[.*\]\z/ !~ v && /:/ =~ v
self.host = v
end | [
"def",
"hostname",
"=",
"(",
"new_hostname",
")",
"if",
"new_hostname",
"&&",
"(",
"new_hostname",
".",
"respond_to?",
"(",
":ipv4?",
")",
"||",
"new_hostname",
".",
"respond_to?",
"(",
":ipv6?",
")",
")",
"new_hostname",
"=",
"new_hostname",
".",
"to_s",
"e... | This method is same as URI::Generic#host= except
the argument can be a bare IPv6 address (or 'IPvFuture').
@see Addressable::URI#host=
@param [String, #to_str] new_hostname The new hostname for this URI. | [
"This",
"method",
"is",
"same",
"as",
"URI",
"::",
"Generic#host",
"=",
"except",
"the",
"argument",
"can",
"be",
"a",
"bare",
"IPv6",
"address",
"(",
"or",
"IPvFuture",
")",
"."
] | 5894c95a7768435cb46d1355954611dbd194832e | https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/uri.rb#L1159-L1169 | train | Sets the hostname of the connection. | [
30522,
13366,
3677,
18442,
1027,
1006,
2047,
1035,
3677,
18442,
1007,
2065,
2047,
1035,
3677,
18442,
1004,
1004,
1006,
2047,
1035,
3677,
18442,
30524,
2047,
1035,
3677,
18442,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
12997,
2615,
2575,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/table.rb | Axlsx.Table.to_xml_string | def to_xml_string(str = '')
str << '<?xml version="1.0" encoding="UTF-8"?>'
str << ('<table xmlns="' << XML_NS << '" id="' << (index+1).to_s << '" name="' << @name << '" displayName="' << @name.gsub(/\s/,'_') << '" ')
str << ('ref="' << @ref << '" totalsRowShown="0">')
str << ('<autoFilter ref="' << @ref << '"/>')
str << ('<tableColumns count="' << header_cells.length.to_s << '">')
header_cells.each_with_index do |cell,index|
str << ('<tableColumn id ="' << (index+1).to_s << '" name="' << cell.value << '"/>')
end
str << '</tableColumns>'
table_style_info.to_xml_string(str)
str << '</table>'
end | ruby | def to_xml_string(str = '')
str << '<?xml version="1.0" encoding="UTF-8"?>'
str << ('<table xmlns="' << XML_NS << '" id="' << (index+1).to_s << '" name="' << @name << '" displayName="' << @name.gsub(/\s/,'_') << '" ')
str << ('ref="' << @ref << '" totalsRowShown="0">')
str << ('<autoFilter ref="' << @ref << '"/>')
str << ('<tableColumns count="' << header_cells.length.to_s << '">')
header_cells.each_with_index do |cell,index|
str << ('<tableColumn id ="' << (index+1).to_s << '" name="' << cell.value << '"/>')
end
str << '</tableColumns>'
table_style_info.to_xml_string(str)
str << '</table>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"str",
"<<",
"'<?xml version=\"1.0\" encoding=\"UTF-8\"?>'",
"str",
"<<",
"(",
"'<table xmlns=\"'",
"<<",
"XML_NS",
"<<",
"'\" id=\"'",
"<<",
"(",
"index",
"+",
"1",
")",
".",
"to_s",
"<<",
"'\" name=\"'",
"<... | Serializes the object
@param [String] str
@return [String] | [
"Serializes",
"the",
"object"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/table.rb#L76-L88 | train | Returns the XML string for this table. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
2358,
2099,
1026,
1026,
1005,
1026,
1029,
20950,
2544,
1027,
1000,
1015,
1012,
1014,
1000,
17181,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1029,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/inflector/methods.rb | ActiveSupport.Inflector.camelize | def camelize(term, uppercase_first_letter = true)
string = term.to_s
if uppercase_first_letter
string = string.sub(/^[a-z\d]*/) { |match| inflections.acronyms[match] || match.capitalize }
else
string = string.sub(inflections.acronyms_camelize_regex) { |match| match.downcase }
end
string.gsub!(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{inflections.acronyms[$2] || $2.capitalize}" }
string.gsub!("/", "::")
string
end | ruby | def camelize(term, uppercase_first_letter = true)
string = term.to_s
if uppercase_first_letter
string = string.sub(/^[a-z\d]*/) { |match| inflections.acronyms[match] || match.capitalize }
else
string = string.sub(inflections.acronyms_camelize_regex) { |match| match.downcase }
end
string.gsub!(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{inflections.acronyms[$2] || $2.capitalize}" }
string.gsub!("/", "::")
string
end | [
"def",
"camelize",
"(",
"term",
",",
"uppercase_first_letter",
"=",
"true",
")",
"string",
"=",
"term",
".",
"to_s",
"if",
"uppercase_first_letter",
"string",
"=",
"string",
".",
"sub",
"(",
"/",
"\\d",
"/",
")",
"{",
"|",
"match",
"|",
"inflections",
".... | Converts strings to UpperCamelCase.
If the +uppercase_first_letter+ parameter is set to false, then produces
lowerCamelCase.
Also converts '/' to '::' which is useful for converting
paths to namespaces.
camelize('active_model') # => "ActiveModel"
camelize('active_model', false) # => "activeModel"
camelize('active_model/errors') # => "ActiveModel::Errors"
camelize('active_model/errors', false) # => "activeModel::Errors"
As a rule of thumb you can think of +camelize+ as the inverse of
#underscore, though there are cases where that does not hold:
camelize(underscore('SSLError')) # => "SslError" | [
"Converts",
"strings",
"to",
"UpperCamelCase",
".",
"If",
"the",
"+",
"uppercase_first_letter",
"+",
"parameter",
"is",
"set",
"to",
"false",
"then",
"produces",
"lowerCamelCase",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/inflector/methods.rb#L68-L78 | train | CamelCase a term | [
30522,
13366,
19130,
4697,
1006,
2744,
1010,
3356,
18382,
1035,
2034,
1035,
3661,
1027,
2995,
1007,
5164,
1027,
2744,
1012,
2000,
1035,
1055,
2065,
3356,
18382,
1035,
2034,
1035,
3661,
5164,
1027,
5164,
1012,
4942,
1006,
1013,
1034,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.get_site_detector_with_http_info | def get_site_detector_with_http_info(resource_group_name, site_name, diagnostic_category, detector_name, custom_headers:nil)
get_site_detector_async(resource_group_name, site_name, diagnostic_category, detector_name, custom_headers:custom_headers).value!
end | ruby | def get_site_detector_with_http_info(resource_group_name, site_name, diagnostic_category, detector_name, custom_headers:nil)
get_site_detector_async(resource_group_name, site_name, diagnostic_category, detector_name, custom_headers:custom_headers).value!
end | [
"def",
"get_site_detector_with_http_info",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_category",
",",
"detector_name",
",",
"custom_headers",
":",
"nil",
")",
"get_site_detector_async",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_categ... | Get Detector
Get Detector
@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 detector_name [String] Detector 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",
"Detector"
] | 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#L1165-L1167 | train | Gets the detected product of the site. | [
30522,
13366,
2131,
1035,
2609,
1035,
19034,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
19034,
1035,
2171,
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... |
grodowski/undercover | lib/undercover/lcov_parser.rb | Undercover.LcovParser.parse_line | def parse_line(line)
case line
when /^SF:([\.\/\w]+)/
@current_filename = $~[1].gsub(/^\.\//, '')
source_files[@current_filename] = []
when /^DA:(\d+),(\d+)/
line_no = $~[1]
covered = $~[2]
source_files[@current_filename] << [line_no.to_i, covered.to_i]
when /^end_of_record$/, /^$/
@current_filename = nil
else
raise LcovParseError, "could not recognise '#{line}' as valid LCOV"
end
end | ruby | def parse_line(line)
case line
when /^SF:([\.\/\w]+)/
@current_filename = $~[1].gsub(/^\.\//, '')
source_files[@current_filename] = []
when /^DA:(\d+),(\d+)/
line_no = $~[1]
covered = $~[2]
source_files[@current_filename] << [line_no.to_i, covered.to_i]
when /^end_of_record$/, /^$/
@current_filename = nil
else
raise LcovParseError, "could not recognise '#{line}' as valid LCOV"
end
end | [
"def",
"parse_line",
"(",
"line",
")",
"case",
"line",
"when",
"/",
"\\.",
"\\/",
"\\w",
"/",
"@current_filename",
"=",
"$~",
"[",
"1",
"]",
".",
"gsub",
"(",
"/",
"\\.",
"\\/",
"/",
",",
"''",
")",
"source_files",
"[",
"@current_filename",
"]",
"=",... | rubocop:disable Metrics/MethodLength, Style/SpecialGlobalVars | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"MethodLength",
"Style",
"/",
"SpecialGlobalVars"
] | 8f9cb32094d1669d67ff957337f95243c4d15ff2 | https://github.com/grodowski/undercover/blob/8f9cb32094d1669d67ff957337f95243c4d15ff2/lib/undercover/lcov_parser.rb#L28-L42 | train | Parse a line of LCOV | [
30522,
13366,
11968,
3366,
1035,
2240,
1006,
2240,
1007,
2553,
2240,
2043,
1013,
1034,
16420,
1024,
1006,
1031,
1032,
1012,
1032,
1013,
1032,
1059,
1033,
1009,
1007,
1013,
1030,
2783,
1035,
5371,
18442,
1027,
1002,
1066,
1031,
1015,
1033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
comfy/comfortable-mexican-sofa | lib/comfortable_mexican_sofa/seeds/page/importer.rb | ComfortableMexicanSofa::Seeds::Page.Importer.files_content | def files_content(record, identifier, path, frag_content)
# preparing attachments
files = frag_content.split("\n").collect do |filename|
file_handler = File.open(File.join(path, filename))
{
io: file_handler,
filename: filename,
content_type: MimeMagic.by_magic(file_handler)
}
end
# ensuring that old attachments get removed
ids_destroy = []
if (frag = record.fragments.find_by(identifier: identifier))
ids_destroy = frag.attachments.pluck(:id)
end
[files, ids_destroy]
end | ruby | def files_content(record, identifier, path, frag_content)
# preparing attachments
files = frag_content.split("\n").collect do |filename|
file_handler = File.open(File.join(path, filename))
{
io: file_handler,
filename: filename,
content_type: MimeMagic.by_magic(file_handler)
}
end
# ensuring that old attachments get removed
ids_destroy = []
if (frag = record.fragments.find_by(identifier: identifier))
ids_destroy = frag.attachments.pluck(:id)
end
[files, ids_destroy]
end | [
"def",
"files_content",
"(",
"record",
",",
"identifier",
",",
"path",
",",
"frag_content",
")",
"# preparing attachments",
"files",
"=",
"frag_content",
".",
"split",
"(",
"\"\\n\"",
")",
".",
"collect",
"do",
"|",
"filename",
"|",
"file_handler",
"=",
"File"... | Preparing fragment attachments. Returns hashes with file data for
ActiveStorage and a list of ids of old attachements to destroy | [
"Preparing",
"fragment",
"attachments",
".",
"Returns",
"hashes",
"with",
"file",
"data",
"for",
"ActiveStorage",
"and",
"a",
"list",
"of",
"ids",
"of",
"old",
"attachements",
"to",
"destroy"
] | 38a31428f6e2c07d5bda64f0371eebfb29a3abc4 | https://github.com/comfy/comfortable-mexican-sofa/blob/38a31428f6e2c07d5bda64f0371eebfb29a3abc4/lib/comfortable_mexican_sofa/seeds/page/importer.rb#L188-L206 | train | Returns the array of the files that are attached to the record | [
30522,
13366,
6764,
1035,
30524,
2015,
6764,
1027,
25312,
2290,
1035,
4180,
1012,
3975,
1006,
1000,
1032,
1050,
1000,
1007,
1012,
8145,
2079,
1064,
5371,
18442,
1064,
5371,
1035,
28213,
1027,
5371,
1012,
2330,
1006,
5371,
1012,
3693,
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... |
lostisland/faraday | lib/faraday/request.rb | Faraday.Request.marshal_load | def marshal_load(serialised)
self.method = serialised[:method]
self.body = serialised[:body]
self.headers = serialised[:headers]
self.path = serialised[:path]
self.params = serialised[:params]
self.options = serialised[:options]
end | ruby | def marshal_load(serialised)
self.method = serialised[:method]
self.body = serialised[:body]
self.headers = serialised[:headers]
self.path = serialised[:path]
self.params = serialised[:params]
self.options = serialised[:options]
end | [
"def",
"marshal_load",
"(",
"serialised",
")",
"self",
".",
"method",
"=",
"serialised",
"[",
":method",
"]",
"self",
".",
"body",
"=",
"serialised",
"[",
":body",
"]",
"self",
".",
"headers",
"=",
"serialised",
"[",
":headers",
"]",
"self",
".",
"path",... | Marshal serialization support.
Restores the instance variables according to the +serialised+.
@param serialised [Hash] the serialised object. | [
"Marshal",
"serialization",
"support",
".",
"Restores",
"the",
"instance",
"variables",
"according",
"to",
"the",
"+",
"serialised",
"+",
"."
] | 3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70 | https://github.com/lostisland/faraday/blob/3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70/lib/faraday/request.rb#L131-L138 | train | Marshal the given object to the object. | [
30522,
13366,
8610,
1035,
7170,
1006,
7642,
5084,
1007,
2969,
1012,
4118,
1027,
7642,
5084,
1031,
1024,
4118,
1033,
2969,
1012,
2303,
1027,
7642,
5084,
1031,
1024,
2303,
1033,
2969,
1012,
20346,
2015,
1027,
7642,
5084,
1031,
1024,
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... |
jnunemaker/httparty | lib/httparty.rb | HTTParty.ClassMethods.move | def move(path, options = {}, &block)
perform_request Net::HTTP::Move, path, options, &block
end | ruby | def move(path, options = {}, &block)
perform_request Net::HTTP::Move, path, options, &block
end | [
"def",
"move",
"(",
"path",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"perform_request",
"Net",
"::",
"HTTP",
"::",
"Move",
",",
"path",
",",
"options",
",",
"block",
"end"
] | Perform a MOVE request to a path | [
"Perform",
"a",
"MOVE",
"request",
"to",
"a",
"path"
] | b4099defba01231d2faaaa2660476f867e096bfb | https://github.com/jnunemaker/httparty/blob/b4099defba01231d2faaaa2660476f867e096bfb/lib/httparty.rb#L542-L544 | train | Move a file to another location. | [
30522,
13366,
2693,
1006,
4130,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
4685,
1035,
5227,
5658,
1024,
1024,
8299,
1024,
1024,
2693,
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_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_recommended_actions.rb | Azure::SQL::Mgmt::V2015_05_01_preview.DatabaseRecommendedActions.list_by_database_advisor | def list_by_database_advisor(resource_group_name, server_name, database_name, advisor_name, custom_headers:nil)
response = list_by_database_advisor_async(resource_group_name, server_name, database_name, advisor_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_database_advisor(resource_group_name, server_name, database_name, advisor_name, custom_headers:nil)
response = list_by_database_advisor_async(resource_group_name, server_name, database_name, advisor_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_database_advisor",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"advisor_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_database_advisor_async",
"(",
"resource_group_name",
",",
"server_name",
",",
... | Gets list of Database Recommended Actions.
@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 database_name [String] The name of the database.
@param advisor_name [String] The name of the Database Advisor.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Gets",
"list",
"of",
"Database",
"Recommended",
"Actions",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/database_recommended_actions.rb#L41-L44 | train | Gets the list of all the available advisors in a database. | [
30522,
13366,
2862,
1035,
30524,
3433,
1027,
2862,
1035,
2011,
1035,
7809,
1035,
8619,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
8619,
1035,
2171,
1010,
7661,
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... |
apache/thrift | lib/rb/lib/thrift/protocol/compact_protocol.rb | Thrift.CompactProtocol.write_collection_begin | def write_collection_begin(elem_type, size)
if size <= 14
write_byte(size << 4 | CompactTypes.get_compact_type(elem_type))
else
write_byte(0xf0 | CompactTypes.get_compact_type(elem_type))
write_varint32(size)
end
end | ruby | def write_collection_begin(elem_type, size)
if size <= 14
write_byte(size << 4 | CompactTypes.get_compact_type(elem_type))
else
write_byte(0xf0 | CompactTypes.get_compact_type(elem_type))
write_varint32(size)
end
end | [
"def",
"write_collection_begin",
"(",
"elem_type",
",",
"size",
")",
"if",
"size",
"<=",
"14",
"write_byte",
"(",
"size",
"<<",
"4",
"|",
"CompactTypes",
".",
"get_compact_type",
"(",
"elem_type",
")",
")",
"else",
"write_byte",
"(",
"0xf0",
"|",
"CompactTyp... | Abstract method for writing the start of lists and sets. List and sets on
the wire differ only by the type indicator. | [
"Abstract",
"method",
"for",
"writing",
"the",
"start",
"of",
"lists",
"and",
"sets",
".",
"List",
"and",
"sets",
"on",
"the",
"wire",
"differ",
"only",
"by",
"the",
"type",
"indicator",
"."
] | 27d8387c49a49fcf193893f834e9766ae0b051c1 | https://github.com/apache/thrift/blob/27d8387c49a49fcf193893f834e9766ae0b051c1/lib/rb/lib/thrift/protocol/compact_protocol.rb#L359-L366 | train | Write the begin of a collection | [
30522,
30524,
2015,
1012,
2131,
1035,
9233,
1035,
2828,
1006,
3449,
6633,
1035,
2828,
1007,
1007,
2842,
4339,
1035,
24880,
1006,
1014,
2595,
2546,
2692,
1064,
9233,
13874,
2015,
1012,
2131,
1035,
9233,
1035,
2828,
1006,
3449,
6633,
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... |
ruby-git/ruby-git | lib/git/lib.rb | Git.Lib.log_path_options | def log_path_options(opts)
arr_opts = []
arr_opts << opts[:object] if opts[:object].is_a? String
arr_opts << '--' << opts[:path_limiter] if opts[:path_limiter]
arr_opts
end | ruby | def log_path_options(opts)
arr_opts = []
arr_opts << opts[:object] if opts[:object].is_a? String
arr_opts << '--' << opts[:path_limiter] if opts[:path_limiter]
arr_opts
end | [
"def",
"log_path_options",
"(",
"opts",
")",
"arr_opts",
"=",
"[",
"]",
"arr_opts",
"<<",
"opts",
"[",
":object",
"]",
"if",
"opts",
"[",
":object",
"]",
".",
"is_a?",
"String",
"arr_opts",
"<<",
"'--'",
"<<",
"opts",
"[",
":path_limiter",
"]",
"if",
"... | Retrurns an array holding path options for the log commands
@param [Hash] opts the given options
@return [Array] the set of path options that the log command will use | [
"Retrurns",
"an",
"array",
"holding",
"path",
"options",
"for",
"the",
"log",
"commands"
] | 9bd4407c56068e1604f14a1b6c0c5a84868e6378 | https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/lib.rb#L1034-L1040 | train | Log the path options for the given options | [
30522,
13366,
8833,
1035,
4130,
1035,
7047,
1006,
23569,
2015,
1007,
12098,
2099,
1035,
23569,
2015,
1027,
1031,
1033,
12098,
2099,
1035,
23569,
2015,
1026,
1026,
23569,
2015,
1031,
1024,
4874,
1033,
2065,
23569,
2015,
1031,
1024,
4874,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stream_analytics/lib/2016-03-01/generated/azure_mgmt_stream_analytics/outputs.rb | Azure::StreamAnalytics::Mgmt::V2016_03_01.Outputs.create_or_replace_with_http_info | def create_or_replace_with_http_info(output, resource_group_name, job_name, output_name, if_match:nil, if_none_match:nil, custom_headers:nil)
create_or_replace_async(output, resource_group_name, job_name, output_name, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
end | ruby | def create_or_replace_with_http_info(output, resource_group_name, job_name, output_name, if_match:nil, if_none_match:nil, custom_headers:nil)
create_or_replace_async(output, resource_group_name, job_name, output_name, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
end | [
"def",
"create_or_replace_with_http_info",
"(",
"output",
",",
"resource_group_name",
",",
"job_name",
",",
"output_name",
",",
"if_match",
":",
"nil",
",",
"if_none_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"create_or_replace_async",
"(",
"output"... | Creates an output or replaces an already existing output under an existing
streaming job.
@param output [Output] The definition of the output that will be used to
create a new output or replace the existing one under the streaming job.
@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 job_name [String] The name of the streaming job.
@param output_name [String] The name of the output.
@param if_match [String] The ETag of the output. Omit this value to always
overwrite the current output. Specify the last-seen ETag value to prevent
accidentally overwritting concurrent changes.
@param if_none_match [String] Set to '*' to allow a new output to be created,
but to prevent updating an existing output. Other values will result in a 412
Pre-condition Failed response.
@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",
"an",
"output",
"or",
"replaces",
"an",
"already",
"existing",
"output",
"under",
"an",
"existing",
"streaming",
"job",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stream_analytics/lib/2016-03-01/generated/azure_mgmt_stream_analytics/outputs.rb#L73-L75 | train | Creates or replaces an existing output. | [
30522,
13366,
3443,
1035,
2030,
1035,
5672,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
6434,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
6434,
1035,
2171,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
2065,
1035,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
DataDog/dogstatsd-ruby | lib/datadog/statsd.rb | Datadog.Statsd.distribution | def distribution(stat, value, opts=EMPTY_OPTIONS)
send_stats stat, value, DISTRIBUTION_TYPE, opts
end | ruby | def distribution(stat, value, opts=EMPTY_OPTIONS)
send_stats stat, value, DISTRIBUTION_TYPE, opts
end | [
"def",
"distribution",
"(",
"stat",
",",
"value",
",",
"opts",
"=",
"EMPTY_OPTIONS",
")",
"send_stats",
"stat",
",",
"value",
",",
"DISTRIBUTION_TYPE",
",",
"opts",
"end"
] | Sends a value to be tracked as a distribution to the statsd server.
Note: Distributions are a beta feature of Datadog and not generally
available. Distributions must be specifically enabled for your
organization.
@param [String] stat stat name.
@param [Numeric] value distribution value.
@param [Hash] opts the options to create the metric with
@option opts [Numeric] :sample_rate sample rate, 1 for always
@option opts [Array<String>] :tags An array of tags
@example Report the current user count:
$statsd.distribution('user.count', User.count) | [
"Sends",
"a",
"value",
"to",
"be",
"tracked",
"as",
"a",
"distribution",
"to",
"the",
"statsd",
"server",
".",
"Note",
":",
"Distributions",
"are",
"a",
"beta",
"feature",
"of",
"Datadog",
"and",
"not",
"generally",
"available",
".",
"Distributions",
"must",... | 0ea2a4d011958ad0d092654cae950e64b6475077 | https://github.com/DataDog/dogstatsd-ruby/blob/0ea2a4d011958ad0d092654cae950e64b6475077/lib/datadog/statsd.rb#L324-L326 | train | Send a distribution stats | [
30522,
13366,
4353,
1006,
28093,
1010,
3643,
1010,
23569,
2015,
1027,
4064,
1035,
7047,
1007,
4604,
1035,
26319,
28093,
1010,
3643,
1010,
4353,
1035,
2828,
1010,
23569,
2015,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mikel/mail | lib/mail/network/delivery_methods/smtp_connection.rb | Mail.SMTPConnection.deliver! | def deliver!(mail)
envelope = Mail::SmtpEnvelope.new(mail)
response = smtp.sendmail(dot_stuff(envelope.message), envelope.from, envelope.to)
settings[:return_response] ? response : self
end | ruby | def deliver!(mail)
envelope = Mail::SmtpEnvelope.new(mail)
response = smtp.sendmail(dot_stuff(envelope.message), envelope.from, envelope.to)
settings[:return_response] ? response : self
end | [
"def",
"deliver!",
"(",
"mail",
")",
"envelope",
"=",
"Mail",
"::",
"SmtpEnvelope",
".",
"new",
"(",
"mail",
")",
"response",
"=",
"smtp",
".",
"sendmail",
"(",
"dot_stuff",
"(",
"envelope",
".",
"message",
")",
",",
"envelope",
".",
"from",
",",
"enve... | Send the message via SMTP.
The from and to attributes are optional. If not set, they are retrieve from the Message. | [
"Send",
"the",
"message",
"via",
"SMTP",
".",
"The",
"from",
"and",
"to",
"attributes",
"are",
"optional",
".",
"If",
"not",
"set",
"they",
"are",
"retrieve",
"from",
"the",
"Message",
"."
] | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/network/delivery_methods/smtp_connection.rb#L51-L55 | train | Send a mail to the server | [
30522,
13366,
8116,
999,
1006,
5653,
1007,
11255,
1027,
5653,
1024,
1024,
15488,
25856,
2368,
15985,
17635,
1012,
2047,
1006,
5653,
1007,
3433,
1027,
15488,
25856,
1012,
4604,
21397,
1006,
11089,
1035,
4933,
1006,
11255,
1012,
4471,
1007,
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... |
commander-rb/commander | lib/commander/user_interaction.rb | Commander.UI.say_warning | def say_warning(*args)
args.each do |arg|
say HighLine.default_instance.color(arg, :yellow)
end
end | ruby | def say_warning(*args)
args.each do |arg|
say HighLine.default_instance.color(arg, :yellow)
end
end | [
"def",
"say_warning",
"(",
"*",
"args",
")",
"args",
".",
"each",
"do",
"|",
"arg",
"|",
"say",
"HighLine",
".",
"default_instance",
".",
"color",
"(",
"arg",
",",
":yellow",
")",
"end",
"end"
] | 'Say' something using the WARNING color (yellow).
=== Examples
say_warning 'This is a warning'
say_warning 'Be careful', 'Think about it' | [
"Say",
"something",
"using",
"the",
"WARNING",
"color",
"(",
"yellow",
")",
"."
] | 332047c14948225462fe60042eed23adfb996d68 | https://github.com/commander-rb/commander/blob/332047c14948225462fe60042eed23adfb996d68/lib/commander/user_interaction.rb#L81-L85 | train | Prints warning message for the given arguments | [
30522,
13366,
2360,
1035,
5432,
1006,
1008,
12098,
5620,
1007,
12098,
5620,
1012,
2169,
2079,
1064,
12098,
2290,
1064,
2360,
2152,
4179,
1012,
12398,
1035,
6013,
1012,
3609,
1006,
12098,
2290,
1010,
1024,
3756,
1007,
2203,
2203,
102,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb | Azure::Storage::Mgmt::V2018_11_01.StorageAccounts.begin_create | def begin_create(resource_group_name, account_name, parameters, custom_headers:nil)
response = begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create(resource_group_name, account_name, parameters, custom_headers:nil)
response = begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create",
"(",
"resource_group_name",
",",
"account_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"parameters",
",",
"custom_headers",
":custo... | Asynchronously creates a new storage account with the specified parameters.
If an account is already created and a subsequent create request is issued
with different properties, the account properties will be updated. If an
account is already created and a subsequent create or update request is
issued with the exact same set of properties, the request will succeed.
@param resource_group_name [String] The name of the resource group within the
user's subscription. The name is case insensitive.
@param account_name [String] The name of the storage account within the
specified resource group. Storage account names must be between 3 and 24
characters in length and use numbers and lower-case letters only.
@param parameters [StorageAccountCreateParameters] The parameters to provide
for the created account.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [StorageAccount] operation results. | [
"Asynchronously",
"creates",
"a",
"new",
"storage",
"account",
"with",
"the",
"specified",
"parameters",
".",
"If",
"an",
"account",
"is",
"already",
"created",
"and",
"a",
"subsequent",
"create",
"request",
"is",
"issued",
"with",
"different",
"properties",
"th... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb#L1380-L1383 | train | Creates a new centralized product. | [
30522,
13366,
4088,
1035,
3443,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3443,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
commander-rb/commander | lib/commander/runner.rb | Commander.Runner.parse_global_options | def parse_global_options
parser = options.inject(OptionParser.new) do |options, option|
options.on(*option[:args], &global_option_proc(option[:switches], &option[:proc]))
end
options = @args.dup
begin
parser.parse!(options)
rescue OptionParser::InvalidOption => e
# Remove the offending args and retry.
options = options.reject { |o| e.args.include?(o) }
retry
end
end | ruby | def parse_global_options
parser = options.inject(OptionParser.new) do |options, option|
options.on(*option[:args], &global_option_proc(option[:switches], &option[:proc]))
end
options = @args.dup
begin
parser.parse!(options)
rescue OptionParser::InvalidOption => e
# Remove the offending args and retry.
options = options.reject { |o| e.args.include?(o) }
retry
end
end | [
"def",
"parse_global_options",
"parser",
"=",
"options",
".",
"inject",
"(",
"OptionParser",
".",
"new",
")",
"do",
"|",
"options",
",",
"option",
"|",
"options",
".",
"on",
"(",
"option",
"[",
":args",
"]",
",",
"global_option_proc",
"(",
"option",
"[",
... | Parse global command options. | [
"Parse",
"global",
"command",
"options",
"."
] | 332047c14948225462fe60042eed23adfb996d68 | https://github.com/commander-rb/commander/blob/332047c14948225462fe60042eed23adfb996d68/lib/commander/runner.rb#L374-L387 | train | Parse the global options | [
30522,
13366,
11968,
3366,
1035,
3795,
1035,
7047,
11968,
8043,
1027,
7047,
1012,
1999,
20614,
1006,
5724,
19362,
8043,
1012,
2047,
1007,
2079,
1064,
7047,
1010,
5724,
1064,
7047,
1012,
2006,
1006,
1008,
5724,
1031,
1024,
12098,
5620,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
oauth-xx/oauth2 | lib/oauth2/mac_token.rb | OAuth2.MACToken.request | def request(verb, path, opts = {}, &block)
url = client.connection.build_url(path, opts[:params]).to_s
opts[:headers] ||= {}
opts[:headers]['Authorization'] = header(verb, url)
@client.request(verb, path, opts, &block)
end | ruby | def request(verb, path, opts = {}, &block)
url = client.connection.build_url(path, opts[:params]).to_s
opts[:headers] ||= {}
opts[:headers]['Authorization'] = header(verb, url)
@client.request(verb, path, opts, &block)
end | [
"def",
"request",
"(",
"verb",
",",
"path",
",",
"opts",
"=",
"{",
"}",
",",
"&",
"block",
")",
"url",
"=",
"client",
".",
"connection",
".",
"build_url",
"(",
"path",
",",
"opts",
"[",
":params",
"]",
")",
".",
"to_s",
"opts",
"[",
":headers",
"... | Initalize a MACToken
@param [Client] client the OAuth2::Client instance
@param [String] token the Access Token value
@option [String] secret the secret key value
@param [Hash] opts the options to create the Access Token with
@option opts [String] :refresh_token (nil) the refresh_token value
@option opts [FixNum, String] :expires_in (nil) the number of seconds in which the AccessToken will expire
@option opts [FixNum, String] :expires_at (nil) the epoch time in seconds in which AccessToken will expire
@option opts [FixNum, String] :algorithm (hmac-sha-256) the algorithm to use for the HMAC digest (one of 'hmac-sha-256', 'hmac-sha-1')
Make a request with the MAC Token
@param [Symbol] verb the HTTP request method
@param [String] path the HTTP URL path of the request
@param [Hash] opts the options to make the request with
@see Client#request | [
"Initalize",
"a",
"MACToken"
] | f08ff9da169136ab133aa2faab0d74a4407deffb | https://github.com/oauth-xx/oauth2/blob/f08ff9da169136ab133aa2faab0d74a4407deffb/lib/oauth2/mac_token.rb#L43-L50 | train | Perform a request to the server. | [
30522,
13366,
5227,
1006,
12034,
1010,
4130,
1010,
23569,
2015,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
24471,
2140,
1027,
7396,
1012,
4434,
1012,
3857,
1035,
24471,
2140,
1006,
4130,
1010,
23569,
2015,
1031,
1024,
11498,
5244,
1033,
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/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.update_certificate_with_http_info | def update_certificate_with_http_info(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
end | ruby | def update_certificate_with_http_info(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
end | [
"def",
"update_certificate_with_http_info",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"name",
",",
"key_vault_certificate",
",",
"custom_headers",
":",
"nil",
")",
"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 [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"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#L1083-L1085 | train | Updates a certificate in an existing key vault certificate order. | [
30522,
13366,
10651,
1035,
8196,
1035,
2007,
1035,
8299,
1035,
18558,
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,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb | Azure::EventGrid::Mgmt::V2018_01_01.EventSubscriptions.begin_update_with_http_info | def begin_update_with_http_info(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:nil)
begin_update_async(scope, event_subscription_name, event_subscription_update_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"scope",
",",
"event_subscription_name",
",",
"event_subscription_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"scope",
",",
"event_subscription_name",
",",
"event_subscription_update_parameter... | Update an event subscription
Asynchronously updates an existing event subscription.
@param scope [String] The scope of existing event subscription. The scope can
be a subscription, or a resource group, or a top level resource belonging to
a resource provider namespace, or an EventGrid topic. For example, use
'/subscriptions/{subscriptionId}/' for a subscription,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
resource group, and
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
for a resource, and
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
for an EventGrid topic.
@param event_subscription_name [String] Name of the event subscription to be
created
@param event_subscription_update_parameters
[EventSubscriptionUpdateParameters] Updated event subscription information
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Update",
"an",
"event",
"subscription"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb#L1719-L1721 | train | Updates an existing event subscription. | [
30522,
13366,
4088,
30524,
2724,
1035,
15002,
1035,
2171,
1010,
2724,
1035,
15002,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-s3/lib/aws-sdk-s3/multipart_upload_part.rb | Aws::S3.MultipartUploadPart.upload | def upload(options = {})
options = options.merge(
bucket: @bucket_name,
key: @object_key,
upload_id: @multipart_upload_id,
part_number: @part_number
)
resp = @client.upload_part(options)
resp.data
end | ruby | def upload(options = {})
options = options.merge(
bucket: @bucket_name,
key: @object_key,
upload_id: @multipart_upload_id,
part_number: @part_number
)
resp = @client.upload_part(options)
resp.data
end | [
"def",
"upload",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"bucket",
":",
"@bucket_name",
",",
"key",
":",
"@object_key",
",",
"upload_id",
":",
"@multipart_upload_id",
",",
"part_number",
":",
"@part_number",
")",
"... | @example Request syntax with placeholder values
multipart_upload_part.upload({
body: source_file,
content_length: 1,
content_md5: "ContentMD5",
sse_customer_algorithm: "SSECustomerAlgorithm",
sse_customer_key: "SSECustomerKey",
sse_customer_key_md5: "SSECustomerKeyMD5",
request_payer: "requester", # accepts requester
})
@param [Hash] options ({})
@option options [String, IO] :body
Object data.
@option options [Integer] :content_length
Size of the body in bytes. This parameter is useful when the size of
the body cannot be determined automatically.
@option options [String] :content_md5
The base64-encoded 128-bit MD5 digest of the part data.
@option options [String] :sse_customer_algorithm
Specifies the algorithm to use to when encrypting the object (e.g.,
AES256).
@option options [String] :sse_customer_key
Specifies the customer-provided encryption key for Amazon S3 to use in
encrypting data. This value is used to store the object and then it is
discarded; Amazon does not store the encryption key. The key must be
appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithm header. This must be
the same encryption key specified in the initiate multipart upload
request.
@option options [String] :sse_customer_key_md5
Specifies the 128-bit MD5 digest of the encryption key according to
RFC 1321. Amazon S3 uses this header for a message integrity check to
ensure the encryption key was transmitted without error.
@option options [String] :request_payer
Confirms that the requester knows that she or he will be charged for
the request. Bucket owners need not specify this parameter in their
requests. Documentation on downloading objects from requester pays
buckets can be found at
http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
@return [Types::UploadPartOutput] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-s3/lib/aws-sdk-s3/multipart_upload_part.rb#L324-L333 | train | Upload a part to the bucket | [
30522,
13366,
2039,
11066,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
13610,
1024,
1030,
13610,
1035,
2171,
1010,
3145,
1024,
1030,
4874,
1035,
3145,
1010,
2039,
11066,
1035,
8909,
1024,
1030,
4800,
19362,
2102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_monitor/lib/2015-04-01/generated/azure_mgmt_monitor/autoscale_settings.rb | Azure::Monitor::Mgmt::V2015_04_01.AutoscaleSettings.update_with_http_info | def update_with_http_info(resource_group_name, autoscale_setting_name, autoscale_setting_resource, custom_headers:nil)
update_async(resource_group_name, autoscale_setting_name, autoscale_setting_resource, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, autoscale_setting_name, autoscale_setting_resource, custom_headers:nil)
update_async(resource_group_name, autoscale_setting_name, autoscale_setting_resource, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"autoscale_setting_name",
",",
"autoscale_setting_resource",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
"autoscale_setting_name",
",",
"autoscale_setting_resource",
... | Updates an existing AutoscaleSettingsResource. To update other fields use the
CreateOrUpdate method.
@param resource_group_name [String] The name of the resource group.
@param autoscale_setting_name [String] The autoscale setting name.
@param autoscale_setting_resource [AutoscaleSettingResourcePatch] Parameters
supplied to the 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. | [
"Updates",
"an",
"existing",
"AutoscaleSettingsResource",
".",
"To",
"update",
"other",
"fields",
"use",
"the",
"CreateOrUpdate",
"method",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_monitor/lib/2015-04-01/generated/azure_mgmt_monitor/autoscale_settings.rb#L432-L434 | train | Updates an existing autoscale setting. | [
30522,
13366,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8285,
15782,
2571,
1035,
4292,
1035,
2171,
1010,
8285,
15782,
2571,
1035,
4292,
1035,
7692,
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... |
RailsEventStore/rails_event_store | ruby_event_store/lib/ruby_event_store/event.rb | RubyEventStore.Event.correlate_with | def correlate_with(other_message)
self.correlation_id = other_message.correlation_id || other_message.message_id
self.causation_id = other_message.message_id
end | ruby | def correlate_with(other_message)
self.correlation_id = other_message.correlation_id || other_message.message_id
self.causation_id = other_message.message_id
end | [
"def",
"correlate_with",
"(",
"other_message",
")",
"self",
".",
"correlation_id",
"=",
"other_message",
".",
"correlation_id",
"||",
"other_message",
".",
"message_id",
"self",
".",
"causation_id",
"=",
"other_message",
".",
"message_id",
"end"
] | Sets correlation_id and causation_id in metadata based
on correlation_id and message_id of the provided message.
{http://railseventstore.org/docs/correlation_causation/ Find out more}
@param other_message [Event, Proto, command] message to correlate with. Most likely an event or a command. Must respond to correlation_id and message_id.
@return [String] set causation_id | [
"Sets",
"correlation_id",
"and",
"causation_id",
"in",
"metadata",
"based",
"on",
"correlation_id",
"and",
"message_id",
"of",
"the",
"provided",
"message",
".",
"{",
"http",
":",
"//",
"railseventstore",
".",
"org",
"/",
"docs",
"/",
"correlation_causation",
"/... | 3ee4f3148499794154ee6fec74ccf6d4670d85ac | https://github.com/RailsEventStore/rails_event_store/blob/3ee4f3148499794154ee6fec74ccf6d4670d85ac/ruby_event_store/lib/ruby_event_store/event.rb#L133-L136 | train | This method is used to correlate the message with another message | [
30522,
13366,
2522,
14343,
13806,
1035,
2007,
1006,
2060,
1035,
4471,
1007,
2969,
1012,
16902,
1035,
8909,
1027,
2060,
1035,
4471,
1012,
16902,
1035,
8909,
1064,
1064,
2060,
1035,
4471,
1012,
4471,
1035,
8909,
2969,
1012,
6187,
10383,
3508,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.list_failover_targets_with_http_info | def list_failover_targets_with_http_info(source_device_name, parameters, resource_group_name, manager_name, custom_headers:nil)
list_failover_targets_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def list_failover_targets_with_http_info(source_device_name, parameters, resource_group_name, manager_name, custom_headers:nil)
list_failover_targets_async(source_device_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"list_failover_targets_with_http_info",
"(",
"source_device_name",
",",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"list_failover_targets_async",
"(",
"source_device_name",
",",
"parameters",
",",
"resource_... | Given a list of volume containers to be failed over from a source device,
this method returns the eligibility result, as a failover target, for all
devices under that resource.
@param source_device_name [String] The source device name on which failover
is performed.
@param parameters [ListFailoverTargetsRequest] ListFailoverTargetsRequest
containing 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.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Given",
"a",
"list",
"of",
"volume",
"containers",
"to",
"be",
"failed",
"over",
"from",
"a",
"source",
"device",
"this",
"method",
"returns",
"the",
"eligibility",
"result",
"as",
"a",
"failover",
"target",
"for",
"all",
"devices",
"under",
"that",
"resour... | 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#L1124-L1126 | train | Gets the list of failover targets for the source device. | [
30522,
13366,
2862,
1035,
8246,
7840,
1035,
7889,
1035,
2007,
1035,
8299,
1035,
18558,
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,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb | Azure::CognitiveServices::ContentModerator::V1_0.Reviews.add_video_frame_stream | def add_video_frame_stream(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale:nil, custom_headers:nil)
response = add_video_frame_stream_async(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale:timescale, custom_headers:custom_headers).value!
nil
end | ruby | def add_video_frame_stream(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale:nil, custom_headers:nil)
response = add_video_frame_stream_async(content_type, team_name, review_id, frame_image_zip, frame_metadata, timescale:timescale, custom_headers:custom_headers).value!
nil
end | [
"def",
"add_video_frame_stream",
"(",
"content_type",
",",
"team_name",
",",
"review_id",
",",
"frame_image_zip",
",",
"frame_metadata",
",",
"timescale",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"add_video_frame_stream_async",
"(",
"cont... | Use this method to add frames for a video review.Timescale: This parameter is
a factor which is used to convert the timestamp on a frame into milliseconds.
Timescale is provided in the output of the Content Moderator video media
processor on the Azure Media Services platform.Timescale in the Video
Moderation output is Ticks/Second.
@param content_type [String] The content type.
@param team_name [String] Your team name.
@param review_id [String] Id of the review.
@param frame_image_zip Zip file containing frame images.
@param frame_metadata [String] Metadata of the frame.
@param timescale [Integer] Timescale of the video .
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Use",
"this",
"method",
"to",
"add",
"frames",
"for",
"a",
"video",
"review",
".",
"Timescale",
":",
"This",
"parameter",
"is",
"a",
"factor",
"which",
"is",
"used",
"to",
"convert",
"the",
"timestamp",
"on",
"a",
"frame",
"into",
"milliseconds",
".",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb#L1721-L1724 | train | Adds a video frame stream to the review. | [
30522,
13366,
5587,
1035,
2678,
1035,
4853,
1035,
5460,
1006,
4180,
1035,
2828,
1010,
2136,
1035,
2171,
1010,
3319,
1035,
8909,
1010,
4853,
1035,
3746,
1035,
14101,
1010,
4853,
1035,
27425,
1010,
2335,
9289,
2063,
1024,
9152,
2140,
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_resources_management/lib/2018-01-01-preview/generated/azure_mgmt_resources_management/management_groups.rb | Azure::ResourcesManagement::Mgmt::V2018_01_01_preview.ManagementGroups.create_or_update | def create_or_update(group_id, cache_control:'no-cache', custom_headers:nil)
response = create_or_update_async(group_id, cache_control:cache_control, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(group_id, cache_control:'no-cache', custom_headers:nil)
response = create_or_update_async(group_id, cache_control:cache_control, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"group_id",
",",
"cache_control",
":",
"'no-cache'",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"group_id",
",",
"cache_control",
":cache_control",
",",
"custom_headers",
":custom_headers",
"... | Create or update a management group.
If a management group is already created and a subsequent create request is
issued with different properties, the management group properties will be
updated.
@param group_id [String] Management Group ID.
@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 [Object] operation results. | [
"Create",
"or",
"update",
"a",
"management",
"group",
".",
"If",
"a",
"management",
"group",
"is",
"already",
"created",
"and",
"a",
"subsequent",
"create",
"request",
"is",
"issued",
"with",
"different",
"properties",
"the",
"management",
"group",
"properties",... | 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/management_groups.rb#L256-L259 | train | Creates or updates a group. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
2177,
1035,
8909,
1010,
17053,
1035,
2491,
1024,
1005,
2053,
1011,
17053,
1005,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2030,
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... |
jeremytregunna/ruby-trello | lib/trello/checklist.rb | Trello.Checklist.copy | def copy
checklist_copy = self.class.create(name: self.name, board_id: self.board_id, card_id: self.card_id)
copy_items_to(checklist_copy)
return checklist_copy
end | ruby | def copy
checklist_copy = self.class.create(name: self.name, board_id: self.board_id, card_id: self.card_id)
copy_items_to(checklist_copy)
return checklist_copy
end | [
"def",
"copy",
"checklist_copy",
"=",
"self",
".",
"class",
".",
"create",
"(",
"name",
":",
"self",
".",
"name",
",",
"board_id",
":",
"self",
".",
"board_id",
",",
"card_id",
":",
"self",
".",
"card_id",
")",
"copy_items_to",
"(",
"checklist_copy",
")"... | Copy a checklist (i.e., same attributes, items, etc.) | [
"Copy",
"a",
"checklist",
"(",
"i",
".",
"e",
".",
"same",
"attributes",
"items",
"etc",
".",
")"
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/checklist.rb#L130-L134 | train | copy the checklist to the correct position | [
30522,
13366,
6100,
4638,
9863,
1035,
6100,
1027,
2969,
1012,
2465,
1012,
3443,
1006,
2171,
1024,
2969,
1012,
2171,
1010,
2604,
1035,
8909,
1024,
2969,
1012,
2604,
1035,
8909,
1010,
4003,
1035,
8909,
1024,
2969,
1012,
4003,
1035,
8909,
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 | 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_deployed_service_package_health_with_http_info | def get_deployed_service_package_health_with_http_info(node_name, application_id, service_package_name, events_health_state_filter:0, timeout:60, custom_headers:nil)
get_deployed_service_package_health_async(node_name, application_id, service_package_name, events_health_state_filter:events_health_state_filter, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_deployed_service_package_health_with_http_info(node_name, application_id, service_package_name, events_health_state_filter:0, timeout:60, custom_headers:nil)
get_deployed_service_package_health_async(node_name, application_id, service_package_name, events_health_state_filter:events_health_state_filter, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_deployed_service_package_health_with_http_info",
"(",
"node_name",
",",
"application_id",
",",
"service_package_name",
",",
"events_health_state_filter",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_deployed_service_package_h... | Gets the information about health of an service package for a specific
application deployed for a Service Fabric node and application.
Gets the information about health of service package for a specific
application deployed on a Service Fabric node. Use EventsHealthStateFilter to
optionally filter for the collection of HealthEvent objects reported on the
deployed service package based on health state.
@param node_name [String] The name of the node.
@param application_id [String] The identity of the application. This is
typically the full name of the application without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the application name is "fabric:/myapp/app1", the application
identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions.
@param service_package_name [String] The name of the service package.
@param events_health_state_filter [Integer] Allows filtering the collection
of HealthEvent objects returned based on health state.
The possible values for this parameter include integer value of one of the
following health states.
Only events that match the filter are returned. All events are used to
evaluate the aggregated health state.
If not specified, all entries are returned. The state values are flag based
enumeration, so the value could be a combination of these value obtained
using bitwise 'OR' operator. For example, If the provided value is 6 then all
of the events with HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@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. | [
"Gets",
"the",
"information",
"about",
"health",
"of",
"an",
"service",
"package",
"for",
"a",
"specific",
"application",
"deployed",
"for",
"a",
"Service",
"Fabric",
"node",
"and",
"application",
"."
] | 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#L16363-L16365 | train | Gets the health of the service package deployed to a Service Fabric node. | [
30522,
13366,
2131,
1035,
7333,
1035,
2326,
1035,
7427,
1035,
2740,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13045,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
2326,
1035,
7427,
1035,
2171,
1010,
2824,
1035,
2740,
1035,
2110,
1035,
11307,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_applications_event_list | def get_applications_event_list(start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
response = get_applications_event_list_async(start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_applications_event_list(start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
response = get_applications_event_list_async(start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_applications_event_list",
"(",
"start_time_utc",
",",
"end_time_utc",
",",
"timeout",
":",
"60",
",",
"events_types_filter",
":",
"nil",
",",
"exclude_analysis_events",
":",
"nil",
",",
"skip_correlation_lookup",
":",
"nil",
",",
"custom_headers",
":",
"... | Gets all Applications-related events.
The response is list of ApplicationEvent objects.
@param start_time_utc [String] The start time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param end_time_utc [String] The end time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param events_types_filter [String] This is a comma separated string
specifying the types of FabricEvents that should only be included in the
response.
@param exclude_analysis_events [Boolean] This param disables the retrieval of
AnalysisEvents if true is passed.
@param skip_correlation_lookup [Boolean] This param disables the search of
CorrelatedEvents information if true is passed. otherwise the
CorrelationEvents get processed and HasCorrelatedEvents field in every
FabricEvent gets populated.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Gets",
"all",
"Applications",
"-",
"related",
"events",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L28031-L28034 | train | Gets the list of applications that are associated with the application. | [
30522,
13366,
2131,
1035,
5097,
1035,
2724,
1035,
2862,
1006,
2707,
1035,
2051,
1035,
11396,
1010,
2203,
1035,
2051,
1035,
11396,
1010,
2051,
5833,
1024,
3438,
1010,
2824,
1035,
4127,
1035,
11307,
1024,
9152,
2140,
1010,
23329,
1035,
4106,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.publish_iteration | def publish_iteration(project_id, iteration_id, publish_name, prediction_id, custom_headers:nil)
response = publish_iteration_async(project_id, iteration_id, publish_name, prediction_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def publish_iteration(project_id, iteration_id, publish_name, prediction_id, custom_headers:nil)
response = publish_iteration_async(project_id, iteration_id, publish_name, prediction_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"publish_iteration",
"(",
"project_id",
",",
"iteration_id",
",",
"publish_name",
",",
"prediction_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"publish_iteration_async",
"(",
"project_id",
",",
"iteration_id",
",",
"publish_name",
",",
"pred... | Publish a specific iteration.
@param project_id The project id.
@param iteration_id The iteration id.
@param publish_name [String] The name to give the published iteration.
@param prediction_id [String] The id of the prediction resource to publish
to.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Boolean] operation results. | [
"Publish",
"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#L3801-L3804 | train | Publishes a single iteration of a given project. | [
30522,
13366,
10172,
1035,
27758,
1006,
2622,
1035,
8909,
1010,
27758,
1035,
8909,
1010,
10172,
1035,
2171,
1010,
17547,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10172,
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... |
zendesk/ruby-kafka | lib/kafka/producer.rb | Kafka.Producer.send_offsets_to_transaction | def send_offsets_to_transaction(batch:, group_id:)
@transaction_manager.send_offsets_to_txn(offsets: { batch.topic => { batch.partition => { offset: batch.last_offset + 1, leader_epoch: batch.leader_epoch } } }, group_id: group_id)
end | ruby | def send_offsets_to_transaction(batch:, group_id:)
@transaction_manager.send_offsets_to_txn(offsets: { batch.topic => { batch.partition => { offset: batch.last_offset + 1, leader_epoch: batch.leader_epoch } } }, group_id: group_id)
end | [
"def",
"send_offsets_to_transaction",
"(",
"batch",
":",
",",
"group_id",
":",
")",
"@transaction_manager",
".",
"send_offsets_to_txn",
"(",
"offsets",
":",
"{",
"batch",
".",
"topic",
"=>",
"{",
"batch",
".",
"partition",
"=>",
"{",
"offset",
":",
"batch",
... | Sends batch last offset to the consumer group coordinator, and also marks
this offset as part of the current transaction. This offset will be considered
committed only if the transaction is committed successfully.
This method should be used when you need to batch consumed and produced messages
together, typically in a consume-transform-produce pattern. Thus, the specified
group_id should be the same as config parameter group_id of the used
consumer.
@return [nil] | [
"Sends",
"batch",
"last",
"offset",
"to",
"the",
"consumer",
"group",
"coordinator",
"and",
"also",
"marks",
"this",
"offset",
"as",
"part",
"of",
"the",
"current",
"transaction",
".",
"This",
"offset",
"will",
"be",
"considered",
"committed",
"only",
"if",
... | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/producer.rb#L343-L345 | train | Send offsets to a transaction | [
30522,
13366,
4604,
1035,
16396,
2015,
1035,
2000,
1035,
12598,
1006,
14108,
1024,
1010,
2177,
1035,
8909,
1024,
1007,
1030,
12598,
1035,
3208,
1012,
4604,
1035,
16396,
2015,
1035,
2000,
1035,
19067,
2078,
1006,
16396,
2015,
1024,
1063,
141... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/unlockable.rb | SidekiqUniqueJobs.Unlockable.unlock | def unlock(item)
SidekiqUniqueJobs::UniqueArgs.digest(item)
SidekiqUniqueJobs::Locksmith.new(item).unlock
end | ruby | def unlock(item)
SidekiqUniqueJobs::UniqueArgs.digest(item)
SidekiqUniqueJobs::Locksmith.new(item).unlock
end | [
"def",
"unlock",
"(",
"item",
")",
"SidekiqUniqueJobs",
"::",
"UniqueArgs",
".",
"digest",
"(",
"item",
")",
"SidekiqUniqueJobs",
"::",
"Locksmith",
".",
"new",
"(",
"item",
")",
".",
"unlock",
"end"
] | Unlocks a job.
@param [Hash] item a Sidekiq job hash | [
"Unlocks",
"a",
"job",
"."
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/unlockable.rb#L13-L16 | train | unlocks the item | [
30522,
13366,
19829,
1006,
8875,
1007,
2217,
3211,
28940,
3490,
4226,
5558,
5910,
1024,
1024,
4310,
2906,
5620,
1012,
17886,
1006,
8875,
1007,
2217,
3211,
28940,
3490,
4226,
5558,
5910,
1024,
1024,
11223,
19864,
1012,
2047,
1006,
8875,
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... |
ruby/rake | lib/rake/task_manager.rb | Rake.TaskManager.lookup | def lookup(task_name, initial_scope=nil)
initial_scope ||= @scope
task_name = task_name.to_s
if task_name =~ /^rake:/
scopes = Scope.make
task_name = task_name.sub(/^rake:/, "")
elsif task_name =~ /^(\^+)/
scopes = initial_scope.trim($1.size)
task_name = task_name.sub(/^(\^+)/, "")
else
scopes = initial_scope
end
lookup_in_scope(task_name, scopes)
end | ruby | def lookup(task_name, initial_scope=nil)
initial_scope ||= @scope
task_name = task_name.to_s
if task_name =~ /^rake:/
scopes = Scope.make
task_name = task_name.sub(/^rake:/, "")
elsif task_name =~ /^(\^+)/
scopes = initial_scope.trim($1.size)
task_name = task_name.sub(/^(\^+)/, "")
else
scopes = initial_scope
end
lookup_in_scope(task_name, scopes)
end | [
"def",
"lookup",
"(",
"task_name",
",",
"initial_scope",
"=",
"nil",
")",
"initial_scope",
"||=",
"@scope",
"task_name",
"=",
"task_name",
".",
"to_s",
"if",
"task_name",
"=~",
"/",
"/",
"scopes",
"=",
"Scope",
".",
"make",
"task_name",
"=",
"task_name",
"... | Lookup a task, using scope and the scope hints in the task name.
This method performs straight lookups without trying to
synthesize file tasks or rules. Special scope names (e.g. '^')
are recognized. If no scope argument is supplied, use the
current scope. Return nil if the task cannot be found. | [
"Lookup",
"a",
"task",
"using",
"scope",
"and",
"the",
"scope",
"hints",
"in",
"the",
"task",
"name",
".",
"This",
"method",
"performs",
"straight",
"lookups",
"without",
"trying",
"to",
"synthesize",
"file",
"tasks",
"or",
"rules",
".",
"Special",
"scope",
... | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/task_manager.rb#L185-L198 | train | Returns the result of the lookup | [
30522,
13366,
2298,
6279,
1006,
4708,
1035,
2171,
1010,
3988,
1035,
9531,
1027,
9152,
2140,
1007,
3988,
1035,
9531,
1064,
1064,
1027,
1030,
9531,
4708,
1035,
2171,
1027,
4708,
1035,
2171,
1012,
2000,
1035,
1055,
2065,
4708,
1035,
2171,
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... |
toptal/chewy | lib/chewy/query.rb | Chewy.Query.script_score | def script_score(script, options = {})
scoring = {script_score: {script: script}.merge(options)}
chain { criteria.update_scores scoring }
end | ruby | def script_score(script, options = {})
scoring = {script_score: {script: script}.merge(options)}
chain { criteria.update_scores scoring }
end | [
"def",
"script_score",
"(",
"script",
",",
"options",
"=",
"{",
"}",
")",
"scoring",
"=",
"{",
"script_score",
":",
"{",
"script",
":",
"script",
"}",
".",
"merge",
"(",
"options",
")",
"}",
"chain",
"{",
"criteria",
".",
"update_scores",
"scoring",
"}... | Adds a script function to score the search request. All scores are
added to the search request and combinded according to
`boost_mode` and `score_mode`
@example
UsersIndex.script_score("doc['boost'].value", params: { modifier: 2 })
# => {body:
query: {
function_score: {
query: { ...},
functions: [{
script_score: {
script: "doc['boost'].value * modifier",
params: { modifier: 2 }
}
}
}]
} } } | [
"Adds",
"a",
"script",
"function",
"to",
"score",
"the",
"search",
"request",
".",
"All",
"scores",
"are",
"added",
"to",
"the",
"search",
"request",
"and",
"combinded",
"according",
"to",
"boost_mode",
"and",
"score_mode"
] | cb1bb3efb1bd8a31e7e31add6072189cb1f4f01b | https://github.com/toptal/chewy/blob/cb1bb3efb1bd8a31e7e31add6072189cb1f4f01b/lib/chewy/query.rb#L397-L400 | train | Update the scores of the script | [
30522,
13366,
5896,
1035,
3556,
1006,
5896,
1010,
7047,
1027,
1063,
1065,
1007,
4577,
1027,
1063,
5896,
1035,
3556,
1024,
1063,
5896,
1024,
5896,
1065,
1012,
13590,
1006,
7047,
1007,
1065,
4677,
1063,
9181,
1012,
10651,
1035,
7644,
4577,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.next_time | def next_time(time, closing_time)
loop do
min_time = recurrence_rules_with_implicit_start_occurrence.reduce(nil) do |best_time, rule|
begin
new_time = rule.next_time(time, start_time, best_time || closing_time)
[best_time, new_time].compact.min
rescue StopIteration
best_time
end
end
break unless min_time
next (time = min_time + 1) if exception_time?(min_time)
break Occurrence.new(min_time, min_time + duration)
end
end | ruby | def next_time(time, closing_time)
loop do
min_time = recurrence_rules_with_implicit_start_occurrence.reduce(nil) do |best_time, rule|
begin
new_time = rule.next_time(time, start_time, best_time || closing_time)
[best_time, new_time].compact.min
rescue StopIteration
best_time
end
end
break unless min_time
next (time = min_time + 1) if exception_time?(min_time)
break Occurrence.new(min_time, min_time + duration)
end
end | [
"def",
"next_time",
"(",
"time",
",",
"closing_time",
")",
"loop",
"do",
"min_time",
"=",
"recurrence_rules_with_implicit_start_occurrence",
".",
"reduce",
"(",
"nil",
")",
"do",
"|",
"best_time",
",",
"rule",
"|",
"begin",
"new_time",
"=",
"rule",
".",
"next_... | Get the next time after (or including) a specific time | [
"Get",
"the",
"next",
"time",
"after",
"(",
"or",
"including",
")",
"a",
"specific",
"time"
] | fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd | https://github.com/seejohnrun/ice_cube/blob/fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd/lib/ice_cube/schedule.rb#L447-L461 | train | Returns the next time in the interval | [
30522,
13366,
2279,
1035,
2051,
1006,
2051,
1010,
5494,
1035,
2051,
1007,
7077,
2079,
8117,
1035,
2051,
1027,
28667,
3126,
24413,
1035,
3513,
1035,
2007,
1035,
24655,
1035,
2707,
1035,
14404,
1012,
5547,
1006,
9152,
2140,
1007,
2079,
1064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb | Azure::Storage::Mgmt::V2018_07_01.BlobContainers.delete_immutability_policy_with_http_info | def delete_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match, custom_headers:nil)
delete_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers:custom_headers).value!
end | ruby | def delete_immutability_policy_with_http_info(resource_group_name, account_name, container_name, if_match, custom_headers:nil)
delete_immutability_policy_async(resource_group_name, account_name, container_name, if_match, custom_headers:custom_headers).value!
end | [
"def",
"delete_immutability_policy_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"container_name",
",",
"if_match",
",",
"custom_headers",
":",
"nil",
")",
"delete_immutability_policy_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"co... | Aborts an unlocked immutability policy. The response of delete has
immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required
for this operation. Deleting a locked immutability policy is not allowed,
only way is to delete the container after deleting all blobs inside the
container.
@param resource_group_name [String] The name of the resource group within the
user's subscription. The name is case insensitive.
@param account_name [String] The name of the storage account within the
specified resource group. Storage account names must be between 3 and 24
characters in length and use numbers and lower-case letters only.
@param container_name [String] The name of the blob container within the
specified storage account. Blob container names must be between 3 and 63
characters in length and use numbers, lower-case letters and dash (-) only.
Every dash (-) character must be immediately preceded and followed by a
letter or number.
@param if_match [String] The entity state (ETag) version of the immutability
policy to update. A value of "*" can be used to apply the operation only if
the immutability policy already exists. If omitted, this operation will
always be applied.
@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. | [
"Aborts",
"an",
"unlocked",
"immutability",
"policy",
".",
"The",
"response",
"of",
"delete",
"has",
"immutabilityPeriodSinceCreationInDays",
"set",
"to",
"0",
".",
"ETag",
"in",
"If",
"-",
"Match",
"is",
"required",
"for",
"this",
"operation",
".",
"Deleting",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb#L1319-L1321 | train | Deletes the immutability policy for the specified container. | [
30522,
13366,
3972,
12870,
1035,
10047,
28120,
8010,
1035,
3343,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11661,
1035,
2171,
1010,
2065,
1035,
2674,
1010,
7661,
1035,
20346,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/cli.rb | HamlLint.CLI.handle_exception | def handle_exception(exception)
case exception
when HamlLint::Exceptions::ConfigurationError
log.error exception.message
Sysexits::EX_CONFIG
when HamlLint::Exceptions::InvalidCLIOption
log.error exception.message
log.log "Run `#{APP_NAME}` --help for usage documentation"
Sysexits::EX_USAGE
when HamlLint::Exceptions::InvalidFilePath
log.error exception.message
Sysexits::EX_NOINPUT
when HamlLint::Exceptions::NoLintersError
log.error exception.message
Sysexits::EX_NOINPUT
else
print_unexpected_exception(exception)
Sysexits::EX_SOFTWARE
end
end | ruby | def handle_exception(exception)
case exception
when HamlLint::Exceptions::ConfigurationError
log.error exception.message
Sysexits::EX_CONFIG
when HamlLint::Exceptions::InvalidCLIOption
log.error exception.message
log.log "Run `#{APP_NAME}` --help for usage documentation"
Sysexits::EX_USAGE
when HamlLint::Exceptions::InvalidFilePath
log.error exception.message
Sysexits::EX_NOINPUT
when HamlLint::Exceptions::NoLintersError
log.error exception.message
Sysexits::EX_NOINPUT
else
print_unexpected_exception(exception)
Sysexits::EX_SOFTWARE
end
end | [
"def",
"handle_exception",
"(",
"exception",
")",
"case",
"exception",
"when",
"HamlLint",
"::",
"Exceptions",
"::",
"ConfigurationError",
"log",
".",
"error",
"exception",
".",
"message",
"Sysexits",
"::",
"EX_CONFIG",
"when",
"HamlLint",
"::",
"Exceptions",
"::"... | Outputs a message and returns an appropriate error code for the specified
exception. | [
"Outputs",
"a",
"message",
"and",
"returns",
"an",
"appropriate",
"error",
"code",
"for",
"the",
"specified",
"exception",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/cli.rb#L67-L86 | train | Handle the exception | [
30522,
13366,
5047,
1035,
6453,
1006,
6453,
1007,
2553,
6453,
2043,
10654,
21202,
2102,
1024,
1024,
11790,
1024,
1024,
9563,
2121,
29165,
8833,
1012,
7561,
6453,
1012,
4471,
25353,
3366,
9048,
3215,
1024,
1024,
4654,
1035,
9530,
8873,
2290,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/bundler.rb | Vagrant.Bundler.install_local | def install_local(path, opts={})
plugin_source = Gem::Source::SpecificFile.new(path)
plugin_info = {
plugin_source.spec.name => {
"gem_version" => plugin_source.spec.version.to_s,
"local_source" => plugin_source,
"sources" => opts.fetch(:sources, [])
}
}
@logger.debug("Installing local plugin - #{plugin_info}")
internal_install(plugin_info, nil, env_local: opts[:env_local])
plugin_source.spec
end | ruby | def install_local(path, opts={})
plugin_source = Gem::Source::SpecificFile.new(path)
plugin_info = {
plugin_source.spec.name => {
"gem_version" => plugin_source.spec.version.to_s,
"local_source" => plugin_source,
"sources" => opts.fetch(:sources, [])
}
}
@logger.debug("Installing local plugin - #{plugin_info}")
internal_install(plugin_info, nil, env_local: opts[:env_local])
plugin_source.spec
end | [
"def",
"install_local",
"(",
"path",
",",
"opts",
"=",
"{",
"}",
")",
"plugin_source",
"=",
"Gem",
"::",
"Source",
"::",
"SpecificFile",
".",
"new",
"(",
"path",
")",
"plugin_info",
"=",
"{",
"plugin_source",
".",
"spec",
".",
"name",
"=>",
"{",
"\"gem... | Installs a local '*.gem' file so that Bundler can find it.
@param [String] path Path to a local gem file.
@return [Gem::Specification] | [
"Installs",
"a",
"local",
"*",
".",
"gem",
"file",
"so",
"that",
"Bundler",
"can",
"find",
"it",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/bundler.rb#L140-L152 | train | Installs a local plugin from a given path. | [
30522,
13366,
16500,
1035,
2334,
1006,
4130,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
13354,
2378,
1035,
3120,
1027,
17070,
1024,
1024,
3120,
1024,
1024,
3563,
8873,
2571,
1012,
2047,
1006,
4130,
1007,
13354,
2378,
1035,
18558,
1027,
1063... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.list_pattern_any_entity_infos_with_http_info | def list_pattern_any_entity_infos_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_pattern_any_entity_infos_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | ruby | def list_pattern_any_entity_infos_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_pattern_any_entity_infos_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | [
"def",
"list_pattern_any_entity_infos_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"0",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"list_pattern_any_entity_infos_async",
"(",
"app_id",
",",
"version_id",
",",
"skip",
"... | Get information about the Pattern.Any 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. | [
"Get",
"information",
"about",
"the",
"Pattern",
".",
"Any",
"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#L5908-L5910 | train | Gets the pattern any entity infos for a version of the application. | [
30522,
13366,
2862,
1035,
5418,
1035,
2151,
1035,
9178,
1035,
18558,
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,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/versions.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Versions.list | def list(app_id, skip:0, take:100, custom_headers:nil)
response = list_async(app_id, skip:skip, take:take, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list(app_id, skip:0, take:100, custom_headers:nil)
response = list_async(app_id, skip:skip, take:take, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list",
"(",
"app_id",
",",
"skip",
":",
"0",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_async",
"(",
"app_id",
",",
"skip",
":",
"skip",
",",
"take",
":",
"take",
",",
"custom_headers",
":custom_head... | Gets a list of versions for this application ID.
@param app_id The application 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 [Array] operation results. | [
"Gets",
"a",
"list",
"of",
"versions",
"for",
"this",
"application",
"ID",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/versions.rb#L148-L151 | train | Gets the list of the available image types. | [
30522,
13366,
2862,
1006,
10439,
1035,
8909,
1010,
13558,
1024,
1014,
1010,
2202,
1024,
2531,
1010,
7661,
1035,
20346,
2015,
1024,
30524,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
3433,
1012,
2303,
4983,
3433,
1012,
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_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_multi_role_pool_instance_metric_definitions | def list_multi_role_pool_instance_metric_definitions(resource_group_name, name, instance, custom_headers:nil)
first_page = list_multi_role_pool_instance_metric_definitions_as_lazy(resource_group_name, name, instance, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_multi_role_pool_instance_metric_definitions(resource_group_name, name, instance, custom_headers:nil)
first_page = list_multi_role_pool_instance_metric_definitions_as_lazy(resource_group_name, name, instance, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_multi_role_pool_instance_metric_definitions",
"(",
"resource_group_name",
",",
"name",
",",
"instance",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_multi_role_pool_instance_metric_definitions_as_lazy",
"(",
"resource_group_name",
",",
"name",
... | Get metric definitions for a specific instance of a multi-role pool of an App
Service Environment.
Get metric definitions for a specific instance of a multi-role 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 instance [String] Name of the instance in the multi-role pool.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<ResourceMetricDefinition>] operation results. | [
"Get",
"metric",
"definitions",
"for",
"a",
"specific",
"instance",
"of",
"a",
"multi",
"-",
"role",
"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#L1687-L1690 | train | Gets all metric definitions for a multi - role pool instance. | [
30522,
13366,
2862,
1035,
4800,
1035,
2535,
1035,
4770,
1035,
6013,
1035,
12046,
1035,
15182,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
6013,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/lifecycle_hook.rb | Aws::AutoScaling.LifecycleHook.complete | def complete(options = {})
options = options.merge(
auto_scaling_group_name: @group_name,
lifecycle_hook_name: @name
)
resp = @client.complete_lifecycle_action(options)
resp.data
end | ruby | def complete(options = {})
options = options.merge(
auto_scaling_group_name: @group_name,
lifecycle_hook_name: @name
)
resp = @client.complete_lifecycle_action(options)
resp.data
end | [
"def",
"complete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"auto_scaling_group_name",
":",
"@group_name",
",",
"lifecycle_hook_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"complete_lifecycle_action",
"(",
"o... | @!group Actions
@example Request syntax with placeholder values
lifecycle_hook.complete({
lifecycle_action_token: "LifecycleActionToken",
lifecycle_action_result: "LifecycleActionResult", # required
instance_id: "XmlStringMaxLen19",
})
@param [Hash] options ({})
@option options [String] :lifecycle_action_token
A universally unique identifier (UUID) that identifies a specific
lifecycle action associated with an instance. Amazon EC2 Auto Scaling
sends this token to the notification target you specified when you
created the lifecycle hook.
@option options [required, String] :lifecycle_action_result
The action for the group to take. This parameter can be either
`CONTINUE` or `ABANDON`.
@option options [String] :instance_id
The ID of the instance.
@return [Types::CompleteLifecycleActionAnswer] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/lifecycle_hook.rb#L256-L263 | train | Complete the lifecycle hook | [
30522,
13366,
3143,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
8285,
1035,
25169,
1035,
2177,
1035,
2171,
1024,
1030,
2177,
1035,
2171,
1010,
2166,
23490,
1035,
8103,
1035,
2171,
1024,
1030,
2171,
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... |
mongodb/mongo-ruby-driver | lib/mongo/retryable.rb | Mongo.Retryable.read_with_one_retry | def read_with_one_retry(options = nil)
yield
rescue Error::SocketError, Error::SocketTimeoutError => e
retry_message = options && options[:retry_message]
log_retry(e, message: retry_message)
yield
end | ruby | def read_with_one_retry(options = nil)
yield
rescue Error::SocketError, Error::SocketTimeoutError => e
retry_message = options && options[:retry_message]
log_retry(e, message: retry_message)
yield
end | [
"def",
"read_with_one_retry",
"(",
"options",
"=",
"nil",
")",
"yield",
"rescue",
"Error",
"::",
"SocketError",
",",
"Error",
"::",
"SocketTimeoutError",
"=>",
"e",
"retry_message",
"=",
"options",
"&&",
"options",
"[",
":retry_message",
"]",
"log_retry",
"(",
... | Execute a read operation with a single retry on network errors.
This method is used by the driver for some of the internal housekeeping
operations. Application-requested reads should use read_with_retry
rather than this method.
@api private
@example Execute the read.
read_with_one_retry do
...
end
@note This only retries read operations on socket errors.
@param [ Hash ] options Options.
@param [ Proc ] block The block to execute.
@option options [ String ] :retry_message Message to log when retrying.
@return [ Result ] The result of the operation.
@since 2.2.6 | [
"Execute",
"a",
"read",
"operation",
"with",
"a",
"single",
"retry",
"on",
"network",
"errors",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/retryable.rb#L149-L155 | train | Reads the file with one retry | [
30522,
13366,
3191,
1035,
2007,
1035,
2028,
1035,
2128,
11129,
1006,
7047,
1027,
9152,
2140,
1007,
10750,
5343,
7561,
1024,
1024,
22278,
2121,
29165,
1010,
7561,
1024,
1024,
22278,
7292,
5833,
2121,
29165,
1027,
1028,
1041,
2128,
11129,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
stripe/stripe-ruby | lib/stripe/stripe_object.rb | Stripe.StripeObject.empty_values | def empty_values(obj)
values = case obj
when Hash then obj
when StripeObject then obj.instance_variable_get(:@values)
else
raise ArgumentError, "#empty_values got unexpected object type: #{obj.class.name}"
end
values.each_with_object({}) do |(k, _), update|
update[k] = ""
end
end | ruby | def empty_values(obj)
values = case obj
when Hash then obj
when StripeObject then obj.instance_variable_get(:@values)
else
raise ArgumentError, "#empty_values got unexpected object type: #{obj.class.name}"
end
values.each_with_object({}) do |(k, _), update|
update[k] = ""
end
end | [
"def",
"empty_values",
"(",
"obj",
")",
"values",
"=",
"case",
"obj",
"when",
"Hash",
"then",
"obj",
"when",
"StripeObject",
"then",
"obj",
".",
"instance_variable_get",
"(",
":@values",
")",
"else",
"raise",
"ArgumentError",
",",
"\"#empty_values got unexpected o... | Returns a hash of empty values for all the values that are in the given
StripeObject. | [
"Returns",
"a",
"hash",
"of",
"empty",
"values",
"for",
"all",
"the",
"values",
"that",
"are",
"in",
"the",
"given",
"StripeObject",
"."
] | 322a8c60be8a9b9ac8aad8857864680a32176935 | https://github.com/stripe/stripe-ruby/blob/322a8c60be8a9b9ac8aad8857864680a32176935/lib/stripe/stripe_object.rb#L556-L567 | train | Returns an empty hash of values for the given object. | [
30522,
13366,
4064,
1035,
5300,
1006,
27885,
3501,
1007,
5300,
1027,
2553,
27885,
3501,
2043,
23325,
2059,
27885,
3501,
2043,
18247,
16429,
20614,
2059,
27885,
3501,
1012,
6013,
1035,
8023,
1035,
2131,
1006,
1024,
1030,
5300,
1007,
2842,
53... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.Base.static! | def static!(options = {})
return if (public_dir = settings.public_folder).nil?
path = File.expand_path("#{public_dir}#{URI_INSTANCE.unescape(request.path_info)}" )
return unless File.file?(path)
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(:disposition => nil)
end | ruby | def static!(options = {})
return if (public_dir = settings.public_folder).nil?
path = File.expand_path("#{public_dir}#{URI_INSTANCE.unescape(request.path_info)}" )
return unless File.file?(path)
env['sinatra.static_file'] = path
cache_control(*settings.static_cache_control) if settings.static_cache_control?
send_file path, options.merge(:disposition => nil)
end | [
"def",
"static!",
"(",
"options",
"=",
"{",
"}",
")",
"return",
"if",
"(",
"public_dir",
"=",
"settings",
".",
"public_folder",
")",
".",
"nil?",
"path",
"=",
"File",
".",
"expand_path",
"(",
"\"#{public_dir}#{URI_INSTANCE.unescape(request.path_info)}\"",
")",
"... | Attempt to serve static files from public directory. Throws :halt when
a matching file is found, returns nil otherwise. | [
"Attempt",
"to",
"serve",
"static",
"files",
"from",
"public",
"directory",
".",
"Throws",
":",
"halt",
"when",
"a",
"matching",
"file",
"is",
"found",
"returns",
"nil",
"otherwise",
"."
] | 1aa64f9858edc3f93cc8d46e26f724c1ae103b1c | https://github.com/sinatra/sinatra/blob/1aa64f9858edc3f93cc8d46e26f724c1ae103b1c/lib/sinatra/base.rb#L1064-L1072 | train | Send a static file to the client | [
30522,
13366,
10763,
999,
1006,
7047,
1027,
1063,
1065,
1007,
2709,
2065,
1006,
2270,
1035,
16101,
1027,
10906,
1012,
2270,
1035,
19622,
1007,
1012,
9152,
2140,
1029,
4130,
1027,
5371,
1012,
7818,
1035,
4130,
1006,
1000,
1001,
1063,
2270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/data/message.rb | Discordrb.Message.reacted_with | def reacted_with(reaction, limit: 100)
reaction = reaction.to_reaction if reaction.respond_to?(:to_reaction)
paginator = Paginator.new(limit, :down) do |last_page|
after_id = last_page.last.id if last_page
last_page = JSON.parse(API::Channel.get_reactions(@bot.token, @channel.id, @id, reaction, nil, after_id, limit))
last_page.map { |d| User.new(d, @bot) }
end
paginator.to_a
end | ruby | def reacted_with(reaction, limit: 100)
reaction = reaction.to_reaction if reaction.respond_to?(:to_reaction)
paginator = Paginator.new(limit, :down) do |last_page|
after_id = last_page.last.id if last_page
last_page = JSON.parse(API::Channel.get_reactions(@bot.token, @channel.id, @id, reaction, nil, after_id, limit))
last_page.map { |d| User.new(d, @bot) }
end
paginator.to_a
end | [
"def",
"reacted_with",
"(",
"reaction",
",",
"limit",
":",
"100",
")",
"reaction",
"=",
"reaction",
".",
"to_reaction",
"if",
"reaction",
".",
"respond_to?",
"(",
":to_reaction",
")",
"paginator",
"=",
"Paginator",
".",
"new",
"(",
"limit",
",",
":down",
"... | Returns the list of users who reacted with a certain reaction.
@param reaction [String, #to_reaction] the unicode emoji or {Emoji}
@param limit [Integer] the limit of how many users to retrieve. `nil` will return all users
@example Get all the users that reacted with a thumbsup.
thumbs_up_reactions = message.reacted_with("\u{1F44D}")
@return [Array<User>] the users who used this reaction | [
"Returns",
"the",
"list",
"of",
"users",
"who",
"reacted",
"with",
"a",
"certain",
"reaction",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/message.rb#L257-L265 | train | Returns a list of users that react to the given reaction. | [
30522,
13366,
14831,
1035,
2007,
1006,
4668,
1010,
5787,
1024,
2531,
1007,
4668,
1027,
4668,
1012,
2000,
1035,
4668,
2065,
4668,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
2000,
1035,
4668,
1007,
6643,
20876,
4263,
1027,
6643,
20876,
4263,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.begin_get_azure_reachability_report | def begin_get_azure_reachability_report(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = begin_get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_get_azure_reachability_report(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = begin_get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_get_azure_reachability_report",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_get_azure_reachability_report_async",
"(",
"resource_group_name",
",",
"network_watcher_name... | Gets the relative latency score for internet service providers from a
specified location to Azure regions.
@param resource_group_name [String] The name of the network watcher resource
group.
@param network_watcher_name [String] The name of the network watcher
resource.
@param parameters [AzureReachabilityReportParameters] Parameters that
determine Azure reachability report configuration.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [AzureReachabilityReport] operation results. | [
"Gets",
"the",
"relative",
"latency",
"score",
"for",
"internet",
"service",
"providers",
"from",
"a",
"specified",
"location",
"to",
"Azure",
"regions",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L2253-L2256 | train | Gets the current Azure reachability report. | [
30522,
13366,
4088,
1035,
2131,
1035,
24296,
1035,
3362,
8010,
1035,
3189,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/site.rb | Jekyll.Site.reset | def reset
self.time = if config["time"]
Utils.parse_date(config["time"].to_s, "Invalid time in _config.yml.")
else
Time.now
end
self.layouts = {}
self.pages = []
self.static_files = []
self.data = {}
@post_attr_hash = {}
@site_data = nil
@collections = nil
@documents = nil
@docs_to_write = nil
@regenerator.clear_cache
@liquid_renderer.reset
@site_cleaner = nil
frontmatter_defaults.reset
raise ArgumentError, "limit_posts must be a non-negative number" if limit_posts.negative?
Jekyll::Cache.clear_if_config_changed config
Jekyll::Hooks.trigger :site, :after_reset, self
end | ruby | def reset
self.time = if config["time"]
Utils.parse_date(config["time"].to_s, "Invalid time in _config.yml.")
else
Time.now
end
self.layouts = {}
self.pages = []
self.static_files = []
self.data = {}
@post_attr_hash = {}
@site_data = nil
@collections = nil
@documents = nil
@docs_to_write = nil
@regenerator.clear_cache
@liquid_renderer.reset
@site_cleaner = nil
frontmatter_defaults.reset
raise ArgumentError, "limit_posts must be a non-negative number" if limit_posts.negative?
Jekyll::Cache.clear_if_config_changed config
Jekyll::Hooks.trigger :site, :after_reset, self
end | [
"def",
"reset",
"self",
".",
"time",
"=",
"if",
"config",
"[",
"\"time\"",
"]",
"Utils",
".",
"parse_date",
"(",
"config",
"[",
"\"time\"",
"]",
".",
"to_s",
",",
"\"Invalid time in _config.yml.\"",
")",
"else",
"Time",
".",
"now",
"end",
"self",
".",
"l... | rubocop:disable Metrics/MethodLength
Reset Site details.
Returns nothing | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"MethodLength"
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/site.rb#L91-L115 | train | Reset the site object | [
30522,
13366,
25141,
2969,
1012,
2051,
1027,
2065,
9530,
8873,
2290,
1031,
1000,
2051,
1000,
1033,
21183,
12146,
1012,
11968,
3366,
1035,
3058,
1006,
9530,
8873,
2290,
1031,
1000,
2051,
1000,
1033,
1012,
2000,
1035,
1055,
1010,
1000,
19528,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/resolve.rb | Sprockets.Resolve.resolve_absolute_path | def resolve_absolute_path(paths, filename, accept)
deps = Set.new
filename = File.expand_path(filename)
# Ensure path is under load paths
return nil, nil, deps unless PathUtils.paths_split(paths, filename)
_, mime_type = PathUtils.match_path_extname(filename, config[:mime_exts])
type = resolve_transform_type(mime_type, accept)
return nil, nil, deps if accept && !type
return nil, nil, deps unless file?(filename)
deps << URIUtils.build_file_digest_uri(filename)
return filename, type, deps
end | ruby | def resolve_absolute_path(paths, filename, accept)
deps = Set.new
filename = File.expand_path(filename)
# Ensure path is under load paths
return nil, nil, deps unless PathUtils.paths_split(paths, filename)
_, mime_type = PathUtils.match_path_extname(filename, config[:mime_exts])
type = resolve_transform_type(mime_type, accept)
return nil, nil, deps if accept && !type
return nil, nil, deps unless file?(filename)
deps << URIUtils.build_file_digest_uri(filename)
return filename, type, deps
end | [
"def",
"resolve_absolute_path",
"(",
"paths",
",",
"filename",
",",
"accept",
")",
"deps",
"=",
"Set",
".",
"new",
"filename",
"=",
"File",
".",
"expand_path",
"(",
"filename",
")",
"# Ensure path is under load paths",
"return",
"nil",
",",
"nil",
",",
"deps",... | Internal: Finds a file in a set of given paths
paths - Array of Strings.
filename - String containing absolute path to a file including extension.
e.g. "/Users/schneems/sprockets/test/fixtures/asset/application.js"
accept - String. A Quality value incoded set of
mime types that we are looking for. Can be nil.
e.g. "application/javascript" or "text/css, */*"
Returns Array. Filename, type, path_pipeline, deps, index_alias | [
"Internal",
":",
"Finds",
"a",
"file",
"in",
"a",
"set",
"of",
"given",
"paths"
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/resolve.rb#L92-L107 | train | Resolve absolute path | [
30522,
13366,
10663,
1035,
7619,
1035,
4130,
1006,
10425,
1010,
5371,
18442,
1010,
5138,
1007,
2139,
4523,
1027,
2275,
1012,
2047,
5371,
18442,
1027,
5371,
1012,
7818,
1035,
4130,
1006,
5371,
18442,
1007,
1001,
5676,
4130,
2003,
2104,
7170,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/tty-prompt | lib/tty/prompt.rb | TTY.Prompt.collect | def collect(options = {}, &block)
collector = AnswersCollector.new(self, options)
collector.call(&block)
end | ruby | def collect(options = {}, &block)
collector = AnswersCollector.new(self, options)
collector.call(&block)
end | [
"def",
"collect",
"(",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"collector",
"=",
"AnswersCollector",
".",
"new",
"(",
"self",
",",
"options",
")",
"collector",
".",
"call",
"(",
"block",
")",
"end"
] | Gathers more than one aswer
@example
prompt.collect do
key(:name).ask('Name?')
end
@return [Hash]
the collection of answers
@api public | [
"Gathers",
"more",
"than",
"one",
"aswer"
] | b1ff627afff98fa6477e5ef3ac4a718c52eff05a | https://github.com/piotrmurach/tty-prompt/blob/b1ff627afff98fa6477e5ef3ac4a718c52eff05a/lib/tty/prompt.rb#L526-L529 | train | Collect answers from the current object | [
30522,
13366,
8145,
1006,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
10018,
1027,
6998,
26895,
22471,
2953,
1012,
2047,
1006,
2969,
1010,
7047,
1007,
10018,
1012,
2655,
1006,
1004,
3796,
1007,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_relay/lib/2016-07-01/generated/azure_mgmt_relay/hybrid_connections.rb | Azure::Relay::Mgmt::V2016_07_01.HybridConnections.list_authorization_rules_with_http_info | def list_authorization_rules_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:nil)
list_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:custom_headers).value!
end | ruby | def list_authorization_rules_with_http_info(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:nil)
list_authorization_rules_async(resource_group_name, namespace_name, hybrid_connection_name, custom_headers:custom_headers).value!
end | [
"def",
"list_authorization_rules_with_http_info",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"hybrid_connection_name",
",",
"custom_headers",
":",
"nil",
")",
"list_authorization_rules_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"hybrid_connecti... | Authorization rules for a HybridConnection.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The Namespace Name
@param hybrid_connection_name [String] The hybrid connection 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. | [
"Authorization",
"rules",
"for",
"a",
"HybridConnection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_relay/lib/2016-07-01/generated/azure_mgmt_relay/hybrid_connections.rb#L471-L473 | train | Gets authorization rules for a HybridConnection. | [
30522,
13366,
2862,
1035,
20104,
1035,
3513,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
8893,
1035,
4434,
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... |
googleapis/google-auth-library-ruby | lib/googleauth/application_default.rb | Google.Auth.get_application_default | def get_application_default scope = nil, options = {}
creds = DefaultCredentials.from_env(scope, options) ||
DefaultCredentials.from_well_known_path(scope, options) ||
DefaultCredentials.from_system_default_path(scope, options)
return creds unless creds.nil?
unless GCECredentials.on_gce? options
# Clear cache of the result of GCECredentials.on_gce?
GCECredentials.unmemoize_all
raise NOT_FOUND_ERROR
end
GCECredentials.new
end | ruby | def get_application_default scope = nil, options = {}
creds = DefaultCredentials.from_env(scope, options) ||
DefaultCredentials.from_well_known_path(scope, options) ||
DefaultCredentials.from_system_default_path(scope, options)
return creds unless creds.nil?
unless GCECredentials.on_gce? options
# Clear cache of the result of GCECredentials.on_gce?
GCECredentials.unmemoize_all
raise NOT_FOUND_ERROR
end
GCECredentials.new
end | [
"def",
"get_application_default",
"scope",
"=",
"nil",
",",
"options",
"=",
"{",
"}",
"creds",
"=",
"DefaultCredentials",
".",
"from_env",
"(",
"scope",
",",
"options",
")",
"||",
"DefaultCredentials",
".",
"from_well_known_path",
"(",
"scope",
",",
"options",
... | Obtains the default credentials implementation to use in this
environment.
Use this to obtain the Application Default Credentials for accessing
Google APIs. Application Default Credentials are described in detail
at http://goo.gl/IUuyuX.
If supplied, scope is used to create the credentials instance, when it can
be applied. E.g, on google compute engine and for user credentials the
scope is ignored.
@param scope [string|array|nil] the scope(s) to access
@param options [Hash] Connection options. These may be used to configure
the `Faraday::Connection` used for outgoing HTTP requests. For
example, if a connection proxy must be used in the current network,
you may provide a connection with with the needed proxy options.
The following keys are recognized:
* `:default_connection` The connection object to use for token
refresh requests.
* `:connection_builder` A `Proc` that creates and returns a
connection to use for token refresh requests.
* `:connection` The connection to use to determine whether GCE
metadata credentials are available. | [
"Obtains",
"the",
"default",
"credentials",
"implementation",
"to",
"use",
"in",
"this",
"environment",
"."
] | f6e8355edd19be17406b052ac1c64d3a595768e8 | https://github.com/googleapis/google-auth-library-ruby/blob/f6e8355edd19be17406b052ac1c64d3a595768e8/lib/googleauth/application_default.rb#L68-L79 | train | Returns the default application credentials | [
30522,
13366,
2131,
1035,
4646,
1035,
12398,
9531,
1027,
9152,
2140,
1010,
7047,
1027,
1063,
1065,
13675,
2098,
2015,
1027,
12398,
16748,
16454,
26340,
1012,
2013,
1035,
4372,
2615,
1006,
9531,
1010,
7047,
1007,
1064,
1064,
12398,
16748,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_analysis_services/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb | Azure::AnalysisServices::Mgmt::V2017_08_01_beta.Servers.begin_create_with_http_info | def begin_create_with_http_info(resource_group_name, server_name, server_parameters, custom_headers:nil)
begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_with_http_info(resource_group_name, server_name, server_parameters, custom_headers:nil)
begin_create_async(resource_group_name, server_name, server_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"server_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"server_parameters",
",",
"custom_headers",
"... | Provisions the specified Analysis Services server based on the configuration
specified in the request.
@param resource_group_name [String] The name of the Azure Resource group of
which a given Analysis Services server is part. This name must be at least 1
character in length, and no more than 90.
@param server_name [String] The name of the Analysis Services server. It must
be a minimum of 3 characters, and a maximum of 63.
@param server_parameters [AnalysisServicesServer] Contains the information
used to provision the Analysis Services server.
@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. | [
"Provisions",
"the",
"specified",
"Analysis",
"Services",
"server",
"based",
"on",
"the",
"configuration",
"specified",
"in",
"the",
"request",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_analysis_services/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb#L1273-L1275 | train | Creates a new cluster. | [
30522,
13366,
4088,
1035,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
8241,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
3443,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/racc | lib/racc/state.rb | Racc.States.actions_to_reach_reduce | def actions_to_reach_reduce(state_idx, target)
rule = target.heads.map(&:rule).min_by do |r|
r.symbols.flat_map(&:shortest_production).size
end
actions, cur_state = [], state_idx
rule.symbols.each do |sym|
if sym.terminal?
actions << sym
else
actions.concat(actions_to_reach_reduce(cur_state, sym))
end
cur_state = transition_graph[cur_state][sym]
end
cur_state = transition_graph[state_idx][target]
actions << ReduceStep.new(state_idx, cur_state, rule, target)
end | ruby | def actions_to_reach_reduce(state_idx, target)
rule = target.heads.map(&:rule).min_by do |r|
r.symbols.flat_map(&:shortest_production).size
end
actions, cur_state = [], state_idx
rule.symbols.each do |sym|
if sym.terminal?
actions << sym
else
actions.concat(actions_to_reach_reduce(cur_state, sym))
end
cur_state = transition_graph[cur_state][sym]
end
cur_state = transition_graph[state_idx][target]
actions << ReduceStep.new(state_idx, cur_state, rule, target)
end | [
"def",
"actions_to_reach_reduce",
"(",
"state_idx",
",",
"target",
")",
"rule",
"=",
"target",
".",
"heads",
".",
"map",
"(",
":rule",
")",
".",
"min_by",
"do",
"|",
"r",
"|",
"r",
".",
"symbols",
".",
"flat_map",
"(",
":shortest_production",
")",
".",
... | What series of shifts/reduces can produce `target`, starting from state
`state_idx`? | [
"What",
"series",
"of",
"shifts",
"/",
"reduces",
"can",
"produce",
"target",
"starting",
"from",
"state",
"state_idx",
"?"
] | d3244edfa11dd6e86e43f570c6444d41c7e3552a | https://github.com/ruby/racc/blob/d3244edfa11dd6e86e43f570c6444d41c7e3552a/lib/racc/state.rb#L445-L462 | train | Returns an array of actions to be performed on a target | [
30522,
13366,
4506,
1035,
2000,
1035,
3362,
1035,
5547,
1006,
2110,
1035,
8909,
2595,
1010,
4539,
1007,
3627,
1027,
4539,
1012,
4641,
1012,
4949,
1006,
1004,
1024,
3627,
1007,
1012,
8117,
1035,
2011,
2079,
1064,
1054,
1064,
1054,
1012,
92... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/email_template.rb | Azure::ApiManagement::Mgmt::V2018_01_01.EmailTemplate.update | def update(resource_group_name, service_name, template_name, parameters, custom_headers:nil)
response = update_async(resource_group_name, service_name, template_name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def update(resource_group_name, service_name, template_name, parameters, custom_headers:nil)
response = update_async(resource_group_name, service_name, template_name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"update",
"(",
"resource_group_name",
",",
"service_name",
",",
"template_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"template_name",
",",
"parameter... | Updates the specific Email Template.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param template_name [TemplateName] Email Template Name Identifier. Possible
values include: 'applicationApprovedNotificationMessage',
'accountClosedDeveloper',
'quotaLimitApproachingDeveloperNotificationMessage',
'newDeveloperNotificationMessage', 'emailChangeIdentityDefault',
'inviteUserNotificationMessage', 'newCommentNotificationMessage',
'confirmSignUpIdentityDefault', 'newIssueNotificationMessage',
'purchaseDeveloperNotificationMessage', 'passwordResetIdentityDefault',
'passwordResetByAdminNotificationMessage',
'rejectDeveloperNotificationMessage', 'requestDeveloperNotificationMessage'
@param parameters [EmailTemplateUpdateParameters] Update parameters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Updates",
"the",
"specific",
"Email",
"Template",
"."
] | 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/email_template.rb#L548-L551 | train | Updates a template s index. | [
30522,
13366,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
23561,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-s3/lib/aws-sdk-s3/object_summary.rb | Aws::S3.ObjectSummary.get | def get(options = {}, &block)
options = options.merge(
bucket: @bucket_name,
key: @key
)
resp = @client.get_object(options, &block)
resp.data
end | ruby | def get(options = {}, &block)
options = options.merge(
bucket: @bucket_name,
key: @key
)
resp = @client.get_object(options, &block)
resp.data
end | [
"def",
"get",
"(",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"bucket",
":",
"@bucket_name",
",",
"key",
":",
"@key",
")",
"resp",
"=",
"@client",
".",
"get_object",
"(",
"options",
",",
"block",
... | @example Request syntax with placeholder values
object_summary.get({
if_match: "IfMatch",
if_modified_since: Time.now,
if_none_match: "IfNoneMatch",
if_unmodified_since: Time.now,
range: "Range",
response_cache_control: "ResponseCacheControl",
response_content_disposition: "ResponseContentDisposition",
response_content_encoding: "ResponseContentEncoding",
response_content_language: "ResponseContentLanguage",
response_content_type: "ResponseContentType",
response_expires: Time.now,
version_id: "ObjectVersionId",
sse_customer_algorithm: "SSECustomerAlgorithm",
sse_customer_key: "SSECustomerKey",
sse_customer_key_md5: "SSECustomerKeyMD5",
request_payer: "requester", # accepts requester
part_number: 1,
})
@param [Hash] options ({})
@option options [String] :if_match
Return the object only if its entity tag (ETag) is the same as the one
specified, otherwise return a 412 (precondition failed).
@option options [Time,DateTime,Date,Integer,String] :if_modified_since
Return the object only if it has been modified since the specified
time, otherwise return a 304 (not modified).
@option options [String] :if_none_match
Return the object only if its entity tag (ETag) is different from the
one specified, otherwise return a 304 (not modified).
@option options [Time,DateTime,Date,Integer,String] :if_unmodified_since
Return the object only if it has not been modified since the specified
time, otherwise return a 412 (precondition failed).
@option options [String] :range
Downloads the specified range bytes of an object. For more information
about the HTTP Range header, go to
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.
@option options [String] :response_cache_control
Sets the Cache-Control header of the response.
@option options [String] :response_content_disposition
Sets the Content-Disposition header of the response
@option options [String] :response_content_encoding
Sets the Content-Encoding header of the response.
@option options [String] :response_content_language
Sets the Content-Language header of the response.
@option options [String] :response_content_type
Sets the Content-Type header of the response.
@option options [Time,DateTime,Date,Integer,String] :response_expires
Sets the Expires header of the response.
@option options [String] :version_id
VersionId used to reference a specific version of the object.
@option options [String] :sse_customer_algorithm
Specifies the algorithm to use to when encrypting the object (e.g.,
AES256).
@option options [String] :sse_customer_key
Specifies the customer-provided encryption key for Amazon S3 to use in
encrypting data. This value is used to store the object and then it is
discarded; Amazon does not store the encryption key. The key must be
appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithm header.
@option options [String] :sse_customer_key_md5
Specifies the 128-bit MD5 digest of the encryption key according to
RFC 1321. Amazon S3 uses this header for a message integrity check to
ensure the encryption key was transmitted without error.
@option options [String] :request_payer
Confirms that the requester knows that she or he will be charged for
the request. Bucket owners need not specify this parameter in their
requests. Documentation on downloading objects from requester pays
buckets can be found at
http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
@option options [Integer] :part_number
Part number of the object being read. This is a positive integer
between 1 and 10,000. Effectively performs a 'ranged' GET request
for the part specified. Useful for downloading just a part of an
object.
@return [Types::GetObjectOutput] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-s3/lib/aws-sdk-s3/object_summary.rb#L513-L520 | train | Get the object from the bucket. | [
30522,
13366,
2131,
1006,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
13610,
1024,
1030,
13610,
1035,
2171,
1010,
3145,
1024,
1030,
3145,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
2131,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_resources/lib/2018-05-01/generated/azure_mgmt_resources/deployment_operations.rb | Azure::Resources::Mgmt::V2018_05_01.DeploymentOperations.list_at_subscription_scope_next | def list_at_subscription_scope_next(next_page_link, custom_headers:nil)
response = list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_at_subscription_scope_next(next_page_link, custom_headers:nil)
response = list_at_subscription_scope_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_at_subscription_scope_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_at_subscription_scope_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",... | Gets all deployments operations for a deployment.
@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 [DeploymentOperationsListResult] operation results. | [
"Gets",
"all",
"deployments",
"operations",
"for",
"a",
"deployment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2018-05-01/generated/azure_mgmt_resources/deployment_operations.rb#L438-L441 | train | Gets the list of the elastic advisors. | [
30522,
13366,
2862,
1035,
2012,
1035,
15002,
1035,
9531,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2012,
1035,
15002,
1035,
9531,
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... |
piotrmurach/tty-prompt | lib/tty/prompt.rb | TTY.Prompt.ok | def ok(*args)
options = Utils.extract_options!(args)
args.each { |message| say message, options.merge(color: :green) }
end | ruby | def ok(*args)
options = Utils.extract_options!(args)
args.each { |message| say message, options.merge(color: :green) }
end | [
"def",
"ok",
"(",
"*",
"args",
")",
"options",
"=",
"Utils",
".",
"extract_options!",
"(",
"args",
")",
"args",
".",
"each",
"{",
"|",
"message",
"|",
"say",
"message",
",",
"options",
".",
"merge",
"(",
"color",
":",
":green",
")",
"}",
"end"
] | Print statement(s) out in red green.
@example
prompt.ok "Are you sure?"
prompt.ok "All is fine!", "This is fine too."
@param [Array] messages
@return [Array] messages
@api public | [
"Print",
"statement",
"(",
"s",
")",
"out",
"in",
"red",
"green",
"."
] | b1ff627afff98fa6477e5ef3ac4a718c52eff05a | https://github.com/piotrmurach/tty-prompt/blob/b1ff627afff98fa6477e5ef3ac4a718c52eff05a/lib/tty/prompt.rb#L429-L432 | train | Prints a success message to the user. | [
30522,
13366,
7929,
1006,
1008,
12098,
5620,
1007,
7047,
1027,
21183,
12146,
1012,
14817,
1035,
7047,
999,
1006,
12098,
5620,
1007,
12098,
5620,
1012,
2169,
1063,
1064,
4471,
1064,
2360,
4471,
1010,
7047,
1012,
13590,
1006,
3609,
1024,
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... |
grpc/grpc | src/ruby/lib/grpc/generic/active_call.rb | GRPC.ActiveCall.run_server_bidi | def run_server_bidi(mth, interception_ctx)
view = multi_req_view
bidi_call = BidiCall.new(
@call,
@marshal,
@unmarshal,
metadata_received: @metadata_received,
req_view: view
)
requests = bidi_call.read_next_loop(proc { set_input_stream_done }, false)
interception_ctx.intercept!(
:bidi_streamer,
call: view,
method: mth,
requests: requests
) do
bidi_call.run_on_server(mth, requests)
end
end | ruby | def run_server_bidi(mth, interception_ctx)
view = multi_req_view
bidi_call = BidiCall.new(
@call,
@marshal,
@unmarshal,
metadata_received: @metadata_received,
req_view: view
)
requests = bidi_call.read_next_loop(proc { set_input_stream_done }, false)
interception_ctx.intercept!(
:bidi_streamer,
call: view,
method: mth,
requests: requests
) do
bidi_call.run_on_server(mth, requests)
end
end | [
"def",
"run_server_bidi",
"(",
"mth",
",",
"interception_ctx",
")",
"view",
"=",
"multi_req_view",
"bidi_call",
"=",
"BidiCall",
".",
"new",
"(",
"@call",
",",
"@marshal",
",",
"@unmarshal",
",",
"metadata_received",
":",
"@metadata_received",
",",
"req_view",
"... | run_server_bidi orchestrates a BiDi stream processing on a server.
N.B. gen_each_reply is a func(Enumerable<Requests>)
It takes an enumerable of requests as an arg, in case there is a
relationship between the stream of requests and the stream of replies.
This does not mean that must necessarily be one. E.g, the replies
produced by gen_each_reply could ignore the received_msgs
@param mth [Proc] generates the BiDi stream replies
@param interception_ctx [InterceptionContext] | [
"run_server_bidi",
"orchestrates",
"a",
"BiDi",
"stream",
"processing",
"on",
"a",
"server",
"."
] | f3937f0e55227a4ef3a23f895d3b204a947610f8 | https://github.com/grpc/grpc/blob/f3937f0e55227a4ef3a23f895d3b204a947610f8/src/ruby/lib/grpc/generic/active_call.rb#L535-L553 | train | Run the bidi streamer on the server | [
30522,
13366,
2448,
1035,
8241,
1035,
7226,
2072,
1006,
11047,
2232,
1010,
17385,
1035,
14931,
2595,
1007,
3193,
1027,
4800,
1035,
2128,
4160,
1035,
3193,
7226,
2072,
1035,
2655,
1027,
7226,
7476,
2140,
1012,
2047,
1006,
1030,
2655,
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... |
commander-rb/commander | lib/commander/runner.rb | Commander.Runner.global_option | def global_option(*args, &block)
switches, description = Runner.separate_switches_from_description(*args)
@options << {
args: args,
proc: block,
switches: switches,
description: description,
}
end | ruby | def global_option(*args, &block)
switches, description = Runner.separate_switches_from_description(*args)
@options << {
args: args,
proc: block,
switches: switches,
description: description,
}
end | [
"def",
"global_option",
"(",
"*",
"args",
",",
"&",
"block",
")",
"switches",
",",
"description",
"=",
"Runner",
".",
"separate_switches_from_description",
"(",
"args",
")",
"@options",
"<<",
"{",
"args",
":",
"args",
",",
"proc",
":",
"block",
",",
"switc... | Add a global option; follows the same syntax as Command#option
This would be used for switches such as --version, --trace, etc. | [
"Add",
"a",
"global",
"option",
";",
"follows",
"the",
"same",
"syntax",
"as",
"Command#option",
"This",
"would",
"be",
"used",
"for",
"switches",
"such",
"as",
"--",
"version",
"--",
"trace",
"etc",
"."
] | 332047c14948225462fe60042eed23adfb996d68 | https://github.com/commander-rb/commander/blob/332047c14948225462fe60042eed23adfb996d68/lib/commander/runner.rb#L180-L188 | train | Add a global option to the command line. | [
30522,
13366,
3795,
1035,
5724,
1006,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
15924,
1010,
6412,
1027,
5479,
1012,
3584,
1035,
15924,
1035,
2013,
1035,
6412,
1006,
1008,
12098,
5620,
1007,
1030,
7047,
1026,
1026,
1063,
12098,
5620,
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_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.get_exports | def get_exports(project_id, iteration_id, custom_headers:nil)
response = get_exports_async(project_id, iteration_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_exports(project_id, iteration_id, custom_headers:nil)
response = get_exports_async(project_id, iteration_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_exports",
"(",
"project_id",
",",
"iteration_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_exports_async",
"(",
"project_id",
",",
"iteration_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body... | Get the list of exports for a specific iteration.
@param project_id The project id.
@param iteration_id The iteration id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Get",
"the",
"list",
"of",
"exports",
"for",
"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#L3992-L3995 | train | Gets the exports of a given iteration. | [
30522,
13366,
2131,
1035,
14338,
1006,
2622,
1035,
8909,
1010,
27758,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
14338,
1035,
2004,
6038,
2278,
1006,
2622,
1035,
8909,
1010,
27758,
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... |
decidim/decidim | decidim-core/lib/decidim/component_manifest.rb | Decidim.ComponentManifest.register_resource | def register_resource(name)
my_component_manifest = self
my_block = proc do |resource|
resource.component_manifest = my_component_manifest
yield(resource)
end
Decidim.register_resource(name, &my_block)
end | ruby | def register_resource(name)
my_component_manifest = self
my_block = proc do |resource|
resource.component_manifest = my_component_manifest
yield(resource)
end
Decidim.register_resource(name, &my_block)
end | [
"def",
"register_resource",
"(",
"name",
")",
"my_component_manifest",
"=",
"self",
"my_block",
"=",
"proc",
"do",
"|",
"resource",
"|",
"resource",
".",
"component_manifest",
"=",
"my_component_manifest",
"yield",
"(",
"resource",
")",
"end",
"Decidim",
".",
"r... | Public: Registers a resource. Exposes a DSL defined by
`Decidim::ResourceManifest`. Automatically sets the component manifest
for that resource to the current one.
Resource manifests are a way to expose a resource from one engine to
the whole system. This way resources can be linked between them.
name - A name for that resource. Should be singular (ie not plural).
block - A Block that will be called to set the Resource attributes.
Returns nothing. | [
"Public",
":",
"Registers",
"a",
"resource",
".",
"Exposes",
"a",
"DSL",
"defined",
"by",
"Decidim",
"::",
"ResourceManifest",
".",
"Automatically",
"sets",
"the",
"component",
"manifest",
"for",
"that",
"resource",
"to",
"the",
"current",
"one",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/component_manifest.rb#L204-L213 | train | Register a resource with the given name. | [
30522,
13366,
4236,
1035,
7692,
1006,
2171,
1007,
2026,
1035,
6922,
1035,
19676,
1027,
2969,
2026,
1035,
3796,
1027,
4013,
2278,
2079,
1064,
7692,
1064,
7692,
1012,
6922,
1035,
19676,
1027,
2026,
1035,
6922,
1035,
19676,
10750,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.