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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sds/overcommit | lib/overcommit/configuration_loader.rb | Overcommit.ConfigurationLoader.load_file | def load_file(file)
config = self.class.load_from_file(file, default: false, logger: @log)
config = self.class.default_configuration.merge(config)
if @options.fetch(:verify) { config.verify_signatures? }
verify_signatures(config)
end
config
rescue Overcommit::Exceptions::ConfigurationSignatureChanged
raise
rescue StandardError => error
raise Overcommit::Exceptions::ConfigurationError,
"Unable to load configuration from '#{file}': #{error}",
error.backtrace
end | ruby | def load_file(file)
config = self.class.load_from_file(file, default: false, logger: @log)
config = self.class.default_configuration.merge(config)
if @options.fetch(:verify) { config.verify_signatures? }
verify_signatures(config)
end
config
rescue Overcommit::Exceptions::ConfigurationSignatureChanged
raise
rescue StandardError => error
raise Overcommit::Exceptions::ConfigurationError,
"Unable to load configuration from '#{file}': #{error}",
error.backtrace
end | [
"def",
"load_file",
"(",
"file",
")",
"config",
"=",
"self",
".",
"class",
".",
"load_from_file",
"(",
"file",
",",
"default",
":",
"false",
",",
"logger",
":",
"@log",
")",
"config",
"=",
"self",
".",
"class",
".",
"default_configuration",
".",
"merge",... | Loads a configuration, ensuring it extends the default configuration. | [
"Loads",
"a",
"configuration",
"ensuring",
"it",
"extends",
"the",
"default",
"configuration",
"."
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/configuration_loader.rb#L64-L79 | train | Load a configuration file | [
30522,
13366,
7170,
1035,
5371,
1006,
5371,
1007,
9530,
8873,
2290,
1027,
2969,
1012,
2465,
1012,
7170,
1035,
2013,
1035,
5371,
1006,
5371,
1010,
12398,
1024,
6270,
1010,
8833,
4590,
1024,
1030,
8833,
1007,
9530,
8873,
2290,
1027,
2969,
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... |
rmosolgo/graphql-ruby | lib/graphql/schema.rb | GraphQL.Schema.rescue_middleware | def rescue_middleware
@rescue_middleware ||= GraphQL::Schema::RescueMiddleware.new.tap { |m| middleware.insert(0, m) }
end | ruby | def rescue_middleware
@rescue_middleware ||= GraphQL::Schema::RescueMiddleware.new.tap { |m| middleware.insert(0, m) }
end | [
"def",
"rescue_middleware",
"@rescue_middleware",
"||=",
"GraphQL",
"::",
"Schema",
"::",
"RescueMiddleware",
".",
"new",
".",
"tap",
"{",
"|",
"m",
"|",
"middleware",
".",
"insert",
"(",
"0",
",",
"m",
")",
"}",
"end"
] | Lazily create a middleware and add it to the schema
(Don't add it if it's not used) | [
"Lazily",
"create",
"a",
"middleware",
"and",
"add",
"it",
"to",
"the",
"schema",
"(",
"Don",
"t",
"add",
"it",
"if",
"it",
"s",
"not",
"used",
")"
] | d5be13a816f220b9efbabeaa69a3e56fedf311f5 | https://github.com/rmosolgo/graphql-ruby/blob/d5be13a816f220b9efbabeaa69a3e56fedf311f5/lib/graphql/schema.rb#L1173-L1175 | train | Returns the middleware to use for the rescue middleware. | [
30522,
13366,
5343,
1035,
2690,
8059,
1030,
5343,
1035,
2690,
8059,
1064,
1064,
1027,
10629,
4160,
2140,
1024,
1024,
8040,
28433,
1024,
1024,
5343,
4328,
20338,
8059,
1012,
2047,
1012,
11112,
1063,
1064,
1049,
1064,
2690,
8059,
1012,
19274,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_cluster_health_chunk | def get_cluster_health_chunk(timeout:60, custom_headers:nil)
response = get_cluster_health_chunk_async(timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_cluster_health_chunk(timeout:60, custom_headers:nil)
response = get_cluster_health_chunk_async(timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_cluster_health_chunk",
"(",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_cluster_health_chunk_async",
"(",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
... | Gets the health of a Service Fabric cluster using health chunks.
Gets the health of a Service Fabric cluster using health chunks. Includes the
aggregated health state of the cluster, but none of the cluster entities.
To expand the cluster health and get the health state of all or some of the
entities, use the POST URI and specify the cluster health chunk query
description.
@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 [ClusterHealthChunk] operation results. | [
"Gets",
"the",
"health",
"of",
"a",
"Service",
"Fabric",
"cluster",
"using",
"health",
"chunks",
"."
] | 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#L1028-L1031 | train | Gets the health chunk of the cluster. | [
30522,
13366,
2131,
1035,
9324,
1035,
2740,
1035,
20000,
1006,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
9324,
1035,
2740,
1035,
20000,
1035,
2004,
6038,
2278,
1006,
2051,
5833,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | actionpack/lib/action_dispatch/http/request.rb | ActionDispatch.Request.GET | def GET
fetch_header("action_dispatch.request.query_parameters") do |k|
rack_query_params = super || {}
# Check for non UTF-8 parameter values, which would cause errors later
Request::Utils.check_param_encoding(rack_query_params)
set_header k, Request::Utils.normalize_encode_params(rack_query_params)
end
rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new("Invalid query parameters: #{e.message}")
end | ruby | def GET
fetch_header("action_dispatch.request.query_parameters") do |k|
rack_query_params = super || {}
# Check for non UTF-8 parameter values, which would cause errors later
Request::Utils.check_param_encoding(rack_query_params)
set_header k, Request::Utils.normalize_encode_params(rack_query_params)
end
rescue Rack::Utils::ParameterTypeError, Rack::Utils::InvalidParameterError => e
raise ActionController::BadRequest.new("Invalid query parameters: #{e.message}")
end | [
"def",
"GET",
"fetch_header",
"(",
"\"action_dispatch.request.query_parameters\"",
")",
"do",
"|",
"k",
"|",
"rack_query_params",
"=",
"super",
"||",
"{",
"}",
"# Check for non UTF-8 parameter values, which would cause errors later",
"Request",
"::",
"Utils",
".",
"check_pa... | Override Rack's GET method to support indifferent access. | [
"Override",
"Rack",
"s",
"GET",
"method",
"to",
"support",
"indifferent",
"access",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_dispatch/http/request.rb#L366-L375 | train | Get the request query parameters | [
30522,
13366,
2131,
18584,
1035,
20346,
1006,
1000,
2895,
1035,
18365,
1012,
5227,
1012,
23032,
1035,
11709,
1000,
1007,
2079,
1064,
1047,
1064,
14513,
1035,
23032,
1035,
11498,
5244,
1027,
3565,
1064,
1064,
1063,
1065,
1001,
4638,
2005,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.create_async | def create_async(resource_group_name, registry_name, replication_name, replication, custom_headers:nil)
# Send request
promise = begin_create_async(resource_group_name, registry_name, replication_name, replication, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::ContainerRegistry::Mgmt::V2017_06_01_preview::Models::Replication.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def create_async(resource_group_name, registry_name, replication_name, replication, custom_headers:nil)
# Send request
promise = begin_create_async(resource_group_name, registry_name, replication_name, replication, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::ContainerRegistry::Mgmt::V2017_06_01_preview::Models::Replication.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"create_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"replication_name",
",",
"replication",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
... | @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 [Replication] The parameters for creating a replication.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@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",
"regist... | 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#L159-L175 | train | Creates a replication in the specified container registry. | [
30522,
13366,
3443,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
21647,
1035,
2171,
1010,
21647,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tongueroo/ufo | lib/ufo/init.rb | Ufo.Init.set_destination_root | def set_destination_root
return unless ENV['UFO_ROOT']
dest = ENV['UFO_ROOT']
FileUtils.rm_rf(dest) && FileUtils.mkdir_p(dest)
self.destination_root = dest
FileUtils.cd(dest)
end | ruby | def set_destination_root
return unless ENV['UFO_ROOT']
dest = ENV['UFO_ROOT']
FileUtils.rm_rf(dest) && FileUtils.mkdir_p(dest)
self.destination_root = dest
FileUtils.cd(dest)
end | [
"def",
"set_destination_root",
"return",
"unless",
"ENV",
"[",
"'UFO_ROOT'",
"]",
"dest",
"=",
"ENV",
"[",
"'UFO_ROOT'",
"]",
"FileUtils",
".",
"rm_rf",
"(",
"dest",
")",
"&&",
"FileUtils",
".",
"mkdir_p",
"(",
"dest",
")",
"self",
".",
"destination_root",
... | for specs | [
"for",
"specs"
] | 16ac3dad28edcab2693c0e7d89a1971aca65b8f9 | https://github.com/tongueroo/ufo/blob/16ac3dad28edcab2693c0e7d89a1971aca65b8f9/lib/ufo/init.rb#L42-L49 | train | Set the destination root of the current project. | [
30522,
13366,
2275,
1035,
7688,
1035,
7117,
2709,
4983,
4372,
2615,
1031,
1005,
24321,
1035,
7117,
1005,
1033,
4078,
2102,
1027,
4372,
2615,
1031,
1005,
24321,
1035,
7117,
1005,
1033,
5371,
21823,
4877,
1012,
28549,
1035,
21792,
1006,
4078,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_metrics_as_lazy | def list_multi_role_pool_instance_metrics_as_lazy(resource_group_name, name, instance, details:nil, custom_headers:nil)
response = list_multi_role_pool_instance_metrics_async(resource_group_name, name, instance, details:details, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_pool_instance_metrics_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_multi_role_pool_instance_metrics_as_lazy(resource_group_name, name, instance, details:nil, custom_headers:nil)
response = list_multi_role_pool_instance_metrics_async(resource_group_name, name, instance, details:details, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_pool_instance_metrics_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_multi_role_pool_instance_metrics_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"instance",
",",
"details",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_multi_role_pool_instance_metrics_async",
"(",
"resource_group_name",
... | Get metrics for a specific instance of a multi-role pool of an App Service
Environment.
Get metrics 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 details [Boolean] Specify <code>true</code> to include instance
details. The default is <code>false</code>.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ResourceMetricCollection] which provide lazy access to pages of the
response. | [
"Get",
"metrics",
"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#L7612-L7621 | train | Gets metrics for a multi - role pool instance. | [
30522,
13366,
2862,
1035,
4800,
1035,
2535,
1035,
4770,
1035,
6013,
1035,
12046,
2015,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
30524,
4770,
1035,
6013,
1035,
12046,
2015,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/bot.rb | Discordrb.Bot.parse_mentions | def parse_mentions(mentions, server = nil)
array_to_return = []
# While possible mentions may be in message
while mentions.include?('<') && mentions.include?('>')
# Removing all content before the next possible mention
mentions = mentions.split('<', 2)[1]
# Locate the first valid mention enclosed in `<...>`, otherwise advance to the next open `<`
next unless mentions.split('>', 2).first.length < mentions.split('<', 2).first.length
# Store the possible mention value to be validated with RegEx
mention = mentions.split('>', 2).first
if /@!?(?<id>\d+)/ =~ mention
array_to_return << user(id) unless user(id).nil?
elsif /#(?<id>\d+)/ =~ mention
array_to_return << channel(id, server) unless channel(id, server).nil?
elsif /@&(?<id>\d+)/ =~ mention
if server
array_to_return << server.role(id) unless server.role(id).nil?
else
@servers.values.each do |element|
array_to_return << element.role(id) unless element.role(id).nil?
end
end
elsif /(?<animated>^[a]|^${0}):(?<name>\w+):(?<id>\d+)/ =~ mention
array_to_return << (emoji(id) || Emoji.new({ 'animated' => !animated.nil?, 'name' => name, 'id' => id }, self, nil))
end
end
array_to_return
end | ruby | def parse_mentions(mentions, server = nil)
array_to_return = []
# While possible mentions may be in message
while mentions.include?('<') && mentions.include?('>')
# Removing all content before the next possible mention
mentions = mentions.split('<', 2)[1]
# Locate the first valid mention enclosed in `<...>`, otherwise advance to the next open `<`
next unless mentions.split('>', 2).first.length < mentions.split('<', 2).first.length
# Store the possible mention value to be validated with RegEx
mention = mentions.split('>', 2).first
if /@!?(?<id>\d+)/ =~ mention
array_to_return << user(id) unless user(id).nil?
elsif /#(?<id>\d+)/ =~ mention
array_to_return << channel(id, server) unless channel(id, server).nil?
elsif /@&(?<id>\d+)/ =~ mention
if server
array_to_return << server.role(id) unless server.role(id).nil?
else
@servers.values.each do |element|
array_to_return << element.role(id) unless element.role(id).nil?
end
end
elsif /(?<animated>^[a]|^${0}):(?<name>\w+):(?<id>\d+)/ =~ mention
array_to_return << (emoji(id) || Emoji.new({ 'animated' => !animated.nil?, 'name' => name, 'id' => id }, self, nil))
end
end
array_to_return
end | [
"def",
"parse_mentions",
"(",
"mentions",
",",
"server",
"=",
"nil",
")",
"array_to_return",
"=",
"[",
"]",
"# While possible mentions may be in message",
"while",
"mentions",
".",
"include?",
"(",
"'<'",
")",
"&&",
"mentions",
".",
"include?",
"(",
"'>'",
")",
... | Gets the users, channels, roles and emoji from a string.
@param mentions [String] The mentions, which should look like `<@12314873129>`, `<#123456789>`, `<@&123456789>` or `<:name:126328:>`.
@param server [Server, nil] The server of the associated mentions. (recommended for role parsing, to speed things up)
@return [Array<User, Channel, Role, Emoji>] The array of users, channels, roles and emoji identified by the mentions, or `nil` if none exists. | [
"Gets",
"the",
"users",
"channels",
"roles",
"and",
"emoji",
"from",
"a",
"string",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L457-L485 | train | Parse mentions | [
30522,
13366,
11968,
3366,
1035,
9704,
1006,
9704,
1010,
8241,
1027,
9152,
2140,
1007,
9140,
1035,
2000,
1035,
2709,
1027,
1031,
1033,
1001,
2096,
2825,
9704,
2089,
2022,
1999,
4471,
2096,
9704,
1012,
2421,
1029,
1006,
1005,
1026,
1005,
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.get_intent | def get_intent(app_id, version_id, intent_id, custom_headers:nil)
response = get_intent_async(app_id, version_id, intent_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_intent(app_id, version_id, intent_id, custom_headers:nil)
response = get_intent_async(app_id, version_id, intent_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_intent",
"(",
"app_id",
",",
"version_id",
",",
"intent_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_intent_async",
"(",
"app_id",
",",
"version_id",
",",
"intent_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!"... | Gets information about the intent model in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param intent_id The intent classifier ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [IntentClassifier] operation results. | [
"Gets",
"information",
"about",
"the",
"intent",
"model",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L1823-L1826 | train | Gets the intent for the application version. | [
30522,
13366,
2131,
1035,
7848,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
7848,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
7848,
1035,
2004,
6038,
2278,
1006,
10439,
1035,
8909,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_monitor/lib/2018-04-16/generated/azure_mgmt_monitor/scheduled_query_rules.rb | Azure::Monitor::Mgmt::V2018_04_16.ScheduledQueryRules.list_by_subscription | def list_by_subscription(filter:nil, custom_headers:nil)
response = list_by_subscription_async(filter:filter, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_subscription(filter:nil, custom_headers:nil)
response = list_by_subscription_async(filter:filter, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_subscription",
"(",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_subscription_async",
"(",
"filter",
":",
"filter",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
... | List the Log Search rules within a subscription group.
@param filter [String] The filter to apply on the operation. For more
information please see
https://msdn.microsoft.com/en-us/library/azure/dn931934.aspx
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [LogSearchRuleResourceCollection] operation results. | [
"List",
"the",
"Log",
"Search",
"rules",
"within",
"a",
"subscription",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_monitor/lib/2018-04-16/generated/azure_mgmt_monitor/scheduled_query_rules.rb#L430-L433 | train | Gets the list of all the elastic network interfaces. | [
30522,
13366,
2862,
1035,
2011,
1035,
15002,
1006,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
15002,
1035,
2004,
6038,
2278,
1006,
11307,
1024,
11307,
1010,
7661,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb | Azure::MachineLearning::Mgmt::V2017_01_01.WebServices.create_or_update | def create_or_update(resource_group_name, web_service_name, create_or_update_payload, custom_headers:nil)
response = create_or_update_async(resource_group_name, web_service_name, create_or_update_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(resource_group_name, web_service_name, create_or_update_payload, custom_headers:nil)
response = create_or_update_async(resource_group_name, web_service_name, create_or_update_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"resource_group_name",
",",
"web_service_name",
",",
"create_or_update_payload",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"resource_group_name",
",",
"web_service_name",
",",
"create_or_update_pa... | Create or update a web service. This call will overwrite an existing web
service. Note that there is no warning or confirmation. This is a
nonrecoverable operation. If your intent is to create a new web service, call
the Get operation first to verify that it does not exist.
@param resource_group_name [String] Name of the resource group in which the
web service is located.
@param web_service_name [String] The name of the web service.
@param create_or_update_payload [WebService] The payload that is used to
create or update the web service.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [WebService] operation results. | [
"Create",
"or",
"update",
"a",
"web",
"service",
".",
"This",
"call",
"will",
"overwrite",
"an",
"existing",
"web",
"service",
".",
"Note",
"that",
"there",
"is",
"no",
"warning",
"or",
"confirmation",
".",
"This",
"is",
"a",
"nonrecoverable",
"operation",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb#L45-L48 | train | Creates or updates a Web Services resource. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4773,
1035,
2326,
1035,
2171,
1010,
3443,
1035,
2030,
1035,
10651,
1035,
18093,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | fastlane/lib/fastlane/plugins/plugin_info_collector.rb | Fastlane.PluginInfoCollector.fix_plugin_name | def fix_plugin_name(name)
name = name.to_s.downcase
fixes = {
/[\- ]/ => '_', # dashes and spaces become underscores
/[^a-z0-9_]/ => '', # anything other than lower case letters, numbers and underscores is removed
/fastlane[_]?/ => '', # 'fastlane' or 'fastlane_' is removed
/plugin[_]?/ => '' # 'plugin' or 'plugin_' is removed
}
fixes.each do |regex, replacement|
name = name.gsub(regex, replacement)
end
name
end | ruby | def fix_plugin_name(name)
name = name.to_s.downcase
fixes = {
/[\- ]/ => '_', # dashes and spaces become underscores
/[^a-z0-9_]/ => '', # anything other than lower case letters, numbers and underscores is removed
/fastlane[_]?/ => '', # 'fastlane' or 'fastlane_' is removed
/plugin[_]?/ => '' # 'plugin' or 'plugin_' is removed
}
fixes.each do |regex, replacement|
name = name.gsub(regex, replacement)
end
name
end | [
"def",
"fix_plugin_name",
"(",
"name",
")",
"name",
"=",
"name",
".",
"to_s",
".",
"downcase",
"fixes",
"=",
"{",
"/",
"\\-",
"/",
"=>",
"'_'",
",",
"# dashes and spaces become underscores",
"/",
"/",
"=>",
"''",
",",
"# anything other than lower case letters, n... | Applies a series of replacement rules to turn the requested plugin name into one
that is acceptable, returning that suggestion | [
"Applies",
"a",
"series",
"of",
"replacement",
"rules",
"to",
"turn",
"the",
"requested",
"plugin",
"name",
"into",
"one",
"that",
"is",
"acceptable",
"returning",
"that",
"suggestion"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/plugins/plugin_info_collector.rb#L79-L91 | train | Fixes the plugin name | [
30522,
13366,
8081,
1035,
13354,
2378,
1035,
2171,
1006,
2171,
1007,
2171,
1027,
2171,
1012,
2000,
1035,
1055,
1012,
2091,
18382,
8081,
2229,
1027,
1063,
1013,
1031,
1032,
1011,
1033,
1013,
1027,
1028,
1005,
1035,
1005,
1010,
1001,
11454,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.image | def image(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'image_for', &block)
define_method("#{name}_loaded?") do
return platform.image_loaded_for identifier.clone unless block_given?
self.send("#{name}_element").loaded?
end
end | ruby | def image(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'image_for', &block)
define_method("#{name}_loaded?") do
return platform.image_loaded_for identifier.clone unless block_given?
self.send("#{name}_element").loaded?
end
end | [
"def",
"image",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'image_for'",
",",
"block",
")",
"define_method",
"(",
"\"#{name}_loaded?\"",
")",
"do",
... | adds three methods - one to retrieve the image element, another to
check the load status of the image, and another to check the
image's existence.
@example
image(:logo, :id => 'logo')
# will generate 'logo_element', 'logo_loaded?', and 'logo?' methods
@param [Symbol] the name used for the generated methods
@param [Hash] identifier how we find an image.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"image",
"element",
"another",
"to",
"check",
"the",
"load",
"status",
"of",
"the",
"image",
"and",
"another",
"to",
"check",
"the",
"image",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L558-L564 | train | Returns the image object for the given name. | [
30522,
13366,
3746,
1006,
2171,
1010,
8909,
4765,
18095,
1027,
1063,
1024,
5950,
1027,
1028,
1014,
1065,
1010,
1004,
3796,
1007,
3115,
1035,
4725,
1006,
2171,
1010,
8909,
4765,
18095,
1010,
1005,
3746,
1035,
2005,
1005,
1010,
1004,
3796,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2016-10-02/generated/azure_mgmt_cdn/cdn_management_client.rb | Azure::CDN::Mgmt::V2016_10_02.CdnManagementClient.list_operations_next | def list_operations_next(next_page_link, custom_headers:nil)
response = list_operations_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_operations_next(next_page_link, custom_headers:nil)
response = list_operations_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_operations_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_operations_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"respon... | Lists all of the available CDN REST API operations.
@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 [OperationListResult] operation results. | [
"Lists",
"all",
"of",
"the",
"available",
"CDN",
"REST",
"API",
"operations",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2016-10-02/generated/azure_mgmt_cdn/cdn_management_client.rb#L506-L509 | train | Gets the next page of operations. | [
30522,
13366,
2862,
1035,
3136,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
3136,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
1035,
3931,
1035,
4957,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-s3/lib/aws-sdk-s3/bucket_website.rb | Aws::S3.BucketWebsite.delete | def delete(options = {})
options = options.merge(bucket: @bucket_name)
resp = @client.delete_bucket_website(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(bucket: @bucket_name)
resp = @client.delete_bucket_website(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"bucket",
":",
"@bucket_name",
")",
"resp",
"=",
"@client",
".",
"delete_bucket_website",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
bucket_website.delete()
@param [Hash] options ({})
@return [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-s3/lib/aws-sdk-s3/bucket_website.rb#L194-L198 | train | Delete the website from the bucket | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
13610,
1024,
1030,
13610,
1035,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
13610,
1035,
4037,
1006,
7047,
1007,
245... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2019_03_01.VirtualMachineScaleSets.begin_reimage | def begin_reimage(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
response = begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_input, custom_headers:custom_headers).value!
nil
end | ruby | def begin_reimage(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:nil, custom_headers:nil)
response = begin_reimage_async(resource_group_name, vm_scale_set_name, vm_scale_set_reimage_input:vm_scale_set_reimage_input, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_reimage",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_scale_set_reimage_input",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_reimage_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_sc... | Reimages (upgrade the operating system) one or more virtual machines in a VM
scale set which don't have a ephemeral OS disk, for virtual machines who have
a ephemeral OS disk the virtual machine is reset to initial state.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_scale_set_reimage_input [VirtualMachineScaleSetReimageParameters]
Parameters for Reimaging VM ScaleSet.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Reimages",
"(",
"upgrade",
"the",
"operating",
"system",
")",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"which",
"don",
"t",
"have",
"a",
"ephemeral",
"OS",
"disk",
"for",
"virtual",
"machines",
"who",
"have",
"a",
"ep... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L2452-L2455 | train | Reimage a virtual machine in a VM scale set. | [
30522,
13366,
4088,
1035,
24964,
26860,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
24964,
26860,
1035,
7953,
1024,
9152,
2140,
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... |
zendesk/ruby-kafka | lib/kafka/client.rb | Kafka.Client.producer | def producer(
compression_codec: nil,
compression_threshold: 1,
ack_timeout: 5,
required_acks: :all,
max_retries: 2,
retry_backoff: 1,
max_buffer_size: 1000,
max_buffer_bytesize: 10_000_000,
idempotent: false,
transactional: false,
transactional_id: nil,
transactional_timeout: 60
)
cluster = initialize_cluster
compressor = Compressor.new(
codec_name: compression_codec,
threshold: compression_threshold,
instrumenter: @instrumenter,
)
transaction_manager = TransactionManager.new(
cluster: cluster,
logger: @logger,
idempotent: idempotent,
transactional: transactional,
transactional_id: transactional_id,
transactional_timeout: transactional_timeout,
)
Producer.new(
cluster: cluster,
transaction_manager: transaction_manager,
logger: @logger,
instrumenter: @instrumenter,
compressor: compressor,
ack_timeout: ack_timeout,
required_acks: required_acks,
max_retries: max_retries,
retry_backoff: retry_backoff,
max_buffer_size: max_buffer_size,
max_buffer_bytesize: max_buffer_bytesize,
)
end | ruby | def producer(
compression_codec: nil,
compression_threshold: 1,
ack_timeout: 5,
required_acks: :all,
max_retries: 2,
retry_backoff: 1,
max_buffer_size: 1000,
max_buffer_bytesize: 10_000_000,
idempotent: false,
transactional: false,
transactional_id: nil,
transactional_timeout: 60
)
cluster = initialize_cluster
compressor = Compressor.new(
codec_name: compression_codec,
threshold: compression_threshold,
instrumenter: @instrumenter,
)
transaction_manager = TransactionManager.new(
cluster: cluster,
logger: @logger,
idempotent: idempotent,
transactional: transactional,
transactional_id: transactional_id,
transactional_timeout: transactional_timeout,
)
Producer.new(
cluster: cluster,
transaction_manager: transaction_manager,
logger: @logger,
instrumenter: @instrumenter,
compressor: compressor,
ack_timeout: ack_timeout,
required_acks: required_acks,
max_retries: max_retries,
retry_backoff: retry_backoff,
max_buffer_size: max_buffer_size,
max_buffer_bytesize: max_buffer_bytesize,
)
end | [
"def",
"producer",
"(",
"compression_codec",
":",
"nil",
",",
"compression_threshold",
":",
"1",
",",
"ack_timeout",
":",
"5",
",",
"required_acks",
":",
":all",
",",
"max_retries",
":",
"2",
",",
"retry_backoff",
":",
"1",
",",
"max_buffer_size",
":",
"1000... | Initializes a new Kafka producer.
@param ack_timeout [Integer] The number of seconds a broker can wait for
replicas to acknowledge a write before responding with a timeout.
@param required_acks [Integer, Symbol] The number of replicas that must acknowledge
a write, or `:all` if all in-sync replicas must acknowledge.
@param max_retries [Integer] the number of retries that should be attempted
before giving up sending messages to the cluster. Does not include the
original attempt.
@param retry_backoff [Integer] the number of seconds to wait between retries.
@param max_buffer_size [Integer] the number of messages allowed in the buffer
before new writes will raise {BufferOverflow} exceptions.
@param max_buffer_bytesize [Integer] the maximum size of the buffer in bytes.
attempting to produce messages when the buffer reaches this size will
result in {BufferOverflow} being raised.
@param compression_codec [Symbol, nil] the name of the compression codec to
use, or nil if no compression should be performed. Valid codecs: `:snappy`,
`:gzip`, `:lz4`, `:zstd`
@param compression_threshold [Integer] the number of messages that needs to
be in a message set before it should be compressed. Note that message sets
are per-partition rather than per-topic or per-producer.
@return [Kafka::Producer] the Kafka producer. | [
"Initializes",
"a",
"new",
"Kafka",
"producer",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/client.rb#L244-L287 | train | Creates a producer object | [
30522,
13366,
3135,
1006,
13379,
1035,
3642,
2278,
1024,
9152,
2140,
1010,
13379,
1035,
11207,
1024,
1015,
1010,
9353,
2243,
1035,
2051,
5833,
1024,
1019,
1010,
3223,
1035,
9353,
5705,
1024,
1024,
2035,
1010,
4098,
1035,
2128,
21011,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb | Azure::CDN::Mgmt::V2015_06_01.Endpoints.begin_create_with_http_info | def begin_create_with_http_info(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:nil)
begin_create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:custom_headers).value!
end | ruby | def begin_create_with_http_info(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:nil)
begin_create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_with_http_info",
"(",
"endpoint_name",
",",
"endpoint_properties",
",",
"profile_name",
",",
"resource_group_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_async",
"(",
"endpoint_name",
",",
"endpoint_properties",
",",
"profile_name",
",... | Creates a new CDN endpoint with the specified parameters.
@param endpoint_name [String] Name of the endpoint within the CDN profile.
@param endpoint_properties [EndpointCreateParameters] Endpoint properties
@param profile_name [String] Name of the CDN profile within the resource
group.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"a",
"new",
"CDN",
"endpoint",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb#L718-L720 | train | Creates an endpoint. | [
30522,
13366,
4088,
1035,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2203,
8400,
1035,
2171,
1010,
2203,
8400,
1035,
5144,
1010,
6337,
1035,
2171,
1010,
7692,
1035,
2177,
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... |
resque/resque | lib/resque/worker.rb | Resque.Worker.register_signal_handlers | def register_signal_handlers
trap('TERM') { graceful_term ? shutdown : shutdown! }
trap('INT') { shutdown! }
begin
trap('QUIT') { shutdown }
if term_child
trap('USR1') { new_kill_child }
else
trap('USR1') { kill_child }
end
trap('USR2') { pause_processing }
trap('CONT') { unpause_processing }
rescue ArgumentError
log_with_severity :warn, "Signals QUIT, USR1, USR2, and/or CONT not supported."
end
log_with_severity :debug, "Registered signals"
end | ruby | def register_signal_handlers
trap('TERM') { graceful_term ? shutdown : shutdown! }
trap('INT') { shutdown! }
begin
trap('QUIT') { shutdown }
if term_child
trap('USR1') { new_kill_child }
else
trap('USR1') { kill_child }
end
trap('USR2') { pause_processing }
trap('CONT') { unpause_processing }
rescue ArgumentError
log_with_severity :warn, "Signals QUIT, USR1, USR2, and/or CONT not supported."
end
log_with_severity :debug, "Registered signals"
end | [
"def",
"register_signal_handlers",
"trap",
"(",
"'TERM'",
")",
"{",
"graceful_term",
"?",
"shutdown",
":",
"shutdown!",
"}",
"trap",
"(",
"'INT'",
")",
"{",
"shutdown!",
"}",
"begin",
"trap",
"(",
"'QUIT'",
")",
"{",
"shutdown",
"}",
"if",
"term_child",
"t... | Registers the various signal handlers a worker responds to.
TERM: Shutdown immediately, stop processing jobs.
INT: Shutdown immediately, stop processing jobs.
QUIT: Shutdown after the current job has finished processing.
USR1: Kill the forked child immediately, continue processing jobs.
USR2: Don't process any new jobs
CONT: Start processing jobs again after a USR2 | [
"Registers",
"the",
"various",
"signal",
"handlers",
"a",
"worker",
"responds",
"to",
"."
] | adb633a0f6b98b1eb5a5a85bb36ebac9309978fd | https://github.com/resque/resque/blob/adb633a0f6b98b1eb5a5a85bb36ebac9309978fd/lib/resque/worker.rb#L386-L404 | train | Registers signal handlers for the process. | [
30522,
13366,
4236,
1035,
4742,
1035,
28213,
2015,
8132,
1006,
1005,
2744,
1005,
1007,
1063,
19415,
1035,
2744,
1029,
3844,
7698,
1024,
3844,
7698,
999,
1065,
8132,
1006,
1005,
20014,
1005,
1007,
1063,
3844,
7698,
999,
1065,
4088,
8132,
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_face/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb | Azure::CognitiveServices::Face::V1_0.SnapshotOperations.take_with_http_info | def take_with_http_info(type, object_id, apply_scope, user_data:nil, custom_headers:nil)
take_async(type, object_id, apply_scope, user_data:user_data, custom_headers:custom_headers).value!
end | ruby | def take_with_http_info(type, object_id, apply_scope, user_data:nil, custom_headers:nil)
take_async(type, object_id, apply_scope, user_data:user_data, custom_headers:custom_headers).value!
end | [
"def",
"take_with_http_info",
"(",
"type",
",",
"object_id",
",",
"apply_scope",
",",
"user_data",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"take_async",
"(",
"type",
",",
"object_id",
",",
"apply_scope",
",",
"user_data",
":user_data",
",",
"custom... | Submit an operation to take a snapshot of face list, large face list, person
group or large person group, with user-specified snapshot type, source object
id, apply scope and an optional user data.<br />
The snapshot interfaces are for users to backup and restore their face data
from one face subscription to another, inside same region or across regions.
The workflow contains two phases, user first calls Snapshot - Take to create
a copy of the source object and store it as a snapshot, then calls Snapshot -
Apply to paste the snapshot to target subscription. The snapshots are stored
in a centralized location (per Azure instance), so that they can be applied
cross accounts and regions.<br />
Taking snapshot is an asynchronous operation. An operation id can be obtained
from the "Operation-Location" field in response header, to be used in
OperationStatus - Get for tracking the progress of creating the snapshot. The
snapshot id will be included in the "resourceLocation" field in
OperationStatus - Get response when the operation status is "succeeded".<br
/>
Snapshot taking time depends on the number of person and face entries in the
source object. It could be in seconds, or up to several hours for 1,000,000
persons with multiple faces.<br />
Snapshots will be automatically expired and cleaned in 48 hours after it is
created by Snapshot - Take. User can delete the snapshot using Snapshot -
Delete by themselves any time before expiration.<br />
Taking snapshot for a certain object will not block any other operations
against the object. All read-only operations (Get/List and
Identify/FindSimilar/Verify) can be conducted as usual. For all writable
operations, including Add/Update/Delete the source object or its
persons/faces and Train, they are not blocked but not recommended because
writable updates may not be reflected on the snapshot during its taking.
After snapshot taking is completed, all readable and writable operations can
work as normal. Snapshot will also include the training results of the source
object, which means target subscription the snapshot applied to does not need
re-train the target object before calling Identify/FindSimilar.<br />
* Free-tier subscription quota: 100 take operations per month.
* S0-tier subscription quota: 100 take operations per day.
@param type [SnapshotObjectType] User specified type for the source object to
take snapshot from. Currently FaceList, PersonGroup, LargeFaceList and
LargePersonGroup are supported. Possible values include: 'FaceList',
'LargeFaceList', 'LargePersonGroup', 'PersonGroup'
@param object_id [String] User specified source object id to take snapshot
from.
@param apply_scope User specified array of target Face subscription ids for
the snapshot. For each snapshot, only subscriptions included in the
applyScope of Snapshot - Take can apply it.
@param user_data [String] User specified data about the snapshot for any
purpose. Length should not exceed 16KB.
@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. | [
"Submit",
"an",
"operation",
"to",
"take",
"a",
"snapshot",
"of",
"face",
"list",
"large",
"face",
"list",
"person",
"group",
"or",
"large",
"person",
"group",
"with",
"user",
"-",
"specified",
"snapshot",
"type",
"source",
"object",
"id",
"apply",
"scope",
... | 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#L132-L134 | train | Take a sequence of objects in a given type. | [
30522,
13366,
2202,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2828,
1010,
4874,
1035,
8909,
1010,
6611,
1035,
9531,
1010,
5310,
1035,
2951,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2202,
1035,
2004,
6038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_resources_management/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups.rb | Azure::ResourcesManagement::Mgmt::V2017_11_01_preview.ManagementGroups.list_with_http_info | def list_with_http_info(cache_control:'no-cache', skiptoken:nil, custom_headers:nil)
list_async(cache_control:cache_control, skiptoken:skiptoken, custom_headers:custom_headers).value!
end | ruby | def list_with_http_info(cache_control:'no-cache', skiptoken:nil, custom_headers:nil)
list_async(cache_control:cache_control, skiptoken:skiptoken, custom_headers:custom_headers).value!
end | [
"def",
"list_with_http_info",
"(",
"cache_control",
":",
"'no-cache'",
",",
"skiptoken",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_async",
"(",
"cache_control",
":cache_control",
",",
"skiptoken",
":",
"skiptoken",
",",
"custom_headers",
":custom_hea... | List management groups for the authenticated user.
@param cache_control [String] Indicates that the request shouldn't utilize
any caches.
@param skiptoken [String] Page continuation token is only used if a previous
operation returned a partial result.
If a previous response contains a nextLink element, the value of the nextLink
element will include a token parameter that specifies a starting point to use
for subsequent calls.
@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",
"management",
"groups",
"for",
"the",
"authenticated",
"user",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources_management/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups.rb#L67-L69 | train | Gets the list of the available image types. | [
30522,
13366,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
17053,
1035,
2491,
1024,
1005,
2053,
1011,
17053,
1005,
1010,
13558,
18715,
2368,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
1035,
2004,
6038... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/drawing/pic.rb | Axlsx.Pic.hyperlink= | def hyperlink=(v, options={})
options[:href] = v
if hyperlink.is_a?(Hyperlink)
options.each do |o|
hyperlink.send("#{o[0]}=", o[1]) if hyperlink.respond_to? "#{o[0]}="
end
else
@hyperlink = Hyperlink.new(self, options)
end
hyperlink
end | ruby | def hyperlink=(v, options={})
options[:href] = v
if hyperlink.is_a?(Hyperlink)
options.each do |o|
hyperlink.send("#{o[0]}=", o[1]) if hyperlink.respond_to? "#{o[0]}="
end
else
@hyperlink = Hyperlink.new(self, options)
end
hyperlink
end | [
"def",
"hyperlink",
"=",
"(",
"v",
",",
"options",
"=",
"{",
"}",
")",
"options",
"[",
":href",
"]",
"=",
"v",
"if",
"hyperlink",
".",
"is_a?",
"(",
"Hyperlink",
")",
"options",
".",
"each",
"do",
"|",
"o",
"|",
"hyperlink",
".",
"send",
"(",
"\"... | sets or updates a hyperlink for this image.
@param [String] v The href value for the hyper link
@option options @see Hyperlink#initialize All options available to the Hyperlink class apply - however href will be overridden with the v parameter value. | [
"sets",
"or",
"updates",
"a",
"hyperlink",
"for",
"this",
"image",
"."
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/pic.rb#L62-L72 | train | Sets the hyperlink to the given url. | [
30522,
13366,
23760,
13767,
1027,
1006,
1058,
1010,
7047,
1027,
1063,
1065,
1007,
7047,
1031,
1024,
17850,
12879,
1033,
1027,
1058,
2065,
23760,
13767,
1012,
2003,
1035,
1037,
1029,
1006,
23760,
13767,
1007,
7047,
1012,
2169,
2079,
1064,
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... |
rmagick/rmagick | lib/rvg/rvg.rb | Magick.RVG.add_outermost_primitives | def add_outermost_primitives(gc) #:nodoc:
add_transform_primitives(gc)
gc.push
add_viewbox_primitives(@width, @height, gc)
add_style_primitives(gc)
@content.each { |element| element.add_primitives(gc) }
gc.pop
self
end | ruby | def add_outermost_primitives(gc) #:nodoc:
add_transform_primitives(gc)
gc.push
add_viewbox_primitives(@width, @height, gc)
add_style_primitives(gc)
@content.each { |element| element.add_primitives(gc) }
gc.pop
self
end | [
"def",
"add_outermost_primitives",
"(",
"gc",
")",
"#:nodoc:",
"add_transform_primitives",
"(",
"gc",
")",
"gc",
".",
"push",
"add_viewbox_primitives",
"(",
"@width",
",",
"@height",
",",
"gc",
")",
"add_style_primitives",
"(",
"gc",
")",
"@content",
".",
"each"... | Primitives for the outermost RVG object | [
"Primitives",
"for",
"the",
"outermost",
"RVG",
"object"
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rvg/rvg.rb#L260-L268 | train | Add the outermost primitive objects to the current object. | [
30522,
13366,
5587,
1035,
6058,
11800,
1035,
10968,
2015,
1006,
1043,
2278,
1007,
1001,
1024,
7293,
10085,
1024,
5587,
1035,
10938,
1035,
10968,
2015,
1006,
1043,
2278,
1007,
1043,
2278,
1012,
5245,
5587,
1035,
3193,
8758,
1035,
10968,
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... |
zendesk/ruby-kafka | lib/kafka/producer.rb | Kafka.Producer.transaction | def transaction
raise 'This method requires a block' unless block_given?
begin_transaction
yield
commit_transaction
rescue Kafka::Producer::AbortTransaction
abort_transaction
rescue
abort_transaction
raise
end | ruby | def transaction
raise 'This method requires a block' unless block_given?
begin_transaction
yield
commit_transaction
rescue Kafka::Producer::AbortTransaction
abort_transaction
rescue
abort_transaction
raise
end | [
"def",
"transaction",
"raise",
"'This method requires a block'",
"unless",
"block_given?",
"begin_transaction",
"yield",
"commit_transaction",
"rescue",
"Kafka",
"::",
"Producer",
"::",
"AbortTransaction",
"abort_transaction",
"rescue",
"abort_transaction",
"raise",
"end"
] | Syntactic sugar to enable easier transaction usage. Do the following steps
- Start the transaction (with Producer#begin_transaction)
- Yield the given block
- Commit the transaction (with Producer#commit_transaction)
If the block raises exception, the transaction is automatically aborted
*before* bubble up the exception.
If the block raises Kafka::Producer::AbortTransaction indicator exception,
it aborts the transaction silently, without throwing up that exception.
@return [nil] | [
"Syntactic",
"sugar",
"to",
"enable",
"easier",
"transaction",
"usage",
".",
"Do",
"the",
"following",
"steps"
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/producer.rb#L360-L370 | train | Calls the given block in a transaction. | [
30522,
13366,
12598,
5333,
1005,
2023,
4118,
5942,
1037,
3796,
1005,
4983,
3796,
1035,
2445,
1029,
4088,
1035,
12598,
10750,
10797,
1035,
12598,
5343,
10556,
24316,
2050,
1024,
1024,
3135,
1024,
1024,
11113,
11589,
6494,
3619,
18908,
3258,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.update_with_http_info | def update_with_http_info(resource_group_name, name, hosting_environment_envelope, custom_headers:nil)
update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, name, hosting_environment_envelope, custom_headers:nil)
update_async(resource_group_name, name, hosting_environment_envelope, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"name",
",",
"hosting_environment_envelope",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
"name",
",",
"hosting_environment_envelope",
",",
"custom_headers",
":cus... | Create or update an App Service Environment.
Create or update 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 hosting_environment_envelope [AppServiceEnvironmentPatchResource]
Configuration details of the App Service Environment.
@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",
"or",
"update",
"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#L451-L453 | train | Updates an existing hosting environment envelope. | [
30522,
13366,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
9936,
1035,
4044,
1035,
11255,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
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_logic/lib/2015-02-01-preview/generated/azure_mgmt_logic/workflow_access_keys.rb | Azure::Logic::Mgmt::V2015_02_01_preview.WorkflowAccessKeys.regenerate_secret_key | def regenerate_secret_key(resource_group_name, workflow_name, access_key_name, parameters, custom_headers:nil)
response = regenerate_secret_key_async(resource_group_name, workflow_name, access_key_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def regenerate_secret_key(resource_group_name, workflow_name, access_key_name, parameters, custom_headers:nil)
response = regenerate_secret_key_async(resource_group_name, workflow_name, access_key_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"regenerate_secret_key",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"access_key_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"regenerate_secret_key_async",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"a... | Regenerates secret key.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param access_key_name [String] The workflow access key name.
@param parameters [RegenerateSecretKeyParameters] The parameters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [WorkflowSecretKeys] operation results. | [
"Regenerates",
"secret",
"key",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2015-02-01-preview/generated/azure_mgmt_logic/workflow_access_keys.rb#L525-L528 | train | Regenerate the secret key for a workflow. | [
30522,
13366,
19723,
24454,
3686,
1035,
3595,
1035,
3145,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
3229,
1035,
3145,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb | Aws::RDS.DBInstance.reboot | def reboot(options = {})
options = options.merge(db_instance_identifier: @id)
resp = @client.reboot_db_instance(options)
DBInstance.new(
id: resp.data.db_instance.db_instance_identifier,
data: resp.data.db_instance,
client: @client
)
end | ruby | def reboot(options = {})
options = options.merge(db_instance_identifier: @id)
resp = @client.reboot_db_instance(options)
DBInstance.new(
id: resp.data.db_instance.db_instance_identifier,
data: resp.data.db_instance,
client: @client
)
end | [
"def",
"reboot",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"db_instance_identifier",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"reboot_db_instance",
"(",
"options",
")",
"DBInstance",
".",
"new",
"(",
"id",
":"... | @example Request syntax with placeholder values
dbinstance = db_instance.reboot({
force_failover: false,
})
@param [Hash] options ({})
@option options [Boolean] :force_failover
When `true`, the reboot is conducted through a MultiAZ failover.
Constraint: You can't specify `true` if the instance is not
configured for MultiAZ.
@return [DBInstance] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb#L2485-L2493 | train | Reboot the database instance | [
30522,
13366,
2128,
27927,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
16962,
1035,
6013,
1035,
8909,
4765,
18095,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
2128,
27927,
1035,
16962,
1035,
601... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
middleman/middleman | middleman-core/lib/middleman-core/template_context.rb | Middleman.TemplateContext.render_file | def render_file(file, locs, opts, &block)
_render_with_all_renderers(file[:relative_path].to_s, locs, self, opts, &block)
end | ruby | def render_file(file, locs, opts, &block)
_render_with_all_renderers(file[:relative_path].to_s, locs, self, opts, &block)
end | [
"def",
"render_file",
"(",
"file",
",",
"locs",
",",
"opts",
",",
"&",
"block",
")",
"_render_with_all_renderers",
"(",
"file",
"[",
":relative_path",
"]",
".",
"to_s",
",",
"locs",
",",
"self",
",",
"opts",
",",
"block",
")",
"end"
] | Render a path with locs, opts and contents block.
@api private
@param [Middleman::SourceFile] file The file.
@param [Hash] locs Template locals.
@param [Hash] opts Template options.
@param [Proc] block A block will be evaluated to return internal contents.
@return [String] The resulting content string.
Contract IsA['Middleman::SourceFile'], Hash, Hash, Maybe[Proc] => String | [
"Render",
"a",
"path",
"with",
"locs",
"opts",
"and",
"contents",
"block",
"."
] | a0dd9f78094813162895511e8516e0c5507cee50 | https://github.com/middleman/middleman/blob/a0dd9f78094813162895511e8516e0c5507cee50/middleman-core/lib/middleman-core/template_context.rb#L218-L220 | train | Render a file with all the renderers | [
30522,
13366,
17552,
1035,
5371,
1006,
5371,
1010,
8840,
6169,
1010,
23569,
2015,
1010,
1004,
3796,
1007,
1035,
17552,
1035,
2007,
1035,
2035,
1035,
17552,
2545,
1006,
5371,
1031,
1024,
5816,
1035,
4130,
1033,
1012,
2000,
1035,
1055,
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... |
square/connect-ruby-sdk | lib/square_connect/api/catalog_api.rb | SquareConnect.CatalogApi.update_item_modifier_lists | def update_item_modifier_lists(body, opts = {})
data, _status_code, _headers = update_item_modifier_lists_with_http_info(body, opts)
return data
end | ruby | def update_item_modifier_lists(body, opts = {})
data, _status_code, _headers = update_item_modifier_lists_with_http_info(body, opts)
return data
end | [
"def",
"update_item_modifier_lists",
"(",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"update_item_modifier_lists_with_http_info",
"(",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | UpdateItemModifierLists
Updates the [CatalogModifierList](#type-catalogmodifierlist) objects that apply to the targeted [CatalogItem](#type-catalogitem) without having to perform an upsert on the entire item.
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [UpdateItemModifierListsResponse] | [
"UpdateItemModifierLists",
"Updates",
"the",
"[",
"CatalogModifierList",
"]",
"(",
"#type",
"-",
"catalogmodifierlist",
")",
"objects",
"that",
"apply",
"to",
"the",
"targeted",
"[",
"CatalogItem",
"]",
"(",
"#type",
"-",
"catalogitem",
")",
"without",
"having",
... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/catalog_api.rb#L466-L469 | train | Updates item modifier lists | [
30522,
13366,
10651,
1035,
8875,
1035,
16913,
18095,
1035,
7201,
1006,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
10651,
1035,
8875,
1035,
16913,
18095,
1035,
7201,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_tasks.rb | Azure::ContainerRegistry::Mgmt::V2018_02_01_preview.BuildTasks.begin_update | def begin_update(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:nil)
response = begin_update_async(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:nil)
response = begin_update_async(resource_group_name, registry_name, build_task_name, build_task_update_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update",
"(",
"resource_group_name",
",",
"registry_name",
",",
"build_task_name",
",",
"build_task_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"b... | Updates a build task 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 build_task_name [String] The name of the container registry build
task.
@param build_task_update_parameters [BuildTaskUpdateParameters] The
parameters for updating a build task.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [BuildTask] operation results. | [
"Updates",
"a",
"build",
"task",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2018-02-01-preview/generated/azure_mgmt_container_registry/build_tasks.rb#L739-L742 | train | Updates a build task. | [
30522,
13366,
4088,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
3857,
1035,
4708,
1035,
2171,
1010,
3857,
1035,
4708,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/storage_accounts.rb | Azure::DataLakeAnalytics::Mgmt::V2016_11_01.StorageAccounts.delete_with_http_info | def delete_with_http_info(resource_group_name, account_name, storage_account_name, custom_headers:nil)
delete_async(resource_group_name, account_name, storage_account_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, account_name, storage_account_name, custom_headers:nil)
delete_async(resource_group_name, account_name, storage_account_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"storage_account_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"storage_account_name",
",",
"custom_headers",
":cus... | Updates the specified Data Lake Analytics account to remove an Azure Storage
account.
@param resource_group_name [String] The name of the Azure resource group.
@param account_name [String] The name of the Data Lake Analytics account.
@param storage_account_name [String] The name of the Azure Storage account to
remove
@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",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"to",
"remove",
"an",
"Azure",
"Storage",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/storage_accounts.rb#L507-L509 | train | Deletes the specified container network storage account. | [
30522,
13366,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3972,
12870,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vault-ruby | lib/vault/api/sys/auth.rb | Vault.Sys.put_auth_tune | def put_auth_tune(path, config = {})
json = client.put("/v1/sys/auth/#{encode_path(path)}/tune", JSON.fast_generate(config))
if json.nil?
return true
else
return Secret.decode(json)
end
end | ruby | def put_auth_tune(path, config = {})
json = client.put("/v1/sys/auth/#{encode_path(path)}/tune", JSON.fast_generate(config))
if json.nil?
return true
else
return Secret.decode(json)
end
end | [
"def",
"put_auth_tune",
"(",
"path",
",",
"config",
"=",
"{",
"}",
")",
"json",
"=",
"client",
".",
"put",
"(",
"\"/v1/sys/auth/#{encode_path(path)}/tune\"",
",",
"JSON",
".",
"fast_generate",
"(",
"config",
")",
")",
"if",
"json",
".",
"nil?",
"return",
"... | Write the given auth path's configuration.
@example
Vault.sys.auth_tune("github", "default_lease_ttl" => 600, "max_lease_ttl" => 1200 ) #=> true
@param [String] path
the path to retrieve configuration for
@return [AuthConfig]
configuration of the given auth path | [
"Write",
"the",
"given",
"auth",
"path",
"s",
"configuration",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/sys/auth.rb#L107-L114 | train | Put an auth tune | [
30522,
13366,
2404,
1035,
8740,
2705,
1035,
8694,
1006,
4130,
1010,
9530,
8873,
2290,
1027,
1063,
1065,
1007,
1046,
3385,
1027,
7396,
1012,
2404,
1006,
1000,
1013,
1058,
2487,
1013,
25353,
2015,
1013,
8740,
2705,
1013,
1001,
1063,
4372,
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_reservations/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb | Azure::Reservations::Mgmt::V2017_11_01.Reservation.list_revisions_next | def list_revisions_next(next_page_link, custom_headers:nil)
response = list_revisions_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_revisions_next(next_page_link, custom_headers:nil)
response = list_revisions_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_revisions_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_revisions_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response... | Get `Reservation` revisions.
List of all the revisions for the `Reservation`.
@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 [ReservationList] operation results. | [
"Get",
"Reservation",
"revisions",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_reservations/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb#L976-L979 | train | Gets the next page of revisions for a given App Service Environment. | [
30522,
13366,
2862,
1035,
24699,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
24699,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
1035,
3931,
1035,
4957,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_privatedns/lib/2018-09-01/generated/azure_mgmt_privatedns/record_sets.rb | Azure::PrivateDns::Mgmt::V2018_09_01.RecordSets.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, private_zone_name, record_type, relative_record_set_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
create_or_update_async(resource_group_name, private_zone_name, record_type, relative_record_set_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, private_zone_name, record_type, relative_record_set_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
create_or_update_async(resource_group_name, private_zone_name, record_type, relative_record_set_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"private_zone_name",
",",
"record_type",
",",
"relative_record_set_name",
",",
"parameters",
",",
"if_match",
":",
"nil",
",",
"if_none_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")... | Creates or updates a record set within a Private DNS zone.
@param resource_group_name [String] The name of the resource group.
@param private_zone_name [String] The name of the Private DNS zone (without a
terminating dot).
@param record_type [RecordType] The type of DNS record in this record set.
Record sets of type SOA can be updated but not created (they are created when
the Private DNS zone is created). Possible values include: 'A', 'AAAA',
'CNAME', 'MX', 'PTR', 'SOA', 'SRV', 'TXT'
@param relative_record_set_name [String] The name of the record set, relative
to the name of the zone.
@param parameters [RecordSet] Parameters supplied to the CreateOrUpdate
operation.
@param if_match [String] The ETag of the record set. Omit this value to
always overwrite the current record set. Specify the last-seen ETag value to
prevent accidentally overwriting any concurrent changes.
@param if_none_match [String] Set to '*' to allow a new record set to be
created, but to prevent updating an existing record set. Other values will be
ignored.
@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",
"record",
"set",
"within",
"a",
"Private",
"DNS",
"zone",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_privatedns/lib/2018-09-01/generated/azure_mgmt_privatedns/record_sets.rb#L79-L81 | train | Creates or updates a record set. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2797,
1035,
4224,
1035,
2171,
1010,
2501,
1035,
2828,
1010,
5816,
1035,
2501,
1035,
2275,
1035,
2171,
1010,
11709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kmuto/review | lib/epubmaker/producer.rb | EPUBMaker.Producer.colophon | def colophon(wobj)
s = @epub.colophon
if !s.nil? && !wobj.nil?
wobj.puts s
end
end | ruby | def colophon(wobj)
s = @epub.colophon
if !s.nil? && !wobj.nil?
wobj.puts s
end
end | [
"def",
"colophon",
"(",
"wobj",
")",
"s",
"=",
"@epub",
".",
"colophon",
"if",
"!",
"s",
".",
"nil?",
"&&",
"!",
"wobj",
".",
"nil?",
"wobj",
".",
"puts",
"s",
"end",
"end"
] | Write colophon file to IO object +wobj+. | [
"Write",
"colophon",
"file",
"to",
"IO",
"object",
"+",
"wobj",
"+",
"."
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/producer.rb#L150-L155 | train | Return the colophon of the object | [
30522,
13366,
8902,
7361,
8747,
1006,
24185,
2497,
3501,
1007,
1055,
1027,
1030,
4958,
12083,
1012,
8902,
7361,
8747,
2065,
999,
1055,
1012,
9152,
2140,
1029,
1004,
1004,
999,
24185,
2497,
3501,
1012,
9152,
2140,
1029,
24185,
2497,
3501,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activerecord/lib/active_record/database_configurations.rb | ActiveRecord.DatabaseConfigurations.find_db_config | def find_db_config(env)
configurations.find do |db_config|
db_config.env_name == env.to_s ||
(db_config.for_current_env? && db_config.spec_name == env.to_s)
end
end | ruby | def find_db_config(env)
configurations.find do |db_config|
db_config.env_name == env.to_s ||
(db_config.for_current_env? && db_config.spec_name == env.to_s)
end
end | [
"def",
"find_db_config",
"(",
"env",
")",
"configurations",
".",
"find",
"do",
"|",
"db_config",
"|",
"db_config",
".",
"env_name",
"==",
"env",
".",
"to_s",
"||",
"(",
"db_config",
".",
"for_current_env?",
"&&",
"db_config",
".",
"spec_name",
"==",
"env",
... | Returns a single DatabaseConfig object based on the requested environment.
If the application has multiple databases +find_db_config+ will return
the first DatabaseConfig for the environment. | [
"Returns",
"a",
"single",
"DatabaseConfig",
"object",
"based",
"on",
"the",
"requested",
"environment",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/database_configurations.rb#L70-L75 | train | Find the DB config for the given environment | [
30522,
13366,
2424,
1035,
16962,
1035,
9530,
8873,
2290,
1006,
4372,
2615,
1007,
22354,
1012,
2424,
2079,
1064,
16962,
1035,
9530,
8873,
2290,
1064,
16962,
1035,
9530,
8873,
2290,
1012,
4372,
2615,
1035,
2171,
1027,
1027,
4372,
2615,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sunspot/sunspot | sunspot/lib/sunspot/composite_setup.rb | Sunspot.CompositeSetup.dynamic_field_factories_hash | def dynamic_field_factories_hash
@dynamic_field_factories_hash ||=
begin
dynamic_field_factories_hash = @types.inject({}) do |hash, type|
Setup.for(type).dynamic_field_factories.each do |field_factory|
(hash[field_factory.name.to_sym] ||= {})[type.name] = field_factory
end
hash
end
dynamic_field_factories_hash.each_pair do |field_name, field_configurations_hash|
if @types.any? { |type| field_configurations_hash[type.name].nil? }
dynamic_field_factories_hash.delete(field_name)
else
dynamic_field_factories_hash[field_name] = field_configurations_hash.values.first
end
end
end
end | ruby | def dynamic_field_factories_hash
@dynamic_field_factories_hash ||=
begin
dynamic_field_factories_hash = @types.inject({}) do |hash, type|
Setup.for(type).dynamic_field_factories.each do |field_factory|
(hash[field_factory.name.to_sym] ||= {})[type.name] = field_factory
end
hash
end
dynamic_field_factories_hash.each_pair do |field_name, field_configurations_hash|
if @types.any? { |type| field_configurations_hash[type.name].nil? }
dynamic_field_factories_hash.delete(field_name)
else
dynamic_field_factories_hash[field_name] = field_configurations_hash.values.first
end
end
end
end | [
"def",
"dynamic_field_factories_hash",
"@dynamic_field_factories_hash",
"||=",
"begin",
"dynamic_field_factories_hash",
"=",
"@types",
".",
"inject",
"(",
"{",
"}",
")",
"do",
"|",
"hash",
",",
"type",
"|",
"Setup",
".",
"for",
"(",
"type",
")",
".",
"dynamic_fi... | Return a hash of dynamic field base names to dynamic field factories for
those base names. Criteria for the inclusion are the same as for
#fields_hash() | [
"Return",
"a",
"hash",
"of",
"dynamic",
"field",
"base",
"names",
"to",
"dynamic",
"field",
"factories",
"for",
"those",
"base",
"names",
".",
"Criteria",
"for",
"the",
"inclusion",
"are",
"the",
"same",
"as",
"for",
"#fields_hash",
"()"
] | 31dd76cd7a14a4ef7bd541de97483d8cd72ff685 | https://github.com/sunspot/sunspot/blob/31dd76cd7a14a4ef7bd541de97483d8cd72ff685/sunspot/lib/sunspot/composite_setup.rb#L183-L200 | train | Returns a hash of dynamic field factories | [
30522,
13366,
8790,
1035,
2492,
1035,
11123,
1035,
23325,
1030,
8790,
1035,
2492,
1035,
11123,
1035,
23325,
1064,
1064,
1027,
4088,
8790,
1035,
2492,
1035,
11123,
1035,
23325,
1027,
1030,
4127,
1012,
1999,
20614,
1006,
1063,
1065,
1007,
207... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
haml/haml | lib/haml/helpers.rb | Haml.Helpers.haml_bind_proc | def haml_bind_proc(&proc)
_hamlout = haml_buffer
#double assignment is to avoid warnings
_erbout = _erbout = _hamlout.buffer
proc { |*args| proc.call(*args) }
end | ruby | def haml_bind_proc(&proc)
_hamlout = haml_buffer
#double assignment is to avoid warnings
_erbout = _erbout = _hamlout.buffer
proc { |*args| proc.call(*args) }
end | [
"def",
"haml_bind_proc",
"(",
"&",
"proc",
")",
"_hamlout",
"=",
"haml_buffer",
"#double assignment is to avoid warnings",
"_erbout",
"=",
"_erbout",
"=",
"_hamlout",
".",
"buffer",
"proc",
"{",
"|",
"*",
"args",
"|",
"proc",
".",
"call",
"(",
"args",
")",
"... | Gives a proc the same local `_hamlout` and `_erbout` variables
that the current template has.
@param proc [#call] The proc to bind
@return [Proc] A new proc with the new variables bound | [
"Gives",
"a",
"proc",
"the",
"same",
"local",
"_hamlout",
"and",
"_erbout",
"variables",
"that",
"the",
"current",
"template",
"has",
"."
] | 9aa0fbe4a91b999978927be569d2ad0cd39076f1 | https://github.com/haml/haml/blob/9aa0fbe4a91b999978927be569d2ad0cd39076f1/lib/haml/helpers.rb#L682-L687 | train | Bind a proc to the Haml buffer. | [
30522,
13366,
10654,
2140,
1035,
14187,
1035,
4013,
2278,
1006,
1004,
4013,
2278,
1007,
1035,
10654,
23743,
2102,
1027,
10654,
2140,
1035,
17698,
1001,
3313,
8775,
2003,
2000,
4468,
16234,
1035,
9413,
5092,
4904,
1027,
1035,
9413,
5092,
490... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.submit_property_batch | def submit_property_batch(name_id, property_batch_description_list, timeout:60, custom_headers:nil)
response = submit_property_batch_async(name_id, property_batch_description_list, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def submit_property_batch(name_id, property_batch_description_list, timeout:60, custom_headers:nil)
response = submit_property_batch_async(name_id, property_batch_description_list, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"submit_property_batch",
"(",
"name_id",
",",
"property_batch_description_list",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"submit_property_batch_async",
"(",
"name_id",
",",
"property_batch_description_list",
",",
"timeo... | Submits a property batch.
Submits a batch of property operations. Either all or none of the operations
will be committed.
@param name_id [String] The Service Fabric name, without the 'fabric:' URI
scheme.
@param property_batch_description_list [PropertyBatchDescriptionList]
Describes the property batch operations to be submitted.
@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 [PropertyBatchInfo] operation results. | [
"Submits",
"a",
"property",
"batch",
"."
] | 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#L27066-L27069 | train | Submit a property batch of properties. | [
30522,
13366,
12040,
1035,
3200,
1035,
14108,
1006,
2171,
1035,
8909,
1010,
3200,
1035,
14108,
1035,
6412,
1035,
2862,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
12040,
1035,
3200,
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... |
jeremytregunna/ruby-trello | lib/trello/attachment.rb | Trello.Attachment.update_fields | def update_fields(fields)
attributes[:name] = fields['name'] || attributes[:name]
attributes[:id] = fields['id'] || attributes[:id]
attributes[:pos] = fields['pos'] || attributes[:pos]
attributes[:url] = fields['url'] || attributes[:url]
attributes[:bytes] = fields['bytes'].to_i || attributes[:bytes]
attributes[:member_id] = fields['idMember'] || attributes[:member_id]
attributes[:date] = Time.parse(fields['date']).presence || attributes[:date]
attributes[:is_upload] = fields['isUpload'] if fields.has_key?('isUpload')
attributes[:mime_type] = fields['mimeType'] || attributes[:mime_type]
attributes[:previews] = fields['previews'] if fields.has_key?('previews')
self
end | ruby | def update_fields(fields)
attributes[:name] = fields['name'] || attributes[:name]
attributes[:id] = fields['id'] || attributes[:id]
attributes[:pos] = fields['pos'] || attributes[:pos]
attributes[:url] = fields['url'] || attributes[:url]
attributes[:bytes] = fields['bytes'].to_i || attributes[:bytes]
attributes[:member_id] = fields['idMember'] || attributes[:member_id]
attributes[:date] = Time.parse(fields['date']).presence || attributes[:date]
attributes[:is_upload] = fields['isUpload'] if fields.has_key?('isUpload')
attributes[:mime_type] = fields['mimeType'] || attributes[:mime_type]
attributes[:previews] = fields['previews'] if fields.has_key?('previews')
self
end | [
"def",
"update_fields",
"(",
"fields",
")",
"attributes",
"[",
":name",
"]",
"=",
"fields",
"[",
"'name'",
"]",
"||",
"attributes",
"[",
":name",
"]",
"attributes",
"[",
":id",
"]",
"=",
"fields",
"[",
"'id'",
"]",
"||",
"attributes",
"[",
":id",
"]",
... | Update the fields of an attachment.
Supply a hash of stringkeyed data retrieved from the Trello API representing
an attachment. | [
"Update",
"the",
"fields",
"of",
"an",
"attachment",
"."
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/attachment.rb#L26-L38 | train | Update the fields of the object | [
30522,
13366,
10651,
1035,
4249,
1006,
4249,
1007,
12332,
1031,
1024,
2171,
1033,
1027,
4249,
1031,
1005,
2171,
1005,
1033,
1064,
1064,
12332,
1031,
1024,
2171,
1033,
12332,
1031,
1024,
8909,
1033,
1027,
4249,
1031,
1005,
8909,
1005,
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_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_backup_policy_by_name_with_http_info | def get_backup_policy_by_name_with_http_info(backup_policy_name, timeout:60, custom_headers:nil)
get_backup_policy_by_name_async(backup_policy_name, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_backup_policy_by_name_with_http_info(backup_policy_name, timeout:60, custom_headers:nil)
get_backup_policy_by_name_async(backup_policy_name, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_backup_policy_by_name_with_http_info",
"(",
"backup_policy_name",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_backup_policy_by_name_async",
"(",
"backup_policy_name",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_h... | Gets a particular backup policy by name.
Gets a particular backup policy identified by {backupPolicyName}
@param backup_policy_name [String] The name of the backup policy.
@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",
"a",
"particular",
"backup",
"policy",
"by",
"name",
"."
] | 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#L22597-L22599 | train | Gets the backup policy by name. | [
30522,
13366,
2131,
1035,
10200,
1035,
3343,
1035,
2011,
1035,
2171,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10200,
1035,
3343,
1035,
2171,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
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... |
meew0/discordrb | lib/discordrb/commands/command_bot.rb | Discordrb::Commands.CommandBot.simple_execute | def simple_execute(chain, event)
return nil if chain.empty?
args = chain.split(' ')
execute_command(args[0].to_sym, event, args[1..-1])
end | ruby | def simple_execute(chain, event)
return nil if chain.empty?
args = chain.split(' ')
execute_command(args[0].to_sym, event, args[1..-1])
end | [
"def",
"simple_execute",
"(",
"chain",
",",
"event",
")",
"return",
"nil",
"if",
"chain",
".",
"empty?",
"args",
"=",
"chain",
".",
"split",
"(",
"' '",
")",
"execute_command",
"(",
"args",
"[",
"0",
"]",
".",
"to_sym",
",",
"event",
",",
"args",
"["... | Executes a command in a simple manner, without command chains or permissions.
@param chain [String] The command with its arguments separated by spaces.
@param event [CommandEvent] The event to pass to the command.
@return [String, nil] the command's result, if there is any. | [
"Executes",
"a",
"command",
"in",
"a",
"simple",
"manner",
"without",
"command",
"chains",
"or",
"permissions",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/commands/command_bot.rb#L327-L332 | train | Execute a command in the chain | [
30522,
13366,
3722,
1035,
15389,
1006,
4677,
1010,
2724,
1007,
2709,
9152,
2140,
2065,
4677,
1012,
4064,
1029,
12098,
5620,
1027,
4677,
1012,
3975,
1006,
1005,
1005,
1007,
15389,
1035,
3094,
1006,
12098,
5620,
1031,
1014,
1033,
1012,
2000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/db_log_file.rb | Aws::RDS.DBLogFile.download | def download(options = {})
options = options.merge(
db_instance_identifier: @instance_id,
log_file_name: @name
)
resp = @client.download_db_log_file_portion(options)
resp.data
end | ruby | def download(options = {})
options = options.merge(
db_instance_identifier: @instance_id,
log_file_name: @name
)
resp = @client.download_db_log_file_portion(options)
resp.data
end | [
"def",
"download",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"db_instance_identifier",
":",
"@instance_id",
",",
"log_file_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"download_db_log_file_portion",
"(",
"opti... | @!group Actions
@example Request syntax with placeholder values
db_log_file.download({
marker: "String",
number_of_lines: 1,
})
@param [Hash] options ({})
@option options [String] :marker
The pagination token provided in the previous request or "0". If the
Marker parameter is specified the response includes only records
beyond the marker until the end of the file or up to NumberOfLines.
@option options [Integer] :number_of_lines
The number of lines to download. If the number of lines specified
results in a file over 1 MB in size, the file is truncated at 1 MB in
size.
If the NumberOfLines parameter is specified, then the block of lines
returned can be from the beginning or the end of the log file,
depending on the value of the Marker parameter.
* If neither Marker or NumberOfLines are specified, the entire log
file is returned up to a maximum of 10000 lines, starting with the
most recent log entries first.
* If NumberOfLines is specified and Marker is not specified, then the
most recent lines from the end of the log file are returned.
* If Marker is specified as "0", then the specified number of lines
from the beginning of the log file are returned.
* You can download the log file in blocks of lines by specifying the
size of the block using the NumberOfLines parameter, and by
specifying a value of "0" for the Marker parameter in your first
request. Include the Marker value returned in the response as the
Marker value for the next request, continuing until the
AdditionalDataPending response element returns false.
@return [Types::DownloadDBLogFilePortionDetails] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_log_file.rb#L218-L225 | train | Download the log file from the database | [
30522,
13366,
8816,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
16962,
1035,
6013,
1035,
8909,
4765,
18095,
1024,
1030,
6013,
1035,
8909,
1010,
8833,
1035,
5371,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.report_deployed_service_package_health_with_http_info | def report_deployed_service_package_health_with_http_info(node_name, application_id, service_package_name, health_information, immediate:false, timeout:60, custom_headers:nil)
report_deployed_service_package_health_async(node_name, application_id, service_package_name, health_information, immediate:immediate, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def report_deployed_service_package_health_with_http_info(node_name, application_id, service_package_name, health_information, immediate:false, timeout:60, custom_headers:nil)
report_deployed_service_package_health_async(node_name, application_id, service_package_name, health_information, immediate:immediate, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"report_deployed_service_package_health_with_http_info",
"(",
"node_name",
",",
"application_id",
",",
"service_package_name",
",",
"health_information",
",",
"immediate",
":",
"false",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"report_de... | Sends a health report on the Service Fabric deployed service package.
Reports health state of the service package of the application deployed on a
Service Fabric node. The report must contain the information about the source
of the health report and property on which it is reported.
The report is sent to a Service Fabric gateway Service, which forwards to the
health store.
The report may be accepted by the gateway, but rejected by the health store
after extra validation.
For example, the health store may reject the report because of an invalid
parameter, like a stale sequence number.
To see whether the report was applied in the health store, get deployed
service package health and check that the report appears in the HealthEvents
section.
@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 health_information [HealthInformation] Describes the health
information for the health report. This information needs to be present in
all of the health reports sent to the health manager.
@param immediate [Boolean] A flag which indicates whether the report should
be sent immediately.
A health report is sent to a Service Fabric gateway Application, which
forwards to the health store.
If Immediate is set to true, the report is sent immediately from HTTP Gateway
to the health store, regardless of the fabric client settings that the HTTP
Gateway Application is using.
This is useful for critical reports that should be sent as soon as possible.
Depending on timing and other conditions, sending the report may still fail,
for example if the HTTP Gateway is closed or the message doesn't reach the
Gateway.
If Immediate is set to false, the report is sent based on the health client
settings from the HTTP Gateway. Therefore, it will be batched according to
the HealthReportSendInterval configuration.
This is the recommended setting because it allows the health client to
optimize health reporting messages to health store as well as health report
processing.
By default, reports are not sent immediately.
@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. | [
"Sends",
"a",
"health",
"report",
"on",
"the",
"Service",
"Fabric",
"deployed",
"service",
"package",
"."
] | 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#L16822-L16824 | train | Report health of deployed service package. | [
30522,
13366,
3189,
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,
2740,
1035,
2592,
1010,
6234,
1024,
6270,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb | Azure::Web::Mgmt::V2016_03_01.WebSiteManagementClient.update_source_control | def update_source_control(source_control_type, request_message, custom_headers:nil)
response = update_source_control_async(source_control_type, request_message, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_source_control(source_control_type, request_message, custom_headers:nil)
response = update_source_control_async(source_control_type, request_message, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_source_control",
"(",
"source_control_type",
",",
"request_message",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_source_control_async",
"(",
"source_control_type",
",",
"request_message",
",",
"custom_headers",
":custom_headers",
")",
"... | Updates source control token
Updates source control token
@param source_control_type [String] Type of source control
@param request_message [SourceControl] Source control token information
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SourceControl] operation results. | [
"Updates",
"source",
"control",
"token"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb#L526-L529 | train | Updates the source control of a given type. | [
30522,
13366,
10651,
1035,
3120,
1035,
2491,
1006,
3120,
1035,
2491,
1035,
2828,
1010,
5227,
1035,
4471,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
3120,
1035,
2491,
1035,
2004,
6038,
2278,
1006,
3120,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/rpc_server.rb | GRPC.Pool.stop | def stop
GRPC.logger.info('stopping, will wait for all the workers to exit')
@stop_mutex.synchronize do # wait @keep_alive seconds for workers to stop
@stopped = true
loop do
break unless ready_for_work?
worker_queue = @ready_workers.pop
worker_queue << [proc { throw :exit }, []]
end
@stop_cond.wait(@stop_mutex, @keep_alive) if @workers.size > 0
end
forcibly_stop_workers
GRPC.logger.info('stopped, all workers are shutdown')
end | ruby | def stop
GRPC.logger.info('stopping, will wait for all the workers to exit')
@stop_mutex.synchronize do # wait @keep_alive seconds for workers to stop
@stopped = true
loop do
break unless ready_for_work?
worker_queue = @ready_workers.pop
worker_queue << [proc { throw :exit }, []]
end
@stop_cond.wait(@stop_mutex, @keep_alive) if @workers.size > 0
end
forcibly_stop_workers
GRPC.logger.info('stopped, all workers are shutdown')
end | [
"def",
"stop",
"GRPC",
".",
"logger",
".",
"info",
"(",
"'stopping, will wait for all the workers to exit'",
")",
"@stop_mutex",
".",
"synchronize",
"do",
"# wait @keep_alive seconds for workers to stop",
"@stopped",
"=",
"true",
"loop",
"do",
"break",
"unless",
"ready_fo... | Stops the jobs in the pool | [
"Stops",
"the",
"jobs",
"in",
"the",
"pool"
] | f3937f0e55227a4ef3a23f895d3b204a947610f8 | https://github.com/grpc/grpc/blob/f3937f0e55227a4ef3a23f895d3b204a947610f8/src/ruby/lib/grpc/generic/rpc_server.rb#L93-L106 | train | stop all the workers | [
30522,
13366,
2644,
24665,
15042,
1012,
8833,
4590,
1012,
18558,
1006,
1005,
7458,
1010,
2097,
3524,
2005,
2035,
1996,
3667,
2000,
6164,
1005,
1007,
1030,
2644,
1035,
20101,
2595,
1012,
26351,
8093,
10698,
4371,
2079,
1001,
3524,
1030,
2562... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_privatedns/lib/2018-09-01/generated/azure_mgmt_privatedns/record_sets.rb | Azure::PrivateDns::Mgmt::V2018_09_01.RecordSets.get_with_http_info | def get_with_http_info(resource_group_name, private_zone_name, record_type, relative_record_set_name, custom_headers:nil)
get_async(resource_group_name, private_zone_name, record_type, relative_record_set_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, private_zone_name, record_type, relative_record_set_name, custom_headers:nil)
get_async(resource_group_name, private_zone_name, record_type, relative_record_set_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"private_zone_name",
",",
"record_type",
",",
"relative_record_set_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"private_zone_name",
",",
"record_type",
",",
"r... | Gets a record set.
@param resource_group_name [String] The name of the resource group.
@param private_zone_name [String] The name of the Private DNS zone (without a
terminating dot).
@param record_type [RecordType] The type of DNS record in this record set.
Possible values include: 'A', 'AAAA', 'CNAME', 'MX', 'PTR', 'SOA', 'SRV',
'TXT'
@param relative_record_set_name [String] The name of the record set, relative
to the name of the zone.
@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",
"a",
"record",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_privatedns/lib/2018-09-01/generated/azure_mgmt_privatedns/record_sets.rb#L473-L475 | train | Gets the specified record set. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2797,
1035,
4224,
1035,
2171,
1010,
2501,
1035,
2828,
1010,
5816,
1035,
2501,
1035,
2275,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rocketjob/symmetric-encryption | lib/symmetric_encryption/cipher.rb | SymmetricEncryption.Cipher.decrypt | def decrypt(str)
decoded = decode(str)
return unless decoded
return decoded if decoded.empty?
decrypted = binary_decrypt(decoded)
# Try to force result to UTF-8 encoding, but if it is not valid, force it back to Binary
decrypted.force_encoding(SymmetricEncryption::BINARY_ENCODING) unless decrypted.force_encoding(SymmetricEncryption::UTF8_ENCODING).valid_encoding?
decrypted
end | ruby | def decrypt(str)
decoded = decode(str)
return unless decoded
return decoded if decoded.empty?
decrypted = binary_decrypt(decoded)
# Try to force result to UTF-8 encoding, but if it is not valid, force it back to Binary
decrypted.force_encoding(SymmetricEncryption::BINARY_ENCODING) unless decrypted.force_encoding(SymmetricEncryption::UTF8_ENCODING).valid_encoding?
decrypted
end | [
"def",
"decrypt",
"(",
"str",
")",
"decoded",
"=",
"decode",
"(",
"str",
")",
"return",
"unless",
"decoded",
"return",
"decoded",
"if",
"decoded",
".",
"empty?",
"decrypted",
"=",
"binary_decrypt",
"(",
"decoded",
")",
"# Try to force result to UTF-8 encoding, but... | Decode and Decrypt string
Returns a decrypted string after decoding it first according to the
encoding setting of this cipher
Returns nil if encrypted_string is nil
Returns '' if encrypted_string == ''
Parameters
encrypted_string [String]
Binary encrypted string to decrypt
Reads the header if present for key, iv, cipher_name and compression
encrypted_string must be in raw binary form when calling this method
Creates a new OpenSSL::Cipher with every call so that this call
is thread-safe and can be called concurrently by multiple threads with
the same instance of Cipher | [
"Decode",
"and",
"Decrypt",
"string",
"Returns",
"a",
"decrypted",
"string",
"after",
"decoding",
"it",
"first",
"according",
"to",
"the",
"encoding",
"setting",
"of",
"this",
"cipher",
"Returns",
"nil",
"if",
"encrypted_string",
"is",
"nil",
"Returns",
"if",
... | 064ba8d57ffac44a3ed80f5e76fa1a54d660ff98 | https://github.com/rocketjob/symmetric-encryption/blob/064ba8d57ffac44a3ed80f5e76fa1a54d660ff98/lib/symmetric_encryption/cipher.rb#L161-L173 | train | Decrypts the string | [
30522,
13366,
11703,
2854,
13876,
1006,
2358,
2099,
1007,
21933,
5732,
1027,
21933,
3207,
1006,
2358,
2099,
1007,
2709,
4983,
21933,
5732,
2709,
21933,
5732,
2065,
21933,
5732,
1012,
4064,
1029,
11703,
2854,
13876,
2098,
1027,
12441,
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_node_health_with_http_info | def get_node_health_with_http_info(node_name, events_health_state_filter:0, timeout:60, custom_headers:nil)
get_node_health_async(node_name, events_health_state_filter:events_health_state_filter, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_node_health_with_http_info(node_name, events_health_state_filter:0, timeout:60, custom_headers:nil)
get_node_health_async(node_name, events_health_state_filter:events_health_state_filter, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_node_health_with_http_info",
"(",
"node_name",
",",
"events_health_state_filter",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_node_health_async",
"(",
"node_name",
",",
"events_health_state_filter",
":events_health_state_f... | Gets the health of a Service Fabric node.
Gets the health of a Service Fabric node. Use EventsHealthStateFilter to
filter the collection of health events reported on the node based on the
health state. If the node that you specify by name does not exist in the
health store, this returns an error.
@param node_name [String] The name of the node.
@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",
"health",
"of",
"a",
"Service",
"Fabric",
"node",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L3542-L3544 | train | Gets the health of the specified node. | [
30522,
13366,
2131,
1035,
13045,
1035,
2740,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13045,
1035,
2171,
1010,
2824,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
2051,
5833,
1024,
3438,
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... |
mojombo/chronic | lib/chronic/repeaters/repeater_fortnight.rb | Chronic.RepeaterFortnight.next | def next(pointer)
super
unless @current_fortnight_start
case pointer
when :future
sunday_repeater = RepeaterDayName.new(:sunday)
sunday_repeater.start = @now
next_sunday_span = sunday_repeater.next(:future)
@current_fortnight_start = next_sunday_span.begin
when :past
sunday_repeater = RepeaterDayName.new(:sunday)
sunday_repeater.start = (@now + RepeaterDay::DAY_SECONDS)
2.times { sunday_repeater.next(:past) }
last_sunday_span = sunday_repeater.next(:past)
@current_fortnight_start = last_sunday_span.begin
end
else
direction = pointer == :future ? 1 : -1
@current_fortnight_start += direction * FORTNIGHT_SECONDS
end
Span.new(@current_fortnight_start, @current_fortnight_start + FORTNIGHT_SECONDS)
end | ruby | def next(pointer)
super
unless @current_fortnight_start
case pointer
when :future
sunday_repeater = RepeaterDayName.new(:sunday)
sunday_repeater.start = @now
next_sunday_span = sunday_repeater.next(:future)
@current_fortnight_start = next_sunday_span.begin
when :past
sunday_repeater = RepeaterDayName.new(:sunday)
sunday_repeater.start = (@now + RepeaterDay::DAY_SECONDS)
2.times { sunday_repeater.next(:past) }
last_sunday_span = sunday_repeater.next(:past)
@current_fortnight_start = last_sunday_span.begin
end
else
direction = pointer == :future ? 1 : -1
@current_fortnight_start += direction * FORTNIGHT_SECONDS
end
Span.new(@current_fortnight_start, @current_fortnight_start + FORTNIGHT_SECONDS)
end | [
"def",
"next",
"(",
"pointer",
")",
"super",
"unless",
"@current_fortnight_start",
"case",
"pointer",
"when",
":future",
"sunday_repeater",
"=",
"RepeaterDayName",
".",
"new",
"(",
":sunday",
")",
"sunday_repeater",
".",
"start",
"=",
"@now",
"next_sunday_span",
"... | (14 * 24 * 60 * 60) | [
"(",
"14",
"*",
"24",
"*",
"60",
"*",
"60",
")"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/repeaters/repeater_fortnight.rb#L10-L33 | train | Returns the next Span of the next Span of the next Span. | [
30522,
13366,
2279,
1006,
20884,
1007,
3565,
4983,
1030,
2783,
1035,
3481,
15864,
1035,
2707,
2553,
20884,
2043,
1024,
2925,
4465,
1035,
9377,
2121,
1027,
9377,
2121,
10259,
18442,
1012,
2047,
1006,
1024,
4465,
1007,
4465,
1035,
9377,
2121,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.get_composite_entity_role | def get_composite_entity_role(app_id, version_id, c_entity_id, role_id, custom_headers:nil)
response = get_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_composite_entity_role(app_id, version_id, c_entity_id, role_id, custom_headers:nil)
response = get_composite_entity_role_async(app_id, version_id, c_entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_composite_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"c_entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_composite_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"c_entity_id",
",",
"role_id"... | Get one role for a given composite entity in a version of the application
@param app_id The application ID.
@param version_id [String] The version ID.
@param c_entity_id The composite entity extractor ID.
@param role_id entity role ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EntityRole] operation results. | [
"Get",
"one",
"role",
"for",
"a",
"given",
"composite",
"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#L10031-L10034 | train | Gets the composite entity role. | [
30522,
13366,
2131,
1035,
12490,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
1039,
1035,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_next | def list_multi_role_pool_instance_metric_definitions_next(next_page_link, custom_headers:nil)
response = list_multi_role_pool_instance_metric_definitions_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_multi_role_pool_instance_metric_definitions_next(next_page_link, custom_headers:nil)
response = list_multi_role_pool_instance_metric_definitions_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_multi_role_pool_instance_metric_definitions_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_multi_role_pool_instance_metric_definitions_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
"."... | 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 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 [ResourceMetricDefinitionCollection] 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#L5516-L5519 | train | Gets the metric definitions for a multi - role pool instance. | [
30522,
13366,
2862,
1035,
4800,
1035,
2535,
1035,
4770,
1035,
6013,
1035,
12046,
1035,
15182,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
4800,
1035,
2535,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/licensed | lib/licensed/configuration.rb | Licensed.AppConfiguration.sources | def sources
@sources ||= Licensed::Sources::Source.sources
.select { |source_class| enabled?(source_class.type) }
.map { |source_class| source_class.new(self) }
end | ruby | def sources
@sources ||= Licensed::Sources::Source.sources
.select { |source_class| enabled?(source_class.type) }
.map { |source_class| source_class.new(self) }
end | [
"def",
"sources",
"@sources",
"||=",
"Licensed",
"::",
"Sources",
"::",
"Source",
".",
"sources",
".",
"select",
"{",
"|",
"source_class",
"|",
"enabled?",
"(",
"source_class",
".",
"type",
")",
"}",
".",
"map",
"{",
"|",
"source_class",
"|",
"source_class... | Returns an array of enabled app sources | [
"Returns",
"an",
"array",
"of",
"enabled",
"app",
"sources"
] | afba288df344e001d43e94ad9217635a011b79c2 | https://github.com/github/licensed/blob/afba288df344e001d43e94ad9217635a011b79c2/lib/licensed/configuration.rb#L58-L62 | train | Returns the list of all the sources that are available for this source. | [
30522,
13366,
4216,
1030,
4216,
1064,
1064,
1027,
7000,
1024,
1024,
4216,
1024,
1024,
3120,
1012,
4216,
1012,
7276,
1063,
1064,
3120,
1035,
2465,
1064,
9124,
1029,
1006,
3120,
1035,
2465,
1012,
2828,
1007,
1065,
1012,
4949,
1063,
1064,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_secrets | def get_secrets(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_secrets_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def get_secrets(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_secrets_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"get_secrets",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"get_secrets_as_lazy",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_headers",
":custom_headers",
")",
... | List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only
the base secret identifier and its attributes are provided in the response.
Individual secret versions are not listed in the response. This operation
requires the secrets/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 [Array<SecretItem>] operation results. | [
"List",
"secrets",
"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#L3157-L3160 | train | Gets all the secrets for the specified vault. | [
30522,
13366,
2131,
1035,
7800,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2131,
1035,
7800,
1035,
2004,
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... |
rails/rails | activemodel/lib/active_model/errors.rb | ActiveModel.Errors.each | def each(&block)
if block.arity == 1
@errors.each(&block)
else
ActiveSupport::Deprecation.warn(<<~MSG)
Enumerating ActiveModel::Errors as a hash has been deprecated.
In Rails 6.1, `errors` is an array of Error objects,
therefore it should be accessed by a block with a single block
parameter like this:
person.errors.each do |error|
error.full_message
end
You are passing a block expecting two parameters,
so the old hash behavior is simulated. As this is deprecated,
this will result in an ArgumentError in Rails 6.2.
MSG
@errors.
sort { |a, b| a.attribute <=> b.attribute }.
each { |error| yield error.attribute, error.message }
end
end | ruby | def each(&block)
if block.arity == 1
@errors.each(&block)
else
ActiveSupport::Deprecation.warn(<<~MSG)
Enumerating ActiveModel::Errors as a hash has been deprecated.
In Rails 6.1, `errors` is an array of Error objects,
therefore it should be accessed by a block with a single block
parameter like this:
person.errors.each do |error|
error.full_message
end
You are passing a block expecting two parameters,
so the old hash behavior is simulated. As this is deprecated,
this will result in an ArgumentError in Rails 6.2.
MSG
@errors.
sort { |a, b| a.attribute <=> b.attribute }.
each { |error| yield error.attribute, error.message }
end
end | [
"def",
"each",
"(",
"&",
"block",
")",
"if",
"block",
".",
"arity",
"==",
"1",
"@errors",
".",
"each",
"(",
"block",
")",
"else",
"ActiveSupport",
"::",
"Deprecation",
".",
"warn",
"(",
"<<~MSG",
")",
"MSG",
"@errors",
".",
"sort",
"{",
"|",
"a",
"... | Iterates through each error key, value pair in the error messages hash.
Yields the attribute and the error for that attribute. If the attribute
has more than one error message, yields once for each error message.
person.errors.add(:name, :blank, message: "can't be blank")
person.errors.each do |attribute, error|
# Will yield :name and "can't be blank"
end
person.errors.add(:name, :not_specified, message: "must be specified")
person.errors.each do |attribute, error|
# Will yield :name and "can't be blank"
# then yield :name and "must be specified"
end | [
"Iterates",
"through",
"each",
"error",
"key",
"value",
"pair",
"in",
"the",
"error",
"messages",
"hash",
".",
"Yields",
"the",
"attribute",
"and",
"the",
"error",
"for",
"that",
"attribute",
".",
"If",
"the",
"attribute",
"has",
"more",
"than",
"one",
"er... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activemodel/lib/active_model/errors.rb#L228-L250 | train | Yields each error in the collection. | [
30522,
13366,
2169,
1006,
1004,
3796,
1007,
2065,
3796,
1012,
10488,
3723,
1027,
1027,
1015,
1030,
10697,
1012,
2169,
1006,
1004,
3796,
1007,
2842,
3161,
6342,
9397,
11589,
1024,
1024,
2139,
28139,
10719,
1012,
11582,
1006,
1026,
1026,
1066... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.list_by_resource_group_with_http_info | def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, skip:nil, expand:nil, select:nil, orderby:nil, count:nil, search:nil, format:nil, custom_headers:nil)
list_by_resource_group_async(resource_group_name, filter:filter, top:top, skip:skip, expand:expand, select:select, orderby:orderby, count:count, search:search, format:format, custom_headers:custom_headers).value!
end | ruby | def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, skip:nil, expand:nil, select:nil, orderby:nil, count:nil, search:nil, format:nil, custom_headers:nil)
list_by_resource_group_async(resource_group_name, filter:filter, top:top, skip:skip, expand:expand, select:select, orderby:orderby, count:count, search:search, format:format, custom_headers:custom_headers).value!
end | [
"def",
"list_by_resource_group_with_http_info",
"(",
"resource_group_name",
",",
"filter",
":",
"nil",
",",
"top",
":",
"nil",
",",
"skip",
":",
"nil",
",",
"expand",
":",
"nil",
",",
"select",
":",
"nil",
",",
"orderby",
":",
"nil",
",",
"count",
":",
"... | Gets the first page of Data Lake Analytics accounts, if any, within a
specific resource group. This includes a link to the next page, if any.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Analytics account.
@param filter [String] OData filter. Optional.
@param top [Integer] The number of items to return. Optional.
@param skip [Integer] The number of items to skip over before returning
elements. Optional.
@param expand [String] OData expansion. Expand related resources in line with
the retrieved resources, e.g. Categories/$expand=Products would expand
Product data in line with each Category entry. Optional.
@param select [String] OData Select statement. Limits the properties on each
entry to just those requested, e.g.
Categories?$select=CategoryName,Description. Optional.
@param orderby [String] OrderBy clause. One or more comma-separated
expressions with an optional "asc" (the default) or "desc" depending on the
order you'd like the values sorted, e.g. Categories?$orderby=CategoryName
desc. Optional.
@param count [Boolean] The Boolean value of true or false to request a count
of the matching resources included with the resources in the response, e.g.
Categories?$count=true. Optional.
@param search [String] A free form search. A free-text search expression to
match for whether a particular entry should be included in the feed, e.g.
Categories?$search=blue OR green. Optional.
@param format [String] The return format. Return the response in particular
formatxii without access to request headers for standard content-type
negotiation (e.g Orders?$format=json). Optional.
@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",
"first",
"page",
"of",
"Data",
"Lake",
"Analytics",
"accounts",
"if",
"any",
"within",
"a",
"specific",
"resource",
"group",
".",
"This",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L1524-L1526 | train | Gets a list of all the segmentation products under a resource group. | [
30522,
13366,
2862,
1035,
2011,
1035,
7692,
1035,
2177,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
13558,
1024,
9152,
2140,
1010,
7818,
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... |
hashicorp/vault-ruby | lib/vault/api/auth.rb | Vault.Authenticate.github | def github(github_token, path="/v1/auth/github/login")
payload = {token: github_token}
json = client.post(path, JSON.fast_generate(payload))
secret = Secret.decode(json)
client.token = secret.auth.client_token
return secret
end | ruby | def github(github_token, path="/v1/auth/github/login")
payload = {token: github_token}
json = client.post(path, JSON.fast_generate(payload))
secret = Secret.decode(json)
client.token = secret.auth.client_token
return secret
end | [
"def",
"github",
"(",
"github_token",
",",
"path",
"=",
"\"/v1/auth/github/login\"",
")",
"payload",
"=",
"{",
"token",
":",
"github_token",
"}",
"json",
"=",
"client",
".",
"post",
"(",
"path",
",",
"JSON",
".",
"fast_generate",
"(",
"payload",
")",
")",
... | Authenticate via the GitHub authentication method. If authentication is
successful, the resulting token will be stored on the client and used
for future requests.
@example
Vault.auth.github("mypersonalgithubtoken") #=> #<Vault::Secret lease_id="">
@param [String] github_token
@return [Secret] | [
"Authenticate",
"via",
"the",
"GitHub",
"authentication",
"method",
".",
"If",
"authentication",
"is",
"successful",
"the",
"resulting",
"token",
"will",
"be",
"stored",
"on",
"the",
"client",
"and",
"used",
"for",
"future",
"requests",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/auth.rb#L158-L164 | train | Create a new client for the github token | [
30522,
13366,
21025,
2705,
12083,
1006,
21025,
2705,
12083,
1035,
19204,
1010,
4130,
1027,
1000,
1013,
1058,
2487,
1013,
8740,
2705,
1013,
21025,
2705,
12083,
1013,
8833,
2378,
1000,
1007,
18093,
1027,
1063,
19204,
1024,
21025,
2705,
12083,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/utilities.rb | Mail.Utilities.quote_phrase | def quote_phrase( str )
if str.respond_to?(:force_encoding)
original_encoding = str.encoding
ascii_str = str.to_s.dup.force_encoding('ASCII-8BIT')
if Constants::PHRASE_UNSAFE === ascii_str
dquote(ascii_str).force_encoding(original_encoding)
else
str
end
else
Constants::PHRASE_UNSAFE === str ? dquote(str) : str
end
end | ruby | def quote_phrase( str )
if str.respond_to?(:force_encoding)
original_encoding = str.encoding
ascii_str = str.to_s.dup.force_encoding('ASCII-8BIT')
if Constants::PHRASE_UNSAFE === ascii_str
dquote(ascii_str).force_encoding(original_encoding)
else
str
end
else
Constants::PHRASE_UNSAFE === str ? dquote(str) : str
end
end | [
"def",
"quote_phrase",
"(",
"str",
")",
"if",
"str",
".",
"respond_to?",
"(",
":force_encoding",
")",
"original_encoding",
"=",
"str",
".",
"encoding",
"ascii_str",
"=",
"str",
".",
"to_s",
".",
"dup",
".",
"force_encoding",
"(",
"'ASCII-8BIT'",
")",
"if",
... | If the string supplied has PHRASE unsafe characters in it, will return the string quoted
in double quotes, otherwise returns the string unmodified | [
"If",
"the",
"string",
"supplied",
"has",
"PHRASE",
"unsafe",
"characters",
"in",
"it",
"will",
"return",
"the",
"string",
"quoted",
"in",
"double",
"quotes",
"otherwise",
"returns",
"the",
"string",
"unmodified"
] | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/utilities.rb#L23-L35 | train | quote a phrase | [
30522,
13366,
14686,
1035,
7655,
1006,
2358,
2099,
1007,
2065,
2358,
2099,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
2486,
1035,
17181,
1007,
2434,
1035,
17181,
1027,
2358,
2099,
1012,
17181,
2004,
6895,
2072,
1035,
2358,
2099,
1027,
2358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.resolve_args_without_dependencies | def resolve_args_without_dependencies(args)
task_name = args.shift
if args.size == 1 && args.first.respond_to?(:to_ary)
arg_names = args.first.to_ary
else
arg_names = args
end
[task_name, arg_names, []]
end | ruby | def resolve_args_without_dependencies(args)
task_name = args.shift
if args.size == 1 && args.first.respond_to?(:to_ary)
arg_names = args.first.to_ary
else
arg_names = args
end
[task_name, arg_names, []]
end | [
"def",
"resolve_args_without_dependencies",
"(",
"args",
")",
"task_name",
"=",
"args",
".",
"shift",
"if",
"args",
".",
"size",
"==",
"1",
"&&",
"args",
".",
"first",
".",
"respond_to?",
"(",
":to_ary",
")",
"arg_names",
"=",
"args",
".",
"first",
".",
... | Resolve task arguments for a task or rule when there are no
dependencies declared.
The patterns recognized by this argument resolving function are:
task :t
task :t, [:a] | [
"Resolve",
"task",
"arguments",
"for",
"a",
"task",
"or",
"rule",
"when",
"there",
"are",
"no",
"dependencies",
"declared",
"."
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/task_manager.rb#L105-L113 | train | Resolve the args without dependencies | [
30522,
13366,
10663,
1035,
12098,
5620,
1035,
2302,
1035,
12530,
15266,
1006,
12098,
5620,
1007,
4708,
1035,
2171,
1027,
12098,
5620,
1012,
5670,
2065,
12098,
5620,
1012,
2946,
1027,
1027,
1015,
1004,
1004,
12098,
5620,
1012,
2034,
1012,
68... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kmuto/review | lib/epubmaker/producer.rb | EPUBMaker.Producer.mytoc | def mytoc(wobj)
s = @epub.mytoc
if !s.nil? && !wobj.nil?
wobj.puts s
end
end | ruby | def mytoc(wobj)
s = @epub.mytoc
if !s.nil? && !wobj.nil?
wobj.puts s
end
end | [
"def",
"mytoc",
"(",
"wobj",
")",
"s",
"=",
"@epub",
".",
"mytoc",
"if",
"!",
"s",
".",
"nil?",
"&&",
"!",
"wobj",
".",
"nil?",
"wobj",
".",
"puts",
"s",
"end",
"end"
] | Write own toc file to IO object +wobj+. | [
"Write",
"own",
"toc",
"file",
"to",
"IO",
"object",
"+",
"wobj",
"+",
"."
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/producer.rb#L158-L163 | train | Get the current page of the page | [
30522,
13366,
2026,
3406,
2278,
1006,
24185,
2497,
3501,
1007,
1055,
1027,
1030,
4958,
12083,
1012,
2026,
3406,
2278,
2065,
999,
1055,
1012,
9152,
2140,
1029,
1004,
1004,
999,
24185,
2497,
3501,
1012,
9152,
2140,
1029,
24185,
2497,
3501,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cloudfoundry/bosh | src/bosh-director/lib/bosh/director/disk_manager.rb | Bosh::Director.DiskManager.sync_persistent_disk | def sync_persistent_disk(instance_plan)
instance = instance_plan.instance
return if instance.model.persistent_disks.empty?
agent_disk_cid = agent_mounted_disks(instance.model).first
if agent_disk_cid.nil? && !instance_plan.needs_disk?
@logger.debug('Disk is already detached')
elsif agent_disk_cid != instance.model.managed_persistent_disk_cid
handle_disk_mismatch(agent_disk_cid, instance, instance_plan)
end
instance.model.persistent_disks.each do |disk|
unless disk.active
@logger.warn("'#{instance}' has inactive disk #{disk.disk_cid}")
end
end
end | ruby | def sync_persistent_disk(instance_plan)
instance = instance_plan.instance
return if instance.model.persistent_disks.empty?
agent_disk_cid = agent_mounted_disks(instance.model).first
if agent_disk_cid.nil? && !instance_plan.needs_disk?
@logger.debug('Disk is already detached')
elsif agent_disk_cid != instance.model.managed_persistent_disk_cid
handle_disk_mismatch(agent_disk_cid, instance, instance_plan)
end
instance.model.persistent_disks.each do |disk|
unless disk.active
@logger.warn("'#{instance}' has inactive disk #{disk.disk_cid}")
end
end
end | [
"def",
"sync_persistent_disk",
"(",
"instance_plan",
")",
"instance",
"=",
"instance_plan",
".",
"instance",
"return",
"if",
"instance",
".",
"model",
".",
"persistent_disks",
".",
"empty?",
"agent_disk_cid",
"=",
"agent_mounted_disks",
"(",
"instance",
".",
"model"... | Synchronizes persistent_disks with the agent.
(Currently assumes that we only have 1 persistent disk.)
@return [void] | [
"Synchronizes",
"persistent_disks",
"with",
"the",
"agent",
".",
"(",
"Currently",
"assumes",
"that",
"we",
"only",
"have",
"1",
"persistent",
"disk",
".",
")"
] | 2eaa7100879ddd20cd909cd698514746195e28b7 | https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/disk_manager.rb#L109-L126 | train | Syncs the persistent disk with the agent | [
30522,
13366,
26351,
1035,
14516,
1035,
9785,
1006,
6013,
1035,
2933,
1007,
6013,
1027,
6013,
1035,
2933,
1012,
6013,
2709,
2065,
6013,
1012,
2944,
1012,
14516,
1035,
23999,
1012,
4064,
1029,
4005,
1035,
9785,
1035,
28744,
1027,
4005,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb | Azure::CDN::Mgmt::V2016_10_02.Profiles.get_supported_optimization_types | def get_supported_optimization_types(resource_group_name, profile_name, custom_headers:nil)
response = get_supported_optimization_types_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_supported_optimization_types(resource_group_name, profile_name, custom_headers:nil)
response = get_supported_optimization_types_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_supported_optimization_types",
"(",
"resource_group_name",
",",
"profile_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_supported_optimization_types_async",
"(",
"resource_group_name",
",",
"profile_name",
",",
"custom_headers",
":custom_head... | Gets the supported optimization types for the current profile. A user can
create an endpoint with an optimization type from the listed values.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param profile_name [String] Name of the CDN profile which is unique within
the resource group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SupportedOptimizationTypesResult] operation results. | [
"Gets",
"the",
"supported",
"optimization",
"types",
"for",
"the",
"current",
"profile",
".",
"A",
"user",
"can",
"create",
"an",
"endpoint",
"with",
"an",
"optimization",
"type",
"from",
"the",
"listed",
"values",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb#L578-L581 | train | Gets the list of supported optimization types. | [
30522,
13366,
2131,
1035,
3569,
1035,
20600,
1035,
4127,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
3569,
1035,
20600,
1035,
4127,
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... |
randym/axlsx | lib/axlsx/workbook/worksheet/icon_set.rb | Axlsx.IconSet.initialize_value_objects | def initialize_value_objects
@value_objects = SimpleTypedList.new Cfvo
@value_objects.concat [Cfvo.new(:type => :percent, :val => 0), Cfvo.new(:type => :percent, :val => 33), Cfvo.new(:type => :percent, :val => 67)]
@value_objects.lock
end | ruby | def initialize_value_objects
@value_objects = SimpleTypedList.new Cfvo
@value_objects.concat [Cfvo.new(:type => :percent, :val => 0), Cfvo.new(:type => :percent, :val => 33), Cfvo.new(:type => :percent, :val => 67)]
@value_objects.lock
end | [
"def",
"initialize_value_objects",
"@value_objects",
"=",
"SimpleTypedList",
".",
"new",
"Cfvo",
"@value_objects",
".",
"concat",
"[",
"Cfvo",
".",
"new",
"(",
":type",
"=>",
":percent",
",",
":val",
"=>",
"0",
")",
",",
"Cfvo",
".",
"new",
"(",
":type",
"... | Initalize the simple typed list of value objects
I am keeping this private for now as I am not sure what impact changes to the required two cfvo objects will do. | [
"Initalize",
"the",
"simple",
"typed",
"list",
"of",
"value",
"objects",
"I",
"am",
"keeping",
"this",
"private",
"for",
"now",
"as",
"I",
"am",
"not",
"sure",
"what",
"impact",
"changes",
"to",
"the",
"required",
"two",
"cfvo",
"objects",
"will",
"do",
... | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/icon_set.rb#L75-L79 | train | Initialize the value objects | [
30522,
13366,
3988,
4697,
1035,
3643,
1035,
5200,
1030,
3643,
1035,
5200,
1027,
3722,
13874,
19422,
2923,
1012,
2047,
12935,
6767,
1030,
3643,
1035,
5200,
1012,
9530,
11266,
1031,
12935,
6767,
1012,
2047,
1006,
1024,
2828,
1027,
1028,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_states.rb | Azure::PolicyInsights::Mgmt::V2018_04_04.PolicyStates.summarize_for_resource_group_level_policy_assignment | def summarize_for_resource_group_level_policy_assignment(subscription_id, resource_group_name, policy_assignment_name, query_options:nil, custom_headers:nil)
response = summarize_for_resource_group_level_policy_assignment_async(subscription_id, resource_group_name, policy_assignment_name, query_options:query_options, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def summarize_for_resource_group_level_policy_assignment(subscription_id, resource_group_name, policy_assignment_name, query_options:nil, custom_headers:nil)
response = summarize_for_resource_group_level_policy_assignment_async(subscription_id, resource_group_name, policy_assignment_name, query_options:query_options, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"summarize_for_resource_group_level_policy_assignment",
"(",
"subscription_id",
",",
"resource_group_name",
",",
"policy_assignment_name",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"summarize_for_resource_group_level_polic... | Summarizes policy states for the resource group level policy assignment.
@param subscription_id [String] Microsoft Azure subscription ID.
@param resource_group_name [String] Resource group name.
@param policy_assignment_name [String] Policy assignment name.
@param query_options [QueryOptions] Additional parameters for the operation
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SummarizeResults] operation results. | [
"Summarizes",
"policy",
"states",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_states.rb#L1884-L1887 | train | Gets the policy s terms for a policy assignment. | [
30522,
13366,
7680,
7849,
4697,
1035,
2005,
1035,
7692,
1035,
2177,
1035,
2504,
1035,
3343,
1035,
8775,
1006,
15002,
1035,
8909,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3343,
1035,
8775,
1035,
2171,
1010,
23032,
1035,
7047,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protectable_items.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationProtectableItems.list_by_replication_protection_containers | def list_by_replication_protection_containers(fabric_name, protection_container_name, filter:nil, custom_headers:nil)
first_page = list_by_replication_protection_containers_as_lazy(fabric_name, protection_container_name, filter:filter, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_replication_protection_containers(fabric_name, protection_container_name, filter:nil, custom_headers:nil)
first_page = list_by_replication_protection_containers_as_lazy(fabric_name, protection_container_name, filter:filter, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_replication_protection_containers",
"(",
"fabric_name",
",",
"protection_container_name",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_replication_protection_containers_as_lazy",
"(",
"fabric_name",
",",
"pro... | Gets the list of protectable items.
Lists the protectable items in a protection container.
@param fabric_name [String] Fabric name.
@param protection_container_name [String] Protection container name.
@param filter [String] OData filter options.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<ProtectableItem>] operation results. | [
"Gets",
"the",
"list",
"of",
"protectable",
"items",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protectable_items.rb#L37-L40 | train | Gets all the applications under the protection container. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
3860,
1035,
16143,
1006,
8313,
1035,
2171,
1010,
3860,
1035,
11661,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
backup/backup | lib/backup/pipeline.rb | Backup.Pipeline.run | def run
Open4.popen4(pipeline) do |_pid, _stdin, stdout, stderr|
pipestatus = stdout.read.delete("\n").split(":").sort
pipestatus.each do |status|
index, exitstatus = status.split("|").map(&:to_i)
next if @success_codes[index].include?(exitstatus)
command = command_name(@commands[index])
@errors << SystemCallError.new(
"'#{command}' returned exit code: #{exitstatus}", exitstatus
)
end
@stderr = stderr.read.strip
end
Logger.warn(stderr_messages) if success? && stderr_messages
rescue Exception => err
raise Error.wrap(err, "Pipeline failed to execute")
end | ruby | def run
Open4.popen4(pipeline) do |_pid, _stdin, stdout, stderr|
pipestatus = stdout.read.delete("\n").split(":").sort
pipestatus.each do |status|
index, exitstatus = status.split("|").map(&:to_i)
next if @success_codes[index].include?(exitstatus)
command = command_name(@commands[index])
@errors << SystemCallError.new(
"'#{command}' returned exit code: #{exitstatus}", exitstatus
)
end
@stderr = stderr.read.strip
end
Logger.warn(stderr_messages) if success? && stderr_messages
rescue Exception => err
raise Error.wrap(err, "Pipeline failed to execute")
end | [
"def",
"run",
"Open4",
".",
"popen4",
"(",
"pipeline",
")",
"do",
"|",
"_pid",
",",
"_stdin",
",",
"stdout",
",",
"stderr",
"|",
"pipestatus",
"=",
"stdout",
".",
"read",
".",
"delete",
"(",
"\"\\n\"",
")",
".",
"split",
"(",
"\":\"",
")",
".",
"so... | Runs the command line from `#pipeline` and collects STDOUT/STDERR.
STDOUT is then parsed to determine the exit status of each command.
For each command with a non-zero exit status, a SystemCallError is
created and added to @errors. All STDERR output is set in @stderr.
Note that there is no accumulated STDOUT from the commands themselves.
Also, the last command should not attempt to write to STDOUT.
Any output on STDOUT from the final command will be sent to STDERR.
This in itself will not cause #run to fail, but will log warnings
when all commands exit with non-zero status.
Use `#success?` to determine if all commands in the pipeline succeeded.
If `#success?` returns `false`, use `#error_messages` to get an error report. | [
"Runs",
"the",
"command",
"line",
"from",
"#pipeline",
"and",
"collects",
"STDOUT",
"/",
"STDERR",
".",
"STDOUT",
"is",
"then",
"parsed",
"to",
"determine",
"the",
"exit",
"status",
"of",
"each",
"command",
".",
"For",
"each",
"command",
"with",
"a",
"non"... | 64370f925e859f858766b674717a3dbee0de7a26 | https://github.com/backup/backup/blob/64370f925e859f858766b674717a3dbee0de7a26/lib/backup/pipeline.rb#L51-L67 | train | Runs the pipeline | [
30522,
13366,
2448,
2330,
2549,
1012,
4831,
2078,
2549,
1006,
13117,
1007,
2079,
1064,
1035,
14255,
2094,
1010,
1035,
2358,
8718,
1010,
2358,
26797,
2102,
1010,
2358,
4063,
2099,
1064,
12432,
29336,
2271,
1027,
2358,
26797,
2102,
1012,
3191... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.defer_validation | def defer_validation(&block)
raise LocalJumpError, "No block given." unless block
@validation_deferred = true
block.call()
@validation_deferred = false
validate
return nil
end | ruby | def defer_validation(&block)
raise LocalJumpError, "No block given." unless block
@validation_deferred = true
block.call()
@validation_deferred = false
validate
return nil
end | [
"def",
"defer_validation",
"(",
"&",
"block",
")",
"raise",
"LocalJumpError",
",",
"\"No block given.\"",
"unless",
"block",
"@validation_deferred",
"=",
"true",
"block",
".",
"call",
"(",
")",
"@validation_deferred",
"=",
"false",
"validate",
"return",
"nil",
"en... | This method allows you to make several changes to a URI simultaneously,
which separately would cause validation errors, but in conjunction,
are valid. The URI will be revalidated as soon as the entire block has
been executed.
@param [Proc] block
A set of operations to perform on a given URI. | [
"This",
"method",
"allows",
"you",
"to",
"make",
"several",
"changes",
"to",
"a",
"URI",
"simultaneously",
"which",
"separately",
"would",
"cause",
"validation",
"errors",
"but",
"in",
"conjunction",
"are",
"valid",
".",
"The",
"URI",
"will",
"be",
"revalidate... | 5894c95a7768435cb46d1355954611dbd194832e | https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/uri.rb#L2370-L2377 | train | Defer validation of the current object. | [
30522,
13366,
13366,
2121,
1035,
27354,
1006,
1004,
3796,
1007,
5333,
2334,
9103,
8737,
2121,
29165,
1010,
1000,
2053,
3796,
2445,
1012,
1000,
4983,
3796,
1030,
27354,
1035,
13366,
28849,
2094,
1027,
2995,
3796,
1012,
2655,
1006,
1007,
1030... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_machine_learning_services/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/machine_learning_compute.rb | Azure::MachineLearningServices::Mgmt::V2018_03_01_preview.MachineLearningCompute.list_keys_with_http_info | def list_keys_with_http_info(resource_group_name, workspace_name, compute_name, custom_headers:nil)
list_keys_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
end | ruby | def list_keys_with_http_info(resource_group_name, workspace_name, compute_name, custom_headers:nil)
list_keys_async(resource_group_name, workspace_name, compute_name, custom_headers:custom_headers).value!
end | [
"def",
"list_keys_with_http_info",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"compute_name",
",",
"custom_headers",
":",
"nil",
")",
"list_keys_async",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"compute_name",
",",
"custom_headers",
":custom_he... | Gets secrets related to Machine Learning compute (storage keys, service
credentials, etc).
@param resource_group_name [String] Name of the resource group in which
workspace is located.
@param workspace_name [String] Name of Azure Machine Learning workspace.
@param compute_name [String] Name of the Azure Machine Learning compute.
@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",
"secrets",
"related",
"to",
"Machine",
"Learning",
"compute",
"(",
"storage",
"keys",
"service",
"credentials",
"etc",
")",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_machine_learning_services/lib/2018-03-01-preview/generated/azure_mgmt_machine_learning_services/machine_learning_compute.rb#L392-L394 | train | Gets the keys of the specified compute. | [
30522,
13366,
2862,
1035,
6309,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2573,
15327,
1035,
2171,
1010,
24134,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
1035,
6309,
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... |
ruby2d/ruby2d | lib/ruby2d/window.rb | Ruby2D.Window.on | def on(event, &proc)
unless @events.has_key? event
raise Error, "`#{event}` is not a valid event type"
end
event_id = new_event_key
@events[event][event_id] = proc
EventDescriptor.new(event, event_id)
end | ruby | def on(event, &proc)
unless @events.has_key? event
raise Error, "`#{event}` is not a valid event type"
end
event_id = new_event_key
@events[event][event_id] = proc
EventDescriptor.new(event, event_id)
end | [
"def",
"on",
"(",
"event",
",",
"&",
"proc",
")",
"unless",
"@events",
".",
"has_key?",
"event",
"raise",
"Error",
",",
"\"`#{event}` is not a valid event type\"",
"end",
"event_id",
"=",
"new_event_key",
"@events",
"[",
"event",
"]",
"[",
"event_id",
"]",
"="... | Set an event handler | [
"Set",
"an",
"event",
"handler"
] | 43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4 | https://github.com/ruby2d/ruby2d/blob/43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4/lib/ruby2d/window.rb#L260-L267 | train | Adds a new event to the event list. | [
30522,
13366,
2006,
30524,
2724,
1033,
1031,
2724,
1035,
8909,
1033,
1027,
4013,
2278,
2724,
6155,
23235,
2953,
1012,
2047,
1006,
2724,
1010,
2724,
1035,
8909,
1007,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.dissociate_gateway | def dissociate_gateway(resource_group_name, server_name, custom_headers:nil)
response = dissociate_gateway_async(resource_group_name, server_name, custom_headers:custom_headers).value!
nil
end | ruby | def dissociate_gateway(resource_group_name, server_name, custom_headers:nil)
response = dissociate_gateway_async(resource_group_name, server_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"dissociate_gateway",
"(",
"resource_group_name",
",",
"server_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"dissociate_gateway_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!"... | Dissociates a Unified Gateway associated with the server.
@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 at least 3 characters in length, and no more than 63.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Dissociates",
"a",
"Unified",
"Gateway",
"associated",
"with",
"the",
"server",
"."
] | 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#L858-L861 | train | Dissociates the specified virtual network gateway. | [
30522,
13366,
4487,
24137,
7405,
2618,
1035,
11909,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4487,
24137,
7405,
2618,
1035,
11909,
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... |
samvera/hyrax | app/helpers/hyrax/hyrax_helper_behavior.rb | Hyrax.HyraxHelperBehavior.search_state_with_facets | def search_state_with_facets(params, facet = {})
state = Blacklight::SearchState.new(params, CatalogController.blacklight_config)
return state.params if facet.none?
state.add_facet_params(ActiveFedora.index_field_mapper.solr_name(facet.keys.first, :facetable),
facet.values.first)
end | ruby | def search_state_with_facets(params, facet = {})
state = Blacklight::SearchState.new(params, CatalogController.blacklight_config)
return state.params if facet.none?
state.add_facet_params(ActiveFedora.index_field_mapper.solr_name(facet.keys.first, :facetable),
facet.values.first)
end | [
"def",
"search_state_with_facets",
"(",
"params",
",",
"facet",
"=",
"{",
"}",
")",
"state",
"=",
"Blacklight",
"::",
"SearchState",
".",
"new",
"(",
"params",
",",
"CatalogController",
".",
"blacklight_config",
")",
"return",
"state",
".",
"params",
"if",
"... | rubocop:enable Metrics/MethodLength
@param [ActionController::Parameters] params first argument for Blacklight::SearchState.new
@param [Hash] facet
@note Ignores all but the first facet. Probably a bug. | [
"rubocop",
":",
"enable",
"Metrics",
"/",
"MethodLength"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/helpers/hyrax/hyrax_helper_behavior.rb#L307-L312 | train | Creates a new SearchState with the given parameters and facet | [
30522,
13366,
3945,
1035,
2110,
1035,
2007,
1035,
2227,
3215,
1006,
11498,
5244,
1010,
2227,
2102,
1027,
1063,
1065,
1007,
2110,
1027,
2304,
7138,
1024,
1024,
3945,
9153,
2618,
1012,
2047,
1006,
11498,
5244,
1010,
12105,
8663,
13181,
10820,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Features.list_phrase_lists | def list_phrase_lists(app_id, version_id, skip:0, take:100, custom_headers:nil)
response = list_phrase_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_phrase_lists(app_id, version_id, skip:0, take:100, custom_headers:nil)
response = list_phrase_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_phrase_lists",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"0",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_phrase_lists_async",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"skip",
",... | Gets all the phraselist features 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 [Array] operation results. | [
"Gets",
"all",
"the",
"phraselist",
"features",
"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/features.rb#L275-L278 | train | Gets the phrase lists for the application version. | [
30522,
13366,
2862,
1035,
7655,
1035,
7201,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
13558,
1024,
1014,
1010,
2202,
1024,
2531,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
7655,
1035,
7201,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_troubleshooting_with_http_info | def begin_get_troubleshooting_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_get_troubleshooting_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
begin_get_troubleshooting_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_get_troubleshooting_with_http_info",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_get_troubleshooting_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
... | Initiate troubleshooting on a specified resource
@param resource_group_name [String] The name of the resource group.
@param network_watcher_name [String] The name of the network watcher
resource.
@param parameters [TroubleshootingParameters] Parameters that define the
resource to troubleshoot.
@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. | [
"Initiate",
"troubleshooting",
"on",
"a",
"specified",
"resource"
] | 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#L1653-L1655 | train | Gets the troubleshooting of a virtual network. | [
30522,
13366,
4088,
1035,
2131,
1035,
13460,
23416,
2075,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
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... |
samvera/hyrax | app/indexers/hyrax/basic_metadata_indexer.rb | Hyrax.BasicMetadataIndexer.merge_config | def merge_config(first, second)
first_hash = first.instance_variable_get(:@hash).deep_dup
ActiveFedora::Indexing::Map.new(first_hash.merge(second))
end | ruby | def merge_config(first, second)
first_hash = first.instance_variable_get(:@hash).deep_dup
ActiveFedora::Indexing::Map.new(first_hash.merge(second))
end | [
"def",
"merge_config",
"(",
"first",
",",
"second",
")",
"first_hash",
"=",
"first",
".",
"instance_variable_get",
"(",
":@hash",
")",
".",
"deep_dup",
"ActiveFedora",
"::",
"Indexing",
"::",
"Map",
".",
"new",
"(",
"first_hash",
".",
"merge",
"(",
"second",... | This can be replaced by a simple merge once
https://github.com/samvera/active_fedora/pull/1227
is available to us
@param [ActiveFedora::Indexing::Map] first
@param [Hash] second | [
"This",
"can",
"be",
"replaced",
"by",
"a",
"simple",
"merge",
"once",
"https",
":",
"//",
"github",
".",
"com",
"/",
"samvera",
"/",
"active_fedora",
"/",
"pull",
"/",
"1227",
"is",
"available",
"to",
"us"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/indexers/hyrax/basic_metadata_indexer.rb#L28-L31 | train | Merge two config objects into one | [
30522,
13366,
13590,
1035,
9530,
8873,
2290,
1006,
2034,
1010,
2117,
1007,
2034,
1035,
23325,
1027,
2034,
1012,
6013,
1035,
8023,
1035,
2131,
1006,
1024,
1030,
23325,
1007,
1012,
2784,
1035,
4241,
2361,
3161,
25031,
6525,
1024,
1024,
5950,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/lab_accounts.rb | Azure::Labservices::Mgmt::V2018_10_15.LabAccounts.create_or_update | def create_or_update(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
response = create_or_update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
response = create_or_update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_account",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_account",
",",
"custom_h... | Create or replace an existing Lab Account.
@param resource_group_name [String] The name of the resource group.
@param lab_account_name [String] The name of the lab Account.
@param lab_account [LabAccount] Represents a lab account.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [LabAccount] operation results. | [
"Create",
"or",
"replace",
"an",
"existing",
"Lab",
"Account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb#L347-L350 | train | Creates or updates a lab account. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
1035,
4070,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2030,
1035,
10651,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/certificate_operations.rb | Azure::Batch::Mgmt::V2017_09_01.CertificateOperations.begin_create_with_http_info | def begin_create_with_http_info(resource_group_name, account_name, certificate_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
begin_create_async(resource_group_name, account_name, certificate_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
end | ruby | def begin_create_with_http_info(resource_group_name, account_name, certificate_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
begin_create_async(resource_group_name, account_name, certificate_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"certificate_name",
",",
"parameters",
",",
"if_match",
":",
"nil",
",",
"if_none_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_async",
"(",
"reso... | Creates a new certificate inside the specified account.
@param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param certificate_name [String] The identifier for the certificate. This
must be made up of algorithm and thumbprint separated by a dash, and must
match the certificate data in the request. For example SHA1-a3d1c5.
@param parameters [CertificateCreateOrUpdateParameters] Additional parameters
for certificate creation.
@param if_match [String] The entity state (ETag) version of the certificate
to update. A value of "*" can be used to apply the operation only if the
certificate already exists. If omitted, this operation will always be
applied.
@param if_none_match [String] Set to '*' to allow a new certificate to be
created, but to prevent updating an existing certificate. Other values will
be ignored.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"a",
"new",
"certificate",
"inside",
"the",
"specified",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/certificate_operations.rb#L692-L694 | train | Creates a new Certificates. | [
30522,
13366,
4088,
1035,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
8196,
1035,
2171,
1010,
11709,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
2065,
1035,
3904,
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... |
piotrmurach/github | lib/github_api/client/scopes.rb | Github.Client::Scopes.list | def list(*args)
arguments(args)
params = arguments.params
token = args.shift
if token.is_a?(Hash) && !params['token'].nil?
token = params.delete('token')
elsif token.nil?
token = oauth_token
end
if token.nil?
raise ArgumentError, 'Access token required'
end
headers = { 'Authorization' => "token #{token}" }
params['headers'] = headers
response = get_request("/user", params)
response.headers.oauth_scopes.split(',').map(&:strip)
end | ruby | def list(*args)
arguments(args)
params = arguments.params
token = args.shift
if token.is_a?(Hash) && !params['token'].nil?
token = params.delete('token')
elsif token.nil?
token = oauth_token
end
if token.nil?
raise ArgumentError, 'Access token required'
end
headers = { 'Authorization' => "token #{token}" }
params['headers'] = headers
response = get_request("/user", params)
response.headers.oauth_scopes.split(',').map(&:strip)
end | [
"def",
"list",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
")",
"params",
"=",
"arguments",
".",
"params",
"token",
"=",
"args",
".",
"shift",
"if",
"token",
".",
"is_a?",
"(",
"Hash",
")",
"&&",
"!",
"params",
"[",
"'token'",
"]",
".",
"nil?"... | Check what OAuth scopes you have.
@see https://developer.github.com/v3/oauth/#scopes
@example
github = Github.new oauth_token: 'e72e16c7e42f292c6912e7710c838347ae17'
github.scopes.all
@example
github = Github.new
github.scopes.list 'e72e16c7e42f292c6912e7710c838347ae17'
@example
github = Github.new
github.scopes.list token: 'e72e16c7e42f292c6912e7710c838347ae17'
@api public | [
"Check",
"what",
"OAuth",
"scopes",
"you",
"have",
"."
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/scopes.rb#L24-L43 | train | Get a list of all users | [
30522,
13366,
2862,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
19204,
1027,
12098,
5620,
1012,
5670,
2065,
19204,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
1004,
1004,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.begin_get_search_results_with_http_info | def begin_get_search_results_with_http_info(resource_group_name, workspace_name, parameters, custom_headers:nil)
begin_get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_get_search_results_with_http_info(resource_group_name, workspace_name, parameters, custom_headers:nil)
begin_get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_get_search_results_with_http_info",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_get_search_results_async",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"parameters",
",",
"cust... | Submit a search for a given workspace. The response will contain an id to
track the search. User can use the id to poll the search status and get the
full search result later if the search takes long time to finish.
@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 parameters [SearchParameters] The parameters required to execute a
search query.
@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. | [
"Submit",
"a",
"search",
"for",
"a",
"given",
"workspace",
".",
"The",
"response",
"will",
"contain",
"an",
"id",
"to",
"track",
"the",
"search",
".",
"User",
"can",
"use",
"the",
"id",
"to",
"poll",
"the",
"search",
"status",
"and",
"get",
"the",
"ful... | 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#L623-L625 | train | Gets the search results for the specified workspace. | [
30522,
13366,
4088,
1035,
2131,
1035,
3945,
1035,
3463,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2573,
15327,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/api.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Api.list_by_tags_as_lazy | def list_by_tags_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil)
response = list_by_tags_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_tags_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_tags_as_lazy(resource_group_name, service_name, filter:nil, top:nil, skip:nil, custom_headers:nil)
response = list_by_tags_async(resource_group_name, service_name, filter:filter, top:top, skip:skip, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_tags_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_tags_as_lazy",
"(",
"resource_group_name",
",",
"service_name",
",",
"filter",
":",
"nil",
",",
"top",
":",
"nil",
",",
"skip",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_tags_async",
"(",
"resource_group_name",... | Lists a collection of apis associated with tags.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param filter [String] | Field | Supported operators | Supported
functions |
|-------------|------------------------|---------------------------------------------|
| id | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
endswith |
| name | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
endswith |
| aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
endswith |
| apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
endswith |
| path | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
endswith |
| description | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
endswith |
| serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith,
endswith |
| isCurrent | eq | substringof, contains, startswith,
endswith |
@param top [Integer] Number of records to return.
@param skip [Integer] Number of records to skip.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [TagResourceCollection] which provide lazy access to pages of the
response. | [
"Lists",
"a",
"collection",
"of",
"apis",
"associated",
"with",
"tags",
"."
] | 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/api.rb#L1132-L1141 | train | Gets a list of all the image objects that have the specified tags. | [
30522,
13366,
2862,
1035,
2011,
1035,
22073,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
13558,
1024,
9152,
2140,
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... |
abonas/kubeclient | lib/kubeclient/common.rb | Kubeclient.ClientMixin.get_entities | def get_entities(entity_type, resource_name, options = {})
params = {}
SEARCH_ARGUMENTS.each { |k, v| params[k] = options[v] if options[v] }
ns_prefix = build_namespace_prefix(options[:namespace])
response = handle_exception do
rest_client[ns_prefix + resource_name]
.get({ 'params' => params }.merge(@headers))
end
format_response(options[:as] || @as, response.body, entity_type)
end | ruby | def get_entities(entity_type, resource_name, options = {})
params = {}
SEARCH_ARGUMENTS.each { |k, v| params[k] = options[v] if options[v] }
ns_prefix = build_namespace_prefix(options[:namespace])
response = handle_exception do
rest_client[ns_prefix + resource_name]
.get({ 'params' => params }.merge(@headers))
end
format_response(options[:as] || @as, response.body, entity_type)
end | [
"def",
"get_entities",
"(",
"entity_type",
",",
"resource_name",
",",
"options",
"=",
"{",
"}",
")",
"params",
"=",
"{",
"}",
"SEARCH_ARGUMENTS",
".",
"each",
"{",
"|",
"k",
",",
"v",
"|",
"params",
"[",
"k",
"]",
"=",
"options",
"[",
"v",
"]",
"if... | Accepts the following options:
:namespace (string) - the namespace of the entity.
:label_selector (string) - a selector to restrict the list of returned objects by labels.
:field_selector (string) - a selector to restrict the list of returned objects by fields.
:limit (integer) - a maximum number of items to return in each response
:continue (string) - a token used to retrieve the next chunk of entities
:as (:raw|:ros) - defaults to :ros
:raw - return the raw response body as a string
:ros - return a collection of RecursiveOpenStruct objects | [
"Accepts",
"the",
"following",
"options",
":",
":",
"namespace",
"(",
"string",
")",
"-",
"the",
"namespace",
"of",
"the",
"entity",
".",
":",
"label_selector",
"(",
"string",
")",
"-",
"a",
"selector",
"to",
"restrict",
"the",
"list",
"of",
"returned",
... | 3630f6c82532fba04f3e1a62d6b99c6cf2910451 | https://github.com/abonas/kubeclient/blob/3630f6c82532fba04f3e1a62d6b99c6cf2910451/lib/kubeclient/common.rb#L324-L334 | train | Get all entities | [
30522,
13366,
2131,
1035,
11422,
1006,
9178,
1035,
2828,
1010,
7692,
1035,
2171,
1010,
7047,
1027,
1063,
1065,
1007,
11498,
5244,
1027,
1063,
1065,
3945,
1035,
9918,
1012,
2169,
1063,
1064,
1047,
1010,
1058,
1064,
11498,
5244,
1031,
1047,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/scss-lint | lib/scss_lint/cli.rb | SCSSLint.CLI.relevant_configuration_file | def relevant_configuration_file(options)
if options[:config_file]
options[:config_file]
elsif File.exist?(Config::FILE_NAME)
Config::FILE_NAME
elsif File.exist?(Config.user_file)
Config.user_file
end
end | ruby | def relevant_configuration_file(options)
if options[:config_file]
options[:config_file]
elsif File.exist?(Config::FILE_NAME)
Config::FILE_NAME
elsif File.exist?(Config.user_file)
Config.user_file
end
end | [
"def",
"relevant_configuration_file",
"(",
"options",
")",
"if",
"options",
"[",
":config_file",
"]",
"options",
"[",
":config_file",
"]",
"elsif",
"File",
".",
"exist?",
"(",
"Config",
"::",
"FILE_NAME",
")",
"Config",
"::",
"FILE_NAME",
"elsif",
"File",
".",... | Return the path of the configuration file that should be loaded.
@param options [Hash]
@return [String] | [
"Return",
"the",
"path",
"of",
"the",
"configuration",
"file",
"that",
"should",
"be",
"loaded",
"."
] | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/cli.rb#L151-L159 | train | Returns the file containing the configuration file. | [
30522,
13366,
7882,
1035,
9563,
1035,
5371,
1006,
7047,
1007,
2065,
7047,
1031,
1024,
9530,
8873,
2290,
1035,
5371,
1033,
7047,
1031,
1024,
9530,
8873,
2290,
1035,
5371,
1033,
3449,
5332,
2546,
5371,
1012,
4839,
1029,
1006,
9530,
8873,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/galleries.rb | Azure::Compute::Mgmt::V2019_03_01.Galleries.begin_create_or_update | def begin_create_or_update(resource_group_name, gallery_name, gallery, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, gallery_name, gallery, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create_or_update(resource_group_name, gallery_name, gallery, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, gallery_name, gallery, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create_or_update",
"(",
"resource_group_name",
",",
"gallery_name",
",",
"gallery",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"gallery_name",
",",
"gallery",
",",
"custom_heade... | Create or update a Shared Image Gallery.
@param resource_group_name [String] The name of the resource group.
@param gallery_name [String] The name of the Shared Image Gallery. The
allowed characters are alphabets and numbers with dots and periods allowed in
the middle. The maximum length is 80 characters.
@param gallery [Gallery] Parameters supplied to the create or update Shared
Image Gallery operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Gallery] operation results. | [
"Create",
"or",
"update",
"a",
"Shared",
"Image",
"Gallery",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/galleries.rb#L392-L395 | train | Creates or updates a gallery. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3916,
1035,
2171,
1010,
3916,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cucumber/cucumber-ruby | lib/cucumber/constantize.rb | Cucumber.Constantize.constantize | def constantize(camel_cased_word)
try = 0
begin
try += 1
names = camel_cased_word.split('::')
names.shift if names.empty? || names.first.empty?
constant = ::Object
names.each do |name|
constant = constantize_name(constant, name)
end
constant
rescue NameError => e
require underscore(camel_cased_word)
retry if try < 2
raise e
end
end | ruby | def constantize(camel_cased_word)
try = 0
begin
try += 1
names = camel_cased_word.split('::')
names.shift if names.empty? || names.first.empty?
constant = ::Object
names.each do |name|
constant = constantize_name(constant, name)
end
constant
rescue NameError => e
require underscore(camel_cased_word)
retry if try < 2
raise e
end
end | [
"def",
"constantize",
"(",
"camel_cased_word",
")",
"try",
"=",
"0",
"begin",
"try",
"+=",
"1",
"names",
"=",
"camel_cased_word",
".",
"split",
"(",
"'::'",
")",
"names",
".",
"shift",
"if",
"names",
".",
"empty?",
"||",
"names",
".",
"first",
".",
"em... | :nodoc: | [
":",
"nodoc",
":"
] | de3ba2fb9a35b8bcfd5109f610a0c16180d7abf2 | https://github.com/cucumber/cucumber-ruby/blob/de3ba2fb9a35b8bcfd5109f610a0c16180d7abf2/lib/cucumber/constantize.rb#L6-L23 | train | Constantizes a string | [
30522,
13366,
5377,
4697,
1006,
19130,
1035,
2553,
2094,
1035,
2773,
1007,
3046,
1027,
1014,
4088,
3046,
1009,
1027,
1015,
3415,
1027,
19130,
1035,
2553,
2094,
1035,
2773,
1012,
3975,
1006,
1005,
1024,
1024,
1005,
1007,
3415,
1012,
5670,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/rich_text_run.rb | Axlsx.RichTextRun.to_xml_string | def to_xml_string(str = '')
valid = RichTextRun::INLINE_STYLES
data = Hash[self.instance_values.map{ |k, v| [k.to_sym, v] }]
data = data.select { |key, value| valid.include?(key) && !value.nil? }
str << '<r><rPr>'
data.keys.each do |key|
case key
when :font_name
str << ('<rFont val="' << font_name << '"/>')
when :color
str << data[key].to_xml_string
else
str << ('<' << key.to_s << ' val="' << xml_value(data[key]) << '"/>')
end
end
clean_value = Axlsx::trust_input ? @value.to_s : ::CGI.escapeHTML(Axlsx::sanitize(@value.to_s))
str << ('</rPr><t>' << clean_value << '</t></r>')
end | ruby | def to_xml_string(str = '')
valid = RichTextRun::INLINE_STYLES
data = Hash[self.instance_values.map{ |k, v| [k.to_sym, v] }]
data = data.select { |key, value| valid.include?(key) && !value.nil? }
str << '<r><rPr>'
data.keys.each do |key|
case key
when :font_name
str << ('<rFont val="' << font_name << '"/>')
when :color
str << data[key].to_xml_string
else
str << ('<' << key.to_s << ' val="' << xml_value(data[key]) << '"/>')
end
end
clean_value = Axlsx::trust_input ? @value.to_s : ::CGI.escapeHTML(Axlsx::sanitize(@value.to_s))
str << ('</rPr><t>' << clean_value << '</t></r>')
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"valid",
"=",
"RichTextRun",
"::",
"INLINE_STYLES",
"data",
"=",
"Hash",
"[",
"self",
".",
"instance_values",
".",
"map",
"{",
"|",
"k",
",",
"v",
"|",
"[",
"k",
".",
"to_sym",
",",
"v",
"]",
"}",... | Serializes the RichTextRun
@param [String] str
@return [String] | [
"Serializes",
"the",
"RichTextRun"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/rich_text_run.rb#L191-L209 | train | Convert the instance to XML string. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
9398,
1027,
4138,
18209,
15532,
1024,
1024,
23881,
1035,
6782,
2951,
1027,
23325,
1031,
2969,
1012,
6013,
1035,
5300,
1012,
4949,
1063,
1064,
1047,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.merge_certificate_with_http_info | def merge_certificate_with_http_info(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil)
merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
end | ruby | def merge_certificate_with_http_info(vault_base_url, certificate_name, x509certificates, certificate_attributes:nil, tags:nil, custom_headers:nil)
merge_certificate_async(vault_base_url, certificate_name, x509certificates, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
end | [
"def",
"merge_certificate_with_http_info",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"x509certificates",
",",
"certificate_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"merge_certificate_async",
"(",
"vault_base_ur... | Merges a certificate or a certificate chain with a key pair existing on the
server.
The MergeCertificate operation performs the merging of a certificate or
certificate chain with a key pair currently available in the service. This
operation requires the certificates/create permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param certificate_name [String] The name of the certificate.
@param x509certificates [Array<Array<Integer>>] The certificate or the
certificate chain to merge.
@param certificate_attributes [CertificateAttributes] The attributes of the
certificate (optional).
@param tags [Hash{String => String}] Application specific metadata in the
form of key-value pairs.
@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. | [
"Merges",
"a",
"certificate",
"or",
"a",
"certificate",
"chain",
"with",
"a",
"key",
"pair",
"existing",
"on",
"the",
"server",
"."
] | 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#L6420-L6422 | train | Merge a certificate into a single resource group. | [
30522,
13366,
13590,
1035,
8196,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
1060,
12376,
2683,
17119,
3775,
8873,
16280,
2015,
1010,
8196,
1035,
12332,
1024,
9152,
2140,
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... |
adimichele/hubspot-ruby | lib/hubspot/form.rb | Hubspot.Form.update! | def update!(opts={})
response = Hubspot::Connection.post_json(FORM_PATH, params: { form_guid: @guid }, body: opts)
self.send(:assign_properties, response)
self
end | ruby | def update!(opts={})
response = Hubspot::Connection.post_json(FORM_PATH, params: { form_guid: @guid }, body: opts)
self.send(:assign_properties, response)
self
end | [
"def",
"update!",
"(",
"opts",
"=",
"{",
"}",
")",
"response",
"=",
"Hubspot",
"::",
"Connection",
".",
"post_json",
"(",
"FORM_PATH",
",",
"params",
":",
"{",
"form_guid",
":",
"@guid",
"}",
",",
"body",
":",
"opts",
")",
"self",
".",
"send",
"(",
... | {https://developers.hubspot.com/docs/methods/forms/update_form} | [
"{",
"https",
":",
"//",
"developers",
".",
"hubspot",
".",
"com",
"/",
"docs",
"/",
"methods",
"/",
"forms",
"/",
"update_form",
"}"
] | 8eb0a64dd0c14c79e631e81bfdc169583e775a46 | https://github.com/adimichele/hubspot-ruby/blob/8eb0a64dd0c14c79e631e81bfdc169583e775a46/lib/hubspot/form.rb#L71-L75 | train | Update the form | [
30522,
13366,
10651,
999,
1006,
23569,
2015,
1027,
1063,
1065,
1007,
3433,
1027,
9594,
13102,
4140,
1024,
1024,
4434,
1012,
2695,
1035,
1046,
3385,
1006,
2433,
1035,
4130,
1010,
11498,
5244,
1024,
1063,
2433,
1035,
26458,
2094,
1024,
1030,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/machine.rb | Vagrant.Machine.id= | def id=(value)
@logger.info("New machine ID: #{value.inspect}")
id_file = nil
if @data_dir
# The file that will store the id if we have one. This allows the
# ID to persist across Vagrant runs. Also, store the UUID for the
# machine index.
id_file = @data_dir.join("id")
end
if value
if id_file
# Write the "id" file with the id given.
id_file.open("w+") do |f|
f.write(value)
end
end
if uid_file
# Write the user id that created this machine
uid_file.open("w+") do |f|
f.write(Process.uid.to_s)
end
end
# If we don't have a UUID, then create one
if index_uuid.nil?
# Create the index entry and save it
entry = MachineIndex::Entry.new
entry.local_data_path = @env.local_data_path
entry.name = @name.to_s
entry.provider = @provider_name.to_s
entry.state = "preparing"
entry.vagrantfile_path = @env.root_path
entry.vagrantfile_name = @env.vagrantfile_name
if @box
entry.extra_data["box"] = {
"name" => @box.name,
"provider" => @box.provider.to_s,
"version" => @box.version.to_s,
}
end
entry = @env.machine_index.set(entry)
@env.machine_index.release(entry)
# Store our UUID so we can access it later
if @index_uuid_file
@index_uuid_file.open("w+") do |f|
f.write(entry.id)
end
end
end
else
# Delete the file, since the machine is now destroyed
id_file.delete if id_file && id_file.file?
uid_file.delete if uid_file && uid_file.file?
# If we have a UUID associated with the index, remove it
uuid = index_uuid
if uuid
entry = @env.machine_index.get(uuid)
@env.machine_index.delete(entry) if entry
end
if @data_dir
# Delete the entire data directory contents since all state
# associated with the VM is now gone.
@data_dir.children.each do |child|
begin
child.rmtree
rescue Errno::EACCES
@logger.info("EACCESS deleting file: #{child}")
end
end
end
end
# Store the ID locally
@id = value.nil? ? nil : value.to_s
# Notify the provider that the ID changed in case it needs to do
# any accounting from it.
@provider.machine_id_changed
end | ruby | def id=(value)
@logger.info("New machine ID: #{value.inspect}")
id_file = nil
if @data_dir
# The file that will store the id if we have one. This allows the
# ID to persist across Vagrant runs. Also, store the UUID for the
# machine index.
id_file = @data_dir.join("id")
end
if value
if id_file
# Write the "id" file with the id given.
id_file.open("w+") do |f|
f.write(value)
end
end
if uid_file
# Write the user id that created this machine
uid_file.open("w+") do |f|
f.write(Process.uid.to_s)
end
end
# If we don't have a UUID, then create one
if index_uuid.nil?
# Create the index entry and save it
entry = MachineIndex::Entry.new
entry.local_data_path = @env.local_data_path
entry.name = @name.to_s
entry.provider = @provider_name.to_s
entry.state = "preparing"
entry.vagrantfile_path = @env.root_path
entry.vagrantfile_name = @env.vagrantfile_name
if @box
entry.extra_data["box"] = {
"name" => @box.name,
"provider" => @box.provider.to_s,
"version" => @box.version.to_s,
}
end
entry = @env.machine_index.set(entry)
@env.machine_index.release(entry)
# Store our UUID so we can access it later
if @index_uuid_file
@index_uuid_file.open("w+") do |f|
f.write(entry.id)
end
end
end
else
# Delete the file, since the machine is now destroyed
id_file.delete if id_file && id_file.file?
uid_file.delete if uid_file && uid_file.file?
# If we have a UUID associated with the index, remove it
uuid = index_uuid
if uuid
entry = @env.machine_index.get(uuid)
@env.machine_index.delete(entry) if entry
end
if @data_dir
# Delete the entire data directory contents since all state
# associated with the VM is now gone.
@data_dir.children.each do |child|
begin
child.rmtree
rescue Errno::EACCES
@logger.info("EACCESS deleting file: #{child}")
end
end
end
end
# Store the ID locally
@id = value.nil? ? nil : value.to_s
# Notify the provider that the ID changed in case it needs to do
# any accounting from it.
@provider.machine_id_changed
end | [
"def",
"id",
"=",
"(",
"value",
")",
"@logger",
".",
"info",
"(",
"\"New machine ID: #{value.inspect}\"",
")",
"id_file",
"=",
"nil",
"if",
"@data_dir",
"# The file that will store the id if we have one. This allows the",
"# ID to persist across Vagrant runs. Also, store the UUID... | This sets the unique ID associated with this machine. This will
persist this ID so that in the future Vagrant will be able to find
this machine again. The unique ID must be absolutely unique to the
virtual machine, and can be used by providers for finding the
actual machine associated with this instance.
**WARNING:** Only providers should ever use this method.
@param [String] value The ID. | [
"This",
"sets",
"the",
"unique",
"ID",
"associated",
"with",
"this",
"machine",
".",
"This",
"will",
"persist",
"this",
"ID",
"so",
"that",
"in",
"the",
"future",
"Vagrant",
"will",
"be",
"able",
"to",
"find",
"this",
"machine",
"again",
".",
"The",
"uni... | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/machine.rb#L287-L373 | train | Create a new instance of the MachineIndex class. | [
30522,
13366,
8909,
1027,
1006,
3643,
1007,
1030,
8833,
4590,
1012,
18558,
1006,
1000,
2047,
3698,
8909,
1024,
1001,
1063,
3643,
1012,
22459,
1065,
1000,
1007,
8909,
1035,
5371,
1027,
9152,
2140,
2065,
1030,
2951,
1035,
16101,
1001,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/pdk | lib/pdk/util.rb | PDK.Util.make_tmpdir_name | def make_tmpdir_name(base)
t = Time.now.strftime('%Y%m%d')
name = "#{base}#{t}-#{Process.pid}-#{rand(0x100000000).to_s(36)}"
File.join(Dir.tmpdir, name)
end | ruby | def make_tmpdir_name(base)
t = Time.now.strftime('%Y%m%d')
name = "#{base}#{t}-#{Process.pid}-#{rand(0x100000000).to_s(36)}"
File.join(Dir.tmpdir, name)
end | [
"def",
"make_tmpdir_name",
"(",
"base",
")",
"t",
"=",
"Time",
".",
"now",
".",
"strftime",
"(",
"'%Y%m%d'",
")",
"name",
"=",
"\"#{base}#{t}-#{Process.pid}-#{rand(0x100000000).to_s(36)}\"",
"File",
".",
"join",
"(",
"Dir",
".",
"tmpdir",
",",
"name",
")",
"en... | Generate a name for a temporary directory.
@param base [String] A string to base the name generation off.
@return [String] The temporary directory path. | [
"Generate",
"a",
"name",
"for",
"a",
"temporary",
"directory",
"."
] | 0d864aff62ffef04b5104addf399d0476afd71e7 | https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/util.rb#L46-L50 | train | Make a tmp directory name | [
30522,
13366,
2191,
1035,
1056,
8737,
4305,
2099,
1035,
2171,
1006,
2918,
1007,
1056,
1027,
2051,
1012,
2085,
1012,
2358,
12881,
7292,
1006,
1005,
1003,
1061,
1003,
1049,
1003,
1040,
1005,
1007,
2171,
1027,
1000,
1001,
1063,
2918,
1065,
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_sql/lib/2018-06-01-preview/generated/azure_mgmt_sql/instance_pools.rb | Azure::SQL::Mgmt::V2018_06_01_preview.InstancePools.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, instance_pool_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, instance_pool_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, instance_pool_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, instance_pool_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"instance_pool_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"instance_pool_name",
",",
"parameters",
",",
"... | Creates or updates an instance pool.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param instance_pool_name [String] The name of the instance pool to be
created or updated.
@param parameters [InstancePool] The requested instance pool resource state.
@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",
"an",
"instance",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2018-06-01-preview/generated/azure_mgmt_sql/instance_pools.rb#L485-L487 | train | Creates or updates an instance pool. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
30524,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.list_storage_accounts_with_http_info | def list_storage_accounts_with_http_info(resource_group_name, account_name, filter:nil, top:nil, skip:nil, expand:nil, select:nil, orderby:nil, count:nil, search:nil, format:nil, custom_headers:nil)
list_storage_accounts_async(resource_group_name, account_name, filter:filter, top:top, skip:skip, expand:expand, select:select, orderby:orderby, count:count, search:search, format:format, custom_headers:custom_headers).value!
end | ruby | def list_storage_accounts_with_http_info(resource_group_name, account_name, filter:nil, top:nil, skip:nil, expand:nil, select:nil, orderby:nil, count:nil, search:nil, format:nil, custom_headers:nil)
list_storage_accounts_async(resource_group_name, account_name, filter:filter, top:top, skip:skip, expand:expand, select:select, orderby:orderby, count:count, search:search, format:format, custom_headers:custom_headers).value!
end | [
"def",
"list_storage_accounts_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"filter",
":",
"nil",
",",
"top",
":",
"nil",
",",
"skip",
":",
"nil",
",",
"expand",
":",
"nil",
",",
"select",
":",
"nil",
",",
"orderby",
":",
"nil",
",... | Gets the first page of Azure Storage accounts, if any, linked to the
specified Data Lake Analytics account. The response includes a link to the
next page, if any.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Analytics account.
@param account_name [String] The name of the Data Lake Analytics account for
which to list Azure Storage accounts.
@param filter [String] The OData filter. Optional.
@param top [Integer] The number of items to return. Optional.
@param skip [Integer] The number of items to skip over before returning
elements. Optional.
@param expand [String] OData expansion. Expand related resources in line with
the retrieved resources, e.g. Categories/$expand=Products would expand
Product data in line with each Category entry. Optional.
@param select [String] OData Select statement. Limits the properties on each
entry to just those requested, e.g.
Categories?$select=CategoryName,Description. Optional.
@param orderby [String] OrderBy clause. One or more comma-separated
expressions with an optional "asc" (the default) or "desc" depending on the
order you'd like the values sorted, e.g. Categories?$orderby=CategoryName
desc. Optional.
@param count [Boolean] The Boolean value of true or false to request a count
of the matching resources included with the resources in the response, e.g.
Categories?$count=true. Optional.
@param search [String] A free form search. A free-text search expression to
match for whether a particular entry should be included in the feed, e.g.
Categories?$search=blue OR green. Optional.
@param format [String] The desired return format. Return the response in
particular formatxii without access to request headers for standard
content-type negotiation (e.g Orders?$format=json). Optional.
@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",
"first",
"page",
"of",
"Azure",
"Storage",
"accounts",
"if",
"any",
"linked",
"to",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L1184-L1186 | train | Gets the list of storage accounts. | [
30522,
13366,
2862,
1035,
5527,
1035,
6115,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
13558,
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... |
mongodb/mongoid | lib/mongoid/persistable.rb | Mongoid.Persistable.atomically | def atomically(join_context: nil)
join_context = Mongoid.join_contexts if join_context.nil?
call_depth = @atomic_depth ||= 0
has_own_context = call_depth.zero? || !join_context
@atomic_updates_to_execute_stack ||= []
_mongoid_push_atomic_context if has_own_context
if block_given?
@atomic_depth += 1
yield(self)
@atomic_depth -= 1
end
if has_own_context
persist_atomic_operations @atomic_context
_mongoid_remove_atomic_context_changes
end
true
rescue Exception => e
_mongoid_reset_atomic_context_changes! if has_own_context
raise e
ensure
_mongoid_pop_atomic_context if has_own_context
if call_depth.zero?
@atomic_depth = nil
@atomic_updates_to_execute_stack = nil
end
end | ruby | def atomically(join_context: nil)
join_context = Mongoid.join_contexts if join_context.nil?
call_depth = @atomic_depth ||= 0
has_own_context = call_depth.zero? || !join_context
@atomic_updates_to_execute_stack ||= []
_mongoid_push_atomic_context if has_own_context
if block_given?
@atomic_depth += 1
yield(self)
@atomic_depth -= 1
end
if has_own_context
persist_atomic_operations @atomic_context
_mongoid_remove_atomic_context_changes
end
true
rescue Exception => e
_mongoid_reset_atomic_context_changes! if has_own_context
raise e
ensure
_mongoid_pop_atomic_context if has_own_context
if call_depth.zero?
@atomic_depth = nil
@atomic_updates_to_execute_stack = nil
end
end | [
"def",
"atomically",
"(",
"join_context",
":",
"nil",
")",
"join_context",
"=",
"Mongoid",
".",
"join_contexts",
"if",
"join_context",
".",
"nil?",
"call_depth",
"=",
"@atomic_depth",
"||=",
"0",
"has_own_context",
"=",
"call_depth",
".",
"zero?",
"||",
"!",
"... | Execute operations atomically (in a single database call) for everything
that would happen inside the block. This method supports nesting further
calls to atomically, which will behave according to the options described
below.
An option join_context can be given which, when true, will merge the
operations declared by the given block with the atomically block wrapping
the current invocation for the same document, if one exists. If this
block or any other block sharing the same context raises before
persisting, then all the operations of that context will not be
persisted, and will also be reset in memory.
When join_context is false, the given block of operations will be
persisted independently of other contexts. Failures in other contexts will
not affect this one, so long as this block was able to run and persist
changes.
The default value of join_context is set by the global configuration
option join_contexts, whose own default is false.
@example Execute the operations atomically.
document.atomically do
document.set(name: "Tool").inc(likes: 10)
end
@example Execute some inner operations atomically, but independently from the outer operations.
document.atomically do
document.inc likes: 10
document.atomically join_context: false do
# The following is persisted to the database independently.
document.unset :origin
end
document.atomically join_context: true do
# The following is persisted along with the other outer operations.
document.inc member_count: 3
end
document.set name: "Tool"
end
@param [ true, false ] join_context Join the context (i.e. merge
declared atomic operations) of the atomically block wrapping this one
for the same document, if one exists.
@return [ true, false ] If the operation succeeded.
@since 4.0.0 | [
"Execute",
"operations",
"atomically",
"(",
"in",
"a",
"single",
"database",
"call",
")",
"for",
"everything",
"that",
"would",
"happen",
"inside",
"the",
"block",
".",
"This",
"method",
"supports",
"nesting",
"further",
"calls",
"to",
"atomically",
"which",
"... | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/persistable.rb#L93-L122 | train | Returns a new instance of the class atomically. | [
30522,
13366,
9593,
3973,
1006,
3693,
1035,
6123,
1024,
9152,
2140,
1007,
3693,
1035,
6123,
1027,
12256,
3995,
3593,
1012,
30524,
1035,
5995,
1064,
1064,
1027,
1014,
2038,
1035,
2219,
1035,
6123,
1027,
2655,
1035,
5995,
1012,
5717,
1029,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/kpi.rb | Azure::CustomerInsights::Mgmt::V2017_01_01.Kpi.reprocess | def reprocess(resource_group_name, hub_name, kpi_name, custom_headers:nil)
response = reprocess_async(resource_group_name, hub_name, kpi_name, custom_headers:custom_headers).value!
nil
end | ruby | def reprocess(resource_group_name, hub_name, kpi_name, custom_headers:nil)
response = reprocess_async(resource_group_name, hub_name, kpi_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"reprocess",
"(",
"resource_group_name",
",",
"hub_name",
",",
"kpi_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"reprocess_async",
"(",
"resource_group_name",
",",
"hub_name",
",",
"kpi_name",
",",
"custom_headers",
":custom_headers",
")",... | Reprocesses the Kpi values of the specified KPI.
@param resource_group_name [String] The name of the resource group.
@param hub_name [String] The name of the hub.
@param kpi_name [String] The name of the KPI.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Reprocesses",
"the",
"Kpi",
"values",
"of",
"the",
"specified",
"KPI",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/kpi.rb#L221-L224 | train | Reprocesses the specified KPI in a hub. | [
30522,
13366,
16360,
3217,
9623,
2015,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9594,
1035,
2171,
1010,
1047,
8197,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
16360,
3217,
9623,
2015,
1035,
2004,
6038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/bot.rb | Discordrb.Bot.delete_guild_role | def delete_guild_role(data)
role_id = data['role_id'].to_i
server_id = data['guild_id'].to_i
server = @servers[server_id]
server.delete_role(role_id)
end | ruby | def delete_guild_role(data)
role_id = data['role_id'].to_i
server_id = data['guild_id'].to_i
server = @servers[server_id]
server.delete_role(role_id)
end | [
"def",
"delete_guild_role",
"(",
"data",
")",
"role_id",
"=",
"data",
"[",
"'role_id'",
"]",
".",
"to_i",
"server_id",
"=",
"data",
"[",
"'guild_id'",
"]",
".",
"to_i",
"server",
"=",
"@servers",
"[",
"server_id",
"]",
"server",
".",
"delete_role",
"(",
... | Internal handler for GUILD_ROLE_DELETE | [
"Internal",
"handler",
"for",
"GUILD_ROLE_DELETE"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L935-L940 | train | Delete a role from a guild | [
30522,
13366,
3972,
12870,
1035,
9054,
1035,
2535,
1006,
2951,
1007,
2535,
1035,
8909,
1027,
2951,
1031,
1005,
2535,
1035,
8909,
1005,
1033,
1012,
2000,
1035,
1045,
8241,
1035,
8909,
1027,
2951,
1031,
1005,
9054,
1035,
8909,
1005,
1033,
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... |
decidim/decidim | decidim-core/app/helpers/decidim/amendments_helper.rb | Decidim.AmendmentsHelper.promoted? | def promoted?(emendation)
logs = Decidim::ActionLog.where(decidim_component_id: emendation.component)
.where(decidim_user_id: emendation.creator_author)
.where(action: "promote")
logs.select { |log| log.extra["promoted_from"] == emendation.id }.present?
end | ruby | def promoted?(emendation)
logs = Decidim::ActionLog.where(decidim_component_id: emendation.component)
.where(decidim_user_id: emendation.creator_author)
.where(action: "promote")
logs.select { |log| log.extra["promoted_from"] == emendation.id }.present?
end | [
"def",
"promoted?",
"(",
"emendation",
")",
"logs",
"=",
"Decidim",
"::",
"ActionLog",
".",
"where",
"(",
"decidim_component_id",
":",
"emendation",
".",
"component",
")",
".",
"where",
"(",
"decidim_user_id",
":",
"emendation",
".",
"creator_author",
")",
"."... | Checks if the unique ActionLog created in the promote command exists. | [
"Checks",
"if",
"the",
"unique",
"ActionLog",
"created",
"in",
"the",
"promote",
"command",
"exists",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/amendments_helper.rb#L98-L104 | train | Returns true if the given emendation is promoted to another emendation | [
30522,
13366,
3755,
1029,
1006,
7861,
10497,
3370,
1007,
15664,
1027,
30524,
1024,
2895,
21197,
1012,
2073,
1006,
11703,
28173,
2213,
1035,
6922,
1035,
8909,
1024,
7861,
10497,
3370,
1012,
6922,
1007,
1012,
2073,
1006,
11703,
28173,
2213,
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... |
decidim/decidim | decidim-core/app/helpers/decidim/decidim_form_helper.rb | Decidim.DecidimFormHelper.decidim_form_slug_url | def decidim_form_slug_url(prepend_path = "", value = "")
prepend_slug_path = if prepend_path.present?
"/#{prepend_path}/"
else
"/"
end
content_tag(:span, class: "slug-url") do
[
request.protocol,
request.host_with_port,
prepend_slug_path
].join("").html_safe +
content_tag(:span, value, class: "slug-url-value")
end
end | ruby | def decidim_form_slug_url(prepend_path = "", value = "")
prepend_slug_path = if prepend_path.present?
"/#{prepend_path}/"
else
"/"
end
content_tag(:span, class: "slug-url") do
[
request.protocol,
request.host_with_port,
prepend_slug_path
].join("").html_safe +
content_tag(:span, value, class: "slug-url-value")
end
end | [
"def",
"decidim_form_slug_url",
"(",
"prepend_path",
"=",
"\"\"",
",",
"value",
"=",
"\"\"",
")",
"prepend_slug_path",
"=",
"if",
"prepend_path",
".",
"present?",
"\"/#{prepend_path}/\"",
"else",
"\"/\"",
"end",
"content_tag",
"(",
":span",
",",
"class",
":",
"\... | Helper method to show how slugs will look like. Intended to be used in forms
together with some JavaScript code. More precisely, this will most probably
show in help texts in forms. The space slug is surrounded with a `span` so
the slug can be updated via JavaScript with the input value.
prepend_path - a path to prepend to the slug, without final slash
value - the initial value of the slug field, so that edit forms have a value
Returns an HTML-safe String. | [
"Helper",
"method",
"to",
"show",
"how",
"slugs",
"will",
"look",
"like",
".",
"Intended",
"to",
"be",
"used",
"in",
"forms",
"together",
"with",
"some",
"JavaScript",
"code",
".",
"More",
"precisely",
"this",
"will",
"most",
"probably",
"show",
"in",
"hel... | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/decidim_form_helper.rb#L170-L184 | train | Returns a slug - url tag with the given value. | [
30522,
13366,
11703,
28173,
2213,
1035,
2433,
1035,
23667,
1035,
24471,
2140,
1006,
17463,
10497,
1035,
4130,
1027,
1000,
1000,
1010,
3643,
1027,
1000,
1000,
1007,
17463,
10497,
1035,
23667,
1035,
4130,
1027,
2065,
17463,
10497,
1035,
4130,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.recover_partition_with_http_info | def recover_partition_with_http_info(partition_id, timeout:60, custom_headers:nil)
recover_partition_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def recover_partition_with_http_info(partition_id, timeout:60, custom_headers:nil)
recover_partition_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"recover_partition_with_http_info",
"(",
"partition_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"recover_partition_async",
"(",
"partition_id",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".",
"va... | Indicates to the Service Fabric cluster that it should attempt to recover a
specific partition which is currently stuck in quorum loss.
Indicates to the Service Fabric cluster that it should attempt to recover a
specific partition which is currently stuck in quorum loss. This operation
should only be performed if it is known that the replicas that are down
cannot be recovered. Incorrect use of this API can cause potential data loss.
@param partition_id The identity of the partition.
@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. | [
"Indicates",
"to",
"the",
"Service",
"Fabric",
"cluster",
"that",
"it",
"should",
"attempt",
"to",
"recover",
"a",
"specific",
"partition",
"which",
"is",
"currently",
"stuck",
"in",
"quorum",
"loss",
"."
] | 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#L13212-L13214 | train | Recover the partition. | [
30522,
13366,
8980,
1035,
13571,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
8980,
30524,
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... |
square/connect-ruby-sdk | lib/square_connect/models/catalog_modifier_override.rb | SquareConnect.CatalogModifierOverride.modifier_id= | def modifier_id=(modifier_id)
if modifier_id.nil?
fail ArgumentError, "modifier_id cannot be nil"
end
if modifier_id.to_s.length < 1
fail ArgumentError, "invalid value for 'modifier_id', the character length must be great than or equal to 1."
end
@modifier_id = modifier_id
end | ruby | def modifier_id=(modifier_id)
if modifier_id.nil?
fail ArgumentError, "modifier_id cannot be nil"
end
if modifier_id.to_s.length < 1
fail ArgumentError, "invalid value for 'modifier_id', the character length must be great than or equal to 1."
end
@modifier_id = modifier_id
end | [
"def",
"modifier_id",
"=",
"(",
"modifier_id",
")",
"if",
"modifier_id",
".",
"nil?",
"fail",
"ArgumentError",
",",
"\"modifier_id cannot be nil\"",
"end",
"if",
"modifier_id",
".",
"to_s",
".",
"length",
"<",
"1",
"fail",
"ArgumentError",
",",
"\"invalid value fo... | Custom attribute writer method with validation
@param [Object] modifier_id Value to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"with",
"validation"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/catalog_modifier_override.rb#L81-L91 | train | Set the modifier_id of the object. | [
30522,
13366,
16913,
18095,
1035,
8909,
1027,
1006,
16913,
18095,
1035,
8909,
1007,
2065,
16913,
18095,
1035,
8909,
1012,
9152,
2140,
1029,
8246,
6685,
2121,
29165,
1010,
1000,
16913,
18095,
1035,
8909,
3685,
2022,
9152,
2140,
1000,
2203,
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_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/runs.rb | Azure::ContainerRegistry::Mgmt::V2018_09_01.Runs.cancel_async | def cancel_async(resource_group_name, registry_name, run_id, custom_headers:nil)
# Send request
promise = begin_cancel_async(resource_group_name, registry_name, run_id, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def cancel_async(resource_group_name, registry_name, run_id, custom_headers:nil)
# Send request
promise = begin_cancel_async(resource_group_name, registry_name, run_id, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"cancel_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"run_id",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_cancel_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"run_id",
",",
"custom_header... | @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 run_id [String] The run ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@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",
"regist... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/runs.rb#L418-L432 | train | Cancels a run. | [
30522,
13366,
17542,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
2448,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
17542,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb | Azure::CognitiveServices::Face::V1_0.LargePersonGroupPerson.add_face_from_stream_with_http_info | def add_face_from_stream_with_http_info(large_person_group_id, person_id, image, user_data:nil, target_face:nil, custom_headers:nil)
add_face_from_stream_async(large_person_group_id, person_id, image, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
end | ruby | def add_face_from_stream_with_http_info(large_person_group_id, person_id, image, user_data:nil, target_face:nil, custom_headers:nil)
add_face_from_stream_async(large_person_group_id, person_id, image, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
end | [
"def",
"add_face_from_stream_with_http_info",
"(",
"large_person_group_id",
",",
"person_id",
",",
"image",
",",
"user_data",
":",
"nil",
",",
"target_face",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"add_face_from_stream_async",
"(",
"large_person_group_id",
... | Add a representative face to a person for identification. The input face is
specified as an image with a targetFace rectangle.
@param large_person_group_id [String] Id referencing a particular large
person group.
@param person_id Id referencing a particular person.
@param image An image stream.
@param user_data [String] User-specified data about the face for any purpose.
The maximum length is 1KB.
@param target_face [Array<Integer>] A face rectangle to specify the target
face to be added to a person in the format of
"targetFace=left,top,width,height". E.g. "targetFace=10,10,100,100". If there
is more than one face in the image, targetFace is required to specify which
face to add. No targetFace means there is only one face detected in the
entire image.
@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. | [
"Add",
"a",
"representative",
"face",
"to",
"a",
"person",
"for",
"identification",
".",
"The",
"input",
"face",
"is",
"specified",
"as",
"an",
"image",
"with",
"a",
"targetFace",
"rectangle",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb#L1055-L1057 | train | Adds a face to a person s face list. | [
30522,
13366,
5587,
1035,
2227,
1035,
2013,
1035,
5460,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2312,
1035,
2711,
1035,
2177,
1035,
8909,
1010,
2711,
1035,
8909,
1010,
3746,
1010,
5310,
1035,
2951,
1024,
9152,
2140,
1010,
4539,
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... |
zendesk/ruby-kafka | lib/kafka/client.rb | Kafka.Client.fetch_messages | def fetch_messages(topic:, partition:, offset: :latest, max_wait_time: 5, min_bytes: 1, max_bytes: 1048576, retries: 1)
operation = FetchOperation.new(
cluster: @cluster,
logger: @logger,
min_bytes: min_bytes,
max_bytes: max_bytes,
max_wait_time: max_wait_time,
)
operation.fetch_from_partition(topic, partition, offset: offset, max_bytes: max_bytes)
attempt = 1
begin
operation.execute.flat_map {|batch| batch.messages }
rescue Kafka::Error => e
@cluster.mark_as_stale!
if attempt >= (retries + 1)
raise
else
attempt += 1
@logger.warn "Error while fetching messages, #{e.class}: #{e.message}; retrying..."
retry
end
end
end | ruby | def fetch_messages(topic:, partition:, offset: :latest, max_wait_time: 5, min_bytes: 1, max_bytes: 1048576, retries: 1)
operation = FetchOperation.new(
cluster: @cluster,
logger: @logger,
min_bytes: min_bytes,
max_bytes: max_bytes,
max_wait_time: max_wait_time,
)
operation.fetch_from_partition(topic, partition, offset: offset, max_bytes: max_bytes)
attempt = 1
begin
operation.execute.flat_map {|batch| batch.messages }
rescue Kafka::Error => e
@cluster.mark_as_stale!
if attempt >= (retries + 1)
raise
else
attempt += 1
@logger.warn "Error while fetching messages, #{e.class}: #{e.message}; retrying..."
retry
end
end
end | [
"def",
"fetch_messages",
"(",
"topic",
":",
",",
"partition",
":",
",",
"offset",
":",
":latest",
",",
"max_wait_time",
":",
"5",
",",
"min_bytes",
":",
"1",
",",
"max_bytes",
":",
"1048576",
",",
"retries",
":",
"1",
")",
"operation",
"=",
"FetchOperati... | Fetches a batch of messages from a single partition. Note that it's possible
to get back empty batches.
The starting point for the fetch can be configured with the `:offset` argument.
If you pass a number, the fetch will start at that offset. However, there are
two special Symbol values that can be passed instead:
* `:earliest` — the first offset in the partition.
* `:latest` — the next offset that will be written to, effectively making the
call block until there is a new message in the partition.
The Kafka protocol specifies the numeric values of these two options: -2 and -1,
respectively. You can also pass in these numbers directly.
## Example
When enumerating the messages in a partition, you typically fetch batches
sequentially.
offset = :earliest
loop do
messages = kafka.fetch_messages(
topic: "my-topic",
partition: 42,
offset: offset,
)
messages.each do |message|
puts message.offset, message.key, message.value
# Set the next offset that should be read to be the subsequent
# offset.
offset = message.offset + 1
end
end
See a working example in `examples/simple-consumer.rb`.
@param topic [String] the topic that messages should be fetched from.
@param partition [Integer] the partition that messages should be fetched from.
@param offset [Integer, Symbol] the offset to start reading from. Default is
the latest offset.
@param max_wait_time [Integer] the maximum amount of time to wait before
the server responds, in seconds.
@param min_bytes [Integer] the minimum number of bytes to wait for. If set to
zero, the broker will respond immediately, but the response may be empty.
The default is 1 byte, which means that the broker will respond as soon as
a message is written to the partition.
@param max_bytes [Integer] the maximum number of bytes to include in the
response message set. Default is 1 MB. You need to set this higher if you
expect messages to be larger than this.
@return [Array<Kafka::FetchedMessage>] the messages returned from the broker. | [
"Fetches",
"a",
"batch",
"of",
"messages",
"from",
"a",
"single",
"partition",
".",
"Note",
"that",
"it",
"s",
"possible",
"to",
"get",
"back",
"empty",
"batches",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/client.rb#L458-L484 | train | Fetch all the messages from a topic partition | [
30522,
13366,
18584,
1035,
7696,
1006,
8476,
1024,
1010,
13571,
1024,
1010,
16396,
1024,
1024,
6745,
1010,
4098,
1035,
3524,
1035,
2051,
1024,
1019,
1010,
8117,
1035,
27507,
1024,
1015,
1010,
4098,
1035,
27507,
1024,
9645,
27531,
2581,
2575... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.