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
chef/chef
chef-config/lib/chef-config/workstation_config_loader.rb
ChefConfig.WorkstationConfigLoader.find_default_key
def find_default_key(key_names) key_names.each do |filename| path = Pathname.new(filename) # If we have a config location (like ./.chef/), look there first. if config_location local_path = path.expand_path(File.dirname(config_location)) return local_path.to_s if local_path.exist? end # Then check ~/.chef. home_path = path.expand_path(home_chef_dir) return home_path.to_s if home_path.exist? end nil end
ruby
def find_default_key(key_names) key_names.each do |filename| path = Pathname.new(filename) # If we have a config location (like ./.chef/), look there first. if config_location local_path = path.expand_path(File.dirname(config_location)) return local_path.to_s if local_path.exist? end # Then check ~/.chef. home_path = path.expand_path(home_chef_dir) return home_path.to_s if home_path.exist? end nil end
[ "def", "find_default_key", "(", "key_names", ")", "key_names", ".", "each", "do", "|", "filename", "|", "path", "=", "Pathname", ".", "new", "(", "filename", ")", "# If we have a config location (like ./.chef/), look there first.", "if", "config_location", "local_path",...
Look for a default key file. This searches for any of a list of possible default keys, checking both the local `.chef/` folder and the home directory `~/.chef/`. Returns `nil` if no matching file is found. @api private @since 14.3 @param key_names [Array<String>] A list of possible filenames to check for. The first one found will be returned. @return [String, nil]
[ "Look", "for", "a", "default", "key", "file", "." ]
61f69e18e69e0dca6e8cffdcd7451181d874cdb3
https://github.com/chef/chef/blob/61f69e18e69e0dca6e8cffdcd7451181d874cdb3/chef-config/lib/chef-config/workstation_config_loader.rb#L250-L263
train
Find the default key for the given key_names.
[ 30522, 13366, 2424, 1035, 12398, 1035, 3145, 1006, 3145, 1035, 3415, 1007, 3145, 1035, 3415, 1012, 2169, 2079, 1064, 5371, 18442, 1064, 4130, 1027, 4130, 18442, 1012, 2047, 1006, 5371, 18442, 1007, 1001, 2065, 2057, 2031, 1037, 9530, 8873, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/collection.rb
Jekyll.Collection.filtered_entries
def filtered_entries return [] unless exists? @filtered_entries ||= Dir.chdir(directory) do entry_filter.filter(entries).reject do |f| path = collection_dir(f) File.directory?(path) || entry_filter.symlink?(f) end end end
ruby
def filtered_entries return [] unless exists? @filtered_entries ||= Dir.chdir(directory) do entry_filter.filter(entries).reject do |f| path = collection_dir(f) File.directory?(path) || entry_filter.symlink?(f) end end end
[ "def", "filtered_entries", "return", "[", "]", "unless", "exists?", "@filtered_entries", "||=", "Dir", ".", "chdir", "(", "directory", ")", "do", "entry_filter", ".", "filter", "(", "entries", ")", ".", "reject", "do", "|", "f", "|", "path", "=", "collecti...
Filtered version of the entries in this collection. See `Jekyll::EntryFilter#filter` for more information. Returns a list of filtered entry paths.
[ "Filtered", "version", "of", "the", "entries", "in", "this", "collection", ".", "See", "Jekyll", "::", "EntryFilter#filter", "for", "more", "information", "." ]
fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b
https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/collection.rb#L89-L99
train
Returns the filtered entries
[ 30522, 13366, 21839, 1035, 10445, 2709, 1031, 1033, 4983, 6526, 1029, 1030, 21839, 1035, 10445, 1064, 1064, 1027, 16101, 1012, 10381, 4305, 2099, 1006, 14176, 1007, 2079, 4443, 1035, 11307, 1012, 11307, 1006, 10445, 1007, 1012, 15454, 2079, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
cucumber/cucumber-ruby
lib/cucumber/runtime.rb
Cucumber.Runtime.doc_string
def doc_string(string_without_triple_quotes, content_type = '', _line_offset = 0) location = Core::Test::Location.of_caller Core::Test::DocString.new(string_without_triple_quotes, content_type, location) end
ruby
def doc_string(string_without_triple_quotes, content_type = '', _line_offset = 0) location = Core::Test::Location.of_caller Core::Test::DocString.new(string_without_triple_quotes, content_type, location) end
[ "def", "doc_string", "(", "string_without_triple_quotes", ",", "content_type", "=", "''", ",", "_line_offset", "=", "0", ")", "location", "=", "Core", "::", "Test", "::", "Location", ".", "of_caller", "Core", "::", "Test", "::", "DocString", ".", "new", "(",...
Returns Ast::DocString for +string_without_triple_quotes+.
[ "Returns", "Ast", "::", "DocString", "for", "+", "string_without_triple_quotes", "+", "." ]
de3ba2fb9a35b8bcfd5109f610a0c16180d7abf2
https://github.com/cucumber/cucumber-ruby/blob/de3ba2fb9a35b8bcfd5109f610a0c16180d7abf2/lib/cucumber/runtime.rb#L99-L102
train
Returns a DocString object for the given string without triple quotes.
[ 30522, 13366, 9986, 1035, 5164, 1006, 5164, 1035, 2302, 1035, 6420, 1035, 16614, 1010, 4180, 1035, 2828, 1027, 1005, 1005, 1010, 1035, 2240, 1035, 16396, 1027, 1014, 1007, 3295, 1027, 4563, 1024, 1024, 3231, 1024, 1024, 3295, 1012, 1997, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
comfy/comfortable-mexican-sofa
app/helpers/comfy/cms_helper.rb
Comfy.CmsHelper.cms_fragment_content
def cms_fragment_content(identifier, page = @cms_page) frag = page&.fragments&.detect { |f| f.identifier == identifier.to_s } return "" unless frag case frag.tag when "date", "datetime" frag.datetime when "checkbox" frag.boolean when "file", "files" frag.attachments else frag.content end end
ruby
def cms_fragment_content(identifier, page = @cms_page) frag = page&.fragments&.detect { |f| f.identifier == identifier.to_s } return "" unless frag case frag.tag when "date", "datetime" frag.datetime when "checkbox" frag.boolean when "file", "files" frag.attachments else frag.content end end
[ "def", "cms_fragment_content", "(", "identifier", ",", "page", "=", "@cms_page", ")", "frag", "=", "page", "&.", "fragments", "&.", "detect", "{", "|", "f", "|", "f", ".", "identifier", "==", "identifier", ".", "to_s", "}", "return", "\"\"", "unless", "f...
Raw content of a page fragment. This is how you get content from unrenderable tags like {{cms:fragment meta, render: false}} Example: cms_fragment_content(:left_column, CmsPage.first) cms_fragment_content(:left_column) # if @cms_page is present
[ "Raw", "content", "of", "a", "page", "fragment", ".", "This", "is", "how", "you", "get", "content", "from", "unrenderable", "tags", "like", "{{", "cms", ":", "fragment", "meta", "render", ":", "false", "}}", "Example", ":", "cms_fragment_content", "(", ":"...
38a31428f6e2c07d5bda64f0371eebfb29a3abc4
https://github.com/comfy/comfortable-mexican-sofa/blob/38a31428f6e2c07d5bda64f0371eebfb29a3abc4/app/helpers/comfy/cms_helper.rb#L11-L24
train
Returns the content of a given fragment.
[ 30522, 13366, 4642, 2015, 1035, 15778, 1035, 4180, 1006, 8909, 4765, 18095, 1010, 3931, 1027, 1030, 4642, 2015, 1035, 3931, 1007, 25312, 2290, 1027, 3931, 1004, 1012, 10341, 1004, 1012, 11487, 1063, 1064, 1042, 1064, 1042, 1012, 8909, 4765,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/group_users.rb
Azure::ApiManagement::Mgmt::V2016_10_10.GroupUsers.list_by_groups
def list_by_groups(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) first_page = list_by_groups_as_lazy(resource_group_name, service_name, group_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) first_page.get_all_items end
ruby
def list_by_groups(resource_group_name, service_name, group_id, filter:nil, top:nil, skip:nil, custom_headers:nil) first_page = list_by_groups_as_lazy(resource_group_name, service_name, group_id, filter:filter, top:top, skip:skip, custom_headers:custom_headers) first_page.get_all_items end
[ "def", "list_by_groups", "(", "resource_group_name", ",", "service_name", ",", "group_id", ",", "filter", ":", "nil", ",", "top", ":", "nil", ",", "skip", ":", "nil", ",", "custom_headers", ":", "nil", ")", "first_page", "=", "list_by_groups_as_lazy", "(", "...
Lists a collection of the members of the group, specified by its identifier. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param group_id [String] Group identifier. Must be unique in the current API Management service instance. @param filter [String] | Field | Supported operators | Supported functions | |------------------|------------------------|-----------------------------------| | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | | state | eq | N/A | | registrationDate | ge, le, eq, ne, gt, lt | N/A | | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | @param top [Integer] Number of records to return. @param skip [Integer] Number of records to skip. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array<UserContract>] operation results.
[ "Lists", "a", "collection", "of", "the", "members", "of", "the", "group", "specified", "by", "its", "identifier", "." ]
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/group_users.rb#L55-L58
train
Gets all the segmentation groups in a subscription.
[ 30522, 13366, 2862, 1035, 2011, 1035, 2967, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 2177, 1035, 8909, 1010, 11307, 1024, 9152, 2140, 1010, 2327, 1024, 9152, 2140, 1010, 13558, 1024, 9152, 2140, 1010, 7661, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
troessner/reek
lib/reek/context_builder.rb
Reek.ContextBuilder.inside_new_context
def inside_new_context(klass, *args) new_context = append_new_context(klass, *args) orig, self.current_context = current_context, new_context yield self.current_context = orig end
ruby
def inside_new_context(klass, *args) new_context = append_new_context(klass, *args) orig, self.current_context = current_context, new_context yield self.current_context = orig end
[ "def", "inside_new_context", "(", "klass", ",", "*", "args", ")", "new_context", "=", "append_new_context", "(", "klass", ",", "args", ")", "orig", ",", "self", ".", "current_context", "=", "current_context", ",", "new_context", "yield", "self", ".", "current_...
Stores a reference to the current context, creates a nested new one, yields to the given block and then restores the previous context. @param klass [Context::*Context] context class @param args arguments for the class initializer @yield block
[ "Stores", "a", "reference", "to", "the", "current", "context", "creates", "a", "nested", "new", "one", "yields", "to", "the", "given", "block", "and", "then", "restores", "the", "previous", "context", "." ]
8c6b5c0c6228a6981ab48543457889f9ea984054
https://github.com/troessner/reek/blob/8c6b5c0c6228a6981ab48543457889f9ea984054/lib/reek/context_builder.rb#L489-L495
train
This method is used to create a new context for the current context.
[ 30522, 13366, 2503, 1035, 2047, 1035, 6123, 1006, 1047, 27102, 1010, 1008, 12098, 5620, 1007, 2047, 1035, 6123, 1027, 10439, 10497, 1035, 2047, 1035, 6123, 1006, 1047, 27102, 1010, 1008, 12098, 5620, 1007, 2030, 8004, 1010, 2969, 1012, 2783...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mongodb/mongoid
lib/mongoid/criteria.rb
Mongoid.Criteria.only
def only(*args) return clone if args.flatten.empty? args = args.flatten if (args & Fields::IDS).empty? args.unshift(:_id) end if klass.hereditary? super(*args.push(:_type)) else super(*args) end end
ruby
def only(*args) return clone if args.flatten.empty? args = args.flatten if (args & Fields::IDS).empty? args.unshift(:_id) end if klass.hereditary? super(*args.push(:_type)) else super(*args) end end
[ "def", "only", "(", "*", "args", ")", "return", "clone", "if", "args", ".", "flatten", ".", "empty?", "args", "=", "args", ".", "flatten", "if", "(", "args", "&", "Fields", "::", "IDS", ")", ".", "empty?", "args", ".", "unshift", "(", ":_id", ")", ...
Overriden to include _type in the fields. @example Limit the fields returned from the database. Band.only(:name) @param [ Array<Symbol> ] args The names of the fields. @return [ Criteria ] The cloned criteria. @since 1.0.0
[ "Overriden", "to", "include", "_type", "in", "the", "fields", "." ]
56976e32610f4c2450882b0bfe14da099f0703f4
https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/criteria.rb#L287-L298
train
Returns a new object with the same fields as the original object.
[ 30522, 13366, 2069, 1006, 1008, 12098, 5620, 1007, 2709, 17598, 2065, 12098, 5620, 1012, 4257, 6528, 1012, 4064, 1029, 12098, 5620, 1027, 12098, 5620, 1012, 4257, 6528, 2065, 1006, 12098, 5620, 1004, 4249, 1024, 1024, 8909, 2015, 1007, 1012...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
puppetlabs/bolt
lib/plan_executor/orch_client.rb
PlanExecutor.OrchClient.unwrap_sensitive_args
def unwrap_sensitive_args(arguments) # Skip this if Puppet isn't loaded return arguments unless defined?(Puppet::Pops::Types::PSensitiveType::Sensitive) case arguments when Array # iterate over the array, unwrapping all elements arguments.map { |x| unwrap_sensitive_args(x) } when Hash # iterate over the arguments hash and unwrap all keys and values arguments.each_with_object({}) { |(k, v), h| h[unwrap_sensitive_args(k)] = unwrap_sensitive_args(v) } when Puppet::Pops::Types::PSensitiveType::Sensitive # this value is Sensitive, unwrap it unwrap_sensitive_args(arguments.unwrap) else # unknown data type, just return it arguments end end
ruby
def unwrap_sensitive_args(arguments) # Skip this if Puppet isn't loaded return arguments unless defined?(Puppet::Pops::Types::PSensitiveType::Sensitive) case arguments when Array # iterate over the array, unwrapping all elements arguments.map { |x| unwrap_sensitive_args(x) } when Hash # iterate over the arguments hash and unwrap all keys and values arguments.each_with_object({}) { |(k, v), h| h[unwrap_sensitive_args(k)] = unwrap_sensitive_args(v) } when Puppet::Pops::Types::PSensitiveType::Sensitive # this value is Sensitive, unwrap it unwrap_sensitive_args(arguments.unwrap) else # unknown data type, just return it arguments end end
[ "def", "unwrap_sensitive_args", "(", "arguments", ")", "# Skip this if Puppet isn't loaded", "return", "arguments", "unless", "defined?", "(", "Puppet", "::", "Pops", "::", "Types", "::", "PSensitiveType", "::", "Sensitive", ")", "case", "arguments", "when", "Array", ...
Unwraps any Sensitive data in an arguments Hash, so the plain-text is passed to the Task/Script. This works on deeply nested data structures composed of Hashes, Arrays, and and plain-old data types (int, string, etc).
[ "Unwraps", "any", "Sensitive", "data", "in", "an", "arguments", "Hash", "so", "the", "plain", "-", "text", "is", "passed", "to", "the", "Task", "/", "Script", "." ]
50689a33699939d262ea7c822a4b24fd8c4f8d8a
https://github.com/puppetlabs/bolt/blob/50689a33699939d262ea7c822a4b24fd8c4f8d8a/lib/plan_executor/orch_client.rb#L202-L222
train
Unwrap the arguments that are Sensitive
[ 30522, 13366, 4895, 13088, 9331, 1035, 7591, 1035, 12098, 5620, 1006, 9918, 1007, 1001, 13558, 2023, 2065, 13997, 3475, 1005, 1056, 8209, 2709, 9918, 4983, 4225, 1029, 1006, 13997, 1024, 1024, 16949, 1024, 1024, 4127, 1024, 1024, 8827, 6132...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/security_rules.rb
Azure::Network::Mgmt::V2018_07_01.SecurityRules.begin_create_or_update
def begin_create_or_update(resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_create_or_update(resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers:nil) response = begin_create_or_update_async(resource_group_name, network_security_group_name, security_rule_name, security_rule_parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_create_or_update", "(", "resource_group_name", ",", "network_security_group_name", ",", "security_rule_name", ",", "security_rule_parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_create_or_update_async", "(", "resource_group_name", ",...
Creates or updates a security rule in the specified network security group. @param resource_group_name [String] The name of the resource group. @param network_security_group_name [String] The name of the network security group. @param security_rule_name [String] The name of the security rule. @param security_rule_parameters [SecurityRule] Parameters supplied to the create or update network security rule operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [SecurityRule] operation results.
[ "Creates", "or", "updates", "a", "security", "rule", "in", "the", "specified", "network", "security", "group", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/security_rules.rb#L412-L415
train
Creates or updates a network security rule.
[ 30522, 13366, 4088, 1035, 3443, 1035, 2030, 1035, 10651, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2897, 1035, 3036, 1035, 2177, 1035, 2171, 1010, 3036, 1035, 3627, 1035, 2171, 1010, 3036, 1035, 3627, 1035, 11709, 1010, 7661, 1035, 20346, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/job_operations.rb
Azure::Automation::Mgmt::V2015_10_31.JobOperations.get_output
def get_output(resource_group_name, automation_account_name, job_id, custom_headers:nil) response = get_output_async(resource_group_name, automation_account_name, job_id, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_output(resource_group_name, automation_account_name, job_id, custom_headers:nil) response = get_output_async(resource_group_name, automation_account_name, job_id, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_output", "(", "resource_group_name", ",", "automation_account_name", ",", "job_id", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_output_async", "(", "resource_group_name", ",", "automation_account_name", ",", "job_id", ",", "custom_headers",...
Retrieve the job output identified by job id. @param resource_group_name [String] Name of an Azure Resource group. @param automation_account_name [String] The name of the automation account. @param job_id [String] The job id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [NOT_IMPLEMENTED] operation results.
[ "Retrieve", "the", "job", "output", "identified", "by", "job", "id", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/job_operations.rb#L35-L38
train
Gets the output of a job.
[ 30522, 13366, 2131, 1035, 6434, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 19309, 1035, 4070, 1035, 2171, 1010, 3105, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 6434, 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...
Azure/azure-sdk-for-ruby
management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb
Azure::Web::Mgmt::V2018_02_01.Recommendations.disable_recommendation_for_site
def disable_recommendation_for_site(resource_group_name, site_name, name, custom_headers:nil) response = disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:custom_headers).value! nil end
ruby
def disable_recommendation_for_site(resource_group_name, site_name, name, custom_headers:nil) response = disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:custom_headers).value! nil end
[ "def", "disable_recommendation_for_site", "(", "resource_group_name", ",", "site_name", ",", "name", ",", "custom_headers", ":", "nil", ")", "response", "=", "disable_recommendation_for_site_async", "(", "resource_group_name", ",", "site_name", ",", "name", ",", "custom...
Disables the specific rule for a web site permanently. Disables the specific rule for a web site permanently. @param resource_group_name [String] Name of the resource group to which the resource belongs. @param site_name [String] Site name @param name [String] Rule name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Disables", "the", "specific", "rule", "for", "a", "web", "site", "permanently", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb#L872-L875
train
Disables the recommendations for a site.
[ 30522, 13366, 4487, 19150, 1035, 12832, 1035, 2005, 1035, 2609, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2609, 1035, 2171, 1010, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4487, 19150, 1035, 12832, 1035, 2005,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_container_mappings.rb
Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationProtectionContainerMappings.list_by_replication_protection_containers_next
def list_by_replication_protection_containers_next(next_page_link, custom_headers:nil) response = list_by_replication_protection_containers_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_by_replication_protection_containers_next(next_page_link, custom_headers:nil) response = list_by_replication_protection_containers_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_by_replication_protection_containers_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_by_replication_protection_containers_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", ...
Gets the list of protection container mappings for a protection container. Lists the protection container mappings for a protection container. @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 [ProtectionContainerMappingCollection] operation results.
[ "Gets", "the", "list", "of", "protection", "container", "mappings", "for", "a", "protection", "container", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_container_mappings.rb#L951-L954
train
Gets the list of all the elastic network protection containers.
[ 30522, 13366, 2862, 1035, 2011, 1035, 21647, 1035, 3860, 1035, 16143, 1035, 2279, 1006, 2279, 1035, 3931, 1035, 4957, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 2011, 1035, 21647, 1035, 3860, 1035, 16143,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/encoding_utils.rb
Sprockets.EncodingUtils.detect_unicode_bom
def detect_unicode_bom(str) bom_bytes = str.byteslice(0, 4).bytes.to_a BOM.each do |encoding, bytes| if bom_bytes[0, bytes.size] == bytes str = str.dup str.force_encoding(Encoding::BINARY) str.slice!(0, bytes.size) str.force_encoding(encoding) return str end end return str end
ruby
def detect_unicode_bom(str) bom_bytes = str.byteslice(0, 4).bytes.to_a BOM.each do |encoding, bytes| if bom_bytes[0, bytes.size] == bytes str = str.dup str.force_encoding(Encoding::BINARY) str.slice!(0, bytes.size) str.force_encoding(encoding) return str end end return str end
[ "def", "detect_unicode_bom", "(", "str", ")", "bom_bytes", "=", "str", ".", "byteslice", "(", "0", ",", "4", ")", ".", "bytes", ".", "to_a", "BOM", ".", "each", "do", "|", "encoding", ",", "bytes", "|", "if", "bom_bytes", "[", "0", ",", "bytes", "....
Public: Detect and strip BOM from possible unicode string. str - ASCII-8BIT encoded String Returns UTF 8/16/32 encoded String without BOM or the original String if no BOM was present.
[ "Public", ":", "Detect", "and", "strip", "BOM", "from", "possible", "unicode", "string", "." ]
9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd
https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/encoding_utils.rb#L157-L171
train
Detect unicode BOM
[ 30522, 13366, 11487, 1035, 27260, 1035, 8945, 2213, 1006, 2358, 2099, 1007, 8945, 2213, 1035, 27507, 1027, 2358, 2099, 1012, 27507, 13231, 1006, 1014, 1010, 1018, 1007, 1012, 27507, 1012, 2000, 1035, 1037, 8945, 2213, 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...
sensu/sensu
lib/sensu/daemon.rb
Sensu.Daemon.log_notices
def log_notices(notices=[], level=:warn) notices.each do |concern| message = concern.delete(:message) @logger.send(level, message, redact_sensitive(concern)) end end
ruby
def log_notices(notices=[], level=:warn) notices.each do |concern| message = concern.delete(:message) @logger.send(level, message, redact_sensitive(concern)) end end
[ "def", "log_notices", "(", "notices", "=", "[", "]", ",", "level", "=", ":warn", ")", "notices", ".", "each", "do", "|", "concern", "|", "message", "=", "concern", ".", "delete", "(", ":message", ")", "@logger", ".", "send", "(", "level", ",", "messa...
Log setting or extension loading notices, sensitive information is redacted. @param notices [Array] to be logged. @param level [Symbol] to log the notices at.
[ "Log", "setting", "or", "extension", "loading", "notices", "sensitive", "information", "is", "redacted", "." ]
51319e4b58c8d9986f101ad71ff729aa3e51e951
https://github.com/sensu/sensu/blob/51319e4b58c8d9986f101ad71ff729aa3e51e951/lib/sensu/daemon.rb#L111-L116
train
Log the notices
[ 30522, 13366, 8833, 1035, 14444, 1006, 14444, 1027, 1031, 1033, 1010, 2504, 1027, 1024, 11582, 1007, 14444, 1012, 2169, 2079, 1064, 5142, 1064, 4471, 1027, 5142, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
troessner/reek
lib/reek/tree_dresser.rb
Reek.TreeDresser.dress
def dress(sexp, comment_map) return sexp unless sexp.is_a? ::Parser::AST::Node type = sexp.type children = sexp.children.map { |child| dress(child, comment_map) } comments = comment_map[sexp] klass_map.klass_for(type).new(type, children, location: sexp.loc, comments: comments) end
ruby
def dress(sexp, comment_map) return sexp unless sexp.is_a? ::Parser::AST::Node type = sexp.type children = sexp.children.map { |child| dress(child, comment_map) } comments = comment_map[sexp] klass_map.klass_for(type).new(type, children, location: sexp.loc, comments: comments) end
[ "def", "dress", "(", "sexp", ",", "comment_map", ")", "return", "sexp", "unless", "sexp", ".", "is_a?", "::", "Parser", "::", "AST", "::", "Node", "type", "=", "sexp", ".", "type", "children", "=", "sexp", ".", "children", ".", "map", "{", "|", "chil...
Recursively enhance an AST with type-dependent mixins, and comments. See {file:docs/How-reek-works-internally.md} for the big picture of how this works. Example: This class Klazz; def meth(argument); argument.call_me; end; end corresponds to this sexp: (class (const nil :Klazz) nil (def :meth (args (arg :argument)) (send (lvar :argument) :call_me))) where every node is of type Parser::AST::Node. Passing this into `dress` will return the exact same structure, but this time the nodes will contain type-dependent mixins, e.g. this: (const nil :Klazz) will be of type Reek::AST::Node with Reek::AST::SexpExtensions::ConstNode mixed in. @param sexp [Parser::AST::Node] the given sexp @param comment_map [Hash] see the documentation for SourceCode#syntax_tree @return an instance of Reek::AST::Node with type-dependent sexp extensions mixed in. @quality :reek:FeatureEnvy @quality :reek:TooManyStatements { max_statements: 6 }
[ "Recursively", "enhance", "an", "AST", "with", "type", "-", "dependent", "mixins", "and", "comments", "." ]
8c6b5c0c6228a6981ab48543457889f9ea984054
https://github.com/troessner/reek/blob/8c6b5c0c6228a6981ab48543457889f9ea984054/lib/reek/tree_dresser.rb#L42-L50
train
Returns a new object for the given Sexp
[ 30522, 13366, 4377, 1006, 3348, 2361, 1010, 7615, 1035, 4949, 1007, 2709, 3348, 2361, 4983, 3348, 2361, 1012, 2003, 1035, 1037, 1029, 1024, 1024, 11968, 8043, 1024, 1024, 2004, 2102, 1024, 1024, 13045, 2828, 1027, 3348, 2361, 1012, 2828, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_replica_health_with_http_info
def get_replica_health_with_http_info(partition_id, replica_id, events_health_state_filter:0, timeout:60, custom_headers:nil) get_replica_health_async(partition_id, replica_id, events_health_state_filter:events_health_state_filter, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def get_replica_health_with_http_info(partition_id, replica_id, events_health_state_filter:0, timeout:60, custom_headers:nil) get_replica_health_async(partition_id, replica_id, events_health_state_filter:events_health_state_filter, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "get_replica_health_with_http_info", "(", "partition_id", ",", "replica_id", ",", "events_health_state_filter", ":", "0", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "get_replica_health_async", "(", "partition_id", ",", "replica_id", ",",...
Gets the health of a Service Fabric stateful service replica or stateless service instance. Gets the health of a Service Fabric replica. Use EventsHealthStateFilter to filter the collection of health events reported on the replica based on the health state. @param partition_id The identity of the partition. @param replica_id [String] The identifier of the replica. @param events_health_state_filter [Integer] Allows filtering the collection of HealthEvent objects returned based on health state. The possible values for this parameter include integer value of one of the following health states. Only events that match the filter are returned. All events are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Gets", "the", "health", "of", "a", "Service", "Fabric", "stateful", "service", "replica", "or", "stateless", "service", "instance", "." ]
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#L14757-L14759
train
Gets the health of the replica.
[ 30522, 13366, 2131, 1035, 15059, 1035, 2740, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 13571, 1035, 8909, 1010, 15059, 1035, 8909, 1010, 2824, 1035, 2740, 1035, 2110, 1035, 11307, 1024, 1014, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb
Azure::StorSimple8000Series::Mgmt::V2017_06_01.DeviceSettings.get_alert_settings
def get_alert_settings(device_name, resource_group_name, manager_name, custom_headers:nil) response = get_alert_settings_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_alert_settings(device_name, resource_group_name, manager_name, custom_headers:nil) response = get_alert_settings_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_alert_settings", "(", "device_name", ",", "resource_group_name", ",", "manager_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_alert_settings_async", "(", "device_name", ",", "resource_group_name", ",", "manager_name", ",", "custom_heade...
Gets the alert settings of the specified device. @param device_name [String] The device name @param resource_group_name [String] The resource group name @param manager_name [String] The manager name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [AlertSettings] operation results.
[ "Gets", "the", "alert", "settings", "of", "the", "specified", "device", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb#L35-L38
train
Gets the alert settings for the specified device.
[ 30522, 13366, 2131, 1035, 9499, 1035, 10906, 1006, 5080, 1035, 2171, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 3208, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 9499, 1035, 10906, 1035, 2004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-core/lib/aws-sdk-core/endpoint_cache.rb
Aws.EndpointCache.update_polling_pool
def update_polling_pool(key, thread) unless @pool.size < @max_threads _, thread = @pool.shift Thread.kill(thread) end @pool[key] = thread end
ruby
def update_polling_pool(key, thread) unless @pool.size < @max_threads _, thread = @pool.shift Thread.kill(thread) end @pool[key] = thread end
[ "def", "update_polling_pool", "(", "key", ",", "thread", ")", "unless", "@pool", ".", "size", "<", "@max_threads", "_", ",", "thread", "=", "@pool", ".", "shift", "Thread", ".", "kill", "(", "thread", ")", "end", "@pool", "[", "key", "]", "=", "thread"...
update polling threads pool param [String] key param [Thread] thread
[ "update", "polling", "threads", "pool", "param", "[", "String", "]", "key", "param", "[", "Thread", "]", "thread" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-core/lib/aws-sdk-core/endpoint_cache.rb#L122-L128
train
Update the polling pool
[ 30522, 13366, 10651, 1035, 17888, 1035, 4770, 1006, 3145, 1010, 11689, 1007, 4983, 1030, 4770, 1012, 2946, 1026, 1030, 4098, 1035, 16457, 1035, 1010, 11689, 1027, 1030, 4770, 1012, 5670, 11689, 1012, 3102, 1006, 11689, 1007, 2203, 1030, 477...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb
Azure::StorageSync::Mgmt::V2018_07_01.CloudEndpoints.begin_post_restore
def begin_post_restore(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:nil) response = begin_post_restore_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:custom_headers).value! nil end
ruby
def begin_post_restore(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:nil) response = begin_post_restore_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:custom_headers).value! nil end
[ "def", "begin_post_restore", "(", "resource_group_name", ",", "storage_sync_service_name", ",", "sync_group_name", ",", "cloud_endpoint_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_post_restore_async", "(", "resource_group_name",...
Post Restore a given CloudEndpoint. @param resource_group_name [String] The name of the resource group. The name is case insensitive. @param storage_sync_service_name [String] Name of Storage Sync Service resource. @param sync_group_name [String] Name of Sync Group resource. @param cloud_endpoint_name [String] Name of Cloud Endpoint object. @param parameters [PostRestoreRequest] Body of Cloud Endpoint object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Post", "Restore", "a", "given", "CloudEndpoint", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb#L1221-L1224
train
Restores a CloudEndpoint.
[ 30522, 13366, 4088, 1035, 2695, 1035, 9239, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 5527, 1035, 26351, 1035, 2326, 1035, 2171, 1010, 26351, 1035, 2177, 1035, 2171, 1010, 6112, 1035, 2203, 8400, 1035, 2171, 1010, 11709, 1010, 7661, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
projectcypress/health-data-standards
lib/hqmf-parser/2.0/types.rb
HQMF2.SubsetOperator.to_model
def to_model vm = value ? value.to_model : nil HQMF::SubsetOperator.new(type, vm) end
ruby
def to_model vm = value ? value.to_model : nil HQMF::SubsetOperator.new(type, vm) end
[ "def", "to_model", "vm", "=", "value", "?", "value", ".", "to_model", ":", "nil", "HQMF", "::", "SubsetOperator", ".", "new", "(", "type", ",", "vm", ")", "end" ]
Generates this classes hqmf-model equivalent
[ "Generates", "this", "classes", "hqmf", "-", "model", "equivalent" ]
252d4f0927c513eacde6b9ea41b76faa1423c34b
https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/types.rb#L318-L321
train
Convert the HQMF object to a HQMF object.
[ 30522, 13366, 2000, 1035, 2944, 1058, 2213, 1027, 3643, 1029, 3643, 1012, 2000, 1035, 2944, 1024, 9152, 2140, 16260, 2213, 2546, 1024, 1024, 16745, 25918, 8844, 1012, 2047, 1006, 2828, 1010, 1058, 2213, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
watir/watir
lib/watir/elements/table.rb
Watir.Table.hashes
def hashes all_rows = rows.locate header_row = all_rows.first || raise(Error, 'no rows in table') all_rows.entries[1..-1].map do |row| cell_size_check(header_row, row) Hash[headers(header_row).map(&:text).zip(row.cells.map(&:text))] end end
ruby
def hashes all_rows = rows.locate header_row = all_rows.first || raise(Error, 'no rows in table') all_rows.entries[1..-1].map do |row| cell_size_check(header_row, row) Hash[headers(header_row).map(&:text).zip(row.cells.map(&:text))] end end
[ "def", "hashes", "all_rows", "=", "rows", ".", "locate", "header_row", "=", "all_rows", ".", "first", "||", "raise", "(", "Error", ",", "'no rows in table'", ")", "all_rows", ".", "entries", "[", "1", "..", "-", "1", "]", ".", "map", "do", "|", "row", ...
Represents table rows as hashes @return [Array<Hash>]
[ "Represents", "table", "rows", "as", "hashes" ]
2d8db09811c6221ae401b85b2f61f5fa66e463a3
https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/elements/table.rb#L28-L36
train
Returns a hash of the header and cells of the table.
[ 30522, 13366, 23325, 2229, 2035, 1035, 10281, 1027, 10281, 1012, 12453, 20346, 1035, 5216, 1027, 2035, 1035, 10281, 1012, 2034, 1064, 1064, 5333, 1006, 7561, 1010, 1005, 2053, 10281, 1999, 2795, 1005, 1007, 2035, 1035, 10281, 1012, 10445, 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_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb
Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.begin_redeploy
def begin_redeploy(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil) response = begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value! nil end
ruby
def begin_redeploy(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil) response = begin_redeploy_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value! nil end
[ "def", "begin_redeploy", "(", "resource_group_name", ",", "vm_scale_set_name", ",", "vm_instance_ids", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_redeploy_async", "(", "resource_group_name", ",", "vm_scale_set_name", ",", "vm_instance_id...
Redeploy one or more virtual machines in a VM scale set. @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.
[ "Redeploy", "one", "or", "more", "virtual", "machines", "in", "a", "VM", "scale", "set", "." ]
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#L2035-L2038
train
Redeploy a virtual machine.
[ 30522, 13366, 4088, 1035, 2417, 13699, 4135, 2100, 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, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
projectcypress/health-data-standards
lib/hqmf-parser/2.0/document_helpers/doc_population_helper.rb
HQMF2.DocumentPopulationHelper.handle_stratifications
def handle_stratifications(population_def, number_of_populations, population, id_def, population_index) # handle stratifications (EP137, EP155) stratifier_criteria_xpath = "cda:component/cda:stratifierCriteria[not(cda:component/cda:measureAttribute/cda:code[@code = 'SDE'])]/.." population_def.xpath(stratifier_criteria_xpath, HQMF2::Document::NAMESPACES) .each_with_index do |criteria_def, criteria_def_index| # Skip this Stratification if any precondition doesn't contain any preconditions next unless PopulationCriteria.new(criteria_def, @document, @id_generator) .preconditions.all? { |prcn| prcn.preconditions.length > 0 } index = number_of_populations + ((population_index - 1) * criteria_def.xpath('./*/cda:precondition').length) + criteria_def_index criteria_id = HQMF::PopulationCriteria::STRAT stratified_population = population.dup stratified_population['stratification'] = criteria_def.at_xpath('./*/cda:id/@root').try(:value) || "#{criteria_id}-#{criteria_def_index}" build_population_criteria(criteria_def, criteria_id, stratified_population) stratified_population['id'] = id_def ? "#{id_def.value} - Stratification #{criteria_def_index + 1}" : "Population#{index}" title_def = population_def.at_xpath('cda:title/@value', HQMF2::Document::NAMESPACES) stratified_population['title'] = title_def ? "#{title_def.value} - Stratification #{criteria_def_index + 1}" : "Population #{index}" @stratifications << stratified_population end end
ruby
def handle_stratifications(population_def, number_of_populations, population, id_def, population_index) # handle stratifications (EP137, EP155) stratifier_criteria_xpath = "cda:component/cda:stratifierCriteria[not(cda:component/cda:measureAttribute/cda:code[@code = 'SDE'])]/.." population_def.xpath(stratifier_criteria_xpath, HQMF2::Document::NAMESPACES) .each_with_index do |criteria_def, criteria_def_index| # Skip this Stratification if any precondition doesn't contain any preconditions next unless PopulationCriteria.new(criteria_def, @document, @id_generator) .preconditions.all? { |prcn| prcn.preconditions.length > 0 } index = number_of_populations + ((population_index - 1) * criteria_def.xpath('./*/cda:precondition').length) + criteria_def_index criteria_id = HQMF::PopulationCriteria::STRAT stratified_population = population.dup stratified_population['stratification'] = criteria_def.at_xpath('./*/cda:id/@root').try(:value) || "#{criteria_id}-#{criteria_def_index}" build_population_criteria(criteria_def, criteria_id, stratified_population) stratified_population['id'] = id_def ? "#{id_def.value} - Stratification #{criteria_def_index + 1}" : "Population#{index}" title_def = population_def.at_xpath('cda:title/@value', HQMF2::Document::NAMESPACES) stratified_population['title'] = title_def ? "#{title_def.value} - Stratification #{criteria_def_index + 1}" : "Population #{index}" @stratifications << stratified_population end end
[ "def", "handle_stratifications", "(", "population_def", ",", "number_of_populations", ",", "population", ",", "id_def", ",", "population_index", ")", "# handle stratifications (EP137, EP155)", "stratifier_criteria_xpath", "=", "\"cda:component/cda:stratifierCriteria[not(cda:component...
Generate the stratifications of populations, if any exist
[ "Generate", "the", "stratifications", "of", "populations", "if", "any", "exist" ]
252d4f0927c513eacde6b9ea41b76faa1423c34b
https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/document_helpers/doc_population_helper.rb#L111-L133
train
This method handles the stratifications for the given population definition.
[ 30522, 13366, 5047, 1035, 2358, 8609, 9031, 2015, 1006, 2313, 1035, 13366, 1010, 2193, 1035, 1997, 1035, 7080, 1010, 2313, 1010, 8909, 1035, 13366, 1010, 2313, 1035, 5950, 1007, 1001, 5047, 2358, 8609, 9031, 2015, 1006, 4958, 17134, 2581, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
puppetlabs/puppet
lib/puppet/network/http/compression.rb
Puppet::Network::HTTP::Compression.Active.uncompress_body
def uncompress_body(response) case response['content-encoding'] when 'gzip' # ZLib::GzipReader has an associated encoding, by default Encoding.default_external return Zlib::GzipReader.new(StringIO.new(response.body), :encoding => Encoding::BINARY).read when 'deflate' return Zlib::Inflate.new.inflate(response.body) when nil, 'identity' return response.body else raise Net::HTTPError.new(_("Unknown content encoding - %{encoding}") % { encoding: response['content-encoding'] }, response) end end
ruby
def uncompress_body(response) case response['content-encoding'] when 'gzip' # ZLib::GzipReader has an associated encoding, by default Encoding.default_external return Zlib::GzipReader.new(StringIO.new(response.body), :encoding => Encoding::BINARY).read when 'deflate' return Zlib::Inflate.new.inflate(response.body) when nil, 'identity' return response.body else raise Net::HTTPError.new(_("Unknown content encoding - %{encoding}") % { encoding: response['content-encoding'] }, response) end end
[ "def", "uncompress_body", "(", "response", ")", "case", "response", "[", "'content-encoding'", "]", "when", "'gzip'", "# ZLib::GzipReader has an associated encoding, by default Encoding.default_external", "return", "Zlib", "::", "GzipReader", ".", "new", "(", "StringIO", "....
return an uncompressed body if the response has been compressed
[ "return", "an", "uncompressed", "body", "if", "the", "response", "has", "been", "compressed" ]
4baeed97cbb7571ddc6635f0a24debe2e8b22cd3
https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/network/http/compression.rb#L20-L32
train
Uncompress the body of the response
[ 30522, 13366, 4895, 9006, 20110, 1035, 2303, 1006, 3433, 1007, 2553, 3433, 1031, 1005, 4180, 1011, 17181, 1005, 1033, 2043, 1005, 1043, 5831, 2361, 1005, 1001, 1062, 29521, 1024, 1024, 1043, 5831, 28139, 9648, 2099, 2038, 2019, 3378, 17181,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
puppetlabs/puppet
lib/puppet/util/fileparsing.rb
Puppet::Util::FileParsing.FileRecord.fields=
def fields=(fields) @fields = fields.collect do |field| r = field.intern raise ArgumentError.new(_("Cannot have fields named %{name}") % { name: r }) if INVALID_FIELDS.include?(r) r end end
ruby
def fields=(fields) @fields = fields.collect do |field| r = field.intern raise ArgumentError.new(_("Cannot have fields named %{name}") % { name: r }) if INVALID_FIELDS.include?(r) r end end
[ "def", "fields", "=", "(", "fields", ")", "@fields", "=", "fields", ".", "collect", "do", "|", "field", "|", "r", "=", "field", ".", "intern", "raise", "ArgumentError", ".", "new", "(", "_", "(", "\"Cannot have fields named %{name}\"", ")", "%", "{", "na...
Customize this so we can do a bit of validation.
[ "Customize", "this", "so", "we", "can", "do", "a", "bit", "of", "validation", "." ]
4baeed97cbb7571ddc6635f0a24debe2e8b22cd3
https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/fileparsing.rb#L40-L46
train
Sets the fields to be used in the query.
[ 30522, 13366, 4249, 1027, 1006, 4249, 1007, 1030, 4249, 1027, 4249, 1012, 8145, 2079, 1064, 2492, 1064, 1054, 1027, 2492, 1012, 25204, 5333, 6685, 2121, 29165, 1012, 2047, 1006, 1035, 1006, 1000, 3685, 2031, 4249, 2315, 1003, 1063, 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...
aws/aws-sdk-ruby
gems/aws-sdk-ec2/lib/aws-sdk-ec2/subnet.rb
Aws::EC2.Subnet.instances
def instances(options = {}) batches = Enumerator.new do |y| options = Aws::Util.deep_merge(options, filters: [{ name: "subnet-id", values: [@id] }]) resp = @client.describe_instances(options) resp.each_page do |page| batch = [] page.data.reservations.each do |r| r.instances.each do |i| batch << Instance.new( id: i.instance_id, data: i, client: @client ) end end y.yield(batch) end end Instance::Collection.new(batches) end
ruby
def instances(options = {}) batches = Enumerator.new do |y| options = Aws::Util.deep_merge(options, filters: [{ name: "subnet-id", values: [@id] }]) resp = @client.describe_instances(options) resp.each_page do |page| batch = [] page.data.reservations.each do |r| r.instances.each do |i| batch << Instance.new( id: i.instance_id, data: i, client: @client ) end end y.yield(batch) end end Instance::Collection.new(batches) end
[ "def", "instances", "(", "options", "=", "{", "}", ")", "batches", "=", "Enumerator", ".", "new", "do", "|", "y", "|", "options", "=", "Aws", "::", "Util", ".", "deep_merge", "(", "options", ",", "filters", ":", "[", "{", "name", ":", "\"subnet-id\""...
@!group Associations @example Request syntax with placeholder values instances = subnet.instances({ filters: [ { name: "String", values: ["String"], }, ], instance_ids: ["String"], dry_run: false, }) @param [Hash] options ({}) @option options [Array<Types::Filter>] :filters The filters. * `affinity` - The affinity setting for an instance running on a Dedicated Host (`default` \| `host`). * `architecture` - The instance architecture (`i386` \| `x86_64`). * `availability-zone` - The Availability Zone of the instance. * `block-device-mapping.attach-time` - The attach time for an EBS volume mapped to the instance, for example, `2010-09-15T17:15:20.000Z`. * `block-device-mapping.delete-on-termination` - A Boolean that indicates whether the EBS volume is deleted on instance termination. * `block-device-mapping.device-name` - The device name specified in the block device mapping (for example, `/dev/sdh` or `xvdh`). * `block-device-mapping.status` - The status for the EBS volume (`attaching` \| `attached` \| `detaching` \| `detached`). * `block-device-mapping.volume-id` - The volume ID of the EBS volume. * `client-token` - The idempotency token you provided when you launched the instance. * `dns-name` - The public DNS name of the instance. * `group-id` - The ID of the security group for the instance. EC2-Classic only. * `group-name` - The name of the security group for the instance. EC2-Classic only. * `hibernation-options.configured` - A Boolean that indicates whether the instance is enabled for hibernation. A value of `true` means that the instance is enabled for hibernation. * `host-id` - The ID of the Dedicated Host on which the instance is running, if applicable. * `hypervisor` - The hypervisor type of the instance (`ovm` \| `xen`). * `iam-instance-profile.arn` - The instance profile associated with the instance. Specified as an ARN. * `image-id` - The ID of the image used to launch the instance. * `instance-id` - The ID of the instance. * `instance-lifecycle` - Indicates whether this is a Spot Instance or a Scheduled Instance (`spot` \| `scheduled`). * `instance-state-code` - The state of the instance, as a 16-bit unsigned integer. The high byte is used for internal purposes and should be ignored. The low byte is set based on the state represented. The valid values are: 0 (pending), 16 (running), 32 (shutting-down), 48 (terminated), 64 (stopping), and 80 (stopped). * `instance-state-name` - The state of the instance (`pending` \| `running` \| `shutting-down` \| `terminated` \| `stopping` \| `stopped`). * `instance-type` - The type of instance (for example, `t2.micro`). * `instance.group-id` - The ID of the security group for the instance. * `instance.group-name` - The name of the security group for the instance. * `ip-address` - The public IPv4 address of the instance. * `kernel-id` - The kernel ID. * `key-name` - The name of the key pair used when the instance was launched. * `launch-index` - When launching multiple instances, this is the index for the instance in the launch group (for example, 0, 1, 2, and so on). * `launch-time` - The time when the instance was launched. * `monitoring-state` - Indicates whether detailed monitoring is enabled (`disabled` \| `enabled`). * `network-interface.addresses.private-ip-address` - The private IPv4 address associated with the network interface. * `network-interface.addresses.primary` - Specifies whether the IPv4 address of the network interface is the primary private IPv4 address. * `network-interface.addresses.association.public-ip` - The ID of the association of an Elastic IP address (IPv4) with a network interface. * `network-interface.addresses.association.ip-owner-id` - The owner ID of the private IPv4 address associated with the network interface. * `network-interface.association.public-ip` - The address of the Elastic IP address (IPv4) bound to the network interface. * `network-interface.association.ip-owner-id` - The owner of the Elastic IP address (IPv4) associated with the network interface. * `network-interface.association.allocation-id` - The allocation ID returned when you allocated the Elastic IP address (IPv4) for your network interface. * `network-interface.association.association-id` - The association ID returned when the network interface was associated with an IPv4 address. * `network-interface.attachment.attachment-id` - The ID of the interface attachment. * `network-interface.attachment.instance-id` - The ID of the instance to which the network interface is attached. * `network-interface.attachment.instance-owner-id` - The owner ID of the instance to which the network interface is attached. * `network-interface.attachment.device-index` - The device index to which the network interface is attached. * `network-interface.attachment.status` - The status of the attachment (`attaching` \| `attached` \| `detaching` \| `detached`). * `network-interface.attachment.attach-time` - The time that the network interface was attached to an instance. * `network-interface.attachment.delete-on-termination` - Specifies whether the attachment is deleted when an instance is terminated. * `network-interface.availability-zone` - The Availability Zone for the network interface. * `network-interface.description` - The description of the network interface. * `network-interface.group-id` - The ID of a security group associated with the network interface. * `network-interface.group-name` - The name of a security group associated with the network interface. * `network-interface.ipv6-addresses.ipv6-address` - The IPv6 address associated with the network interface. * `network-interface.mac-address` - The MAC address of the network interface. * `network-interface.network-interface-id` - The ID of the network interface. * `network-interface.owner-id` - The ID of the owner of the network interface. * `network-interface.private-dns-name` - The private DNS name of the network interface. * `network-interface.requester-id` - The requester ID for the network interface. * `network-interface.requester-managed` - Indicates whether the network interface is being managed by AWS. * `network-interface.status` - The status of the network interface (`available`) \| `in-use`). * `network-interface.source-dest-check` - Whether the network interface performs source/destination checking. A value of `true` means that checking is enabled, and `false` means that checking is disabled. The value must be `false` for the network interface to perform network address translation (NAT) in your VPC. * `network-interface.subnet-id` - The ID of the subnet for the network interface. * `network-interface.vpc-id` - The ID of the VPC for the network interface. * `owner-id` - The AWS account ID of the instance owner. * `placement-group-name` - The name of the placement group for the instance. * `placement-partition-number` - The partition in which the instance is located. * `platform` - The platform. To list only Windows instances, use `windows`. * `private-dns-name` - The private IPv4 DNS name of the instance. * `private-ip-address` - The private IPv4 address of the instance. * `product-code` - The product code associated with the AMI used to launch the instance. * `product-code.type` - The type of product code (`devpay` \| `marketplace`). * `ramdisk-id` - The RAM disk ID. * `reason` - The reason for the current state of the instance (for example, shows "User Initiated \[date\]" when you stop or terminate the instance). Similar to the state-reason-code filter. * `requester-id` - The ID of the entity that launched the instance on your behalf (for example, AWS Management Console, Auto Scaling, and so on). * `reservation-id` - The ID of the instance's reservation. A reservation ID is created any time you launch an instance. A reservation ID has a one-to-one relationship with an instance launch request, but can be associated with more than one instance if you launch multiple instances using the same launch request. For example, if you launch one instance, you get one reservation ID. If you launch ten instances using the same launch request, you also get one reservation ID. * `root-device-name` - The device name of the root device volume (for example, `/dev/sda1`). * `root-device-type` - The type of the root device volume (`ebs` \| `instance-store`). * `source-dest-check` - Indicates whether the instance performs source/destination checking. A value of `true` means that checking is enabled, and `false` means that checking is disabled. The value must be `false` for the instance to perform network address translation (NAT) in your VPC. * `spot-instance-request-id` - The ID of the Spot Instance request. * `state-reason-code` - The reason code for the state change. * `state-reason-message` - A message that describes the state change. * `subnet-id` - The ID of the subnet for the instance. * `tag`\:&lt;key&gt; - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key `Owner` and the value `TeamA`, specify `tag:Owner` for the filter name and `TeamA` for the filter value. * `tag-key` - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value. * `tenancy` - The tenancy of an instance (`dedicated` \| `default` \| `host`). * `virtualization-type` - The virtualization type of the instance (`paravirtual` \| `hvm`). * `vpc-id` - The ID of the VPC that the instance is running in. @option options [Array<String>] :instance_ids The instance IDs. Default: Describes all your instances. @option options [Boolean] :dry_run Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`. @return [Instance::Collection]
[ "@!group", "Associations", "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/subnet.rb#L1083-L1105
train
Returns a list of all instances in the subnet.
[ 30522, 13366, 12107, 1006, 7047, 1027, 1063, 1065, 1007, 14108, 2229, 1027, 4372, 17897, 16259, 1012, 2047, 2079, 1064, 1061, 1064, 7047, 1027, 22091, 2015, 1024, 1024, 21183, 4014, 1012, 2784, 1035, 13590, 1006, 7047, 1010, 17736, 1024, 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_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb
Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.list_deployments_at_resource_group
def list_deployments_at_resource_group(resource_group_name, remediation_name, query_options:nil, custom_headers:nil) first_page = list_deployments_at_resource_group_as_lazy(resource_group_name, remediation_name, query_options:query_options, custom_headers:custom_headers) first_page.get_all_items end
ruby
def list_deployments_at_resource_group(resource_group_name, remediation_name, query_options:nil, custom_headers:nil) first_page = list_deployments_at_resource_group_as_lazy(resource_group_name, remediation_name, query_options:query_options, custom_headers:custom_headers) first_page.get_all_items end
[ "def", "list_deployments_at_resource_group", "(", "resource_group_name", ",", "remediation_name", ",", "query_options", ":", "nil", ",", "custom_headers", ":", "nil", ")", "first_page", "=", "list_deployments_at_resource_group_as_lazy", "(", "resource_group_name", ",", "rem...
Gets all deployments for a remediation at resource group scope. @param resource_group_name [String] Resource group name. @param remediation_name [String] The name of the remediation. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array<RemediationDeployment>] operation results.
[ "Gets", "all", "deployments", "for", "a", "remediation", "at", "resource", "group", "scope", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L1185-L1188
train
Gets all deployments at resource group scope.
[ 30522, 13366, 2862, 1035, 10813, 2015, 1035, 2012, 1035, 7692, 1035, 2177, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2128, 16969, 3508, 1035, 2171, 1010, 23032, 1035, 7047, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
danger/danger
lib/danger/plugin_support/plugin_linter.rb
Danger.PluginLinter.class_rules
def class_rules [ Rule.new(:error, 4..6, "Description Markdown", "Above your class you need documentation that covers the scope, and the usage of your plugin.", proc do |json| json[:body_md] && json[:body_md].empty? end), Rule.new(:warning, 30, "Tags", "This plugin does not include `@tags tag1, tag2` and thus will be harder to find in search.", proc do |json| json[:tags] && json[:tags].empty? end), Rule.new(:warning, 29, "References", "Ideally, you have a reference implementation of your plugin that you can show to people, add `@see org/repo` to have the site auto link it.", proc do |json| json[:see] && json[:see].empty? end), Rule.new(:error, 8..27, "Examples", "You should include some examples of common use-cases for your plugin.", proc do |json| json[:example_code] && json[:example_code].empty? end) ] end
ruby
def class_rules [ Rule.new(:error, 4..6, "Description Markdown", "Above your class you need documentation that covers the scope, and the usage of your plugin.", proc do |json| json[:body_md] && json[:body_md].empty? end), Rule.new(:warning, 30, "Tags", "This plugin does not include `@tags tag1, tag2` and thus will be harder to find in search.", proc do |json| json[:tags] && json[:tags].empty? end), Rule.new(:warning, 29, "References", "Ideally, you have a reference implementation of your plugin that you can show to people, add `@see org/repo` to have the site auto link it.", proc do |json| json[:see] && json[:see].empty? end), Rule.new(:error, 8..27, "Examples", "You should include some examples of common use-cases for your plugin.", proc do |json| json[:example_code] && json[:example_code].empty? end) ] end
[ "def", "class_rules", "[", "Rule", ".", "new", "(", ":error", ",", "4", "..", "6", ",", "\"Description Markdown\"", ",", "\"Above your class you need documentation that covers the scope, and the usage of your plugin.\"", ",", "proc", "do", "|", "json", "|", "json", "[",...
Rules that apply to a class
[ "Rules", "that", "apply", "to", "a", "class" ]
0d6d09f2d949c287fe75202d947374042b0679f4
https://github.com/danger/danger/blob/0d6d09f2d949c287fe75202d947374042b0679f4/lib/danger/plugin_support/plugin_linter.rb#L93-L108
train
The rules that are used to generate the class.
[ 30522, 13366, 2465, 1035, 3513, 1031, 3627, 1012, 2047, 1006, 1024, 7561, 1010, 1018, 1012, 1012, 1020, 1010, 1000, 6412, 2928, 7698, 1000, 1010, 1000, 2682, 2115, 2465, 2017, 2342, 12653, 2008, 4472, 1996, 9531, 1010, 1998, 1996, 8192, 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_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb
Azure::StorageSync::Mgmt::V2018_07_01.CloudEndpoints.begin_delete
def begin_delete(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, custom_headers:nil) response = begin_delete_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, custom_headers:custom_headers).value! nil end
ruby
def begin_delete(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, custom_headers:nil) response = begin_delete_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, custom_headers:custom_headers).value! nil end
[ "def", "begin_delete", "(", "resource_group_name", ",", "storage_sync_service_name", ",", "sync_group_name", ",", "cloud_endpoint_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_delete_async", "(", "resource_group_name", ",", "storage_sync_service_nam...
Delete a given CloudEndpoint. @param resource_group_name [String] The name of the resource group. The name is case insensitive. @param storage_sync_service_name [String] Name of Storage Sync Service resource. @param sync_group_name [String] Name of Sync Group resource. @param cloud_endpoint_name [String] Name of Cloud Endpoint object. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Delete", "a", "given", "CloudEndpoint", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb#L776-L779
train
Deletes a CloudEndpoint.
[ 30522, 13366, 4088, 1035, 3972, 12870, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 5527, 1035, 26351, 1035, 2326, 1035, 2171, 1010, 26351, 1035, 2177, 1035, 2171, 1010, 6112, 1035, 2203, 8400, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
randym/axlsx
lib/axlsx/package.rb
Axlsx.Package.write_parts
def write_parts(zip) p = parts p.each do |part| unless part[:doc].nil? zip.put_next_entry(zip_entry_for_part(part)) part[:doc].to_xml_string(zip) end unless part[:path].nil? zip.put_next_entry(zip_entry_for_part(part)) zip.write IO.read(part[:path]) end end zip end
ruby
def write_parts(zip) p = parts p.each do |part| unless part[:doc].nil? zip.put_next_entry(zip_entry_for_part(part)) part[:doc].to_xml_string(zip) end unless part[:path].nil? zip.put_next_entry(zip_entry_for_part(part)) zip.write IO.read(part[:path]) end end zip end
[ "def", "write_parts", "(", "zip", ")", "p", "=", "parts", "p", ".", "each", "do", "|", "part", "|", "unless", "part", "[", ":doc", "]", ".", "nil?", "zip", ".", "put_next_entry", "(", "zip_entry_for_part", "(", "part", ")", ")", "part", "[", ":doc", ...
Writes the package parts to a zip archive. @param [Zip::OutputStream] zip @return [Zip::OutputStream]
[ "Writes", "the", "package", "parts", "to", "a", "zip", "archive", "." ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/package.rb#L161-L174
train
Write the parts of the document to the zip.
[ 30522, 13366, 4339, 1035, 3033, 1006, 14101, 1007, 1052, 1027, 3033, 1052, 1012, 2169, 2079, 1064, 2112, 1064, 4983, 2112, 1031, 1024, 9986, 1033, 1012, 9152, 2140, 1029, 14101, 1012, 2404, 1035, 2279, 1035, 4443, 1006, 14101, 1035, 4443, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
railties/lib/rails/application.rb
Rails.Application.secrets
def secrets @secrets ||= begin secrets = ActiveSupport::OrderedOptions.new files = config.paths["config/secrets"].existent files = files.reject { |path| path.end_with?(".enc") } unless config.read_encrypted_secrets secrets.merge! Rails::Secrets.parse(files, env: Rails.env) # Fallback to config.secret_key_base if secrets.secret_key_base isn't set secrets.secret_key_base ||= config.secret_key_base secrets end end
ruby
def secrets @secrets ||= begin secrets = ActiveSupport::OrderedOptions.new files = config.paths["config/secrets"].existent files = files.reject { |path| path.end_with?(".enc") } unless config.read_encrypted_secrets secrets.merge! Rails::Secrets.parse(files, env: Rails.env) # Fallback to config.secret_key_base if secrets.secret_key_base isn't set secrets.secret_key_base ||= config.secret_key_base secrets end end
[ "def", "secrets", "@secrets", "||=", "begin", "secrets", "=", "ActiveSupport", "::", "OrderedOptions", ".", "new", "files", "=", "config", ".", "paths", "[", "\"config/secrets\"", "]", ".", "existent", "files", "=", "files", ".", "reject", "{", "|", "path", ...
Returns secrets added to config/secrets.yml. Example: development: secret_key_base: 836fa3665997a860728bcb9e9a1e704d427cfc920e79d847d79c8a9a907b9e965defa4154b2b86bdec6930adbe33f21364523a6f6ce363865724549fdfc08553 test: secret_key_base: 5a37811464e7d378488b0f073e2193b093682e4e21f5d6f3ae0a4e1781e61a351fdc878a843424e81c73fb484a40d23f92c8dafac4870e74ede6e5e174423010 production: secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> namespace: my_app_production +Rails.application.secrets.namespace+ returns +my_app_production+ in the production environment.
[ "Returns", "secrets", "added", "to", "config", "/", "secrets", ".", "yml", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/railties/lib/rails/application.rb#L393-L405
train
Returns the secrets for this application.
[ 30522, 13366, 7800, 1030, 7800, 1064, 1064, 1027, 4088, 7800, 1027, 3161, 6342, 9397, 11589, 1024, 1024, 3641, 7361, 9285, 1012, 2047, 6764, 1027, 9530, 8873, 2290, 1012, 10425, 1031, 1000, 9530, 8873, 2290, 1013, 7800, 1000, 1033, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_api_management/lib/2019-01-01/generated/azure_mgmt_api_management/logger.rb
Azure::ApiManagement::Mgmt::V2019_01_01.Logger.get_entity_tag_with_http_info
def get_entity_tag_with_http_info(resource_group_name, service_name, logger_id, custom_headers:nil) get_entity_tag_async(resource_group_name, service_name, logger_id, custom_headers:custom_headers).value! end
ruby
def get_entity_tag_with_http_info(resource_group_name, service_name, logger_id, custom_headers:nil) get_entity_tag_async(resource_group_name, service_name, logger_id, custom_headers:custom_headers).value! end
[ "def", "get_entity_tag_with_http_info", "(", "resource_group_name", ",", "service_name", ",", "logger_id", ",", "custom_headers", ":", "nil", ")", "get_entity_tag_async", "(", "resource_group_name", ",", "service_name", ",", "logger_id", ",", "custom_headers", ":custom_he...
Gets the entity state (Etag) version of the logger specified by its identifier. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param logger_id [String] Logger identifier. Must be unique in the API Management service instance. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Gets", "the", "entity", "state", "(", "Etag", ")", "version", "of", "the", "logger", "specified", "by", "its", "identifier", "." ]
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/logger.rb#L181-L183
train
Gets the entity tag for the specified logger.
[ 30522, 13366, 2131, 1035, 9178, 1035, 6415, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 8833, 4590, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ruby-git/ruby-git
lib/git/log.rb
Git.Log.run_log
def run_log log = @base.lib.full_log_commits(:count => @count, :object => @object, :path_limiter => @path, :since => @since, :author => @author, :grep => @grep, :skip => @skip, :until => @until, :between => @between) @commits = log.map { |c| Git::Object::Commit.new(@base, c['sha'], c) } end
ruby
def run_log log = @base.lib.full_log_commits(:count => @count, :object => @object, :path_limiter => @path, :since => @since, :author => @author, :grep => @grep, :skip => @skip, :until => @until, :between => @between) @commits = log.map { |c| Git::Object::Commit.new(@base, c['sha'], c) } end
[ "def", "run_log", "log", "=", "@base", ".", "lib", ".", "full_log_commits", "(", ":count", "=>", "@count", ",", ":object", "=>", "@object", ",", ":path_limiter", "=>", "@path", ",", ":since", "=>", "@since", ",", ":author", "=>", "@author", ",", ":grep", ...
actually run the 'git log' command
[ "actually", "run", "the", "git", "log", "command" ]
9bd4407c56068e1604f14a1b6c0c5a84868e6378
https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/log.rb#L118-L124
train
runs the full log of the object
[ 30522, 13366, 2448, 1035, 8833, 8833, 1027, 1030, 2918, 1012, 5622, 2497, 1012, 2440, 1035, 8833, 1035, 27791, 1006, 1024, 4175, 1027, 1028, 1030, 4175, 1010, 1024, 4874, 1027, 1028, 1030, 4874, 1010, 1024, 4130, 1035, 5787, 2121, 1027, 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...
activerecord-hackery/ransack
polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb
Polyamorous.JoinDependencyExtensions.build
def build(associations, base_klass) associations.map do |name, right| if name.is_a? Join reflection = find_reflection base_klass, name.name reflection.check_validity! reflection.check_eager_loadable! klass = if reflection.polymorphic? name.klass || base_klass else reflection.klass end JoinAssociation.new(reflection, build(right, klass), alias_tracker, name.klass, name.type) else reflection = find_reflection base_klass, name reflection.check_validity! reflection.check_eager_loadable! if reflection.polymorphic? raise ActiveRecord::EagerLoadPolymorphicError.new(reflection) end JoinAssociation.new(reflection, build(right, reflection.klass), alias_tracker) end end end
ruby
def build(associations, base_klass) associations.map do |name, right| if name.is_a? Join reflection = find_reflection base_klass, name.name reflection.check_validity! reflection.check_eager_loadable! klass = if reflection.polymorphic? name.klass || base_klass else reflection.klass end JoinAssociation.new(reflection, build(right, klass), alias_tracker, name.klass, name.type) else reflection = find_reflection base_klass, name reflection.check_validity! reflection.check_eager_loadable! if reflection.polymorphic? raise ActiveRecord::EagerLoadPolymorphicError.new(reflection) end JoinAssociation.new(reflection, build(right, reflection.klass), alias_tracker) end end end
[ "def", "build", "(", "associations", ",", "base_klass", ")", "associations", ".", "map", "do", "|", "name", ",", "right", "|", "if", "name", ".", "is_a?", "Join", "reflection", "=", "find_reflection", "base_klass", ",", "name", ".", "name", "reflection", "...
Replaces ActiveRecord::Associations::JoinDependency#build
[ "Replaces", "ActiveRecord", "::", "Associations", "::", "JoinDependency#build" ]
d44bfe6fe21ab374ceea9d060267d0d38b09ef28
https://github.com/activerecord-hackery/ransack/blob/d44bfe6fe21ab374ceea9d060267d0d38b09ef28/polyamorous/lib/polyamorous/activerecord_5.2.0_ruby_2/join_dependency.rb#L7-L31
train
Builds an association list from the given associations.
[ 30522, 13366, 3857, 1006, 8924, 1010, 2918, 1035, 1047, 27102, 1007, 8924, 1012, 4949, 2079, 1064, 2171, 1010, 2157, 1064, 2065, 2171, 1012, 2003, 1035, 1037, 1029, 3693, 9185, 1027, 2424, 1035, 9185, 2918, 1035, 1047, 27102, 1010, 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...
randym/axlsx
lib/axlsx/package.rb
Axlsx.Package.validate
def validate errors = [] parts.each do |part| unless part[:schema].nil? errors.concat validate_single_doc(part[:schema], part[:doc].to_xml_string) end end errors end
ruby
def validate errors = [] parts.each do |part| unless part[:schema].nil? errors.concat validate_single_doc(part[:schema], part[:doc].to_xml_string) end end errors end
[ "def", "validate", "errors", "=", "[", "]", "parts", ".", "each", "do", "|", "part", "|", "unless", "part", "[", ":schema", "]", ".", "nil?", "errors", ".", "concat", "validate_single_doc", "(", "part", "[", ":schema", "]", ",", "part", "[", ":doc", ...
Validate all parts of the package against xsd schema. @return [Array] An array of all validation errors found. @note This gem includes all schema from OfficeOpenXML-XMLSchema-Transitional.zip and OpenPackagingConventions-XMLSchema.zip as per ECMA-376, Third edition. opc schema require an internet connection to import remote schema from dublin core for dc, dcterms and xml namespaces. Those remote schema are included in this gem, and the original files have been altered to refer to the local versions. If by chance you are able to creat a package that does not validate it indicates that the internal validation is not robust enough and needs to be improved. Please report your errors to the gem author. @see http://www.ecma-international.org/publications/standards/Ecma-376.htm @example # The following will output any error messages found in serialization. p = Axlsx::Package.new # ... code to create sheets, charts, styles etc. p.validate.each { |error| puts error.message }
[ "Validate", "all", "parts", "of", "the", "package", "against", "xsd", "schema", ".", "@return", "[", "Array", "]", "An", "array", "of", "all", "validation", "errors", "found", ".", "@note", "This", "gem", "includes", "all", "schema", "from", "OfficeOpenXML",...
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/package.rb#L146-L154
train
Validate the schema and doc
[ 30522, 13366, 9398, 3686, 10697, 1027, 1031, 1033, 3033, 1012, 2169, 2079, 1064, 2112, 1064, 4983, 2112, 1031, 1024, 8040, 28433, 1033, 1012, 9152, 2140, 1029, 10697, 1012, 9530, 11266, 9398, 3686, 1035, 2309, 1035, 9986, 1006, 2112, 1031, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-kinesis/lib/aws-sdk-kinesis/async_client.rb
Aws::Kinesis.AsyncClient.subscribe_to_shard
def subscribe_to_shard(params = {}, options = {}) params = params.dup output_event_stream_handler = _event_stream_handler( :output, params.delete(:output_event_stream_handler) || params.delete(:event_stream_handler), EventStreams::SubscribeToShardEventStream ) yield(output_event_stream_handler) if block_given? req = build_request(:subscribe_to_shard, params) req.context[:output_event_stream_handler] = output_event_stream_handler req.handlers.add(Aws::Binary::DecodeHandler, priority: 95) req.send_request(options) end
ruby
def subscribe_to_shard(params = {}, options = {}) params = params.dup output_event_stream_handler = _event_stream_handler( :output, params.delete(:output_event_stream_handler) || params.delete(:event_stream_handler), EventStreams::SubscribeToShardEventStream ) yield(output_event_stream_handler) if block_given? req = build_request(:subscribe_to_shard, params) req.context[:output_event_stream_handler] = output_event_stream_handler req.handlers.add(Aws::Binary::DecodeHandler, priority: 95) req.send_request(options) end
[ "def", "subscribe_to_shard", "(", "params", "=", "{", "}", ",", "options", "=", "{", "}", ")", "params", "=", "params", ".", "dup", "output_event_stream_handler", "=", "_event_stream_handler", "(", ":output", ",", "params", ".", "delete", "(", ":output_event_s...
@option options [required, Aws::CredentialProvider] :credentials Your AWS credentials. This can be an instance of any one of the following classes: * `Aws::Credentials` - Used for configuring static, non-refreshing credentials. * `Aws::InstanceProfileCredentials` - Used for loading credentials from an EC2 IMDS on an EC2 instance. * `Aws::SharedCredentials` - Used for loading credentials from a shared file, such as `~/.aws/config`. * `Aws::AssumeRoleCredentials` - Used when you need to assume a role. When `:credentials` are not configured directly, the following locations will be searched for credentials: * `Aws.config[:credentials]` * The `:access_key_id`, `:secret_access_key`, and `:session_token` options. * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'] * `~/.aws/credentials` * `~/.aws/config` * EC2 IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of `Aws::InstanceProfileCredentails` to enable retries and extended timeouts. @option options [required, String] :region The AWS region to connect to. The configured `:region` is used to determine the service `:endpoint`. When not passed, a default `:region` is search for in the following locations: * `Aws.config[:region]` * `ENV['AWS_REGION']` * `ENV['AMAZON_REGION']` * `ENV['AWS_DEFAULT_REGION']` * `~/.aws/credentials` * `~/.aws/config` @option options [String] :access_key_id @option options [Boolean] :convert_params (true) When `true`, an attempt is made to coerce request parameters into the required types. @option options [String] :endpoint The client endpoint is normally constructed from the `:region` option. You should only configure an `:endpoint` when connecting to test endpoints. This should be avalid HTTP(S) URI. @option options [Proc] :event_stream_handler When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way. @option options [Proc] :input_event_stream_handler When an EventStream or Proc object is provided, it can be used for sending events for the event stream. @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default) The log formatter. @option options [Symbol] :log_level (:info) The log level to send messages to the `:logger` at. @option options [Logger] :logger The Logger instance to send log messages to. If this option is not set, logging will be disabled. @option options [Proc] :output_event_stream_handler When an EventStream or Proc object is provided, it will be used as callback for each chunk of event stream response received along the way. @option options [String] :profile ("default") Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. @option options [Float] :retry_base_delay (0.3) The base delay in seconds used by the default backoff function. @option options [Symbol] :retry_jitter (:none) A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. @see https://www.awsarchitectureblog.com/2015/03/backoff.html @option options [Integer] :retry_limit (3) The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. @option options [Integer] :retry_max_delay (0) The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. @option options [String] :secret_access_key @option options [String] :session_token @option options [Boolean] :simple_json (false) Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures. When `:simple_json` is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. @option options [Boolean] :stub_responses (false) Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling {ClientStubs#stub_responses}. See {ClientStubs} for more information. ** Please note ** When response stubbing is enabled, no HTTP requests are made, and retries are disabled. @option options [Boolean] :validate_params (true) When `true`, request parameters are validated before sending the request. @!group API Operations Call this operation from your consumer after you call RegisterStreamConsumer to register the consumer with Kinesis Data Streams. If the call succeeds, your consumer starts receiving events of type SubscribeToShardEvent for up to 5 minutes, after which time you need to call `SubscribeToShard` again to renew the subscription if you want to continue to receive records. You can make one call to `SubscribeToShard` per second per `ConsumerARN`. If your call succeeds, and then you call the operation again less than 5 seconds later, the second call generates a ResourceInUseException. If you call the operation a second time more than 5 seconds after the first call succeeds, the second call succeeds and the first connection gets shut down. @option params [required, String] :consumer_arn For this parameter, use the value you obtained when you called RegisterStreamConsumer. @option params [required, String] :shard_id The ID of the shard you want to subscribe to. To see a list of all the shards for a given stream, use ListShards. @option params [required, Types::StartingPosition] :starting_position @return [Types::SubscribeToShardOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: * {Types::SubscribeToShardOutput#event_stream #event_stream} => Types::SubscribeToShardEventStream @example EventStream Operation Example You can process event once it arrives immediately, or wait until full response complete and iterate through eventstream enumerator. To interact with event immediately, you need to register #subscribe_to_shard with callbacks, callbacks can be register for specifc events or for all events, callback for errors in the event stream is also available for register. Callbacks can be passed in by `:event_stream_handler` option or within block statement attached to #subscribe_to_shard call directly. Hybrid pattern of both is also supported. `:event_stream_handler` option takes in either Proc object or Aws::Kinesis::EventStreams::SubscribeToShardEventStream object. Usage pattern a): callbacks with a block attached to #subscribe_to_shard Example for registering callbacks for all event types and error event client.subscribe_to_shard( # params input# ) do |stream| stream.on_error_event do |event| # catch unmodeled error event in the stream raise event # => Aws::Errors::EventError # event.event_type => :error # event.error_code => String # event.error_message => String end stream.on_event do |event| # process all events arrive puts event.event_type ... end end Usage pattern b): pass in `:event_stream_handler` for #subscribe_to_shard 1) create a Aws::Kinesis::EventStreams::SubscribeToShardEventStream object Example for registering callbacks with specific events handler = Aws::Kinesis::EventStreams::SubscribeToShardEventStream.new handler.on_subscribe_to_shard_event_event do |event| event # => Aws::Kinesis::Types::SubscribeToShardEvent end handler.on_resource_not_found_exception_event do |event| event # => Aws::Kinesis::Types::ResourceNotFoundException end handler.on_resource_in_use_exception_event do |event| event # => Aws::Kinesis::Types::ResourceInUseException end handler.on_kms_disabled_exception_event do |event| event # => Aws::Kinesis::Types::KMSDisabledException end handler.on_kms_invalid_state_exception_event do |event| event # => Aws::Kinesis::Types::KMSInvalidStateException end handler.on_kms_access_denied_exception_event do |event| event # => Aws::Kinesis::Types::KMSAccessDeniedException end handler.on_kms_not_found_exception_event do |event| event # => Aws::Kinesis::Types::KMSNotFoundException end handler.on_kms_opt_in_required_event do |event| event # => Aws::Kinesis::Types::KMSOptInRequired end handler.on_kms_throttling_exception_event do |event| event # => Aws::Kinesis::Types::KMSThrottlingException end handler.on_internal_failure_exception_event do |event| event # => Aws::Kinesis::Types::InternalFailureException end client.subscribe_to_shard( # params input #, event_stream_handler: handler) 2) use a Ruby Proc object Example for registering callbacks with specific events handler = Proc.new do |stream| stream.on_subscribe_to_shard_event_event do |event| event # => Aws::Kinesis::Types::SubscribeToShardEvent end stream.on_resource_not_found_exception_event do |event| event # => Aws::Kinesis::Types::ResourceNotFoundException end stream.on_resource_in_use_exception_event do |event| event # => Aws::Kinesis::Types::ResourceInUseException end stream.on_kms_disabled_exception_event do |event| event # => Aws::Kinesis::Types::KMSDisabledException end stream.on_kms_invalid_state_exception_event do |event| event # => Aws::Kinesis::Types::KMSInvalidStateException end stream.on_kms_access_denied_exception_event do |event| event # => Aws::Kinesis::Types::KMSAccessDeniedException end stream.on_kms_not_found_exception_event do |event| event # => Aws::Kinesis::Types::KMSNotFoundException end stream.on_kms_opt_in_required_event do |event| event # => Aws::Kinesis::Types::KMSOptInRequired end stream.on_kms_throttling_exception_event do |event| event # => Aws::Kinesis::Types::KMSThrottlingException end stream.on_internal_failure_exception_event do |event| event # => Aws::Kinesis::Types::InternalFailureException end end client.subscribe_to_shard( # params input #, event_stream_handler: handler) Usage pattern c): hybird pattern of a) and b) handler = Aws::Kinesis::EventStreams::SubscribeToShardEventStream.new handler.on_subscribe_to_shard_event_event do |event| event # => Aws::Kinesis::Types::SubscribeToShardEvent end handler.on_resource_not_found_exception_event do |event| event # => Aws::Kinesis::Types::ResourceNotFoundException end handler.on_resource_in_use_exception_event do |event| event # => Aws::Kinesis::Types::ResourceInUseException end handler.on_kms_disabled_exception_event do |event| event # => Aws::Kinesis::Types::KMSDisabledException end handler.on_kms_invalid_state_exception_event do |event| event # => Aws::Kinesis::Types::KMSInvalidStateException end handler.on_kms_access_denied_exception_event do |event| event # => Aws::Kinesis::Types::KMSAccessDeniedException end handler.on_kms_not_found_exception_event do |event| event # => Aws::Kinesis::Types::KMSNotFoundException end handler.on_kms_opt_in_required_event do |event| event # => Aws::Kinesis::Types::KMSOptInRequired end handler.on_kms_throttling_exception_event do |event| event # => Aws::Kinesis::Types::KMSThrottlingException end handler.on_internal_failure_exception_event do |event| event # => Aws::Kinesis::Types::InternalFailureException end client.subscribe_to_shard( # params input #, event_stream_handler: handler) do |stream| stream.on_error_event do |event| # catch unmodeled error event in the stream raise event # => Aws::Errors::EventError # event.event_type => :error # event.error_code => String # event.error_message => String end end Besides above usage patterns for process events when they arrive immediately, you can also iterate through events after response complete. Events are available at resp.event_stream # => Enumerator For parameter input example, please refer to following request syntax @example Request syntax with placeholder values async_resp = async_client.subscribe_to_shard({ consumer_arn: "ConsumerARN", # required shard_id: "ShardId", # required starting_position: { # required type: "AT_SEQUENCE_NUMBER", # required, accepts AT_SEQUENCE_NUMBER, AFTER_SEQUENCE_NUMBER, TRIM_HORIZON, LATEST, AT_TIMESTAMP sequence_number: "SequenceNumber", timestamp: Time.now, }, }) # => Seahorse::Client::AsyncResponse async_resp.wait # => Seahorse::Client::Response # Or use async_resp.join! @example Response structure All events are available at resp.event_stream: resp.event_stream #=> Enumerator resp.event_stream.event_types #=> [:subscribe_to_shard_event, :resource_not_found_exception, :resource_in_use_exception, :kms_disabled_exception, :kms_invalid_state_exception, :kms_access_denied_exception, :kms_not_found_exception, :kms_opt_in_required, :kms_throttling_exception, :internal_failure_exception] For :subscribe_to_shard_event event available at #on_subscribe_to_shard_event_event callback and response eventstream enumerator: event.records #=> Array event.records[0].sequence_number #=> String event.records[0].approximate_arrival_timestamp #=> Time event.records[0].data #=> String event.records[0].partition_key #=> String event.records[0].encryption_type #=> String, one of "NONE", "KMS" event.continuation_sequence_number #=> String event.millis_behind_latest #=> Integer For :resource_not_found_exception event available at #on_resource_not_found_exception_event callback and response eventstream enumerator: event.message #=> String For :resource_in_use_exception event available at #on_resource_in_use_exception_event callback and response eventstream enumerator: event.message #=> String For :kms_disabled_exception event available at #on_kms_disabled_exception_event callback and response eventstream enumerator: event.message #=> String For :kms_invalid_state_exception event available at #on_kms_invalid_state_exception_event callback and response eventstream enumerator: event.message #=> String For :kms_access_denied_exception event available at #on_kms_access_denied_exception_event callback and response eventstream enumerator: event.message #=> String For :kms_not_found_exception event available at #on_kms_not_found_exception_event callback and response eventstream enumerator: event.message #=> String For :kms_opt_in_required event available at #on_kms_opt_in_required_event callback and response eventstream enumerator: event.message #=> String For :kms_throttling_exception event available at #on_kms_throttling_exception_event callback and response eventstream enumerator: event.message #=> String For :internal_failure_exception event available at #on_internal_failure_exception_event callback and response eventstream enumerator: event.message #=> String @see http://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/SubscribeToShard AWS API Documentation @overload subscribe_to_shard(params = {}) @param [Hash] params ({})
[ "@option", "options", "[", "required", "Aws", "::", "CredentialProvider", "]", ":", "credentials", "Your", "AWS", "credentials", ".", "This", "can", "be", "an", "instance", "of", "any", "one", "of", "the", "following", "classes", ":" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-kinesis/lib/aws-sdk-kinesis/async_client.rb#L444-L460
train
Subscribe to a shard
[ 30522, 13366, 4942, 29234, 1035, 2000, 1035, 21146, 4103, 1006, 11498, 5244, 1027, 1063, 1065, 1010, 7047, 1027, 1063, 1065, 1007, 11498, 5244, 1027, 11498, 5244, 1012, 4241, 2361, 6434, 1035, 2724, 1035, 5460, 1035, 28213, 1027, 1035, 2724...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hashicorp/vagrant
lib/vagrant/environment.rb
Vagrant.Environment.batch
def batch(parallel=true) parallel = false if ENV["VAGRANT_NO_PARALLEL"] @batch_lock.synchronize do BatchAction.new(parallel).tap do |b| # Yield it so that the caller can setup actions yield b # And run it! b.run end end end
ruby
def batch(parallel=true) parallel = false if ENV["VAGRANT_NO_PARALLEL"] @batch_lock.synchronize do BatchAction.new(parallel).tap do |b| # Yield it so that the caller can setup actions yield b # And run it! b.run end end end
[ "def", "batch", "(", "parallel", "=", "true", ")", "parallel", "=", "false", "if", "ENV", "[", "\"VAGRANT_NO_PARALLEL\"", "]", "@batch_lock", ".", "synchronize", "do", "BatchAction", ".", "new", "(", "parallel", ")", ".", "tap", "do", "|", "b", "|", "# Y...
This creates a new batch action, yielding it, and then running it once the block is called. This handles the case where batch actions are disabled by the VAGRANT_NO_PARALLEL environmental variable.
[ "This", "creates", "a", "new", "batch", "action", "yielding", "it", "and", "then", "running", "it", "once", "the", "block", "is", "called", "." ]
c22a145c59790c098f95d50141d9afb48e1ef55f
https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/environment.rb#L272-L284
train
Yields the batch action
[ 30522, 13366, 14108, 1006, 5903, 1027, 2995, 1007, 5903, 1027, 6270, 2065, 4372, 2615, 1031, 1000, 12436, 18980, 1035, 2053, 1035, 5903, 1000, 1033, 1030, 14108, 1035, 5843, 1012, 26351, 8093, 10698, 4371, 2079, 14108, 18908, 3258, 1012, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb
Azure::StorSimple8000Series::Mgmt::V2017_06_01.DeviceSettings.sync_remotemanagement_certificate_async
def sync_remotemanagement_certificate_async(device_name, resource_group_name, manager_name, custom_headers:nil) # Send request promise = begin_sync_remotemanagement_certificate_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
ruby
def sync_remotemanagement_certificate_async(device_name, resource_group_name, manager_name, custom_headers:nil) # Send request promise = begin_sync_remotemanagement_certificate_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| end # Waiting for response. @client.get_long_running_operation_result(response, deserialize_method) end promise end
[ "def", "sync_remotemanagement_certificate_async", "(", "device_name", ",", "resource_group_name", ",", "manager_name", ",", "custom_headers", ":", "nil", ")", "# Send request", "promise", "=", "begin_sync_remotemanagement_certificate_async", "(", "device_name", ",", "resource...
@param device_name [String] The device name @param resource_group_name [String] The resource group name @param manager_name [String] The manager name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Concurrent::Promise] promise which provides async access to http response.
[ "@param", "device_name", "[", "String", "]", "The", "device", "name", "@param", "resource_group_name", "[", "String", "]", "The", "resource", "group", "name", "@param", "manager_name", "[", "String", "]", "The", "manager", "name", "@param", "custom_headers", "["...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb#L482-L496
train
Sync the certificate of a managed certificate.
[ 30522, 13366, 26351, 1035, 6556, 24805, 20511, 1035, 8196, 1035, 2004, 6038, 2278, 1006, 5080, 1035, 2171, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 3208, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 1001, 4604, 5227, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_sqlvirtualmachine/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machines.rb
Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview.SqlVirtualMachines.update_async
def update_async(resource_group_name, sql_virtual_machine_name, parameters, custom_headers:nil) # Send request promise = begin_update_async(resource_group_name, sql_virtual_machine_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview::Models::SqlVirtualMachine.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 update_async(resource_group_name, sql_virtual_machine_name, parameters, custom_headers:nil) # Send request promise = begin_update_async(resource_group_name, sql_virtual_machine_name, parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview::Models::SqlVirtualMachine.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", "update_async", "(", "resource_group_name", ",", "sql_virtual_machine_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "# Send request", "promise", "=", "begin_update_async", "(", "resource_group_name", ",", "sql_virtual_machine_name", ",", "parame...
@param resource_group_name [String] Name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param sql_virtual_machine_name [String] Name of the SQL virtual machine. @param parameters [SqlVirtualMachineUpdate] The SQL virtual machine. @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", "]", "Name", "of", "the", "resource", "group", "that", "contains", "the", "resource", ".", "You", "can", "obtain", "this", "value", "from", "the", "Azure", "Resource", "Manager", "API", "or", "the", "portal", "...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sqlvirtualmachine/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machines.rb#L249-L265
train
Updates a SQL virtual machine.
[ 30522, 13366, 10651, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 29296, 1035, 7484, 1035, 3698, 1035, 2171, 1010, 11709, 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_network/lib/2018-07-01/generated/azure_mgmt_network/route_filters.rb
Azure::Network::Mgmt::V2018_07_01.RouteFilters.update_async
def update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers:nil) # Send request promise = begin_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_07_01::Models::RouteFilter.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 update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers:nil) # Send request promise = begin_update_async(resource_group_name, route_filter_name, route_filter_parameters, custom_headers:custom_headers) promise = promise.then do |response| # Defining deserialization method. deserialize_method = lambda do |parsed_response| result_mapper = Azure::Network::Mgmt::V2018_07_01::Models::RouteFilter.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", "update_async", "(", "resource_group_name", ",", "route_filter_name", ",", "route_filter_parameters", ",", "custom_headers", ":", "nil", ")", "# Send request", "promise", "=", "begin_update_async", "(", "resource_group_name", ",", "route_filter_name", ",", "route_f...
@param resource_group_name [String] The name of the resource group. @param route_filter_name [String] The name of the route filter. @param route_filter_parameters [PatchRouteFilter] Parameters supplied to the update route filter operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Concurrent::Promise] promise which provides async access to http response.
[ "@param", "resource_group_name", "[", "String", "]", "The", "name", "of", "the", "resource", "group", ".", "@param", "route_filter_name", "[", "String", "]", "The", "name", "of", "the", "route", "filter", ".", "@param", "route_filter_parameters", "[", "PatchRout...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_filters.rb#L234-L250
train
Updates a route filter.
[ 30522, 13366, 10651, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2799, 1035, 11307, 1035, 2171, 1010, 2799, 1035, 11307, 1035, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 1001, 4604, 5227, 4872, 1027,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-ec2/lib/aws-sdk-ec2/volume.rb
Aws::EC2.Volume.snapshots
def snapshots(options = {}) batches = Enumerator.new do |y| options = Aws::Util.deep_merge(options, filters: [{ name: "volume-id", values: [@id] }]) resp = @client.describe_snapshots(options) resp.each_page do |page| batch = [] page.data.snapshots.each do |s| batch << Snapshot.new( id: s.snapshot_id, data: s, client: @client ) end y.yield(batch) end end Snapshot::Collection.new(batches) end
ruby
def snapshots(options = {}) batches = Enumerator.new do |y| options = Aws::Util.deep_merge(options, filters: [{ name: "volume-id", values: [@id] }]) resp = @client.describe_snapshots(options) resp.each_page do |page| batch = [] page.data.snapshots.each do |s| batch << Snapshot.new( id: s.snapshot_id, data: s, client: @client ) end y.yield(batch) end end Snapshot::Collection.new(batches) end
[ "def", "snapshots", "(", "options", "=", "{", "}", ")", "batches", "=", "Enumerator", ".", "new", "do", "|", "y", "|", "options", "=", "Aws", "::", "Util", ".", "deep_merge", "(", "options", ",", "filters", ":", "[", "{", "name", ":", "\"volume-id\""...
@!group Associations @example Request syntax with placeholder values snapshots = volume.snapshots({ filters: [ { name: "String", values: ["String"], }, ], owner_ids: ["String"], restorable_by_user_ids: ["String"], snapshot_ids: ["String"], dry_run: false, }) @param [Hash] options ({}) @option options [Array<Types::Filter>] :filters The filters. * `description` - A description of the snapshot. * `encrypted` - Indicates whether the snapshot is encrypted (`true` \| `false`) * `owner-alias` - Value from an Amazon-maintained list (`amazon` \| `self` \| `all` \| `aws-marketplace` \| `microsoft`) of snapshot owners. Not to be confused with the user-configured AWS account alias, which is set from the IAM console. * `owner-id` - The ID of the AWS account that owns the snapshot. * `progress` - The progress of the snapshot, as a percentage (for example, 80%). * `snapshot-id` - The snapshot ID. * `start-time` - The time stamp when the snapshot was initiated. * `status` - The status of the snapshot (`pending` \| `completed` \| `error`). * `tag`\:&lt;key&gt; - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key `Owner` and the value `TeamA`, specify `tag:Owner` for the filter name and `TeamA` for the filter value. * `tag-key` - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value. * `volume-id` - The ID of the volume the snapshot is for. * `volume-size` - The size of the volume, in GiB. @option options [Array<String>] :owner_ids Describes the snapshots owned by these owners. @option options [Array<String>] :restorable_by_user_ids The IDs of the AWS accounts that can create volumes from the snapshot. @option options [Array<String>] :snapshot_ids The snapshot IDs. Default: Describes the snapshots for which you have create volume permissions. @option options [Boolean] :dry_run Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`. @return [Snapshot::Collection]
[ "@!group", "Associations", "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/volume.rb#L616-L636
train
Returns a collection of all snapshots in this volume
[ 30522, 13366, 20057, 12326, 2015, 1006, 7047, 1027, 1063, 1065, 1007, 14108, 2229, 1027, 4372, 17897, 16259, 1012, 2047, 2079, 1064, 1061, 1064, 7047, 1027, 22091, 2015, 1024, 1024, 21183, 4014, 1012, 2784, 1035, 13590, 1006, 7047, 1010, 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_correlated_event_list
def get_correlated_event_list(event_instance_id, timeout:60, custom_headers:nil) response = get_correlated_event_list_async(event_instance_id, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_correlated_event_list(event_instance_id, timeout:60, custom_headers:nil) response = get_correlated_event_list_async(event_instance_id, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_correlated_event_list", "(", "event_instance_id", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_correlated_event_list_async", "(", "event_instance_id", ",", "timeout", ":", "timeout", ",", "custom_headers", ":cust...
Gets all correlated events for a given event. The response is list of FabricEvents. @param event_instance_id [String] The EventInstanceId. @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 [Array] operation results.
[ "Gets", "all", "correlated", "events", "for", "a", "given", "event", "." ]
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#L29174-L29177
train
Gets the list of correlated events.
[ 30522, 13366, 2131, 1035, 23900, 1035, 2724, 1035, 2862, 1006, 2724, 1035, 6013, 1035, 8909, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 23900, 1035, 2724, 1035, 2862, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
ruby-i18n/i18n
lib/i18n.rb
I18n.Base.translate
def translate(key = nil, *, throw: false, raise: false, locale: nil, **options) # TODO deprecate :raise locale ||= config.locale raise Disabled.new('t') if locale == false enforce_available_locales!(locale) backend = config.backend result = catch(:exception) do if key.is_a?(Array) key.map { |k| backend.translate(locale, k, options) } else backend.translate(locale, key, options) end end if result.is_a?(MissingTranslation) handle_exception((throw && :throw || raise && :raise), result, locale, key, options) else result end end
ruby
def translate(key = nil, *, throw: false, raise: false, locale: nil, **options) # TODO deprecate :raise locale ||= config.locale raise Disabled.new('t') if locale == false enforce_available_locales!(locale) backend = config.backend result = catch(:exception) do if key.is_a?(Array) key.map { |k| backend.translate(locale, k, options) } else backend.translate(locale, key, options) end end if result.is_a?(MissingTranslation) handle_exception((throw && :throw || raise && :raise), result, locale, key, options) else result end end
[ "def", "translate", "(", "key", "=", "nil", ",", "*", ",", "throw", ":", "false", ",", "raise", ":", "false", ",", "locale", ":", "nil", ",", "**", "options", ")", "# TODO deprecate :raise", "locale", "||=", "config", ".", "locale", "raise", "Disabled", ...
Translates, pluralizes and interpolates a given key using a given locale, scope, and default, as well as interpolation values. *LOOKUP* Translation data is organized as a nested hash using the upper-level keys as namespaces. <em>E.g.</em>, ActionView ships with the translation: <tt>:date => {:formats => {:short => "%b %d"}}</tt>. Translations can be looked up at any level of this hash using the key argument and the scope option. <em>E.g.</em>, in this example <tt>I18n.t :date</tt> returns the whole translations hash <tt>{:formats => {:short => "%b %d"}}</tt>. Key can be either a single key or a dot-separated key (both Strings and Symbols work). <em>E.g.</em>, the short format can be looked up using both: I18n.t 'date.formats.short' I18n.t :'date.formats.short' Scope can be either a single key, a dot-separated key or an array of keys or dot-separated keys. Keys and scopes can be combined freely. So these examples will all look up the same short date format: I18n.t 'date.formats.short' I18n.t 'formats.short', :scope => 'date' I18n.t 'short', :scope => 'date.formats' I18n.t 'short', :scope => %w(date formats) *INTERPOLATION* Translations can contain interpolation variables which will be replaced by values passed to #translate as part of the options hash, with the keys matching the interpolation variable names. <em>E.g.</em>, with a translation <tt>:foo => "foo %{bar}"</tt> the option value for the key +bar+ will be interpolated into the translation: I18n.t :foo, :bar => 'baz' # => 'foo baz' *PLURALIZATION* Translation data can contain pluralized translations. Pluralized translations are arrays of singluar/plural versions of translations like <tt>['Foo', 'Foos']</tt>. Note that <tt>I18n::Backend::Simple</tt> only supports an algorithm for English pluralization rules. Other algorithms can be supported by custom backends. This returns the singular version of a pluralized translation: I18n.t :foo, :count => 1 # => 'Foo' These both return the plural version of a pluralized translation: I18n.t :foo, :count => 0 # => 'Foos' I18n.t :foo, :count => 2 # => 'Foos' The <tt>:count</tt> option can be used both for pluralization and interpolation. <em>E.g.</em>, with the translation <tt>:foo => ['%{count} foo', '%{count} foos']</tt>, count will be interpolated to the pluralized translation: I18n.t :foo, :count => 1 # => '1 foo' *DEFAULTS* This returns the translation for <tt>:foo</tt> or <tt>default</tt> if no translation was found: I18n.t :foo, :default => 'default' This returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt> if no translation for <tt>:foo</tt> was found: I18n.t :foo, :default => :bar Returns the translation for <tt>:foo</tt> or the translation for <tt>:bar</tt> or <tt>default</tt> if no translations for <tt>:foo</tt> and <tt>:bar</tt> were found. I18n.t :foo, :default => [:bar, 'default'] *BULK LOOKUP* This returns an array with the translations for <tt>:foo</tt> and <tt>:bar</tt>. I18n.t [:foo, :bar] Can be used with dot-separated nested keys: I18n.t [:'baz.foo', :'baz.bar'] Which is the same as using a scope option: I18n.t [:foo, :bar], :scope => :baz *LAMBDAS* Both translations and defaults can be given as Ruby lambdas. Lambdas will be called and passed the key and options. E.g. assuming the key <tt>:salutation</tt> resolves to: lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" } Then <tt>I18n.t(:salutation, :gender => 'w', :name => 'Smith') will result in "Mrs. Smith". Note that the string returned by lambda will go through string interpolation too, so the following lambda would give the same result: lambda { |key, options| options[:gender] == 'm' ? "Mr. %{name}" : "Mrs. %{name}" } It is recommended to use/implement lambdas in an "idempotent" way. E.g. when a cache layer is put in front of I18n.translate it will generate a cache key from the argument values passed to #translate. Therefor your lambdas should always return the same translations/values per unique combination of argument values.
[ "Translates", "pluralizes", "and", "interpolates", "a", "given", "key", "using", "a", "given", "locale", "scope", "and", "default", "as", "well", "as", "interpolation", "values", "." ]
0c5dab494d9b043e00662d8e789229c33045c024
https://github.com/ruby-i18n/i18n/blob/0c5dab494d9b043e00662d8e789229c33045c024/lib/i18n.rb#L179-L199
train
Translate a key to a given locale.
[ 30522, 13366, 17637, 1006, 3145, 1027, 9152, 2140, 1010, 1008, 1010, 5466, 1024, 6270, 1010, 5333, 1024, 6270, 1010, 2334, 2063, 1024, 9152, 2140, 1010, 1008, 1008, 7047, 1007, 1001, 28681, 2080, 2139, 28139, 16280, 1024, 5333, 2334, 2063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb
Azure::MixedReality::Mgmt::V2019_02_28_preview.SpatialAnchorsAccounts.update_with_http_info
def update_with_http_info(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil) update_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value! end
ruby
def update_with_http_info(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil) update_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value! end
[ "def", "update_with_http_info", "(", "resource_group_name", ",", "spatial_anchors_account_name", ",", "spatial_anchors_account", ",", "custom_headers", ":", "nil", ")", "update_async", "(", "resource_group_name", ",", "spatial_anchors_account_name", ",", "spatial_anchors_accoun...
Updating a Spatial Anchors Account @param resource_group_name [String] Name of an Azure resource group. @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial Anchors Account. @param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors Account parameter. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Updating", "a", "Spatial", "Anchors", "Account" ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb#L421-L423
train
Updates a spatial anchors account.
[ 30522, 13366, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 13589, 1035, 24674, 1035, 4070, 1035, 2171, 1010, 13589, 1035, 24674, 1035, 4070, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 106...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mikel/mail
lib/mail/elements/address.rb
Mail.Address.format
def format(output_type = :decode) parse unless @parsed if @data.nil? Constants::EMPTY elsif name = display_name(output_type) [Utilities.quote_phrase(name), "<#{address(output_type)}>", format_comments].compact.join(Constants::SPACE) elsif a = address(output_type) [a, format_comments].compact.join(Constants::SPACE) else raw end end
ruby
def format(output_type = :decode) parse unless @parsed if @data.nil? Constants::EMPTY elsif name = display_name(output_type) [Utilities.quote_phrase(name), "<#{address(output_type)}>", format_comments].compact.join(Constants::SPACE) elsif a = address(output_type) [a, format_comments].compact.join(Constants::SPACE) else raw end end
[ "def", "format", "(", "output_type", "=", ":decode", ")", "parse", "unless", "@parsed", "if", "@data", ".", "nil?", "Constants", "::", "EMPTY", "elsif", "name", "=", "display_name", "(", "output_type", ")", "[", "Utilities", ".", "quote_phrase", "(", "name",...
Returns a correctly formatted address for the email going out. If given an incorrectly formatted address as input, Mail::Address will do its best to format it correctly. This includes quoting display names as needed and putting the address in angle brackets etc. a = Address.new('Mikel Lindsaar (My email address) <mikel@test.lindsaar.net>') a.format #=> 'Mikel Lindsaar <mikel@test.lindsaar.net> (My email address)'
[ "Returns", "a", "correctly", "formatted", "address", "for", "the", "email", "going", "out", ".", "If", "given", "an", "incorrectly", "formatted", "address", "as", "input", "Mail", "::", "Address", "will", "do", "its", "best", "to", "format", "it", "correctly...
fb53fb369eb2bf0494ac70675970c90cdcc3f495
https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/elements/address.rb#L47-L58
train
Returns the raw data as a string.
[ 30522, 13366, 4289, 1006, 6434, 1035, 2828, 1027, 1024, 21933, 3207, 1007, 11968, 3366, 4983, 1030, 11968, 6924, 2065, 1030, 2951, 1012, 9152, 2140, 1029, 5377, 2015, 1024, 1024, 4064, 3449, 5332, 2546, 2171, 1027, 4653, 1035, 2171, 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...
puppetlabs/puppet
lib/puppet/util/windows/service.rb
Puppet::Util::Windows.Service.service_state
def service_state(service_name) state = nil open_service(service_name, SC_MANAGER_CONNECT, SERVICE_QUERY_STATUS) do |service| query_status(service) do |status| state = SERVICE_STATES[status[:dwCurrentState]] end end if state.nil? raise Puppet::Error.new(_("Unknown Service state '%{current_state}' for '%{service_name}'") % { current_state: state.to_s, service_name: service_name}) end state end
ruby
def service_state(service_name) state = nil open_service(service_name, SC_MANAGER_CONNECT, SERVICE_QUERY_STATUS) do |service| query_status(service) do |status| state = SERVICE_STATES[status[:dwCurrentState]] end end if state.nil? raise Puppet::Error.new(_("Unknown Service state '%{current_state}' for '%{service_name}'") % { current_state: state.to_s, service_name: service_name}) end state end
[ "def", "service_state", "(", "service_name", ")", "state", "=", "nil", "open_service", "(", "service_name", ",", "SC_MANAGER_CONNECT", ",", "SERVICE_QUERY_STATUS", ")", "do", "|", "service", "|", "query_status", "(", "service", ")", "do", "|", "status", "|", "...
Query the state of a service using QueryServiceStatusEx @param [string] service_name name of the service to query @return [string] the status of the service
[ "Query", "the", "state", "of", "a", "service", "using", "QueryServiceStatusEx" ]
4baeed97cbb7571ddc6635f0a24debe2e8b22cd3
https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/windows/service.rb#L365-L376
train
Get the current state of a service
[ 30522, 13366, 2326, 1035, 2110, 1006, 2326, 1035, 2171, 1007, 2110, 1027, 9152, 2140, 2330, 1035, 2326, 1006, 2326, 1035, 2171, 1010, 8040, 1035, 3208, 1035, 7532, 1010, 2326, 1035, 23032, 1035, 3570, 1007, 2079, 1064, 2326, 1064, 23032, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
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_image_performance_count_with_http_info
def get_image_performance_count_with_http_info(project_id, iteration_id, tag_ids:nil, custom_headers:nil) get_image_performance_count_async(project_id, iteration_id, tag_ids:tag_ids, custom_headers:custom_headers).value! end
ruby
def get_image_performance_count_with_http_info(project_id, iteration_id, tag_ids:nil, custom_headers:nil) get_image_performance_count_async(project_id, iteration_id, tag_ids:tag_ids, custom_headers:custom_headers).value! end
[ "def", "get_image_performance_count_with_http_info", "(", "project_id", ",", "iteration_id", ",", "tag_ids", ":", "nil", ",", "custom_headers", ":", "nil", ")", "get_image_performance_count_async", "(", "project_id", ",", "iteration_id", ",", "tag_ids", ":tag_ids", ",",...
Gets the number of images tagged with the provided {tagIds} that have prediction results from training for the provided iteration {iterationId}. The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and "Cat" tags, then only images tagged with Dog and/or Cat will be returned @param project_id The project id. @param iteration_id The iteration id. Defaults to workspace. @param tag_ids A list of tags ids to filter the images to count. Defaults to all tags when null. @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", "number", "of", "images", "tagged", "with", "the", "provided", "{", "tagIds", "}", "that", "have", "prediction", "results", "from", "training", "for", "the", "provided", "iteration", "{", "iterationId", "}", "." ]
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#L2729-L2731
train
Gets the number of images that are performance of an iteration.
[ 30522, 13366, 2131, 1035, 3746, 1035, 2836, 1035, 4175, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 2622, 1035, 8909, 1010, 27758, 1035, 8909, 1010, 6415, 1035, 8909, 2015, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
floere/phony
lib/phony/country_codes.rb
Phony.CountryCodes.format
def format number, options = {} country, _, national_number = partial_split number country.format national_number, options end
ruby
def format number, options = {} country, _, national_number = partial_split number country.format national_number, options end
[ "def", "format", "number", ",", "options", "=", "{", "}", "country", ",", "_", ",", "national_number", "=", "partial_split", "number", "country", ".", "format", "national_number", ",", "options", "end" ]
Format the number.
[ "Format", "the", "number", "." ]
9ca50743499cf478a25fdb927bcdacd29d2c90c7
https://github.com/floere/phony/blob/9ca50743499cf478a25fdb927bcdacd29d2c90c7/lib/phony/country_codes.rb#L87-L90
train
Format the number
[ 30522, 13366, 4289, 2193, 1010, 7047, 1027, 1063, 1065, 2406, 1010, 1035, 1010, 2120, 1035, 2193, 1027, 7704, 1035, 3975, 2193, 2406, 1012, 4289, 2120, 1035, 2193, 1010, 7047, 2203, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
mongodb/mongoid
lib/mongoid/findable.rb
Mongoid.Findable.find_by
def find_by(attrs = {}) result = where(attrs).find_first if result.nil? && Mongoid.raise_not_found_error raise(Errors::DocumentNotFound.new(self, attrs)) end yield(result) if result && block_given? result end
ruby
def find_by(attrs = {}) result = where(attrs).find_first if result.nil? && Mongoid.raise_not_found_error raise(Errors::DocumentNotFound.new(self, attrs)) end yield(result) if result && block_given? result end
[ "def", "find_by", "(", "attrs", "=", "{", "}", ")", "result", "=", "where", "(", "attrs", ")", ".", "find_first", "if", "result", ".", "nil?", "&&", "Mongoid", ".", "raise_not_found_error", "raise", "(", "Errors", "::", "DocumentNotFound", ".", "new", "(...
Find the first +Document+ given the conditions. If a matching Document is not found and Mongoid.raise_not_found_error is true it raises Mongoid::Errors::DocumentNotFound, return null nil elsewise. @example Find the document by attribute other than id Person.find_by(:username => "superuser") @param [ Hash ] attrs The attributes to check. @raise [ Errors::DocumentNotFound ] If no document found and Mongoid.raise_not_found_error is true. @return [ Document, nil ] A matching document. @since 3.0.0
[ "Find", "the", "first", "+", "Document", "+", "given", "the", "conditions", ".", "If", "a", "matching", "Document", "is", "not", "found", "and", "Mongoid", ".", "raise_not_found_error", "is", "true", "it", "raises", "Mongoid", "::", "Errors", "::", "Document...
56976e32610f4c2450882b0bfe14da099f0703f4
https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/findable.rb#L114-L121
train
Find the first document matching the given attributes.
[ 30522, 13366, 2424, 1035, 2011, 1006, 2012, 16344, 2015, 1027, 1063, 1065, 1007, 2765, 1027, 2073, 1006, 2012, 16344, 2015, 1007, 1012, 2424, 1035, 2034, 2065, 2765, 1012, 9152, 2140, 1029, 1004, 1004, 12256, 3995, 3593, 1012, 5333, 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_automation/lib/2015-10-31/generated/azure_mgmt_automation/runbook_operations.rb
Azure::Automation::Mgmt::V2015_10_31.RunbookOperations.create_or_update_with_http_info
def create_or_update_with_http_info(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers:nil) create_or_update_async(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers:custom_headers).value! end
ruby
def create_or_update_with_http_info(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers:nil) create_or_update_async(resource_group_name, automation_account_name, runbook_name, parameters, custom_headers:custom_headers).value! end
[ "def", "create_or_update_with_http_info", "(", "resource_group_name", ",", "automation_account_name", ",", "runbook_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "create_or_update_async", "(", "resource_group_name", ",", "automation_account_name", ",", "...
Create the runbook identified by runbook name. @param resource_group_name [String] Name of an Azure Resource group. @param automation_account_name [String] The name of the automation account. @param runbook_name [String] The runbook name. @param parameters [RunbookCreateOrUpdateParameters] The create or update parameters for runbook. Provide either content link for a published runbook or draft, not both. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Create", "the", "runbook", "identified", "by", "runbook", "name", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/runbook_operations.rb#L262-L264
train
Creates or updates a runbook.
[ 30522, 13366, 3443, 1035, 2030, 1035, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 19309, 1035, 4070, 1035, 2171, 1010, 2448, 8654, 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...
castwide/solargraph
lib/solargraph/api_map.rb
Solargraph.ApiMap.document
def document path rake_yard(store) docs = [] docs.push code_object_at(path) unless code_object_at(path).nil? docs end
ruby
def document path rake_yard(store) docs = [] docs.push code_object_at(path) unless code_object_at(path).nil? docs end
[ "def", "document", "path", "rake_yard", "(", "store", ")", "docs", "=", "[", "]", "docs", ".", "push", "code_object_at", "(", "path", ")", "unless", "code_object_at", "(", "path", ")", ".", "nil?", "docs", "end" ]
Get YARD documentation for the specified path. @example api_map.document('String#split') @param path [String] The path to find @return [Array<YARD::CodeObject::Base>]
[ "Get", "YARD", "documentation", "for", "the", "specified", "path", "." ]
47badb5d151aca775ccbe6c470236089eae7839d
https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/api_map.rb#L412-L417
train
Returns the document at the given path.
[ 30522, 13366, 6254, 4130, 26008, 1035, 4220, 1006, 3573, 1007, 9986, 2015, 1027, 1031, 1033, 9986, 2015, 1012, 5245, 3642, 1035, 4874, 1035, 2012, 1006, 4130, 1007, 4983, 3642, 1035, 4874, 1035, 2012, 1006, 4130, 1007, 1012, 30524, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.each_iptc_dataset
def each_iptc_dataset Magick::IPTC.constants.each do |record| rec = Magick::IPTC.const_get(record) rec.constants.each do |dataset| data_field = get_iptc_dataset(rec.const_get(dataset)) yield(dataset, data_field) unless data_field.nil? end end nil end
ruby
def each_iptc_dataset Magick::IPTC.constants.each do |record| rec = Magick::IPTC.const_get(record) rec.constants.each do |dataset| data_field = get_iptc_dataset(rec.const_get(dataset)) yield(dataset, data_field) unless data_field.nil? end end nil end
[ "def", "each_iptc_dataset", "Magick", "::", "IPTC", ".", "constants", ".", "each", "do", "|", "record", "|", "rec", "=", "Magick", "::", "IPTC", ".", "const_get", "(", "record", ")", "rec", ".", "constants", ".", "each", "do", "|", "dataset", "|", "dat...
Iterate over IPTC record number:dataset tags, yield for each non-nil dataset
[ "Iterate", "over", "IPTC", "record", "number", ":", "dataset", "tags", "yield", "for", "each", "non", "-", "nil", "dataset" ]
ef6688ed9d76bf123c2ea1a483eff8635051adb7
https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L859-L868
train
Yields the dataset and the data field for each record.
[ 30522, 13366, 2169, 1035, 12997, 13535, 1035, 2951, 13462, 3894, 2243, 1024, 1024, 12997, 13535, 1012, 5377, 2015, 1012, 2169, 2079, 1064, 2501, 1064, 28667, 1027, 3894, 2243, 1024, 1024, 12997, 13535, 1012, 9530, 3367, 1035, 2131, 1006, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
kmuto/review
lib/review/latexbuilder.rb
ReVIEW.LATEXBuilder.inline_list
def inline_list(id) chapter, id = extract_chapter_id(id) if get_chap(chapter).nil? macro('reviewlistref', I18n.t('format_number_without_chapter', [chapter.list(id).number])) else macro('reviewlistref', I18n.t('format_number', [get_chap(chapter), chapter.list(id).number])) end rescue KeyError error "unknown list: #{id}" end
ruby
def inline_list(id) chapter, id = extract_chapter_id(id) if get_chap(chapter).nil? macro('reviewlistref', I18n.t('format_number_without_chapter', [chapter.list(id).number])) else macro('reviewlistref', I18n.t('format_number', [get_chap(chapter), chapter.list(id).number])) end rescue KeyError error "unknown list: #{id}" end
[ "def", "inline_list", "(", "id", ")", "chapter", ",", "id", "=", "extract_chapter_id", "(", "id", ")", "if", "get_chap", "(", "chapter", ")", ".", "nil?", "macro", "(", "'reviewlistref'", ",", "I18n", ".", "t", "(", "'format_number_without_chapter'", ",", ...
FIXME: use TeX native label/ref.
[ "FIXME", ":", "use", "TeX", "native", "label", "/", "ref", "." ]
77d1273e671663f05db2992281fd891b776badf0
https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/review/latexbuilder.rb#L934-L943
train
inline list
[ 30522, 13366, 23881, 1035, 2862, 1006, 8909, 1007, 3127, 1010, 8909, 1027, 14817, 1035, 3127, 1035, 8909, 1006, 8909, 1007, 2065, 2131, 1035, 15775, 2361, 1006, 3127, 1007, 1012, 9152, 2140, 1029, 26632, 1006, 1005, 3319, 9863, 2890, 2546, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.add_entity
def add_entity(app_id, version_id, model_create_object, custom_headers:nil) response = add_entity_async(app_id, version_id, model_create_object, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def add_entity(app_id, version_id, model_create_object, custom_headers:nil) response = add_entity_async(app_id, version_id, model_create_object, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "add_entity", "(", "app_id", ",", "version_id", ",", "model_create_object", ",", "custom_headers", ":", "nil", ")", "response", "=", "add_entity_async", "(", "app_id", ",", "version_id", ",", "model_create_object", ",", "custom_headers", ":custom_headers", ")...
Adds a simple entity extractor to a version of the application. @param app_id The application ID. @param version_id [String] The version ID. @param model_create_object [ModelCreateObject] A model object containing the name for the new simple entity extractor. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Uuid] operation results.
[ "Adds", "a", "simple", "entity", "extractor", "to", "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#L268-L271
train
Adds an entity to the application version.
[ 30522, 13366, 5587, 1035, 9178, 1006, 10439, 1035, 8909, 1010, 2544, 1035, 8909, 1010, 2944, 1035, 3443, 1035, 4874, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 5587, 1035, 9178, 1035, 2004, 6038, 2278, 1006, 10439, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_node_load_info_with_http_info
def get_node_load_info_with_http_info(node_name, timeout:60, custom_headers:nil) get_node_load_info_async(node_name, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def get_node_load_info_with_http_info(node_name, timeout:60, custom_headers:nil) get_node_load_info_async(node_name, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "get_node_load_info_with_http_info", "(", "node_name", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "get_node_load_info_async", "(", "node_name", ",", "timeout", ":", "timeout", ",", "custom_headers", ":custom_headers", ")", ".", "value!...
Gets the load information of a Service Fabric node. Retrieves the load information of a Service Fabric node for all the metrics that have load or capacity defined. @param node_name [String] The name of the node. @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", "load", "information", "of", "a", "Service", "Fabric", "node", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L4076-L4078
train
Gets the load information of the specified node.
[ 30522, 13366, 2131, 1035, 13045, 1035, 7170, 1035, 18558, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 13045, 1035, 2171, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, 13045, 1035, 7170, 1035...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_partition_info_list
def get_partition_info_list(service_id, continuation_token:nil, timeout:60, custom_headers:nil) response = get_partition_info_list_async(service_id, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_partition_info_list(service_id, continuation_token:nil, timeout:60, custom_headers:nil) response = get_partition_info_list_async(service_id, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_partition_info_list", "(", "service_id", ",", "continuation_token", ":", "nil", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_partition_info_list_async", "(", "service_id", ",", "continuation_token", ":continuatio...
Gets the list of partitions of a Service Fabric service. Gets the list of partitions of a Service Fabric service. The response includes the partition ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the partition. @param service_id [String] The identity of the service. This is typically the full name of the service without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. @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 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 [PagedServicePartitionInfoList] operation results.
[ "Gets", "the", "list", "of", "partitions", "of", "a", "Service", "Fabric", "service", "." ]
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#L11840-L11843
train
Gets the partition info list for the specified service.
[ 30522, 13366, 2131, 1035, 13571, 1035, 18558, 1035, 2862, 1006, 2326, 1035, 8909, 1010, 13633, 1035, 19204, 1024, 9152, 2140, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 13571...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/interactions.rb
Azure::CustomerInsights::Mgmt::V2017_01_01.Interactions.list_by_hub
def list_by_hub(resource_group_name, hub_name, locale_code:'en-us', custom_headers:nil) first_page = list_by_hub_as_lazy(resource_group_name, hub_name, locale_code:locale_code, custom_headers:custom_headers) first_page.get_all_items end
ruby
def list_by_hub(resource_group_name, hub_name, locale_code:'en-us', custom_headers:nil) first_page = list_by_hub_as_lazy(resource_group_name, hub_name, locale_code:locale_code, custom_headers:custom_headers) first_page.get_all_items end
[ "def", "list_by_hub", "(", "resource_group_name", ",", "hub_name", ",", "locale_code", ":", "'en-us'", ",", "custom_headers", ":", "nil", ")", "first_page", "=", "list_by_hub_as_lazy", "(", "resource_group_name", ",", "hub_name", ",", "locale_code", ":locale_code", ...
Gets all interactions in the hub. @param resource_group_name [String] The name of the resource group. @param hub_name [String] The name of the hub. @param locale_code [String] Locale of interaction to retrieve, default is en-us. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array<InteractionResourceFormat>] operation results.
[ "Gets", "all", "interactions", "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/interactions.rb#L189-L192
train
Gets all the segmentation of the hub.
[ 30522, 13366, 2862, 1035, 2011, 1035, 9594, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 9594, 1035, 2171, 1010, 2334, 2063, 1035, 3642, 1024, 1005, 4372, 1011, 2149, 1005, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2034, 1035, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
jnunemaker/flipper
lib/flipper/feature.rb
Flipper.Feature.gate_for
def gate_for(thing) gates.detect { |gate| gate.protects?(thing) } || raise(GateNotFound, thing) end
ruby
def gate_for(thing) gates.detect { |gate| gate.protects?(thing) } || raise(GateNotFound, thing) end
[ "def", "gate_for", "(", "thing", ")", "gates", ".", "detect", "{", "|", "gate", "|", "gate", ".", "protects?", "(", "thing", ")", "}", "||", "raise", "(", "GateNotFound", ",", "thing", ")", "end" ]
Public: Find the gate that protects a thing. thing - The object for which you would like to find a gate Returns a Flipper::Gate. Raises Flipper::GateNotFound if no gate found for thing
[ "Public", ":", "Find", "the", "gate", "that", "protects", "a", "thing", "." ]
df0352b663ad3ed45d68710f10a8170249ff9d78
https://github.com/jnunemaker/flipper/blob/df0352b663ad3ed45d68710f10a8170249ff9d78/lib/flipper/feature.rb#L365-L367
train
Returns the gate for the given thing.
[ 30522, 13366, 4796, 1035, 2005, 1006, 2518, 1007, 6733, 1012, 11487, 1063, 1064, 4796, 1064, 4796, 1012, 18227, 1029, 1006, 2518, 1007, 1065, 1064, 1064, 5333, 1006, 4796, 17048, 14876, 8630, 1010, 2518, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/2016-03-01/generated/azure_mgmt_monitor/alert_rules.rb
Azure::Monitor::Mgmt::V2016_03_01.AlertRules.update_with_http_info
def update_with_http_info(resource_group_name, rule_name, alert_rules_resource, custom_headers:nil) update_async(resource_group_name, rule_name, alert_rules_resource, custom_headers:custom_headers).value! end
ruby
def update_with_http_info(resource_group_name, rule_name, alert_rules_resource, custom_headers:nil) update_async(resource_group_name, rule_name, alert_rules_resource, custom_headers:custom_headers).value! end
[ "def", "update_with_http_info", "(", "resource_group_name", ",", "rule_name", ",", "alert_rules_resource", ",", "custom_headers", ":", "nil", ")", "update_async", "(", "resource_group_name", ",", "rule_name", ",", "alert_rules_resource", ",", "custom_headers", ":custom_he...
Updates an existing AlertRuleResource. To update other fields use the CreateOrUpdate method. @param resource_group_name [String] The name of the resource group. @param rule_name [String] The name of the rule. @param alert_rules_resource [AlertRuleResourcePatch] 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", "AlertRuleResource", ".", "To", "update", "other", "fields", "use", "the", "CreateOrUpdate", "method", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_monitor/lib/2016-03-01/generated/azure_mgmt_monitor/alert_rules.rb#L344-L346
train
Updates an existing alert rule.
[ 30522, 13366, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 3627, 1035, 2171, 1010, 9499, 1035, 3513, 1035, 7692, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 10651, 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...
Azure/azure-sdk-for-ruby
management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protectable_items.rb
Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationProtectableItems.get_with_http_info
def get_with_http_info(fabric_name, protection_container_name, protectable_item_name, custom_headers:nil) get_async(fabric_name, protection_container_name, protectable_item_name, custom_headers:custom_headers).value! end
ruby
def get_with_http_info(fabric_name, protection_container_name, protectable_item_name, custom_headers:nil) get_async(fabric_name, protection_container_name, protectable_item_name, custom_headers:custom_headers).value! end
[ "def", "get_with_http_info", "(", "fabric_name", ",", "protection_container_name", ",", "protectable_item_name", ",", "custom_headers", ":", "nil", ")", "get_async", "(", "fabric_name", ",", "protection_container_name", ",", "protectable_item_name", ",", "custom_headers", ...
Gets the details of a protectable item. The operation to get the details of a protectable item. @param fabric_name [String] Fabric name. @param protection_container_name [String] Protection container name. @param protectable_item_name [String] Protectable item name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Gets", "the", "details", "of", "a", "protectable", "item", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protectable_items.rb#L158-L160
train
Gets the protection container protection item.
[ 30522, 13366, 2131, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 8313, 1035, 2171, 1010, 3860, 1035, 11661, 1035, 2171, 1010, 4047, 3085, 1035, 8875, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, 2004, 6038, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
randym/axlsx
lib/axlsx/drawing/pie_3D_chart.rb
Axlsx.Pie3DChart.to_xml_string
def to_xml_string(str = '') super(str) do str << '<c:pie3DChart>' str << ('<c:varyColors val="' << vary_colors.to_s << '"/>') @series.each { |ser| ser.to_xml_string(str) } d_lbls.to_xml_string(str) if @d_lbls str << '</c:pie3DChart>' end end
ruby
def to_xml_string(str = '') super(str) do str << '<c:pie3DChart>' str << ('<c:varyColors val="' << vary_colors.to_s << '"/>') @series.each { |ser| ser.to_xml_string(str) } d_lbls.to_xml_string(str) if @d_lbls str << '</c:pie3DChart>' end end
[ "def", "to_xml_string", "(", "str", "=", "''", ")", "super", "(", "str", ")", "do", "str", "<<", "'<c:pie3DChart>'", "str", "<<", "(", "'<c:varyColors val=\"'", "<<", "vary_colors", ".", "to_s", "<<", "'\"/>'", ")", "@series", ".", "each", "{", "|", "ser...
Creates a new pie chart object @param [GraphicFrame] frame The workbook that owns this chart. @option options [Cell, String] title @option options [Boolean] show_legend @option options [Symbol] grouping @option options [String] gap_depth @option options [Integer] rot_x @option options [String] h_percent @option options [Integer] rot_y @option options [String] depth_percent @option options [Boolean] r_ang_ax @option options [Integer] perspective @see Chart @see View3D Serializes the object @param [String] str @return [String]
[ "Creates", "a", "new", "pie", "chart", "object" ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/pie_3D_chart.rb#L36-L44
train
Returns the XML string for this chart.
[ 30522, 13366, 2000, 1035, 20950, 1035, 5164, 1006, 2358, 2099, 1027, 1005, 1005, 1007, 3565, 1006, 2358, 2099, 1007, 2079, 2358, 2099, 1026, 1026, 1005, 1026, 1039, 1024, 11345, 29097, 7507, 5339, 1028, 1005, 2358, 2099, 1026, 1026, 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...
decidim/decidim
decidim-core/lib/decidim/metric_operation.rb
Decidim.MetricOperation.for
def for(metric_operation, metric_name = nil) list = if metric_name all.find { |manifest| manifest.metric_operation == metric_operation.to_s && manifest.metric_name == metric_name.to_s } else all.find_all { |manifest| manifest.metric_operation == metric_operation.to_s } end list end
ruby
def for(metric_operation, metric_name = nil) list = if metric_name all.find { |manifest| manifest.metric_operation == metric_operation.to_s && manifest.metric_name == metric_name.to_s } else all.find_all { |manifest| manifest.metric_operation == metric_operation.to_s } end list end
[ "def", "for", "(", "metric_operation", ",", "metric_name", "=", "nil", ")", "list", "=", "if", "metric_name", "all", ".", "find", "{", "|", "manifest", "|", "manifest", ".", "metric_operation", "==", "metric_operation", ".", "to_s", "&&", "manifest", ".", ...
Searches for MetricOperationManifest(s) depending on parameters With 'metric_operation' only: - Returns all manifest related to that operation With 'metric_operation' and 'metric_name': - Returns a single manifest related to that two params
[ "Searches", "for", "MetricOperationManifest", "(", "s", ")", "depending", "on", "parameters", "With", "metric_operation", "only", ":", "-", "Returns", "all", "manifest", "related", "to", "that", "operation", "With", "metric_operation", "and", "metric_name", ":", "...
6e2b14e559a63088669904e3c5c49a5180700cf7
https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/metric_operation.rb#L38-L45
train
Returns the list of all the artifacts that match the metric_operation and metric_name.
[ 30522, 13366, 2005, 1006, 12046, 1035, 3169, 1010, 12046, 1035, 2171, 1027, 9152, 2140, 1007, 2862, 1027, 2065, 12046, 1035, 2171, 2035, 1012, 2424, 1063, 1064, 19676, 1064, 19676, 1012, 12046, 1035, 3169, 1027, 1027, 12046, 1035, 3169, 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...
rails/rails
activerecord/lib/active_record/migration.rb
ActiveRecord.Migration.say_with_time
def say_with_time(message) say(message) result = nil time = Benchmark.measure { result = yield } say "%.4fs" % time.real, :subitem say("#{result} rows", :subitem) if result.is_a?(Integer) result end
ruby
def say_with_time(message) say(message) result = nil time = Benchmark.measure { result = yield } say "%.4fs" % time.real, :subitem say("#{result} rows", :subitem) if result.is_a?(Integer) result end
[ "def", "say_with_time", "(", "message", ")", "say", "(", "message", ")", "result", "=", "nil", "time", "=", "Benchmark", ".", "measure", "{", "result", "=", "yield", "}", "say", "\"%.4fs\"", "%", "time", ".", "real", ",", ":subitem", "say", "(", "\"#{r...
Outputs text along with how long it took to run its block. If the block returns an integer it assumes it is the number of rows affected.
[ "Outputs", "text", "along", "with", "how", "long", "it", "took", "to", "run", "its", "block", ".", "If", "the", "block", "returns", "an", "integer", "it", "assumes", "it", "is", "the", "number", "of", "rows", "affected", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/migration.rb#L847-L854
train
Print the result of a block with a given message.
[ 30522, 13366, 2360, 1035, 2007, 1035, 2051, 1006, 4471, 1007, 2360, 1006, 4471, 1007, 2765, 1027, 9152, 2140, 2051, 1027, 6847, 10665, 1012, 5468, 1063, 2765, 1027, 10750, 1065, 2360, 1000, 1003, 1012, 1018, 10343, 1000, 1003, 2051, 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...
activeadmin/activeadmin
lib/active_admin/namespace.rb
ActiveAdmin.Namespace.add_logout_button_to_menu
def add_logout_button_to_menu(menu, priority = 20, html_options = {}) if logout_link_path html_options = html_options.reverse_merge(method: logout_link_method || :get) menu.add id: 'logout', priority: priority, html_options: html_options, label: -> { I18n.t 'active_admin.logout' }, url: -> { render_or_call_method_or_proc_on self, active_admin_namespace.logout_link_path }, if: :current_active_admin_user? end end
ruby
def add_logout_button_to_menu(menu, priority = 20, html_options = {}) if logout_link_path html_options = html_options.reverse_merge(method: logout_link_method || :get) menu.add id: 'logout', priority: priority, html_options: html_options, label: -> { I18n.t 'active_admin.logout' }, url: -> { render_or_call_method_or_proc_on self, active_admin_namespace.logout_link_path }, if: :current_active_admin_user? end end
[ "def", "add_logout_button_to_menu", "(", "menu", ",", "priority", "=", "20", ",", "html_options", "=", "{", "}", ")", "if", "logout_link_path", "html_options", "=", "html_options", ".", "reverse_merge", "(", "method", ":", "logout_link_method", "||", ":get", ")"...
The default logout menu item @param [ActiveAdmin::MenuItem] menu The menu to add the logout link to @param [Fixnum] priority The numeric priority for the order in which it appears @param [Hash] html_options An options hash to pass along to link_to
[ "The", "default", "logout", "menu", "item" ]
0759c8dcf97865748c9344459162ac3c7e65a6cd
https://github.com/activeadmin/activeadmin/blob/0759c8dcf97865748c9344459162ac3c7e65a6cd/lib/active_admin/namespace.rb#L149-L157
train
Add a logout button to the menu
[ 30522, 13366, 5587, 1035, 8154, 4904, 1035, 6462, 1035, 2000, 1035, 12183, 1006, 12183, 1010, 9470, 1027, 2322, 1010, 16129, 1035, 7047, 1027, 1063, 1065, 1007, 2065, 8154, 4904, 1035, 4957, 1035, 4130, 16129, 1035, 7047, 1027, 16129, 1035,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
randym/axlsx
lib/axlsx/workbook/worksheet/cell.rb
Axlsx.Cell.merge
def merge(target) start, stop = if target.is_a?(String) [self.r, target] elsif(target.is_a?(Cell)) Axlsx.sort_cells([self, target]).map { |c| c.r } end self.row.worksheet.merge_cells "#{start}:#{stop}" unless stop.nil? end
ruby
def merge(target) start, stop = if target.is_a?(String) [self.r, target] elsif(target.is_a?(Cell)) Axlsx.sort_cells([self, target]).map { |c| c.r } end self.row.worksheet.merge_cells "#{start}:#{stop}" unless stop.nil? end
[ "def", "merge", "(", "target", ")", "start", ",", "stop", "=", "if", "target", ".", "is_a?", "(", "String", ")", "[", "self", ".", "r", ",", "target", "]", "elsif", "(", "target", ".", "is_a?", "(", "Cell", ")", ")", "Axlsx", ".", "sort_cells", "...
Merges all the cells in a range created between this cell and the cell or string name for a cell provided @see worksheet.merge_cells @param [Cell, String] target The last cell, or str ref for the cell in the merge range
[ "Merges", "all", "the", "cells", "in", "a", "range", "created", "between", "this", "cell", "and", "the", "cell", "or", "string", "name", "for", "a", "cell", "provided" ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/cell.rb#L308-L315
train
Merge cells of the current row with the target cell.
[ 30522, 13366, 13590, 1006, 4539, 1007, 2707, 1010, 2644, 1027, 2065, 4539, 1012, 2003, 1035, 1037, 1029, 1006, 5164, 1007, 1031, 2969, 1012, 1054, 1010, 4539, 1033, 3449, 5332, 2546, 1006, 4539, 1012, 2003, 1035, 1037, 1029, 1006, 3526, 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_consumption/lib/2018-01-31/generated/azure_mgmt_consumption/price_sheet.rb
Azure::Consumption::Mgmt::V2018_01_31.PriceSheet.get_by_billing_period_with_http_info
def get_by_billing_period_with_http_info(billing_period_name, expand:nil, skiptoken:nil, top:nil, custom_headers:nil) get_by_billing_period_async(billing_period_name, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value! end
ruby
def get_by_billing_period_with_http_info(billing_period_name, expand:nil, skiptoken:nil, top:nil, custom_headers:nil) get_by_billing_period_async(billing_period_name, expand:expand, skiptoken:skiptoken, top:top, custom_headers:custom_headers).value! end
[ "def", "get_by_billing_period_with_http_info", "(", "billing_period_name", ",", "expand", ":", "nil", ",", "skiptoken", ":", "nil", ",", "top", ":", "nil", ",", "custom_headers", ":", "nil", ")", "get_by_billing_period_async", "(", "billing_period_name", ",", "expan...
Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only for May 1, 2014 or later. @param billing_period_name [String] Billing Period Name. @param expand [String] May be used to expand the properties/meterDetails within a price sheet. By default, these fields are not included when returning price sheet. @param skiptoken [String] Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies a starting point to use for subsequent calls. @param top [Integer] May be used to limit the number of results to the top N results. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Get", "the", "price", "sheet", "for", "a", "scope", "by", "subscriptionId", "and", "billing", "period", ".", "Price", "sheet", "is", "available", "via", "this", "API", "only", "for", "May", "1", "2014", "or", "later", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_consumption/lib/2018-01-31/generated/azure_mgmt_consumption/price_sheet.rb#L184-L186
train
Gets the list of all the documents in a billing period.
[ 30522, 13366, 2131, 1035, 2011, 1035, 25640, 1035, 2558, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 25640, 1035, 2558, 1035, 2171, 1010, 7818, 1024, 9152, 2140, 1010, 13558, 18715, 2368, 1024, 9152, 2140, 1010, 2327, 1024, 9152, 2140, 1010,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
fastlane/fastlane
precheck/lib/precheck/rules/abstract_text_match_rule.rb
Precheck.AbstractTextMatchRule.rule_block
def rule_block return lambda { |text| text = text.to_s.strip.downcase if text.empty? if pass_if_empty? return RuleReturn.new(validation_state: Precheck::VALIDATION_STATES[:passed]) else return RuleReturn.new(validation_state: VALIDATION_STATES[:failed], failure_data: "missing text") end end text = remove_safe_words(text: text) matches = lowercased_words_to_look_for.each_with_object([]) do |word, found_words| if text.include?(word) found_words << word end end if matches.length > 0 && word_search_type == WORD_SEARCH_TYPES[:fail_on_inclusion] # we are supposed to fail if any of the words are found friendly_matches = matches.join(', ') UI.verbose("😭 #{self.class.name.split('::').last ||= self.class.name} found words \"#{friendly_matches}\"") return RuleReturn.new(validation_state: VALIDATION_STATES[:failed], failure_data: "found: #{friendly_matches}") elsif matches.length < lowercased_words_to_look_for.length && word_search_type == WORD_SEARCH_TYPES[:fail_on_exclusion] # we are supposed to fail if any of the words are not found (like current copyright date in the copyright field) search_data_set = lowercased_words_to_look_for.to_set search_data_set.subtract(matches) missing_words = search_data_set.to_a.join(', ') UI.verbose("😭 #{self.class.name.split('::').last ||= self.class.name} didn't find words \"#{missing_words}\"") return RuleReturn.new(validation_state: VALIDATION_STATES[:failed], failure_data: "missing: #{missing_words}") else return RuleReturn.new(validation_state: VALIDATION_STATES[:passed]) end } end
ruby
def rule_block return lambda { |text| text = text.to_s.strip.downcase if text.empty? if pass_if_empty? return RuleReturn.new(validation_state: Precheck::VALIDATION_STATES[:passed]) else return RuleReturn.new(validation_state: VALIDATION_STATES[:failed], failure_data: "missing text") end end text = remove_safe_words(text: text) matches = lowercased_words_to_look_for.each_with_object([]) do |word, found_words| if text.include?(word) found_words << word end end if matches.length > 0 && word_search_type == WORD_SEARCH_TYPES[:fail_on_inclusion] # we are supposed to fail if any of the words are found friendly_matches = matches.join(', ') UI.verbose("😭 #{self.class.name.split('::').last ||= self.class.name} found words \"#{friendly_matches}\"") return RuleReturn.new(validation_state: VALIDATION_STATES[:failed], failure_data: "found: #{friendly_matches}") elsif matches.length < lowercased_words_to_look_for.length && word_search_type == WORD_SEARCH_TYPES[:fail_on_exclusion] # we are supposed to fail if any of the words are not found (like current copyright date in the copyright field) search_data_set = lowercased_words_to_look_for.to_set search_data_set.subtract(matches) missing_words = search_data_set.to_a.join(', ') UI.verbose("😭 #{self.class.name.split('::').last ||= self.class.name} didn't find words \"#{missing_words}\"") return RuleReturn.new(validation_state: VALIDATION_STATES[:failed], failure_data: "missing: #{missing_words}") else return RuleReturn.new(validation_state: VALIDATION_STATES[:passed]) end } end
[ "def", "rule_block", "return", "lambda", "{", "|", "text", "|", "text", "=", "text", ".", "to_s", ".", "strip", ".", "downcase", "if", "text", ".", "empty?", "if", "pass_if_empty?", "return", "RuleReturn", ".", "new", "(", "validation_state", ":", "Prechec...
rule block that checks text for any instance of each string in lowercased_words_to_look_for
[ "rule", "block", "that", "checks", "text", "for", "any", "instance", "of", "each", "string", "in", "lowercased_words_to_look_for" ]
457c5d647c77f0e078dafa5129da616914e002c5
https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/precheck/lib/precheck/rules/abstract_text_match_rule.rb#L40-L78
train
Rule block for the given text
[ 30522, 13366, 3627, 1035, 3796, 2709, 23375, 1063, 1064, 3793, 1064, 3793, 1027, 3793, 1012, 2000, 1035, 1055, 1012, 6167, 1012, 2091, 18382, 2065, 3793, 1012, 4064, 1029, 2065, 3413, 1035, 2065, 1035, 4064, 1029, 2709, 7786, 3388, 14287, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/create_order_request.rb
SquareConnect.CreateOrderRequest.reference_id=
def reference_id=(reference_id) if !reference_id.nil? && reference_id.to_s.length > 40 fail ArgumentError, "invalid value for 'reference_id', the character length must be smaller than or equal to 40." end @reference_id = reference_id end
ruby
def reference_id=(reference_id) if !reference_id.nil? && reference_id.to_s.length > 40 fail ArgumentError, "invalid value for 'reference_id', the character length must be smaller than or equal to 40." end @reference_id = reference_id end
[ "def", "reference_id", "=", "(", "reference_id", ")", "if", "!", "reference_id", ".", "nil?", "&&", "reference_id", ".", "to_s", ".", "length", ">", "40", "fail", "ArgumentError", ",", "\"invalid value for 'reference_id', the character length must be smaller than or equal...
Custom attribute writer method with validation @param [Object] reference_id Value to be assigned
[ "Custom", "attribute", "writer", "method", "with", "validation" ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/create_order_request.rb#L134-L141
train
Sets the reference_id of the object.
[ 30522, 13366, 4431, 1035, 8909, 1027, 1006, 4431, 1035, 8909, 1007, 2065, 999, 4431, 1035, 8909, 1012, 9152, 2140, 1029, 1004, 1004, 4431, 1035, 8909, 1012, 2000, 1035, 1055, 1012, 3091, 1028, 2871, 8246, 6685, 2121, 29165, 1010, 1000, 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
data/azure_service_fabric/lib/6.4.0.36/generated/azure_service_fabric/mesh_secret_value.rb
Azure::ServiceFabric::V6_4_0_36.MeshSecretValue.add_value
def add_value(secret_resource_name, secret_value_resource_name, secret_value_resource_description, custom_headers:nil) response = add_value_async(secret_resource_name, secret_value_resource_name, secret_value_resource_description, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def add_value(secret_resource_name, secret_value_resource_name, secret_value_resource_description, custom_headers:nil) response = add_value_async(secret_resource_name, secret_value_resource_name, secret_value_resource_description, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "add_value", "(", "secret_resource_name", ",", "secret_value_resource_name", ",", "secret_value_resource_description", ",", "custom_headers", ":", "nil", ")", "response", "=", "add_value_async", "(", "secret_resource_name", ",", "secret_value_resource_name", ",", "se...
Adds the specified value as a new version of the specified secret resource. Creates a new value of the specified secret resource. The name of the value is typically the version identifier. Once created the value cannot be changed. @param secret_resource_name [String] The name of the secret resource. @param secret_value_resource_name [String] The name of the secret resource value which is typically the version identifier for the value. @param secret_value_resource_description [SecretValueResourceDescription] Description for creating a value of a secret resource. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [SecretValueResourceDescription] operation results.
[ "Adds", "the", "specified", "value", "as", "a", "new", "version", "of", "the", "specified", "secret", "resource", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.4.0.36/generated/azure_service_fabric/mesh_secret_value.rb#L42-L45
train
Adds a value to a specified secret resource.
[ 30522, 13366, 5587, 1035, 3643, 1006, 3595, 1035, 7692, 1035, 2171, 1010, 3595, 1035, 3643, 1035, 7692, 1035, 2171, 1010, 3595, 1035, 3643, 1035, 7692, 1035, 6412, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 5587, 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...
projectcypress/health-data-standards
lib/hqmf-parser/2.0/document_helpers/doc_utilities.rb
HQMF2.DocumentUtilities.criteria_covered_by_criteria?
def criteria_covered_by_criteria?(dc) @reference_ids.uniq base_criteria_defs = %w(patient_characteristic_ethnicity patient_characteristic_gender patient_characteristic_payer patient_characteristic_race) to_reject = true # don't reject if anything refers directly to this criteria to_reject &&= @reference_ids.index(dc.id).nil? # don't reject if it is a "base" criteria (no references but must exist) to_reject &&= !base_criteria_defs.include?(dc.definition) # keep referral occurrence to_reject &&= dc.specific_occurrence_const.nil? || dc.code_list_id != '2.16.840.1.113883.3.464.1003.101.12.1046' to_reject && !@data_criteria.detect do |dc2| similar_criteria = true similar_criteria &&= dc != dc2 # Don't check against itself similar_criteria &&= dc.code_list_id == dc2.code_list_id # Ensure code list ids are the same similar_criteria && detect_criteria_covered_by_criteria(dc, dc2) end.nil? # don't reject unless there is a similar element end
ruby
def criteria_covered_by_criteria?(dc) @reference_ids.uniq base_criteria_defs = %w(patient_characteristic_ethnicity patient_characteristic_gender patient_characteristic_payer patient_characteristic_race) to_reject = true # don't reject if anything refers directly to this criteria to_reject &&= @reference_ids.index(dc.id).nil? # don't reject if it is a "base" criteria (no references but must exist) to_reject &&= !base_criteria_defs.include?(dc.definition) # keep referral occurrence to_reject &&= dc.specific_occurrence_const.nil? || dc.code_list_id != '2.16.840.1.113883.3.464.1003.101.12.1046' to_reject && !@data_criteria.detect do |dc2| similar_criteria = true similar_criteria &&= dc != dc2 # Don't check against itself similar_criteria &&= dc.code_list_id == dc2.code_list_id # Ensure code list ids are the same similar_criteria && detect_criteria_covered_by_criteria(dc, dc2) end.nil? # don't reject unless there is a similar element end
[ "def", "criteria_covered_by_criteria?", "(", "dc", ")", "@reference_ids", ".", "uniq", "base_criteria_defs", "=", "%w(", "patient_characteristic_ethnicity", "patient_characteristic_gender", "patient_characteristic_payer", "patient_characteristic_race", ")", "to_reject", "=", "tru...
Checks if one data criteria is covered by another (has all the appropriate elements of)
[ "Checks", "if", "one", "data", "criteria", "is", "covered", "by", "another", "(", "has", "all", "the", "appropriate", "elements", "of", ")" ]
252d4f0927c513eacde6b9ea41b76faa1423c34b
https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/document_helpers/doc_utilities.rb#L65-L83
train
Returns true if the criteria is covered by the criteria
[ 30522, 13366, 9181, 1035, 3139, 1035, 2011, 1035, 9181, 1029, 1006, 5887, 1007, 1030, 4431, 1035, 8909, 2015, 1012, 4895, 18515, 2918, 1035, 9181, 1035, 13366, 2015, 1027, 1003, 1059, 1006, 5776, 1035, 8281, 1035, 18240, 5776, 1035, 8281, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rmosolgo/graphql-ruby
lib/graphql/query.rb
GraphQL.Query.lookahead
def lookahead @lookahead ||= begin ast_node = selected_operation root_type = warden.root_type_for_operation(ast_node.operation_type || "query") root_type = root_type.metadata[:type_class] || raise("Invariant: `lookahead` only works with class-based types") GraphQL::Execution::Lookahead.new(query: self, root_type: root_type, ast_nodes: [ast_node]) end end
ruby
def lookahead @lookahead ||= begin ast_node = selected_operation root_type = warden.root_type_for_operation(ast_node.operation_type || "query") root_type = root_type.metadata[:type_class] || raise("Invariant: `lookahead` only works with class-based types") GraphQL::Execution::Lookahead.new(query: self, root_type: root_type, ast_nodes: [ast_node]) end end
[ "def", "lookahead", "@lookahead", "||=", "begin", "ast_node", "=", "selected_operation", "root_type", "=", "warden", ".", "root_type_for_operation", "(", "ast_node", ".", "operation_type", "||", "\"query\"", ")", "root_type", "=", "root_type", ".", "metadata", "[", ...
A lookahead for the root selections of this query @return [GraphQL::Execution::Lookahead]
[ "A", "lookahead", "for", "the", "root", "selections", "of", "this", "query" ]
d5be13a816f220b9efbabeaa69a3e56fedf311f5
https://github.com/rmosolgo/graphql-ruby/blob/d5be13a816f220b9efbabeaa69a3e56fedf311f5/lib/graphql/query.rb#L151-L158
train
Returns the lookahead for the current operation.
[ 30522, 13366, 2298, 4430, 13775, 1030, 2298, 4430, 13775, 1064, 1064, 1027, 4088, 2004, 2102, 1035, 13045, 1027, 3479, 1035, 3169, 7117, 1035, 2828, 1027, 13745, 1012, 7117, 1035, 2828, 1035, 2005, 1035, 3169, 1006, 2004, 2102, 1035, 13045,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/translations_helper.rb
Decidim.TranslationsHelper.empty_translatable
def empty_translatable(locales = Decidim.available_locales) locales.each_with_object({}) do |locale, result| result[locale.to_s] = "" end end
ruby
def empty_translatable(locales = Decidim.available_locales) locales.each_with_object({}) do |locale, result| result[locale.to_s] = "" end end
[ "def", "empty_translatable", "(", "locales", "=", "Decidim", ".", "available_locales", ")", "locales", ".", "each_with_object", "(", "{", "}", ")", "do", "|", "locale", ",", "result", "|", "result", "[", "locale", ".", "to_s", "]", "=", "\"\"", "end", "e...
Public: Creates an translation for each available language in the list so empty fields still have the correct format. locales - A list of locales to scope the translations to. Picks up all the available locales by default. Returns a Hash with the locales as keys and the empty strings as values.
[ "Public", ":", "Creates", "an", "translation", "for", "each", "available", "language", "in", "the", "list", "so", "empty", "fields", "still", "have", "the", "correct", "format", "." ]
6e2b14e559a63088669904e3c5c49a5180700cf7
https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/translations_helper.rb#L32-L36
train
Empty the language for the current language
[ 30522, 13366, 4064, 1035, 9099, 20051, 3085, 1006, 2334, 2229, 1027, 11703, 28173, 2213, 1012, 2800, 1035, 2334, 2229, 1007, 2334, 2229, 1012, 2169, 1035, 2007, 1035, 4874, 1006, 1063, 1065, 1007, 2079, 1064, 2334, 2063, 1010, 2765, 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_redis/lib/2017-10-01/generated/azure_mgmt_redis/redis.rb
Azure::Redis::Mgmt::V2017_10_01.Redis.list_upgrade_notifications_with_http_info
def list_upgrade_notifications_with_http_info(resource_group_name, name, history, custom_headers:nil) list_upgrade_notifications_async(resource_group_name, name, history, custom_headers:custom_headers).value! end
ruby
def list_upgrade_notifications_with_http_info(resource_group_name, name, history, custom_headers:nil) list_upgrade_notifications_async(resource_group_name, name, history, custom_headers:custom_headers).value! end
[ "def", "list_upgrade_notifications_with_http_info", "(", "resource_group_name", ",", "name", ",", "history", ",", "custom_headers", ":", "nil", ")", "list_upgrade_notifications_async", "(", "resource_group_name", ",", "name", ",", "history", ",", "custom_headers", ":custo...
Gets any upgrade notifications for a Redis cache. @param resource_group_name [String] The name of the resource group. @param name [String] The name of the Redis cache. @param history [Float] how many minutes in past to look for upgrade notifications @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", "any", "upgrade", "notifications", "for", "a", "Redis", "cache", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_redis/lib/2017-10-01/generated/azure_mgmt_redis/redis.rb#L143-L145
train
Gets the list of upgrade notifications for a resource group.
[ 30522, 13366, 2862, 1035, 12200, 1035, 26828, 2015, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2171, 1010, 2381, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2862, 1035, 12200, 1035, 26828, 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...
aws/aws-sdk-ruby
gems/aws-sdk-sns/lib/aws-sdk-sns/resource.rb
Aws::SNS.Resource.create_platform_application
def create_platform_application(options = {}) resp = @client.create_platform_application(options) PlatformApplication.new( arn: resp.data.platform_application_arn, client: @client ) end
ruby
def create_platform_application(options = {}) resp = @client.create_platform_application(options) PlatformApplication.new( arn: resp.data.platform_application_arn, client: @client ) end
[ "def", "create_platform_application", "(", "options", "=", "{", "}", ")", "resp", "=", "@client", ".", "create_platform_application", "(", "options", ")", "PlatformApplication", ".", "new", "(", "arn", ":", "resp", ".", "data", ".", "platform_application_arn", "...
@!group Actions @example Request syntax with placeholder values platformapplication = sns.create_platform_application({ name: "String", # required platform: "String", # required attributes: { # required "String" => "String", }, }) @param [Hash] options ({}) @option options [required, String] :name Application names must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, hyphens, and periods, and must be between 1 and 256 characters long. @option options [required, String] :platform The following platforms are supported: ADM (Amazon Device Messaging), APNS (Apple Push Notification Service), APNS\_SANDBOX, and GCM (Google Cloud Messaging). @option options [required, Hash<String,String>] :attributes For a list of attributes, see [SetPlatformApplicationAttributes][1] [1]: https://docs.aws.amazon.com/sns/latest/api/API_SetPlatformApplicationAttributes.html @return [PlatformApplication]
[ "@!group", "Actions", "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-sns/lib/aws-sdk-sns/resource.rb#L49-L55
train
Creates a platform application
[ 30522, 13366, 3443, 1035, 4132, 1035, 4646, 1006, 7047, 1027, 1063, 1065, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 3443, 1035, 4132, 1035, 4646, 1006, 7047, 1007, 4132, 29098, 19341, 3508, 1012, 2047, 1006, 12098, 2078, 1024, 24501, 2361,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/firewall_rules.rb
Azure::DataLakeAnalytics::Mgmt::V2016_11_01.FirewallRules.get_with_http_info
def get_with_http_info(resource_group_name, account_name, firewall_rule_name, custom_headers:nil) get_async(resource_group_name, account_name, firewall_rule_name, custom_headers:custom_headers).value! end
ruby
def get_with_http_info(resource_group_name, account_name, firewall_rule_name, custom_headers:nil) get_async(resource_group_name, account_name, firewall_rule_name, custom_headers:custom_headers).value! end
[ "def", "get_with_http_info", "(", "resource_group_name", ",", "account_name", ",", "firewall_rule_name", ",", "custom_headers", ":", "nil", ")", "get_async", "(", "resource_group_name", ",", "account_name", ",", "firewall_rule_name", ",", "custom_headers", ":custom_header...
Gets the specified Data Lake Analytics firewall rule. @param resource_group_name [String] The name of the Azure resource group. @param account_name [String] The name of the Data Lake Analytics account. @param firewall_rule_name [String] The name of the firewall rule to retrieve. @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", "specified", "Data", "Lake", "Analytics", "firewall", "rule", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/firewall_rules.rb#L262-L264
train
Gets the specified firewall rule.
[ 30522, 13366, 2131, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4070, 1035, 2171, 1010, 2543, 9628, 1035, 3627, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, 1035, 2004, 6038, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
randym/axlsx
lib/axlsx/workbook/worksheet/color_scale.rb
Axlsx.ColorScale.initialize_default_cfvos
def initialize_default_cfvos(user_cfvos) defaults = self.class.default_cfvos user_cfvos.each_with_index do |cfvo, index| if index < defaults.size cfvo = defaults[index].merge(cfvo) end add cfvo end while colors.size < defaults.size add defaults[colors.size - 1] end end
ruby
def initialize_default_cfvos(user_cfvos) defaults = self.class.default_cfvos user_cfvos.each_with_index do |cfvo, index| if index < defaults.size cfvo = defaults[index].merge(cfvo) end add cfvo end while colors.size < defaults.size add defaults[colors.size - 1] end end
[ "def", "initialize_default_cfvos", "(", "user_cfvos", ")", "defaults", "=", "self", ".", "class", ".", "default_cfvos", "user_cfvos", ".", "each_with_index", "do", "|", "cfvo", ",", "index", "|", "if", "index", "<", "defaults", ".", "size", "cfvo", "=", "def...
There has got to be cleaner way of merging these arrays.
[ "There", "has", "got", "to", "be", "cleaner", "way", "of", "merging", "these", "arrays", "." ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/color_scale.rb#L97-L108
train
Initialize the default CFVOs
[ 30522, 13366, 3988, 4697, 1035, 12398, 1035, 12935, 19862, 1006, 5310, 1035, 12935, 19862, 1007, 12398, 2015, 1027, 2969, 1012, 2465, 1012, 12398, 1035, 12935, 19862, 5310, 1035, 12935, 19862, 1012, 2169, 1035, 2007, 1035, 5950, 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...
fastlane/fastlane
frameit/lib/frameit/config_parser.rb
Frameit.ConfigParser.change_paths_to_absolutes!
def change_paths_to_absolutes!(values) values.each do |key, value| if value.kind_of?(Hash) change_paths_to_absolutes!(value) # recursive call elsif value.kind_of?(Array) value.each do |current| change_paths_to_absolutes!(current) if current.kind_of?(Hash) # recursive call end else if ['font', 'background'].include?(key) # Change the paths to relative ones # `replace`: to change the content of the string, so it's actually stored if @path # where is the config file. We don't have a config file in tests containing_folder = File.expand_path('..', @path) value.replace(File.join(containing_folder, value)) end end end end end
ruby
def change_paths_to_absolutes!(values) values.each do |key, value| if value.kind_of?(Hash) change_paths_to_absolutes!(value) # recursive call elsif value.kind_of?(Array) value.each do |current| change_paths_to_absolutes!(current) if current.kind_of?(Hash) # recursive call end else if ['font', 'background'].include?(key) # Change the paths to relative ones # `replace`: to change the content of the string, so it's actually stored if @path # where is the config file. We don't have a config file in tests containing_folder = File.expand_path('..', @path) value.replace(File.join(containing_folder, value)) end end end end end
[ "def", "change_paths_to_absolutes!", "(", "values", ")", "values", ".", "each", "do", "|", "key", ",", "value", "|", "if", "value", ".", "kind_of?", "(", "Hash", ")", "change_paths_to_absolutes!", "(", "value", ")", "# recursive call", "elsif", "value", ".", ...
Use absolute paths instead of relative
[ "Use", "absolute", "paths", "instead", "of", "relative" ]
457c5d647c77f0e078dafa5129da616914e002c5
https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/frameit/lib/frameit/config_parser.rb#L45-L64
train
Change the paths to absolute ones
[ 30522, 13366, 2689, 1035, 10425, 1035, 2000, 1035, 7619, 2015, 999, 1006, 5300, 1007, 5300, 1012, 2169, 2079, 1064, 3145, 1010, 3643, 1064, 2065, 3643, 30524, 999, 1006, 3643, 1007, 1001, 28667, 9236, 3512, 2655, 3449, 5332, 2546, 3643, 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...
kmuto/review
lib/review/textutils.rb
ReVIEW.TextUtils.trim_lines
def trim_lines(lines) new_lines = lines.dup while new_lines[-1] && new_lines[-1].strip.empty? new_lines.pop end new_lines end
ruby
def trim_lines(lines) new_lines = lines.dup while new_lines[-1] && new_lines[-1].strip.empty? new_lines.pop end new_lines end
[ "def", "trim_lines", "(", "lines", ")", "new_lines", "=", "lines", ".", "dup", "while", "new_lines", "[", "-", "1", "]", "&&", "new_lines", "[", "-", "1", "]", ".", "strip", ".", "empty?", "new_lines", ".", "pop", "end", "new_lines", "end" ]
remove elements at the back of `lines` if element is empty string (`lines` should be Array of String.)
[ "remove", "elements", "at", "the", "back", "of", "lines", "if", "element", "is", "empty", "string", "(", "lines", "should", "be", "Array", "of", "String", ".", ")" ]
77d1273e671663f05db2992281fd891b776badf0
https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/review/textutils.rb#L40-L46
train
Trim lines that are empty
[ 30522, 13366, 12241, 1035, 3210, 1006, 3210, 1007, 2047, 1035, 3210, 1027, 3210, 1012, 4241, 2361, 2096, 2047, 1035, 3210, 1031, 1011, 1015, 1033, 1004, 1004, 2047, 1035, 3210, 1031, 1011, 1015, 1033, 1012, 6167, 1012, 4064, 1029, 2047, 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...
square/connect-ruby-sdk
lib/square_connect/api/v1_items_api.rb
SquareConnect.V1ItemsApi.list_fees
def list_fees(location_id, opts = {}) data, _status_code, _headers = list_fees_with_http_info(location_id, opts) return data end
ruby
def list_fees(location_id, opts = {}) data, _status_code, _headers = list_fees_with_http_info(location_id, opts) return data end
[ "def", "list_fees", "(", "location_id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "list_fees_with_http_info", "(", "location_id", ",", "opts", ")", "return", "data", "end" ]
ListFees Lists all of a location's fees (taxes). @param location_id The ID of the location to list fees for. @param [Hash] opts the optional parameters @return [Array<V1Fee>]
[ "ListFees", "Lists", "all", "of", "a", "location", "s", "fees", "(", "taxes", ")", "." ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L1349-L1352
train
Returns a list of fees for a location
[ 30522, 13366, 2862, 1035, 9883, 1006, 3295, 1035, 8909, 1010, 23569, 2015, 1027, 1063, 1065, 1007, 2951, 1010, 1035, 3570, 1035, 3642, 1010, 1035, 20346, 2015, 1027, 2862, 1035, 30524, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
cheezy/page-object
lib/page-object/accessors.rb
PageObject.Accessors.table
def table(name, identifier={:index => 0}, &block) standard_methods(name, identifier, 'table_for', &block) define_method(name) do return platform.table_text_for identifier.clone unless block_given? self.send("#{name}_element").text end end
ruby
def table(name, identifier={:index => 0}, &block) standard_methods(name, identifier, 'table_for', &block) define_method(name) do return platform.table_text_for identifier.clone unless block_given? self.send("#{name}_element").text end end
[ "def", "table", "(", "name", ",", "identifier", "=", "{", ":index", "=>", "0", "}", ",", "&", "block", ")", "standard_methods", "(", "name", ",", "identifier", ",", "'table_for'", ",", "block", ")", "define_method", "(", "name", ")", "do", "return", "p...
adds three methods - one to return the text for the table, one to retrieve the table element, and another to check the table's existence. @example table(:cart, :id => 'shopping_cart') # will generate a 'cart', 'cart_element' and 'cart?' method @param [Symbol] the name used for the generated methods @param [Hash] identifier how we find a table. @param optional block to be invoked when element method is called
[ "adds", "three", "methods", "-", "one", "to", "return", "the", "text", "for", "the", "table", "one", "to", "retrieve", "the", "table", "element", "and", "another", "to", "check", "the", "table", "s", "existence", "." ]
850d775bf63768fbb1551a34480195785fe8e193
https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L493-L499
train
Creates a new instance of the Table class.
[ 30522, 13366, 2795, 1006, 2171, 1010, 8909, 4765, 18095, 1027, 1063, 1024, 5950, 1027, 1028, 1014, 1065, 1010, 1004, 3796, 1007, 3115, 1035, 4725, 1006, 2171, 1010, 8909, 4765, 18095, 1010, 1005, 2795, 1035, 2005, 1005, 1010, 1004, 3796, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb
Azure::MixedReality::Mgmt::V2019_02_28_preview.SpatialAnchorsAccounts.get_keys
def get_keys(resource_group_name, spatial_anchors_account_name, custom_headers:nil) response = get_keys_async(resource_group_name, spatial_anchors_account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_keys(resource_group_name, spatial_anchors_account_name, custom_headers:nil) response = get_keys_async(resource_group_name, spatial_anchors_account_name, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_keys", "(", "resource_group_name", ",", "spatial_anchors_account_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_keys_async", "(", "resource_group_name", ",", "spatial_anchors_account_name", ",", "custom_headers", ":custom_headers", ")", "...
Get Both of the 2 Keys of a Spatial Anchors Account @param resource_group_name [String] Name of an Azure resource group. @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial Anchors Account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [SpatialAnchorsAccountKeys] operation results.
[ "Get", "Both", "of", "the", "2", "Keys", "of", "a", "Spatial", "Anchors", "Account" ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb#L641-L644
train
Gets the keys for the specified spatial anchors account.
[ 30522, 13366, 2131, 1035, 6309, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 13589, 1035, 24674, 1035, 4070, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 6309, 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...
samvera/hyrax
app/presenters/hyrax/fixity_status_presenter.rb
Hyrax.FixityStatusPresenter.render_failed_compact
def render_failed_compact safe_join( ["<p><strong>Failed checks:</strong></p>".html_safe] + failing_checks.collect do |log| safe_join( [ "<p>".html_safe, "ChecksumAuditLog id: #{log.id}; ", content_tag("a", "file", href: "#{Hydra::PCDM::File.translate_id_to_uri.call(log.file_id)}/fcr:metadata") + "; ", content_tag("a", "checked_uri", href: "#{log.checked_uri}/fcr:metadata") + "; ", "date: #{log.created_at}; ", "expected_result: #{log.expected_result}", "</p>".html_safe ] ) end ) end
ruby
def render_failed_compact safe_join( ["<p><strong>Failed checks:</strong></p>".html_safe] + failing_checks.collect do |log| safe_join( [ "<p>".html_safe, "ChecksumAuditLog id: #{log.id}; ", content_tag("a", "file", href: "#{Hydra::PCDM::File.translate_id_to_uri.call(log.file_id)}/fcr:metadata") + "; ", content_tag("a", "checked_uri", href: "#{log.checked_uri}/fcr:metadata") + "; ", "date: #{log.created_at}; ", "expected_result: #{log.expected_result}", "</p>".html_safe ] ) end ) end
[ "def", "render_failed_compact", "safe_join", "(", "[", "\"<p><strong>Failed checks:</strong></p>\"", ".", "html_safe", "]", "+", "failing_checks", ".", "collect", "do", "|", "log", "|", "safe_join", "(", "[", "\"<p>\"", ".", "html_safe", ",", "\"ChecksumAuditLog id: #...
A weird display, cause we need it to fit in that 180px column on FileSet show, and have no real UI to link to for files/versions :( rubocop:disable Metrics/MethodLength
[ "A", "weird", "display", "cause", "we", "need", "it", "to", "fit", "in", "that", "180px", "column", "on", "FileSet", "show", "and", "have", "no", "real", "UI", "to", "link", "to", "for", "files", "/", "versions", ":", "(", "rubocop", ":", "disable", ...
e2b4f56e829a53b1f11296324736e9d5b8c9ee5f
https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/presenters/hyrax/fixity_status_presenter.rb#L38-L55
train
Renders the failed compact audit logs
[ 30522, 13366, 17552, 1035, 3478, 1035, 9233, 3647, 1035, 3693, 1006, 1031, 1000, 1026, 1052, 1028, 1026, 2844, 1028, 3478, 14148, 1024, 1026, 1013, 2844, 1028, 1026, 1013, 1052, 1028, 1000, 1012, 16129, 1035, 3647, 1033, 1009, 7989, 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...
projectcypress/health-data-standards
lib/hqmf-parser/1.0/utilities.rb
HQMF1.Utilities.check_nil_conjunction_on_child
def check_nil_conjunction_on_child if (@preconditions.length == 1 && @preconditions.first.conjunction.nil?) bad_precondition = @preconditions.first if (bad_precondition.restrictions.empty? && bad_precondition.subset.nil? && bad_precondition.expression.nil?) @preconditions = @preconditions.first.preconditions #puts "\t FIXED PRECONDITION WITHOUT CONJUNCTION" else puts "\t PRECONDITION WITHOUT CONJUNCTION: Cannot be fixed" end end end
ruby
def check_nil_conjunction_on_child if (@preconditions.length == 1 && @preconditions.first.conjunction.nil?) bad_precondition = @preconditions.first if (bad_precondition.restrictions.empty? && bad_precondition.subset.nil? && bad_precondition.expression.nil?) @preconditions = @preconditions.first.preconditions #puts "\t FIXED PRECONDITION WITHOUT CONJUNCTION" else puts "\t PRECONDITION WITHOUT CONJUNCTION: Cannot be fixed" end end end
[ "def", "check_nil_conjunction_on_child", "if", "(", "@preconditions", ".", "length", "==", "1", "&&", "@preconditions", ".", "first", ".", "conjunction", ".", "nil?", ")", "bad_precondition", "=", "@preconditions", ".", "first", "if", "(", "bad_precondition", ".",...
Preconditions can have nil conjunctions as part of a DATEDIFF, we want to remove these and warn
[ "Preconditions", "can", "have", "nil", "conjunctions", "as", "part", "of", "a", "DATEDIFF", "we", "want", "to", "remove", "these", "and", "warn" ]
252d4f0927c513eacde6b9ea41b76faa1423c34b
https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/1.0/utilities.rb#L41-L51
train
Check that the nil conjunction on the child node is a nil conjunction.
[ 30522, 13366, 4638, 1035, 9152, 2140, 1035, 9595, 1035, 2006, 1035, 2775, 2065, 1006, 1030, 3653, 8663, 20562, 2015, 1012, 3091, 1027, 1027, 1015, 1004, 1004, 1030, 3653, 8663, 20562, 2015, 1012, 2034, 1012, 9595, 1012, 9152, 2140, 1029, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_application_type_info_list_by_name_with_http_info
def get_application_type_info_list_by_name_with_http_info(application_type_name, application_type_version:nil, exclude_application_parameters:false, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil) get_application_type_info_list_by_name_async(application_type_name, application_type_version:application_type_version, exclude_application_parameters:exclude_application_parameters, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def get_application_type_info_list_by_name_with_http_info(application_type_name, application_type_version:nil, exclude_application_parameters:false, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil) get_application_type_info_list_by_name_async(application_type_name, application_type_version:application_type_version, exclude_application_parameters:exclude_application_parameters, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "get_application_type_info_list_by_name_with_http_info", "(", "application_type_name", ",", "application_type_version", ":", "nil", ",", "exclude_application_parameters", ":", "false", ",", "continuation_token", ":", "nil", ",", "max_results", ":", "0", ",", "timeout...
Gets the list of application types in the Service Fabric cluster matching exactly the specified name. Returns the information about the application types that are provisioned or in the process of being provisioned in the Service Fabric cluster. These results are of application types whose name match exactly the one specified as the parameter, and which comply with the given query parameters. All versions of the application type matching the application type name are returned, with each version returned as one application type. The response includes the name, version, status and other details about the application type. This is a paged query, meaning that if not all of the application types fit in a page, one page of results is returned as well as a continuation token which can be used to get the next page. For example, if there are 10 application types but a page only fits the first 3 application types, or if max results is set to 3, then 3 is returned. To access the rest of the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty continuation token is returned if there are no subsequent pages. @param application_type_name [String] The name of the application type. @param application_type_version [String] The version of the application type. @param exclude_application_parameters [Boolean] The flag that specifies whether application parameters will be excluded from the result. @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", "the", "list", "of", "application", "types", "in", "the", "Service", "Fabric", "cluster", "matching", "exactly", "the", "specified", "name", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L4947-L4949
train
Gets the list of information about the specified application type.
[ 30522, 13366, 2131, 1035, 4646, 1035, 2828, 1035, 18558, 1035, 2862, 1035, 2011, 1035, 2171, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 4646, 1035, 2828, 1035, 2171, 1010, 4646, 1035, 2828, 1035, 2544, 1024, 9152, 2140, 1010, 23329, 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...
puppetlabs/bolt
acceptance/lib/acceptance/bolt_command_helper.rb
Acceptance.BoltCommandHelper.bolt_command_on
def bolt_command_on(host, command, flags = {}, opts = {}) bolt_command = command.dup flags.each { |k, v| bolt_command << " #{k} #{v}" } case host['platform'] when /windows/ execute_powershell_script_on(host, bolt_command, opts) when /osx/ # Ensure Bolt runs with UTF-8 under macOS. Otherwise we get issues with # UTF-8 content in task results. env = 'source /etc/profile ~/.bash_profile ~/.bash_login ~/.profile && env LANG=en_US.UTF-8' on(host, env + ' ' + bolt_command) else on(host, bolt_command, opts) end end
ruby
def bolt_command_on(host, command, flags = {}, opts = {}) bolt_command = command.dup flags.each { |k, v| bolt_command << " #{k} #{v}" } case host['platform'] when /windows/ execute_powershell_script_on(host, bolt_command, opts) when /osx/ # Ensure Bolt runs with UTF-8 under macOS. Otherwise we get issues with # UTF-8 content in task results. env = 'source /etc/profile ~/.bash_profile ~/.bash_login ~/.profile && env LANG=en_US.UTF-8' on(host, env + ' ' + bolt_command) else on(host, bolt_command, opts) end end
[ "def", "bolt_command_on", "(", "host", ",", "command", ",", "flags", "=", "{", "}", ",", "opts", "=", "{", "}", ")", "bolt_command", "=", "command", ".", "dup", "flags", ".", "each", "{", "|", "k", ",", "v", "|", "bolt_command", "<<", "\" #{k} #{v}\"...
A helper to build a bolt command used in acceptance testing @param [Beaker::Host] host the host to execute the command on @param [String] command the command to execute on the bolt SUT @param [Hash] flags the command flags to append to the command @option flags [String] '--nodes' the nodes to run on @option flags [String] '--user' the user to run the command as @option flags [String] '--password' the password for the user @option flags [nil] '--no-host-key-check' specify nil to use @option flags [nil] '--no-ssl' specify nil to use @param [Hash] opts the options hash for this method
[ "A", "helper", "to", "build", "a", "bolt", "command", "used", "in", "acceptance", "testing" ]
50689a33699939d262ea7c822a4b24fd8c4f8d8a
https://github.com/puppetlabs/bolt/blob/50689a33699939d262ea7c822a4b24fd8c4f8d8a/acceptance/lib/acceptance/bolt_command_helper.rb#L15-L30
train
Execute a bolt command on the given host.
[ 30522, 13366, 10053, 1035, 3094, 1035, 2006, 1006, 3677, 1010, 3094, 1010, 9245, 1027, 1063, 1065, 1010, 23569, 2015, 1027, 1063, 1065, 1007, 10053, 1035, 3094, 1027, 3094, 1012, 4241, 2361, 9245, 1012, 2169, 1063, 1064, 1047, 1010, 1058, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb
Azure::CognitiveServices::LuisAuthoring::V2_0.Features.delete_phrase_list
def delete_phrase_list(app_id, version_id, phraselist_id, custom_headers:nil) response = delete_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def delete_phrase_list(app_id, version_id, phraselist_id, custom_headers:nil) response = delete_phrase_list_async(app_id, version_id, phraselist_id, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "delete_phrase_list", "(", "app_id", ",", "version_id", ",", "phraselist_id", ",", "custom_headers", ":", "nil", ")", "response", "=", "delete_phrase_list_async", "(", "app_id", ",", "version_id", ",", "phraselist_id", ",", "custom_headers", ":custom_headers", ...
Deletes a phraselist feature from a version of the application. @param app_id The application ID. @param version_id [String] The version ID. @param phraselist_id [Integer] The ID of the feature to be deleted. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [OperationStatus] operation results.
[ "Deletes", "a", "phraselist", "feature", "from", "a", "version", "of", "the", "application", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb#L712-L715
train
Deletes the phrase list of a version of the application.
[ 30522, 13366, 3972, 12870, 1035, 7655, 1035, 2862, 1006, 10439, 1035, 8909, 1010, 2544, 1035, 8909, 1010, 7655, 9863, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 3972, 12870, 1035, 7655, 1035, 2862, 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_logic/lib/2016-06-01/generated/azure_mgmt_logic/schemas.rb
Azure::Logic::Mgmt::V2016_06_01.Schemas.create_or_update_with_http_info
def create_or_update_with_http_info(resource_group_name, integration_account_name, schema_name, schema, custom_headers:nil) create_or_update_async(resource_group_name, integration_account_name, schema_name, schema, custom_headers:custom_headers).value! end
ruby
def create_or_update_with_http_info(resource_group_name, integration_account_name, schema_name, schema, custom_headers:nil) create_or_update_async(resource_group_name, integration_account_name, schema_name, schema, custom_headers:custom_headers).value! end
[ "def", "create_or_update_with_http_info", "(", "resource_group_name", ",", "integration_account_name", ",", "schema_name", ",", "schema", ",", "custom_headers", ":", "nil", ")", "create_or_update_async", "(", "resource_group_name", ",", "integration_account_name", ",", "sch...
Creates or updates an integration account schema. @param resource_group_name [String] The resource group name. @param integration_account_name [String] The integration account name. @param schema_name [String] The integration account schema name. @param schema [IntegrationAccountSchema] The integration account schema. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Creates", "or", "updates", "an", "integration", "account", "schema", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/schemas.rb#L250-L252
train
Creates or updates an integration account schema.
[ 30522, 13366, 3443, 1035, 2030, 1035, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 8346, 1035, 4070, 1035, 2171, 1010, 8040, 28433, 1035, 2171, 1010, 8040, 28433, 1010, 7661, 1035, 20346, 2015, 1024,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb
Azure::SQL::Mgmt::V2014_04_01.Databases.list_metrics_with_http_info
def list_metrics_with_http_info(resource_group_name, server_name, database_name, filter, custom_headers:nil) list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers:custom_headers).value! end
ruby
def list_metrics_with_http_info(resource_group_name, server_name, database_name, filter, custom_headers:nil) list_metrics_async(resource_group_name, server_name, database_name, filter, custom_headers:custom_headers).value! end
[ "def", "list_metrics_with_http_info", "(", "resource_group_name", ",", "server_name", ",", "database_name", ",", "filter", ",", "custom_headers", ":", "nil", ")", "list_metrics_async", "(", "resource_group_name", ",", "server_name", ",", "database_name", ",", "filter", ...
Returns database metrics. @param resource_group_name [String] The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param server_name [String] The name of the server. @param database_name [String] The name of the database. @param filter [String] An OData filter expression that describes a subset of metrics to return. @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", "database", "metrics", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb#L1154-L1156
train
Gets metrics for the specified database.
[ 30522, 13366, 2862, 1035, 12046, 2015, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 8241, 1035, 2171, 1010, 7809, 1035, 2171, 1010, 11307, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2862, 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_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/cloud_appliances.rb
Azure::StorSimple8000Series::Mgmt::V2017_06_01.CloudAppliances.begin_provision
def begin_provision(parameters, resource_group_name, manager_name, custom_headers:nil) response = begin_provision_async(parameters, resource_group_name, manager_name, custom_headers:custom_headers).value! nil end
ruby
def begin_provision(parameters, resource_group_name, manager_name, custom_headers:nil) response = begin_provision_async(parameters, resource_group_name, manager_name, custom_headers:custom_headers).value! nil end
[ "def", "begin_provision", "(", "parameters", ",", "resource_group_name", ",", "manager_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_provision_async", "(", "parameters", ",", "resource_group_name", ",", "manager_name", ",", "custom_headers", "...
Provisions cloud appliance. @param parameters [CloudAppliance] The cloud appliance @param resource_group_name [String] The resource group name @param manager_name [String] The manager name @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Provisions", "cloud", "appliance", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/cloud_appliances.rb#L168-L171
train
Creates a new cluster provisioning service.
[ 30522, 13366, 4088, 1035, 9347, 1006, 11709, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 3208, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 9347, 1035, 2004, 6038, 2278, 1006, 11709, 1010, 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...
stripe/stripe-ruby
lib/stripe/list_object.rb
Stripe.ListObject.next_page
def next_page(params = {}, opts = {}) return self.class.empty_list(opts) unless has_more last_id = data.last.id params = filters.merge(starting_after: last_id).merge(params) list(params, opts) end
ruby
def next_page(params = {}, opts = {}) return self.class.empty_list(opts) unless has_more last_id = data.last.id params = filters.merge(starting_after: last_id).merge(params) list(params, opts) end
[ "def", "next_page", "(", "params", "=", "{", "}", ",", "opts", "=", "{", "}", ")", "return", "self", ".", "class", ".", "empty_list", "(", "opts", ")", "unless", "has_more", "last_id", "=", "data", ".", "last", ".", "id", "params", "=", "filters", ...
Fetches the next page in the resource list (if there is one). This method will try to respect the limit of the current page. If none was given, the default limit will be fetched again.
[ "Fetches", "the", "next", "page", "in", "the", "resource", "list", "(", "if", "there", "is", "one", ")", "." ]
322a8c60be8a9b9ac8aad8857864680a32176935
https://github.com/stripe/stripe-ruby/blob/322a8c60be8a9b9ac8aad8857864680a32176935/lib/stripe/list_object.rb#L79-L86
train
Returns the next page of results
[ 30522, 13366, 2279, 1035, 3931, 1006, 11498, 5244, 1027, 1063, 1065, 1010, 23569, 2015, 1027, 1063, 1065, 1007, 2709, 2969, 1012, 2465, 1012, 4064, 1035, 2862, 1006, 23569, 2015, 1007, 4983, 2038, 1035, 2062, 2197, 1035, 8909, 1027, 2951, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/person_group_operations.rb
Azure::CognitiveServices::Face::V1_0.PersonGroupOperations.update_with_http_info
def update_with_http_info(person_group_id, name:nil, user_data:nil, custom_headers:nil) update_async(person_group_id, name:name, user_data:user_data, custom_headers:custom_headers).value! end
ruby
def update_with_http_info(person_group_id, name:nil, user_data:nil, custom_headers:nil) update_async(person_group_id, name:name, user_data:user_data, custom_headers:custom_headers).value! end
[ "def", "update_with_http_info", "(", "person_group_id", ",", "name", ":", "nil", ",", "user_data", ":", "nil", ",", "custom_headers", ":", "nil", ")", "update_async", "(", "person_group_id", ",", "name", ":", "name", ",", "user_data", ":user_data", ",", "custo...
Update an existing person group's display name and userData. The properties which does not appear in request body will not be updated. @param person_group_id [String] Id referencing a particular person group. @param name [String] User defined name, maximum length is 128. @param user_data [String] User specified data. Length should not exceed 16KB. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Update", "an", "existing", "person", "group", "s", "display", "name", "and", "userData", ".", "The", "properties", "which", "does", "not", "appear", "in", "request", "body", "will", "not", "be", "updated", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/person_group_operations.rb#L433-L435
train
Updates a person group s coverages.
[ 30522, 13366, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 2711, 1035, 2177, 1035, 8909, 1010, 2171, 1024, 9152, 2140, 1010, 5310, 1035, 2951, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 10651, 1035, 2004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
fastlane/fastlane
spaceship/lib/spaceship/tunes/tunes_client.rb
Spaceship.TunesClient.create_application!
def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil, platform: nil, itunes_connect_users: nil) puts("The `version` parameter is deprecated. Use `Spaceship::Tunes::Application.ensure_version!` method instead") if version # First, we need to fetch the data from Apple, which we then modify with the user's values primary_language ||= "English" platform ||= "ios" r = request(:get, "ra/apps/create/v2/?platformString=#{platform}") data = parse_response(r, 'data') # Now fill in the values we have # some values are nil, that's why there is a hash data['name'] = { value: name } data['bundleId'] = { value: bundle_id } data['primaryLanguage'] = { value: primary_language } data['primaryLocaleCode'] = { value: primary_language.to_itc_locale } data['vendorId'] = { value: sku } data['bundleIdSuffix'] = { value: bundle_id_suffix } data['companyName'] = { value: company_name } if company_name data['enabledPlatformsForCreation'] = { value: [platform] } data['initialPlatform'] = platform data['enabledPlatformsForCreation'] = { value: [platform] } unless itunes_connect_users.nil? data['iTunesConnectUsers']['grantedAllUsers'] = false data['iTunesConnectUsers']['grantedUsers'] = data['iTunesConnectUsers']['availableUsers'].select { |user| itunes_connect_users.include?(user['username']) } end # Now send back the modified hash r = request(:post) do |req| req.url('ra/apps/create/v2') req.body = data.to_json req.headers['Content-Type'] = 'application/json' end data = parse_response(r, 'data') handle_itc_response(data) end
ruby
def create_application!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil, platform: nil, itunes_connect_users: nil) puts("The `version` parameter is deprecated. Use `Spaceship::Tunes::Application.ensure_version!` method instead") if version # First, we need to fetch the data from Apple, which we then modify with the user's values primary_language ||= "English" platform ||= "ios" r = request(:get, "ra/apps/create/v2/?platformString=#{platform}") data = parse_response(r, 'data') # Now fill in the values we have # some values are nil, that's why there is a hash data['name'] = { value: name } data['bundleId'] = { value: bundle_id } data['primaryLanguage'] = { value: primary_language } data['primaryLocaleCode'] = { value: primary_language.to_itc_locale } data['vendorId'] = { value: sku } data['bundleIdSuffix'] = { value: bundle_id_suffix } data['companyName'] = { value: company_name } if company_name data['enabledPlatformsForCreation'] = { value: [platform] } data['initialPlatform'] = platform data['enabledPlatformsForCreation'] = { value: [platform] } unless itunes_connect_users.nil? data['iTunesConnectUsers']['grantedAllUsers'] = false data['iTunesConnectUsers']['grantedUsers'] = data['iTunesConnectUsers']['availableUsers'].select { |user| itunes_connect_users.include?(user['username']) } end # Now send back the modified hash r = request(:post) do |req| req.url('ra/apps/create/v2') req.body = data.to_json req.headers['Content-Type'] = 'application/json' end data = parse_response(r, 'data') handle_itc_response(data) end
[ "def", "create_application!", "(", "name", ":", "nil", ",", "primary_language", ":", "nil", ",", "version", ":", "nil", ",", "sku", ":", "nil", ",", "bundle_id", ":", "nil", ",", "bundle_id_suffix", ":", "nil", ",", "company_name", ":", "nil", ",", "plat...
Creates a new application on App Store Connect @param name (String): The name of your app as it will appear on the App Store. This can't be longer than 255 characters. @param primary_language (String): If localized app information isn't available in an App Store territory, the information from your primary language will be used instead. @param version *DEPRECATED: Use `Spaceship::Tunes::Application.ensure_version!` method instead* (String): The version number is shown on the App Store and should match the one you used in Xcode. @param sku (String): A unique ID for your app that is not visible on the App Store. @param bundle_id (String): The bundle ID must match the one you used in Xcode. It can't be changed after you submit your first build.
[ "Creates", "a", "new", "application", "on", "App", "Store", "Connect" ]
457c5d647c77f0e078dafa5129da616914e002c5
https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/tunes/tunes_client.rb#L289-L326
train
Create an application
[ 30522, 13366, 3443, 1035, 4646, 999, 1006, 2171, 1024, 9152, 2140, 1010, 3078, 1035, 2653, 1024, 9152, 2140, 1010, 2544, 1024, 9152, 2140, 1010, 15315, 2226, 1024, 9152, 2140, 1010, 14012, 1035, 8909, 1024, 9152, 2140, 1010, 14012, 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...
hashicorp/vault-ruby
lib/vault/api/sys/mount.rb
Vault.Sys.mounts
def mounts json = client.get("/v1/sys/mounts") json = json[:data] if json[:data] return Hash[*json.map do |k,v| [k.to_s.chomp("/").to_sym, Mount.decode(v)] end.flatten] end
ruby
def mounts json = client.get("/v1/sys/mounts") json = json[:data] if json[:data] return Hash[*json.map do |k,v| [k.to_s.chomp("/").to_sym, Mount.decode(v)] end.flatten] end
[ "def", "mounts", "json", "=", "client", ".", "get", "(", "\"/v1/sys/mounts\"", ")", "json", "=", "json", "[", ":data", "]", "if", "json", "[", ":data", "]", "return", "Hash", "[", "json", ".", "map", "do", "|", "k", ",", "v", "|", "[", "k", ".", ...
List all mounts in the vault. @example Vault.sys.mounts #=> { :secret => #<struct Vault::Mount type="generic", description="generic secret storage"> } @return [Hash<Symbol, Mount>]
[ "List", "all", "mounts", "in", "the", "vault", "." ]
02f0532a802ba1a2a0d8703a4585dab76eb9d864
https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/sys/mount.rb#L28-L34
train
Returns a hash of all the mounts that are available for this system.
[ 30522, 13366, 19363, 1046, 3385, 1027, 7396, 1012, 2131, 1006, 1000, 1013, 1058, 2487, 1013, 25353, 2015, 1013, 19363, 1000, 1007, 1046, 3385, 1027, 1046, 3385, 1031, 1024, 2951, 1033, 2065, 1046, 3385, 1031, 1024, 2951, 1033, 2709, 23325, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sds/overcommit
lib/overcommit/configuration.rb
Overcommit.Configuration.apply_environment!
def apply_environment!(hook_context, env) skipped_hooks = "#{env['SKIP']} #{env['SKIP_CHECKS']} #{env['SKIP_HOOKS']}".split(/[:, ]/) only_hooks = env.fetch('ONLY') { '' }.split(/[:, ]/) hook_type = hook_context.hook_class_name if only_hooks.any? || skipped_hooks.include?('all') || skipped_hooks.include?('ALL') @hash[hook_type]['ALL']['skip'] = true end only_hooks.select { |hook_name| hook_exists?(hook_context, hook_name) }. map { |hook_name| Overcommit::Utils.camel_case(hook_name) }. each do |hook_name| @hash[hook_type][hook_name] ||= {} @hash[hook_type][hook_name]['skip'] = false end skipped_hooks.select { |hook_name| hook_exists?(hook_context, hook_name) }. map { |hook_name| Overcommit::Utils.camel_case(hook_name) }. each do |hook_name| @hash[hook_type][hook_name] ||= {} @hash[hook_type][hook_name]['skip'] = true end end
ruby
def apply_environment!(hook_context, env) skipped_hooks = "#{env['SKIP']} #{env['SKIP_CHECKS']} #{env['SKIP_HOOKS']}".split(/[:, ]/) only_hooks = env.fetch('ONLY') { '' }.split(/[:, ]/) hook_type = hook_context.hook_class_name if only_hooks.any? || skipped_hooks.include?('all') || skipped_hooks.include?('ALL') @hash[hook_type]['ALL']['skip'] = true end only_hooks.select { |hook_name| hook_exists?(hook_context, hook_name) }. map { |hook_name| Overcommit::Utils.camel_case(hook_name) }. each do |hook_name| @hash[hook_type][hook_name] ||= {} @hash[hook_type][hook_name]['skip'] = false end skipped_hooks.select { |hook_name| hook_exists?(hook_context, hook_name) }. map { |hook_name| Overcommit::Utils.camel_case(hook_name) }. each do |hook_name| @hash[hook_type][hook_name] ||= {} @hash[hook_type][hook_name]['skip'] = true end end
[ "def", "apply_environment!", "(", "hook_context", ",", "env", ")", "skipped_hooks", "=", "\"#{env['SKIP']} #{env['SKIP_CHECKS']} #{env['SKIP_HOOKS']}\"", ".", "split", "(", "/", "/", ")", "only_hooks", "=", "env", ".", "fetch", "(", "'ONLY'", ")", "{", "''", "}", ...
Applies additional configuration settings based on the provided environment variables.
[ "Applies", "additional", "configuration", "settings", "based", "on", "the", "provided", "environment", "variables", "." ]
35d60adb41da942178b789560968e3ad030b0ac7
https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/configuration.rb#L157-L179
train
Apply the environment to the current object.
[ 30522, 13366, 6611, 1035, 4044, 999, 1006, 8103, 1035, 6123, 1010, 4372, 2615, 1007, 16791, 1035, 18008, 1027, 1000, 1001, 1063, 4372, 2615, 1031, 1005, 13558, 1005, 1033, 1065, 1001, 1063, 4372, 2615, 1031, 1005, 13558, 1035, 14148, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb
Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.begin_get_network_configuration_diagnostic_with_http_info
def begin_get_network_configuration_diagnostic_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_get_network_configuration_diagnostic_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
ruby
def begin_get_network_configuration_diagnostic_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_get_network_configuration_diagnostic_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
[ "def", "begin_get_network_configuration_diagnostic_with_http_info", "(", "resource_group_name", ",", "network_watcher_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "begin_get_network_configuration_diagnostic_async", "(", "resource_group_name", ",", "network_watc...
Get network configuration diagnostic. @param resource_group_name [String] The name of the resource group. @param network_watcher_name [String] The name of the network watcher. @param parameters [NetworkConfigurationDiagnosticParameters] Parameters to get network configuration diagnostic. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Get", "network", "configuration", "diagnostic", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L2514-L2516
train
Gets the network configuration diagnostic.
[ 30522, 13366, 4088, 1035, 2131, 1035, 2897, 1035, 9563, 1035, 16474, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2897, 1035, 3422, 2121, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
piotrmurach/github
lib/github_api/api.rb
Github.API.execute
def execute(action, *args, &block) action_name = action.to_s.gsub(/_with(out)?_callback_.*$/, '') result = nil run_callbacks(action_name) do result = send(action, *args, &block) end result end
ruby
def execute(action, *args, &block) action_name = action.to_s.gsub(/_with(out)?_callback_.*$/, '') result = nil run_callbacks(action_name) do result = send(action, *args, &block) end result end
[ "def", "execute", "(", "action", ",", "*", "args", ",", "&", "block", ")", "action_name", "=", "action", ".", "to_s", ".", "gsub", "(", "/", "/", ",", "''", ")", "result", "=", "nil", "run_callbacks", "(", "action_name", ")", "do", "result", "=", "...
Execute action @param [Symbol] action @api private
[ "Execute", "action" ]
8702452c66bea33c9388550aed9e9974f76aaef1
https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/api.rb#L246-L253
train
Execute an action on the current thread.
[ 30522, 13366, 15389, 1006, 2895, 1010, 1008, 12098, 5620, 1010, 1004, 3796, 1007, 2895, 1035, 2171, 1027, 2895, 1012, 2000, 1035, 1055, 1012, 28177, 12083, 1006, 1013, 30524, 2765, 1027, 4604, 1006, 2895, 1010, 1008, 12098, 5620, 1010, 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...
aws/aws-sdk-ruby
gems/aws-sdk-s3/lib/aws-sdk-s3/client.rb
Aws::S3.Client.get_object_torrent
def get_object_torrent(params = {}, options = {}, &block) req = build_request(:get_object_torrent, params) req.send_request(options, &block) end
ruby
def get_object_torrent(params = {}, options = {}, &block) req = build_request(:get_object_torrent, params) req.send_request(options, &block) end
[ "def", "get_object_torrent", "(", "params", "=", "{", "}", ",", "options", "=", "{", "}", ",", "&", "block", ")", "req", "=", "build_request", "(", ":get_object_torrent", ",", "params", ")", "req", ".", "send_request", "(", "options", ",", "block", ")", ...
Return torrent files from a bucket. @option params [String, IO] :response_target Where to write response data, file path, or IO object. @option params [required, String] :bucket @option params [required, String] :key @option params [String] :request_payer Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html @return [Types::GetObjectTorrentOutput] Returns a {Seahorse::Client::Response response} object which responds to the following methods: * {Types::GetObjectTorrentOutput#body #body} => IO * {Types::GetObjectTorrentOutput#request_charged #request_charged} => String @example Example: To retrieve torrent files for an object # The following example retrieves torrent files of an object. resp = client.get_object_torrent({ bucket: "examplebucket", key: "HappyFace.jpg", }) resp.to_h outputs the following: { } @example Request syntax with placeholder values resp = client.get_object_torrent({ bucket: "BucketName", # required key: "ObjectKey", # required request_payer: "requester", # accepts requester }) @example Response structure resp.body #=> IO resp.request_charged #=> String, one of "requester" @see http://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent AWS API Documentation @overload get_object_torrent(params = {}) @param [Hash] params ({})
[ "Return", "torrent", "files", "from", "a", "bucket", "." ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-s3/lib/aws-sdk-s3/client.rb#L3273-L3276
train
Get object torrent
[ 30522, 13366, 2131, 1035, 4874, 1035, 22047, 3372, 1006, 11498, 5244, 1027, 1063, 1065, 1010, 7047, 1027, 1063, 1065, 1010, 1004, 3796, 1007, 2128, 4160, 1027, 3857, 1035, 5227, 1006, 1024, 2131, 1035, 4874, 1035, 22047, 3372, 1010, 11498, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_node_info
def get_node_info(node_name, timeout:60, custom_headers:nil) response = get_node_info_async(node_name, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_node_info(node_name, timeout:60, custom_headers:nil) response = get_node_info_async(node_name, timeout:timeout, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_node_info", "(", "node_name", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_node_info_async", "(", "node_name", ",", "timeout", ":", "timeout", ",", "custom_headers", ":custom_headers", ")", ".", "value!", ...
Gets the information about a specific node in the Service Fabric cluster. Gets the information about a specific node in the Service Fabric Cluster. The response includes the name, status, id, health, uptime, and other details about the node. @param node_name [String] The name of the node. @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 [NodeInfo] operation results.
[ "Gets", "the", "information", "about", "a", "specific", "node", "in", "the", "Service", "Fabric", "cluster", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L3363-L3366
train
Gets information about the node.
[ 30522, 13366, 2131, 1035, 13045, 1035, 18558, 1006, 13045, 1035, 2171, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 13045, 1035, 18558, 1035, 2004, 6038, 2278, 1006, 13045, 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...
aws/aws-sdk-ruby
gems/aws-sdk-ec2/lib/aws-sdk-ec2/instance.rb
Aws::EC2.Instance.terminate
def terminate(options = {}) options = Aws::Util.deep_merge(options, instance_ids: [@id]) resp = @client.terminate_instances(options) resp.data end
ruby
def terminate(options = {}) options = Aws::Util.deep_merge(options, instance_ids: [@id]) resp = @client.terminate_instances(options) resp.data end
[ "def", "terminate", "(", "options", "=", "{", "}", ")", "options", "=", "Aws", "::", "Util", ".", "deep_merge", "(", "options", ",", "instance_ids", ":", "[", "@id", "]", ")", "resp", "=", "@client", ".", "terminate_instances", "(", "options", ")", "re...
@example Request syntax with placeholder values instance.terminate({ dry_run: false, }) @param [Hash] options ({}) @option options [Boolean] :dry_run Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`. @return [Types::TerminateInstancesResult]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/instance.rb#L1196-L1200
train
Terminate the instance
[ 30522, 13366, 20320, 1006, 7047, 1027, 1063, 1065, 1007, 7047, 1027, 22091, 2015, 1024, 1024, 21183, 4014, 1012, 2784, 1035, 13590, 1006, 7047, 1010, 6013, 1035, 8909, 2015, 1024, 1031, 1030, 8909, 1033, 1007, 24501, 2361, 1027, 1030, 7396,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
httprb/http
lib/http/chainable.rb
HTTP.Chainable.persistent
def persistent(host, timeout: 5) options = {:keep_alive_timeout => timeout} p_client = branch default_options.merge(options).with_persistent host return p_client unless block_given? yield p_client ensure p_client.close if p_client end
ruby
def persistent(host, timeout: 5) options = {:keep_alive_timeout => timeout} p_client = branch default_options.merge(options).with_persistent host return p_client unless block_given? yield p_client ensure p_client.close if p_client end
[ "def", "persistent", "(", "host", ",", "timeout", ":", "5", ")", "options", "=", "{", ":keep_alive_timeout", "=>", "timeout", "}", "p_client", "=", "branch", "default_options", ".", "merge", "(", "options", ")", ".", "with_persistent", "host", "return", "p_c...
@overload persistent(host, timeout: 5) Flags as persistent @param [String] host @option [Integer] timeout Keep alive timeout @raise [Request::Error] if Host is invalid @return [HTTP::Client] Persistent client @overload persistent(host, timeout: 5, &block) Executes given block with persistent client and automatically closes connection at the end of execution. @example def keys(users) HTTP.persistent("https://github.com") do |http| users.map { |u| http.get("/#{u}.keys").to_s } end end # same as def keys(users) http = HTTP.persistent "https://github.com" users.map { |u| http.get("/#{u}.keys").to_s } ensure http.close if http end @yieldparam [HTTP::Client] client Persistent client @return [Object] result of last expression in the block
[ "@overload", "persistent", "(", "host", "timeout", ":", "5", ")", "Flags", "as", "persistent", "@param", "[", "String", "]", "host", "@option", "[", "Integer", "]", "timeout", "Keep", "alive", "timeout", "@raise", "[", "Request", "::", "Error", "]", "if", ...
f37a10ea4fab3ee411907ea2e4251ddf0ca33a93
https://github.com/httprb/http/blob/f37a10ea4fab3ee411907ea2e4251ddf0ca33a93/lib/http/chainable.rb#L143-L150
train
Create a persistent client
[ 30522, 13366, 14516, 1006, 3677, 1010, 2051, 5833, 1024, 1019, 1007, 7047, 1027, 1063, 1024, 2562, 1035, 4142, 1035, 2051, 5833, 1027, 1028, 2051, 5833, 1065, 1052, 1035, 7396, 1027, 3589, 12398, 1035, 7047, 1012, 13590, 1006, 7047, 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...