repo
stringclasses
237 values
path
stringlengths
11
168
func_name
stringlengths
10
147
original_string
stringlengths
79
124k
language
stringclasses
1 value
code
stringlengths
79
124k
code_tokens
listlengths
16
45.3k
docstring
stringlengths
4
23.5k
docstring_tokens
listlengths
1
452
sha
stringclasses
237 values
url
stringlengths
95
268
partition
stringclasses
1 value
summary
stringlengths
8
229
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
piotrmurach/github
lib/github_api/client/users/emails.rb
Github.Client::Users::Emails.delete
def delete(*args) arguments(args) params = arguments.params params['data'] = arguments.remaining unless arguments.remaining.empty? delete_request("/user/emails", params) end
ruby
def delete(*args) arguments(args) params = arguments.params params['data'] = arguments.remaining unless arguments.remaining.empty? delete_request("/user/emails", params) end
[ "def", "delete", "(", "*", "args", ")", "arguments", "(", "args", ")", "params", "=", "arguments", ".", "params", "params", "[", "'data'", "]", "=", "arguments", ".", "remaining", "unless", "arguments", ".", "remaining", ".", "empty?", "delete_request", "(...
Delete email address(es) for the authenticated user @param [Array[String]] emails You can include a single email address or an array of addresses @example github = Github.new oauth_token: '...' github.users.emails.delete "octocat@github.com", "support@github.com" @api public
[ "Delete", "email", "address", "(", "es", ")", "for", "the", "authenticated", "user" ]
8702452c66bea33c9388550aed9e9974f76aaef1
https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/users/emails.rb#L57-L63
train
Delete a user s emails
[ 30522, 13366, 3972, 12870, 1006, 1008, 12098, 5620, 1007, 9918, 1006, 12098, 5620, 1007, 11498, 5244, 1027, 9918, 1012, 11498, 5244, 11498, 5244, 1031, 1005, 2951, 1005, 1033, 1027, 9918, 1012, 3588, 4983, 9918, 1012, 3588, 1012, 4064, 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...
cloudfoundry/bosh
src/bosh-director/lib/bosh/director/agent_client.rb
Bosh::Director.AgentClient.format_exception
def format_exception(exception) return exception.to_s unless exception.is_a?(Hash) msg = exception['message'].to_s if exception['backtrace'] msg += "\n" msg += Array(exception['backtrace']).join("\n") end if exception['blobstore_id'] blob = download_and_delete_blob(exception['blobstore_id']) msg += "\n" msg += blob.to_s end msg end
ruby
def format_exception(exception) return exception.to_s unless exception.is_a?(Hash) msg = exception['message'].to_s if exception['backtrace'] msg += "\n" msg += Array(exception['backtrace']).join("\n") end if exception['blobstore_id'] blob = download_and_delete_blob(exception['blobstore_id']) msg += "\n" msg += blob.to_s end msg end
[ "def", "format_exception", "(", "exception", ")", "return", "exception", ".", "to_s", "unless", "exception", ".", "is_a?", "(", "Hash", ")", "msg", "=", "exception", "[", "'message'", "]", ".", "to_s", "if", "exception", "[", "'backtrace'", "]", "msg", "+=...
Returns formatted exception information @param [Hash|#to_s] exception Serialized exception @return [String]
[ "Returns", "formatted", "exception", "information" ]
2eaa7100879ddd20cd909cd698514746195e28b7
https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/agent_client.rb#L287-L304
train
Format an exception
[ 30522, 13366, 4289, 1035, 6453, 1006, 6453, 1007, 2709, 6453, 1012, 2000, 1035, 1055, 4983, 6453, 1012, 2003, 1035, 1037, 1029, 1006, 23325, 1007, 5796, 2290, 1027, 6453, 1031, 1005, 4471, 1005, 1033, 1012, 2000, 1035, 1055, 2065, 6453, 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/services/hyrax/file_set_derivatives_service.rb
Hyrax.FileSetDerivativesService.extract_full_text
def extract_full_text(filename, uri) return unless Hyrax.config.extract_full_text? Hydra::Derivatives::FullTextExtract.create(filename, outputs: [{ url: uri, container: "extracted_text" }]) end
ruby
def extract_full_text(filename, uri) return unless Hyrax.config.extract_full_text? Hydra::Derivatives::FullTextExtract.create(filename, outputs: [{ url: uri, container: "extracted_text" }]) end
[ "def", "extract_full_text", "(", "filename", ",", "uri", ")", "return", "unless", "Hyrax", ".", "config", ".", "extract_full_text?", "Hydra", "::", "Derivatives", "::", "FullTextExtract", ".", "create", "(", "filename", ",", "outputs", ":", "[", "{", "url", ...
Calls the Hydra::Derivates::FulltextExtraction unless the extract_full_text configuration option is set to false @param [String] filename of the object to be used for full text extraction @param [String] uri to the file set (deligated to file_set)
[ "Calls", "the", "Hydra", "::", "Derivates", "::", "FulltextExtraction", "unless", "the", "extract_full_text", "configuration", "option", "is", "set", "to", "false" ]
e2b4f56e829a53b1f11296324736e9d5b8c9ee5f
https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/services/hyrax/file_set_derivatives_service.rb#L103-L107
train
Extract full text from a file
[ 30522, 13366, 14817, 1035, 2440, 1035, 3793, 1006, 5371, 18442, 1010, 24471, 2072, 1007, 2709, 4983, 1044, 19563, 2595, 1012, 9530, 8873, 2290, 1012, 14817, 1035, 2440, 1035, 3793, 1029, 26018, 1024, 1024, 16942, 1024, 1024, 2440, 18209, 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...
square/connect-ruby-sdk
lib/square_connect/models/order_fulfillment_recipient.rb
SquareConnect.OrderFulfillmentRecipient.email_address=
def email_address=(email_address) if !email_address.nil? && email_address.to_s.length > 255 fail ArgumentError, "invalid value for 'email_address', the character length must be smaller than or equal to 255." end @email_address = email_address end
ruby
def email_address=(email_address) if !email_address.nil? && email_address.to_s.length > 255 fail ArgumentError, "invalid value for 'email_address', the character length must be smaller than or equal to 255." end @email_address = email_address end
[ "def", "email_address", "=", "(", "email_address", ")", "if", "!", "email_address", ".", "nil?", "&&", "email_address", ".", "to_s", ".", "length", ">", "255", "fail", "ArgumentError", ",", "\"invalid value for 'email_address', the character length must be smaller than or...
Custom attribute writer method with validation @param [Object] email_address Value to be assigned
[ "Custom", "attribute", "writer", "method", "with", "validation" ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/order_fulfillment_recipient.rb#L115-L122
train
Set the email address of the user.
[ 30522, 13366, 10373, 1035, 4769, 1027, 1006, 10373, 1035, 4769, 1007, 2065, 999, 10373, 1035, 4769, 1012, 9152, 2140, 1029, 1004, 1004, 10373, 1035, 4769, 1012, 2000, 1035, 1055, 1012, 3091, 1028, 20637, 8246, 6685, 2121, 29165, 1010, 1000,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_privatedns/lib/2018-09-01/generated/azure_mgmt_privatedns/private_zones.rb
Azure::PrivateDns::Mgmt::V2018_09_01.PrivateZones.update
def update(resource_group_name, private_zone_name, parameters, if_match:nil, custom_headers:nil) response = update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def update(resource_group_name, private_zone_name, parameters, if_match:nil, custom_headers:nil) response = update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "update", "(", "resource_group_name", ",", "private_zone_name", ",", "parameters", ",", "if_match", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "update_async", "(", "resource_group_name", ",", "private_zone_name", ",", "parameters", ...
Updates a Private DNS zone. Does not modify virtual network links or DNS records within the zone. @param resource_group_name [String] The name of the resource group. @param private_zone_name [String] The name of the Private DNS zone (without a terminating dot). @param parameters [PrivateZone] Parameters supplied to the Update operation. @param if_match [String] The ETag of the Private DNS zone. Omit this value to always overwrite the current zone. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [PrivateZone] operation results.
[ "Updates", "a", "Private", "DNS", "zone", ".", "Does", "not", "modify", "virtual", "network", "links", "or", "DNS", "records", "within", "the", "zone", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_privatedns/lib/2018-09-01/generated/azure_mgmt_privatedns/private_zones.rb#L101-L104
train
Updates a Private DNS zone.
[ 30522, 13366, 10651, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2797, 1035, 4224, 1035, 2171, 1010, 11709, 1010, 2065, 1035, 2674, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 10651, 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...
github-changelog-generator/github-changelog-generator
lib/github_changelog_generator/generator/entry.rb
GitHubChangelogGenerator.Entry.default_sections
def default_sections [ Section.new(name: "summary", prefix: @options[:summary_prefix], labels: @options[:summary_labels], options: @options, body_only: true), Section.new(name: "breaking", prefix: @options[:breaking_prefix], labels: @options[:breaking_labels], options: @options), Section.new(name: "enhancements", prefix: @options[:enhancement_prefix], labels: @options[:enhancement_labels], options: @options), Section.new(name: "bugs", prefix: @options[:bug_prefix], labels: @options[:bug_labels], options: @options), Section.new(name: "deprecated", prefix: @options[:deprecated_prefix], labels: @options[:deprecated_labels], options: @options), Section.new(name: "removed", prefix: @options[:removed_prefix], labels: @options[:removed_labels], options: @options), Section.new(name: "security", prefix: @options[:security_prefix], labels: @options[:security_labels], options: @options) ] end
ruby
def default_sections [ Section.new(name: "summary", prefix: @options[:summary_prefix], labels: @options[:summary_labels], options: @options, body_only: true), Section.new(name: "breaking", prefix: @options[:breaking_prefix], labels: @options[:breaking_labels], options: @options), Section.new(name: "enhancements", prefix: @options[:enhancement_prefix], labels: @options[:enhancement_labels], options: @options), Section.new(name: "bugs", prefix: @options[:bug_prefix], labels: @options[:bug_labels], options: @options), Section.new(name: "deprecated", prefix: @options[:deprecated_prefix], labels: @options[:deprecated_labels], options: @options), Section.new(name: "removed", prefix: @options[:removed_prefix], labels: @options[:removed_labels], options: @options), Section.new(name: "security", prefix: @options[:security_prefix], labels: @options[:security_labels], options: @options) ] end
[ "def", "default_sections", "[", "Section", ".", "new", "(", "name", ":", "\"summary\"", ",", "prefix", ":", "@options", "[", ":summary_prefix", "]", ",", "labels", ":", "@options", "[", ":summary_labels", "]", ",", "options", ":", "@options", ",", "body_only...
Default sections to used when --configure-sections is not set. @return [Array] Section objects.
[ "Default", "sections", "to", "used", "when", "--", "configure", "-", "sections", "is", "not", "set", "." ]
f18c64b5cc0d7473b059275b88385ac11ca8b564
https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/generator/entry.rb#L126-L136
train
Returns a list of default sections
[ 30522, 13366, 12398, 1035, 5433, 1031, 2930, 1012, 2047, 1006, 2171, 1024, 1000, 12654, 1000, 1010, 17576, 1024, 1030, 7047, 1031, 1024, 12654, 1035, 17576, 1033, 1010, 10873, 1024, 1030, 7047, 1031, 1024, 12654, 1035, 10873, 1033, 1010, 70...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_analysis_services/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb
Azure::AnalysisServices::Mgmt::V2017_08_01_beta.Servers.get_details
def get_details(resource_group_name, server_name, custom_headers:nil) response = get_details_async(resource_group_name, server_name, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_details(resource_group_name, server_name, custom_headers:nil) response = get_details_async(resource_group_name, server_name, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_details", "(", "resource_group_name", ",", "server_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_details_async", "(", "resource_group_name", ",", "server_name", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response"...
Gets details about the specified Analysis Services server. @param resource_group_name [String] The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90. @param server_name [String] The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [AnalysisServicesServer] operation results.
[ "Gets", "details", "about", "the", "specified", "Analysis", "Services", "server", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_analysis_services/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb#L39-L42
train
Gets the details of a managed cluster.
[ 30522, 13366, 2131, 1035, 4751, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 8241, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 4751, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 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_advisor/lib/2017-03-31/generated/azure_mgmt_advisor/suppressions.rb
Azure::Advisor::Mgmt::V2017_03_31.Suppressions.get_with_http_info
def get_with_http_info(resource_uri, recommendation_id, name, custom_headers:nil) get_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value! end
ruby
def get_with_http_info(resource_uri, recommendation_id, name, custom_headers:nil) get_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value! end
[ "def", "get_with_http_info", "(", "resource_uri", ",", "recommendation_id", ",", "name", ",", "custom_headers", ":", "nil", ")", "get_async", "(", "resource_uri", ",", "recommendation_id", ",", "name", ",", "custom_headers", ":custom_headers", ")", ".", "value!", ...
Obtains the details of a suppression. @param resource_uri [String] The fully qualified Azure Resource Manager identifier of the resource to which the recommendation applies. @param recommendation_id [String] The recommendation ID. @param name [String] The name of the suppression. @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.
[ "Obtains", "the", "details", "of", "a", "suppression", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_advisor/lib/2017-03-31/generated/azure_mgmt_advisor/suppressions.rb#L53-L55
train
Gets the details of a specific recommendation.
[ 30522, 13366, 2131, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 24471, 2072, 1010, 12832, 1035, 8909, 1010, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 24471, 2072,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb
Azure::ApiManagement::Mgmt::V2016_10_10.ApiManagementServices.begin_backup
def begin_backup(resource_group_name, service_name, parameters, custom_headers:nil) response = begin_backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_backup(resource_group_name, service_name, parameters, custom_headers:nil) response = begin_backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_backup", "(", "resource_group_name", ",", "service_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_backup_async", "(", "resource_group_name", ",", "service_name", ",", "parameters", ",", "custom_headers", ":custo...
Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and could take several minutes to complete. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters supplied to the ApiManagementServices_Backup operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ApiManagementServiceResource] operation results.
[ "Creates", "a", "backup", "of", "the", "API", "Management", "service", "to", "the", "given", "Azure", "Storage", "Account", ".", "This", "is", "long", "running", "operation", "and", "could", "take", "several", "minutes", "to", "complete", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb#L1344-L1347
train
Creates a backup of a service.
[ 30522, 13366, 4088, 1035, 10200, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 10200, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ms-ati/docile
lib/docile/fallback_context_proxy.rb
Docile.FallbackContextProxy.method_missing
def method_missing(method, *args, &block) if @__receiver__.respond_to?(method.to_sym) @__receiver__.__send__(method.to_sym, *args, &block) else @__fallback__.__send__(method.to_sym, *args, &block) end end
ruby
def method_missing(method, *args, &block) if @__receiver__.respond_to?(method.to_sym) @__receiver__.__send__(method.to_sym, *args, &block) else @__fallback__.__send__(method.to_sym, *args, &block) end end
[ "def", "method_missing", "(", "method", ",", "*", "args", ",", "&", "block", ")", "if", "@__receiver__", ".", "respond_to?", "(", "method", ".", "to_sym", ")", "@__receiver__", ".", "__send__", "(", "method", ".", "to_sym", ",", "args", ",", "block", ")"...
Proxy all methods, excluding {NON_PROXIED_METHODS}, first to `receiver` and then to `fallback` if not found.
[ "Proxy", "all", "methods", "excluding", "{", "NON_PROXIED_METHODS", "}", "first", "to", "receiver", "and", "then", "to", "fallback", "if", "not", "found", "." ]
67517e7573f1dc511922534078d68659403e0ac6
https://github.com/ms-ati/docile/blob/67517e7573f1dc511922534078d68659403e0ac6/lib/docile/fallback_context_proxy.rb#L85-L91
train
This method is called by the classloader to call the method on the classloader.
[ 30522, 13366, 4118, 1035, 4394, 1006, 4118, 1010, 1008, 12098, 5620, 1010, 1004, 3796, 1007, 2065, 1030, 1035, 1035, 8393, 1035, 1035, 1012, 6869, 1035, 2000, 1029, 1006, 4118, 1012, 2000, 1035, 25353, 2213, 1007, 1030, 1035, 1035, 8393, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/portal/portal_client.rb
Spaceship.PortalClient.provisioning_profiles_via_xcode_api
def provisioning_profiles_via_xcode_api(mac: false) req = request(:post) do |r| r.url("https://developerservices2.apple.com/services/#{PROTOCOL_VERSION}/#{platform_slug(mac)}/listProvisioningProfiles.action") r.params = { teamId: team_id, includeInactiveProfiles: true, onlyCountLists: true } end result = parse_response(req, 'provisioningProfiles') csrf_cache[Spaceship::Portal::ProvisioningProfile] = self.csrf_tokens result end
ruby
def provisioning_profiles_via_xcode_api(mac: false) req = request(:post) do |r| r.url("https://developerservices2.apple.com/services/#{PROTOCOL_VERSION}/#{platform_slug(mac)}/listProvisioningProfiles.action") r.params = { teamId: team_id, includeInactiveProfiles: true, onlyCountLists: true } end result = parse_response(req, 'provisioningProfiles') csrf_cache[Spaceship::Portal::ProvisioningProfile] = self.csrf_tokens result end
[ "def", "provisioning_profiles_via_xcode_api", "(", "mac", ":", "false", ")", "req", "=", "request", "(", ":post", ")", "do", "|", "r", "|", "r", ".", "url", "(", "\"https://developerservices2.apple.com/services/#{PROTOCOL_VERSION}/#{platform_slug(mac)}/listProvisioningProfi...
this endpoint is used by Xcode to fetch provisioning profiles. The response is an xml plist but has the added benefit of containing the appId of each provisioning profile. Use this method over `provisioning_profiles` if possible because no secondary API calls are necessary to populate the ProvisioningProfile data model.
[ "this", "endpoint", "is", "used", "by", "Xcode", "to", "fetch", "provisioning", "profiles", ".", "The", "response", "is", "an", "xml", "plist", "but", "has", "the", "added", "benefit", "of", "containing", "the", "appId", "of", "each", "provisioning", "profil...
457c5d647c77f0e078dafa5129da616914e002c5
https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/portal/portal_client.rb#L645-L660
train
Get provisioning profiles via xcode api
[ 30522, 13366, 9347, 2075, 1035, 17879, 1035, 3081, 1035, 1060, 16044, 1035, 17928, 1006, 6097, 1024, 6270, 1007, 2128, 4160, 1027, 5227, 1006, 1024, 2695, 1007, 2079, 1064, 1054, 1064, 1054, 1012, 24471, 2140, 1006, 1000, 16770, 1024, 1013,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sds/overcommit
lib/overcommit/hook/base.rb
Overcommit::Hook.Base.check_for_libraries
def check_for_libraries output = [] required_libraries.each do |library| begin require library rescue LoadError install_command = @config['install_command'] install_command = " -- install via #{install_command}" if install_command output << "Unable to load '#{library}'#{install_command}" end end return if output.empty? output.join("\n") end
ruby
def check_for_libraries output = [] required_libraries.each do |library| begin require library rescue LoadError install_command = @config['install_command'] install_command = " -- install via #{install_command}" if install_command output << "Unable to load '#{library}'#{install_command}" end end return if output.empty? output.join("\n") end
[ "def", "check_for_libraries", "output", "=", "[", "]", "required_libraries", ".", "each", "do", "|", "library", "|", "begin", "require", "library", "rescue", "LoadError", "install_command", "=", "@config", "[", "'install_command'", "]", "install_command", "=", "\"...
If the hook defines required library paths that it wants to load, attempt to load them.
[ "If", "the", "hook", "defines", "required", "library", "paths", "that", "it", "wants", "to", "load", "attempt", "to", "load", "them", "." ]
35d60adb41da942178b789560968e3ad030b0ac7
https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/hook/base.rb#L221-L238
train
Checks for libraries that are installed.
[ 30522, 13366, 4638, 1035, 2005, 1035, 8860, 6434, 1027, 1031, 1033, 3223, 1035, 8860, 1012, 2169, 2079, 1064, 3075, 1064, 4088, 5478, 3075, 5343, 7170, 2121, 29165, 16500, 1035, 3094, 1027, 1030, 9530, 8873, 2290, 1031, 1005, 16500, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb
Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.get_tag
def get_tag(project_id, tag_id, iteration_id:nil, custom_headers:nil) response = get_tag_async(project_id, tag_id, iteration_id:iteration_id, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_tag(project_id, tag_id, iteration_id:nil, custom_headers:nil) response = get_tag_async(project_id, tag_id, iteration_id:iteration_id, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_tag", "(", "project_id", ",", "tag_id", ",", "iteration_id", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_tag_async", "(", "project_id", ",", "tag_id", ",", "iteration_id", ":iteration_id", ",", "custom_headers", ":custom...
Get information about a specific tag. @param project_id The project this tag belongs to. @param tag_id The tag id. @param iteration_id The iteration to retrieve this tag from. Optional, defaults to current training set. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Tag] operation results.
[ "Get", "information", "about", "a", "specific", "tag", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb#L4210-L4213
train
Gets the tag for a given project.
[ 30522, 13366, 2131, 1035, 6415, 1006, 2622, 1035, 8909, 1010, 6415, 1035, 8909, 1010, 27758, 1035, 8909, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 6415, 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...
aws/aws-sdk-ruby
gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/table.rb
Aws::DynamoDB.Table.scan
def scan(options = {}) options = options.merge(table_name: @name) resp = @client.scan(options) resp.data end
ruby
def scan(options = {}) options = options.merge(table_name: @name) resp = @client.scan(options) resp.data end
[ "def", "scan", "(", "options", "=", "{", "}", ")", "options", "=", "options", ".", "merge", "(", "table_name", ":", "@name", ")", "resp", "=", "@client", ".", "scan", "(", "options", ")", "resp", ".", "data", "end" ]
@example Request syntax with placeholder values table.scan({ index_name: "IndexName", attributes_to_get: ["AttributeName"], limit: 1, select: "ALL_ATTRIBUTES", # accepts ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, SPECIFIC_ATTRIBUTES, COUNT scan_filter: { "AttributeName" => { attribute_value_list: ["value"], # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil> comparison_operator: "EQ", # required, accepts EQ, NE, IN, LE, LT, GE, GT, BETWEEN, NOT_NULL, NULL, CONTAINS, NOT_CONTAINS, BEGINS_WITH }, }, conditional_operator: "AND", # accepts AND, OR exclusive_start_key: { "AttributeName" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil> }, return_consumed_capacity: "INDEXES", # accepts INDEXES, TOTAL, NONE total_segments: 1, segment: 1, projection_expression: "ProjectionExpression", filter_expression: "ConditionExpression", expression_attribute_names: { "ExpressionAttributeNameVariable" => "AttributeName", }, expression_attribute_values: { "ExpressionAttributeValueVariable" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil> }, consistent_read: false, }) @param [Hash] options ({}) @option options [String] :index_name The name of a secondary index to scan. This index can be any local secondary index or global secondary index. Note that if you use the `IndexName` parameter, you must also provide `TableName`. @option options [Array<String>] :attributes_to_get This is a legacy parameter. Use `ProjectionExpression` instead. For more information, see [AttributesToGet][1] in the *Amazon DynamoDB Developer Guide*. [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html @option options [Integer] :limit The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in `LastEvaluatedKey` to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed data set size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in `LastEvaluatedKey` to apply in a subsequent operation to continue the operation. For more information, see [Query and Scan][1] in the *Amazon DynamoDB Developer Guide*. [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html @option options [String] :select The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index. * `ALL_ATTRIBUTES` - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index DynamoDB will fetch the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required. * `ALL_PROJECTED_ATTRIBUTES` - Allowed only when querying an index. Retrieves all attributes that have been projected into the index. If the index is configured to project all attributes, this return value is equivalent to specifying `ALL_ATTRIBUTES`. * `COUNT` - Returns the number of matching items, rather than the matching items themselves. * `SPECIFIC_ATTRIBUTES` - Returns only the attributes listed in `AttributesToGet`. This return value is equivalent to specifying `AttributesToGet` without specifying any value for `Select`. If you query or scan a local secondary index and request only attributes that are projected into that index, the operation will read only the index and not the table. If any of the requested attributes are not projected into the local secondary index, DynamoDB will fetch each of these attributes from the parent table. This extra fetching incurs additional throughput cost and latency. If you query or scan a global secondary index, you can only request attributes that are projected into the index. Global secondary index queries cannot fetch attributes from the parent table. If neither `Select` nor `AttributesToGet` are specified, DynamoDB defaults to `ALL_ATTRIBUTES` when accessing a table, and `ALL_PROJECTED_ATTRIBUTES` when accessing an index. You cannot use both `Select` and `AttributesToGet` together in a single request, unless the value for `Select` is `SPECIFIC_ATTRIBUTES`. (This usage is equivalent to specifying `AttributesToGet` without any value for `Select`.) <note markdown="1"> If you use the `ProjectionExpression` parameter, then the value for `Select` can only be `SPECIFIC_ATTRIBUTES`. Any other value for `Select` will return an error. </note> @option options [Hash<String,Types::Condition>] :scan_filter This is a legacy parameter. Use `FilterExpression` instead. For more information, see [ScanFilter][1] in the *Amazon DynamoDB Developer Guide*. [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ScanFilter.html @option options [String] :conditional_operator This is a legacy parameter. Use `FilterExpression` instead. For more information, see [ConditionalOperator][1] in the *Amazon DynamoDB Developer Guide*. [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html @option options [Hash<String,Types::AttributeValue>] :exclusive_start_key The primary key of the first item that this operation will evaluate. Use the value that was returned for `LastEvaluatedKey` in the previous operation. The data type for `ExclusiveStartKey` must be String, Number or Binary. No set data types are allowed. In a parallel scan, a `Scan` request that includes `ExclusiveStartKey` must specify the same segment whose previous `Scan` returned the corresponding value of `LastEvaluatedKey`. @option options [String] :return_consumed_capacity Determines the level of detail about provisioned throughput consumption that is returned in the response: * `INDEXES` - The response includes the aggregate `ConsumedCapacity` for the operation, together with `ConsumedCapacity` for each table and secondary index that was accessed. Note that some operations, such as `GetItem` and `BatchGetItem`, do not access any indexes at all. In these cases, specifying `INDEXES` will only return `ConsumedCapacity` information for table(s). * `TOTAL` - The response includes only the aggregate `ConsumedCapacity` for the operation. * `NONE` - No `ConsumedCapacity` details are included in the response. @option options [Integer] :total_segments For a parallel `Scan` request, `TotalSegments` represents the total number of segments into which the `Scan` operation will be divided. The value of `TotalSegments` corresponds to the number of application workers that will perform the parallel scan. For example, if you want to use four application threads to scan a table or an index, specify a `TotalSegments` value of 4. The value for `TotalSegments` must be greater than or equal to 1, and less than or equal to 1000000. If you specify a `TotalSegments` value of 1, the `Scan` operation will be sequential rather than parallel. If you specify `TotalSegments`, you must also specify `Segment`. @option options [Integer] :segment For a parallel `Scan` request, `Segment` identifies an individual segment to be scanned by an application worker. Segment IDs are zero-based, so the first segment is always 0. For example, if you want to use four application threads to scan a table or an index, then the first thread specifies a `Segment` value of 0, the second thread specifies 1, and so on. The value of `LastEvaluatedKey` returned from a parallel `Scan` request must be used as `ExclusiveStartKey` with the same segment ID in a subsequent `Scan` operation. The value for `Segment` must be greater than or equal to 0, and less than the value provided for `TotalSegments`. If you provide `Segment`, you must also provide `TotalSegments`. @option options [String] :projection_expression A string that identifies one or more attributes to retrieve from the specified table or index. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas. If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result. For more information, see [Accessing Item Attributes][1] in the *Amazon DynamoDB Developer Guide*. [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html @option options [String] :filter_expression A string that contains conditions that DynamoDB applies after the `Scan` operation, but before the data is returned to you. Items that do not satisfy the `FilterExpression` criteria are not returned. <note markdown="1"> A `FilterExpression` is applied after the items have already been read; the process of filtering does not consume any additional read capacity units. </note> For more information, see [Filter Expressions][1] in the *Amazon DynamoDB Developer Guide*. [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#FilteringResults @option options [Hash<String,String>] :expression_attribute_names One or more substitution tokens for attribute names in an expression. The following are some use cases for using `ExpressionAttributeNames`\: * To access an attribute whose name conflicts with a DynamoDB reserved word. * To create a placeholder for repeating occurrences of an attribute name in an expression. * To prevent special characters in an attribute name from being misinterpreted in an expression. Use the **#** character in an expression to dereference an attribute name. For example, consider the following attribute name: * `Percentile` ^ The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see [Reserved Words][1] in the *Amazon DynamoDB Developer Guide*). To work around this, you could specify the following for `ExpressionAttributeNames`\: * `\{"#P":"Percentile"\}` ^ You could then use this substitution in an expression, as in this example: * `#P = :val` ^ <note markdown="1"> Tokens that begin with the **\:** character are *expression attribute values*, which are placeholders for the actual value at runtime. </note> For more information on expression attribute names, see [Accessing Item Attributes][2] in the *Amazon DynamoDB Developer Guide*. [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html [2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html @option options [Hash<String,Types::AttributeValue>] :expression_attribute_values One or more values that can be substituted in an expression. Use the **\:** (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the *ProductStatus* attribute was one of the following: `Available | Backordered | Discontinued` You would first need to specify `ExpressionAttributeValues` as follows: `\{ ":avail":\{"S":"Available"\}, ":back":\{"S":"Backordered"\}, ":disc":\{"S":"Discontinued"\} \}` You could then use these values in an expression, such as this: `ProductStatus IN (:avail, :back, :disc)` For more information on expression attribute values, see [Specifying Conditions][1] in the *Amazon DynamoDB Developer Guide*. [1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html @option options [Boolean] :consistent_read A Boolean value that determines the read consistency model during the scan: * If `ConsistentRead` is `false`, then the data returned from `Scan` might not contain the results from other recently completed write operations (PutItem, UpdateItem or DeleteItem). * If `ConsistentRead` is `true`, then all of the write operations that completed before the `Scan` began are guaranteed to be contained in the `Scan` response. The default setting for `ConsistentRead` is `false`. The `ConsistentRead` parameter is not supported on global secondary indexes. If you scan a global secondary index with `ConsistentRead` set to true, you will receive a `ValidationException`. @return [Types::ScanOutput]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/table.rb#L1670-L1674
train
Scan the table
[ 30522, 13366, 13594, 1006, 7047, 1027, 1063, 1065, 1007, 7047, 1027, 7047, 1012, 13590, 1006, 2795, 1035, 2171, 1024, 1030, 2171, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 13594, 1006, 7047, 1007, 24501, 2361, 1012, 2951, 2203, 102, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rails/rails
actionpack/lib/action_controller/metal/streaming.rb
ActionController.Streaming._render_template
def _render_template(options) if options.delete(:stream) Rack::Chunked::Body.new view_renderer.render_body(view_context, options) else super end end
ruby
def _render_template(options) if options.delete(:stream) Rack::Chunked::Body.new view_renderer.render_body(view_context, options) else super end end
[ "def", "_render_template", "(", "options", ")", "if", "options", ".", "delete", "(", ":stream", ")", "Rack", "::", "Chunked", "::", "Body", ".", "new", "view_renderer", ".", "render_body", "(", "view_context", ",", "options", ")", "else", "super", "end", "...
Call render_body if we are streaming instead of usual +render+.
[ "Call", "render_body", "if", "we", "are", "streaming", "instead", "of", "usual", "+", "render", "+", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_controller/metal/streaming.rb#L215-L221
train
Render the template
[ 30522, 13366, 1035, 17552, 1035, 23561, 1006, 7047, 1007, 2065, 7047, 1012, 3972, 12870, 1006, 1024, 5460, 1007, 14513, 1024, 1024, 20000, 2098, 1024, 1024, 2303, 1012, 2047, 3193, 1035, 17552, 2121, 1012, 17552, 1035, 2303, 1006, 3193, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
puppetlabs/bolt
lib/bolt_server/file_cache.rb
BoltServer.FileCache.update_file
def update_file(file_data) sha = file_data['sha256'] file_dir = create_cache_dir(file_data['sha256']) file_path = File.join(file_dir, File.basename(file_data['filename'])) if check_file(file_path, sha) @logger.debug("Using prexisting task file: #{file_path}") return file_path end @logger.debug("Queueing download for: #{file_path}") serial_execute { download_file(file_path, sha, file_data['uri']) } end
ruby
def update_file(file_data) sha = file_data['sha256'] file_dir = create_cache_dir(file_data['sha256']) file_path = File.join(file_dir, File.basename(file_data['filename'])) if check_file(file_path, sha) @logger.debug("Using prexisting task file: #{file_path}") return file_path end @logger.debug("Queueing download for: #{file_path}") serial_execute { download_file(file_path, sha, file_data['uri']) } end
[ "def", "update_file", "(", "file_data", ")", "sha", "=", "file_data", "[", "'sha256'", "]", "file_dir", "=", "create_cache_dir", "(", "file_data", "[", "'sha256'", "]", ")", "file_path", "=", "File", ".", "join", "(", "file_dir", ",", "File", ".", "basenam...
If the file doesn't exist or is invalid redownload it This downloads, validates and moves into place
[ "If", "the", "file", "doesn", "t", "exist", "or", "is", "invalid", "redownload", "it", "This", "downloads", "validates", "and", "moves", "into", "place" ]
50689a33699939d262ea7c822a4b24fd8c4f8d8a
https://github.com/puppetlabs/bolt/blob/50689a33699939d262ea7c822a4b24fd8c4f8d8a/lib/bolt_server/file_cache.rb#L155-L166
train
Update the file with the given data
[ 30522, 13366, 10651, 1035, 5371, 1006, 5371, 1035, 2951, 1007, 21146, 1027, 5371, 1035, 2951, 1031, 1005, 21146, 17788, 2575, 1005, 1033, 5371, 1035, 16101, 1027, 3443, 1035, 17053, 1035, 16101, 1006, 5371, 1035, 2951, 1031, 1005, 21146, 17...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_container_logs_deployed_on_node_with_http_info
def get_container_logs_deployed_on_node_with_http_info(node_name, application_id, service_manifest_name, code_package_name, tail:nil, previous:false, timeout:60, custom_headers:nil) get_container_logs_deployed_on_node_async(node_name, application_id, service_manifest_name, code_package_name, tail:tail, previous:previous, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def get_container_logs_deployed_on_node_with_http_info(node_name, application_id, service_manifest_name, code_package_name, tail:nil, previous:false, timeout:60, custom_headers:nil) get_container_logs_deployed_on_node_async(node_name, application_id, service_manifest_name, code_package_name, tail:tail, previous:previous, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "get_container_logs_deployed_on_node_with_http_info", "(", "node_name", ",", "application_id", ",", "service_manifest_name", ",", "code_package_name", ",", "tail", ":", "nil", ",", "previous", ":", "false", ",", "timeout", ":", "60", ",", "custom_headers", ":",...
Gets the container logs for container deployed on a Service Fabric node. Gets the container logs for container deployed on a Service Fabric node for the given code package. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. @param service_manifest_name [String] The name of a service manifest registered as part of an application type in a Service Fabric cluster. @param code_package_name [String] The name of code package specified in service manifest registered as part of an application type in a Service Fabric cluster. @param tail [String] Number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. @param previous [Boolean] Specifies whether to get container logs from exited/dead containers of the code package instance. @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", "container", "logs", "for", "container", "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#L17432-L17434
train
Gets the logs deployed on a node.
[ 30522, 13366, 2131, 1035, 11661, 1035, 15664, 1035, 7333, 1035, 2006, 1035, 13045, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 13045, 1035, 2171, 1010, 4646, 1035, 8909, 1010, 2326, 1035, 19676, 1035, 2171, 1010, 3642, 1035, 7427, 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_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.enable_partition_backup
def enable_partition_backup(partition_id, enable_backup_description, timeout:60, custom_headers:nil) response = enable_partition_backup_async(partition_id, enable_backup_description, timeout:timeout, custom_headers:custom_headers).value! nil end
ruby
def enable_partition_backup(partition_id, enable_backup_description, timeout:60, custom_headers:nil) response = enable_partition_backup_async(partition_id, enable_backup_description, timeout:timeout, custom_headers:custom_headers).value! nil end
[ "def", "enable_partition_backup", "(", "partition_id", ",", "enable_backup_description", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "response", "=", "enable_partition_backup_async", "(", "partition_id", ",", "enable_backup_description", ",", "tim...
Enables periodic backup of the stateful persisted partition. Enables periodic backup of stateful persisted partition. Each partition is backed up as per the specified backup policy description. In case the application or service, which is partition is part of, is already enabled for backup then this operation would override the policy being used to take the periodic backup of this partition. Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. @param partition_id The identity of the partition. @param enable_backup_description [EnableBackupDescription] Specifies the parameters for enabling backup. @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.
[ "Enables", "periodic", "backup", "of", "the", "stateful", "persisted", "partition", "." ]
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#L24730-L24733
train
Enables backup of the specified partition.
[ 30522, 13366, 9585, 1035, 13571, 1035, 10200, 1006, 13571, 1035, 8909, 1010, 9585, 1035, 10200, 1035, 6412, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 30524, 20346, 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, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/storage_accounts.rb
Azure::Storage::Mgmt::V2018_07_01.StorageAccounts.create_async
def create_async(resource_group_name, account_name, parameters, custom_headers:nil) # Send request promise = begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Storage::Mgmt::V2018_07_01::Models::StorageAccount.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
ruby
def create_async(resource_group_name, account_name, parameters, custom_headers:nil) # Send request promise = begin_create_async(resource_group_name, account_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Storage::Mgmt::V2018_07_01::Models::StorageAccount.mapper() parsed_response = @client.deserialize(result_mapper, parsed_response) end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
[ "def", "create_async", "(", "resource_group_name", ",", "account_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "# Send request", "promise", "=", "begin_create_async", "(", "resource_group_name", ",", "account_name", ",", "parameters", ",", "custom_...
@param resource_group_name [String] The name of the resource group within the user's subscription. The name is case insensitive. @param account_name [String] The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @param parameters [StorageAccountCreateParameters] The parameters to provide for the created account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Concurrent::Promise] promise which provides async access to http response.
[ "@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", "na...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-07-01/generated/azure_mgmt_storage/storage_accounts.rb#L168-L184
train
Creates a storage account.
[ 30522, 13366, 3443, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4070, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 1001, 4604, 5227, 4872, 1027, 4088, 1035, 3443, 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
runtime/ms_rest_azure/lib/ms_rest_azure/azure_service_client.rb
MsRestAzure.AzureServiceClient.get_async_with_custom_deserialization
def get_async_with_custom_deserialization(request, custom_deserialization_block) result = get_async_common(request) if !result.body.nil? && !custom_deserialization_block.nil? begin result.body = custom_deserialization_block.call(result.body) rescue Exception => e fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, http_response.body) end end result end
ruby
def get_async_with_custom_deserialization(request, custom_deserialization_block) result = get_async_common(request) if !result.body.nil? && !custom_deserialization_block.nil? begin result.body = custom_deserialization_block.call(result.body) rescue Exception => e fail MsRest::DeserializationError.new("Error occured in deserializing the response", e.message, e.backtrace, http_response.body) end end result end
[ "def", "get_async_with_custom_deserialization", "(", "request", ",", "custom_deserialization_block", ")", "result", "=", "get_async_common", "(", "request", ")", "if", "!", "result", ".", "body", ".", "nil?", "&&", "!", "custom_deserialization_block", ".", "nil?", "...
Retrieves data by given URL. @param request [MsRest::HttpOperationRequest] the URL. @param custom_deserialization_block [Proc] function to perform deserialization of the HTTP response. @return [MsRest::HttpOperationResponse] the response.
[ "Retrieves", "data", "by", "given", "URL", ".", "@param", "request", "[", "MsRest", "::", "HttpOperationRequest", "]", "the", "URL", ".", "@param", "custom_deserialization_block", "[", "Proc", "]", "function", "to", "perform", "deserialization", "of", "the", "HT...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/runtime/ms_rest_azure/lib/ms_rest_azure/azure_service_client.rb#L225-L237
train
Get the response body with custom deserialization
[ 30522, 13366, 2131, 1035, 2004, 6038, 2278, 1035, 2007, 1035, 7661, 1035, 4078, 11610, 22731, 1006, 5227, 1010, 7661, 1035, 4078, 11610, 22731, 1035, 3796, 1007, 2765, 1027, 2131, 1035, 2004, 6038, 2278, 1035, 2691, 1006, 5227, 1007, 2065, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/spring
lib/spring/json.rb
Spring.OkJson.tok
def tok(s) case s[0] when ?{ then ['{', s[0,1], s[0,1]] when ?} then ['}', s[0,1], s[0,1]] when ?: then [':', s[0,1], s[0,1]] when ?, then [',', s[0,1], s[0,1]] when ?[ then ['[', s[0,1], s[0,1]] when ?] then [']', s[0,1], s[0,1]] when ?n then nulltok(s) when ?t then truetok(s) when ?f then falsetok(s) when ?" then strtok(s) when Spc, ?\t, ?\n, ?\r then [:space, s[0,1], s[0,1]] else numtok(s) end end
ruby
def tok(s) case s[0] when ?{ then ['{', s[0,1], s[0,1]] when ?} then ['}', s[0,1], s[0,1]] when ?: then [':', s[0,1], s[0,1]] when ?, then [',', s[0,1], s[0,1]] when ?[ then ['[', s[0,1], s[0,1]] when ?] then [']', s[0,1], s[0,1]] when ?n then nulltok(s) when ?t then truetok(s) when ?f then falsetok(s) when ?" then strtok(s) when Spc, ?\t, ?\n, ?\r then [:space, s[0,1], s[0,1]] else numtok(s) end end
[ "def", "tok", "(", "s", ")", "case", "s", "[", "0", "]", "when", "?{", "then", "[", "'{'", ",", "s", "[", "0", ",", "1", "]", ",", "s", "[", "0", ",", "1", "]", "]", "when", "?}", "then", "[", "'}'", ",", "s", "[", "0", ",", "1", "]",...
Scans the first token in s and returns a 3-element list, or nil if s does not begin with a valid token. The first list element is one of '{', '}', ':', ',', '[', ']', :val, :str, and :space. The second element is the lexeme. The third element is the value of the token for :val and :str, otherwise it is the lexeme.
[ "Scans", "the", "first", "token", "in", "s", "and", "returns", "a", "3", "-", "element", "list", "or", "nil", "if", "s", "does", "not", "begin", "with", "a", "valid", "token", "." ]
e7a36afa436fcc59b6945f68dbc08f1076e65585
https://github.com/rails/spring/blob/e7a36afa436fcc59b6945f68dbc08f1076e65585/lib/spring/json.rb#L264-L280
train
toks a string
[ 30522, 13366, 2000, 2243, 1006, 1055, 1007, 2553, 1055, 1031, 1014, 1033, 2043, 1029, 1063, 2059, 1031, 1005, 1063, 1005, 1010, 1055, 1031, 1014, 1010, 1015, 1033, 1010, 1055, 1031, 1014, 1010, 1015, 1033, 1033, 2043, 1029, 1065, 2059, 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_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/api_issue.rb
Azure::ApiManagement::Mgmt::V2019_01_01.ApiIssue.list_by_service_as_lazy
def list_by_service_as_lazy(resource_group_name, service_name, api_id, filter:nil, expand_comments_attachments:nil, top:nil, skip:nil, custom_headers:nil) response = list_by_service_async(resource_group_name, service_name, api_id, filter:filter, expand_comments_attachments:expand_comments_attachments, top:top, skip:skip, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_service_next_async(next_page_link, custom_headers:custom_headers) end page end end
ruby
def list_by_service_as_lazy(resource_group_name, service_name, api_id, filter:nil, expand_comments_attachments:nil, top:nil, skip:nil, custom_headers:nil) response = list_by_service_async(resource_group_name, service_name, api_id, filter:filter, expand_comments_attachments:expand_comments_attachments, top:top, skip:skip, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_service_next_async(next_page_link, custom_headers:custom_headers) end page end end
[ "def", "list_by_service_as_lazy", "(", "resource_group_name", ",", "service_name", ",", "api_id", ",", "filter", ":", "nil", ",", "expand_comments_attachments", ":", "nil", ",", "top", ":", "nil", ",", "skip", ":", "nil", ",", "custom_headers", ":", "nil", ")"...
Lists all issues associated with the specified API. @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 identifier. Must be unique in the current API Management service instance. @param filter [String] | Field | Usage | Supported operators | Supported functions |</br>|-------------|-------------|-------------|-------------|</br>| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | </br>| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | </br>| state | filter | eq | | </br> @param expand_comments_attachments [Boolean] Expand the comment attachments. @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [IssueCollection] which provide lazy access to pages of the response.
[ "Lists", "all", "issues", "associated", "with", "the", "specified", "API", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/api_issue.rb#L876-L885
train
Gets all the image documents in an API.
[ 30522, 13366, 2862, 1035, 2011, 1035, 2326, 1035, 2004, 1035, 13971, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 30524, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 2011, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
decidim/decidim
decidim-core/app/helpers/decidim/map_helper.rb
Decidim.MapHelper.static_map_link
def static_map_link(resource, options = {}) return unless resource.geocoded? zoom = options[:zoom] || 17 latitude = resource.latitude longitude = resource.longitude map_url = "https://www.openstreetmap.org/?mlat=#{latitude}&mlon=#{longitude}#map=#{zoom}/#{latitude}/#{longitude}" link_to map_url, target: "_blank" do image_tag decidim.static_map_path(sgid: resource.to_sgid.to_s) end end
ruby
def static_map_link(resource, options = {}) return unless resource.geocoded? zoom = options[:zoom] || 17 latitude = resource.latitude longitude = resource.longitude map_url = "https://www.openstreetmap.org/?mlat=#{latitude}&mlon=#{longitude}#map=#{zoom}/#{latitude}/#{longitude}" link_to map_url, target: "_blank" do image_tag decidim.static_map_path(sgid: resource.to_sgid.to_s) end end
[ "def", "static_map_link", "(", "resource", ",", "options", "=", "{", "}", ")", "return", "unless", "resource", ".", "geocoded?", "zoom", "=", "options", "[", ":zoom", "]", "||", "17", "latitude", "=", "resource", ".", "latitude", "longitude", "=", "resourc...
Renders a link to openstreetmaps with the resource latitude and longitude. The link's content is a static map image. resource - A geolocalizable resource options - An optional hash of options (default: { zoom: 17 }) * zoom: A number to represent the zoom value of the map
[ "Renders", "a", "link", "to", "openstreetmaps", "with", "the", "resource", "latitude", "and", "longitude", ".", "The", "link", "s", "content", "is", "a", "static", "map", "image", "." ]
6e2b14e559a63088669904e3c5c49a5180700cf7
https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/map_helper.rb#L12-L24
train
Returns a static map link to a resource
[ 30522, 13366, 10763, 1035, 4949, 1035, 4957, 1006, 7692, 1010, 7047, 1027, 1063, 1065, 1007, 2709, 4983, 7692, 1012, 20248, 16044, 2094, 1029, 24095, 1027, 7047, 1031, 1024, 24095, 1033, 1064, 1064, 2459, 15250, 1027, 7692, 1012, 15250, 204...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
randym/axlsx
lib/axlsx/drawing/str_data.rb
Axlsx.StrData.data=
def data=(values=[]) @tag_name = values.first.is_a?(Cell) ? :strCache : :strLit values.each do |value| v = value.is_a?(Cell) ? value.value : value @pt << @type.new(:v => v) end end
ruby
def data=(values=[]) @tag_name = values.first.is_a?(Cell) ? :strCache : :strLit values.each do |value| v = value.is_a?(Cell) ? value.value : value @pt << @type.new(:v => v) end end
[ "def", "data", "=", "(", "values", "=", "[", "]", ")", "@tag_name", "=", "values", ".", "first", ".", "is_a?", "(", "Cell", ")", "?", ":strCache", ":", ":strLit", "values", ".", "each", "do", "|", "value", "|", "v", "=", "value", ".", "is_a?", "(...
creates a new StrVal object @option options [Array] :data @option options [String] :tag_name Creates the val objects for this data set. I am not overly confident this is going to play nicely with time and data types. @param [Array] values An array of cells or values.
[ "creates", "a", "new", "StrVal", "object" ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/str_data.rb#L22-L28
train
Create a new object with the given data
[ 30522, 13366, 2951, 1027, 1006, 5300, 1027, 1031, 1033, 1007, 1030, 6415, 1035, 2171, 1027, 5300, 1012, 2034, 1012, 2003, 1035, 1037, 1029, 1006, 3526, 1007, 1029, 1024, 2358, 18992, 5403, 1024, 1024, 2358, 12190, 4183, 5300, 1012, 2169, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/user.rb
Azure::ApiManagement::Mgmt::V2018_01_01.User.get_shared_access_token_with_http_info
def get_shared_access_token_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers:nil) get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers:custom_headers).value! end
ruby
def get_shared_access_token_with_http_info(resource_group_name, service_name, uid, parameters, custom_headers:nil) get_shared_access_token_async(resource_group_name, service_name, uid, parameters, custom_headers:custom_headers).value! end
[ "def", "get_shared_access_token_with_http_info", "(", "resource_group_name", ",", "service_name", ",", "uid", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "get_shared_access_token_async", "(", "resource_group_name", ",", "service_name", ",", "uid", ",", "p...
Gets the Shared Access Authorization Token for the User. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param uid [String] User identifier. Must be unique in the current API Management service instance. @param parameters [UserTokenParameters] Create Authorization Token parameters. @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", "Shared", "Access", "Authorization", "Token", "for", "the", "User", "." ]
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/user.rb#L979-L981
train
Gets the shared access token for the specified App Service plan.
[ 30522, 13366, 2131, 1035, 4207, 1035, 3229, 1035, 19204, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 21318, 2094, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rails/rails
activesupport/lib/active_support/core_ext/marshal.rb
ActiveSupport.MarshalWithAutoloading.load
def load(source, proc = nil) super(source, proc) rescue ArgumentError, NameError => exc if exc.message.match(%r|undefined class/module (.+?)(?:::)?\z|) # try loading the class/module loaded = $1.constantize raise unless $1 == loaded.name # if it is an IO we need to go back to read the object source.rewind if source.respond_to?(:rewind) retry else raise exc end end
ruby
def load(source, proc = nil) super(source, proc) rescue ArgumentError, NameError => exc if exc.message.match(%r|undefined class/module (.+?)(?:::)?\z|) # try loading the class/module loaded = $1.constantize raise unless $1 == loaded.name # if it is an IO we need to go back to read the object source.rewind if source.respond_to?(:rewind) retry else raise exc end end
[ "def", "load", "(", "source", ",", "proc", "=", "nil", ")", "super", "(", "source", ",", "proc", ")", "rescue", "ArgumentError", ",", "NameError", "=>", "exc", "if", "exc", ".", "message", ".", "match", "(", "%r|", "\\z", "|", ")", "# try loading the c...
:nodoc:
[ ":", "nodoc", ":" ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/core_ext/marshal.rb#L5-L20
train
Load the object from a source
[ 30522, 13366, 7170, 1006, 3120, 1010, 4013, 2278, 1027, 9152, 2140, 1007, 3565, 1006, 3120, 1010, 4013, 2278, 1007, 5343, 6685, 2121, 29165, 1010, 2171, 2121, 29165, 1027, 1028, 4654, 2278, 2065, 4654, 2278, 1012, 4471, 1012, 2674, 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...
NetSweet/netsuite
lib/netsuite/utilities.rb
NetSuite.Utilities.normalize_time_to_netsuite_date
def normalize_time_to_netsuite_date(unix_timestamp) # convert to date to eliminate hr/min/sec time = Time.at(unix_timestamp). utc. to_date. to_datetime # tzinfo allows us to determine the dst status of the time being passed in # NetSuite requires that the time be passed to the API with the PDT TZ offset # of the time passed in (i.e. not the current TZ offset of PDT) if defined?(TZInfo) # if no version is defined, less than 2.0 # https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md#added if !defined?(TZInfo::VERSION) # https://stackoverflow.com/questions/2927111/ruby-get-time-in-given-timezone offset = TZInfo::Timezone.get("America/Los_Angeles").period_for_utc(time).utc_total_offset_rational time = time.new_offset(offset) else time = TZInfo::Timezone.get("America/Los_Angeles").utc_to_local(time) offset = time.offset end else # if tzinfo is not installed, let's give it our best guess: -7 offset = Rational(-7, 24) time = time.new_offset("-07:00") end time = (time + (offset * -1)) time.iso8601 end
ruby
def normalize_time_to_netsuite_date(unix_timestamp) # convert to date to eliminate hr/min/sec time = Time.at(unix_timestamp). utc. to_date. to_datetime # tzinfo allows us to determine the dst status of the time being passed in # NetSuite requires that the time be passed to the API with the PDT TZ offset # of the time passed in (i.e. not the current TZ offset of PDT) if defined?(TZInfo) # if no version is defined, less than 2.0 # https://github.com/tzinfo/tzinfo/blob/master/CHANGES.md#added if !defined?(TZInfo::VERSION) # https://stackoverflow.com/questions/2927111/ruby-get-time-in-given-timezone offset = TZInfo::Timezone.get("America/Los_Angeles").period_for_utc(time).utc_total_offset_rational time = time.new_offset(offset) else time = TZInfo::Timezone.get("America/Los_Angeles").utc_to_local(time) offset = time.offset end else # if tzinfo is not installed, let's give it our best guess: -7 offset = Rational(-7, 24) time = time.new_offset("-07:00") end time = (time + (offset * -1)) time.iso8601 end
[ "def", "normalize_time_to_netsuite_date", "(", "unix_timestamp", ")", "# convert to date to eliminate hr/min/sec", "time", "=", "Time", ".", "at", "(", "unix_timestamp", ")", ".", "utc", ".", "to_date", ".", "to_datetime", "# tzinfo allows us to determine the dst status of th...
http://mikebian.co/notes-on-dates-timezones-with-netsuites-suitetalk-api/ https://wyeworks.com/blog/2016/6/22/behavior-changes-in-ruby-2.4 https://github.com/rails/rails/commit/c9c5788a527b70d7f983e2b4b47e3afd863d9f48 assumes UTC0 unix timestamp
[ "http", ":", "//", "mikebian", ".", "co", "/", "notes", "-", "on", "-", "dates", "-", "timezones", "-", "with", "-", "netsuites", "-", "suitetalk", "-", "api", "/", "https", ":", "//", "wyeworks", ".", "com", "/", "blog", "/", "2016", "/", "6", "...
9eb47854f54a801a55e0cc4ed1c3d4229d198e42
https://github.com/NetSweet/netsuite/blob/9eb47854f54a801a55e0cc4ed1c3d4229d198e42/lib/netsuite/utilities.rb#L269-L299
train
Converts a unix timestamp to a NetSuite date
[ 30522, 13366, 3671, 4697, 1035, 2051, 1035, 2000, 1035, 16996, 14663, 2063, 1035, 3058, 1006, 19998, 1035, 2335, 15464, 2361, 1007, 1001, 10463, 2000, 3058, 2000, 11027, 17850, 1013, 8117, 1013, 10819, 2051, 1027, 2051, 1012, 2012, 1006, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.create_with_http_info
def create_with_http_info(resource_group_name, account_name, container_name, blob_container, custom_headers:nil) create_async(resource_group_name, account_name, container_name, blob_container, custom_headers:custom_headers).value! end
ruby
def create_with_http_info(resource_group_name, account_name, container_name, blob_container, custom_headers:nil) create_async(resource_group_name, account_name, container_name, blob_container, custom_headers:custom_headers).value! end
[ "def", "create_with_http_info", "(", "resource_group_name", ",", "account_name", ",", "container_name", ",", "blob_container", ",", "custom_headers", ":", "nil", ")", "create_async", "(", "resource_group_name", ",", "account_name", ",", "container_name", ",", "blob_cont...
Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. @param resource_group_name [String] The name of the resource group within the user's subscription. The name is case insensitive. @param account_name [String] The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @param container_name [String] The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. @param blob_container [BlobContainer] Properties of the blob container to create. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Creates", "a", "new", "container", "under", "the", "specified", "account", "as", "described", "by", "request", "body", ".", "The", "container", "resource", "includes", "metadata", "and", "properties", "for", "that", "container", ".", "It", "does", "not", "inc...
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#L186-L188
train
Creates a new container in the specified container.
[ 30522, 13366, 3443, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4070, 1035, 2171, 1010, 11661, 1035, 2171, 1010, 1038, 4135, 2497, 1035, 11661, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 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...
randym/axlsx
lib/axlsx/drawing/view_3D.rb
Axlsx.View3D.to_xml_string
def to_xml_string(str = '') str << '<c:view3D>' %w(rot_x h_percent rot_y depth_percent r_ang_ax perspective).each do |key| str << element_for_attribute(key, 'c') end str << '</c:view3D>' end
ruby
def to_xml_string(str = '') str << '<c:view3D>' %w(rot_x h_percent rot_y depth_percent r_ang_ax perspective).each do |key| str << element_for_attribute(key, 'c') end str << '</c:view3D>' end
[ "def", "to_xml_string", "(", "str", "=", "''", ")", "str", "<<", "'<c:view3D>'", "%w(", "rot_x", "h_percent", "rot_y", "depth_percent", "r_ang_ax", "perspective", ")", ".", "each", "do", "|", "key", "|", "str", "<<", "element_for_attribute", "(", "key", ",",...
DataTypeValidator.validate "#{self.class}.perspective", [Integer], v, lambda {|arg| arg >= 0 && arg <= 240 }; @perspective = v; end Serializes the object @param [String] str @return [String]
[ "DataTypeValidator", ".", "validate", "#", "{", "self", ".", "class", "}", ".", "perspective", "[", "Integer", "]", "v", "lambda", "{", "|arg|", "arg", ">", "=", "0", "&&", "arg", "<", "=", "240", "}", ";" ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/view_3D.rb#L99-L105
train
Returns the XML string for this view3D.
[ 30522, 13366, 2000, 1035, 20950, 1035, 5164, 1006, 2358, 2099, 1027, 1005, 1005, 1007, 2358, 2099, 1026, 1026, 1005, 1026, 1039, 1024, 3193, 29097, 1028, 1005, 1003, 1059, 1006, 18672, 1035, 1060, 1044, 1035, 3867, 18672, 1035, 1061, 5995, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.list_hub_schemas_with_http_info
def list_hub_schemas_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers:nil) list_hub_schemas_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers:custom_headers).value! end
ruby
def list_hub_schemas_with_http_info(resource_group_name, server_name, database_name, sync_group_name, custom_headers:nil) list_hub_schemas_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers:custom_headers).value! end
[ "def", "list_hub_schemas_with_http_info", "(", "resource_group_name", ",", "server_name", ",", "database_name", ",", "sync_group_name", ",", "custom_headers", ":", "nil", ")", "list_hub_schemas_async", "(", "resource_group_name", ",", "server_name", ",", "database_name", ...
Gets a collection of hub database schemas. @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. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Gets", "a", "collection", "of", "hub", "database", "schemas", "." ]
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#L201-L203
train
Gets the list of hub schemas for the specified database.
[ 30522, 13366, 2862, 1035, 9594, 1035, 8040, 28433, 2015, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 8241, 1035, 2171, 1010, 7809, 1035, 2171, 1010, 26351, 1035, 2177, 1035, 2171, 1010, 7661, 1035, 20346, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
meew0/discordrb
lib/discordrb/data/user.rb
Discordrb.User.await
def await(key, attributes = {}, &block) @bot.add_await(key, Discordrb::Events::MessageEvent, { from: @id }.merge(attributes), &block) end
ruby
def await(key, attributes = {}, &block) @bot.add_await(key, Discordrb::Events::MessageEvent, { from: @id }.merge(attributes), &block) end
[ "def", "await", "(", "key", ",", "attributes", "=", "{", "}", ",", "&", "block", ")", "@bot", ".", "add_await", "(", "key", ",", "Discordrb", "::", "Events", "::", "MessageEvent", ",", "{", "from", ":", "@id", "}", ".", "merge", "(", "attributes", ...
Add an await for a message from this user. Specifically, this adds a global await for a MessageEvent with this user's ID as a :from attribute. @see Bot#add_await
[ "Add", "an", "await", "for", "a", "message", "from", "this", "user", ".", "Specifically", "this", "adds", "a", "global", "await", "for", "a", "MessageEvent", "with", "this", "user", "s", "ID", "as", "a", ":", "from", "attribute", "." ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/user.rb#L139-L141
train
Add a await event to the message.
[ 30522, 13366, 26751, 1006, 3145, 1010, 12332, 1027, 1063, 1065, 1010, 1004, 3796, 1007, 1030, 28516, 1012, 5587, 1035, 26751, 1006, 3145, 1010, 12532, 4103, 15185, 1024, 1024, 2824, 1024, 1024, 4471, 18697, 3372, 1010, 1063, 2013, 1024, 103...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
meew0/discordrb
lib/discordrb/data/server.rb
Discordrb.Server.icon=
def icon=(icon) if icon.respond_to? :read icon_string = 'data:image/jpg;base64,' icon_string += Base64.strict_encode64(icon.read) update_server_data(icon_id: icon_string) else update_server_data(icon_id: icon) end end
ruby
def icon=(icon) if icon.respond_to? :read icon_string = 'data:image/jpg;base64,' icon_string += Base64.strict_encode64(icon.read) update_server_data(icon_id: icon_string) else update_server_data(icon_id: icon) end end
[ "def", "icon", "=", "(", "icon", ")", "if", "icon", ".", "respond_to?", ":read", "icon_string", "=", "'data:image/jpg;base64,'", "icon_string", "+=", "Base64", ".", "strict_encode64", "(", "icon", ".", "read", ")", "update_server_data", "(", "icon_id", ":", "i...
Sets the server's icon. @param icon [String, #read] The new icon, in base64-encoded JPG format.
[ "Sets", "the", "server", "s", "icon", "." ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/server.rb#L623-L631
train
Update the image icon
[ 30522, 13366, 12696, 1027, 1006, 12696, 1007, 2065, 12696, 1012, 6869, 1035, 2000, 1029, 1024, 3191, 12696, 1035, 5164, 1027, 1005, 2951, 1024, 3746, 1013, 16545, 2290, 1025, 2918, 21084, 1010, 1005, 12696, 1035, 5164, 1009, 1027, 2918, 210...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hashicorp/vault-ruby
lib/vault/api/auth_token.rb
Vault.AuthToken.lookup
def lookup(token, options = {}) headers = extract_headers!(options) json = client.post("/v1/auth/token/lookup", JSON.fast_generate( token: token, ), headers) return Secret.decode(json) end
ruby
def lookup(token, options = {}) headers = extract_headers!(options) json = client.post("/v1/auth/token/lookup", JSON.fast_generate( token: token, ), headers) return Secret.decode(json) end
[ "def", "lookup", "(", "token", ",", "options", "=", "{", "}", ")", "headers", "=", "extract_headers!", "(", "options", ")", "json", "=", "client", ".", "post", "(", "\"/v1/auth/token/lookup\"", ",", "JSON", ".", "fast_generate", "(", "token", ":", "token",...
Lookup information about the current token. @example Vault.auth_token.lookup("abcd-...") #=> #<Vault::Secret lease_id=""> @param [String] token @param [Hash] options @return [Secret]
[ "Lookup", "information", "about", "the", "current", "token", "." ]
02f0532a802ba1a2a0d8703a4585dab76eb9d864
https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/auth_token.rb#L111-L117
train
Lookup a token
[ 30522, 13366, 2298, 6279, 1006, 19204, 1010, 7047, 1027, 1063, 1065, 1007, 20346, 2015, 1027, 14817, 1035, 20346, 2015, 999, 1006, 7047, 1007, 1046, 3385, 1027, 7396, 1012, 2695, 1006, 1000, 1013, 1058, 2487, 1013, 8740, 2705, 1013, 19204, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-core/lib/aws-sdk-core/client_stubs.rb
Aws.ClientStubs.api_requests
def api_requests(options = {}) if config.stub_responses if options[:exclude_presign] @api_requests.reject {|req| req[:context][:presigned_url] } else @api_requests end else msg = 'This method is only implemented for stubbed clients, and is ' msg << 'available when you enable stubbing in the constructor with `stub_responses: true`' raise NotImplementedError.new(msg) end end
ruby
def api_requests(options = {}) if config.stub_responses if options[:exclude_presign] @api_requests.reject {|req| req[:context][:presigned_url] } else @api_requests end else msg = 'This method is only implemented for stubbed clients, and is ' msg << 'available when you enable stubbing in the constructor with `stub_responses: true`' raise NotImplementedError.new(msg) end end
[ "def", "api_requests", "(", "options", "=", "{", "}", ")", "if", "config", ".", "stub_responses", "if", "options", "[", ":exclude_presign", "]", "@api_requests", ".", "reject", "{", "|", "req", "|", "req", "[", ":context", "]", "[", ":presigned_url", "]", ...
Allows you to access all of the requests that the stubbed client has made @params [Boolean] exclude_presign Setting to true for filtering out not sent requests from generating presigned urls. Default to false. @return [Array] Returns an array of the api requests made, each request object contains the :operation_name, :params, and :context of the request. @raise [NotImplementedError] Raises `NotImplementedError` when the client is not stubbed
[ "Allows", "you", "to", "access", "all", "of", "the", "requests", "that", "the", "stubbed", "client", "has", "made" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-core/lib/aws-sdk-core/client_stubs.rb#L192-L204
train
Returns an array of api requests for the current request
[ 30522, 13366, 17928, 1035, 11186, 1006, 7047, 1027, 1063, 1065, 1007, 2065, 9530, 8873, 2290, 1012, 24646, 2497, 1035, 10960, 2065, 7047, 1031, 1024, 23329, 1035, 3653, 5332, 16206, 1033, 1030, 17928, 1035, 11186, 1012, 15454, 1063, 1064, 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_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflows.rb
Azure::Logic::Mgmt::V2016_06_01.Workflows.list_swagger
def list_swagger(resource_group_name, workflow_name, custom_headers:nil) response = list_swagger_async(resource_group_name, workflow_name, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_swagger(resource_group_name, workflow_name, custom_headers:nil) response = list_swagger_async(resource_group_name, workflow_name, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_swagger", "(", "resource_group_name", ",", "workflow_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_swagger_async", "(", "resource_group_name", ",", "workflow_name", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "res...
Gets an OpenAPI definition for the workflow. @param resource_group_name [String] The resource group name. @param workflow_name [String] The workflow name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Object] operation results.
[ "Gets", "an", "OpenAPI", "definition", "for", "the", "workflow", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflows.rb#L977-L980
train
Gets the swagger for a workflow.
[ 30522, 13366, 2862, 1035, 25430, 27609, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2147, 12314, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 25430, 27609, 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...
sds/haml-lint
lib/haml_lint/linter/instance_variables.rb
HamlLint.Linter::InstanceVariables.visit_tag
def visit_tag(node) return unless enabled? visit_script(node) || if node.parsed_attributes.contains_instance_variables? record_lint(node, "Avoid using instance variables in #{file_types} views") end end
ruby
def visit_tag(node) return unless enabled? visit_script(node) || if node.parsed_attributes.contains_instance_variables? record_lint(node, "Avoid using instance variables in #{file_types} views") end end
[ "def", "visit_tag", "(", "node", ")", "return", "unless", "enabled?", "visit_script", "(", "node", ")", "||", "if", "node", ".", "parsed_attributes", ".", "contains_instance_variables?", "record_lint", "(", "node", ",", "\"Avoid using instance variables in #{file_types}...
Checks for instance variables in tag nodes when the linter is enabled. @param [HamlLint::Tree:TagNode] @return [void]
[ "Checks", "for", "instance", "variables", "in", "tag", "nodes", "when", "the", "linter", "is", "enabled", "." ]
024c773667e54cf88db938c2b368977005d70ee8
https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/linter/instance_variables.rb#L39-L46
train
Visit a tag
[ 30522, 13366, 3942, 1035, 6415, 1006, 13045, 1007, 2709, 4983, 9124, 1029, 3942, 1035, 5896, 1006, 13045, 1007, 1064, 1064, 2065, 13045, 1012, 11968, 6924, 1035, 12332, 1012, 3397, 1035, 6013, 1035, 10857, 1029, 2501, 1035, 11409, 2102, 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...
hashicorp/vagrant
lib/vagrant/box.rb
Vagrant.Box.repackage
def repackage(path) @logger.debug("Repackaging box '#{@name}' to: #{path}") Util::SafeChdir.safe_chdir(@directory) do # Find all the files in our current directory and tar it up! files = Dir.glob(File.join(".", "**", "*")).select { |f| File.file?(f) } # Package! Util::Subprocess.execute("bsdtar", "-czf", path.to_s, *files) end @logger.info("Repackaged box '#{@name}' successfully: #{path}") true end
ruby
def repackage(path) @logger.debug("Repackaging box '#{@name}' to: #{path}") Util::SafeChdir.safe_chdir(@directory) do # Find all the files in our current directory and tar it up! files = Dir.glob(File.join(".", "**", "*")).select { |f| File.file?(f) } # Package! Util::Subprocess.execute("bsdtar", "-czf", path.to_s, *files) end @logger.info("Repackaged box '#{@name}' successfully: #{path}") true end
[ "def", "repackage", "(", "path", ")", "@logger", ".", "debug", "(", "\"Repackaging box '#{@name}' to: #{path}\"", ")", "Util", "::", "SafeChdir", ".", "safe_chdir", "(", "@directory", ")", "do", "# Find all the files in our current directory and tar it up!", "files", "=",...
This repackages this box and outputs it to the given path. @param [Pathname] path The full path (filename included) of where to output this box. @return [Boolean] true if this succeeds.
[ "This", "repackages", "this", "box", "and", "outputs", "it", "to", "the", "given", "path", "." ]
c22a145c59790c098f95d50141d9afb48e1ef55f
https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/box.rb#L199-L213
train
Repack the box
[ 30522, 13366, 16360, 8684, 4270, 1006, 4130, 1007, 1030, 8833, 4590, 1012, 2139, 8569, 2290, 1006, 1000, 16360, 8684, 16594, 3482, 1005, 1001, 1063, 1030, 2171, 1065, 1005, 2000, 1024, 1001, 1063, 4130, 1065, 1000, 1007, 21183, 4014, 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...
sds/haml-lint
lib/haml_lint/cli.rb
HamlLint.CLI.print_available_reporters
def print_available_reporters log.info 'Available reporters:' HamlLint::Reporter.available.map(&:cli_name).sort.each do |reporter_name| log.log " - #{reporter_name}" end end
ruby
def print_available_reporters log.info 'Available reporters:' HamlLint::Reporter.available.map(&:cli_name).sort.each do |reporter_name| log.log " - #{reporter_name}" end end
[ "def", "print_available_reporters", "log", ".", "info", "'Available reporters:'", "HamlLint", "::", "Reporter", ".", "available", ".", "map", "(", ":cli_name", ")", ".", "sort", ".", "each", "do", "|", "reporter_name", "|", "log", ".", "log", "\" - #{reporter_na...
Outputs a list of currently available reporters.
[ "Outputs", "a", "list", "of", "currently", "available", "reporters", "." ]
024c773667e54cf88db938c2b368977005d70ee8
https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/cli.rb#L127-L133
train
Print the available reporters
[ 30522, 13366, 6140, 1035, 2800, 1035, 12060, 8833, 1012, 18558, 1005, 2800, 12060, 1024, 1005, 10654, 21202, 2102, 1024, 1024, 6398, 1012, 2800, 1012, 4949, 1006, 1004, 1024, 18856, 2072, 1035, 2171, 1007, 1012, 4066, 1012, 2169, 2079, 1064...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_monitor/lib/2017-04-01/generated/azure_mgmt_monitor/activity_log_alerts.rb
Azure::Monitor::Mgmt::V2017_04_01.ActivityLogAlerts.update_with_http_info
def update_with_http_info(resource_group_name, activity_log_alert_name, activity_log_alert_patch, custom_headers:nil) update_async(resource_group_name, activity_log_alert_name, activity_log_alert_patch, custom_headers:custom_headers).value! end
ruby
def update_with_http_info(resource_group_name, activity_log_alert_name, activity_log_alert_patch, custom_headers:nil) update_async(resource_group_name, activity_log_alert_name, activity_log_alert_patch, custom_headers:custom_headers).value! end
[ "def", "update_with_http_info", "(", "resource_group_name", ",", "activity_log_alert_name", ",", "activity_log_alert_patch", ",", "custom_headers", ":", "nil", ")", "update_async", "(", "resource_group_name", ",", "activity_log_alert_name", ",", "activity_log_alert_patch", ",...
Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. @param resource_group_name [String] The name of the resource group. @param activity_log_alert_name [String] The name of the activity log alert. @param activity_log_alert_patch [ActivityLogAlertPatchBody] Parameters supplied to the operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Updates", "an", "existing", "ActivityLogAlertResource", "s", "tags", ".", "To", "update", "other", "fields", "use", "the", "CreateOrUpdate", "method", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_monitor/lib/2017-04-01/generated/azure_mgmt_monitor/activity_log_alerts.rb#L344-L346
train
Updates an existing Activity Log Alert.
[ 30522, 13366, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4023, 1035, 8833, 1035, 9499, 1035, 2171, 1010, 4023, 1035, 8833, 1035, 9499, 1035, 8983, 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...
puppetlabs/pdk
lib/pdk/answer_file.rb
PDK.AnswerFile.save_to_disk
def save_to_disk FileUtils.mkdir_p(File.dirname(answer_file_path)) write_file(answer_file_path, JSON.pretty_generate(answers)) rescue SystemCallError, IOError => e raise PDK::CLI::FatalError, _("Unable to write '%{file}': %{msg}") % { file: answer_file_path, msg: e.message, } end
ruby
def save_to_disk FileUtils.mkdir_p(File.dirname(answer_file_path)) write_file(answer_file_path, JSON.pretty_generate(answers)) rescue SystemCallError, IOError => e raise PDK::CLI::FatalError, _("Unable to write '%{file}': %{msg}") % { file: answer_file_path, msg: e.message, } end
[ "def", "save_to_disk", "FileUtils", ".", "mkdir_p", "(", "File", ".", "dirname", "(", "answer_file_path", ")", ")", "write_file", "(", "answer_file_path", ",", "JSON", ".", "pretty_generate", "(", "answers", ")", ")", "rescue", "SystemCallError", ",", "IOError",...
Save the in memory answer set to the answer file on disk. @raise [PDK::CLI::FatalError] if the answer file can not be written to.
[ "Save", "the", "in", "memory", "answer", "set", "to", "the", "answer", "file", "on", "disk", "." ]
0d864aff62ffef04b5104addf399d0476afd71e7
https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/answer_file.rb#L110-L119
train
Save the answers to disk
[ 30522, 13366, 3828, 1035, 2000, 1035, 9785, 5371, 21823, 4877, 1012, 12395, 4305, 2099, 1035, 1052, 1006, 5371, 1012, 16101, 18442, 1006, 3437, 1035, 5371, 1035, 4130, 1007, 1007, 4339, 1035, 5371, 1006, 3437, 1035, 5371, 1035, 4130, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_event_hub/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb
Azure::EventHub::Mgmt::V2018_01_01_preview.Namespaces.delete_virtual_network_rule
def delete_virtual_network_rule(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:nil) response = delete_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:custom_headers).value! nil end
ruby
def delete_virtual_network_rule(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:nil) response = delete_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, custom_headers:custom_headers).value! nil end
[ "def", "delete_virtual_network_rule", "(", "resource_group_name", ",", "namespace_name", ",", "virtual_network_rule_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "delete_virtual_network_rule_async", "(", "resource_group_name", ",", "namespace_name", ",", "...
Deletes an VirtualNetworkRule 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 virtual_network_rule_name [String] The Virtual Network Rule name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Deletes", "an", "VirtualNetworkRule", "for", "a", "Namespace", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_hub/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb#L1161-L1164
train
Deletes the specified virtual network rule.
[ 30522, 13366, 3972, 12870, 1035, 7484, 1035, 2897, 1035, 3627, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 3415, 15327, 1035, 2171, 1010, 7484, 1035, 2897, 1035, 3627, 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...
jekyll/jekyll
lib/jekyll/utils.rb
Jekyll.Utils.deep_merge_hashes!
def deep_merge_hashes!(target, overwrite) merge_values(target, overwrite) merge_default_proc(target, overwrite) duplicate_frozen_values(target) target end
ruby
def deep_merge_hashes!(target, overwrite) merge_values(target, overwrite) merge_default_proc(target, overwrite) duplicate_frozen_values(target) target end
[ "def", "deep_merge_hashes!", "(", "target", ",", "overwrite", ")", "merge_values", "(", "target", ",", "overwrite", ")", "merge_default_proc", "(", "target", ",", "overwrite", ")", "duplicate_frozen_values", "(", "target", ")", "target", "end" ]
Merges a master hash with another hash, recursively. master_hash - the "parent" hash whose values will be overridden other_hash - the other hash whose values will be persisted after the merge This code was lovingly stolen from some random gem: http://gemjack.com/gems/tartan-0.1.1/classes/Hash.html Thanks to whoever made it.
[ "Merges", "a", "master", "hash", "with", "another", "hash", "recursively", "." ]
fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b
https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/utils.rb#L41-L47
train
Merge hashes with the target hash.
[ 30522, 13366, 2784, 1035, 13590, 1035, 23325, 2229, 999, 1006, 4539, 1010, 2058, 26373, 1007, 13590, 1035, 5300, 1006, 4539, 1010, 2058, 26373, 1007, 13590, 1035, 12398, 1035, 4013, 2278, 1006, 4539, 1010, 2058, 26373, 1007, 24473, 1035, 77...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
phusion/passenger
src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb
PhusionPassenger.LoaderSharedHelpers.init
def init(main_app) @main_app = main_app options = read_startup_arguments # We don't dump PATH info because at this point it's # unlikely to be changed. dump_ruby_environment check_rvm_using_wrapper_script(options) PhusionPassenger.require_passenger_lib 'native_support' if defined?(NativeSupport) NativeSupport.disable_stdio_buffering end PhusionPassenger.require_passenger_lib 'constants' PhusionPassenger.require_passenger_lib 'public_api' PhusionPassenger.require_passenger_lib 'debug_logging' PhusionPassenger.require_passenger_lib 'platform_info/ruby' PhusionPassenger.require_passenger_lib 'platform_info/operating_system' PhusionPassenger.require_passenger_lib 'utils/shellwords' PhusionPassenger.require_passenger_lib 'ruby_core_enhancements' PhusionPassenger.require_passenger_lib 'ruby_core_io_enhancements' PhusionPassenger.require_passenger_lib 'request_handler' PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension' RequestHandler::ThreadHandler.send(:include, Rack::ThreadHandlerExtension) Thread.main[:name] = "Main thread" load_macos_foundation options rescue Exception => e record_journey_step_end('SUBPROCESS_WRAPPER_PREPARATION', 'STEP_ERRORED') record_and_print_exception(e) exit exit_code_for_exception(e) end
ruby
def init(main_app) @main_app = main_app options = read_startup_arguments # We don't dump PATH info because at this point it's # unlikely to be changed. dump_ruby_environment check_rvm_using_wrapper_script(options) PhusionPassenger.require_passenger_lib 'native_support' if defined?(NativeSupport) NativeSupport.disable_stdio_buffering end PhusionPassenger.require_passenger_lib 'constants' PhusionPassenger.require_passenger_lib 'public_api' PhusionPassenger.require_passenger_lib 'debug_logging' PhusionPassenger.require_passenger_lib 'platform_info/ruby' PhusionPassenger.require_passenger_lib 'platform_info/operating_system' PhusionPassenger.require_passenger_lib 'utils/shellwords' PhusionPassenger.require_passenger_lib 'ruby_core_enhancements' PhusionPassenger.require_passenger_lib 'ruby_core_io_enhancements' PhusionPassenger.require_passenger_lib 'request_handler' PhusionPassenger.require_passenger_lib 'rack/thread_handler_extension' RequestHandler::ThreadHandler.send(:include, Rack::ThreadHandlerExtension) Thread.main[:name] = "Main thread" load_macos_foundation options rescue Exception => e record_journey_step_end('SUBPROCESS_WRAPPER_PREPARATION', 'STEP_ERRORED') record_and_print_exception(e) exit exit_code_for_exception(e) end
[ "def", "init", "(", "main_app", ")", "@main_app", "=", "main_app", "options", "=", "read_startup_arguments", "# We don't dump PATH info because at this point it's", "# unlikely to be changed.", "dump_ruby_environment", "check_rvm_using_wrapper_script", "(", "options", ")", "Phusi...
To be called by the (pre)loader as soon as possible.
[ "To", "be", "called", "by", "the", "(", "pre", ")", "loader", "as", "soon", "as", "possible", "." ]
970964b53e0ba86959acdf40f06c99b0c4a128ca
https://github.com/phusion/passenger/blob/970964b53e0ba86959acdf40f06c99b0c4a128ca/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb#L33-L68
train
Initialize the application
[ 30522, 13366, 1999, 4183, 1006, 2364, 1035, 10439, 1007, 1030, 2364, 1035, 10439, 1027, 2364, 1035, 10439, 7047, 1027, 3191, 1035, 22752, 1035, 9918, 1001, 2057, 2123, 1005, 1056, 15653, 4130, 18558, 2138, 2012, 2023, 2391, 2009, 1005, 1055...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-iam/lib/aws-sdk-iam/group_policy.rb
Aws::IAM.GroupPolicy.delete
def delete(options = {}) options = options.merge( group_name: @group_name, policy_name: @name ) resp = @client.delete_group_policy(options) resp.data end
ruby
def delete(options = {}) options = options.merge( group_name: @group_name, policy_name: @name ) resp = @client.delete_group_policy(options) resp.data end
[ "def", "delete", "(", "options", "=", "{", "}", ")", "options", "=", "options", ".", "merge", "(", "group_name", ":", "@group_name", ",", "policy_name", ":", "@name", ")", "resp", "=", "@client", ".", "delete_group_policy", "(", "options", ")", "resp", "...
@!group Actions @example Request syntax with placeholder values group_policy.delete() @param [Hash] options ({}) @return [EmptyStructure]
[ "@!group", "Actions", "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/group_policy.rb#L188-L195
train
Delete a policy from the policy group
[ 30522, 13366, 3972, 12870, 1006, 7047, 1027, 1063, 1065, 1007, 7047, 1027, 7047, 1012, 13590, 1006, 2177, 1035, 2171, 1024, 1030, 2177, 1035, 2171, 1010, 3343, 1035, 2171, 1024, 1030, 2171, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 3972, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/vpn_sites.rb
Azure::Network::Mgmt::V2018_10_01.VpnSites.create_or_update
def create_or_update(resource_group_name, vpn_site_name, vpn_site_parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, vpn_site_name, vpn_site_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def create_or_update(resource_group_name, vpn_site_name, vpn_site_parameters, custom_headers:nil) response = create_or_update_async(resource_group_name, vpn_site_name, vpn_site_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "create_or_update", "(", "resource_group_name", ",", "vpn_site_name", ",", "vpn_site_parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "create_or_update_async", "(", "resource_group_name", ",", "vpn_site_name", ",", "vpn_site_parameters", ",", ...
Creates a VpnSite resource if it doesn't exist else updates the existing VpnSite. @param resource_group_name [String] The resource group name of the VpnSite. @param vpn_site_name [String] The name of the VpnSite being created or updated. @param vpn_site_parameters [VpnSite] Parameters supplied to create or update VpnSite. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [VpnSite] operation results.
[ "Creates", "a", "VpnSite", "resource", "if", "it", "doesn", "t", "exist", "else", "updates", "the", "existing", "VpnSite", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/vpn_sites.rb#L130-L133
train
Creates or updates a virtual network site.
[ 30522, 13366, 3443, 1035, 2030, 1035, 10651, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 21210, 2078, 1035, 2609, 1035, 2171, 1010, 21210, 2078, 1035, 2609, 1035, 11709, 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...
Azure/azure-sdk-for-ruby
data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb
Azure::KeyVault::V2016_10_01.KeyVaultClient.get_keys_next
def get_keys_next(next_page_link, custom_headers:nil) response = get_keys_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_keys_next(next_page_link, custom_headers:nil) response = get_keys_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_keys_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_keys_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "body", "unless", "response", ".", ...
List keys in the specified vault. Retrieves a list of the keys in the Key Vault as JSON Web Key structures that contain the public part of a stored key. The LIST operation is applicable to all key types, however only the base key identifier, attributes, and tags are provided in the response. Individual versions of a key are not listed in the response. This operation requires the keys/list permission. @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 [KeyListResult] operation results.
[ "List", "keys", "in", "the", "specified", "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#L8358-L8361
train
Gets the keys of the specified key group.
[ 30522, 13366, 2131, 1035, 6309, 1035, 2279, 1006, 2279, 1035, 3931, 1035, 4957, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 6309, 1035, 2279, 1035, 2004, 6038, 2278, 1006, 2279, 1035, 3931, 1035, 4957, 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_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb
Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.list_data_lake_store_accounts_next
def list_data_lake_store_accounts_next(next_page_link, custom_headers:nil) response = list_data_lake_store_accounts_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_data_lake_store_accounts_next(next_page_link, custom_headers:nil) response = list_data_lake_store_accounts_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_data_lake_store_accounts_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_data_lake_store_accounts_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "...
Gets the first page of Data Lake Store accounts linked to the specified Data Lake Analytics account. The response includes a link to the next page, if any. @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 [DataLakeAnalyticsAccountListDataLakeStoreResult] operation results.
[ "Gets", "the", "first", "page", "of", "Data", "Lake", "Store", "accounts", "linked", "to", "the", "specified", "Data", "Lake", "Analytics", "account", ".", "The", "response", "includes", "a", "link", "to", "the", "next", "page", "if", "any", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L2635-L2638
train
Gets the list of Data Lake Store accounts.
[ 30522, 13366, 2862, 1035, 2951, 1035, 2697, 1035, 3573, 1035, 6115, 1035, 2279, 1006, 2279, 1035, 3931, 1035, 4957, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 2951, 1035, 2697, 1035, 3573, 1035, 6115, 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...
activeadmin/activeadmin
lib/active_admin/resource_collection.rb
ActiveAdmin.ResourceCollection.find_resource
def find_resource(obj) resources.detect do |r| r.resource_name.to_s == obj.to_s end || resources.detect do |r| r.resource_class.to_s == obj.to_s end || if obj.respond_to? :base_class resources.detect { |r| r.resource_class.to_s == obj.base_class.to_s } end end
ruby
def find_resource(obj) resources.detect do |r| r.resource_name.to_s == obj.to_s end || resources.detect do |r| r.resource_class.to_s == obj.to_s end || if obj.respond_to? :base_class resources.detect { |r| r.resource_class.to_s == obj.base_class.to_s } end end
[ "def", "find_resource", "(", "obj", ")", "resources", ".", "detect", "do", "|", "r", "|", "r", ".", "resource_name", ".", "to_s", "==", "obj", ".", "to_s", "end", "||", "resources", ".", "detect", "do", "|", "r", "|", "r", ".", "resource_class", ".",...
Finds a resource based on the resource name, resource class, or base class.
[ "Finds", "a", "resource", "based", "on", "the", "resource", "name", "resource", "class", "or", "base", "class", "." ]
0759c8dcf97865748c9344459162ac3c7e65a6cd
https://github.com/activeadmin/activeadmin/blob/0759c8dcf97865748c9344459162ac3c7e65a6cd/lib/active_admin/resource_collection.rb#L34-L43
train
Find the resource object in the current hierarchy
[ 30522, 13366, 2424, 1035, 7692, 1006, 27885, 3501, 1007, 4219, 1012, 11487, 2079, 1064, 1054, 1064, 1054, 1012, 7692, 1035, 2171, 1012, 2000, 1035, 1055, 1027, 1027, 27885, 3501, 1012, 2000, 1035, 1055, 2203, 1064, 1064, 4219, 1012, 11487, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
benbalter/word-to-markdown
lib/cliver/dependency_ext.rb
Cliver.Dependency.open?
def open? ProcTable.ps.any? { |p| p.comm == path } # See https://github.com/djberg96/sys-proctable/issues/44 rescue ArgumentError false end
ruby
def open? ProcTable.ps.any? { |p| p.comm == path } # See https://github.com/djberg96/sys-proctable/issues/44 rescue ArgumentError false end
[ "def", "open?", "ProcTable", ".", "ps", ".", "any?", "{", "|", "p", "|", "p", ".", "comm", "==", "path", "}", "# See https://github.com/djberg96/sys-proctable/issues/44", "rescue", "ArgumentError", "false", "end" ]
Is the detected dependency currently open?
[ "Is", "the", "detected", "dependency", "currently", "open?" ]
48031ffd70c9a8caa9978fa576c6de24b736df20
https://github.com/benbalter/word-to-markdown/blob/48031ffd70c9a8caa9978fa576c6de24b736df20/lib/cliver/dependency_ext.rb#L18-L23
train
Returns true if the file is open
[ 30522, 13366, 2330, 1029, 4013, 23576, 1012, 8827, 1012, 2151, 1029, 1063, 1064, 1052, 1064, 1052, 1012, 4012, 2213, 1027, 1027, 4130, 1065, 1001, 2156, 16770, 1024, 1013, 1013, 21025, 2705, 12083, 1012, 4012, 1013, 6520, 4059, 2683, 2575, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Dynamoid/dynamoid
lib/dynamoid/persistence.rb
Dynamoid.Persistence.update!
def update!(conditions = {}) run_callbacks(:update) do options = range_key ? { range_key: Dumping.dump_field(read_attribute(range_key), self.class.attributes[range_key]) } : {} begin new_attrs = Dynamoid.adapter.update_item(self.class.table_name, hash_key, options.merge(conditions: conditions)) do |t| t.add(lock_version: 1) if self.class.attributes[:lock_version] if Dynamoid::Config.timestamps time_now = DateTime.now.in_time_zone(Time.zone) time_now_dumped = Dumping.dump_field(time_now, self.class.attributes[:updated_at]) t.set(updated_at: time_now_dumped) end yield t end load(Undumping.undump_attributes(new_attrs, self.class.attributes)) rescue Dynamoid::Errors::ConditionalCheckFailedException raise Dynamoid::Errors::StaleObjectError.new(self, 'update') end end end
ruby
def update!(conditions = {}) run_callbacks(:update) do options = range_key ? { range_key: Dumping.dump_field(read_attribute(range_key), self.class.attributes[range_key]) } : {} begin new_attrs = Dynamoid.adapter.update_item(self.class.table_name, hash_key, options.merge(conditions: conditions)) do |t| t.add(lock_version: 1) if self.class.attributes[:lock_version] if Dynamoid::Config.timestamps time_now = DateTime.now.in_time_zone(Time.zone) time_now_dumped = Dumping.dump_field(time_now, self.class.attributes[:updated_at]) t.set(updated_at: time_now_dumped) end yield t end load(Undumping.undump_attributes(new_attrs, self.class.attributes)) rescue Dynamoid::Errors::ConditionalCheckFailedException raise Dynamoid::Errors::StaleObjectError.new(self, 'update') end end end
[ "def", "update!", "(", "conditions", "=", "{", "}", ")", "run_callbacks", "(", ":update", ")", "do", "options", "=", "range_key", "?", "{", "range_key", ":", "Dumping", ".", "dump_field", "(", "read_attribute", "(", "range_key", ")", ",", "self", ".", "c...
update!() will increment the lock_version if the table has the column, but will not check it. Thus, a concurrent save will never cause an update! to fail, but an update! may cause a concurrent save to fail.
[ "update!", "()", "will", "increment", "the", "lock_version", "if", "the", "table", "has", "the", "column", "but", "will", "not", "check", "it", ".", "Thus", "a", "concurrent", "save", "will", "never", "cause", "an", "update!", "to", "fail", "but", "an", ...
9e3d006b039e45877b003564ded65509b10b6354
https://github.com/Dynamoid/dynamoid/blob/9e3d006b039e45877b003564ded65509b10b6354/lib/dynamoid/persistence.rb#L188-L209
train
Update the object in the database.
[ 30522, 13366, 10651, 999, 1006, 3785, 1027, 1063, 1065, 1007, 2448, 1035, 2655, 12221, 1006, 1024, 10651, 1007, 2079, 7047, 1027, 2846, 1035, 3145, 1029, 1063, 2846, 1035, 3145, 1024, 23642, 1012, 15653, 1035, 2492, 1006, 3191, 1035, 17961,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rmagick/rmagick
lib/rmagick_internal.rb
Magick.Draw.clip_units
def clip_units(unit) Kernel.raise ArgumentError, "Unknown clip unit #{unit}" unless %w[userspace userspaceonuse objectboundingbox].include?(unit.downcase) primitive "clip-units #{unit}" end
ruby
def clip_units(unit) Kernel.raise ArgumentError, "Unknown clip unit #{unit}" unless %w[userspace userspaceonuse objectboundingbox].include?(unit.downcase) primitive "clip-units #{unit}" end
[ "def", "clip_units", "(", "unit", ")", "Kernel", ".", "raise", "ArgumentError", ",", "\"Unknown clip unit #{unit}\"", "unless", "%w[", "userspace", "userspaceonuse", "objectboundingbox", "]", ".", "include?", "(", "unit", ".", "downcase", ")", "primitive", "\"clip-u...
Define the clip units
[ "Define", "the", "clip", "units" ]
ef6688ed9d76bf123c2ea1a483eff8635051adb7
https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L265-L268
train
clip units
[ 30522, 13366, 12528, 1035, 3197, 1006, 3131, 1007, 16293, 1012, 5333, 6685, 2121, 29165, 1010, 1000, 4242, 12528, 3131, 1001, 1063, 3131, 1065, 1000, 4983, 1003, 1059, 1031, 5198, 15327, 5198, 15327, 24891, 2063, 4874, 15494, 2075, 8758, 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...
boazsegev/combine_pdf
lib/combine_pdf/pdf_protected.rb
CombinePDF.PDF.print_outline_to_file
def print_outline_to_file(outline, file) outline_subbed_str = outline.to_s.gsub(/\:raw_stream_content=\>"(?:(?!"}).)*+"\}\}/, ':raw_stream_content=> RAW STREAM}}') brace_cnt = 0 formatted_outline_str = '' outline_subbed_str.each_char do |c| if c == '{' formatted_outline_str << "\n" << "\t" * brace_cnt << c brace_cnt += 1 elsif c == '}' brace_cnt -= 1 brace_cnt = 0 if brace_cnt < 0 formatted_outline_str << c << "\n" << "\t" * brace_cnt elsif c == '\n' formatted_outline_str << c << "\t" * brace_cnt else formatted_outline_str << c end end formatted_outline_str << "\n" * 10 File.open(file, 'w') { |f| f.write(formatted_outline_str) } end
ruby
def print_outline_to_file(outline, file) outline_subbed_str = outline.to_s.gsub(/\:raw_stream_content=\>"(?:(?!"}).)*+"\}\}/, ':raw_stream_content=> RAW STREAM}}') brace_cnt = 0 formatted_outline_str = '' outline_subbed_str.each_char do |c| if c == '{' formatted_outline_str << "\n" << "\t" * brace_cnt << c brace_cnt += 1 elsif c == '}' brace_cnt -= 1 brace_cnt = 0 if brace_cnt < 0 formatted_outline_str << c << "\n" << "\t" * brace_cnt elsif c == '\n' formatted_outline_str << c << "\t" * brace_cnt else formatted_outline_str << c end end formatted_outline_str << "\n" * 10 File.open(file, 'w') { |f| f.write(formatted_outline_str) } end
[ "def", "print_outline_to_file", "(", "outline", ",", "file", ")", "outline_subbed_str", "=", "outline", ".", "to_s", ".", "gsub", "(", "/", "\\:", "\\>", "\\}", "\\}", "/", ",", "':raw_stream_content=> RAW STREAM}}'", ")", "brace_cnt", "=", "0", "formatted_outli...
Prints the whole outline hash to a file, with basic indentation and replacing raw streams with "RAW STREAM" (subbing doesn't allways work that great for big streams) outline - outline hash file - "filename.filetype" string
[ "Prints", "the", "whole", "outline", "hash", "to", "a", "file", "with", "basic", "indentation", "and", "replacing", "raw", "streams", "with", "RAW", "STREAM", "(", "subbing", "doesn", "t", "allways", "work", "that", "great", "for", "big", "streams", ")", "...
09054051019c069f551f3e60be789577c0f93900
https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/pdf_protected.rb#L351-L371
train
Print the outline to a file
[ 30522, 13366, 6140, 1035, 12685, 1035, 2000, 1035, 5371, 1006, 12685, 1010, 5371, 1007, 12685, 1035, 4942, 8270, 1035, 2358, 2099, 1027, 12685, 1012, 2000, 1035, 1055, 1012, 28177, 12083, 1006, 1013, 1032, 1024, 6315, 1035, 5460, 1035, 4180...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rocketjob/symmetric-encryption
lib/symmetric_encryption/config.rb
SymmetricEncryption.Config.config
def config @config ||= begin raise(ConfigError, "Cannot find config file: #{file_name}") unless File.exist?(file_name) env_config = YAML.load(ERB.new(File.new(file_name).read).result)[env] raise(ConfigError, "Cannot find environment: #{env} in config file: #{file_name}") unless env_config env_config = self.class.send(:deep_symbolize_keys, env_config) self.class.send(:migrate_old_formats!, env_config) end end
ruby
def config @config ||= begin raise(ConfigError, "Cannot find config file: #{file_name}") unless File.exist?(file_name) env_config = YAML.load(ERB.new(File.new(file_name).read).result)[env] raise(ConfigError, "Cannot find environment: #{env} in config file: #{file_name}") unless env_config env_config = self.class.send(:deep_symbolize_keys, env_config) self.class.send(:migrate_old_formats!, env_config) end end
[ "def", "config", "@config", "||=", "begin", "raise", "(", "ConfigError", ",", "\"Cannot find config file: #{file_name}\"", ")", "unless", "File", ".", "exist?", "(", "file_name", ")", "env_config", "=", "YAML", ".", "load", "(", "ERB", ".", "new", "(", "File",...
Load the Encryption Configuration from a YAML file. See: `.load!` for parameters. Returns [Hash] the configuration for the supplied environment.
[ "Load", "the", "Encryption", "Configuration", "from", "a", "YAML", "file", "." ]
064ba8d57ffac44a3ed80f5e76fa1a54d660ff98
https://github.com/rocketjob/symmetric-encryption/blob/064ba8d57ffac44a3ed80f5e76fa1a54d660ff98/lib/symmetric_encryption/config.rb#L73-L83
train
Returns the config file containing the current environment.
[ 30522, 13366, 9530, 8873, 2290, 1030, 9530, 8873, 2290, 1064, 1064, 1027, 4088, 5333, 1006, 9530, 8873, 4590, 29165, 1010, 1000, 3685, 2424, 9530, 8873, 2290, 5371, 1024, 1001, 1063, 5371, 1035, 2171, 1065, 1000, 1007, 4983, 5371, 1012, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
tongueroo/jets
lib/jets/stack/main/extensions/lambda.rb
Jets::Stack::Main::Dsl.Lambda.permission
def permission(id, props={}) defaults = { action: "lambda:InvokeFunction" } props = defaults.merge(props) resource(id, "AWS::Lambda::Permission", props) end
ruby
def permission(id, props={}) defaults = { action: "lambda:InvokeFunction" } props = defaults.merge(props) resource(id, "AWS::Lambda::Permission", props) end
[ "def", "permission", "(", "id", ",", "props", "=", "{", "}", ")", "defaults", "=", "{", "action", ":", "\"lambda:InvokeFunction\"", "}", "props", "=", "defaults", ".", "merge", "(", "props", ")", "resource", "(", "id", ",", "\"AWS::Lambda::Permission\"", "...
Usage: permission(:my_permission, principal: "events.amazonaws.com")
[ "Usage", ":" ]
46943a519224067e58aa3e2d5656e3ca083150f9
https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/stack/main/extensions/lambda.rb#L72-L76
train
Returns a permission resource
[ 30522, 13366, 6656, 1006, 8909, 1010, 24387, 1027, 1063, 1065, 1007, 12398, 2015, 1027, 1063, 2895, 1024, 1000, 23375, 1024, 1999, 6767, 3489, 11263, 27989, 1000, 1065, 24387, 1027, 12398, 2015, 1012, 13590, 1006, 24387, 1007, 7692, 1006, 8...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
samvera/hyrax
lib/wings/active_fedora_converter.rb
Wings.ActiveFedoraConverter.id
def id id_attr = resource[:id] return id_attr.to_s if id_attr.present? && id_attr.is_a?(::Valkyrie::ID) && !id_attr.blank? return "" unless resource.respond_to?(:alternate_ids) resource.alternate_ids.first.to_s end
ruby
def id id_attr = resource[:id] return id_attr.to_s if id_attr.present? && id_attr.is_a?(::Valkyrie::ID) && !id_attr.blank? return "" unless resource.respond_to?(:alternate_ids) resource.alternate_ids.first.to_s end
[ "def", "id", "id_attr", "=", "resource", "[", ":id", "]", "return", "id_attr", ".", "to_s", "if", "id_attr", ".", "present?", "&&", "id_attr", ".", "is_a?", "(", "::", "Valkyrie", "::", "ID", ")", "&&", "!", "id_attr", ".", "blank?", "return", "\"\"", ...
In the context of a Valkyrie resource, prefer to use the id if it is provided and fallback to the first of the alternate_ids. If all else fails then the id hasn't been minted and shouldn't yet be set. @return [String]
[ "In", "the", "context", "of", "a", "Valkyrie", "resource", "prefer", "to", "use", "the", "id", "if", "it", "is", "provided", "and", "fallback", "to", "the", "first", "of", "the", "alternate_ids", ".", "If", "all", "else", "fails", "then", "the", "id", ...
e2b4f56e829a53b1f11296324736e9d5b8c9ee5f
https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/lib/wings/active_fedora_converter.rb#L69-L74
train
Returns the ID of the object in the order they are assigned to the object.
[ 30522, 13366, 8909, 8909, 1035, 2012, 16344, 1027, 7692, 1031, 1024, 8909, 1033, 2709, 8909, 1035, 2012, 16344, 1012, 2000, 1035, 1055, 2065, 8909, 1035, 2012, 16344, 1012, 2556, 1029, 1004, 1004, 8909, 1035, 2012, 16344, 1012, 2003, 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_network/lib/2016-12-01/generated/azure_mgmt_network/virtual_network_gateways.rb
Azure::Network::Mgmt::V2016_12_01.VirtualNetworkGateways.generatevpnclientpackage_with_http_info
def generatevpnclientpackage_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil) generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers).value! end
ruby
def generatevpnclientpackage_with_http_info(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:nil) generatevpnclientpackage_async(resource_group_name, virtual_network_gateway_name, parameters, custom_headers:custom_headers).value! end
[ "def", "generatevpnclientpackage_with_http_info", "(", "resource_group_name", ",", "virtual_network_gateway_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "generatevpnclientpackage_async", "(", "resource_group_name", ",", "virtual_network_gateway_name", ",", ...
Generates VPN client package for P2S client of the virtual network gateway in the specified resource group. @param resource_group_name [String] The name of the resource group. @param virtual_network_gateway_name [String] The name of the virtual network gateway. @param parameters [VpnClientParameters] Parameters supplied to the generate virtual network gateway VPN client package 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.
[ "Generates", "VPN", "client", "package", "for", "P2S", "client", "of", "the", "virtual", "network", "gateway", "in", "the", "specified", "resource", "group", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2016-12-01/generated/azure_mgmt_network/virtual_network_gateways.rb#L377-L379
train
Generates a VPN client package for P2S client.
[ 30522, 13366, 9699, 2615, 2361, 12273, 8751, 3372, 23947, 4270, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 7484, 1035, 2897, 1035, 11909, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb
Azure::ContainerRegistry::Mgmt::V2018_09_01.Tasks.begin_update_with_http_info
def begin_update_with_http_info(resource_group_name, registry_name, task_name, task_update_parameters, custom_headers:nil) begin_update_async(resource_group_name, registry_name, task_name, task_update_parameters, custom_headers:custom_headers).value! end
ruby
def begin_update_with_http_info(resource_group_name, registry_name, task_name, task_update_parameters, custom_headers:nil) begin_update_async(resource_group_name, registry_name, task_name, task_update_parameters, custom_headers:custom_headers).value! end
[ "def", "begin_update_with_http_info", "(", "resource_group_name", ",", "registry_name", ",", "task_name", ",", "task_update_parameters", ",", "custom_headers", ":", "nil", ")", "begin_update_async", "(", "resource_group_name", ",", "registry_name", ",", "task_name", ",", ...
Updates a task with the specified parameters. @param resource_group_name [String] The name of the resource group to which the container registry belongs. @param registry_name [String] The name of the container registry. @param task_name [String] The name of the container registry task. @param task_update_parameters [TaskUpdateParameters] The parameters for updating a task. @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", "task", "with", "the", "specified", "parameters", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/tasks.rb#L730-L732
train
Updates a task s existing assessment.
[ 30522, 13366, 4088, 1035, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 15584, 1035, 2171, 1010, 4708, 1035, 2171, 1010, 4708, 1035, 10651, 1035, 11709, 1010, 7661, 1035, 30524, 7661, 1035, 20346, 201...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
fastlane/fastlane
fastlane_core/lib/fastlane_core/project.rb
FastlaneCore.Project.project_paths
def project_paths return @_project_paths if @_project_paths if self.workspace? # Find the xcodeproj file, as the information isn't included in the workspace file # We have a reference to the workspace, let's find the xcodeproj file # Use Xcodeproj gem here to # * parse the contents.xcworkspacedata XML file # * handle different types (group:, container: etc.) of file references and their paths # for details see https://github.com/CocoaPods/Xcodeproj/blob/e0287156d426ba588c9234bb2a4c824149889860/lib/xcodeproj/workspace/file_reference.rb``` workspace_dir_path = File.expand_path("..", self.path) file_references_paths = workspace.file_references.map { |fr| fr.absolute_path(workspace_dir_path) } @_project_paths = file_references_paths.select do |current_match| # Xcode workspaces can contain loose files now, so let's filter non-xcodeproj files. current_match.end_with?(".xcodeproj") end.reject do |current_match| # We're not interested in a `Pods` project, as it doesn't contain any relevant information about code signing current_match.end_with?("Pods/Pods.xcodeproj") end return @_project_paths else # Return the path as an array return @_project_paths = [path] end end
ruby
def project_paths return @_project_paths if @_project_paths if self.workspace? # Find the xcodeproj file, as the information isn't included in the workspace file # We have a reference to the workspace, let's find the xcodeproj file # Use Xcodeproj gem here to # * parse the contents.xcworkspacedata XML file # * handle different types (group:, container: etc.) of file references and their paths # for details see https://github.com/CocoaPods/Xcodeproj/blob/e0287156d426ba588c9234bb2a4c824149889860/lib/xcodeproj/workspace/file_reference.rb``` workspace_dir_path = File.expand_path("..", self.path) file_references_paths = workspace.file_references.map { |fr| fr.absolute_path(workspace_dir_path) } @_project_paths = file_references_paths.select do |current_match| # Xcode workspaces can contain loose files now, so let's filter non-xcodeproj files. current_match.end_with?(".xcodeproj") end.reject do |current_match| # We're not interested in a `Pods` project, as it doesn't contain any relevant information about code signing current_match.end_with?("Pods/Pods.xcodeproj") end return @_project_paths else # Return the path as an array return @_project_paths = [path] end end
[ "def", "project_paths", "return", "@_project_paths", "if", "@_project_paths", "if", "self", ".", "workspace?", "# Find the xcodeproj file, as the information isn't included in the workspace file", "# We have a reference to the workspace, let's find the xcodeproj file", "# Use Xcodeproj gem h...
Array of paths to all project files (might be multiple, because of workspaces)
[ "Array", "of", "paths", "to", "all", "project", "files", "(", "might", "be", "multiple", "because", "of", "workspaces", ")" ]
457c5d647c77f0e078dafa5129da616914e002c5
https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane_core/lib/fastlane_core/project.rb#L446-L471
train
Find the project paths for this project
[ 30522, 13366, 2622, 1035, 10425, 2709, 1030, 1035, 2622, 1035, 10425, 2065, 1030, 1035, 2622, 1035, 10425, 2065, 2969, 1012, 2573, 15327, 1029, 1001, 2424, 1996, 1060, 16044, 21572, 3501, 5371, 1010, 2004, 1996, 2592, 3475, 1005, 1056, 2443...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
fastlane/fastlane
fastlane/lib/fastlane/runner.rb
Fastlane.Runner.execute
def execute(lane, platform = nil, parameters = nil) UI.crash!("No lane given") unless lane self.current_lane = lane.to_sym self.current_platform = (platform ? platform.to_sym : nil) lane_obj = lanes.fetch(current_platform, {}).fetch(current_lane, nil) UI.user_error!("Could not find lane '#{full_lane_name}'. Available lanes: #{available_lanes.join(', ')}") unless lane_obj UI.user_error!("You can't call the private lane '#{lane}' directly") if lane_obj.is_private ENV["FASTLANE_LANE_NAME"] = current_lane.to_s ENV["FASTLANE_PLATFORM_NAME"] = (current_platform ? current_platform.to_s : nil) Actions.lane_context[Actions::SharedValues::PLATFORM_NAME] = current_platform Actions.lane_context[Actions::SharedValues::LANE_NAME] = full_lane_name UI.success("Driving the lane '#{full_lane_name}' 🚀") return_val = nil path_to_use = FastlaneCore::FastlaneFolder.path || Dir.pwd parameters ||= {} begin Dir.chdir(path_to_use) do # the file is located in the fastlane folder execute_flow_block(before_all_blocks, current_platform, current_lane, parameters) execute_flow_block(before_each_blocks, current_platform, current_lane, parameters) return_val = lane_obj.call(parameters) # by default no parameters # after blocks are only called if no exception was raised before # Call the platform specific after block and then the general one execute_flow_block(after_each_blocks, current_platform, current_lane, parameters) execute_flow_block(after_all_blocks, current_platform, current_lane, parameters) end return return_val rescue => ex Dir.chdir(path_to_use) do # Provide error block exception without color code begin error_blocks[current_platform].call(current_lane, ex, parameters) if current_platform && error_blocks[current_platform] error_blocks[nil].call(current_lane, ex, parameters) if error_blocks[nil] rescue => error_block_exception UI.error("An error occurred while executing the `error` block:") UI.error(error_block_exception.to_s) raise ex # raise the original error message end end raise ex end end
ruby
def execute(lane, platform = nil, parameters = nil) UI.crash!("No lane given") unless lane self.current_lane = lane.to_sym self.current_platform = (platform ? platform.to_sym : nil) lane_obj = lanes.fetch(current_platform, {}).fetch(current_lane, nil) UI.user_error!("Could not find lane '#{full_lane_name}'. Available lanes: #{available_lanes.join(', ')}") unless lane_obj UI.user_error!("You can't call the private lane '#{lane}' directly") if lane_obj.is_private ENV["FASTLANE_LANE_NAME"] = current_lane.to_s ENV["FASTLANE_PLATFORM_NAME"] = (current_platform ? current_platform.to_s : nil) Actions.lane_context[Actions::SharedValues::PLATFORM_NAME] = current_platform Actions.lane_context[Actions::SharedValues::LANE_NAME] = full_lane_name UI.success("Driving the lane '#{full_lane_name}' 🚀") return_val = nil path_to_use = FastlaneCore::FastlaneFolder.path || Dir.pwd parameters ||= {} begin Dir.chdir(path_to_use) do # the file is located in the fastlane folder execute_flow_block(before_all_blocks, current_platform, current_lane, parameters) execute_flow_block(before_each_blocks, current_platform, current_lane, parameters) return_val = lane_obj.call(parameters) # by default no parameters # after blocks are only called if no exception was raised before # Call the platform specific after block and then the general one execute_flow_block(after_each_blocks, current_platform, current_lane, parameters) execute_flow_block(after_all_blocks, current_platform, current_lane, parameters) end return return_val rescue => ex Dir.chdir(path_to_use) do # Provide error block exception without color code begin error_blocks[current_platform].call(current_lane, ex, parameters) if current_platform && error_blocks[current_platform] error_blocks[nil].call(current_lane, ex, parameters) if error_blocks[nil] rescue => error_block_exception UI.error("An error occurred while executing the `error` block:") UI.error(error_block_exception.to_s) raise ex # raise the original error message end end raise ex end end
[ "def", "execute", "(", "lane", ",", "platform", "=", "nil", ",", "parameters", "=", "nil", ")", "UI", ".", "crash!", "(", "\"No lane given\"", ")", "unless", "lane", "self", ".", "current_lane", "=", "lane", ".", "to_sym", "self", ".", "current_platform", ...
This will take care of executing **one** lane. That's when the user triggers a lane from the CLI for example This method is **not** executed when switching a lane @param lane_name The name of the lane to execute @param platform The name of the platform to execute @param parameters [Hash] The parameters passed from the command line to the lane
[ "This", "will", "take", "care", "of", "executing", "**", "one", "**", "lane", ".", "That", "s", "when", "the", "user", "triggers", "a", "lane", "from", "the", "CLI", "for", "example", "This", "method", "is", "**", "not", "**", "executed", "when", "swit...
457c5d647c77f0e078dafa5129da616914e002c5
https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/runner.rb#L21-L73
train
Execute a lane
[ 30522, 13366, 15389, 1006, 4644, 1010, 4132, 1027, 9152, 2140, 1010, 11709, 1027, 9152, 2140, 1007, 21318, 1012, 5823, 999, 1006, 1000, 2053, 4644, 2445, 1000, 1007, 4983, 4644, 2969, 1012, 2783, 1035, 4644, 1027, 4644, 1012, 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...
rails/rails
actionpack/lib/action_controller/metal/conditional_get.rb
ActionController.ConditionalGet.expires_in
def expires_in(seconds, options = {}) response.cache_control.merge!( max_age: seconds, public: options.delete(:public), must_revalidate: options.delete(:must_revalidate), stale_while_revalidate: options.delete(:stale_while_revalidate), stale_if_error: options.delete(:stale_if_error), ) options.delete(:private) response.cache_control[:extras] = options.map { |k, v| "#{k}=#{v}" } response.date = Time.now unless response.date? end
ruby
def expires_in(seconds, options = {}) response.cache_control.merge!( max_age: seconds, public: options.delete(:public), must_revalidate: options.delete(:must_revalidate), stale_while_revalidate: options.delete(:stale_while_revalidate), stale_if_error: options.delete(:stale_if_error), ) options.delete(:private) response.cache_control[:extras] = options.map { |k, v| "#{k}=#{v}" } response.date = Time.now unless response.date? end
[ "def", "expires_in", "(", "seconds", ",", "options", "=", "{", "}", ")", "response", ".", "cache_control", ".", "merge!", "(", "max_age", ":", "seconds", ",", "public", ":", "options", ".", "delete", "(", ":public", ")", ",", "must_revalidate", ":", "opt...
Sets an HTTP 1.1 Cache-Control header. Defaults to issuing a +private+ instruction, so that intermediate caches must not cache the response. expires_in 20.minutes expires_in 3.hours, public: true expires_in 3.hours, public: true, must_revalidate: true This method will overwrite an existing Cache-Control header. See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html for more possibilities. HTTP Cache-Control Extensions for Stale Content. See https://tools.ietf.org/html/rfc5861 It helps to cache an asset and serve it while is being revalidated and/or returning with an error. expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds expires_in 3.hours, public: true, stale_while_revalidate: 60.seconds, stale_if_error: 5.minutes The method will also ensure an HTTP Date header for client compatibility.
[ "Sets", "an", "HTTP", "1", ".", "1", "Cache", "-", "Control", "header", ".", "Defaults", "to", "issuing", "a", "+", "private", "+", "instruction", "so", "that", "intermediate", "caches", "must", "not", "cache", "the", "response", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_controller/metal/conditional_get.rb#L238-L250
train
Set the cache control to the specified number of seconds.
[ 30522, 13366, 4654, 20781, 2015, 1035, 1999, 1006, 3823, 1010, 7047, 1027, 1063, 1065, 1007, 3433, 1012, 17053, 1035, 2491, 1012, 13590, 999, 1006, 4098, 1035, 2287, 1024, 3823, 1010, 2270, 1024, 7047, 1012, 3972, 12870, 1006, 1024, 2270, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
square/connect-ruby-sdk
lib/square_connect/api/apple_pay_api.rb
SquareConnect.ApplePayApi.register_domain
def register_domain(body, opts = {}) data, _status_code, _headers = register_domain_with_http_info(body, opts) return data end
ruby
def register_domain(body, opts = {}) data, _status_code, _headers = register_domain_with_http_info(body, opts) return data end
[ "def", "register_domain", "(", "body", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "register_domain_with_http_info", "(", "body", ",", "opts", ")", "return", "data", "end" ]
RegisterDomain Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](/payments/sqpaymentform/overview) guide. @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. @param [Hash] opts the optional parameters @return [RegisterDomainResponse]
[ "RegisterDomain", "Activates", "a", "domain", "for", "use", "with", "Web", "Apple", "Pay", "and", "Square", ".", "A", "validation", "will", "be", "performed", "on", "this", "domain", "by", "Apple", "to", "ensure", "is", "it", "properly", "set", "up", "as",...
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/apple_pay_api.rb#L25-L28
train
Register a domain
[ 30522, 13366, 4236, 1035, 5884, 1006, 2303, 1010, 23569, 2015, 1027, 1063, 1065, 1007, 2951, 1010, 1035, 3570, 1035, 3642, 1010, 1035, 20346, 2015, 1027, 4236, 1035, 5884, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 2303, 1010, 23569, 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...
twitter/secure_headers
lib/secure_headers/utils/cookies_config.rb
SecureHeaders.CookiesConfig.validate_samesite_boolean_config!
def validate_samesite_boolean_config! if config[:samesite].key?(:lax) && config[:samesite][:lax].is_a?(TrueClass) && config[:samesite].key?(:strict) raise CookiesConfigError.new("samesite cookie config is invalid, combination use of booleans and Hash to configure lax and strict enforcement is not permitted.") elsif config[:samesite].key?(:strict) && config[:samesite][:strict].is_a?(TrueClass) && config[:samesite].key?(:lax) raise CookiesConfigError.new("samesite cookie config is invalid, combination use of booleans and Hash to configure lax and strict enforcement is not permitted.") end end
ruby
def validate_samesite_boolean_config! if config[:samesite].key?(:lax) && config[:samesite][:lax].is_a?(TrueClass) && config[:samesite].key?(:strict) raise CookiesConfigError.new("samesite cookie config is invalid, combination use of booleans and Hash to configure lax and strict enforcement is not permitted.") elsif config[:samesite].key?(:strict) && config[:samesite][:strict].is_a?(TrueClass) && config[:samesite].key?(:lax) raise CookiesConfigError.new("samesite cookie config is invalid, combination use of booleans and Hash to configure lax and strict enforcement is not permitted.") end end
[ "def", "validate_samesite_boolean_config!", "if", "config", "[", ":samesite", "]", ".", "key?", "(", ":lax", ")", "&&", "config", "[", ":samesite", "]", "[", ":lax", "]", ".", "is_a?", "(", "TrueClass", ")", "&&", "config", "[", ":samesite", "]", ".", "k...
when configuring with booleans, only one enforcement is permitted
[ "when", "configuring", "with", "booleans", "only", "one", "enforcement", "is", "permitted" ]
543e6712aadae08f1653ed973e6b6204f7eac26a
https://github.com/twitter/secure_headers/blob/543e6712aadae08f1653ed973e6b6204f7eac26a/lib/secure_headers/utils/cookies_config.rb#L45-L51
train
Validate the samesite boolean config
[ 30522, 13366, 9398, 3686, 1035, 2168, 28032, 2063, 1035, 22017, 20898, 1035, 9530, 8873, 2290, 999, 2065, 9530, 8873, 2290, 1031, 1024, 2168, 28032, 2063, 1033, 1012, 30524, 2290, 1031, 1024, 2168, 28032, 2063, 1033, 1012, 3145, 1029, 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_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/notification_recipient_user.rb
Azure::ApiManagement::Mgmt::V2018_01_01.NotificationRecipientUser.check_entity_exists
def check_entity_exists(resource_group_name, service_name, notification_name, uid, custom_headers:nil) response = check_entity_exists_async(resource_group_name, service_name, notification_name, uid, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def check_entity_exists(resource_group_name, service_name, notification_name, uid, custom_headers:nil) response = check_entity_exists_async(resource_group_name, service_name, notification_name, uid, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "check_entity_exists", "(", "resource_group_name", ",", "service_name", ",", "notification_name", ",", "uid", ",", "custom_headers", ":", "nil", ")", "response", "=", "check_entity_exists_async", "(", "resource_group_name", ",", "service_name", ",", "notification...
Determine if the Notification Recipient User is subscribed to the notification. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param notification_name [NotificationName] Notification Name Identifier. Possible values include: 'RequestPublisherNotificationMessage', 'PurchasePublisherNotificationMessage', 'NewApplicationNotificationMessage', 'BCC', 'NewIssuePublisherNotificationMessage', 'AccountClosedPublisher', 'QuotaLimitApproachingPublisherNotificationMessage' @param uid [String] User identifier. Must be unique in the current API Management service instance. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Boolean] operation results.
[ "Determine", "if", "the", "Notification", "Recipient", "User", "is", "subscribed", "to", "the", "notification", "." ]
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/notification_recipient_user.rb#L156-L159
train
Check if an entity with the specified identifier already exists in the notification.
[ 30522, 13366, 4638, 1035, 9178, 1035, 6526, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 26828, 1035, 2171, 1010, 21318, 2094, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4638, 1035, 9178, 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_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/connectors.rb
Azure::CustomerInsights::Mgmt::V2017_01_01.Connectors.get_with_http_info
def get_with_http_info(resource_group_name, hub_name, connector_name, custom_headers:nil) get_async(resource_group_name, hub_name, connector_name, custom_headers:custom_headers).value! end
ruby
def get_with_http_info(resource_group_name, hub_name, connector_name, custom_headers:nil) get_async(resource_group_name, hub_name, connector_name, custom_headers:custom_headers).value! end
[ "def", "get_with_http_info", "(", "resource_group_name", ",", "hub_name", ",", "connector_name", ",", "custom_headers", ":", "nil", ")", "get_async", "(", "resource_group_name", ",", "hub_name", ",", "connector_name", ",", "custom_headers", ":custom_headers", ")", "."...
Gets a connector in the hub. @param resource_group_name [String] The name of the resource group. @param hub_name [String] The name of the hub. @param connector_name [String] The name of the connector. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Gets", "a", "connector", "in", "the", "hub", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/connectors.rb#L102-L104
train
Gets the specified HDInsight connector s index.
[ 30522, 13366, 2131, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 9594, 1035, 2171, 1010, 19400, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, 2004, 6038, 2278, 1006, 7692, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rails/sprockets
lib/sprockets/resolve.rb
Sprockets.Resolve.resolve_logical_path
def resolve_logical_path(paths, logical_path, accept) extname, mime_type = PathUtils.match_path_extname(logical_path, config[:mime_exts]) logical_name = logical_path.chomp(extname) extname, pipeline = PathUtils.match_path_extname(logical_name, config[:pipeline_exts]) logical_name = logical_name.chomp(extname) parsed_accept = parse_accept_options(mime_type, accept) transformed_accepts = expand_transform_accepts(parsed_accept) filename, mime_type, deps, index_alias = resolve_under_paths(paths, logical_name, transformed_accepts) if filename deps << build_file_digest_uri(filename) type = resolve_transform_type(mime_type, parsed_accept) return filename, type, pipeline, deps, index_alias else return nil, nil, nil, deps end end
ruby
def resolve_logical_path(paths, logical_path, accept) extname, mime_type = PathUtils.match_path_extname(logical_path, config[:mime_exts]) logical_name = logical_path.chomp(extname) extname, pipeline = PathUtils.match_path_extname(logical_name, config[:pipeline_exts]) logical_name = logical_name.chomp(extname) parsed_accept = parse_accept_options(mime_type, accept) transformed_accepts = expand_transform_accepts(parsed_accept) filename, mime_type, deps, index_alias = resolve_under_paths(paths, logical_name, transformed_accepts) if filename deps << build_file_digest_uri(filename) type = resolve_transform_type(mime_type, parsed_accept) return filename, type, pipeline, deps, index_alias else return nil, nil, nil, deps end end
[ "def", "resolve_logical_path", "(", "paths", ",", "logical_path", ",", "accept", ")", "extname", ",", "mime_type", "=", "PathUtils", ".", "match_path_extname", "(", "logical_path", ",", "config", "[", ":mime_exts", "]", ")", "logical_name", "=", "logical_path", ...
Internal: Finds a file in a set of given paths paths - Array of Strings. logical_path - String. A filename with extension e.g. "coffee/foo.js" or "foo.js" accept - String. A Quality value incoded set of mime types that we are looking for. Can be nil. e.g. "application/javascript" or "text/css, */*" Finds a file on the given paths. Returns Array. Filename, type, path_pipeline, deps, index_alias
[ "Internal", ":", "Finds", "a", "file", "in", "a", "set", "of", "given", "paths" ]
9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd
https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/resolve.rb#L142-L161
train
Resolve the logical path
[ 30522, 13366, 10663, 1035, 11177, 1035, 4130, 1006, 10425, 1010, 11177, 1035, 4130, 1010, 5138, 1007, 4654, 2102, 18442, 1010, 2771, 4168, 1035, 2828, 1027, 4130, 21823, 4877, 1012, 2674, 1035, 4130, 1035, 4654, 2102, 18442, 1006, 11177, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rmagick/rmagick
lib/rmagick_internal.rb
Magick.Image.matte_replace
def matte_replace(x, y) f = copy f.opacity = OpaqueOpacity unless f.alpha? target = f.pixel_color(x, y) f.transparent(target) end
ruby
def matte_replace(x, y) f = copy f.opacity = OpaqueOpacity unless f.alpha? target = f.pixel_color(x, y) f.transparent(target) end
[ "def", "matte_replace", "(", "x", ",", "y", ")", "f", "=", "copy", "f", ".", "opacity", "=", "OpaqueOpacity", "unless", "f", ".", "alpha?", "target", "=", "f", ".", "pixel_color", "(", "x", ",", "y", ")", "f", ".", "transparent", "(", "target", ")"...
Make transparent all pixels that are the same color as the pixel at (x, y).
[ "Make", "transparent", "all", "pixels", "that", "are", "the", "same", "color", "as", "the", "pixel", "at", "(", "x", "y", ")", "." ]
ef6688ed9d76bf123c2ea1a483eff8635051adb7
https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L917-L922
train
Replace pixel color with the new pixel color
[ 30522, 13366, 4717, 2063, 1035, 5672, 1006, 1060, 1010, 1061, 1007, 1042, 1027, 6100, 1042, 1012, 6728, 6305, 3012, 1027, 28670, 29477, 12972, 4983, 1042, 1012, 6541, 1029, 4539, 1027, 1042, 1012, 22138, 1035, 3609, 1006, 1060, 1010, 1061, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/resource_health_metadata_operations.rb
Azure::Web::Mgmt::V2018_02_01.ResourceHealthMetadataOperations.list_by_site
def list_by_site(resource_group_name, name, custom_headers:nil) first_page = list_by_site_as_lazy(resource_group_name, name, custom_headers:custom_headers) first_page.get_all_items end
ruby
def list_by_site(resource_group_name, name, custom_headers:nil) first_page = list_by_site_as_lazy(resource_group_name, name, custom_headers:custom_headers) first_page.get_all_items end
[ "def", "list_by_site", "(", "resource_group_name", ",", "name", ",", "custom_headers", ":", "nil", ")", "first_page", "=", "list_by_site_as_lazy", "(", "resource_group_name", ",", "name", ",", "custom_headers", ":custom_headers", ")", "first_page", ".", "get_all_items...
Gets the category of ResourceHealthMetadata to use for the given site as a collection Gets the category of ResourceHealthMetadata to use for the given site as a collection @param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of web app. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array<ResourceHealthMetadata>] operation results.
[ "Gets", "the", "category", "of", "ResourceHealthMetadata", "to", "use", "for", "the", "given", "site", "as", "a", "collection" ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/resource_health_metadata_operations.rb#L235-L238
train
Gets all the segmentation terms of a site.
[ 30522, 13366, 2862, 1035, 2011, 1035, 2609, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2034, 1035, 3931, 1027, 2862, 1035, 2011, 1035, 2609, 1035, 2004, 1035, 13971, 1006, 7692, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_container_registry/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb
Azure::ContainerRegistry::Mgmt::V2017_10_01.Registries.import_image
def import_image(resource_group_name, registry_name, parameters, custom_headers:nil) response = import_image_async(resource_group_name, registry_name, parameters, custom_headers:custom_headers).value! nil end
ruby
def import_image(resource_group_name, registry_name, parameters, custom_headers:nil) response = import_image_async(resource_group_name, registry_name, parameters, custom_headers:custom_headers).value! nil end
[ "def", "import_image", "(", "resource_group_name", ",", "registry_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "import_image_async", "(", "resource_group_name", ",", "registry_name", ",", "parameters", ",", "custom_headers", ":cus...
Copies an image to this container registry from the specified container registry. @param resource_group_name [String] The name of the resource group to which the container registry belongs. @param registry_name [String] The name of the container registry. @param parameters [ImportImageParameters] The parameters specifying the image to copy and the source container registry. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Copies", "an", "image", "to", "this", "container", "registry", "from", "the", "specified", "container", "registry", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb#L36-L39
train
Import an image into an image registry.
[ 30522, 13366, 12324, 1035, 3746, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 15584, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 12324, 1035, 3746, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/connection_monitors.rb
Azure::Network::Mgmt::V2018_10_01.ConnectionMonitors.begin_query_with_http_info
def begin_query_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! end
ruby
def begin_query_with_http_info(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil) begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value! end
[ "def", "begin_query_with_http_info", "(", "resource_group_name", ",", "network_watcher_name", ",", "connection_monitor_name", ",", "custom_headers", ":", "nil", ")", "begin_query_async", "(", "resource_group_name", ",", "network_watcher_name", ",", "connection_monitor_name", ...
Query a snapshot of the most recent connection states. @param resource_group_name [String] The name of the resource group containing Network Watcher. @param network_watcher_name [String] The name of the Network Watcher resource. @param connection_monitor_name [String] The name given to the connection monitor. @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.
[ "Query", "a", "snapshot", "of", "the", "most", "recent", "connection", "states", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/connection_monitors.rb#L890-L892
train
Gets the next set of documents that are available for use in the connection monitor.
[ 30522, 13366, 4088, 1035, 23032, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2897, 1035, 3422, 2121, 1035, 2171, 1010, 4434, 1035, 8080, 1035, 2171, 1010, 7661, 1035, 30524, 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...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb
Azure::CognitiveServices::LuisAuthoring::V2_0.Model.update_custom_prebuilt_entity_role_with_http_info
def update_custom_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) update_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value! end
ruby
def update_custom_prebuilt_entity_role_with_http_info(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil) update_custom_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value! end
[ "def", "update_custom_prebuilt_entity_role_with_http_info", "(", "app_id", ",", "version_id", ",", "entity_id", ",", "role_id", ",", "entity_role_update_object", ",", "custom_headers", ":", "nil", ")", "update_custom_prebuilt_entity_role_async", "(", "app_id", ",", "version...
Update a role for a given prebuilt entity in a version of the application. @param app_id The application ID. @param version_id [String] The version ID. @param entity_id The entity ID. @param role_id The entity role ID. @param entity_role_update_object [EntityRoleUpdateObject] The new entity role. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Update", "a", "role", "for", "a", "given", "prebuilt", "entity", "in", "a", "version", "of", "the", "application", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L11087-L11089
train
Updates a prebuilt entity role.
[ 30522, 13366, 10651, 1035, 7661, 1035, 3653, 8569, 4014, 2102, 1035, 9178, 1035, 2535, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 10439, 1035, 8909, 1010, 2544, 1035, 8909, 1010, 9178, 1035, 8909, 1010, 2535, 1035, 8909, 1010, 9178, 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...
samvera/hyrax
app/controllers/concerns/hyrax/local_file_downloads_controller_behavior.rb
Hyrax.LocalFileDownloadsControllerBehavior.send_range_for_local_file
def send_range_for_local_file _, range = request.headers['Range'].split('bytes=') from, to = range.split('-').map(&:to_i) to = local_file_size - 1 unless to length = to - from + 1 response.headers['Content-Range'] = "bytes #{from}-#{to}/#{local_file_size}" response.headers['Content-Length'] = length.to_s self.status = 206 prepare_local_file_headers # For derivatives stored on the local file system send_data IO.binread(file, length, from), local_derivative_download_options.merge(status: status) end
ruby
def send_range_for_local_file _, range = request.headers['Range'].split('bytes=') from, to = range.split('-').map(&:to_i) to = local_file_size - 1 unless to length = to - from + 1 response.headers['Content-Range'] = "bytes #{from}-#{to}/#{local_file_size}" response.headers['Content-Length'] = length.to_s self.status = 206 prepare_local_file_headers # For derivatives stored on the local file system send_data IO.binread(file, length, from), local_derivative_download_options.merge(status: status) end
[ "def", "send_range_for_local_file", "_", ",", "range", "=", "request", ".", "headers", "[", "'Range'", "]", ".", "split", "(", "'bytes='", ")", "from", ",", "to", "=", "range", ".", "split", "(", "'-'", ")", ".", "map", "(", ":to_i", ")", "to", "=", ...
render an HTTP Range response
[ "render", "an", "HTTP", "Range", "response" ]
e2b4f56e829a53b1f11296324736e9d5b8c9ee5f
https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/controllers/concerns/hyrax/local_file_downloads_controller_behavior.rb#L18-L29
train
Send the range for the local file
[ 30522, 13366, 4604, 1035, 2846, 1035, 2005, 1035, 2334, 1035, 5371, 1035, 1010, 2846, 1027, 5227, 1012, 20346, 2015, 1031, 1005, 2846, 1005, 1033, 1012, 3975, 1006, 1005, 27507, 1027, 1005, 1007, 2013, 1010, 2000, 1027, 2846, 1012, 3975, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sds/overcommit
lib/overcommit/printer.rb
Overcommit.Printer.end_hook
def end_hook(hook, status, output) # Want to print the header for quiet hooks only if the result wasn't good # so that the user knows what failed print_header(hook) if (!hook.quiet? && !@config['quiet']) || status != :pass print_result(hook, status, output) end
ruby
def end_hook(hook, status, output) # Want to print the header for quiet hooks only if the result wasn't good # so that the user knows what failed print_header(hook) if (!hook.quiet? && !@config['quiet']) || status != :pass print_result(hook, status, output) end
[ "def", "end_hook", "(", "hook", ",", "status", ",", "output", ")", "# Want to print the header for quiet hooks only if the result wasn't good", "# so that the user knows what failed", "print_header", "(", "hook", ")", "if", "(", "!", "hook", ".", "quiet?", "&&", "!", "@...
Executed at the end of an individual hook run.
[ "Executed", "at", "the", "end", "of", "an", "individual", "hook", "run", "." ]
35d60adb41da942178b789560968e3ad030b0ac7
https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/printer.rb#L37-L43
train
This method is called when a hook is finished
[ 30522, 13366, 2203, 1035, 8103, 1006, 8103, 1010, 3570, 1010, 6434, 1007, 1001, 2215, 2000, 6140, 1996, 20346, 2005, 4251, 18008, 2069, 2065, 1996, 2765, 2347, 1005, 1056, 2204, 1001, 2061, 2008, 1996, 5310, 4282, 2054, 3478, 6140, 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...
magnusvk/counter_culture
lib/counter_culture/extensions.rb
CounterCulture.Extensions.destroyed_for_counter_culture?
def destroyed_for_counter_culture? if respond_to?(:paranoia_destroyed?) paranoia_destroyed? elsif defined?(Discard::Model) && self.class.include?(Discard::Model) discarded? else false end end
ruby
def destroyed_for_counter_culture? if respond_to?(:paranoia_destroyed?) paranoia_destroyed? elsif defined?(Discard::Model) && self.class.include?(Discard::Model) discarded? else false end end
[ "def", "destroyed_for_counter_culture?", "if", "respond_to?", "(", ":paranoia_destroyed?", ")", "paranoia_destroyed?", "elsif", "defined?", "(", "Discard", "::", "Model", ")", "&&", "self", ".", "class", ".", "include?", "(", "Discard", "::", "Model", ")", "discar...
check if record is soft-deleted
[ "check", "if", "record", "is", "soft", "-", "deleted" ]
6b5bd4d6e1ee4f10f262ace7cfed5776af9520ba
https://github.com/magnusvk/counter_culture/blob/6b5bd4d6e1ee4f10f262ace7cfed5776af9520ba/lib/counter_culture/extensions.rb#L129-L137
train
Returns true if the current object was destroyed for counter culture
[ 30522, 13366, 3908, 1035, 2005, 1035, 4675, 1035, 3226, 1029, 2065, 6869, 1035, 2000, 1029, 1006, 1024, 27890, 1035, 3908, 1029, 1007, 27890, 1035, 3908, 1029, 3449, 5332, 2546, 4225, 1029, 1006, 5860, 4232, 1024, 1024, 2944, 1007, 1004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sporkmonger/addressable
lib/addressable/template.rb
Addressable.Template.parse_template_pattern
def parse_template_pattern(pattern, processor=nil) # Escape the pattern. The two gsubs restore the escaped curly braces # back to their original form. Basically, escape everything that isn't # within an expansion. escaped_pattern = Regexp.escape( pattern ).gsub(/\\\{(.*?)\\\}/) do |escaped| escaped.gsub(/\\(.)/, "\\1") end expansions = [] # Create a regular expression that captures the values of the # variables in the URI. regexp_string = escaped_pattern.gsub( EXPRESSION ) do |expansion| expansions << expansion _, operator, varlist = *expansion.match(EXPRESSION) leader = Regexp.escape(LEADERS.fetch(operator, '')) joiner = Regexp.escape(JOINERS.fetch(operator, ',')) combined = varlist.split(',').map do |varspec| _, name, modifier = *varspec.match(VARSPEC) result = processor && processor.respond_to?(:match) ? processor.match(name) : nil if result "(?<#{name}>#{ result })" else group = case operator when '+' "#{ RESERVED }*?" when '#' "#{ RESERVED }*?" when '/' "#{ UNRESERVED }*?" when '.' "#{ UNRESERVED.gsub('\.', '') }*?" when ';' "#{ UNRESERVED }*=?#{ UNRESERVED }*?" when '?' "#{ UNRESERVED }*=#{ UNRESERVED }*?" when '&' "#{ UNRESERVED }*=#{ UNRESERVED }*?" else "#{ UNRESERVED }*?" end if modifier == '*' "(?<#{name}>#{group}(?:#{joiner}?#{group})*)?" else "(?<#{name}>#{group})?" end end end.join("#{joiner}?") "(?:|#{leader}#{combined})" end # Ensure that the regular expression matches the whole URI. regexp_string = "^#{regexp_string}$" return expansions, Regexp.new(regexp_string) end
ruby
def parse_template_pattern(pattern, processor=nil) # Escape the pattern. The two gsubs restore the escaped curly braces # back to their original form. Basically, escape everything that isn't # within an expansion. escaped_pattern = Regexp.escape( pattern ).gsub(/\\\{(.*?)\\\}/) do |escaped| escaped.gsub(/\\(.)/, "\\1") end expansions = [] # Create a regular expression that captures the values of the # variables in the URI. regexp_string = escaped_pattern.gsub( EXPRESSION ) do |expansion| expansions << expansion _, operator, varlist = *expansion.match(EXPRESSION) leader = Regexp.escape(LEADERS.fetch(operator, '')) joiner = Regexp.escape(JOINERS.fetch(operator, ',')) combined = varlist.split(',').map do |varspec| _, name, modifier = *varspec.match(VARSPEC) result = processor && processor.respond_to?(:match) ? processor.match(name) : nil if result "(?<#{name}>#{ result })" else group = case operator when '+' "#{ RESERVED }*?" when '#' "#{ RESERVED }*?" when '/' "#{ UNRESERVED }*?" when '.' "#{ UNRESERVED.gsub('\.', '') }*?" when ';' "#{ UNRESERVED }*=?#{ UNRESERVED }*?" when '?' "#{ UNRESERVED }*=#{ UNRESERVED }*?" when '&' "#{ UNRESERVED }*=#{ UNRESERVED }*?" else "#{ UNRESERVED }*?" end if modifier == '*' "(?<#{name}>#{group}(?:#{joiner}?#{group})*)?" else "(?<#{name}>#{group})?" end end end.join("#{joiner}?") "(?:|#{leader}#{combined})" end # Ensure that the regular expression matches the whole URI. regexp_string = "^#{regexp_string}$" return expansions, Regexp.new(regexp_string) end
[ "def", "parse_template_pattern", "(", "pattern", ",", "processor", "=", "nil", ")", "# Escape the pattern. The two gsubs restore the escaped curly braces", "# back to their original form. Basically, escape everything that isn't", "# within an expansion.", "escaped_pattern", "=", "Regexp"...
Generates the <tt>Regexp</tt> that parses a template pattern. @param [String] pattern The URI template pattern. @param [#match] processor The template processor to use. @return [Regexp] A regular expression which may be used to parse a template pattern.
[ "Generates", "the", "<tt", ">", "Regexp<", "/", "tt", ">", "that", "parses", "a", "template", "pattern", "." ]
5894c95a7768435cb46d1355954611dbd194832e
https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/template.rb#L984-L1042
train
Parse a template pattern.
[ 30522, 13366, 11968, 3366, 1035, 23561, 1035, 5418, 1006, 5418, 1010, 13151, 1027, 9152, 2140, 1007, 1001, 4019, 1996, 5418, 1012, 1996, 2048, 28177, 12083, 2015, 9239, 1996, 6376, 17546, 17180, 2015, 1001, 2067, 2000, 2037, 2434, 2433, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb
Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_worker_pool_instance_metrics_as_lazy
def list_worker_pool_instance_metrics_as_lazy(resource_group_name, name, worker_pool_name, instance, details:nil, filter:nil, custom_headers:nil) response = list_worker_pool_instance_metrics_async(resource_group_name, name, worker_pool_name, instance, details:details, filter:filter, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_worker_pool_instance_metrics_next_async(next_page_link, custom_headers:custom_headers) end page end end
ruby
def list_worker_pool_instance_metrics_as_lazy(resource_group_name, name, worker_pool_name, instance, details:nil, filter:nil, custom_headers:nil) response = list_worker_pool_instance_metrics_async(resource_group_name, name, worker_pool_name, instance, details:details, filter:filter, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_worker_pool_instance_metrics_next_async(next_page_link, custom_headers:custom_headers) end page end end
[ "def", "list_worker_pool_instance_metrics_as_lazy", "(", "resource_group_name", ",", "name", ",", "worker_pool_name", ",", "instance", ",", "details", ":", "nil", ",", "filter", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_worker_pool_i...
Get metrics for a specific instance of a worker pool of an App Service Environment. Get metrics for a specific instance of a worker pool of an App Service Environment. @param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param worker_pool_name [String] Name of the worker pool. @param instance [String] Name of the instance in the worker pool. @param details [Boolean] Specify <code>true</code> to include instance details. The default is <code>false</code>. @param filter [String] Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ResourceMetricCollection] which provide lazy access to pages of the response.
[ "Get", "metrics", "for", "a", "specific", "instance", "of", "a", "worker", "pool", "of", "an", "App", "Service", "Environment", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L7890-L7899
train
Gets metrics for a worker pool instance.
[ 30522, 13366, 2862, 1035, 7309, 1035, 4770, 1035, 6013, 1035, 12046, 2015, 1035, 2004, 1035, 13971, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2171, 1010, 7309, 1035, 4770, 1035, 2171, 1010, 6013, 1010, 4751, 1024, 9152, 2140, 1010, 11307, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
zendesk/ruby-kafka
lib/kafka/client.rb
Kafka.Client.each_message
def each_message(topic:, start_from_beginning: true, max_wait_time: 5, min_bytes: 1, max_bytes: 1048576, &block) default_offset ||= start_from_beginning ? :earliest : :latest offsets = Hash.new { default_offset } loop do operation = FetchOperation.new( cluster: @cluster, logger: @logger, min_bytes: min_bytes, max_wait_time: max_wait_time, ) @cluster.partitions_for(topic).map(&:partition_id).each do |partition| partition_offset = offsets[partition] operation.fetch_from_partition(topic, partition, offset: partition_offset, max_bytes: max_bytes) end batches = operation.execute batches.each do |batch| batch.messages.each(&block) offsets[batch.partition] = batch.last_offset + 1 unless batch.unknown_last_offset? end end end
ruby
def each_message(topic:, start_from_beginning: true, max_wait_time: 5, min_bytes: 1, max_bytes: 1048576, &block) default_offset ||= start_from_beginning ? :earliest : :latest offsets = Hash.new { default_offset } loop do operation = FetchOperation.new( cluster: @cluster, logger: @logger, min_bytes: min_bytes, max_wait_time: max_wait_time, ) @cluster.partitions_for(topic).map(&:partition_id).each do |partition| partition_offset = offsets[partition] operation.fetch_from_partition(topic, partition, offset: partition_offset, max_bytes: max_bytes) end batches = operation.execute batches.each do |batch| batch.messages.each(&block) offsets[batch.partition] = batch.last_offset + 1 unless batch.unknown_last_offset? end end end
[ "def", "each_message", "(", "topic", ":", ",", "start_from_beginning", ":", "true", ",", "max_wait_time", ":", "5", ",", "min_bytes", ":", "1", ",", "max_bytes", ":", "1048576", ",", "&", "block", ")", "default_offset", "||=", "start_from_beginning", "?", ":...
Enumerate all messages in a topic. @param topic [String] the topic to consume messages from. @param start_from_beginning [Boolean] whether to start from the beginning of the topic or just subscribe to new messages being produced. @param max_wait_time [Integer] the maximum amount of time to wait before the server responds, in seconds. @param min_bytes [Integer] the minimum number of bytes to wait for. If set to zero, the broker will respond immediately, but the response may be empty. The default is 1 byte, which means that the broker will respond as soon as a message is written to the partition. @param max_bytes [Integer] the maximum number of bytes to include in the response message set. Default is 1 MB. You need to set this higher if you expect messages to be larger than this. @return [nil]
[ "Enumerate", "all", "messages", "in", "a", "topic", "." ]
2a73471b6a607a52dc85c79301ba522acb4566b5
https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/client.rb#L506-L530
train
Yields each message from a topic
[ 30522, 13366, 2169, 1035, 4471, 1006, 8476, 1024, 1010, 2707, 1035, 2013, 1035, 2927, 1024, 2995, 1010, 4098, 1035, 3524, 1035, 2051, 1024, 1019, 1010, 8117, 1035, 27507, 1024, 1015, 1010, 4098, 1035, 27507, 1024, 9645, 27531, 2581, 2575, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
alexreisner/geocoder
lib/geocoder/calculations.rb
Geocoder.Calculations.compass_point
def compass_point(bearing, points = COMPASS_POINTS) seg_size = 360.0 / points.size points[((bearing + (seg_size / 2)) % 360) / seg_size] end
ruby
def compass_point(bearing, points = COMPASS_POINTS) seg_size = 360.0 / points.size points[((bearing + (seg_size / 2)) % 360) / seg_size] end
[ "def", "compass_point", "(", "bearing", ",", "points", "=", "COMPASS_POINTS", ")", "seg_size", "=", "360.0", "/", "points", ".", "size", "points", "[", "(", "(", "bearing", "+", "(", "seg_size", "/", "2", ")", ")", "%", "360", ")", "/", "seg_size", "...
Translate a bearing (float) into a compass direction (string, eg "North").
[ "Translate", "a", "bearing", "(", "float", ")", "into", "a", "compass", "direction", "(", "string", "eg", "North", ")", "." ]
e087dc2759264ee6f307b926bb2de4ec2406859e
https://github.com/alexreisner/geocoder/blob/e087dc2759264ee6f307b926bb2de4ec2406859e/lib/geocoder/calculations.rb#L156-L159
train
Returns the compass point for the given neighbouring
[ 30522, 13366, 16681, 1035, 2391, 1006, 7682, 1010, 2685, 1027, 16681, 1035, 2685, 1007, 7367, 2290, 1035, 2946, 1027, 9475, 1012, 1014, 1013, 2685, 1012, 2946, 2685, 1031, 1006, 1006, 7682, 1009, 1006, 7367, 2290, 1035, 2946, 1013, 1016, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
roo-rb/roo
lib/roo/open_office.rb
Roo.OpenOffice.decrypt_if_necessary
def decrypt_if_necessary( zip_file, content_entry, roo_content_xml_path, options ) # Check if content.xml is encrypted by extracting manifest.xml # and searching for a manifest:encryption-data element if (manifest_entry = zip_file.glob('META-INF/manifest.xml').first) roo_manifest_xml_path = File.join(@tmpdir, 'roo_manifest.xml') manifest_entry.extract(roo_manifest_xml_path) manifest = ::Roo::Utils.load_xml(roo_manifest_xml_path) # XPath search for manifest:encryption-data only for the content.xml # file encryption_data = manifest.xpath( "//manifest:file-entry[@manifest:full-path='content.xml']"\ "/manifest:encryption-data" ).first # If XPath returns a node, then we know content.xml is encrypted unless encryption_data.nil? # Since we know it's encrypted, we check for the password option # and if it doesn't exist, raise an argument error password = options[:password] if !password.nil? perform_decryption( encryption_data, password, content_entry, roo_content_xml_path ) else fail ArgumentError, 'file is encrypted but password was not supplied' end end else fail ArgumentError, 'file missing required META-INF/manifest.xml' end end
ruby
def decrypt_if_necessary( zip_file, content_entry, roo_content_xml_path, options ) # Check if content.xml is encrypted by extracting manifest.xml # and searching for a manifest:encryption-data element if (manifest_entry = zip_file.glob('META-INF/manifest.xml').first) roo_manifest_xml_path = File.join(@tmpdir, 'roo_manifest.xml') manifest_entry.extract(roo_manifest_xml_path) manifest = ::Roo::Utils.load_xml(roo_manifest_xml_path) # XPath search for manifest:encryption-data only for the content.xml # file encryption_data = manifest.xpath( "//manifest:file-entry[@manifest:full-path='content.xml']"\ "/manifest:encryption-data" ).first # If XPath returns a node, then we know content.xml is encrypted unless encryption_data.nil? # Since we know it's encrypted, we check for the password option # and if it doesn't exist, raise an argument error password = options[:password] if !password.nil? perform_decryption( encryption_data, password, content_entry, roo_content_xml_path ) else fail ArgumentError, 'file is encrypted but password was not supplied' end end else fail ArgumentError, 'file missing required META-INF/manifest.xml' end end
[ "def", "decrypt_if_necessary", "(", "zip_file", ",", "content_entry", ",", "roo_content_xml_path", ",", "options", ")", "# Check if content.xml is encrypted by extracting manifest.xml", "# and searching for a manifest:encryption-data element", "if", "(", "manifest_entry", "=", "zip...
If the ODS file has an encryption-data element, then try to decrypt. If successful, the temporary content.xml will be overwritten with decrypted contents.
[ "If", "the", "ODS", "file", "has", "an", "encryption", "-", "data", "element", "then", "try", "to", "decrypt", ".", "If", "successful", "the", "temporary", "content", ".", "xml", "will", "be", "overwritten", "with", "decrypted", "contents", "." ]
4ec1104f0c3c2a29711c0c907371cd2be12bcc3c
https://github.com/roo-rb/roo/blob/4ec1104f0c3c2a29711c0c907371cd2be12bcc3c/lib/roo/open_office.rb#L227-L270
train
Perform the decryption if necessary
[ 30522, 13366, 11703, 2854, 13876, 1035, 2065, 1035, 4072, 1006, 14101, 1035, 5371, 1010, 4180, 1035, 4443, 1010, 20996, 2080, 1035, 4180, 1035, 20950, 1035, 4130, 1010, 7047, 1007, 1001, 4638, 2065, 4180, 1012, 20950, 2003, 4372, 26775, 225...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
github-changelog-generator/github-changelog-generator
lib/github_changelog_generator/generator/section.rb
GitHubChangelogGenerator.Section.get_string_for_issue
def get_string_for_issue(issue) encapsulated_title = encapsulate_string issue["title"] title_with_number = "#{encapsulated_title} [\\##{issue['number']}](#{issue['html_url']})" title_with_number = "#{title_with_number}#{line_labels_for(issue)}" if @options[:issue_line_labels].present? line = issue_line_with_user(title_with_number, issue) issue_line_with_body(line, issue) end
ruby
def get_string_for_issue(issue) encapsulated_title = encapsulate_string issue["title"] title_with_number = "#{encapsulated_title} [\\##{issue['number']}](#{issue['html_url']})" title_with_number = "#{title_with_number}#{line_labels_for(issue)}" if @options[:issue_line_labels].present? line = issue_line_with_user(title_with_number, issue) issue_line_with_body(line, issue) end
[ "def", "get_string_for_issue", "(", "issue", ")", "encapsulated_title", "=", "encapsulate_string", "issue", "[", "\"title\"", "]", "title_with_number", "=", "\"#{encapsulated_title} [\\\\##{issue['number']}](#{issue['html_url']})\"", "title_with_number", "=", "\"#{title_with_number...
Parse issue and generate single line formatted issue line. Example output: - Add coveralls integration [\#223](https://github.com/github-changelog-generator/github-changelog-generator/pull/223) (@github-changelog-generator) @param [Hash] issue Fetched issue from GitHub @return [String] Markdown-formatted single issue
[ "Parse", "issue", "and", "generate", "single", "line", "formatted", "issue", "line", "." ]
f18c64b5cc0d7473b059275b88385ac11ca8b564
https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/generator/section.rb#L48-L55
train
Returns the string for an issue
[ 30522, 13366, 2131, 1035, 5164, 1035, 2005, 1035, 3277, 1006, 3277, 1007, 4372, 17695, 23722, 4383, 1035, 2516, 30524, 3277, 1031, 1005, 16129, 1035, 24471, 2140, 1005, 1033, 1065, 1007, 1000, 2516, 1035, 2007, 1035, 2193, 1027, 1000, 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_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb
Azure::Network::Mgmt::V2019_02_01.ApplicationGateways.begin_start
def begin_start(resource_group_name, application_gateway_name, custom_headers:nil) response = begin_start_async(resource_group_name, application_gateway_name, custom_headers:custom_headers).value! nil end
ruby
def begin_start(resource_group_name, application_gateway_name, custom_headers:nil) response = begin_start_async(resource_group_name, application_gateway_name, custom_headers:custom_headers).value! nil end
[ "def", "begin_start", "(", "resource_group_name", ",", "application_gateway_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_start_async", "(", "resource_group_name", ",", "application_gateway_name", ",", "custom_headers", ":custom_headers", ")", "."...
Starts the specified application gateway. @param resource_group_name [String] The name of the resource group. @param application_gateway_name [String] The name of the application gateway. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Starts", "the", "specified", "application", "gateway", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb#L1541-L1544
train
Starts an application gateway in a resource group.
[ 30522, 13366, 4088, 1035, 2707, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4646, 1035, 11909, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 2707, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_backup_policy_list_with_http_info
def get_backup_policy_list_with_http_info(continuation_token:nil, max_results:0, timeout:60, custom_headers:nil) get_backup_policy_list_async(continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def get_backup_policy_list_with_http_info(continuation_token:nil, max_results:0, timeout:60, custom_headers:nil) get_backup_policy_list_async(continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "get_backup_policy_list_with_http_info", "(", "continuation_token", ":", "nil", ",", "max_results", ":", "0", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "get_backup_policy_list_async", "(", "continuation_token", ":continuation_token", ",",...
Gets all the backup policies configured. Get a list of all the backup policies configured. @param continuation_token [String] The continuation token parameter is used to obtain next set of results. A continuation token with a non empty value is included in the response of the API when the results from the system do not fit in a single response. When this value is passed to the next API call, the API returns next set of results. If there are no further results then the continuation token does not contain a value. The value of this parameter should not be URL encoded. @param max_results [Integer] The maximum number of results to be returned as part of the paged queries. This parameter defines the upper bound on the number of results returned. The results returned can be less than the specified maximum results if they do not fit in the message as per the max message size restrictions defined in the configuration. If this parameter is zero or not specified, the paged queries includes as many results as possible that fit in the return message. @param 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", "all", "the", "backup", "policies", "configured", "." ]
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#L22477-L22479
train
Gets backup policy list.
[ 30522, 13366, 2131, 1035, 10200, 1035, 3343, 1035, 2862, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 13633, 1035, 19204, 1024, 9152, 2140, 1010, 4098, 1035, 3463, 1024, 1014, 1010, 2051, 5833, 1024, 3438, 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...
meew0/discordrb
lib/discordrb/bot.rb
Discordrb.Bot.find_emoji
def find_emoji(name) LOGGER.out("Resolving emoji #{name}") emoji.find { |element| element.name == name } end
ruby
def find_emoji(name) LOGGER.out("Resolving emoji #{name}") emoji.find { |element| element.name == name } end
[ "def", "find_emoji", "(", "name", ")", "LOGGER", ".", "out", "(", "\"Resolving emoji #{name}\"", ")", "emoji", ".", "find", "{", "|", "element", "|", "element", ".", "name", "==", "name", "}", "end" ]
Finds an emoji by its name. @param name [String] The emoji name that should be resolved. @return [GlobalEmoji, nil] the emoji identified by the name, or `nil` if it couldn't be found.
[ "Finds", "an", "emoji", "by", "its", "name", "." ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L189-L192
train
Finds an emoji by name
[ 30522, 13366, 2424, 1035, 7861, 29147, 2072, 1006, 2171, 1007, 8833, 4590, 1012, 2041, 1006, 1000, 29304, 7861, 29147, 2072, 1001, 1063, 2171, 1065, 1000, 1007, 7861, 29147, 2072, 1012, 2424, 1063, 1064, 5783, 1064, 5783, 1012, 2171, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/public_ipaddresses.rb
Azure::Network::Mgmt::V2018_07_01.PublicIPAddresses.begin_update_tags
def begin_update_tags(resource_group_name, public_ip_address_name, parameters, custom_headers:nil) response = begin_update_tags_async(resource_group_name, public_ip_address_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_update_tags(resource_group_name, public_ip_address_name, parameters, custom_headers:nil) response = begin_update_tags_async(resource_group_name, public_ip_address_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_update_tags", "(", "resource_group_name", ",", "public_ip_address_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_update_tags_async", "(", "resource_group_name", ",", "public_ip_address_name", ",", "parameters", ",",...
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 [PublicIPAddress] operation results.
[ "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#L630-L633
train
Updates the tags on an existing public IP address.
[ 30522, 13366, 4088, 1035, 10651, 1035, 22073, 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, 3433, 1027, 4088, 1035, 10651, 1035, 2207...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rmagick/rmagick
lib/rvg/rvg.rb
Magick.RVG.background_fill=
def background_fill=(color) warn 'background_fill= has no effect in nested RVG objects' if @nested if !color.is_a?(Magick::Pixel) begin @background_fill = Magick::Pixel.from_color(color) rescue Magick::ImageMagickError raise ArgumentError, "unknown color `#{color}'" rescue TypeError raise TypeError, "cannot convert #{color.class} into Pixel" rescue StandardError raise ArgumentError, "argument must be a color name or a Pixel (got #{color.class})" end else @background_fill = color end end
ruby
def background_fill=(color) warn 'background_fill= has no effect in nested RVG objects' if @nested if !color.is_a?(Magick::Pixel) begin @background_fill = Magick::Pixel.from_color(color) rescue Magick::ImageMagickError raise ArgumentError, "unknown color `#{color}'" rescue TypeError raise TypeError, "cannot convert #{color.class} into Pixel" rescue StandardError raise ArgumentError, "argument must be a color name or a Pixel (got #{color.class})" end else @background_fill = color end end
[ "def", "background_fill", "=", "(", "color", ")", "warn", "'background_fill= has no effect in nested RVG objects'", "if", "@nested", "if", "!", "color", ".", "is_a?", "(", "Magick", "::", "Pixel", ")", "begin", "@background_fill", "=", "Magick", "::", "Pixel", "."...
Sets the canvas background color. Either a Magick::Pixel or a color name. The default fill is "none", that is, transparent black.
[ "Sets", "the", "canvas", "background", "color", ".", "Either", "a", "Magick", "::", "Pixel", "or", "a", "color", "name", ".", "The", "default", "fill", "is", "none", "that", "is", "transparent", "black", "." ]
ef6688ed9d76bf123c2ea1a483eff8635051adb7
https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rvg/rvg.rb#L171-L186
train
Sets the background fill color for this image.
[ 30522, 13366, 4281, 1035, 6039, 1027, 1006, 3609, 1007, 11582, 1005, 4281, 1035, 6039, 30524, 1005, 2065, 1030, 9089, 2098, 2065, 999, 3609, 1012, 2003, 1035, 1037, 1029, 1006, 3894, 2243, 1024, 1024, 22138, 1007, 4088, 1030, 4281, 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...
RailsEventStore/rails_event_store
ruby_event_store/lib/ruby_event_store/client.rb
RubyEventStore.Client.within
def within(&block) raise ArgumentError if block.nil? Within.new(block, broker) end
ruby
def within(&block) raise ArgumentError if block.nil? Within.new(block, broker) end
[ "def", "within", "(", "&", "block", ")", "raise", "ArgumentError", "if", "block", ".", "nil?", "Within", ".", "new", "(", "block", ",", "broker", ")", "end" ]
Use for starting temporary subscriptions. {http://railseventstore.org/docs/subscribe/#temporary-subscriptions Read more} @param block [Proc] block of code during which the temporary subscriptions will be active @return [Within] builder object which collects temporary subscriptions
[ "Use", "for", "starting", "temporary", "subscriptions", ".", "{", "http", ":", "//", "railseventstore", ".", "org", "/", "docs", "/", "subscribe", "/", "#temporary", "-", "subscriptions", "Read", "more", "}" ]
3ee4f3148499794154ee6fec74ccf6d4670d85ac
https://github.com/RailsEventStore/rails_event_store/blob/3ee4f3148499794154ee6fec74ccf6d4670d85ac/ruby_event_store/lib/ruby_event_store/client.rb#L200-L203
train
Returns the index of the object within the given block.
[ 30522, 13366, 2306, 1006, 1004, 3796, 1007, 5333, 6685, 2121, 29165, 2065, 3796, 1012, 9152, 2140, 1029, 2306, 1012, 2047, 1006, 3796, 1010, 20138, 1007, 2203, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
guard/guard
lib/guard/plugin_util.rb
Guard.PluginUtil.add_to_guardfile
def add_to_guardfile klass = plugin_class # call here to avoid failing later require_relative "guardfile/evaluator" # TODO: move this to Generator? options = Guard.state.session.evaluator_options evaluator = Guardfile::Evaluator.new(options) begin evaluator.evaluate rescue Guard::Guardfile::Evaluator::NoPluginsError end if evaluator.guardfile_include?(name) UI.info "Guardfile already includes #{ name } guard" else content = File.read("Guardfile") File.open("Guardfile", "wb") do |f| f.puts(content) f.puts("") f.puts(klass.template(plugin_location)) end UI.info INFO_ADDED_GUARD_TO_GUARDFILE % name end end
ruby
def add_to_guardfile klass = plugin_class # call here to avoid failing later require_relative "guardfile/evaluator" # TODO: move this to Generator? options = Guard.state.session.evaluator_options evaluator = Guardfile::Evaluator.new(options) begin evaluator.evaluate rescue Guard::Guardfile::Evaluator::NoPluginsError end if evaluator.guardfile_include?(name) UI.info "Guardfile already includes #{ name } guard" else content = File.read("Guardfile") File.open("Guardfile", "wb") do |f| f.puts(content) f.puts("") f.puts(klass.template(plugin_location)) end UI.info INFO_ADDED_GUARD_TO_GUARDFILE % name end end
[ "def", "add_to_guardfile", "klass", "=", "plugin_class", "# call here to avoid failing later", "require_relative", "\"guardfile/evaluator\"", "# TODO: move this to Generator?", "options", "=", "Guard", ".", "state", ".", "session", ".", "evaluator_options", "evaluator", "=", ...
Adds a plugin's template to the Guardfile.
[ "Adds", "a", "plugin", "s", "template", "to", "the", "Guardfile", "." ]
e2508cd83badf0d537dbaba35d307adc35d92e4f
https://github.com/guard/guard/blob/e2508cd83badf0d537dbaba35d307adc35d92e4f/lib/guard/plugin_util.rb#L126-L150
train
Add the guard to the Guardfile
[ 30522, 13366, 5587, 1035, 2000, 1035, 3457, 8873, 2571, 1047, 27102, 1027, 13354, 2378, 1035, 2465, 1001, 2655, 2182, 2000, 4468, 7989, 2101, 5478, 1035, 5816, 1000, 3457, 8873, 2571, 1013, 9345, 7630, 8844, 1000, 1001, 28681, 2080, 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_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb
Azure::MediaServices::Mgmt::V2018_07_01.LiveEvents.reset_async
def reset_async(resource_group_name, account_name, live_event_name, custom_headers:nil) # Send request promise = begin_reset_async(resource_group_name, account_name, live_event_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 reset_async(resource_group_name, account_name, live_event_name, custom_headers:nil) # Send request promise = begin_reset_async(resource_group_name, account_name, live_event_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", "reset_async", "(", "resource_group_name", ",", "account_name", ",", "live_event_name", ",", "custom_headers", ":", "nil", ")", "# Send request", "promise", "=", "begin_reset_async", "(", "resource_group_name", ",", "account_name", ",", "live_event_name", ",", ...
@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 live_event_name [String] The name of the Live Event. @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", "within", "the", "Azure", "subscription", ".", "@param", "account_name", "[", "String", "]", "The", "Media", "Services", "account", "name", ".", "@param", "li...
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/live_events.rb#L497-L511
train
Resets a live event.
[ 30522, 13366, 25141, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4070, 1035, 2171, 1010, 2444, 1035, 2724, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 1001, 4604, 5227, 4872, 1027, 4088, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb
Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.reimage_all
def reimage_all(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil) response = reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value! nil end
ruby
def reimage_all(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil) response = reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value! nil end
[ "def", "reimage_all", "(", "resource_group_name", ",", "vm_scale_set_name", ",", "vm_instance_ids", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "reimage_all_async", "(", "resource_group_name", ",", "vm_scale_set_name", ",", "vm_instance_ids", ...
Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks. @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.
[ "Reimages", "all", "the", "disks", "(", "including", "data", "disks", ")", "in", "the", "virtual", "machines", "in", "a", "VM", "scale", "set", ".", "This", "operation", "is", "only", "supported", "for", "managed", "disks", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1104-L1107
train
Reimage all virtual machines in a VM scale set.
[ 30522, 13366, 24964, 26860, 1035, 2035, 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, 9152, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.create_service_from_template_with_http_info
def create_service_from_template_with_http_info(application_id, service_from_template_description, timeout:60, custom_headers:nil) create_service_from_template_async(application_id, service_from_template_description, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def create_service_from_template_with_http_info(application_id, service_from_template_description, timeout:60, custom_headers:nil) create_service_from_template_async(application_id, service_from_template_description, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "create_service_from_template_with_http_info", "(", "application_id", ",", "service_from_template_description", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "create_service_from_template_async", "(", "application_id", ",", "service_from_template_des...
Creates a Service Fabric service from the service template. Creates a Service Fabric service from the service template defined in the application manifest. A service template contains the properties that will be same for the service instance of the same type. The API allows overriding the properties that are usually different for different services of the same service type. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. @param service_from_template_description [ServiceFromTemplateDescription] Describes the service that needs to be created from the template defined in the application manifest. @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", "a", "Service", "Fabric", "service", "from", "the", "service", "template", "." ]
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#L10292-L10294
train
Creates a service from a template.
[ 30522, 13366, 3443, 1035, 2326, 1035, 2013, 1035, 23561, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 4646, 1035, 8909, 1010, 2326, 1035, 2013, 1035, 23561, 1035, 6412, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb
Azure::CDN::Mgmt::V2017_04_02.Endpoints.list_by_profile_next
def list_by_profile_next(next_page_link, custom_headers:nil) response = list_by_profile_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_by_profile_next(next_page_link, custom_headers:nil) response = list_by_profile_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_by_profile_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_by_profile_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "body", "unless", "respon...
Lists existing CDN endpoints. @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 [EndpointListResult] operation results.
[ "Lists", "existing", "CDN", "endpoints", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb#L1701-L1704
train
Gets the list of a service account s terms.
[ 30522, 13366, 2862, 1035, 2011, 1035, 6337, 1035, 2279, 1006, 2279, 1035, 3931, 1035, 4957, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 2011, 1035, 6337, 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
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_partition_restore_progress
def get_partition_restore_progress(partition_id, timeout:60, custom_headers:nil) response = get_partition_restore_progress_async(partition_id, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_partition_restore_progress(partition_id, timeout:60, custom_headers:nil) response = get_partition_restore_progress_async(partition_id, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_partition_restore_progress", "(", "partition_id", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_partition_restore_progress_async", "(", "partition_id", ",", "timeout", ":", "timeout", ",", "custom_headers", ":cust...
Gets details for the latest restore operation triggered for this partition. Returns information about the state of the latest restore operation along with details or failure reason in case of completion. @param partition_id The identity of the partition. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [RestoreProgressInfo] operation results.
[ "Gets", "details", "for", "the", "latest", "restore", "operation", "triggered", "for", "this", "partition", "." ]
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#L25842-L25845
train
Gets the current state of the restore of the partition.
[ 30522, 13366, 2131, 1035, 13571, 1035, 9239, 1035, 5082, 1006, 13571, 1035, 8909, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 13571, 1035, 9239, 1035, 5082, 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...
minimagick/minimagick
lib/mini_magick/image.rb
MiniMagick.Image.format
def format(format, page = 0, read_opts={}) if @tempfile new_tempfile = MiniMagick::Utilities.tempfile(".#{format}") new_path = new_tempfile.path else new_path = Pathname(path).sub_ext(".#{format}").to_s end input_path = path.dup input_path << "[#{page}]" if page && !layer? MiniMagick::Tool::Convert.new do |convert| read_opts.each do |opt, val| convert.send(opt.to_s, val) end convert << input_path yield convert if block_given? convert << new_path end if @tempfile destroy! @tempfile = new_tempfile else File.delete(path) unless path == new_path || layer? end path.replace new_path @info.clear self end
ruby
def format(format, page = 0, read_opts={}) if @tempfile new_tempfile = MiniMagick::Utilities.tempfile(".#{format}") new_path = new_tempfile.path else new_path = Pathname(path).sub_ext(".#{format}").to_s end input_path = path.dup input_path << "[#{page}]" if page && !layer? MiniMagick::Tool::Convert.new do |convert| read_opts.each do |opt, val| convert.send(opt.to_s, val) end convert << input_path yield convert if block_given? convert << new_path end if @tempfile destroy! @tempfile = new_tempfile else File.delete(path) unless path == new_path || layer? end path.replace new_path @info.clear self end
[ "def", "format", "(", "format", ",", "page", "=", "0", ",", "read_opts", "=", "{", "}", ")", "if", "@tempfile", "new_tempfile", "=", "MiniMagick", "::", "Utilities", ".", "tempfile", "(", "\".#{format}\"", ")", "new_path", "=", "new_tempfile", ".", "path",...
This is used to change the format of the image. That is, from "tiff to jpg" or something like that. Once you run it, the instance is pointing to a new file with a new extension! *DANGER*: This renames the file that the instance is pointing to. So, if you manually opened the file with Image.new(file_path)... Then that file is DELETED! If you used Image.open(file) then you are OK. The original file will still be there. But, any changes to it might not be... Formatting an animation into a non-animated type will result in ImageMagick creating multiple pages (starting with 0). You can choose which page you want to manipulate. We default to the first page. If you would like to convert between animated formats, pass nil as your page and ImageMagick will copy all of the pages. @param format [String] The target format... Like 'jpg', 'gif', 'tiff' etc. @param page [Integer] If this is an animated gif, say which 'page' you want with an integer. Default 0 will convert only the first page; 'nil' will convert all pages. @param read_opts [Hash] Any read options to be passed to ImageMagick for example: image.format('jpg', page, {density: '300'}) @yield [MiniMagick::Tool::Convert] It optionally yields the command, if you want to add something. @return [self]
[ "This", "is", "used", "to", "change", "the", "format", "of", "the", "image", ".", "That", "is", "from", "tiff", "to", "jpg", "or", "something", "like", "that", ".", "Once", "you", "run", "it", "the", "instance", "is", "pointing", "to", "a", "new", "f...
d484786f35e91f107836d3c86aca61d50a35820b
https://github.com/minimagick/minimagick/blob/d484786f35e91f107836d3c86aca61d50a35820b/lib/mini_magick/image.rb#L395-L426
train
Format the file into the specified format.
[ 30522, 13366, 4289, 1006, 4289, 1010, 3931, 1027, 1014, 1010, 3191, 1035, 23569, 2015, 1027, 1063, 1065, 1007, 2065, 1030, 8915, 8737, 8873, 2571, 2047, 1035, 8915, 8737, 8873, 2571, 1027, 7163, 2863, 12863, 2243, 1024, 1024, 16548, 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...
github/linguist
samples/Ruby/sinatra.rb
Sinatra.Base.handle_exception!
def handle_exception!(boom) @env['sinatra.error'] = boom if boom.respond_to? :http_status status(boom.http_status) elsif settings.use_code? and boom.respond_to? :code and boom.code.between? 400, 599 status(boom.code) else status(500) end status(500) unless status.between? 400, 599 if server_error? dump_errors! boom if settings.dump_errors? raise boom if settings.show_exceptions? and settings.show_exceptions != :after_handler end if not_found? headers['X-Cascade'] = 'pass' body '<h1>Not Found</h1>' end res = error_block!(boom.class, boom) || error_block!(status, boom) return res if res or not server_error? raise boom if settings.raise_errors? or settings.show_exceptions? error_block! Exception, boom end
ruby
def handle_exception!(boom) @env['sinatra.error'] = boom if boom.respond_to? :http_status status(boom.http_status) elsif settings.use_code? and boom.respond_to? :code and boom.code.between? 400, 599 status(boom.code) else status(500) end status(500) unless status.between? 400, 599 if server_error? dump_errors! boom if settings.dump_errors? raise boom if settings.show_exceptions? and settings.show_exceptions != :after_handler end if not_found? headers['X-Cascade'] = 'pass' body '<h1>Not Found</h1>' end res = error_block!(boom.class, boom) || error_block!(status, boom) return res if res or not server_error? raise boom if settings.raise_errors? or settings.show_exceptions? error_block! Exception, boom end
[ "def", "handle_exception!", "(", "boom", ")", "@env", "[", "'sinatra.error'", "]", "=", "boom", "if", "boom", ".", "respond_to?", ":http_status", "status", "(", "boom", ".", "http_status", ")", "elsif", "settings", ".", "use_code?", "and", "boom", ".", "resp...
Error handling during requests.
[ "Error", "handling", "during", "requests", "." ]
9116c90fcbb82ac03b4b33c58cfbde1fcf745e99
https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/samples/Ruby/sinatra.rb#L958-L985
train
Handle exceptions
[ 30522, 13366, 5047, 1035, 6453, 999, 1006, 8797, 1007, 1030, 4372, 2615, 1031, 1005, 19643, 1012, 7561, 1005, 1033, 1027, 8797, 2065, 8797, 1012, 6869, 1035, 2000, 1029, 1024, 8299, 1035, 3570, 3570, 1006, 8797, 1012, 8299, 1035, 3570, 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...
hashicorp/vault-ruby
lib/vault/api/auth_token.rb
Vault.AuthToken.create_with_role
def create_with_role(name, options = {}) headers = extract_headers!(options) json = client.post("/v1/auth/token/create/#{encode_path(name)}", JSON.fast_generate(options), headers) return Secret.decode(json) end
ruby
def create_with_role(name, options = {}) headers = extract_headers!(options) json = client.post("/v1/auth/token/create/#{encode_path(name)}", JSON.fast_generate(options), headers) return Secret.decode(json) end
[ "def", "create_with_role", "(", "name", ",", "options", "=", "{", "}", ")", "headers", "=", "extract_headers!", "(", "options", ")", "json", "=", "client", ".", "post", "(", "\"/v1/auth/token/create/#{encode_path(name)}\"", ",", "JSON", ".", "fast_generate", "("...
Create an orphaned authentication token. @example Vault.auth_token.create_with_role("developer") #=> #<Vault::Secret lease_id=""> @param [Hash] options @return [Secret]
[ "Create", "an", "orphaned", "authentication", "token", "." ]
02f0532a802ba1a2a0d8703a4585dab76eb9d864
https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/auth_token.rb#L96-L100
train
Create a new token with a role
[ 30522, 13366, 3443, 1035, 2007, 1035, 2535, 1006, 2171, 1010, 7047, 1027, 1063, 1065, 1007, 20346, 2015, 1027, 14817, 1035, 20346, 2015, 999, 1006, 7047, 1007, 1046, 3385, 1027, 7396, 1012, 2695, 1006, 1000, 1013, 1058, 2487, 1013, 8740, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_stream_analytics/lib/2016-03-01/generated/azure_mgmt_stream_analytics/transformations.rb
Azure::StreamAnalytics::Mgmt::V2016_03_01.Transformations.get_with_http_info
def get_with_http_info(resource_group_name, job_name, transformation_name, custom_headers:nil) get_async(resource_group_name, job_name, transformation_name, custom_headers:custom_headers).value! end
ruby
def get_with_http_info(resource_group_name, job_name, transformation_name, custom_headers:nil) get_async(resource_group_name, job_name, transformation_name, custom_headers:custom_headers).value! end
[ "def", "get_with_http_info", "(", "resource_group_name", ",", "job_name", ",", "transformation_name", ",", "custom_headers", ":", "nil", ")", "get_async", "(", "resource_group_name", ",", "job_name", ",", "transformation_name", ",", "custom_headers", ":custom_headers", ...
Gets details about the specified transformation. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param job_name [String] The name of the streaming job. @param transformation_name [String] The name of the transformation. @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", "details", "about", "the", "specified", "transformation", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stream_analytics/lib/2016-03-01/generated/azure_mgmt_stream_analytics/transformations.rb#L354-L356
train
Gets the specified chunk of the image.
[ 30522, 13366, 2131, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 3105, 1035, 2171, 1010, 8651, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, 2004, 6038, 2278, 1006, 7692, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2015-05-01-preview/generated/azure_mgmt_network/network_interfaces.rb
Azure::Network::Mgmt::V2015_05_01_preview.NetworkInterfaces.list_virtual_machine_scale_set_vmnetwork_interfaces
def list_virtual_machine_scale_set_vmnetwork_interfaces(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers:nil) first_page = list_virtual_machine_scale_set_vmnetwork_interfaces_as_lazy(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers:custom_headers) first_page.get_all_items end
ruby
def list_virtual_machine_scale_set_vmnetwork_interfaces(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers:nil) first_page = list_virtual_machine_scale_set_vmnetwork_interfaces_as_lazy(resource_group_name, virtual_machine_scale_set_name, virtualmachine_index, custom_headers:custom_headers) first_page.get_all_items end
[ "def", "list_virtual_machine_scale_set_vmnetwork_interfaces", "(", "resource_group_name", ",", "virtual_machine_scale_set_name", ",", "virtualmachine_index", ",", "custom_headers", ":", "nil", ")", "first_page", "=", "list_virtual_machine_scale_set_vmnetwork_interfaces_as_lazy", "(",...
The list network interface operation retrieves information about all network interfaces in a virtual machine from a virtual machine scale set. @param resource_group_name [String] The name of the resource group. @param virtual_machine_scale_set_name [String] The name of the virtual machine scale set. @param virtualmachine_index [String] The virtual machine index. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array<NetworkInterface>] operation results.
[ "The", "list", "network", "interface", "operation", "retrieves", "information", "about", "all", "network", "interfaces", "in", "a", "virtual", "machine", "from", "a", "virtual", "machine", "scale", "set", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2015-05-01-preview/generated/azure_mgmt_network/network_interfaces.rb#L216-L219
train
Gets all the virtual machine network interfaces in a virtual machine scale set.
[ 30522, 13366, 2862, 1035, 7484, 1035, 3698, 1035, 4094, 1035, 2275, 1035, 1058, 2213, 7159, 6198, 1035, 19706, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 7484, 1035, 3698, 1035, 4094, 1035, 2275, 1035, 2171, 1010, 7484, 22911, 14014, 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_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb
Azure::Storage::Mgmt::V2018_11_01.StorageAccounts.get_properties_with_http_info
def get_properties_with_http_info(resource_group_name, account_name, expand:nil, custom_headers:nil) get_properties_async(resource_group_name, account_name, expand:expand, custom_headers:custom_headers).value! end
ruby
def get_properties_with_http_info(resource_group_name, account_name, expand:nil, custom_headers:nil) get_properties_async(resource_group_name, account_name, expand:expand, custom_headers:custom_headers).value! end
[ "def", "get_properties_with_http_info", "(", "resource_group_name", ",", "account_name", ",", "expand", ":", "nil", ",", "custom_headers", ":", "nil", ")", "get_properties_async", "(", "resource_group_name", ",", "account_name", ",", "expand", ":", "expand", ",", "c...
Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys. @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 expand [StorageAccountExpand] May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats. Possible values include: 'geoReplicationStats' @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Returns", "the", "properties", "for", "the", "specified", "storage", "account", "including", "but", "not", "limited", "to", "name", "SKU", "name", "location", "and", "account", "status", ".", "The", "ListKeys", "operation", "should", "be", "used", "to", "retr...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb#L326-L328
train
Gets the properties of the specified HDInsight account.
[ 30522, 13366, 2131, 1035, 5144, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4070, 1035, 2171, 1010, 7818, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, 5144, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jekyll/jekyll
lib/jekyll/filters.rb
Jekyll.Filters.sort
def sort(input, property = nil, nils = "first") raise ArgumentError, "Cannot sort a null object." if input.nil? if property.nil? input.sort else if nils == "first" order = - 1 elsif nils == "last" order = + 1 else raise ArgumentError, "Invalid nils order: " \ "'#{nils}' is not a valid nils order. It must be 'first' or 'last'." end sort_input(input, property, order) end end
ruby
def sort(input, property = nil, nils = "first") raise ArgumentError, "Cannot sort a null object." if input.nil? if property.nil? input.sort else if nils == "first" order = - 1 elsif nils == "last" order = + 1 else raise ArgumentError, "Invalid nils order: " \ "'#{nils}' is not a valid nils order. It must be 'first' or 'last'." end sort_input(input, property, order) end end
[ "def", "sort", "(", "input", ",", "property", "=", "nil", ",", "nils", "=", "\"first\"", ")", "raise", "ArgumentError", ",", "\"Cannot sort a null object.\"", "if", "input", ".", "nil?", "if", "property", ".", "nil?", "input", ".", "sort", "else", "if", "n...
Sort an array of objects input - the object array property - property within each object to filter by nils ('first' | 'last') - nils appear before or after non-nil values Returns the filtered array of objects
[ "Sort", "an", "array", "of", "objects" ]
fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b
https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/filters.rb#L232-L249
train
Sort an array of objects by the given property.
[ 30522, 13366, 4066, 1006, 7953, 1010, 3200, 1027, 9152, 2140, 1010, 27282, 1027, 1000, 2034, 1000, 1007, 5333, 6685, 2121, 29165, 1010, 1000, 3685, 4066, 1037, 19701, 4874, 1012, 1000, 2065, 7953, 1012, 9152, 2140, 1029, 2065, 3200, 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...
Katello/katello
app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb
Katello.Api::Rhsm::CandlepinProxiesController.async_hypervisors_update
def async_hypervisors_update task = Katello::Resources::Candlepin::Consumer.async_hypervisors(params[:owner], request.raw_post) async_task(::Actions::Katello::Host::Hypervisors, nil, :task_id => task['id']) render :json => task end
ruby
def async_hypervisors_update task = Katello::Resources::Candlepin::Consumer.async_hypervisors(params[:owner], request.raw_post) async_task(::Actions::Katello::Host::Hypervisors, nil, :task_id => task['id']) render :json => task end
[ "def", "async_hypervisors_update", "task", "=", "Katello", "::", "Resources", "::", "Candlepin", "::", "Consumer", ".", "async_hypervisors", "(", "params", "[", ":owner", "]", ",", "request", ".", "raw_post", ")", "async_task", "(", "::", "Actions", "::", "Kat...
api :POST, "/hypervisors/OWNER" Note that this request comes in as content-type 'text/plain' so that tomcat won't parse the json. Here we just pass the plain body through to candlepin
[ "api", ":", "POST", "/", "hypervisors", "/", "OWNER", "Note", "that", "this", "request", "comes", "in", "as", "content", "-", "type", "text", "/", "plain", "so", "that", "tomcat", "won", "t", "parse", "the", "json", ".", "Here", "we", "just", "pass", ...
a1c9280067607999cae43bab89b53ba870856b76
https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb#L121-L126
train
Updates the current task using the current task ID
[ 30522, 13366, 2004, 6038, 2278, 1035, 23760, 11365, 5668, 1035, 10651, 4708, 1027, 5736, 7174, 1024, 1024, 4219, 1024, 1024, 13541, 8091, 1024, 1024, 7325, 1012, 2004, 6038, 2278, 1035, 23760, 11365, 5668, 1006, 11498, 5244, 1031, 1024, 395...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb
Azure::IotHub::Mgmt::V2017_01_19.IotHubResource.get_valid_skus_next
def get_valid_skus_next(next_page_link, custom_headers:nil) response = get_valid_skus_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_valid_skus_next(next_page_link, custom_headers:nil) response = get_valid_skus_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_valid_skus_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_valid_skus_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "body", "unless", "response...
Get the list of valid SKUs for an IoT hub. Get the list of valid SKUs for an IoT hub. @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 [IotHubSkuDescriptionListResult] operation results.
[ "Get", "the", "list", "of", "valid", "SKUs", "for", "an", "IoT", "hub", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb#L2411-L2414
train
Gets the next page of valid SKUs.
[ 30522, 13366, 2131, 1035, 9398, 1035, 15315, 2271, 1035, 2279, 1006, 2279, 1035, 3931, 1035, 4957, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 9398, 1035, 15315, 2271, 1035, 2279, 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...