repo stringclasses 235 values | path stringlengths 11 168 | func_name stringlengths 12 143 | original_string stringlengths 83 6.91k | language stringclasses 1 value | code stringlengths 83 6.91k | code_tokens listlengths 15 1.01k | docstring stringlengths 5 25.7k | docstring_tokens listlengths 1 427 | sha stringclasses 235 values | url stringlengths 99 268 | partition stringclasses 1 value | summary stringlengths 7 202 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | management/azure_mgmt_signalr/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb | Azure::Signalr::Mgmt::V2018_03_01_preview.SignalR.delete | def delete(resource_group_name, resource_name, custom_headers:nil)
response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, resource_name, custom_headers:nil)
response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Operation to delete a SignalR service.
@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 resource_name [String] The name of the SignalR resource.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Operation",
"to",
"delete",
"a",
"SignalR",
"service",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_signalr/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb#L610-L613 | train | Deletes a given HDInsight resource. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
30524,
2015,
1007,
1012,
3643,
999,
9152,
2140,
2203,
102,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb | Azure::Labservices::Mgmt::V2018_10_15.Labs.add_users | def add_users(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers:nil)
response = add_users_async(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers:custom_headers).value!
nil
end | ruby | def add_users(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers:nil)
response = add_users_async(resource_group_name, lab_account_name, lab_name, add_users_payload, custom_headers:custom_headers).value!
nil
end | [
"def",
"add_users",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
"add_users_payload",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"add_users_async",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
... | Add users to a lab
@param resource_group_name [String] The name of the resource group.
@param lab_account_name [String] The name of the lab Account.
@param lab_name [String] The name of the lab.
@param add_users_payload [AddUsersPayload] Payload for Add Users operation on
a Lab.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Add",
"users",
"to",
"a",
"lab"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb#L515-L518 | train | Adds users to a lab. | [
30522,
13366,
5587,
1035,
5198,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
1035,
2171,
1010,
5587,
1035,
5198,
1035,
18093,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
5587,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_relay/lib/2016-07-01/generated/azure_mgmt_relay/namespaces.rb | Azure::Relay::Mgmt::V2016_07_01.Namespaces.list_post_authorization_rules_as_lazy | def list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
response = list_post_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_post_authorization_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
response = list_post_authorization_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_post_authorization_rules_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_post_authorization_rules_as_lazy",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_post_authorization_rules_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"custom_headers",
":custo... | Authorization rules for a namespace.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The Namespace Name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [AuthorizationRuleListResult] which provide lazy access to pages of
the response. | [
"Authorization",
"rules",
"for",
"a",
"namespace",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_relay/lib/2016-07-01/generated/azure_mgmt_relay/namespaces.rb#L2086-L2095 | train | Gets the list of post authorization rules for a namespace. | [
30522,
13366,
2862,
1035,
2695,
1035,
20104,
1035,
3513,
1035,
2004,
1035,
13971,
30524,
15327,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
4983,
3433,
1012,
9152,
2140,
1029,
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... |
zendesk/ruby-kafka | lib/kafka/ssl_socket_with_timeout.rb | Kafka.SSLSocketWithTimeout.write | def write(bytes)
loop do
written = 0
begin
# unlike plain tcp sockets, ssl sockets don't support IO.select
# properly.
# Instead, timeouts happen on a per write basis, and we have to
# catch exceptions from write_nonblock, and gradually build up
# our write buffer.
written += @ssl_socket.write_nonblock(bytes)
rescue Errno::EFAULT => error
raise error
rescue OpenSSL::SSL::SSLError, Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitWritable => error
if error.is_a?(OpenSSL::SSL::SSLError) && error.message == 'write would block'
if select_with_timeout(@ssl_socket, :write)
retry
else
raise Errno::ETIMEDOUT
end
else
raise error
end
end
# Fast, common case.
break if written == bytes.size
# This takes advantage of the fact that most ruby implementations
# have Copy-On-Write strings. Thusly why requesting a subrange
# of data, we actually don't copy data because the new string
# simply references a subrange of the original.
bytes = bytes[written, bytes.size]
end
end | ruby | def write(bytes)
loop do
written = 0
begin
# unlike plain tcp sockets, ssl sockets don't support IO.select
# properly.
# Instead, timeouts happen on a per write basis, and we have to
# catch exceptions from write_nonblock, and gradually build up
# our write buffer.
written += @ssl_socket.write_nonblock(bytes)
rescue Errno::EFAULT => error
raise error
rescue OpenSSL::SSL::SSLError, Errno::EAGAIN, Errno::EWOULDBLOCK, IO::WaitWritable => error
if error.is_a?(OpenSSL::SSL::SSLError) && error.message == 'write would block'
if select_with_timeout(@ssl_socket, :write)
retry
else
raise Errno::ETIMEDOUT
end
else
raise error
end
end
# Fast, common case.
break if written == bytes.size
# This takes advantage of the fact that most ruby implementations
# have Copy-On-Write strings. Thusly why requesting a subrange
# of data, we actually don't copy data because the new string
# simply references a subrange of the original.
bytes = bytes[written, bytes.size]
end
end | [
"def",
"write",
"(",
"bytes",
")",
"loop",
"do",
"written",
"=",
"0",
"begin",
"# unlike plain tcp sockets, ssl sockets don't support IO.select",
"# properly.",
"# Instead, timeouts happen on a per write basis, and we have to",
"# catch exceptions from write_nonblock, and gradually build... | Writes bytes to the socket, possible with a timeout.
@param bytes [String] the data that should be written to the socket.
@raise [Errno::ETIMEDOUT] if the timeout is exceeded.
@return [Integer] the number of bytes written. | [
"Writes",
"bytes",
"to",
"the",
"socket",
"possible",
"with",
"a",
"timeout",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/ssl_socket_with_timeout.rb#L126-L159 | train | Write the given bytes to the socket. | [
30522,
13366,
4339,
1006,
27507,
1007,
7077,
2079,
2517,
1027,
1014,
4088,
1001,
4406,
5810,
22975,
2361,
27540,
1010,
7020,
2140,
27540,
2123,
1005,
1056,
2490,
22834,
1012,
7276,
1001,
7919,
1012,
1001,
2612,
1010,
2051,
12166,
4148,
2006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
wearefine/fae | app/controllers/fae/files_controller.rb | Fae.FilesController.delete_file | def delete_file
file = Fae::File.find_by_id(params[:id])
file.remove_asset = true
file.save
render body: nil
end | ruby | def delete_file
file = Fae::File.find_by_id(params[:id])
file.remove_asset = true
file.save
render body: nil
end | [
"def",
"delete_file",
"file",
"=",
"Fae",
"::",
"File",
".",
"find_by_id",
"(",
"params",
"[",
":id",
"]",
")",
"file",
".",
"remove_asset",
"=",
"true",
"file",
".",
"save",
"render",
"body",
":",
"nil",
"end"
] | ajax delete action
post 'files/:id/delete_file' => 'files#delete_file', as: :delete_file
here we just remove the asset from the attached file model, because if we deleted
the model itself, re-uploading a new one would break. | [
"ajax",
"delete",
"action"
] | 645d6b66945aeff54e27af6a95c4f8a1f7a67d39 | https://github.com/wearefine/fae/blob/645d6b66945aeff54e27af6a95c4f8a1f7a67d39/app/controllers/fae/files_controller.rb#L8-L13 | train | delete file | [
30522,
13366,
3972,
12870,
1035,
5371,
5371,
1027,
17282,
1024,
1024,
5371,
1012,
2424,
1035,
2011,
1035,
8909,
1006,
11498,
5244,
1031,
1024,
8909,
1033,
1007,
5371,
1012,
6366,
1035,
11412,
1027,
2995,
5371,
1012,
3828,
17552,
2303,
30524... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb | Azure::CognitiveServices::ComputerVision::V2_0.ComputerVisionClient.recognize_printed_text_in_stream | def recognize_printed_text_in_stream(detect_orientation, image, language:nil, custom_headers:nil)
response = recognize_printed_text_in_stream_async(detect_orientation, image, language:language, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def recognize_printed_text_in_stream(detect_orientation, image, language:nil, custom_headers:nil)
response = recognize_printed_text_in_stream_async(detect_orientation, image, language:language, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"recognize_printed_text_in_stream",
"(",
"detect_orientation",
",",
"image",
",",
"language",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"recognize_printed_text_in_stream_async",
"(",
"detect_orientation",
",",
"image",
",",
"language",
... | Optical Character Recognition (OCR) detects text in an image and extracts the
recognized characters into a machine-usable character stream.
Upon success, the OCR results will be returned.
Upon failure, the error code together with an error message will be returned.
The error code can be one of InvalidImageUrl, InvalidImageFormat,
InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or
InternalServerError.
@param detect_orientation [Boolean] Whether detect the text orientation in
the image. With detectOrientation=true the OCR service tries to detect the
image orientation and correct it before further processing (e.g. if it's
upside-down).
@param image An image stream.
@param language [OcrLanguages] The BCP-47 language code of the text to be
detected in the image. The default value is 'unk'. Possible values include:
'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el',
'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro',
'sr-Cyrl', 'sr-Latn', 'sk'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OcrResult] operation results. | [
"Optical",
"Character",
"Recognition",
"(",
"OCR",
")",
"detects",
"text",
"in",
"an",
"image",
"and",
"extracts",
"the",
"recognized",
"characters",
"into",
"a",
"machine",
"-",
"usable",
"character",
"stream",
".",
"Upon",
"success",
"the",
"OCR",
"results",... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb#L2690-L2693 | train | Recognizes the printed text in a given image. | [
30522,
13366,
6807,
1035,
6267,
1035,
3793,
30524,
6038,
2278,
1006,
11487,
1035,
10296,
1010,
3746,
1010,
2653,
1024,
2653,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
3433,
1012,
2303,
4983,
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... |
github/licensed | lib/licensed/dependency.rb | Licensed.Dependency.license_content_sources | def license_content_sources(files)
paths = Array(files).map do |file|
next file[:uri] if file[:uri]
path = dir_path.join(file[:dir], file[:name])
normalize_source_path(path)
end
paths.join(", ")
end | ruby | def license_content_sources(files)
paths = Array(files).map do |file|
next file[:uri] if file[:uri]
path = dir_path.join(file[:dir], file[:name])
normalize_source_path(path)
end
paths.join(", ")
end | [
"def",
"license_content_sources",
"(",
"files",
")",
"paths",
"=",
"Array",
"(",
"files",
")",
".",
"map",
"do",
"|",
"file",
"|",
"next",
"file",
"[",
":uri",
"]",
"if",
"file",
"[",
":uri",
"]",
"path",
"=",
"dir_path",
".",
"join",
"(",
"file",
... | Returns the sources for a group of license file contents
Sources are returned as a single string with sources separated by ", " | [
"Returns",
"the",
"sources",
"for",
"a",
"group",
"of",
"license",
"file",
"contents"
] | afba288df344e001d43e94ad9217635a011b79c2 | https://github.com/github/licensed/blob/afba288df344e001d43e94ad9217635a011b79c2/lib/licensed/dependency.rb#L95-L104 | train | Returns the license content sources for the given files | [
30522,
13366,
6105,
1035,
4180,
1035,
4216,
1006,
6764,
1007,
10425,
1027,
9140,
1006,
6764,
1007,
1012,
4949,
2079,
1064,
5371,
1064,
2279,
5371,
1031,
1024,
24471,
2072,
1033,
2065,
5371,
1031,
1024,
24471,
2072,
1033,
4130,
1027,
16101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/charge_request.rb | SquareConnect.ChargeRequest.order_id= | def order_id=(order_id)
if !order_id.nil? && order_id.to_s.length > 192
fail ArgumentError, "invalid value for 'order_id', the character length must be smaller than or equal to 192."
end
@order_id = order_id
end | ruby | def order_id=(order_id)
if !order_id.nil? && order_id.to_s.length > 192
fail ArgumentError, "invalid value for 'order_id', the character length must be smaller than or equal to 192."
end
@order_id = order_id
end | [
"def",
"order_id",
"=",
"(",
"order_id",
")",
"if",
"!",
"order_id",
".",
"nil?",
"&&",
"order_id",
".",
"to_s",
".",
"length",
">",
"192",
"fail",
"ArgumentError",
",",
"\"invalid value for 'order_id', the character length must be smaller than or equal to 192.\"",
"end... | Custom attribute writer method with validation
@param [Object] order_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/charge_request.rb#L295-L302 | train | Sets the order_id of the object. | [
30522,
13366,
2344,
1035,
8909,
1027,
1006,
2344,
1035,
8909,
1007,
2065,
999,
2344,
1035,
8909,
1012,
9152,
2140,
1029,
1004,
1004,
2344,
1035,
8909,
1012,
2000,
1035,
1055,
1012,
3091,
1028,
17613,
8246,
6685,
2121,
29165,
1010,
1000,
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... |
samvera/hyrax | app/controllers/concerns/hyrax/leases_controller_behavior.rb | Hyrax.LeasesControllerBehavior.destroy | def destroy
Hyrax::Actors::LeaseActor.new(curation_concern).destroy
flash[:notice] = curation_concern.lease_history.last
if curation_concern.work? && curation_concern.file_sets.present?
redirect_to confirm_permission_path
else
redirect_to edit_lease_path
end
end | ruby | def destroy
Hyrax::Actors::LeaseActor.new(curation_concern).destroy
flash[:notice] = curation_concern.lease_history.last
if curation_concern.work? && curation_concern.file_sets.present?
redirect_to confirm_permission_path
else
redirect_to edit_lease_path
end
end | [
"def",
"destroy",
"Hyrax",
"::",
"Actors",
"::",
"LeaseActor",
".",
"new",
"(",
"curation_concern",
")",
".",
"destroy",
"flash",
"[",
":notice",
"]",
"=",
"curation_concern",
".",
"lease_history",
".",
"last",
"if",
"curation_concern",
".",
"work?",
"&&",
"... | Removes a single lease | [
"Removes",
"a",
"single",
"lease"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/controllers/concerns/hyrax/leases_controller_behavior.rb#L15-L23 | train | destroy a lease | [
30522,
13366,
6033,
1044,
19563,
2595,
1024,
1024,
5889,
1024,
1024,
10084,
18908,
2953,
1012,
2047,
1006,
12731,
8156,
1035,
5142,
1007,
1012,
6033,
5956,
1031,
1024,
5060,
1033,
1027,
12731,
8156,
1035,
5142,
1012,
10084,
1035,
2381,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.DeviceSettings.get_time_settings_with_http_info | def get_time_settings_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
get_time_settings_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def get_time_settings_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
get_time_settings_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"get_time_settings_with_http_info",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"get_time_settings_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
"... | Gets the time settings of the specified device.
@param device_name [String] The device name
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"time",
"settings",
"of",
"the",
"specified",
"device",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb#L525-L527 | train | Gets the time settings for the specified device. | [
30522,
13366,
2131,
1035,
2051,
1035,
10906,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2051,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb | Azure::SQL::Mgmt::V2014_04_01.Databases.begin_pause_with_http_info | def begin_pause_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
begin_pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
end | ruby | def begin_pause_with_http_info(resource_group_name, server_name, database_name, custom_headers:nil)
begin_pause_async(resource_group_name, server_name, database_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_pause_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_pause_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"custom_headers",
":custom_he... | Pauses a data warehouse.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param database_name [String] The name of the data warehouse to pause.
@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. | [
"Pauses",
"a",
"data",
"warehouse",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb#L1360-L1362 | train | Pause a database. | [
30522,
13366,
4088,
1035,
8724,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
8724,
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_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/email_template.rb | Azure::ApiManagement::Mgmt::V2018_01_01.EmailTemplate.list_by_service_next | def list_by_service_next(next_page_link, custom_headers:nil)
response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_service_next(next_page_link, custom_headers:nil)
response = list_by_service_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_service_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_service_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"respon... | Lists a collection of properties defined within a service instance.
@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 [EmailTemplateCollection] operation results. | [
"Lists",
"a",
"collection",
"of",
"properties",
"defined",
"within",
"a",
"service",
"instance",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/email_template.rb#L793-L796 | train | Gets the list of the elastic advisors. | [
30522,
13366,
2862,
1035,
2011,
1035,
2326,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
2326,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
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_netapp/lib/2017-08-15-preview/generated/azure_mgmt_netapp/volumes.rb | Azure::NetApp::Mgmt::V2017_08_15_preview.Volumes.begin_create_or_update | def begin_create_or_update(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
response = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create_or_update(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:nil)
response = begin_create_or_update_async(body, resource_group_name, account_name, pool_name, volume_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create_or_update",
"(",
"body",
",",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"volume_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_or_update_async",
"(",
"body",
",",
"resource_group_name",
",",
... | Create or update a volume
@param body [Volume] Volume object supplied in the body of the operation.
@param resource_group_name [String] The name of the resource group.
@param account_name [String] The name of the NetApp account
@param pool_name [String] The name of the capacity pool
@param volume_name [String] The name of the volume
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Volume] operation results. | [
"Create",
"or",
"update",
"a",
"volume"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_netapp/lib/2017-08-15-preview/generated/azure_mgmt_netapp/volumes.rb#L446-L449 | train | Creates or updates a managed volume. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1006,
2303,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4770,
1035,
2171,
1010,
3872,
1035,
2171,
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... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.hidden_field | def hidden_field(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'hidden_field_for', &block)
define_method(name) do
return platform.hidden_field_value_for identifier.clone unless block_given?
self.send("#{name}_element").value
end
end | ruby | def hidden_field(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'hidden_field_for', &block)
define_method(name) do
return platform.hidden_field_value_for identifier.clone unless block_given?
self.send("#{name}_element").value
end
end | [
"def",
"hidden_field",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'hidden_field_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
... | adds three methods to the page object - one to get the text from a hidden field,
another to retrieve the hidden field element, and another to check the hidden
field's existence.
@example
hidden_field(:user_id, :id => "user_identity")
# will generate 'user_id', 'user_id_element' and 'user_id?' methods
@param [String] the name used for the generated methods
@param [Hash] identifier how we find a hidden field.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"to",
"the",
"page",
"object",
"-",
"one",
"to",
"get",
"the",
"text",
"from",
"a",
"hidden",
"field",
"another",
"to",
"retrieve",
"the",
"hidden",
"field",
"element",
"and",
"another",
"to",
"check",
"the",
"hidden",
"field",
... | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L221-L227 | train | Creates a hidden field. | [
30522,
13366,
5023,
1035,
2492,
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,
5023,
1035,
2492,
1035,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/webhooks/embeds.rb | Discordrb::Webhooks.Embed.add_field | def add_field(name: nil, value: nil, inline: nil)
self << EmbedField.new(name: name, value: value, inline: inline)
end | ruby | def add_field(name: nil, value: nil, inline: nil)
self << EmbedField.new(name: name, value: value, inline: inline)
end | [
"def",
"add_field",
"(",
"name",
":",
"nil",
",",
"value",
":",
"nil",
",",
"inline",
":",
"nil",
")",
"self",
"<<",
"EmbedField",
".",
"new",
"(",
"name",
":",
"name",
",",
"value",
":",
"value",
",",
"inline",
":",
"inline",
")",
"end"
] | Convenience method to add a field to the embed without having to create one manually.
@see EmbedField
@example Add a field to an embed, conveniently
embed.add_field(name: 'A field', value: "The field's content")
@param name [String] The field's name
@param value [String] The field's value
@param inline [true, false] Whether the field should be inlined | [
"Convenience",
"method",
"to",
"add",
"a",
"field",
"to",
"the",
"embed",
"without",
"having",
"to",
"create",
"one",
"manually",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/webhooks/embeds.rb#L98-L100 | train | Add a field to the embed. | [
30522,
13366,
5587,
1035,
2492,
1006,
2171,
1024,
9152,
2140,
1010,
3643,
1024,
9152,
2140,
1010,
23881,
1024,
9152,
2140,
1007,
2969,
1026,
1026,
7861,
8270,
3790,
1012,
2047,
1006,
2171,
1024,
2171,
1010,
3643,
1024,
3643,
1010,
23881,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_image_store_content_with_http_info | def get_image_store_content_with_http_info(content_path, timeout:60, custom_headers:nil)
get_image_store_content_async(content_path, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_image_store_content_with_http_info(content_path, timeout:60, custom_headers:nil)
get_image_store_content_async(content_path, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_image_store_content_with_http_info",
"(",
"content_path",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_image_store_content_async",
"(",
"content_path",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
... | Gets the image store content information.
Returns the information about the image store content at the specified
contentPath relative to the root of the image store.
@param content_path [String] Relative path to file or folder in the image
store from its root.
@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",
"image",
"store",
"content",
"information",
"."
] | 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#L19322-L19324 | train | Gets the content of an image store. | [
30522,
13366,
2131,
1035,
3746,
1035,
3573,
1035,
4180,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
4180,
1035,
4130,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
3746,
1035,
3573,
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/sprockets | lib/sprockets/path_utils.rb | Sprockets.PathUtils.stat_sorted_tree | def stat_sorted_tree(dir, &block)
return to_enum(__method__, dir) unless block_given?
self.stat_directory(dir).sort_by { |path, stat|
stat.directory? ? "#{path}/" : path
}.each do |path, stat|
yield path, stat
if stat.directory?
stat_sorted_tree(path, &block)
end
end
nil
end | ruby | def stat_sorted_tree(dir, &block)
return to_enum(__method__, dir) unless block_given?
self.stat_directory(dir).sort_by { |path, stat|
stat.directory? ? "#{path}/" : path
}.each do |path, stat|
yield path, stat
if stat.directory?
stat_sorted_tree(path, &block)
end
end
nil
end | [
"def",
"stat_sorted_tree",
"(",
"dir",
",",
"&",
"block",
")",
"return",
"to_enum",
"(",
"__method__",
",",
"dir",
")",
"unless",
"block_given?",
"self",
".",
"stat_directory",
"(",
"dir",
")",
".",
"sort_by",
"{",
"|",
"path",
",",
"stat",
"|",
"stat",
... | Public: Recursive stat all the files under a directory in alphabetical
order.
dir - A String directory
Returns an Enumerator of [path, stat]. | [
"Public",
":",
"Recursive",
"stat",
"all",
"the",
"files",
"under",
"a",
"directory",
"in",
"alphabetical",
"order",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/path_utils.rb#L324-L338 | train | Returns the sorted tree of the files in the given directory. | [
30522,
13366,
28093,
1035,
19616,
1035,
3392,
1006,
16101,
1010,
1004,
3796,
1007,
2709,
2000,
1035,
4372,
2819,
1006,
1035,
1035,
4118,
1035,
1035,
1010,
16101,
1007,
4983,
3796,
1035,
2445,
1029,
2969,
1012,
28093,
1035,
14176,
1006,
1610... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | vagrant/spec/support/example_helpers.rb | BackupSpec.ExampleHelpers.backup_perform | def backup_perform(triggers, *options)
triggers = Array(triggers).map(&:to_s)
opts = options.last.is_a?(Hash) ? options.pop : {}
exit_status = opts.delete(:exit_status)
options << '--no-quiet' if example.metadata[:focus] || ENV['VERBOSE']
argv = ['perform', '-t', triggers.join(',')] + options
# Reset config paths, utility paths and the logger.
Backup::Config.send(:reset!)
Backup::Utilities.send(:reset!)
Backup::Logger.send(:reset!)
# Ensure multiple runs have different timestamps
sleep 1 unless Backup::Model.all.empty?
# Clear previously loaded models and other class instance variables
Backup::Model.send(:reset!)
ARGV.replace(argv)
if exit_status
expect do
Backup::CLI.start
end.to raise_error(SystemExit) {|exit|
expect( exit.status ).to be(exit_status)
}
else
Backup::CLI.start
end
models = triggers.map {|t| Backup::Model.find_by_trigger(t).first }
jobs = models.map {|m| BackupSpec::PerformedJob.new(m) }
jobs.count > 1 ? jobs : jobs.first
end | ruby | def backup_perform(triggers, *options)
triggers = Array(triggers).map(&:to_s)
opts = options.last.is_a?(Hash) ? options.pop : {}
exit_status = opts.delete(:exit_status)
options << '--no-quiet' if example.metadata[:focus] || ENV['VERBOSE']
argv = ['perform', '-t', triggers.join(',')] + options
# Reset config paths, utility paths and the logger.
Backup::Config.send(:reset!)
Backup::Utilities.send(:reset!)
Backup::Logger.send(:reset!)
# Ensure multiple runs have different timestamps
sleep 1 unless Backup::Model.all.empty?
# Clear previously loaded models and other class instance variables
Backup::Model.send(:reset!)
ARGV.replace(argv)
if exit_status
expect do
Backup::CLI.start
end.to raise_error(SystemExit) {|exit|
expect( exit.status ).to be(exit_status)
}
else
Backup::CLI.start
end
models = triggers.map {|t| Backup::Model.find_by_trigger(t).first }
jobs = models.map {|m| BackupSpec::PerformedJob.new(m) }
jobs.count > 1 ? jobs : jobs.first
end | [
"def",
"backup_perform",
"(",
"triggers",
",",
"*",
"options",
")",
"triggers",
"=",
"Array",
"(",
"triggers",
")",
".",
"map",
"(",
":to_s",
")",
"opts",
"=",
"options",
".",
"last",
".",
"is_a?",
"(",
"Hash",
")",
"?",
"options",
".",
"pop",
":",
... | Runs the given trigger(s).
Any +options+ given are passed as command line options to the
`backup perform` command. These should be given as String arguments.
e.g. job = backup_perform :my_backup, '--tmp-path=/tmp'
The last argument given for +options+ may be a Hash, which is used
as options for this method. If { :exit_status => Integer } is set,
this method will rescue SystemExit and assert that the exit status
is correct. This allows jobs that log warnings to continue and return
the performed job(s).
When :focus is added to an example, '--no-quiet' will be appended to
+options+ so you can see the log output as the backup is performed. | [
"Runs",
"the",
"given",
"trigger",
"(",
"s",
")",
"."
] | 64370f925e859f858766b674717a3dbee0de7a26 | https://github.com/backup/backup/blob/64370f925e859f858766b674717a3dbee0de7a26/vagrant/spec/support/example_helpers.rb#L105-L136 | train | Perform a backup of the given triggers | [
30522,
13366,
10200,
1035,
4685,
1006,
27099,
1010,
1008,
7047,
1007,
27099,
1027,
9140,
1006,
27099,
1007,
1012,
4949,
1006,
1004,
1024,
2000,
1035,
1055,
1007,
23569,
2015,
1027,
7047,
1012,
2197,
1012,
2003,
1035,
1037,
1029,
1006,
23325... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Devices.scan_for_updates_async | def scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers:nil)
# Send request
promise = begin_scan_for_updates_async(device_name, resource_group_name, manager_name, 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 scan_for_updates_async(device_name, resource_group_name, manager_name, custom_headers:nil)
# Send request
promise = begin_scan_for_updates_async(device_name, resource_group_name, manager_name, 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",
"scan_for_updates_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_scan_for_updates_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_na... | @param device_name [String] The device name
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"device_name",
"[",
"String",
"]",
"The",
"device",
"name",
"@param",
"resource_group_name",
"[",
"String",
"]",
"The",
"resource",
"group",
"name",
"@param",
"manager_name",
"[",
"String",
"]",
"The",
"manager",
"name",
"@param",
"custom_headers",
"["... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb#L926-L940 | train | Scans for updates on the device. | [
30522,
13366,
13594,
1035,
2005,
1035,
14409,
1035,
2004,
6038,
2278,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
30524,
1035,
2171,
1010,
7661,
1035,
20346,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb | Axlsx.FilterColumn.apply | def apply(row, offset)
row.hidden = @filter.apply(row.cells[offset+col_id.to_i])
end | ruby | def apply(row, offset)
row.hidden = @filter.apply(row.cells[offset+col_id.to_i])
end | [
"def",
"apply",
"(",
"row",
",",
"offset",
")",
"row",
".",
"hidden",
"=",
"@filter",
".",
"apply",
"(",
"row",
".",
"cells",
"[",
"offset",
"+",
"col_id",
".",
"to_i",
"]",
")",
"end"
] | Apply the filters for this column
@param [Array] row A row from a worksheet that needs to be
filtered. | [
"Apply",
"the",
"filters",
"for",
"this",
"column"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb#L67-L69 | train | Apply the filter to the row | [
30522,
13366,
6611,
1006,
5216,
1010,
16396,
1007,
5216,
1012,
5023,
1027,
1030,
11307,
1012,
6611,
1006,
5216,
1012,
4442,
1031,
16396,
1009,
8902,
1035,
8909,
1012,
2000,
1035,
1045,
1033,
1007,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/paged_request.rb | Github.PagedRequest.page_request | def page_request(path, params={})
if params[PARAM_PER_PAGE] == NOT_FOUND
params[PARAM_PER_PAGE] = default_page_size
end
if params[PARAM_PAGE] && params[PARAM_PAGE] == NOT_FOUND
params[PARAM_PAGE] = default_page
end
current_api.get_request(path, ParamsHash.new(params))
end | ruby | def page_request(path, params={})
if params[PARAM_PER_PAGE] == NOT_FOUND
params[PARAM_PER_PAGE] = default_page_size
end
if params[PARAM_PAGE] && params[PARAM_PAGE] == NOT_FOUND
params[PARAM_PAGE] = default_page
end
current_api.get_request(path, ParamsHash.new(params))
end | [
"def",
"page_request",
"(",
"path",
",",
"params",
"=",
"{",
"}",
")",
"if",
"params",
"[",
"PARAM_PER_PAGE",
"]",
"==",
"NOT_FOUND",
"params",
"[",
"PARAM_PER_PAGE",
"]",
"=",
"default_page_size",
"end",
"if",
"params",
"[",
"PARAM_PAGE",
"]",
"&&",
"para... | Perform http get request with pagination parameters | [
"Perform",
"http",
"get",
"request",
"with",
"pagination",
"parameters"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/paged_request.rb#L30-L39 | train | Get a request to a specific page | [
30522,
13366,
3931,
1035,
5227,
1006,
4130,
1010,
11498,
5244,
1027,
1063,
1065,
1007,
2065,
11498,
5244,
1031,
11498,
2213,
1035,
2566,
1035,
3931,
1033,
1027,
1027,
2025,
1035,
2179,
11498,
5244,
1031,
11498,
2213,
1035,
2566,
1035,
3931,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/azure_firewalls.rb | Azure::Network::Mgmt::V2018_07_01.AzureFirewalls.begin_delete | def begin_delete(resource_group_name, azure_firewall_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, azure_firewall_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, azure_firewall_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, azure_firewall_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"azure_firewall_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"azure_firewall_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"val... | Deletes the specified Azure Firewall.
@param resource_group_name [String] The name of the resource group.
@param azure_firewall_name [String] The name of the Azure Firewall.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"Azure",
"Firewall",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/azure_firewalls.rb#L381-L384 | train | Deletes the specified Azure Firewall. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
24296,
1035,
2543,
9628,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/volume_containers.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.VolumeContainers.get_with_http_info | def get_with_http_info(device_name, volume_container_name, resource_group_name, manager_name, custom_headers:nil)
get_async(device_name, volume_container_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(device_name, volume_container_name, resource_group_name, manager_name, custom_headers:nil)
get_async(device_name, volume_container_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"device_name",
",",
"volume_container_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"device_name",
",",
"volume_container_name",
",",
"resource_group_name",
",",
"manag... | Gets the properties of the specified volume container name.
@param device_name [String] The device name
@param volume_container_name [String] The name of the volume container.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"properties",
"of",
"the",
"specified",
"volume",
"container",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/volume_containers.rb#L151-L153 | train | Gets the specified volume container. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5080,
1035,
2171,
1010,
3872,
1035,
11661,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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_automation/lib/2015-10-31/generated/azure_mgmt_automation/job_operations.rb | Azure::Automation::Mgmt::V2015_10_31.JobOperations.get_runbook_content | def get_runbook_content(resource_group_name, automation_account_name, job_id, custom_headers:nil)
response = get_runbook_content_async(resource_group_name, automation_account_name, job_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_runbook_content(resource_group_name, automation_account_name, job_id, custom_headers:nil)
response = get_runbook_content_async(resource_group_name, automation_account_name, job_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_runbook_content",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"job_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_runbook_content_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"job_id",
",",
... | Retrieve the runbook content of the job identified by job id.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param job_id [String] The job id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [NOT_IMPLEMENTED] operation results. | [
"Retrieve",
"the",
"runbook",
"content",
"of",
"the",
"job",
"identified",
"by",
"job",
"id",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/job_operations.rb#L141-L144 | train | Gets the runbook content of the job. | [
30522,
13366,
2131,
1035,
2448,
8654,
1035,
4180,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
3105,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2448,
8654,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.update_sas_definition | def update_sas_definition(vault_base_url, storage_account_name, sas_definition_name, parameters:nil, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
response = update_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, parameters:parameters, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_sas_definition(vault_base_url, storage_account_name, sas_definition_name, parameters:nil, sas_definition_attributes:nil, tags:nil, custom_headers:nil)
response = update_sas_definition_async(vault_base_url, storage_account_name, sas_definition_name, parameters:parameters, sas_definition_attributes:sas_definition_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_sas_definition",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"sas_definition_name",
",",
"parameters",
":",
"nil",
",",
"sas_definition_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
... | Updates the specified attributes associated with the given SAS definition.
This operation requires the storage/setsas permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param storage_account_name [String] The name of the storage account.
@param sas_definition_name [String] The name of the SAS definition.
@param parameters [Hash{String => String}] Sas definition update metadata in
the form of key-value pairs.
@param sas_definition_attributes [SasDefinitionAttributes] The attributes of
the SAS definition.
@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 [SasDefinitionBundle] operation results. | [
"Updates",
"the",
"specified",
"attributes",
"associated",
"with",
"the",
"given",
"SAS",
"definition",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"setsas",
"permission",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L8129-L8132 | train | Updates the specified SAS definition. | [
30522,
13366,
10651,
1035,
21871,
1035,
6210,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
21871,
1035,
6210,
1035,
2171,
1010,
11709,
1024,
9152,
2140,
1010,
21871,
1035,
6210,
1035,
12332,
1024,
91... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/public_ipaddresses.rb | Azure::Network::Mgmt::V2018_07_01.PublicIPAddresses.begin_update_tags_with_http_info | def begin_update_tags_with_http_info(resource_group_name, public_ip_address_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, public_ip_address_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_tags_with_http_info(resource_group_name, public_ip_address_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, public_ip_address_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_tags_with_http_info",
"(",
"resource_group_name",
",",
"public_ip_address_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_tags_async",
"(",
"resource_group_name",
",",
"public_ip_address_name",
",",
"parameters",
",",
"cu... | Updates public IP address tags.
@param resource_group_name [String] The name of the resource group.
@param public_ip_address_name [String] The name of the public IP address.
@param parameters [TagsObject] Parameters supplied to update public IP
address tags.
@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",
"public",
"IP",
"address",
"tags",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/public_ipaddresses.rb#L647-L649 | train | Updates the tags on an existing public IP address. | [
30522,
13366,
4088,
1035,
10651,
1035,
22073,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2270,
1035,
12997,
1035,
4769,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/package.rb | Axlsx.Package.parts | def parts
parts = [
{:entry => RELS_PN, :doc => relationships, :schema => RELS_XSD},
{:entry => "xl/#{STYLES_PN}", :doc => workbook.styles, :schema => SML_XSD},
{:entry => CORE_PN, :doc => @core, :schema => CORE_XSD},
{:entry => APP_PN, :doc => @app, :schema => APP_XSD},
{:entry => WORKBOOK_RELS_PN, :doc => workbook.relationships, :schema => RELS_XSD},
{:entry => CONTENT_TYPES_PN, :doc => content_types, :schema => CONTENT_TYPES_XSD},
{:entry => WORKBOOK_PN, :doc => workbook, :schema => SML_XSD}
]
workbook.drawings.each do |drawing|
parts << {:entry => "xl/#{drawing.rels_pn}", :doc => drawing.relationships, :schema => RELS_XSD}
parts << {:entry => "xl/#{drawing.pn}", :doc => drawing, :schema => DRAWING_XSD}
end
workbook.tables.each do |table|
parts << {:entry => "xl/#{table.pn}", :doc => table, :schema => SML_XSD}
end
workbook.pivot_tables.each do |pivot_table|
cache_definition = pivot_table.cache_definition
parts << {:entry => "xl/#{pivot_table.rels_pn}", :doc => pivot_table.relationships, :schema => RELS_XSD}
parts << {:entry => "xl/#{pivot_table.pn}", :doc => pivot_table} #, :schema => SML_XSD}
parts << {:entry => "xl/#{cache_definition.pn}", :doc => cache_definition} #, :schema => SML_XSD}
end
workbook.comments.each do|comment|
if comment.size > 0
parts << { :entry => "xl/#{comment.pn}", :doc => comment, :schema => SML_XSD }
parts << { :entry => "xl/#{comment.vml_drawing.pn}", :doc => comment.vml_drawing, :schema => nil }
end
end
workbook.charts.each do |chart|
parts << {:entry => "xl/#{chart.pn}", :doc => chart, :schema => DRAWING_XSD}
end
workbook.images.each do |image|
parts << {:entry => "xl/#{image.pn}", :path => image.image_src}
end
if use_shared_strings
parts << {:entry => "xl/#{SHARED_STRINGS_PN}", :doc => workbook.shared_strings, :schema => SML_XSD}
end
workbook.worksheets.each do |sheet|
parts << {:entry => "xl/#{sheet.rels_pn}", :doc => sheet.relationships, :schema => RELS_XSD}
parts << {:entry => "xl/#{sheet.pn}", :doc => sheet, :schema => SML_XSD}
end
# Sort parts for correct MIME detection
parts.sort_by { |part| part[:entry] }
end | ruby | def parts
parts = [
{:entry => RELS_PN, :doc => relationships, :schema => RELS_XSD},
{:entry => "xl/#{STYLES_PN}", :doc => workbook.styles, :schema => SML_XSD},
{:entry => CORE_PN, :doc => @core, :schema => CORE_XSD},
{:entry => APP_PN, :doc => @app, :schema => APP_XSD},
{:entry => WORKBOOK_RELS_PN, :doc => workbook.relationships, :schema => RELS_XSD},
{:entry => CONTENT_TYPES_PN, :doc => content_types, :schema => CONTENT_TYPES_XSD},
{:entry => WORKBOOK_PN, :doc => workbook, :schema => SML_XSD}
]
workbook.drawings.each do |drawing|
parts << {:entry => "xl/#{drawing.rels_pn}", :doc => drawing.relationships, :schema => RELS_XSD}
parts << {:entry => "xl/#{drawing.pn}", :doc => drawing, :schema => DRAWING_XSD}
end
workbook.tables.each do |table|
parts << {:entry => "xl/#{table.pn}", :doc => table, :schema => SML_XSD}
end
workbook.pivot_tables.each do |pivot_table|
cache_definition = pivot_table.cache_definition
parts << {:entry => "xl/#{pivot_table.rels_pn}", :doc => pivot_table.relationships, :schema => RELS_XSD}
parts << {:entry => "xl/#{pivot_table.pn}", :doc => pivot_table} #, :schema => SML_XSD}
parts << {:entry => "xl/#{cache_definition.pn}", :doc => cache_definition} #, :schema => SML_XSD}
end
workbook.comments.each do|comment|
if comment.size > 0
parts << { :entry => "xl/#{comment.pn}", :doc => comment, :schema => SML_XSD }
parts << { :entry => "xl/#{comment.vml_drawing.pn}", :doc => comment.vml_drawing, :schema => nil }
end
end
workbook.charts.each do |chart|
parts << {:entry => "xl/#{chart.pn}", :doc => chart, :schema => DRAWING_XSD}
end
workbook.images.each do |image|
parts << {:entry => "xl/#{image.pn}", :path => image.image_src}
end
if use_shared_strings
parts << {:entry => "xl/#{SHARED_STRINGS_PN}", :doc => workbook.shared_strings, :schema => SML_XSD}
end
workbook.worksheets.each do |sheet|
parts << {:entry => "xl/#{sheet.rels_pn}", :doc => sheet.relationships, :schema => RELS_XSD}
parts << {:entry => "xl/#{sheet.pn}", :doc => sheet, :schema => SML_XSD}
end
# Sort parts for correct MIME detection
parts.sort_by { |part| part[:entry] }
end | [
"def",
"parts",
"parts",
"=",
"[",
"{",
":entry",
"=>",
"RELS_PN",
",",
":doc",
"=>",
"relationships",
",",
":schema",
"=>",
"RELS_XSD",
"}",
",",
"{",
":entry",
"=>",
"\"xl/#{STYLES_PN}\"",
",",
":doc",
"=>",
"workbook",
".",
"styles",
",",
":schema",
"... | The parts of a package
@return [Array] An array of hashes that define the entry, document and schema for each part of the package.
@private | [
"The",
"parts",
"of",
"a",
"package"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/package.rb#L195-L248 | train | Returns the list of parts that are part of the workbook. | [
30522,
13366,
3033,
3033,
1027,
1031,
1063,
1024,
4443,
1027,
1028,
2128,
4877,
1035,
1052,
2078,
1010,
1024,
9986,
1027,
1028,
6550,
1010,
1024,
8040,
28433,
1027,
1028,
2128,
4877,
1035,
1060,
16150,
1065,
1010,
1063,
1024,
4443,
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... |
ruby-git/ruby-git | lib/git/base.rb | Git.Base.is_branch? | def is_branch?(branch)
branch_names = self.branches.map {|b| b.name}
branch_names.include?(branch)
end | ruby | def is_branch?(branch)
branch_names = self.branches.map {|b| b.name}
branch_names.include?(branch)
end | [
"def",
"is_branch?",
"(",
"branch",
")",
"branch_names",
"=",
"self",
".",
"branches",
".",
"map",
"{",
"|",
"b",
"|",
"b",
".",
"name",
"}",
"branch_names",
".",
"include?",
"(",
"branch",
")",
"end"
] | returns +true+ if the branch exists | [
"returns",
"+",
"true",
"+",
"if",
"the",
"branch",
"exists"
] | 9bd4407c56068e1604f14a1b6c0c5a84868e6378 | https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/base.rb#L175-L178 | train | Returns true if the branch is a branch | [
30522,
13366,
2003,
1035,
3589,
1029,
1006,
3589,
1007,
3589,
1035,
3415,
1027,
2969,
1012,
5628,
1012,
4949,
1063,
1064,
1038,
1064,
1038,
1012,
2171,
1065,
3589,
1035,
3415,
1012,
2421,
1029,
1006,
3589,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_managed_applications/lib/2018-06-01/generated/azure_mgmt_managed_applications/application_definitions.rb | Azure::ManagedApplications::Mgmt::V2018_06_01.ApplicationDefinitions.delete | def delete(resource_group_name, application_definition_name, custom_headers:nil)
response = delete_async(resource_group_name, application_definition_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, application_definition_name, custom_headers:nil)
response = delete_async(resource_group_name, application_definition_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"application_definition_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"application_definition_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Deletes the managed application definition.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param application_definition_name [String] The name of the managed
application definition to delete.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"managed",
"application",
"definition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_managed_applications/lib/2018-06-01/generated/azure_mgmt_managed_applications/application_definitions.rb#L137-L140 | train | Deletes an application definition. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4646,
1035,
6210,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_sub_list_with_http_info | def delete_sub_list_with_http_info(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:nil)
delete_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:custom_headers).value!
end | ruby | def delete_sub_list_with_http_info(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:nil)
delete_sub_list_async(app_id, version_id, cl_entity_id, sub_list_id, custom_headers:custom_headers).value!
end | [
"def",
"delete_sub_list_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"cl_entity_id",
",",
"sub_list_id",
",",
"custom_headers",
":",
"nil",
")",
"delete_sub_list_async",
"(",
"app_id",
",",
"version_id",
",",
"cl_entity_id",
",",
"sub_list_id",
",",
"cust... | Deletes a sublist of a specific list entity model from a version of the
application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param cl_entity_id The list entity extractor ID.
@param sub_list_id [Integer] The sublist ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"a",
"sublist",
"of",
"a",
"specific",
"list",
"entity",
"model",
"from",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L3656-L3658 | train | Deletes a list of subLists. | [
30522,
13366,
3972,
12870,
1035,
4942,
1035,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
18856,
1035,
9178,
1035,
8909,
1010,
4942,
1035,
2862,
1035,
8909,
1010,
7661,
1035,
20346,
2015,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/machine.rb | Vagrant.Machine.action_raw | def action_raw(name, callable, extra_env=nil)
# Run the action with the action runner on the environment
env = {
action_name: "machine_action_#{name}".to_sym,
machine: self,
machine_action: name,
ui: @ui,
}.merge(extra_env || {})
@env.action_runner.run(callable, env)
end | ruby | def action_raw(name, callable, extra_env=nil)
# Run the action with the action runner on the environment
env = {
action_name: "machine_action_#{name}".to_sym,
machine: self,
machine_action: name,
ui: @ui,
}.merge(extra_env || {})
@env.action_runner.run(callable, env)
end | [
"def",
"action_raw",
"(",
"name",
",",
"callable",
",",
"extra_env",
"=",
"nil",
")",
"# Run the action with the action runner on the environment",
"env",
"=",
"{",
"action_name",
":",
"\"machine_action_#{name}\"",
".",
"to_sym",
",",
"machine",
":",
"self",
",",
"m... | This calls a raw callable in the proper context of the machine using
the middleware stack.
@param [Symbol] name Name of the action
@param [Proc] callable
@param [Hash] extra_env Extra env for the action env.
@return [Hash] The resulting env | [
"This",
"calls",
"a",
"raw",
"callable",
"in",
"the",
"proper",
"context",
"of",
"the",
"machine",
"using",
"the",
"middleware",
"stack",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/machine.rb#L230-L239 | train | Run the given action on the environment | [
30522,
13366,
2895,
1035,
6315,
1006,
2171,
1010,
2655,
3085,
1010,
4469,
1035,
4372,
2615,
1027,
9152,
2140,
1007,
1001,
2448,
1996,
2895,
2007,
1996,
2895,
5479,
2006,
1996,
4044,
4372,
2615,
1027,
1063,
2895,
1035,
2171,
1024,
1000,
36... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/vpn_connections.rb | Azure::Network::Mgmt::V2019_02_01.VpnConnections.begin_delete | def begin_delete(resource_group_name, gateway_name, connection_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, gateway_name, connection_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, gateway_name, connection_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, gateway_name, connection_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"connection_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"connection_name",
",",
"custom_headers",... | Deletes a vpn connection.
@param resource_group_name [String] The resource group name of the
VpnGateway.
@param gateway_name [String] The name of the gateway.
@param connection_name [String] The name of the connection.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"a",
"vpn",
"connection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/vpn_connections.rb#L448-L451 | train | Deletes a connection from the specified HDInsight gateway. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11909,
1035,
2171,
1010,
4434,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
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... |
plataformatec/simple_form | lib/simple_form/form_builder.rb | SimpleForm.FormBuilder.collection_check_boxes | def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
SimpleForm::Tags::CollectionCheckBoxes.new(@object_name, method, @template, collection, value_method, text_method, objectify_options(options), @default_options.merge(html_options)).render(&block)
end | ruby | def collection_check_boxes(method, collection, value_method, text_method, options = {}, html_options = {}, &block)
SimpleForm::Tags::CollectionCheckBoxes.new(@object_name, method, @template, collection, value_method, text_method, objectify_options(options), @default_options.merge(html_options)).render(&block)
end | [
"def",
"collection_check_boxes",
"(",
"method",
",",
"collection",
",",
"value_method",
",",
"text_method",
",",
"options",
"=",
"{",
"}",
",",
"html_options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"SimpleForm",
"::",
"Tags",
"::",
"CollectionCheckBoxes",
"... | Creates a collection of check boxes for each item in the collection,
associated with a clickable label. Use value_method and text_method to
convert items in the collection for use as text/value in check boxes.
You can give a symbol or a proc to both value_method and text_method,
that will be evaluated for each item in the collection.
== Examples
form_for @user do |f|
f.collection_check_boxes :options, [[true, 'Yes'] ,[false, 'No']], :first, :last
end
<input name="user[options][]" type="hidden" value="" />
<input id="user_options_true" name="user[options][]" type="checkbox" value="true" />
<label class="collection_check_boxes" for="user_options_true">Yes</label>
<input name="user[options][]" type="hidden" value="" />
<input id="user_options_false" name="user[options][]" type="checkbox" value="false" />
<label class="collection_check_boxes" for="user_options_false">No</label>
It is also possible to give a block that should generate the check box +
label. To wrap the check box with the label, for instance:
form_for @user do |f|
f.collection_check_boxes(
:options, [[true, 'Yes'] ,[false, 'No']], :first, :last
) do |b|
b.label { b.check_box + b.text }
end
end
== Options
Collection check box accepts some extra options:
* checked => the value or values that should be checked initially. Accepts
a single item or an array of items. It overrides existing associations.
* disabled => the value or values that should be disabled. Accepts a single
item or an array of items.
* collection_wrapper_tag => the tag to wrap the entire collection.
* collection_wrapper_class => the CSS class to use for collection_wrapper_tag. This option
is ignored if the :collection_wrapper_tag option is blank.
* item_wrapper_tag => the tag to wrap each item in the collection.
* item_wrapper_class => the CSS class to use for item_wrapper_tag
* a block => to generate the label + check box or any other component. | [
"Creates",
"a",
"collection",
"of",
"check",
"boxes",
"for",
"each",
"item",
"in",
"the",
"collection",
"associated",
"with",
"a",
"clickable",
"label",
".",
"Use",
"value_method",
"and",
"text_method",
"to",
"convert",
"items",
"in",
"the",
"collection",
"for... | 4dd9261ebb392e46a9beeefe8d83081e7c6e56b5 | https://github.com/plataformatec/simple_form/blob/4dd9261ebb392e46a9beeefe8d83081e7c6e56b5/lib/simple_form/form_builder.rb#L450-L452 | train | Renders the checkboxes for a collection | [
30522,
13366,
3074,
1035,
4638,
1035,
8378,
1006,
4118,
1010,
3074,
1010,
3643,
1035,
4118,
1010,
3793,
1035,
4118,
1010,
7047,
1027,
1063,
1065,
1010,
16129,
1035,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
3722,
14192,
1024,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.restore_secret | def restore_secret(vault_base_url, secret_bundle_backup, custom_headers:nil)
response = restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def restore_secret(vault_base_url, secret_bundle_backup, custom_headers:nil)
response = restore_secret_async(vault_base_url, secret_bundle_backup, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"restore_secret",
"(",
"vault_base_url",
",",
"secret_bundle_backup",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"restore_secret_async",
"(",
"vault_base_url",
",",
"secret_bundle_backup",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!"... | Restores a backed up secret to a vault.
Restores a backed up secret, and all its versions, to a vault. This operation
requires the secrets/restore permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param secret_bundle_backup The backup blob associated with a secret bundle.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SecretBundle] operation results. | [
"Restores",
"a",
"backed",
"up",
"secret",
"to",
"a",
"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#L3909-L3912 | train | Restores the secret from the specified vault. | [
30522,
13366,
9239,
1035,
3595,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3595,
1035,
14012,
1035,
10200,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
9239,
1035,
3595,
1035,
2004,
6038,
2278,
1006,
11632,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/row.rb | Axlsx.Row.color= | def color=(color)
each_with_index do | cell, index |
cell.color = color.is_a?(Array) ? color[index] : color
end
end | ruby | def color=(color)
each_with_index do | cell, index |
cell.color = color.is_a?(Array) ? color[index] : color
end
end | [
"def",
"color",
"=",
"(",
"color",
")",
"each_with_index",
"do",
"|",
"cell",
",",
"index",
"|",
"cell",
".",
"color",
"=",
"color",
".",
"is_a?",
"(",
"Array",
")",
"?",
"color",
"[",
"index",
"]",
":",
"color",
"end",
"end"
] | sets the color for every cell in this row | [
"sets",
"the",
"color",
"for",
"every",
"cell",
"in",
"this",
"row"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/row.rb#L107-L111 | train | Set the color of the cells | [
30522,
13366,
3609,
1027,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.put_property_with_http_info | def put_property_with_http_info(name_id, property_description, timeout:60, custom_headers:nil)
put_property_async(name_id, property_description, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def put_property_with_http_info(name_id, property_description, timeout:60, custom_headers:nil)
put_property_async(name_id, property_description, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"put_property_with_http_info",
"(",
"name_id",
",",
"property_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"put_property_async",
"(",
"name_id",
",",
"property_description",
",",
"timeout",
":",
"timeout",
",",
"custom_head... | Creates or updates a Service Fabric property.
Creates or updates the specified Service Fabric property under a given name.
@param name_id [String] The Service Fabric name, without the 'fabric:' URI
scheme.
@param property_description [PropertyDescription] Describes the Service
Fabric property to be created.
@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. | [
"Creates",
"or",
"updates",
"a",
"Service",
"Fabric",
"property",
"."
] | 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#L26751-L26753 | train | Put a property in a given container. | [
30522,
13366,
2404,
1035,
3200,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2171,
1035,
8909,
1010,
3200,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2404,
1035,
3200,
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_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/assets.rb | Azure::MediaServices::Mgmt::V2018_07_01.Assets.delete_with_http_info | def delete_with_http_info(resource_group_name, account_name, asset_name, custom_headers:nil)
delete_async(resource_group_name, account_name, asset_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, account_name, asset_name, custom_headers:nil)
delete_async(resource_group_name, account_name, asset_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"asset_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"asset_name",
",",
"custom_headers",
":custom_headers",
")",... | Delete an Asset.
Deletes an Asset in the Media Services account
@param resource_group_name [String] The name of the resource group within the
Azure subscription.
@param account_name [String] The Media Services account name.
@param asset_name [String] The Asset name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Delete",
"an",
"Asset",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/assets.rb#L409-L411 | train | Deletes an asset from the specified account. | [
30522,
13366,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11412,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3972,
12870,
1035,
2004,
6038,
2278,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/puppet | lib/puppet/module_tool/metadata.rb | Puppet::ModuleTool.Metadata.validate_name | def validate_name(name)
return if name =~ /\A[a-z0-9]+[-\/][a-z][a-z0-9_]*\Z/i
namespace, modname = name.split(/[-\/]/, 2)
modname = :namespace_missing if namespace == ''
err = case modname
when nil, '', :namespace_missing
_("the field must be a namespaced module name")
when /[^a-z0-9_]/i
_("the module name contains non-alphanumeric (or underscore) characters")
when /^[^a-z]/i
_("the module name must begin with a letter")
else
_("the namespace contains non-alphanumeric characters")
end
raise ArgumentError, _("Invalid 'name' field in metadata.json: %{err}") % { err: err }
end | ruby | def validate_name(name)
return if name =~ /\A[a-z0-9]+[-\/][a-z][a-z0-9_]*\Z/i
namespace, modname = name.split(/[-\/]/, 2)
modname = :namespace_missing if namespace == ''
err = case modname
when nil, '', :namespace_missing
_("the field must be a namespaced module name")
when /[^a-z0-9_]/i
_("the module name contains non-alphanumeric (or underscore) characters")
when /^[^a-z]/i
_("the module name must begin with a letter")
else
_("the namespace contains non-alphanumeric characters")
end
raise ArgumentError, _("Invalid 'name' field in metadata.json: %{err}") % { err: err }
end | [
"def",
"validate_name",
"(",
"name",
")",
"return",
"if",
"name",
"=~",
"/",
"\\A",
"\\/",
"\\Z",
"/i",
"namespace",
",",
"modname",
"=",
"name",
".",
"split",
"(",
"/",
"\\/",
"/",
",",
"2",
")",
"modname",
"=",
":namespace_missing",
"if",
"namespace"... | Validates that the given module name is both namespaced and well-formed. | [
"Validates",
"that",
"the",
"given",
"module",
"name",
"is",
"both",
"namespaced",
"and",
"well",
"-",
"formed",
"."
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/module_tool/metadata.rb#L168-L186 | train | Validate the name field in the metadata. json | [
30522,
13366,
9398,
3686,
1035,
2171,
1006,
2171,
1007,
2709,
2065,
2171,
1027,
1066,
1013,
1032,
1037,
1031,
1037,
1011,
1062,
2692,
1011,
1023,
1033,
1009,
1031,
1011,
1032,
1013,
1033,
1031,
1037,
1011,
1062,
1033,
1031,
1037,
1011,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb | Aws::IAM.Policy.attach_user | def attach_user(options = {})
options = options.merge(policy_arn: @arn)
resp = @client.attach_user_policy(options)
resp.data
end | ruby | def attach_user(options = {})
options = options.merge(policy_arn: @arn)
resp = @client.attach_user_policy(options)
resp.data
end | [
"def",
"attach_user",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"policy_arn",
":",
"@arn",
")",
"resp",
"=",
"@client",
".",
"attach_user_policy",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
policy.attach_user({
user_name: "userNameType", # required
})
@param [Hash] options ({})
@option options [required, String] :user_name
The name (friendly name, not ARN) of the IAM user to attach the policy
to.
This parameter allows (through its [regex pattern][1]) a string of
characters consisting of upper and lowercase alphanumeric characters
with no spaces. You can also include any of the following characters:
\_+=,.@-
[1]: http://wikipedia.org/wiki/regex
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb#L336-L340 | train | Attach a user to the policy | [
30522,
13366,
22476,
1035,
5310,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
3343,
1035,
12098,
2078,
1024,
1030,
12098,
2078,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
22476,
1035,
5310,
1035,
3343,
1006,
7047... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/util/parser.rb | Axlsx.Parser.parse_integer | def parse_integer attr_name, xpath
v = parse_value xpath
v = v.to_i if v.respond_to?(:to_i)
send("#{attr_name}=", v)
end | ruby | def parse_integer attr_name, xpath
v = parse_value xpath
v = v.to_i if v.respond_to?(:to_i)
send("#{attr_name}=", v)
end | [
"def",
"parse_integer",
"attr_name",
",",
"xpath",
"v",
"=",
"parse_value",
"xpath",
"v",
"=",
"v",
".",
"to_i",
"if",
"v",
".",
"respond_to?",
"(",
":to_i",
")",
"send",
"(",
"\"#{attr_name}=\"",
",",
"v",
")",
"end"
] | parse, convert and assign note text to integer | [
"parse",
"convert",
"and",
"assign",
"note",
"text",
"to",
"integer"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/util/parser.rb#L23-L27 | train | Parse an integer value | [
30522,
13366,
11968,
3366,
1035,
16109,
2012,
16344,
1035,
2171,
1010,
26726,
8988,
1058,
1027,
11968,
3366,
1035,
3643,
26726,
8988,
1058,
1027,
1058,
1012,
2000,
1035,
1045,
2065,
1058,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
2000,
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... |
cucumber/aruba | lib/aruba/setup.rb | Aruba.Setup.events | def events
runtime.event_bus.register(
:command_started,
proc do |event|
runtime.announcer.announce :command, event.entity.commandline
runtime.announcer.announce :timeout, 'exit', event.entity.exit_timeout
runtime.announcer.announce :timeout, 'io wait', event.entity.io_wait_timeout
runtime.announcer.announce :wait_time, 'startup wait time', event.entity.startup_wait_time
runtime.announcer.announce :full_environment, event.entity.environment
end
)
runtime.event_bus.register(
:command_started,
proc do |event|
runtime.command_monitor.register_command event.entity
runtime.command_monitor.last_command_started = event.entity
end
)
runtime.event_bus.register(
:command_stopped,
proc do |event|
runtime.announcer.announce(:stdout) { event.entity.stdout }
runtime.announcer.announce(:stderr) { event.entity.stderr }
runtime.announcer.announce(:command_content) { event.entity.content }
runtime.announcer.announce(:command_filesystem_status) { event.entity.filesystem_status }
end
)
runtime.event_bus.register(
:command_stopped,
proc do |event|
runtime.command_monitor.last_command_stopped = event.entity
end
)
runtime.event_bus.register(
[:changed_environment_variable, :added_environment_variable, :deleted_environment_variable],
proc do |event|
runtime.announcer.announce :changed_environment, event.entity[:changed][:name], event.entity[:changed][:value]
runtime.announcer.announce :environment, event.entity[:changed][:name], event.entity[:changed][:value]
end
)
runtime.event_bus.register(
:changed_working_directory,
proc { |event| runtime.announcer.announce :directory, event.entity[:new] }
)
runtime.event_bus.register(
:changed_configuration,
proc { |event| runtime.announcer.announce :configuration, event.entity[:changed][:name], event.entity[:changed][:value] }
)
end | ruby | def events
runtime.event_bus.register(
:command_started,
proc do |event|
runtime.announcer.announce :command, event.entity.commandline
runtime.announcer.announce :timeout, 'exit', event.entity.exit_timeout
runtime.announcer.announce :timeout, 'io wait', event.entity.io_wait_timeout
runtime.announcer.announce :wait_time, 'startup wait time', event.entity.startup_wait_time
runtime.announcer.announce :full_environment, event.entity.environment
end
)
runtime.event_bus.register(
:command_started,
proc do |event|
runtime.command_monitor.register_command event.entity
runtime.command_monitor.last_command_started = event.entity
end
)
runtime.event_bus.register(
:command_stopped,
proc do |event|
runtime.announcer.announce(:stdout) { event.entity.stdout }
runtime.announcer.announce(:stderr) { event.entity.stderr }
runtime.announcer.announce(:command_content) { event.entity.content }
runtime.announcer.announce(:command_filesystem_status) { event.entity.filesystem_status }
end
)
runtime.event_bus.register(
:command_stopped,
proc do |event|
runtime.command_monitor.last_command_stopped = event.entity
end
)
runtime.event_bus.register(
[:changed_environment_variable, :added_environment_variable, :deleted_environment_variable],
proc do |event|
runtime.announcer.announce :changed_environment, event.entity[:changed][:name], event.entity[:changed][:value]
runtime.announcer.announce :environment, event.entity[:changed][:name], event.entity[:changed][:value]
end
)
runtime.event_bus.register(
:changed_working_directory,
proc { |event| runtime.announcer.announce :directory, event.entity[:new] }
)
runtime.event_bus.register(
:changed_configuration,
proc { |event| runtime.announcer.announce :configuration, event.entity[:changed][:name], event.entity[:changed][:value] }
)
end | [
"def",
"events",
"runtime",
".",
"event_bus",
".",
"register",
"(",
":command_started",
",",
"proc",
"do",
"|",
"event",
"|",
"runtime",
".",
"announcer",
".",
"announce",
":command",
",",
"event",
".",
"entity",
".",
"commandline",
"runtime",
".",
"announce... | rubocop:disable Metrics/MethodLength | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"MethodLength"
] | add17615322f575588aef1fccce875396cdf36e9 | https://github.com/cucumber/aruba/blob/add17615322f575588aef1fccce875396cdf36e9/lib/aruba/setup.rb#L35-L89 | train | Register commands to the event bus | [
30522,
13366,
2824,
2448,
7292,
1012,
2724,
1035,
3902,
1012,
4236,
1006,
1024,
3094,
1035,
2318,
1010,
4013,
2278,
2079,
1064,
2724,
1064,
2448,
7292,
1012,
14073,
1012,
14970,
1024,
3094,
1010,
2724,
1012,
9178,
1012,
3094,
4179,
2448,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/nat_gateways.rb | Azure::Network::Mgmt::V2019_02_01.NatGateways.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, nat_gateway_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, nat_gateway_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, nat_gateway_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, nat_gateway_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"nat_gateway_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"nat_gateway_name",
",",
"parameters",
",",
"cust... | Creates or updates a nat gateway.
@param resource_group_name [String] The name of the resource group.
@param nat_gateway_name [String] The name of the nat gateway.
@param parameters [NatGateway] Parameters supplied to the create or update
nat gateway operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"a",
"nat",
"gateway",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/nat_gateways.rb#L591-L593 | train | Creates or updates a nat gateway. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
14085,
1035,
11909,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmosolgo/graphql-ruby | lib/graphql/enum_type.rb | GraphQL.EnumType.coerce_non_null_input | def coerce_non_null_input(value_name, ctx)
if @values_by_name.key?(value_name)
@values_by_name.fetch(value_name).value
elsif match_by_value = @values_by_name.find { |k, v| v.value == value_name }
# this is for matching default values, which are "inputs", but they're
# the Ruby value, not the GraphQL string.
match_by_value[1].value
else
nil
end
end | ruby | def coerce_non_null_input(value_name, ctx)
if @values_by_name.key?(value_name)
@values_by_name.fetch(value_name).value
elsif match_by_value = @values_by_name.find { |k, v| v.value == value_name }
# this is for matching default values, which are "inputs", but they're
# the Ruby value, not the GraphQL string.
match_by_value[1].value
else
nil
end
end | [
"def",
"coerce_non_null_input",
"(",
"value_name",
",",
"ctx",
")",
"if",
"@values_by_name",
".",
"key?",
"(",
"value_name",
")",
"@values_by_name",
".",
"fetch",
"(",
"value_name",
")",
".",
"value",
"elsif",
"match_by_value",
"=",
"@values_by_name",
".",
"find... | Get the underlying value for this enum value
@example get episode value from Enum
episode = EpisodeEnum.coerce("NEWHOPE")
episode # => 6
@param value_name [String] the string representation of this enum value
@return [Object] the underlying value for this enum value | [
"Get",
"the",
"underlying",
"value",
"for",
"this",
"enum",
"value"
] | d5be13a816f220b9efbabeaa69a3e56fedf311f5 | https://github.com/rmosolgo/graphql-ruby/blob/d5be13a816f220b9efbabeaa69a3e56fedf311f5/lib/graphql/enum_type.rb#L169-L179 | train | Coerce a non - null input to a valid Ruby value. | [
30522,
13366,
24873,
19170,
1035,
2512,
1035,
19701,
1035,
7953,
1006,
3643,
1035,
2171,
1010,
14931,
2595,
1007,
2065,
1030,
5300,
1035,
2011,
1035,
2171,
1012,
3145,
30524,
1027,
1027,
3643,
1035,
2171,
1065,
1001,
2023,
2003,
2005,
9844,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/util.rb | Haml.Util.check_encoding | def check_encoding(str)
if str.valid_encoding?
# Get rid of the Unicode BOM if possible
# Shortcut for UTF-8 which might be the majority case
if str.encoding == Encoding::UTF_8
return str.gsub(/\A\uFEFF/, '')
elsif str.encoding.name =~ /^UTF-(16|32)(BE|LE)?$/
return str.gsub(Regexp.new("\\A\uFEFF".encode(str.encoding)), '')
else
return str
end
end
encoding = str.encoding
newlines = Regexp.new("\r\n|\r|\n".encode(encoding).force_encoding(Encoding::ASCII_8BIT))
str.force_encoding(Encoding::ASCII_8BIT).split(newlines).each_with_index do |line, i|
begin
line.encode(encoding)
rescue Encoding::UndefinedConversionError => e
yield <<MSG.rstrip, i + 1
Invalid #{encoding.name} character #{e.error_char.dump}
MSG
end
end
return str
end | ruby | def check_encoding(str)
if str.valid_encoding?
# Get rid of the Unicode BOM if possible
# Shortcut for UTF-8 which might be the majority case
if str.encoding == Encoding::UTF_8
return str.gsub(/\A\uFEFF/, '')
elsif str.encoding.name =~ /^UTF-(16|32)(BE|LE)?$/
return str.gsub(Regexp.new("\\A\uFEFF".encode(str.encoding)), '')
else
return str
end
end
encoding = str.encoding
newlines = Regexp.new("\r\n|\r|\n".encode(encoding).force_encoding(Encoding::ASCII_8BIT))
str.force_encoding(Encoding::ASCII_8BIT).split(newlines).each_with_index do |line, i|
begin
line.encode(encoding)
rescue Encoding::UndefinedConversionError => e
yield <<MSG.rstrip, i + 1
Invalid #{encoding.name} character #{e.error_char.dump}
MSG
end
end
return str
end | [
"def",
"check_encoding",
"(",
"str",
")",
"if",
"str",
".",
"valid_encoding?",
"# Get rid of the Unicode BOM if possible",
"# Shortcut for UTF-8 which might be the majority case",
"if",
"str",
".",
"encoding",
"==",
"Encoding",
"::",
"UTF_8",
"return",
"str",
".",
"gsub",... | Checks that the encoding of a string is valid
and cleans up potential encoding gotchas like the UTF-8 BOM.
If it's not, yields an error string describing the invalid character
and the line on which it occurs.
@param str [String] The string of which to check the encoding
@yield [msg] A block in which an encoding error can be raised.
Only yields if there is an encoding error
@yieldparam msg [String] The error message to be raised
@return [String] `str`, potentially with encoding gotchas like BOMs removed | [
"Checks",
"that",
"the",
"encoding",
"of",
"a",
"string",
"is",
"valid",
"and",
"cleans",
"up",
"potential",
"encoding",
"gotchas",
"like",
"the",
"UTF",
"-",
"8",
"BOM",
".",
"If",
"it",
"s",
"not",
"yields",
"an",
"error",
"string",
"describing",
"the"... | 9aa0fbe4a91b999978927be569d2ad0cd39076f1 | https://github.com/haml/haml/blob/9aa0fbe4a91b999978927be569d2ad0cd39076f1/lib/haml/util.rb#L62-L87 | train | Check the encoding of a string | [
30522,
13366,
4638,
1035,
17181,
1006,
2358,
2099,
1007,
2065,
2358,
2099,
1012,
9398,
1035,
17181,
1029,
1001,
2131,
9436,
1997,
1996,
27260,
8945,
2213,
2065,
2825,
1001,
2460,
12690,
2005,
21183,
2546,
1011,
1022,
2029,
2453,
2022,
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... |
rails/rails | activemodel/lib/active_model/dirty.rb | ActiveModel.Dirty.restore_attribute! | def restore_attribute!(attr_name)
attr_name = attr_name.to_s
if attribute_changed?(attr_name)
__send__("#{attr_name}=", attribute_was(attr_name))
clear_attribute_change(attr_name)
end
end | ruby | def restore_attribute!(attr_name)
attr_name = attr_name.to_s
if attribute_changed?(attr_name)
__send__("#{attr_name}=", attribute_was(attr_name))
clear_attribute_change(attr_name)
end
end | [
"def",
"restore_attribute!",
"(",
"attr_name",
")",
"attr_name",
"=",
"attr_name",
".",
"to_s",
"if",
"attribute_changed?",
"(",
"attr_name",
")",
"__send__",
"(",
"\"#{attr_name}=\"",
",",
"attribute_was",
"(",
"attr_name",
")",
")",
"clear_attribute_change",
"(",
... | Dispatch target for <tt>restore_*!</tt> attribute methods. | [
"Dispatch",
"target",
"for",
"<tt",
">",
"restore_",
"*",
"!<",
"/",
"tt",
">",
"attribute",
"methods",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activemodel/lib/active_model/dirty.rb#L272-L278 | train | Restore the attribute | [
30522,
13366,
9239,
1035,
17961,
999,
1006,
2012,
16344,
1035,
2171,
1007,
2012,
16344,
1035,
2171,
1027,
2012,
16344,
1035,
2171,
1012,
2000,
1035,
1055,
2065,
17961,
1035,
2904,
1029,
1006,
2012,
16344,
1035,
2171,
1007,
1035,
1035,
4604,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
googleapis/google-cloud-ruby | google-cloud-spanner/lib/google-cloud-spanner.rb | Google.Cloud.spanner | def spanner scope: nil, timeout: nil, client_config: nil
Google::Cloud.spanner @project, @keyfile, scope: scope,
timeout: (timeout || @timeout),
client_config: client_config
end | ruby | def spanner scope: nil, timeout: nil, client_config: nil
Google::Cloud.spanner @project, @keyfile, scope: scope,
timeout: (timeout || @timeout),
client_config: client_config
end | [
"def",
"spanner",
"scope",
":",
"nil",
",",
"timeout",
":",
"nil",
",",
"client_config",
":",
"nil",
"Google",
"::",
"Cloud",
".",
"spanner",
"@project",
",",
"@keyfile",
",",
"scope",
":",
"scope",
",",
"timeout",
":",
"(",
"timeout",
"||",
"@timeout",
... | Creates a new object for connecting to the Spanner service.
Each call creates a new connection.
For more information on connecting to Google Cloud see the
{file:AUTHENTICATION.md Authentication Guide}.
@param [String, Array<String>] scope The OAuth 2.0 scopes controlling the
set of resources and operations that the connection can access. See
[Using OAuth 2.0 to Access Google
APIs](https://developers.google.com/identity/protocols/OAuth2).
The default scopes are:
* `https://www.googleapis.com/auth/spanner`
* `https://www.googleapis.com/auth/spanner.data`
@param [Integer] timeout Default timeout to use in requests. Optional.
@param [Hash] client_config A hash of values to override the default
behavior of the API client. Optional.
@return [Google::Cloud::Spanner::Project]
@example
require "google/cloud"
gcloud = Google::Cloud.new
spanner = gcloud.spanner
@example The default scope can be overridden with the `scope` option:
require "google/cloud"
gcloud = Google::Cloud.new
platform_scope = "https://www.googleapis.com/auth/cloud-platform"
spanner = gcloud.spanner scope: platform_scope | [
"Creates",
"a",
"new",
"object",
"for",
"connecting",
"to",
"the",
"Spanner",
"service",
".",
"Each",
"call",
"creates",
"a",
"new",
"connection",
"."
] | 846c1a57250ac860ef4de1b54853a480ab2ff702 | https://github.com/googleapis/google-cloud-ruby/blob/846c1a57250ac860ef4de1b54853a480ab2ff702/google-cloud-spanner/lib/google-cloud-spanner.rb#L64-L68 | train | Create a new instance of the Spanner object. | [
30522,
13366,
8487,
3678,
9531,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
9152,
2140,
1010,
7396,
1035,
9530,
8873,
2290,
1024,
9152,
2140,
8224,
1024,
1024,
6112,
1012,
8487,
3678,
1030,
2622,
1010,
1030,
3145,
8873,
2571,
1010,
9531,
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_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.get_vmsecurity_rules_async | def get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
# Send request
promise = begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::SecurityGroupViewResult.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 get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
# Send request
promise = begin_get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Network::Mgmt::V2018_08_01::Models::SecurityGroupViewResult.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",
"get_vmsecurity_rules_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_get_vmsecurity_rules_async",
"(",
"resource_group_name",
",",
"network_watcher_nam... | @param resource_group_name [String] The name of the resource group.
@param network_watcher_name [String] The name of the network watcher.
@param parameters [SecurityGroupViewParameters] Parameters that define the VM
to check security groups for.
@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",
".",
"@param",
"network_watcher_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"network",
"watcher",
".",
"@param",
"parameters",
"[",
"SecurityGroupVie... | 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#L775-L791 | train | Gets the security rules for a virtual machine. | [
30522,
13366,
2131,
1035,
1058,
5244,
8586,
25137,
1035,
3513,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_service_fabric/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb | Azure::ServiceFabric::Mgmt::V2017_07_01_preview.Clusters.delete_with_http_info | def delete_with_http_info(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:nil)
delete_async(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:nil)
delete_async(resource_group_name, cluster_name, api_version, subscription_id, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"api_version",
",",
"subscription_id",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"api_version",
",",
"subscription_i... | Delete cluster resource
Delete cluster resource
@param resource_group_name [String] The name of the resource group.
@param cluster_name [String] The name of the cluster resource
@param api_version [String] The version of the API.
@param subscription_id [String] The customer subscription identifier
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Delete",
"cluster",
"resource"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_fabric/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb#L109-L111 | train | Deletes the specified cluster. | [
30522,
13366,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9324,
1035,
2171,
1010,
17928,
1035,
2544,
1010,
15002,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3972,
12870... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb | Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.list_deployments_at_resource_as_lazy | def list_deployments_at_resource_as_lazy(resource_id, remediation_name, query_options:nil, custom_headers:nil)
response = list_deployments_at_resource_async(resource_id, remediation_name, query_options:query_options, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_deployments_at_resource_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_deployments_at_resource_as_lazy(resource_id, remediation_name, query_options:nil, custom_headers:nil)
response = list_deployments_at_resource_async(resource_id, remediation_name, query_options:query_options, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_deployments_at_resource_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_deployments_at_resource_as_lazy",
"(",
"resource_id",
",",
"remediation_name",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_deployments_at_resource_async",
"(",
"resource_id",
",",
"remediation_name",
",",
... | Gets all deployments for a remediation at resource scope.
@param resource_id [String] Resource ID.
@param remediation_name [String] The name of the remediation.
@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 [RemediationDeploymentsListResult] which provide lazy access to pages
of the response. | [
"Gets",
"all",
"deployments",
"for",
"a",
"remediation",
"at",
"resource",
"scope",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L3196-L3205 | train | Gets the list of deployments at resource scope. | [
30522,
13366,
2862,
1035,
10813,
2015,
1035,
2012,
1035,
7692,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
8909,
1010,
2128,
16969,
3508,
1035,
2171,
1010,
23032,
1035,
7047,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.execute_site_analysis_slot | def execute_site_analysis_slot(resource_group_name, site_name, diagnostic_category, analysis_name, slot, start_time:nil, end_time:nil, time_grain:nil, custom_headers:nil)
response = execute_site_analysis_slot_async(resource_group_name, site_name, diagnostic_category, analysis_name, slot, start_time:start_time, end_time:end_time, time_grain:time_grain, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def execute_site_analysis_slot(resource_group_name, site_name, diagnostic_category, analysis_name, slot, start_time:nil, end_time:nil, time_grain:nil, custom_headers:nil)
response = execute_site_analysis_slot_async(resource_group_name, site_name, diagnostic_category, analysis_name, slot, start_time:start_time, end_time:end_time, time_grain:time_grain, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"execute_site_analysis_slot",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_category",
",",
"analysis_name",
",",
"slot",
",",
"start_time",
":",
"nil",
",",
"end_time",
":",
"nil",
",",
"time_grain",
":",
"nil",
",",
"custom_headers",
":",... | Execute Analysis
Execute Analysis
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param diagnostic_category [String] Category Name
@param analysis_name [String] Analysis Resource Name
@param slot [String] Slot Name
@param start_time [DateTime] Start Time
@param end_time [DateTime] End Time
@param time_grain [String] Time Grain
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DiagnosticAnalysis] operation results. | [
"Execute",
"Analysis"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L2061-L2064 | train | Executes a site analysis slot. | [
30522,
13366,
15389,
1035,
2609,
1035,
4106,
1035,
10453,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
4106,
1035,
2171,
1010,
10453,
1010,
2707,
1035,
2051,
1024,
9152,
2140,
1010,
2203,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/content_type/abstract_content_type.rb | Axlsx.AbstractContentType.to_xml_string | def to_xml_string(node_name = '', str = '')
str << "<#{node_name} "
str << instance_values.map { |key, value| Axlsx::camel(key) << '="' << value.to_s << '"' }.join(' ')
str << '/>'
end | ruby | def to_xml_string(node_name = '', str = '')
str << "<#{node_name} "
str << instance_values.map { |key, value| Axlsx::camel(key) << '="' << value.to_s << '"' }.join(' ')
str << '/>'
end | [
"def",
"to_xml_string",
"(",
"node_name",
"=",
"''",
",",
"str",
"=",
"''",
")",
"str",
"<<",
"\"<#{node_name} \"",
"str",
"<<",
"instance_values",
".",
"map",
"{",
"|",
"key",
",",
"value",
"|",
"Axlsx",
"::",
"camel",
"(",
"key",
")",
"<<",
"'=\"'",
... | Serialize the contenty type to xml | [
"Serialize",
"the",
"contenty",
"type",
"to",
"xml"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/content_type/abstract_content_type.rb#L25-L29 | train | Convert the instance to XML string. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
13045,
1035,
2171,
1027,
1005,
1005,
1010,
2358,
2099,
1027,
1005,
1005,
1007,
2358,
2099,
1026,
1026,
1000,
1026,
1001,
1063,
13045,
1035,
2171,
1065,
1000,
2358,
2099,
1026,
1026,
6013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.get_storage_account | def get_storage_account(resource_group_name, account_name, storage_account_name, custom_headers:nil)
response = get_storage_account_async(resource_group_name, account_name, storage_account_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_storage_account(resource_group_name, account_name, storage_account_name, custom_headers:nil)
response = get_storage_account_async(resource_group_name, account_name, storage_account_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_storage_account",
"(",
"resource_group_name",
",",
"account_name",
",",
"storage_account_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_storage_account_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"storage_account_name",
... | Gets the specified Azure Storage account linked to the given Data Lake
Analytics account.
@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 from
which to retrieve Azure storage account details.
@param storage_account_name [String] The name of the Azure Storage account
for which to retrieve the details.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [StorageAccountInfo] operation results. | [
"Gets",
"the",
"specified",
"Azure",
"Storage",
"account",
"linked",
"to",
"the",
"given",
"Data",
"Lake",
"Analytics",
"account",
"."
] | 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#L39-L42 | train | Gets the specified storage account. | [
30522,
13366,
2131,
1035,
5527,
1035,
4070,
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,
3433,
1027,
2131,
1035,
5527,
1035,
4070,
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... |
elastic/apm-agent-ruby | lib/elastic_apm/instrumenter.rb | ElasticAPM.Instrumenter.end_transaction | def end_transaction(result = nil)
return nil unless (transaction = current_transaction)
self.current_transaction = nil
transaction.done result
enqueue.call transaction
transaction
end | ruby | def end_transaction(result = nil)
return nil unless (transaction = current_transaction)
self.current_transaction = nil
transaction.done result
enqueue.call transaction
transaction
end | [
"def",
"end_transaction",
"(",
"result",
"=",
"nil",
")",
"return",
"nil",
"unless",
"(",
"transaction",
"=",
"current_transaction",
")",
"self",
".",
"current_transaction",
"=",
"nil",
"transaction",
".",
"done",
"result",
"enqueue",
".",
"call",
"transaction",... | rubocop:enable Metrics/MethodLength | [
"rubocop",
":",
"enable",
"Metrics",
"/",
"MethodLength"
] | 82190d1a9ba22af3b2c2c6fe6d23cc471f2e7ff6 | https://github.com/elastic/apm-agent-ruby/blob/82190d1a9ba22af3b2c2c6fe6d23cc471f2e7ff6/lib/elastic_apm/instrumenter.rb#L113-L123 | train | End a transaction | [
30522,
13366,
2203,
1035,
12598,
1006,
2765,
1027,
9152,
2140,
1007,
2709,
9152,
2140,
4983,
1006,
12598,
1027,
2783,
1035,
12598,
1007,
2969,
1012,
2783,
1035,
12598,
1027,
9152,
2140,
12598,
1012,
2589,
2765,
4372,
4226,
5657,
1012,
2655,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/ddos_custom_policies.rb | Azure::Network::Mgmt::V2019_02_01.DdosCustomPolicies.delete | def delete(resource_group_name, ddos_custom_policy_name, custom_headers:nil)
response = delete_async(resource_group_name, ddos_custom_policy_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, ddos_custom_policy_name, custom_headers:nil)
response = delete_async(resource_group_name, ddos_custom_policy_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"ddos_custom_policy_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"ddos_custom_policy_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!"... | Deletes the specified DDoS custom policy.
@param resource_group_name [String] The name of the resource group.
@param ddos_custom_policy_name [String] The name of the DDoS custom policy.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"DDoS",
"custom",
"policy",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/ddos_custom_policies.rb#L32-L35 | train | Deletes the specified DDoS custom policy. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
20315,
2891,
1035,
7661,
1035,
3343,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heroku/legacy-cli | lib/heroku/command/addons.rb | Heroku::Command.Addons.services | def services
if current_command == "addons:list"
deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:services` instead.")
end
display_table(get_services, %w[name human_name state], %w[Slug Name State])
display "\nSee plans with `heroku addons:plans SERVICE`"
end | ruby | def services
if current_command == "addons:list"
deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:services` instead.")
end
display_table(get_services, %w[name human_name state], %w[Slug Name State])
display "\nSee plans with `heroku addons:plans SERVICE`"
end | [
"def",
"services",
"if",
"current_command",
"==",
"\"addons:list\"",
"deprecate",
"(",
"\"`heroku #{current_command}` has been deprecated. Please use `heroku addons:services` instead.\"",
")",
"end",
"display_table",
"(",
"get_services",
",",
"%w[",
"name",
"human_name",
"state",... | addons:services
list all available add-on services | [
"addons",
":",
"services"
] | 6f18521a258394bfb79e6b36f7160ad8559a8e16 | https://github.com/heroku/legacy-cli/blob/6f18521a258394bfb79e6b36f7160ad8559a8e16/lib/heroku/command/addons.rb#L57-L64 | train | Get the services | [
30522,
13366,
2578,
2065,
2783,
1035,
3094,
1027,
1027,
1000,
5587,
5644,
1024,
2862,
1000,
2139,
28139,
16280,
1006,
1000,
1036,
5394,
5283,
1001,
1063,
2783,
1035,
3094,
1065,
1036,
2038,
2042,
2139,
28139,
12921,
1012,
3531,
2224,
1036,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/search_shifts_request.rb | SquareConnect.SearchShiftsRequest.limit= | def limit=(limit)
if !limit.nil? && limit > 200
fail ArgumentError, "invalid value for 'limit', must be smaller than or equal to 200."
end
if !limit.nil? && limit < 1
fail ArgumentError, "invalid value for 'limit', must be greater than or equal to 1."
end
@limit = limit
end | ruby | def limit=(limit)
if !limit.nil? && limit > 200
fail ArgumentError, "invalid value for 'limit', must be smaller than or equal to 200."
end
if !limit.nil? && limit < 1
fail ArgumentError, "invalid value for 'limit', must be greater than or equal to 1."
end
@limit = limit
end | [
"def",
"limit",
"=",
"(",
"limit",
")",
"if",
"!",
"limit",
".",
"nil?",
"&&",
"limit",
">",
"200",
"fail",
"ArgumentError",
",",
"\"invalid value for 'limit', must be smaller than or equal to 200.\"",
"end",
"if",
"!",
"limit",
".",
"nil?",
"&&",
"limit",
"<",
... | Custom attribute writer method with validation
@param [Object] limit Value to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"with",
"validation"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/search_shifts_request.rb#L90-L101 | train | Set the limit for the page. | [
30522,
13366,
5787,
1027,
1006,
5787,
1007,
2065,
999,
5787,
1012,
9152,
2140,
1029,
1004,
1004,
5787,
1028,
3263,
8246,
6685,
2121,
29165,
1010,
1000,
19528,
3643,
2005,
1005,
5787,
1005,
1010,
2442,
2022,
3760,
2084,
2030,
5020,
2000,
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... |
grpc/grpc | src/ruby/lib/grpc/generic/active_call.rb | GRPC.ActiveCall.server_streamer | def server_streamer(req, metadata: {})
raise_error_if_already_executed
ops = {
SEND_MESSAGE => @marshal.call(req),
SEND_CLOSE_FROM_CLIENT => nil
}
@send_initial_md_mutex.synchronize do
# Metadata might have already been sent if this is an operation view
unless @metadata_sent
ops[SEND_INITIAL_METADATA] = @metadata_to_send.merge!(metadata)
end
@metadata_sent = true
end
begin
@call.run_batch(ops)
rescue GRPC::Core::CallError => e
receive_and_check_status # checks for Cancelled
raise e
rescue => e
set_input_stream_done
raise e
ensure
set_output_stream_done
end
replies = enum_for(:each_remote_read_then_finish)
return replies unless block_given?
replies.each { |r| yield r }
end | ruby | def server_streamer(req, metadata: {})
raise_error_if_already_executed
ops = {
SEND_MESSAGE => @marshal.call(req),
SEND_CLOSE_FROM_CLIENT => nil
}
@send_initial_md_mutex.synchronize do
# Metadata might have already been sent if this is an operation view
unless @metadata_sent
ops[SEND_INITIAL_METADATA] = @metadata_to_send.merge!(metadata)
end
@metadata_sent = true
end
begin
@call.run_batch(ops)
rescue GRPC::Core::CallError => e
receive_and_check_status # checks for Cancelled
raise e
rescue => e
set_input_stream_done
raise e
ensure
set_output_stream_done
end
replies = enum_for(:each_remote_read_then_finish)
return replies unless block_given?
replies.each { |r| yield r }
end | [
"def",
"server_streamer",
"(",
"req",
",",
"metadata",
":",
"{",
"}",
")",
"raise_error_if_already_executed",
"ops",
"=",
"{",
"SEND_MESSAGE",
"=>",
"@marshal",
".",
"call",
"(",
"req",
")",
",",
"SEND_CLOSE_FROM_CLIENT",
"=>",
"nil",
"}",
"@send_initial_md_mute... | server_streamer sends one request to the GRPC server, which yields a
stream of responses.
responses provides an enumerator over the streamed responses, i.e. it
follows Ruby's #each iteration protocol. The enumerator blocks while
waiting for each response, stops when the server signals that no
further responses will be supplied. If the implicit block is provided,
it is executed with each response as the argument and no result is
returned.
@param req [Object] the request sent to the server
@param metadata [Hash] metadata to be sent to the server. If a value is
a list, multiple metadata for its key are sent
@return [Enumerator|nil] a response Enumerator | [
"server_streamer",
"sends",
"one",
"request",
"to",
"the",
"GRPC",
"server",
"which",
"yields",
"a",
"stream",
"of",
"responses",
"."
] | f3937f0e55227a4ef3a23f895d3b204a947610f8 | https://github.com/grpc/grpc/blob/f3937f0e55227a4ef3a23f895d3b204a947610f8/src/ruby/lib/grpc/generic/active_call.rb#L436-L465 | train | Creates a new streamer for the given request. | [
30522,
13366,
8241,
1035,
5460,
2121,
1006,
2128,
4160,
1010,
27425,
1024,
1063,
1065,
1007,
5333,
1035,
30524,
1027,
1028,
9152,
2140,
1065,
1030,
4604,
1035,
3988,
1035,
9108,
1035,
20101,
2595,
1012,
26351,
8093,
10698,
4371,
2079,
1001,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/auto_scaling_group.rb | Aws::AutoScaling.AutoScalingGroup.notification_configurations | def notification_configurations(options = {})
batches = Enumerator.new do |y|
options = Aws::Util.deep_merge(options, auto_scaling_group_names: [@name])
resp = @client.describe_notification_configurations(options)
resp.each_page do |page|
batch = []
page.data.notification_configurations.each do |n|
batch << NotificationConfiguration.new(
group_name: n.auto_scaling_group_name,
type: n.notification_type,
topic_arn: n.topic_arn,
data: n,
client: @client
)
end
y.yield(batch)
end
end
NotificationConfiguration::Collection.new(batches)
end | ruby | def notification_configurations(options = {})
batches = Enumerator.new do |y|
options = Aws::Util.deep_merge(options, auto_scaling_group_names: [@name])
resp = @client.describe_notification_configurations(options)
resp.each_page do |page|
batch = []
page.data.notification_configurations.each do |n|
batch << NotificationConfiguration.new(
group_name: n.auto_scaling_group_name,
type: n.notification_type,
topic_arn: n.topic_arn,
data: n,
client: @client
)
end
y.yield(batch)
end
end
NotificationConfiguration::Collection.new(batches)
end | [
"def",
"notification_configurations",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"options",
"=",
"Aws",
"::",
"Util",
".",
"deep_merge",
"(",
"options",
",",
"auto_scaling_group_names",
":",
"[",
"@na... | @example Request syntax with placeholder values
auto_scaling_group.notification_configurations()
@param [Hash] options ({})
@return [NotificationConfiguration::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/auto_scaling_group.rb#L1077-L1096 | train | Returns an array of all notification configurations for this auto scaling group | [
30522,
13366,
26828,
1035,
22354,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
7047,
1027,
22091,
2015,
1024,
1024,
21183,
4014,
1012,
2784,
1035,
13590,
1006,
7047,
1010,
82... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb | Azure::Storage::Mgmt::V2018_07_01.BlobContainers.delete_with_http_info | def delete_with_http_info(resource_group_name, account_name, container_name, custom_headers:nil)
delete_async(resource_group_name, account_name, container_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, account_name, container_name, custom_headers:nil)
delete_async(resource_group_name, account_name, container_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"container_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"container_name",
",",
"custom_headers",
":custom_headers"... | Deletes specified container under its account.
@param resource_group_name [String] The name of the resource group within the
user's subscription. The name is case insensitive.
@param account_name [String] The name of the storage account within the
specified resource group. Storage account names must be between 3 and 24
characters in length and use numbers and lower-case letters only.
@param container_name [String] The name of the blob container within the
specified storage account. Blob container names must be between 3 and 63
characters in length and use numbers, lower-case letters and dash (-) only.
Every dash (-) character must be immediately preceded and followed by a
letter or number.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"specified",
"container",
"under",
"its",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb#L596-L598 | train | Deletes the specified container. | [
30522,
13366,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11661,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3972,
12870,
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... |
etewiah/property_web_builder | app/models/pwb/prop.rb | Pwb.Prop.set_features= | def set_features=(features_json)
# return unless features_json.class == Hash
features_json.keys.each do |feature_key|
# TODO - create feature_key if its missing
if features_json[feature_key] == "true" || features_json[feature_key] == true
features.find_or_create_by( feature_key: feature_key)
else
features.where( feature_key: feature_key).delete_all
end
end
end | ruby | def set_features=(features_json)
# return unless features_json.class == Hash
features_json.keys.each do |feature_key|
# TODO - create feature_key if its missing
if features_json[feature_key] == "true" || features_json[feature_key] == true
features.find_or_create_by( feature_key: feature_key)
else
features.where( feature_key: feature_key).delete_all
end
end
end | [
"def",
"set_features",
"=",
"(",
"features_json",
")",
"# return unless features_json.class == Hash",
"features_json",
".",
"keys",
".",
"each",
"do",
"|",
"feature_key",
"|",
"# TODO - create feature_key if its missing",
"if",
"features_json",
"[",
"feature_key",
"]",
"=... | Setter- called by update_extras in properties controller
expects a hash with keys like "cl.casafactory.fieldLabels.extras.alarma"
each with a value of true or false | [
"Setter",
"-",
"called",
"by",
"update_extras",
"in",
"properties",
"controller",
"expects",
"a",
"hash",
"with",
"keys",
"like",
"cl",
".",
"casafactory",
".",
"fieldLabels",
".",
"extras",
".",
"alarma",
"each",
"with",
"a",
"value",
"of",
"true",
"or",
... | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/models/pwb/prop.rb#L113-L123 | train | set features from a hash of features_json | [
30522,
13366,
2275,
1035,
2838,
1027,
1006,
2838,
1035,
1046,
3385,
1007,
1001,
2709,
4983,
2838,
1035,
1046,
3385,
1012,
2465,
1027,
1027,
23325,
2838,
1035,
1046,
3385,
1012,
6309,
1012,
2169,
2079,
1064,
3444,
1035,
3145,
1064,
1001,
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_serialconsole/lib/2018-05-01/generated/azure_mgmt_serialconsole/console.rb | Azure::Serialconsole::Mgmt::V2018_05_01.Console.enable_console | def enable_console(custom_headers:nil)
response = enable_console_async(custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def enable_console(custom_headers:nil)
response = enable_console_async(custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"enable_console",
"(",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"enable_console_async",
"(",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
"nil?",
"end"
] | Enables Serial Console for a subscription
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SetDisabledResult] operation results. | [
"Enables",
"Serial",
"Console",
"for",
"a",
"subscription"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_serialconsole/lib/2018-05-01/generated/azure_mgmt_serialconsole/console.rb#L33-L36 | train | Enables console for a container. | [
30522,
13366,
9585,
1035,
10122,
1006,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
9585,
1035,
10122,
1035,
2004,
6038,
2278,
1006,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
3433,
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... |
shugo/textbringer | lib/textbringer/modes/programming_mode.rb | Textbringer.ProgrammingMode.indent_line | def indent_line
result = false
level = calculate_indentation
return result if level.nil?
@buffer.save_excursion do
@buffer.beginning_of_line
@buffer.composite_edit do
if @buffer.looking_at?(/[ \t]+/)
s = @buffer.match_string(0)
break if /\t/ !~ s && s.size == level
@buffer.delete_region(@buffer.match_beginning(0),
@buffer.match_end(0))
else
break if level == 0
end
@buffer.indent_to(level)
end
result = true
end
pos = @buffer.point
@buffer.beginning_of_line
@buffer.forward_char while /[ \t]/ =~ @buffer.char_after
if @buffer.point < pos
@buffer.goto_char(pos)
end
result
end | ruby | def indent_line
result = false
level = calculate_indentation
return result if level.nil?
@buffer.save_excursion do
@buffer.beginning_of_line
@buffer.composite_edit do
if @buffer.looking_at?(/[ \t]+/)
s = @buffer.match_string(0)
break if /\t/ !~ s && s.size == level
@buffer.delete_region(@buffer.match_beginning(0),
@buffer.match_end(0))
else
break if level == 0
end
@buffer.indent_to(level)
end
result = true
end
pos = @buffer.point
@buffer.beginning_of_line
@buffer.forward_char while /[ \t]/ =~ @buffer.char_after
if @buffer.point < pos
@buffer.goto_char(pos)
end
result
end | [
"def",
"indent_line",
"result",
"=",
"false",
"level",
"=",
"calculate_indentation",
"return",
"result",
"if",
"level",
".",
"nil?",
"@buffer",
".",
"save_excursion",
"do",
"@buffer",
".",
"beginning_of_line",
"@buffer",
".",
"composite_edit",
"do",
"if",
"@buffer... | Return true if modified. | [
"Return",
"true",
"if",
"modified",
"."
] | dcea7a098b5e04335e73faee5616bd1678add7ec | https://github.com/shugo/textbringer/blob/dcea7a098b5e04335e73faee5616bd1678add7ec/lib/textbringer/modes/programming_mode.rb#L32-L58 | train | indent_line_seqobj | [
30522,
13366,
27427,
4765,
1035,
2240,
2765,
1027,
6270,
2504,
1027,
18422,
1035,
27427,
19304,
2709,
2765,
2065,
2504,
1012,
9152,
2140,
1029,
1030,
17698,
1012,
3828,
1035,
26144,
2079,
1030,
17698,
1012,
2927,
30524,
17698,
1012,
2559,
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... |
alexreisner/geocoder | lib/geocoder/lookups/ban_data_gouv_fr.rb | Geocoder::Lookup.BanDataGouvFr.search_geocode_ban_fr_params | def search_geocode_ban_fr_params(query)
params = {
q: query.sanitized_text
}
unless (limit = query.options[:limit]).nil? || !limit_param_is_valid?(limit)
params[:limit] = limit.to_i
end
unless (autocomplete = query.options[:autocomplete]).nil? || !autocomplete_param_is_valid?(autocomplete)
params[:autocomplete] = autocomplete.to_s
end
unless (type = query.options[:type]).nil? || !type_param_is_valid?(type)
params[:type] = type.downcase
end
unless (postcode = query.options[:postcode]).nil? || !code_param_is_valid?(postcode)
params[:postcode] = postcode.to_s
end
unless (citycode = query.options[:citycode]).nil? || !code_param_is_valid?(citycode)
params[:citycode] = citycode.to_s
end
params
end | ruby | def search_geocode_ban_fr_params(query)
params = {
q: query.sanitized_text
}
unless (limit = query.options[:limit]).nil? || !limit_param_is_valid?(limit)
params[:limit] = limit.to_i
end
unless (autocomplete = query.options[:autocomplete]).nil? || !autocomplete_param_is_valid?(autocomplete)
params[:autocomplete] = autocomplete.to_s
end
unless (type = query.options[:type]).nil? || !type_param_is_valid?(type)
params[:type] = type.downcase
end
unless (postcode = query.options[:postcode]).nil? || !code_param_is_valid?(postcode)
params[:postcode] = postcode.to_s
end
unless (citycode = query.options[:citycode]).nil? || !code_param_is_valid?(citycode)
params[:citycode] = citycode.to_s
end
params
end | [
"def",
"search_geocode_ban_fr_params",
"(",
"query",
")",
"params",
"=",
"{",
"q",
":",
"query",
".",
"sanitized_text",
"}",
"unless",
"(",
"limit",
"=",
"query",
".",
"options",
"[",
":limit",
"]",
")",
".",
"nil?",
"||",
"!",
"limit_param_is_valid?",
"("... | SEARCH GEOCODING PARAMS
:q => required, full text search param)
:limit => force limit number of results returned by raw API
(default = 5) note : only first result is taken
in account in geocoder
:autocomplete => pass 0 to disable autocomplete treatment of :q
(default = 1)
:lat => force filter results around specific lat/lon
:lon => force filter results around specific lat/lon
:type => force filter the returned result type
(check results for a list of accepted types)
:postcode => force filter results on a specific city post code
:citycode => force filter results on a specific city UUID INSEE code
For up to date doc (in french only) : https://adresse.data.gouv.fr/api/ | [
"SEARCH",
"GEOCODING",
"PARAMS"
] | e087dc2759264ee6f307b926bb2de4ec2406859e | https://github.com/alexreisner/geocoder/blob/e087dc2759264ee6f307b926bb2de4ec2406859e/lib/geocoder/lookups/ban_data_gouv_fr.rb#L70-L90 | train | Returns the params for the search geocodebanfr | [
30522,
13366,
3945,
1035,
20248,
16044,
1035,
7221,
1035,
10424,
1035,
11498,
5244,
1006,
23032,
1007,
11498,
5244,
1027,
1063,
1053,
1024,
23032,
1012,
2624,
25090,
5422,
1035,
3793,
1065,
4983,
1006,
5787,
1027,
23032,
1012,
7047,
1031,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.retrieve_site_seal | def retrieve_site_seal(resource_group_name, certificate_order_name, site_seal_request, custom_headers:nil)
response = retrieve_site_seal_async(resource_group_name, certificate_order_name, site_seal_request, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def retrieve_site_seal(resource_group_name, certificate_order_name, site_seal_request, custom_headers:nil)
response = retrieve_site_seal_async(resource_group_name, certificate_order_name, site_seal_request, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"retrieve_site_seal",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"site_seal_request",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"retrieve_site_seal_async",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"site_seal_... | Verify domain ownership for this certificate order.
Verify domain ownership for this certificate order.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param certificate_order_name [String] Name of the certificate order.
@param site_seal_request [SiteSealRequest] Site seal request.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SiteSeal] operation results. | [
"Verify",
"domain",
"ownership",
"for",
"this",
"certificate",
"order",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L1603-L1606 | train | Retrieve site sealing information for a certificate order. | [
30522,
13366,
12850,
1035,
2609,
1035,
7744,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8196,
1035,
2344,
1035,
2171,
1010,
2609,
1035,
7744,
1035,
5227,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
12850,
1035,
2609,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb | Azure::Storage::Mgmt::V2018_07_01.BlobContainers.lease | def lease(resource_group_name, account_name, container_name, parameters:nil, custom_headers:nil)
response = lease_async(resource_group_name, account_name, container_name, parameters:parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def lease(resource_group_name, account_name, container_name, parameters:nil, custom_headers:nil)
response = lease_async(resource_group_name, account_name, container_name, parameters:parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"lease",
"(",
"resource_group_name",
",",
"account_name",
",",
"container_name",
",",
"parameters",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"lease_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"container_name",
"... | The Lease Container operation establishes and manages a lock on a container
for delete operations. The lock duration can be 15 to 60 seconds, or can be
infinite.
@param resource_group_name [String] The name of the resource group within the
user's subscription. The name is case insensitive.
@param account_name [String] The name of the storage account within the
specified resource group. Storage account names must be between 3 and 24
characters in length and use numbers and lower-case letters only.
@param container_name [String] The name of the blob container within the
specified storage account. Blob container names must be between 3 and 63
characters in length and use numbers, lower-case letters and dash (-) only.
Every dash (-) character must be immediately preceded and followed by a
letter or number.
@param parameters [LeaseContainerRequest] Lease Container request body.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [LeaseContainerResponse] operation results. | [
"The",
"Lease",
"Container",
"operation",
"establishes",
"and",
"manages",
"a",
"lock",
"on",
"a",
"container",
"for",
"delete",
"operations",
".",
"The",
"lock",
"duration",
"can",
"be",
"15",
"to",
"60",
"seconds",
"or",
"can",
"be",
"infinite",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/blob_containers.rb#L1741-L1744 | train | Gets the lease for a container. | [
30522,
13366,
10084,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11661,
1035,
2171,
1010,
11709,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10084,
1035,
2004,
6038,
2278,
1006,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
xcpretty/xcode-install | lib/xcode/install.rb | XcodeInstall.Installer.seedlist | def seedlist
@xcodes = Marshal.load(File.read(LIST_FILE)) if LIST_FILE.exist? && xcodes.nil?
all_xcodes = (xcodes || fetch_seedlist)
# We have to set the `installed` value here, as we might still use
# the cached list of available Xcode versions, but have a new Xcode
# installed in the mean-time
cached_installed_versions = installed_versions.map(&:bundle_version)
all_xcodes.each do |current_xcode|
current_xcode.installed = cached_installed_versions.include?(current_xcode.version)
end
all_xcodes.sort_by(&:version)
end | ruby | def seedlist
@xcodes = Marshal.load(File.read(LIST_FILE)) if LIST_FILE.exist? && xcodes.nil?
all_xcodes = (xcodes || fetch_seedlist)
# We have to set the `installed` value here, as we might still use
# the cached list of available Xcode versions, but have a new Xcode
# installed in the mean-time
cached_installed_versions = installed_versions.map(&:bundle_version)
all_xcodes.each do |current_xcode|
current_xcode.installed = cached_installed_versions.include?(current_xcode.version)
end
all_xcodes.sort_by(&:version)
end | [
"def",
"seedlist",
"@xcodes",
"=",
"Marshal",
".",
"load",
"(",
"File",
".",
"read",
"(",
"LIST_FILE",
")",
")",
"if",
"LIST_FILE",
".",
"exist?",
"&&",
"xcodes",
".",
"nil?",
"all_xcodes",
"=",
"(",
"xcodes",
"||",
"fetch_seedlist",
")",
"# We have to set... | Returns an array of `XcodeInstall::Xcode`
<XcodeInstall::Xcode:0x007fa1d451c390
@date_modified=2015,
@name="6.4",
@path="/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg",
@url=
"https://developer.apple.com/devcenter/download.action?path=/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg",
@version=Gem::Version.new("6.4")>,
the resulting list is sorted with the most recent release as first element | [
"Returns",
"an",
"array",
"of",
"XcodeInstall",
"::",
"Xcode",
"<XcodeInstall",
"::",
"Xcode",
":",
"0x007fa1d451c390",
"@date_modified",
"=",
"2015",
"@name",
"=",
"6",
".",
"4",
"@path",
"=",
"/",
"Developer_Tools",
"/",
"Xcode_6",
".",
"4",
"/",
"Xcode_6"... | 054d80ac84f6e2b666b862d3b5fa936dda0f8722 | https://github.com/xcpretty/xcode-install/blob/054d80ac84f6e2b666b862d3b5fa936dda0f8722/lib/xcode/install.rb#L198-L211 | train | Returns the Xcode object for the seedlist | [
30522,
13366,
6534,
9863,
1030,
1060,
23237,
1027,
8610,
1012,
7170,
1006,
5371,
1012,
3191,
1006,
2862,
1035,
5371,
1007,
1007,
2065,
2862,
1035,
5371,
1012,
4839,
1029,
1004,
1004,
1060,
23237,
1012,
9152,
2140,
1029,
2035,
1035,
1060,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | runtime/ms_rest_azure/lib/ms_rest_azure/azure_service_client.rb | MsRestAzure.AzureServiceClient.update_state_from_azure_async_operation_header | def update_state_from_azure_async_operation_header(request, polling_state)
result = get_async_with_async_operation_deserialization(request)
fail AzureOperationError, 'The response from long running operation does not contain a body' if result.body.nil? || result.body.status.nil?
polling_state.status = result.body.status
polling_state.error_data = result.body.error
polling_state.response = result.response
polling_state.request = result.request
polling_state.resource = nil
polling_state
end | ruby | def update_state_from_azure_async_operation_header(request, polling_state)
result = get_async_with_async_operation_deserialization(request)
fail AzureOperationError, 'The response from long running operation does not contain a body' if result.body.nil? || result.body.status.nil?
polling_state.status = result.body.status
polling_state.error_data = result.body.error
polling_state.response = result.response
polling_state.request = result.request
polling_state.resource = nil
polling_state
end | [
"def",
"update_state_from_azure_async_operation_header",
"(",
"request",
",",
"polling_state",
")",
"result",
"=",
"get_async_with_async_operation_deserialization",
"(",
"request",
")",
"fail",
"AzureOperationError",
",",
"'The response from long running operation does not contain a ... | Updates polling state from Azure async operation header.
@param polling_state [MsRestAzure::PollingState] polling state. | [
"Updates",
"polling",
"state",
"from",
"Azure",
"async",
"operation",
"header",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/runtime/ms_rest_azure/lib/ms_rest_azure/azure_service_client.rb#L204-L216 | train | Update polling state from Azure Async Operation header | [
30522,
13366,
10651,
1035,
2110,
1035,
2013,
1035,
24296,
1035,
2004,
6038,
2278,
1035,
3169,
1035,
20346,
1006,
5227,
1010,
17888,
1035,
2110,
1007,
2765,
1027,
2131,
1035,
2004,
6038,
2278,
1035,
2007,
1035,
2004,
6038,
2278,
1035,
3169,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_service_bus/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/namespaces.rb | Azure::ServiceBus::Mgmt::V2018_01_01_preview.Namespaces.list_ip_filter_rules_as_lazy | def list_ip_filter_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
response = list_ip_filter_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_ip_filter_rules_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_ip_filter_rules_as_lazy(resource_group_name, namespace_name, custom_headers:nil)
response = list_ip_filter_rules_async(resource_group_name, namespace_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_ip_filter_rules_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_ip_filter_rules_as_lazy",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_ip_filter_rules_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"custom_headers",
":custom_headers",
")",... | Gets a list of IP Filter rules for a Namespace.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The namespace name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [IpFilterRuleListResult] which provide lazy access to pages of the
response. | [
"Gets",
"a",
"list",
"of",
"IP",
"Filter",
"rules",
"for",
"a",
"Namespace",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_bus/lib/2018-01-01-preview/generated/azure_mgmt_service_bus/namespaces.rb#L2176-L2185 | train | Gets the IP filter rules for the specified namespace. | [
30522,
13366,
2862,
1035,
12997,
1035,
11307,
1035,
3513,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
12997,
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_container_service/lib/2019-02-01/generated/azure_mgmt_container_service/managed_clusters.rb | Azure::ContainerService::Mgmt::V2019_02_01.ManagedClusters.list_cluster_user_credentials | def list_cluster_user_credentials(resource_group_name, resource_name, custom_headers:nil)
response = list_cluster_user_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_cluster_user_credentials(resource_group_name, resource_name, custom_headers:nil)
response = list_cluster_user_credentials_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_cluster_user_credentials",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_cluster_user_credentials_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":custom_headers"... | Gets cluster user credential of a managed cluster.
Gets cluster user credential of the managed cluster with a specified resource
group and name.
@param resource_group_name [String] The name of the resource group.
@param resource_name [String] The name of the managed cluster resource.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CredentialResults] operation results. | [
"Gets",
"cluster",
"user",
"credential",
"of",
"a",
"managed",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_service/lib/2019-02-01/generated/azure_mgmt_container_service/managed_clusters.rb#L541-L544 | train | Gets the user credentials for the specified App Service Environment. | [
30522,
13366,
2862,
1035,
9324,
1035,
5310,
1035,
22496,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
9324,
1035,
5310,
1035,
22496,
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_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb | Azure::ContainerInstance::Mgmt::V2018_06_01.ContainerGroups.restart | def restart(resource_group_name, container_group_name, custom_headers:nil)
response = restart_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
nil
end | ruby | def restart(resource_group_name, container_group_name, custom_headers:nil)
response = restart_async(resource_group_name, container_group_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"restart",
"(",
"resource_group_name",
",",
"container_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"restart_async",
"(",
"resource_group_name",
",",
"container_group_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Restarts all containers in a container group.
Restarts all containers in a contaienr group in place. If container image has
updates, new image will be downloaded.
@param resource_group_name [String] The name of the resource group.
@param container_group_name [String] The name of the container group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Restarts",
"all",
"containers",
"in",
"a",
"container",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_instance/lib/2018-06-01/generated/azure_mgmt_container_instance/container_groups.rb#L611-L614 | train | Restarts the specified container group. | [
30522,
13366,
23818,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11661,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
23818,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11661,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.start_node_transition | def start_node_transition(node_name, operation_id, node_transition_type, node_instance_id, stop_duration_in_seconds, timeout:60, custom_headers:nil)
response = start_node_transition_async(node_name, operation_id, node_transition_type, node_instance_id, stop_duration_in_seconds, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def start_node_transition(node_name, operation_id, node_transition_type, node_instance_id, stop_duration_in_seconds, timeout:60, custom_headers:nil)
response = start_node_transition_async(node_name, operation_id, node_transition_type, node_instance_id, stop_duration_in_seconds, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"start_node_transition",
"(",
"node_name",
",",
"operation_id",
",",
"node_transition_type",
",",
"node_instance_id",
",",
"stop_duration_in_seconds",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"start_node_transition_async... | Starts or stops a cluster node.
Starts or stops a cluster node. A cluster node is a process, not the OS
instance itself. To start a node, pass in "Start" for the NodeTransitionType
parameter.
To stop a node, pass in "Stop" for the NodeTransitionType parameter. This
API starts the operation - when the API returns the node may not have
finished transitioning yet.
Call GetNodeTransitionProgress with the same OperationId to get the progress
of the operation.
@param node_name [String] The name of the node.
@param operation_id A GUID that identifies a call of this API. This is
passed into the corresponding GetProgress API
@param node_transition_type [NodeTransitionType] Indicates the type of
transition to perform. NodeTransitionType.Start will start a stopped node.
NodeTransitionType.Stop will stop a node that is up. Possible values include:
'Invalid', 'Start', 'Stop'
@param node_instance_id [String] The node instance ID of the target node.
This can be determined through GetNodeInfo API.
@param stop_duration_in_seconds [Integer] The duration, in seconds, to keep
the node stopped. The minimum value is 600, the maximum is 14400. After
this time expires, the node will automatically come back up.
@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. | [
"Starts",
"or",
"stops",
"a",
"cluster",
"node",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L21615-L21618 | train | Starts a node transition. | [
30522,
13366,
2707,
1035,
13045,
1035,
6653,
1006,
13045,
1035,
2171,
1010,
3169,
1035,
8909,
1010,
13045,
1035,
6653,
1035,
2828,
1010,
13045,
1035,
6013,
1035,
8909,
1010,
2644,
1035,
9367,
1035,
1999,
1035,
3823,
1010,
2051,
5833,
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_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb | Azure::SQL::Mgmt::V2015_05_01_preview.SyncGroups.refresh_hub_schema | def refresh_hub_schema(resource_group_name, server_name, database_name, sync_group_name, custom_headers:nil)
response = refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers:custom_headers).value!
nil
end | ruby | def refresh_hub_schema(resource_group_name, server_name, database_name, sync_group_name, custom_headers:nil)
response = refresh_hub_schema_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"refresh_hub_schema",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"sync_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"refresh_hub_schema_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database... | Refreshes a hub database schema.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param database_name [String] The name of the database on which the sync
group is hosted.
@param sync_group_name [String] The name of the sync group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Refreshes",
"a",
"hub",
"database",
"schema",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb#L131-L134 | train | Refresh hub schema. | [
30522,
13366,
25416,
21898,
1035,
9594,
1035,
8040,
28433,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
26351,
1035,
2177,
1035,
2171,
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... |
kmuto/review | lib/epubmaker/epubv2.rb | EPUBMaker.EPUBv2.ncx | def ncx(indentarray)
@ncx_isbn = ncx_isbn
@ncx_doctitle = ncx_doctitle
@ncx_navmap = ncx_navmap(indentarray)
tmplfile = File.expand_path('./ncx/epubv2.ncx.erb', ReVIEW::Template::TEMPLATE_DIR)
ReVIEW::Template.load(tmplfile).result(binding)
end | ruby | def ncx(indentarray)
@ncx_isbn = ncx_isbn
@ncx_doctitle = ncx_doctitle
@ncx_navmap = ncx_navmap(indentarray)
tmplfile = File.expand_path('./ncx/epubv2.ncx.erb', ReVIEW::Template::TEMPLATE_DIR)
ReVIEW::Template.load(tmplfile).result(binding)
end | [
"def",
"ncx",
"(",
"indentarray",
")",
"@ncx_isbn",
"=",
"ncx_isbn",
"@ncx_doctitle",
"=",
"ncx_doctitle",
"@ncx_navmap",
"=",
"ncx_navmap",
"(",
"indentarray",
")",
"tmplfile",
"=",
"File",
".",
"expand_path",
"(",
"'./ncx/epubv2.ncx.erb'",
",",
"ReVIEW",
"::",
... | Return ncx content. +indentarray+ has prefix marks for each level. | [
"Return",
"ncx",
"content",
".",
"+",
"indentarray",
"+",
"has",
"prefix",
"marks",
"for",
"each",
"level",
"."
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/epubv2.rb#L114-L121 | train | This method is used to load the NCX file | [
30522,
13366,
13316,
2595,
1006,
27427,
4765,
2906,
9447,
1007,
1030,
13316,
2595,
1035,
3175,
1027,
13316,
2595,
1035,
3175,
1030,
13316,
2595,
1035,
9986,
3775,
9286,
1027,
13316,
2595,
1035,
9986,
3775,
9286,
1030,
13316,
2595,
1035,
658... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_filters.rb | Azure::Network::Mgmt::V2018_07_01.RouteFilters.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, route_filter_name, route_filter_parameters, custom_headers:nil)
begin_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, route_filter_name, route_filter_parameters, custom_headers:nil)
begin_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"route_filter_name",
",",
"route_filter_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"route_filter_name",
",",
"route_filter_parameters",
",",... | Updates a route filter in a specified resource group.
@param resource_group_name [String] The name of the resource group.
@param route_filter_name [String] The name of the route filter.
@param route_filter_parameters [PatchRouteFilter] Parameters supplied to the
update route filter operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"a",
"route",
"filter",
"in",
"a",
"specified",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_filters.rb#L650-L652 | train | Updates a route filter. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2799,
1035,
11307,
1035,
2171,
1010,
2799,
1035,
11307,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/cache.rb | Discordrb.Cache.resolve_invite_code | def resolve_invite_code(invite)
invite = invite.code if invite.is_a? Discordrb::Invite
invite = invite[invite.rindex('/') + 1..-1] if invite.start_with?('http', 'discord.gg')
invite
end | ruby | def resolve_invite_code(invite)
invite = invite.code if invite.is_a? Discordrb::Invite
invite = invite[invite.rindex('/') + 1..-1] if invite.start_with?('http', 'discord.gg')
invite
end | [
"def",
"resolve_invite_code",
"(",
"invite",
")",
"invite",
"=",
"invite",
".",
"code",
"if",
"invite",
".",
"is_a?",
"Discordrb",
"::",
"Invite",
"invite",
"=",
"invite",
"[",
"invite",
".",
"rindex",
"(",
"'/'",
")",
"+",
"1",
"..",
"-",
"1",
"]",
... | Gets the code for an invite.
@param invite [String, Invite] The invite to get the code for. Possible formats are:
* An {Invite} object
* The code for an invite
* A fully qualified invite URL (e.g. `https://discordapp.com/invite/0A37aN7fasF7n83q`)
* A short invite URL with protocol (e.g. `https://discord.gg/0A37aN7fasF7n83q`)
* A short invite URL without protocol (e.g. `discord.gg/0A37aN7fasF7n83q`)
@return [String] Only the code for the invite. | [
"Gets",
"the",
"code",
"for",
"an",
"invite",
".",
"@param",
"invite",
"[",
"String",
"Invite",
"]",
"The",
"invite",
"to",
"get",
"the",
"code",
"for",
".",
"Possible",
"formats",
"are",
":"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/cache.rb#L195-L199 | train | Resolve the invite code | [
30522,
13366,
10663,
1035,
13260,
1035,
3642,
1006,
13260,
1007,
13260,
1027,
13260,
1012,
3642,
2065,
13260,
1012,
2003,
1035,
1037,
1029,
12532,
4103,
15185,
1024,
1024,
13260,
13260,
1027,
13260,
1031,
13260,
1012,
15544,
13629,
2595,
1006... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_edgegateway/lib/2019-03-01/generated/azure_mgmt_edgegateway/triggers.rb | Azure::EdgeGateway::Mgmt::V2019_03_01.Triggers.list_by_data_box_edge_device | def list_by_data_box_edge_device(device_name, resource_group_name, expand:nil, custom_headers:nil)
first_page = list_by_data_box_edge_device_as_lazy(device_name, resource_group_name, expand:expand, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_data_box_edge_device(device_name, resource_group_name, expand:nil, custom_headers:nil)
first_page = list_by_data_box_edge_device_as_lazy(device_name, resource_group_name, expand:expand, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_data_box_edge_device",
"(",
"device_name",
",",
"resource_group_name",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_data_box_edge_device_as_lazy",
"(",
"device_name",
",",
"resource_group_name",
",",
"exp... | Lists all the triggers configured in the device.
@param device_name [String] The device name.
@param resource_group_name [String] The resource group name.
@param expand [String] Specify $filter='CustomContextTag eq <tag>' to filter
on custom context tag property
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<Trigger>] operation results. | [
"Lists",
"all",
"the",
"triggers",
"configured",
"in",
"the",
"device",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_edgegateway/lib/2019-03-01/generated/azure_mgmt_edgegateway/triggers.rb#L36-L39 | train | Gets all the data box edge devices under an Azure subscription. | [
30522,
13366,
2862,
1035,
2011,
1035,
2951,
1035,
3482,
1035,
3341,
1035,
5080,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
7818,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mikel/mail | lib/mail/fields/common_address_field.rb | Mail.CommonAddressField.addresses | def addresses
list = element.addresses.map { |a| a.address }
Mail::AddressContainer.new(self, list)
end | ruby | def addresses
list = element.addresses.map { |a| a.address }
Mail::AddressContainer.new(self, list)
end | [
"def",
"addresses",
"list",
"=",
"element",
".",
"addresses",
".",
"map",
"{",
"|",
"a",
"|",
"a",
".",
"address",
"}",
"Mail",
"::",
"AddressContainer",
".",
"new",
"(",
"self",
",",
"list",
")",
"end"
] | Returns the address string of all the addresses in the address list | [
"Returns",
"the",
"address",
"string",
"of",
"all",
"the",
"addresses",
"in",
"the",
"address",
"list"
] | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/fields/common_address_field.rb#L46-L49 | train | Returns the addresses of the current Mail object. | [
30522,
13366,
11596,
2862,
1027,
5783,
1012,
11596,
1012,
4949,
1063,
1064,
1037,
1064,
1037,
1012,
4769,
1065,
5653,
1024,
1024,
4769,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/filters.rb | Haml.Filters.remove_filter | def remove_filter(name)
defined.delete name.to_s.downcase
if constants.map(&:to_s).include?(name.to_s)
remove_const name.to_sym
end
end | ruby | def remove_filter(name)
defined.delete name.to_s.downcase
if constants.map(&:to_s).include?(name.to_s)
remove_const name.to_sym
end
end | [
"def",
"remove_filter",
"(",
"name",
")",
"defined",
".",
"delete",
"name",
".",
"to_s",
".",
"downcase",
"if",
"constants",
".",
"map",
"(",
":to_s",
")",
".",
"include?",
"(",
"name",
".",
"to_s",
")",
"remove_const",
"name",
".",
"to_sym",
"end",
"e... | Removes a filter from Haml. If the filter was removed, it returns
the Module that was removed upon success, or nil on failure. If you try
to redefine a filter, Haml will raise an error. Use this method first to
explicitly remove the filter before redefining it.
@return Module The filter module that has been removed
@since 4.0 | [
"Removes",
"a",
"filter",
"from",
"Haml",
".",
"If",
"the",
"filter",
"was",
"removed",
"it",
"returns",
"the",
"Module",
"that",
"was",
"removed",
"upon",
"success",
"or",
"nil",
"on",
"failure",
".",
"If",
"you",
"try",
"to",
"redefine",
"a",
"filter",... | 9aa0fbe4a91b999978927be569d2ad0cd39076f1 | https://github.com/haml/haml/blob/9aa0fbe4a91b999978927be569d2ad0cd39076f1/lib/haml/filters.rb#L68-L73 | train | Remove a filter from the current context | [
30522,
13366,
6366,
1035,
11307,
1006,
2171,
1007,
4225,
1012,
3972,
12870,
2171,
1012,
2000,
1035,
1055,
1012,
2091,
18382,
2065,
5377,
2015,
1012,
4949,
1006,
1004,
1024,
2000,
1035,
1055,
1007,
1012,
2421,
1029,
1006,
2171,
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... |
samvera/hyrax | app/helpers/hyrax/collections_helper.rb | Hyrax.CollectionsHelper.append_collection_type_url | def append_collection_type_url(url, collection_type_id)
uri = URI.parse(url)
uri.query = [uri.query, "collection_type_id=#{collection_type_id}"].compact.join('&')
uri.to_s
end | ruby | def append_collection_type_url(url, collection_type_id)
uri = URI.parse(url)
uri.query = [uri.query, "collection_type_id=#{collection_type_id}"].compact.join('&')
uri.to_s
end | [
"def",
"append_collection_type_url",
"(",
"url",
",",
"collection_type_id",
")",
"uri",
"=",
"URI",
".",
"parse",
"(",
"url",
")",
"uri",
".",
"query",
"=",
"[",
"uri",
".",
"query",
",",
"\"collection_type_id=#{collection_type_id}\"",
"]",
".",
"compact",
"."... | Append a collection_type_id to the existing querystring (whether or not it has pre-existing params)
@return [String] the original url with and added collection_type_id param | [
"Append",
"a",
"collection_type_id",
"to",
"the",
"existing",
"querystring",
"(",
"whether",
"or",
"not",
"it",
"has",
"pre",
"-",
"existing",
"params",
")"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/helpers/hyrax/collections_helper.rb#L39-L43 | train | Append collection_type_id to the url | [
30522,
13366,
10439,
10497,
1035,
3074,
1035,
2828,
1035,
24471,
2140,
1006,
24471,
2140,
1010,
3074,
1035,
2828,
1035,
8909,
1007,
24471,
2072,
1027,
24471,
2072,
1012,
11968,
3366,
1006,
24471,
2140,
1007,
24471,
2072,
1012,
23032,
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... |
samvera/hyrax | spec/support/selectors.rb | Selectors.Dashboard.select_member_of_collection | def select_member_of_collection(collection)
find('#s2id_member_of_collection_ids').click
find('.select2-input').set(collection.title.first)
# Crude way of waiting for the AJAX response
select2_results = []
time_elapsed = 0
while select2_results.empty? && time_elapsed < 30
begin_time = Time.now.to_f
doc = Nokogiri::XML.parse(page.body)
select2_results = doc.xpath('//html:li[contains(@class,"select2-result")]', html: 'http://www.w3.org/1999/xhtml')
end_time = Time.now.to_f
time_elapsed += end_time - begin_time
end
expect(page).to have_css('.select2-result')
within ".select2-result" do
find("span", text: collection.title.first).click
end
end | ruby | def select_member_of_collection(collection)
find('#s2id_member_of_collection_ids').click
find('.select2-input').set(collection.title.first)
# Crude way of waiting for the AJAX response
select2_results = []
time_elapsed = 0
while select2_results.empty? && time_elapsed < 30
begin_time = Time.now.to_f
doc = Nokogiri::XML.parse(page.body)
select2_results = doc.xpath('//html:li[contains(@class,"select2-result")]', html: 'http://www.w3.org/1999/xhtml')
end_time = Time.now.to_f
time_elapsed += end_time - begin_time
end
expect(page).to have_css('.select2-result')
within ".select2-result" do
find("span", text: collection.title.first).click
end
end | [
"def",
"select_member_of_collection",
"(",
"collection",
")",
"find",
"(",
"'#s2id_member_of_collection_ids'",
")",
".",
"click",
"find",
"(",
"'.select2-input'",
")",
".",
"set",
"(",
"collection",
".",
"title",
".",
"first",
")",
"# Crude way of waiting for the AJAX... | For use with javascript collection selector that allows for searching for an existing collection from add to collection modal.
Does not save the selection. The calling test is expected to click Save and validate the collection membership was added to the work.
@param [Collection] collection to select | [
"For",
"use",
"with",
"javascript",
"collection",
"selector",
"that",
"allows",
"for",
"searching",
"for",
"an",
"existing",
"collection",
"from",
"add",
"to",
"collection",
"modal",
".",
"Does",
"not",
"save",
"the",
"selection",
".",
"The",
"calling",
"test"... | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/spec/support/selectors.rb#L43-L60 | train | Select the first member of a collection | [
30522,
13366,
7276,
1035,
2266,
1035,
1997,
1035,
3074,
1006,
3074,
1007,
2424,
1006,
1005,
1001,
1055,
2475,
3593,
1035,
2266,
1035,
1997,
1035,
3074,
1035,
8909,
2015,
1005,
1007,
1012,
11562,
2424,
1006,
1005,
1012,
7276,
2475,
1011,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb | Azure::EventGrid::Mgmt::V2018_01_01.EventSubscriptions.list_regional_by_subscription_for_topic_type | def list_regional_by_subscription_for_topic_type(location, topic_type_name, custom_headers:nil)
response = list_regional_by_subscription_for_topic_type_async(location, topic_type_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_regional_by_subscription_for_topic_type(location, topic_type_name, custom_headers:nil)
response = list_regional_by_subscription_for_topic_type_async(location, topic_type_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_regional_by_subscription_for_topic_type",
"(",
"location",
",",
"topic_type_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_regional_by_subscription_for_topic_type_async",
"(",
"location",
",",
"topic_type_name",
",",
"custom_headers",
":cus... | List all regional event subscriptions under an Azure subscription for a topic
type
List all event subscriptions from the given location under a specific Azure
subscription and topic type.
@param location [String] Name of the location
@param topic_type_name [String] Name of the topic type
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EventSubscriptionsListResult] operation results. | [
"List",
"all",
"regional",
"event",
"subscriptions",
"under",
"an",
"Azure",
"subscription",
"for",
"a",
"topic",
"type"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb#L1091-L1094 | train | Gets the regional policy for the subscription for a topic type. | [
30522,
13366,
2862,
1035,
3164,
1035,
2011,
1035,
15002,
1035,
2005,
1035,
8476,
1035,
2828,
1006,
3295,
1010,
8476,
1035,
2828,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
3164,
1035,
2011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Katello/katello | app/models/katello/repository.rb | Katello.Repository.master? | def master?
!self.yum? || # non-yum repos
self.in_default_view? || # default content view repos
(self.archive? && !self.content_view.composite) || # non-composite content view archive repos
(self.content_view.composite? && self.component_source_repositories.count > 1) # composite archive repo with more than 1 source repository
end | ruby | def master?
!self.yum? || # non-yum repos
self.in_default_view? || # default content view repos
(self.archive? && !self.content_view.composite) || # non-composite content view archive repos
(self.content_view.composite? && self.component_source_repositories.count > 1) # composite archive repo with more than 1 source repository
end | [
"def",
"master?",
"!",
"self",
".",
"yum?",
"||",
"# non-yum repos",
"self",
".",
"in_default_view?",
"||",
"# default content view repos",
"(",
"self",
".",
"archive?",
"&&",
"!",
"self",
".",
"content_view",
".",
"composite",
")",
"||",
"# non-composite content ... | a master repository actually has content (rpms, errata, etc) in the pulp repository. For these repositories, we can use the YumDistributor
to generate metadata and can index the content from pulp, or for the case of content view archives without filters, can also use the YumCloneDistributor | [
"a",
"master",
"repository",
"actually",
"has",
"content",
"(",
"rpms",
"errata",
"etc",
")",
"in",
"the",
"pulp",
"repository",
".",
"For",
"these",
"repositories",
"we",
"can",
"use",
"the",
"YumDistributor",
"to",
"generate",
"metadata",
"and",
"can",
"in... | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/repository.rb#L619-L624 | train | Returns true if the master is a master view | [
30522,
13366,
3040,
1029,
999,
2969,
1012,
9805,
2213,
1029,
1064,
1064,
1001,
2512,
1011,
9805,
2213,
16360,
2891,
2969,
1012,
1999,
1035,
12398,
1035,
3193,
1029,
1064,
1064,
1001,
12398,
4180,
3193,
16360,
2891,
1006,
2969,
1012,
8756,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activerecord/lib/active_record/relation.rb | ActiveRecord.Relation.delete_all | def delete_all
invalid_methods = INVALID_METHODS_FOR_DELETE_ALL.select do |method|
value = @values[method]
method == :distinct ? value : value&.any?
end
if invalid_methods.any?
raise ActiveRecordError.new("delete_all doesn't support #{invalid_methods.join(', ')}")
end
if eager_loading?
relation = apply_join_dependency
return relation.delete_all
end
stmt = Arel::DeleteManager.new
stmt.from(arel.join_sources.empty? ? table : arel.source)
stmt.key = arel_attribute(primary_key)
stmt.take(arel.limit)
stmt.offset(arel.offset)
stmt.order(*arel.orders)
stmt.wheres = arel.constraints
affected = @klass.connection.delete(stmt, "#{@klass} Destroy")
reset
affected
end | ruby | def delete_all
invalid_methods = INVALID_METHODS_FOR_DELETE_ALL.select do |method|
value = @values[method]
method == :distinct ? value : value&.any?
end
if invalid_methods.any?
raise ActiveRecordError.new("delete_all doesn't support #{invalid_methods.join(', ')}")
end
if eager_loading?
relation = apply_join_dependency
return relation.delete_all
end
stmt = Arel::DeleteManager.new
stmt.from(arel.join_sources.empty? ? table : arel.source)
stmt.key = arel_attribute(primary_key)
stmt.take(arel.limit)
stmt.offset(arel.offset)
stmt.order(*arel.orders)
stmt.wheres = arel.constraints
affected = @klass.connection.delete(stmt, "#{@klass} Destroy")
reset
affected
end | [
"def",
"delete_all",
"invalid_methods",
"=",
"INVALID_METHODS_FOR_DELETE_ALL",
".",
"select",
"do",
"|",
"method",
"|",
"value",
"=",
"@values",
"[",
"method",
"]",
"method",
"==",
":distinct",
"?",
"value",
":",
"value",
"&.",
"any?",
"end",
"if",
"invalid_me... | Deletes the records without instantiating the records
first, and hence not calling the {#destroy}[rdoc-ref:Persistence#destroy]
method nor invoking callbacks.
This is a single SQL DELETE statement that goes straight to the database, much more
efficient than #destroy_all. Be careful with relations though, in particular
<tt>:dependent</tt> rules defined on associations are not honored. Returns the
number of rows affected.
Post.where(person_id: 5).where(category: ['Something', 'Else']).delete_all
Both calls delete the affected posts all at once with a single DELETE statement.
If you need to destroy dependent associations or call your <tt>before_*</tt> or
+after_destroy+ callbacks, use the #destroy_all method instead.
If an invalid method is supplied, #delete_all raises an ActiveRecordError:
Post.distinct.delete_all
# => ActiveRecord::ActiveRecordError: delete_all doesn't support distinct | [
"Deletes",
"the",
"records",
"without",
"instantiating",
"the",
"records",
"first",
"and",
"hence",
"not",
"calling",
"the",
"{",
"#destroy",
"}",
"[",
"rdoc",
"-",
"ref",
":",
"Persistence#destroy",
"]",
"method",
"nor",
"invoking",
"callbacks",
".",
"This",
... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/relation.rb#L554-L580 | train | Delete all records in the table. | [
30522,
13366,
3972,
12870,
1035,
2035,
19528,
1035,
4725,
1027,
19528,
1035,
4725,
1035,
2005,
1035,
3972,
12870,
1035,
2035,
1012,
7276,
2079,
1064,
4118,
1064,
3643,
1027,
1030,
5300,
1031,
4118,
1033,
4118,
1027,
1027,
1024,
5664,
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 | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_deployed_application_health_with_http_info | def get_deployed_application_health_with_http_info(node_name, application_id, events_health_state_filter:0, deployed_service_packages_health_state_filter:0, exclude_health_statistics:false, timeout:60, custom_headers:nil)
get_deployed_application_health_async(node_name, application_id, events_health_state_filter:events_health_state_filter, deployed_service_packages_health_state_filter:deployed_service_packages_health_state_filter, exclude_health_statistics:exclude_health_statistics, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_deployed_application_health_with_http_info(node_name, application_id, events_health_state_filter:0, deployed_service_packages_health_state_filter:0, exclude_health_statistics:false, timeout:60, custom_headers:nil)
get_deployed_application_health_async(node_name, application_id, events_health_state_filter:events_health_state_filter, deployed_service_packages_health_state_filter:deployed_service_packages_health_state_filter, exclude_health_statistics:exclude_health_statistics, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_deployed_application_health_with_http_info",
"(",
"node_name",
",",
"application_id",
",",
"events_health_state_filter",
":",
"0",
",",
"deployed_service_packages_health_state_filter",
":",
"0",
",",
"exclude_health_statistics",
":",
"false",
",",
"timeout",
":",
... | Gets the information about health of an application deployed on a Service
Fabric node.
Gets the information about health of an application deployed on a Service
Fabric node. Use EventsHealthStateFilter to optionally filter for the
collection of HealthEvent objects reported on the deployed application based
on health state. Use DeployedServicePackagesHealthStateFilter to optionally
filter for DeployedServicePackageHealth children based on health state.
@param node_name [String] The name of the node.
@param application_id [String] The identity of the application. This is
typically the full name of the application without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the application name is "fabric:/myapp/app1", the application
identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions.
@param 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 deployed_service_packages_health_state_filter [Integer] Allows
filtering of the deployed service package health state objects returned in
the result of deployed application health query based on their health state.
The possible values for this parameter include integer value of one of the
following health states.
Only deployed service packages that match the filter are returned. All
deployed service packages are used to evaluate the aggregated health state of
the deployed application.
If not specified, all entries are returned.
The state values are flag based enumeration, so the value can be a
combination of these value obtained using bitwise 'OR' operator.
For example, if the provided value is 6 then health state of service packages
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 exclude_health_statistics [Boolean] Indicates whether the health
statistics should be returned as part of the query result. False by default.
The statistics show the number of children entities in health state Ok,
Warning, and Error.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"information",
"about",
"health",
"of",
"an",
"application",
"deployed",
"on",
"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#L8863-L8865 | train | Gets health of the specified application. | [
30522,
13366,
2131,
1035,
7333,
1035,
4646,
1035,
2740,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13045,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
2824,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
7333,
1035,
2326,
1035,
14555,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2016-06-01/generated/azure_mgmt_logic/schemas.rb | Azure::Logic::Mgmt::V2016_06_01.Schemas.create_or_update | def create_or_update(resource_group_name, integration_account_name, schema_name, schema, custom_headers:nil)
response = create_or_update_async(resource_group_name, integration_account_name, schema_name, schema, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(resource_group_name, integration_account_name, schema_name, schema, custom_headers:nil)
response = create_or_update_async(resource_group_name, integration_account_name, schema_name, schema, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"schema_name",
",",
"schema",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
... | Creates or updates an integration account schema.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param schema_name [String] The integration account schema name.
@param schema [IntegrationAccountSchema] The integration account schema.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [IntegrationAccountSchema] operation results. | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"schema",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/schemas.rb#L233-L236 | train | Creates or updates an integration account schema. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8346,
1035,
4070,
1035,
2171,
1010,
8040,
28433,
1035,
2171,
1010,
8040,
28433,
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... |
rails/rails | activerecord/lib/active_record/relation.rb | ActiveRecord.Relation.create_or_find_by! | def create_or_find_by!(attributes, &block)
transaction(requires_new: true) { create!(attributes, &block) }
rescue ActiveRecord::RecordNotUnique
find_by!(attributes)
end | ruby | def create_or_find_by!(attributes, &block)
transaction(requires_new: true) { create!(attributes, &block) }
rescue ActiveRecord::RecordNotUnique
find_by!(attributes)
end | [
"def",
"create_or_find_by!",
"(",
"attributes",
",",
"&",
"block",
")",
"transaction",
"(",
"requires_new",
":",
"true",
")",
"{",
"create!",
"(",
"attributes",
",",
"block",
")",
"}",
"rescue",
"ActiveRecord",
"::",
"RecordNotUnique",
"find_by!",
"(",
"attrib... | Like #create_or_find_by, but calls
{create!}[rdoc-ref:Persistence::ClassMethods#create!] so an exception
is raised if the created record is invalid. | [
"Like",
"#create_or_find_by",
"but",
"calls",
"{",
"create!",
"}",
"[",
"rdoc",
"-",
"ref",
":",
"Persistence",
"::",
"ClassMethods#create!",
"]",
"so",
"an",
"exception",
"is",
"raised",
"if",
"the",
"created",
"record",
"is",
"invalid",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/relation.rb#L218-L222 | train | Create or find the record | [
30522,
13366,
3443,
1035,
2030,
1035,
2424,
1035,
2011,
999,
1006,
12332,
1010,
1004,
3796,
1007,
12598,
1006,
5942,
1035,
2047,
1024,
2995,
1007,
1063,
3443,
999,
1006,
12332,
1010,
1004,
3796,
1007,
1065,
5343,
3161,
2890,
27108,
2094,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/searches_helper.rb | Decidim.SearchesHelper.search_path_by | def search_path_by(resource_type: nil, space_state: nil)
new_params = {
utf8: params[:utf8],
filter: {
decidim_scope_id: params.dig(:filter, :decidim_scope_id),
term: params[:term] || params.dig(:filter, :term)
}
}
new_params[:filter][:resource_type] = resource_type if resource_type.present?
new_params[:filter][:space_state] = space_state if space_state.present?
decidim.search_path(new_params)
end | ruby | def search_path_by(resource_type: nil, space_state: nil)
new_params = {
utf8: params[:utf8],
filter: {
decidim_scope_id: params.dig(:filter, :decidim_scope_id),
term: params[:term] || params.dig(:filter, :term)
}
}
new_params[:filter][:resource_type] = resource_type if resource_type.present?
new_params[:filter][:space_state] = space_state if space_state.present?
decidim.search_path(new_params)
end | [
"def",
"search_path_by",
"(",
"resource_type",
":",
"nil",
",",
"space_state",
":",
"nil",
")",
"new_params",
"=",
"{",
"utf8",
":",
"params",
"[",
":utf8",
"]",
",",
"filter",
":",
"{",
"decidim_scope_id",
":",
"params",
".",
"dig",
"(",
":filter",
",",... | Generates a link to filter the current search by the given type. If no
type is given, it generates a link to the main results page.
resource_type - An optional String with the name of the model class to filter
space_state - An optional String with the name of the state of the space | [
"Generates",
"a",
"link",
"to",
"filter",
"the",
"current",
"search",
"by",
"the",
"given",
"type",
".",
"If",
"no",
"type",
"is",
"given",
"it",
"generates",
"a",
"link",
"to",
"the",
"main",
"results",
"page",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/searches_helper.rb#L26-L37 | train | Search path by resource type and space state | [
30522,
13366,
3945,
1035,
4130,
1035,
2011,
1006,
7692,
1035,
2828,
1024,
9152,
2140,
1010,
2686,
1035,
2110,
1024,
9152,
2140,
1007,
2047,
1035,
11498,
5244,
1027,
1063,
21183,
2546,
2620,
1024,
11498,
5244,
1031,
1024,
21183,
2546,
2620,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachineScaleSets.begin_deallocate | def begin_deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
response = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
response = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_deallocate",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_deallocate_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instanc... | Deallocates specific virtual machines in a VM scale set. Shuts down the
virtual machines and releases the compute resources. You are not billed for
the compute resources that this virtual machine scale set deallocates.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusResponse] operation results. | [
"Deallocates",
"specific",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"Shuts",
"down",
"the",
"virtual",
"machines",
"and",
"releases",
"the",
"compute",
"resources",
".",
"You",
"are",
"not",
"billed",
"for",
"the",
"compute",
"resources",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1156-L1159 | train | Deallocate virtual machines from a virtual machine scale set. | [
30522,
13366,
4088,
1035,
3066,
4135,
16280,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb | Azure::Labservices::Mgmt::V2018_10_15.GlobalUsers.get_personal_preferences | def get_personal_preferences(user_name, personal_preferences_operations_payload, custom_headers:nil)
response = get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_personal_preferences(user_name, personal_preferences_operations_payload, custom_headers:nil)
response = get_personal_preferences_async(user_name, personal_preferences_operations_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_personal_preferences",
"(",
"user_name",
",",
"personal_preferences_operations_payload",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_personal_preferences_async",
"(",
"user_name",
",",
"personal_preferences_operations_payload",
",",
"custom_headers... | Get personal preferences for a user
@param user_name [String] The name of the user.
@param personal_preferences_operations_payload
[PersonalPreferencesOperationsPayload] Represents payload for any Environment
operations like get, start, stop, connect
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [GetPersonalPreferencesResponse] operation results. | [
"Get",
"personal",
"preferences",
"for",
"a",
"user"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb#L348-L351 | train | Gets the user preferences. | [
30522,
13366,
2131,
1035,
30524,
2131,
1035,
3167,
1035,
18394,
1035,
2004,
6038,
2278,
1006,
5310,
1035,
2171,
1010,
3167,
1035,
18394,
1035,
3136,
1035,
18093,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
CocoaPods/Xcodeproj | lib/xcodeproj/scheme.rb | Xcodeproj.XCScheme.set_launch_target | def set_launch_target(build_target)
launch_runnable = BuildableProductRunnable.new(build_target, 0)
launch_action.buildable_product_runnable = launch_runnable
profile_runnable = BuildableProductRunnable.new(build_target)
profile_action.buildable_product_runnable = profile_runnable
macro_exp = MacroExpansion.new(build_target)
test_action.add_macro_expansion(macro_exp)
end | ruby | def set_launch_target(build_target)
launch_runnable = BuildableProductRunnable.new(build_target, 0)
launch_action.buildable_product_runnable = launch_runnable
profile_runnable = BuildableProductRunnable.new(build_target)
profile_action.buildable_product_runnable = profile_runnable
macro_exp = MacroExpansion.new(build_target)
test_action.add_macro_expansion(macro_exp)
end | [
"def",
"set_launch_target",
"(",
"build_target",
")",
"launch_runnable",
"=",
"BuildableProductRunnable",
".",
"new",
"(",
"build_target",
",",
"0",
")",
"launch_action",
".",
"buildable_product_runnable",
"=",
"launch_runnable",
"profile_runnable",
"=",
"BuildableProduct... | Sets a runnable target to be the target of the launch action of the scheme.
@param [Xcodeproj::Project::Object::AbstractTarget] build_target
A target used by scheme in the launch step. | [
"Sets",
"a",
"runnable",
"target",
"to",
"be",
"the",
"target",
"of",
"the",
"launch",
"action",
"of",
"the",
"scheme",
"."
] | 3be1684437a6f8e69c7836ad4c85a2b78663272f | https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/lib/xcodeproj/scheme.rb#L220-L229 | train | Set the launch target | [
30522,
13366,
2275,
1035,
4888,
1035,
4539,
1006,
3857,
1035,
4539,
1007,
4888,
1035,
2448,
22966,
1027,
3857,
3085,
21572,
8566,
6593,
15532,
22966,
1012,
2047,
1006,
3857,
1035,
4539,
1010,
1014,
1007,
4888,
1035,
2895,
1012,
3857,
3085,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Shopify/doggy | lib/doggy/model.rb | Doggy.Model.save_local | def save_local
ensure_read_only!
self.path ||= Doggy.object_root.join("#{prefix}-#{id}.json")
File.open(@path, 'w') { |f| f.write(JSON.pretty_generate(to_h)) }
end | ruby | def save_local
ensure_read_only!
self.path ||= Doggy.object_root.join("#{prefix}-#{id}.json")
File.open(@path, 'w') { |f| f.write(JSON.pretty_generate(to_h)) }
end | [
"def",
"save_local",
"ensure_read_only!",
"self",
".",
"path",
"||=",
"Doggy",
".",
"object_root",
".",
"join",
"(",
"\"#{prefix}-#{id}.json\"",
")",
"File",
".",
"open",
"(",
"@path",
",",
"'w'",
")",
"{",
"|",
"f",
"|",
"f",
".",
"write",
"(",
"JSON",
... | class << self | [
"class",
"<<",
"self"
] | 5c5a08698925c26eb1118eae7a81a5ad39dc086f | https://github.com/Shopify/doggy/blob/5c5a08698925c26eb1118eae7a81a5ad39dc086f/lib/doggy/model.rb#L184-L188 | train | Save the object to disk | [
30522,
13366,
3828,
1035,
2334,
5676,
1035,
3191,
1035,
2069,
999,
2969,
1012,
4130,
1064,
1064,
1027,
28844,
2100,
1012,
4874,
1035,
7117,
1012,
3693,
1006,
1000,
1001,
1063,
17576,
1065,
1011,
1001,
1063,
8909,
1065,
1012,
1046,
3385,
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_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb | Azure::CognitiveServices::ComputerVision::V2_0.ComputerVisionClient.analyze_image_by_domain | def analyze_image_by_domain(model, url, language:nil, custom_headers:nil)
response = analyze_image_by_domain_async(model, url, language:language, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def analyze_image_by_domain(model, url, language:nil, custom_headers:nil)
response = analyze_image_by_domain_async(model, url, language:language, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"analyze_image_by_domain",
"(",
"model",
",",
"url",
",",
"language",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"analyze_image_by_domain_async",
"(",
"model",
",",
"url",
",",
"language",
":",
"language",
",",
"custom_headers",
... | This operation recognizes content within an image by applying a
domain-specific model. The list of domain-specific models that are supported
by the Computer Vision API can be retrieved using the /models GET request.
Currently, the API provides following domain-specific models: celebrities,
landmarks.
Two input methods are supported -- (1) Uploading an image or (2) specifying
an image URL.
A successful response will be returned in JSON.
If the request failed, the response will contain an error code and a message
to help understand what went wrong.
@param model [String] The domain-specific content to recognize.
@param url [String] Publicly reachable URL of an image.
@param language [Enum] The desired language for output generation. If this
parameter is not specified, the default value is "en".Supported
languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es',
'ja', 'pt', 'zh'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DomainModelResults] operation results. | [
"This",
"operation",
"recognizes",
"content",
"within",
"an",
"image",
"by",
"applying",
"a",
"domain",
"-",
"specific",
"model",
".",
"The",
"list",
"of",
"domain",
"-",
"specific",
"models",
"that",
"are",
"supported",
"by",
"the",
"Computer",
"Vision",
"A... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb#L688-L691 | train | Analyze an image by domain. | [
30522,
13366,
17908,
1035,
3746,
1035,
2011,
1035,
5884,
1006,
2944,
1010,
24471,
2140,
1010,
2653,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
17908,
1035,
3746,
1035,
2011,
1035,
5884,
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... |
AaronLasseigne/active_interaction | lib/active_interaction/filter.rb | ActiveInteraction.Filter.default | def default(context = nil)
raise NoDefaultError, name unless default?
value = raw_default(context)
raise InvalidValueError if value.is_a?(GroupedInput)
cast(value, context)
rescue InvalidNestedValueError => error
raise InvalidDefaultError, "#{name}: #{value.inspect} (#{error})"
rescue InvalidValueError, MissingValueError
raise InvalidDefaultError, "#{name}: #{value.inspect}"
end | ruby | def default(context = nil)
raise NoDefaultError, name unless default?
value = raw_default(context)
raise InvalidValueError if value.is_a?(GroupedInput)
cast(value, context)
rescue InvalidNestedValueError => error
raise InvalidDefaultError, "#{name}: #{value.inspect} (#{error})"
rescue InvalidValueError, MissingValueError
raise InvalidDefaultError, "#{name}: #{value.inspect}"
end | [
"def",
"default",
"(",
"context",
"=",
"nil",
")",
"raise",
"NoDefaultError",
",",
"name",
"unless",
"default?",
"value",
"=",
"raw_default",
"(",
"context",
")",
"raise",
"InvalidValueError",
"if",
"value",
".",
"is_a?",
"(",
"GroupedInput",
")",
"cast",
"(... | Get the default value.
@example
ActiveInteraction::Filter.new(:example).default
# => ActiveInteraction::NoDefaultError: example
@example
ActiveInteraction::Filter.new(:example, default: nil).default
# => nil
@example
ActiveInteraction::Filter.new(:example, default: 0).default
# => ActiveInteraction::InvalidDefaultError: example: 0
@param context [Base, nil]
@return (see #raw_default)
@raise [NoDefaultError] If the default is missing.
@raise [InvalidDefaultError] If the default is invalid. | [
"Get",
"the",
"default",
"value",
"."
] | fdc00a041e939ef48948baa2f7fd1ce2e4d66982 | https://github.com/AaronLasseigne/active_interaction/blob/fdc00a041e939ef48948baa2f7fd1ce2e4d66982/lib/active_interaction/filter.rb#L127-L138 | train | Returns the default value for this input. | [
30522,
13366,
12398,
1006,
6123,
1027,
9152,
2140,
1007,
5333,
13045,
7011,
11314,
2121,
29165,
1010,
2171,
4983,
12398,
1029,
3643,
1027,
6315,
1035,
12398,
1006,
6123,
1007,
5333,
19528,
10175,
5657,
2121,
29165,
2065,
3643,
1012,
2003,
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... |
fastlane/fastlane | spaceship/lib/spaceship/tunes/tunes_client.rb | Spaceship.TunesClient.upload_watch_icon | def upload_watch_icon(app_version, upload_image)
raise "app_version is required" unless app_version
raise "upload_image is required" unless upload_image
du_client.upload_watch_icon(app_version, upload_image, content_provider_id, sso_token_for_image)
end | ruby | def upload_watch_icon(app_version, upload_image)
raise "app_version is required" unless app_version
raise "upload_image is required" unless upload_image
du_client.upload_watch_icon(app_version, upload_image, content_provider_id, sso_token_for_image)
end | [
"def",
"upload_watch_icon",
"(",
"app_version",
",",
"upload_image",
")",
"raise",
"\"app_version is required\"",
"unless",
"app_version",
"raise",
"\"upload_image is required\"",
"unless",
"upload_image",
"du_client",
".",
"upload_watch_icon",
"(",
"app_version",
",",
"upl... | Uploads a watch icon
@param app_version (AppVersion): The version of your app
@param upload_image (UploadFile): The icon to upload
@return [JSON] the response | [
"Uploads",
"a",
"watch",
"icon"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/tunes/tunes_client.rb#L787-L792 | train | Upload an image to the watch icon | [
30522,
13366,
2039,
11066,
1035,
3422,
1035,
12696,
1006,
10439,
1035,
2544,
1010,
2039,
11066,
1035,
3746,
1007,
5333,
1000,
10439,
1035,
2544,
2003,
3223,
1000,
4983,
10439,
1035,
2544,
5333,
1000,
2039,
11066,
1035,
3746,
2003,
3223,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/puppet | lib/puppet/pops/visitor.rb | Puppet::Pops.Visitor.visit_this_2 | def visit_this_2(receiver, thing, arg1, arg2)
if method_name = @cache[thing.class]
return receiver.send(method_name, thing, arg1, arg2)
end
visit_this(receiver, thing, [arg1, arg2])
end | ruby | def visit_this_2(receiver, thing, arg1, arg2)
if method_name = @cache[thing.class]
return receiver.send(method_name, thing, arg1, arg2)
end
visit_this(receiver, thing, [arg1, arg2])
end | [
"def",
"visit_this_2",
"(",
"receiver",
",",
"thing",
",",
"arg1",
",",
"arg2",
")",
"if",
"method_name",
"=",
"@cache",
"[",
"thing",
".",
"class",
"]",
"return",
"receiver",
".",
"send",
"(",
"method_name",
",",
"thing",
",",
"arg1",
",",
"arg2",
")"... | Visit an explicit receiver with 2 args
(This is ~30% faster than calling the general method) | [
"Visit",
"an",
"explicit",
"receiver",
"with",
"2",
"args",
"(",
"This",
"is",
"~30%",
"faster",
"than",
"calling",
"the",
"general",
"method",
")"
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/pops/visitor.rb#L98-L103 | train | This method is called by the visitor to visit the given thing. | [
30522,
13366,
3942,
1035,
2023,
1035,
1016,
1006,
8393,
1010,
2518,
1010,
12098,
2290,
2487,
1010,
12098,
2290,
2475,
1007,
2065,
4118,
1035,
2171,
1027,
1030,
17053,
1031,
2518,
1012,
2465,
1033,
2709,
8393,
1012,
4604,
1006,
4118,
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/tag.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Tag.assign_to_operation | def assign_to_operation(resource_group_name, service_name, api_id, operation_id, tag_id, if_match:nil, custom_headers:nil)
response = assign_to_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, if_match:if_match, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def assign_to_operation(resource_group_name, service_name, api_id, operation_id, tag_id, if_match:nil, custom_headers:nil)
response = assign_to_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, if_match:if_match, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"assign_to_operation",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"operation_id",
",",
"tag_id",
",",
"if_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"assign_to_operation_async",
"(",
"resource_group_... | Assign tag to the Operation.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param api_id [String] API revision identifier. Must be unique in the current
API Management service instance. Non-current revision has ;rev=n as a suffix
where n is the revision number.
@param operation_id [String] Operation identifier within an API. Must be
unique in the current API Management service instance.
@param tag_id [String] Tag identifier. Must be unique in the current API
Management service instance.
@param if_match [String] ETag of the Entity. Not required when creating an
entity, but required when updating an entity.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [TagContract] operation results. | [
"Assign",
"tag",
"to",
"the",
"Operation",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb#L1738-L1741 | train | Assign a tag to an API. | [
30522,
13366,
23911,
1035,
2000,
1035,
3169,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
17928,
1035,
8909,
1010,
3169,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
30524,
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... |
sds/haml-lint | lib/haml_lint/linter/rubocop.rb | HamlLint.Linter::RuboCop.find_lints | def find_lints(ruby, source_map)
rubocop = ::RuboCop::CLI.new
filename =
if document.file
"#{document.file}.rb"
else
'ruby_script.rb'
end
with_ruby_from_stdin(ruby) do
extract_lints_from_offenses(lint_file(rubocop, filename), source_map)
end
end | ruby | def find_lints(ruby, source_map)
rubocop = ::RuboCop::CLI.new
filename =
if document.file
"#{document.file}.rb"
else
'ruby_script.rb'
end
with_ruby_from_stdin(ruby) do
extract_lints_from_offenses(lint_file(rubocop, filename), source_map)
end
end | [
"def",
"find_lints",
"(",
"ruby",
",",
"source_map",
")",
"rubocop",
"=",
"::",
"RuboCop",
"::",
"CLI",
".",
"new",
"filename",
"=",
"if",
"document",
".",
"file",
"\"#{document.file}.rb\"",
"else",
"'ruby_script.rb'",
"end",
"with_ruby_from_stdin",
"(",
"ruby",... | Executes RuboCop against the given Ruby code and records the offenses as
lints.
@param ruby [String] Ruby code
@param source_map [Hash] map of Ruby code line numbers to original line
numbers in the template | [
"Executes",
"RuboCop",
"against",
"the",
"given",
"Ruby",
"code",
"and",
"records",
"the",
"offenses",
"as",
"lints",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/linter/rubocop.rb#L38-L51 | train | Find lints from the given Ruby file | [
30522,
13366,
2424,
1035,
11409,
3215,
1006,
10090,
1010,
3120,
1035,
4949,
1007,
14548,
24163,
2361,
1027,
1024,
1024,
14548,
24163,
2361,
1024,
1024,
18856,
2072,
1012,
2047,
5371,
18442,
1027,
2065,
6254,
1012,
5371,
1000,
1001,
1063,
62... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_applications_event_list_with_http_info | def get_applications_event_list_with_http_info(start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
get_applications_event_list_async(start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
end | ruby | def get_applications_event_list_with_http_info(start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
get_applications_event_list_async(start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
end | [
"def",
"get_applications_event_list_with_http_info",
"(",
"start_time_utc",
",",
"end_time_utc",
",",
"timeout",
":",
"60",
",",
"events_types_filter",
":",
"nil",
",",
"exclude_analysis_events",
":",
"nil",
",",
"skip_correlation_lookup",
":",
"nil",
",",
"custom_heade... | Gets all Applications-related events.
The response is list of ApplicationEvent objects.
@param start_time_utc [String] The start time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param end_time_utc [String] The end time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param events_types_filter [String] This is a comma separated string
specifying the types of FabricEvents that should only be included in the
response.
@param exclude_analysis_events [Boolean] This param disables the retrieval of
AnalysisEvents if true is passed.
@param skip_correlation_lookup [Boolean] This param disables the search of
CorrelatedEvents information if true is passed. otherwise the
CorrelationEvents get processed and HasCorrelatedEvents field in every
FabricEvent gets populated.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"all",
"Applications",
"-",
"related",
"events",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L28063-L28065 | train | Gets the list of applications that have been processed. | [
30522,
13366,
2131,
1035,
5097,
1035,
2724,
1035,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2707,
1035,
2051,
1035,
11396,
1010,
2203,
1035,
2051,
1035,
11396,
1010,
2051,
5833,
1024,
3438,
1010,
2824,
1035,
4127,
1035,
11307,
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... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.radio_button_group | def radio_button_group(name, identifier)
define_method("select_#{name}") do |value|
platform.radio_buttons_for(identifier.clone).each do |radio_elem|
if radio_elem.value == value
return radio_elem.select
end
end
end
define_method("#{name}_values") do
result = []
platform.radio_buttons_for(identifier.clone).each do |radio_elem|
result << radio_elem.value
end
return result
end
define_method("#{name}_selected?") do
platform.radio_buttons_for(identifier.clone).each do |radio_elem|
return radio_elem.value if radio_elem.selected?
end
return false
end
define_method("#{name}_elements") do
return platform.radio_buttons_for(identifier.clone)
end
define_method("#{name}?") do
return platform.radio_buttons_for(identifier.clone).any?
end
end | ruby | def radio_button_group(name, identifier)
define_method("select_#{name}") do |value|
platform.radio_buttons_for(identifier.clone).each do |radio_elem|
if radio_elem.value == value
return radio_elem.select
end
end
end
define_method("#{name}_values") do
result = []
platform.radio_buttons_for(identifier.clone).each do |radio_elem|
result << radio_elem.value
end
return result
end
define_method("#{name}_selected?") do
platform.radio_buttons_for(identifier.clone).each do |radio_elem|
return radio_elem.value if radio_elem.selected?
end
return false
end
define_method("#{name}_elements") do
return platform.radio_buttons_for(identifier.clone)
end
define_method("#{name}?") do
return platform.radio_buttons_for(identifier.clone).any?
end
end | [
"def",
"radio_button_group",
"(",
"name",
",",
"identifier",
")",
"define_method",
"(",
"\"select_#{name}\"",
")",
"do",
"|",
"value",
"|",
"platform",
".",
"radio_buttons_for",
"(",
"identifier",
".",
"clone",
")",
".",
"each",
"do",
"|",
"radio_elem",
"|",
... | adds five methods to help interact with a radio button group -
a method to select a radio button in the group by given value/text,
a method to return the values of all radio buttons in the group, a method
to return if a radio button in the group is selected (will return
the text of the selected radio button, if true), a method to return
an array of PageObject::Elements::RadioButton objects representing
the radio button group, and finally a method to check the existence
of the radio button group.
@example
radio_button_group(:color, :name => "preferred_color")
will generate 'select_color', 'color_values', 'color_selected?',
'color_elements', and 'color?' methods
@param [Symbol] the name used for the generated methods
@param [Hash] shared identifier for the radio button group. Typically, a 'name' attribute.
The valid keys are:
* :name | [
"adds",
"five",
"methods",
"to",
"help",
"interact",
"with",
"a",
"radio",
"button",
"group",
"-",
"a",
"method",
"to",
"select",
"a",
"radio",
"button",
"in",
"the",
"group",
"by",
"given",
"value",
"/",
"text",
"a",
"method",
"to",
"return",
"the",
"... | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L390-L417 | train | Returns a group of radio buttons for the given identifier. | [
30522,
13366,
2557,
1035,
6462,
1035,
2177,
1006,
2171,
1010,
8909,
4765,
18095,
1007,
9375,
1035,
4118,
1006,
1000,
7276,
1035,
1001,
1063,
2171,
1065,
1000,
1007,
2079,
1064,
3643,
1064,
4132,
1012,
2557,
1035,
11287,
1035,
2005,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/worksheet.rb | Axlsx.Worksheet.column_widths | def column_widths(*widths)
widths.each_with_index do |value, index|
next if value == nil
Axlsx::validate_unsigned_numeric(value) unless value == nil
find_or_create_column_info(index).width = value
end
end | ruby | def column_widths(*widths)
widths.each_with_index do |value, index|
next if value == nil
Axlsx::validate_unsigned_numeric(value) unless value == nil
find_or_create_column_info(index).width = value
end
end | [
"def",
"column_widths",
"(",
"*",
"widths",
")",
"widths",
".",
"each_with_index",
"do",
"|",
"value",
",",
"index",
"|",
"next",
"if",
"value",
"==",
"nil",
"Axlsx",
"::",
"validate_unsigned_numeric",
"(",
"value",
")",
"unless",
"value",
"==",
"nil",
"fi... | This is a helper method that Lets you specify a fixed width for multiple columns in a worksheet in one go.
Note that you must call column_widths AFTER adding data, otherwise the width will not be set successfully.
Setting a fixed column width to nil will revert the behaviour back to calculating the width for you on the next call to add_row.
@example This would set the first and third column widhts but leave the second column in autofit state.
ws.column_widths 7.2, nil, 3
@note For updating only a single column it is probably easier to just set the width of the ws.column_info[col_index].width directly
@param [Integer|Float|nil] widths | [
"This",
"is",
"a",
"helper",
"method",
"that",
"Lets",
"you",
"specify",
"a",
"fixed",
"width",
"for",
"multiple",
"columns",
"in",
"a",
"worksheet",
"in",
"one",
"go",
".",
"Note",
"that",
"you",
"must",
"call",
"column_widths",
"AFTER",
"adding",
"data",... | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/worksheet.rb#L515-L521 | train | Set the column widths for this worksheet. | [
30522,
13366,
5930,
1035,
9381,
2015,
1006,
1008,
9381,
2015,
1007,
9381,
2015,
1012,
2169,
1035,
2007,
1035,
5950,
2079,
1064,
3643,
1010,
5950,
1064,
2279,
2065,
3643,
1027,
1027,
9152,
2140,
22260,
4877,
2595,
1024,
1024,
9398,
3686,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.