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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RailsEventStore/rails_event_store | ruby_event_store/lib/ruby_event_store/client.rb | RubyEventStore.Client.subscribe_to_all_events | def subscribe_to_all_events(subscriber = nil, &proc)
raise ArgumentError, "subscriber must be first argument or block, cannot be both" if subscriber && proc
broker.add_global_subscription(subscriber || proc)
end | ruby | def subscribe_to_all_events(subscriber = nil, &proc)
raise ArgumentError, "subscriber must be first argument or block, cannot be both" if subscriber && proc
broker.add_global_subscription(subscriber || proc)
end | [
"def",
"subscribe_to_all_events",
"(",
"subscriber",
"=",
"nil",
",",
"&",
"proc",
")",
"raise",
"ArgumentError",
",",
"\"subscriber must be first argument or block, cannot be both\"",
"if",
"subscriber",
"&&",
"proc",
"broker",
".",
"add_global_subscription",
"(",
"subsc... | Subscribes a handler (subscriber) that will be invoked for all published events
@overload subscribe_to_all_events(subscriber)
@param subscriber [Object, Class] handler
@return [Proc] - unsubscribe proc. Call to unsubscribe.
@raise [ArgumentError, SubscriberNotExist]
@overload subscribe_to_all_events(&subscriber)
@param subscriber [Proc] handler
@return [Proc] - unsubscribe proc. Call to unsubscribe.
@raise [ArgumentError, SubscriberNotExist] | [
"Subscribes",
"a",
"handler",
"(",
"subscriber",
")",
"that",
"will",
"be",
"invoked",
"for",
"all",
"published",
"events"
] | 3ee4f3148499794154ee6fec74ccf6d4670d85ac | https://github.com/RailsEventStore/rails_event_store/blob/3ee4f3148499794154ee6fec74ccf6d4670d85ac/ruby_event_store/lib/ruby_event_store/client.rb#L116-L119 | train | Subscribe to all events | [
30522,
13366,
4942,
29234,
1035,
2000,
1035,
2035,
1035,
2824,
1006,
4942,
29234,
2099,
1027,
9152,
2140,
1010,
1004,
4013,
2278,
1007,
5333,
6685,
2121,
29165,
1010,
1000,
4942,
29234,
2099,
2442,
2022,
2034,
6685,
2030,
3796,
1010,
3685,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_reservations/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb | Azure::Reservations::Mgmt::V2017_11_01.Reservation.update | def update(reservation_order_id, reservation_id, parameters, custom_headers:nil)
response = update_async(reservation_order_id, reservation_id, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update(reservation_order_id, reservation_id, parameters, custom_headers:nil)
response = update_async(reservation_order_id, reservation_id, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update",
"(",
"reservation_order_id",
",",
"reservation_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"reservation_order_id",
",",
"reservation_id",
",",
"parameters",
",",
"custom_headers",
":custom_head... | Updates a `Reservation`.
Updates the applied scopes of the `Reservation`.
@param reservation_order_id [String] Order Id of the reservation
@param reservation_id [String] Id of the Reservation Item
@param parameters [Patch] Information needed to patch a reservation item
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ReservationResponse] operation results. | [
"Updates",
"a",
"Reservation",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_reservations/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb#L363-L366 | train | Updates a reservation s segmentation group. | [
30522,
13366,
10651,
1006,
11079,
1035,
2344,
1035,
8909,
1010,
11079,
1035,
8909,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
2004,
6038,
2278,
1006,
11079,
1035,
2344,
1035,
8909,
1010,
110... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2017-12-01/generated/azure_mgmt_compute/virtual_machines.rb | Azure::Compute::Mgmt::V2017_12_01.VirtualMachines.begin_perform_maintenance | def begin_perform_maintenance(resource_group_name, vm_name, custom_headers:nil)
response = begin_perform_maintenance_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_perform_maintenance(resource_group_name, vm_name, custom_headers:nil)
response = begin_perform_maintenance_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_perform_maintenance",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_perform_maintenance_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"v... | The operation to perform maintenance on a virtual machine.
@param resource_group_name [String] The name of the resource group.
@param vm_name [String] The name of the virtual machine.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusResponse] operation results. | [
"The",
"operation",
"to",
"perform",
"maintenance",
"on",
"a",
"virtual",
"machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machines.rb#L2307-L2310 | train | Perform maintenance of a virtual machine. | [
30522,
13366,
4088,
1035,
4685,
1035,
6032,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
4685,
1035,
6032,
1035,
2004,
6038,
2278,
1006,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb | Azure::Web::Mgmt::V2016_03_01.WebSiteManagementClient.list_geo_regions_as_lazy | def list_geo_regions_as_lazy(sku:nil, linux_workers_enabled:nil, custom_headers:nil)
first_page = list_geo_regions_as_lazy_as_lazy(sku:sku, linux_workers_enabled:linux_workers_enabled, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_geo_regions_as_lazy(sku:nil, linux_workers_enabled:nil, custom_headers:nil)
first_page = list_geo_regions_as_lazy_as_lazy(sku:sku, linux_workers_enabled:linux_workers_enabled, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_geo_regions_as_lazy",
"(",
"sku",
":",
"nil",
",",
"linux_workers_enabled",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_geo_regions_as_lazy_as_lazy",
"(",
"sku",
":",
"sku",
",",
"linux_workers_enabled",
":linux_workers_en... | Get a list of available geographical regions.
Get a list of available geographical regions.
@param sku [SkuName] Name of SKU used to filter the regions. Possible values
include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', 'PremiumV2',
'Dynamic', 'Isolated'
@param linux_workers_enabled [Boolean] Specify <code>true</code> if you want
to filter to only regions that support Linux workers.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [GeoRegionCollection] operation results. | [
"Get",
"a",
"list",
"of",
"available",
"geographical",
"regions",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb#L2117-L2120 | train | Gets all the geo regions in a subscription. | [
30522,
13366,
2862,
1035,
20248,
1035,
4655,
1035,
2004,
1035,
13971,
1006,
15315,
2226,
1024,
9152,
2140,
1010,
11603,
1035,
3667,
1035,
9124,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activestorage/lib/active_storage/service/mirror_service.rb | ActiveStorage.Service::MirrorService.upload | def upload(key, io, checksum: nil, **options)
each_service.collect do |service|
service.upload key, io.tap(&:rewind), checksum: checksum, **options
end
end | ruby | def upload(key, io, checksum: nil, **options)
each_service.collect do |service|
service.upload key, io.tap(&:rewind), checksum: checksum, **options
end
end | [
"def",
"upload",
"(",
"key",
",",
"io",
",",
"checksum",
":",
"nil",
",",
"**",
"options",
")",
"each_service",
".",
"collect",
"do",
"|",
"service",
"|",
"service",
".",
"upload",
"key",
",",
"io",
".",
"tap",
"(",
":rewind",
")",
",",
"checksum",
... | Upload the +io+ to the +key+ specified to all services. If a +checksum+ is provided, all services will
ensure a match when the upload has completed or raise an ActiveStorage::IntegrityError. | [
"Upload",
"the",
"+",
"io",
"+",
"to",
"the",
"+",
"key",
"+",
"specified",
"to",
"all",
"services",
".",
"If",
"a",
"+",
"checksum",
"+",
"is",
"provided",
"all",
"services",
"will",
"ensure",
"a",
"match",
"when",
"the",
"upload",
"has",
"completed",... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activestorage/lib/active_storage/service/mirror_service.rb#L27-L31 | train | Upload an IO to the server | [
30522,
13366,
2039,
11066,
1006,
3145,
1010,
22834,
1010,
14148,
2819,
1024,
9152,
2140,
1010,
1008,
1008,
7047,
1007,
2169,
1035,
2326,
1012,
8145,
2079,
1064,
2326,
1064,
2326,
1012,
2039,
11066,
3145,
1010,
22834,
1012,
11112,
1006,
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... |
rails/sprockets | lib/sprockets/source_map_utils.rb | Sprockets.SourceMapUtils.bsearch_mappings | def bsearch_mappings(mappings, offset, from = 0, to = mappings.size - 1)
mid = (from + to) / 2
if from > to
return from < 1 ? nil : mappings[from-1]
end
case compare_source_offsets(offset, mappings[mid][:generated])
when 0
mappings[mid]
when -1
bsearch_mappings(mappings, offset, from, mid - 1)
when 1
bsearch_mappings(mappings, offset, mid + 1, to)
end
end | ruby | def bsearch_mappings(mappings, offset, from = 0, to = mappings.size - 1)
mid = (from + to) / 2
if from > to
return from < 1 ? nil : mappings[from-1]
end
case compare_source_offsets(offset, mappings[mid][:generated])
when 0
mappings[mid]
when -1
bsearch_mappings(mappings, offset, from, mid - 1)
when 1
bsearch_mappings(mappings, offset, mid + 1, to)
end
end | [
"def",
"bsearch_mappings",
"(",
"mappings",
",",
"offset",
",",
"from",
"=",
"0",
",",
"to",
"=",
"mappings",
".",
"size",
"-",
"1",
")",
"mid",
"=",
"(",
"from",
"+",
"to",
")",
"/",
"2",
"if",
"from",
">",
"to",
"return",
"from",
"<",
"1",
"?... | Public: Search Array of mappings for closest offset.
mappings - Array of mapping Hash objects
offset - Array [line, column]
Returns mapping Hash object. | [
"Public",
":",
"Search",
"Array",
"of",
"mappings",
"for",
"closest",
"offset",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/source_map_utils.rb#L273-L288 | train | Finds the first mapping that matches the given offset. | [
30522,
13366,
18667,
14644,
2818,
1035,
12375,
2015,
1006,
12375,
2015,
1010,
16396,
1010,
2013,
1027,
1014,
1010,
2000,
1027,
12375,
2015,
1012,
2946,
1011,
1015,
1007,
3054,
1027,
1006,
2013,
1009,
2000,
1007,
1013,
1016,
2065,
2013,
1028... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/package.rb | Axlsx.Package.base_content_types | def base_content_types
c_types = ContentType.new()
c_types << Default.new(:ContentType => RELS_CT, :Extension => RELS_EX)
c_types << Default.new(:Extension => XML_EX, :ContentType => XML_CT)
c_types << Override.new(:PartName => "/#{APP_PN}", :ContentType => APP_CT)
c_types << Override.new(:PartName => "/#{CORE_PN}", :ContentType => CORE_CT)
c_types << Override.new(:PartName => "/xl/#{STYLES_PN}", :ContentType => STYLES_CT)
c_types << Axlsx::Override.new(:PartName => "/#{WORKBOOK_PN}", :ContentType => WORKBOOK_CT)
c_types.lock
c_types
end | ruby | def base_content_types
c_types = ContentType.new()
c_types << Default.new(:ContentType => RELS_CT, :Extension => RELS_EX)
c_types << Default.new(:Extension => XML_EX, :ContentType => XML_CT)
c_types << Override.new(:PartName => "/#{APP_PN}", :ContentType => APP_CT)
c_types << Override.new(:PartName => "/#{CORE_PN}", :ContentType => CORE_CT)
c_types << Override.new(:PartName => "/xl/#{STYLES_PN}", :ContentType => STYLES_CT)
c_types << Axlsx::Override.new(:PartName => "/#{WORKBOOK_PN}", :ContentType => WORKBOOK_CT)
c_types.lock
c_types
end | [
"def",
"base_content_types",
"c_types",
"=",
"ContentType",
".",
"new",
"(",
")",
"c_types",
"<<",
"Default",
".",
"new",
"(",
":ContentType",
"=>",
"RELS_CT",
",",
":Extension",
"=>",
"RELS_EX",
")",
"c_types",
"<<",
"Default",
".",
"new",
"(",
":Extension"... | Creates the minimum content types for generating a valid xlsx document.
@return [ContentType]
@private | [
"Creates",
"the",
"minimum",
"content",
"types",
"for",
"generating",
"a",
"valid",
"xlsx",
"document",
"."
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/package.rb#L329-L339 | train | Returns an array of all the content types that are available for the current project. | [
30522,
13366,
2918,
1035,
4180,
1035,
4127,
1039,
1035,
4127,
1027,
4180,
13874,
1012,
2047,
1006,
1007,
1039,
1035,
4127,
1026,
1026,
30524,
1027,
1028,
20950,
1035,
4654,
1010,
1024,
4180,
13874,
1027,
1028,
20950,
1035,
14931,
1007,
1039... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/managers.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Managers.get_extended_info | def get_extended_info(resource_group_name, manager_name, custom_headers:nil)
response = get_extended_info_async(resource_group_name, manager_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_extended_info(resource_group_name, manager_name, custom_headers:nil)
response = get_extended_info_async(resource_group_name, manager_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_extended_info",
"(",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_extended_info_async",
"(",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!"... | Returns the extended information of the specified manager 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 [ManagerExtendedInfo] operation results. | [
"Returns",
"the",
"extended",
"information",
"of",
"the",
"specified",
"manager",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/managers.rb#L795-L798 | train | Gets the extended information of the specified managed volume. | [
30522,
13366,
2131,
1035,
3668,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
3668,
1035,
18558,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_filters.rb | Azure::Network::Mgmt::V2018_07_01.RouteFilters.get_with_http_info | def get_with_http_info(resource_group_name, route_filter_name, expand:nil, custom_headers:nil)
get_async(resource_group_name, route_filter_name, expand:expand, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, route_filter_name, expand:nil, custom_headers:nil)
get_async(resource_group_name, route_filter_name, expand:expand, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"route_filter_name",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"route_filter_name",
",",
"expand",
":",
"expand",
",",
"custom_header... | Gets the specified route filter.
@param resource_group_name [String] The name of the resource group.
@param route_filter_name [String] The name of the route filter.
@param expand [String] Expands referenced express route bgp peering
resources.
@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",
"route",
"filter",
"."
] | 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#L91-L93 | train | Gets the specified route filter. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
30524,
1010,
7818,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
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... |
heroku/legacy-cli | lib/heroku/command/plugins.rb | Heroku::Command.Plugins.commands | def commands
validate_arguments!
ruby_cmd = Heroku::Command.commands.inject({}) {|h, (cmd, command)| h[cmd] = command_to_hash('ruby', cmd, command) ; h}
commands = Heroku::JSPlugin.commands_info['commands']
node_cmd = command_list_to_hash(commands.select {|command| command['plugin'] != ''}, 'node')
go_cmd = command_list_to_hash(commands.select {|command| command['plugin'] == ''}, 'go')
all_cmd = {}
all_cmd.merge!(ruby_cmd)
all_cmd.merge!(node_cmd)
all_cmd.merge!(go_cmd)
sorted_cmd = all_cmd.sort { |a,b| a[0] <=> b[0] }.map{|cmd| cmd[1]}
attrs = [:command, :type, :plugin]
header = attrs.map{|attr| attr.to_s.capitalize}
count_attrs = [:type, :count]
count_header = count_attrs.map{|attr| attr.to_s.capitalize}
counts = all_cmd.inject(Hash.new(0)) {|h, (_, cmd)| h[cmd[:type]] += 1; h}
type_and_percentage = counts.keys.sort.map{|type| {:type => type, :count => counts[type]}}
if options[:csv]
csv_str = CSV.generate do |csv|
csv << header
sorted_cmd.each {|cmd| csv << attrs.map{|attr| cmd[attr]}}
csv << []
csv << count_header
type_and_percentage.each {|type| csv << count_attrs.map{|attr| type[attr]}}
end
display(csv_str)
else
display_table(sorted_cmd, attrs, header)
display("")
display_table(type_and_percentage, count_attrs, count_header)
end
end | ruby | def commands
validate_arguments!
ruby_cmd = Heroku::Command.commands.inject({}) {|h, (cmd, command)| h[cmd] = command_to_hash('ruby', cmd, command) ; h}
commands = Heroku::JSPlugin.commands_info['commands']
node_cmd = command_list_to_hash(commands.select {|command| command['plugin'] != ''}, 'node')
go_cmd = command_list_to_hash(commands.select {|command| command['plugin'] == ''}, 'go')
all_cmd = {}
all_cmd.merge!(ruby_cmd)
all_cmd.merge!(node_cmd)
all_cmd.merge!(go_cmd)
sorted_cmd = all_cmd.sort { |a,b| a[0] <=> b[0] }.map{|cmd| cmd[1]}
attrs = [:command, :type, :plugin]
header = attrs.map{|attr| attr.to_s.capitalize}
count_attrs = [:type, :count]
count_header = count_attrs.map{|attr| attr.to_s.capitalize}
counts = all_cmd.inject(Hash.new(0)) {|h, (_, cmd)| h[cmd[:type]] += 1; h}
type_and_percentage = counts.keys.sort.map{|type| {:type => type, :count => counts[type]}}
if options[:csv]
csv_str = CSV.generate do |csv|
csv << header
sorted_cmd.each {|cmd| csv << attrs.map{|attr| cmd[attr]}}
csv << []
csv << count_header
type_and_percentage.each {|type| csv << count_attrs.map{|attr| type[attr]}}
end
display(csv_str)
else
display_table(sorted_cmd, attrs, header)
display("")
display_table(type_and_percentage, count_attrs, count_header)
end
end | [
"def",
"commands",
"validate_arguments!",
"ruby_cmd",
"=",
"Heroku",
"::",
"Command",
".",
"commands",
".",
"inject",
"(",
"{",
"}",
")",
"{",
"|",
"h",
",",
"(",
"cmd",
",",
"command",
")",
"|",
"h",
"[",
"cmd",
"]",
"=",
"command_to_hash",
"(",
"'r... | HIDDEN: plugins:commands
Prints a table of commands and location
-c, --csv # Show with csv formatting | [
"HIDDEN",
":",
"plugins",
":",
"commands"
] | 6f18521a258394bfb79e6b36f7160ad8559a8e16 | https://github.com/heroku/legacy-cli/blob/6f18521a258394bfb79e6b36f7160ad8559a8e16/lib/heroku/command/plugins.rb#L128-L167 | train | Returns a hash of all commands that are available to the user. | [
30522,
13366,
10954,
9398,
3686,
1035,
9918,
999,
10090,
1035,
4642,
2094,
1027,
5394,
5283,
1024,
1024,
3094,
1012,
10954,
1012,
1999,
20614,
1006,
1063,
1065,
1007,
1063,
1064,
1044,
1010,
1006,
4642,
2094,
1010,
3094,
1007,
1064,
1044,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/pivot_table.rb | Axlsx.PivotTable.to_xml_string | def to_xml_string(str = '')
str << '<?xml version="1.0" encoding="UTF-8"?>'
str << ('<pivotTableDefinition xmlns="' << XML_NS << '" name="' << name << '" cacheId="' << cache_definition.cache_id.to_s << '" dataOnRows="1" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Data" showMultipleLabel="0" showMemberPropertyTips="0" useAutoFormatting="1" indent="0" compact="0" compactData="0" gridDropZones="1" multipleFieldFilters="0">')
str << ('<location firstDataCol="1" firstDataRow="1" firstHeaderRow="1" ref="' << ref << '"/>')
str << ('<pivotFields count="' << header_cells_count.to_s << '">')
header_cell_values.each do |cell_value|
str << pivot_field_for(cell_value, !no_subtotals_on_headers.include?(cell_value))
end
str << '</pivotFields>'
if rows.empty?
str << '<rowFields count="1"><field x="-2"/></rowFields>'
str << '<rowItems count="2"><i><x/></i> <i i="1"><x v="1"/></i></rowItems>'
else
str << ('<rowFields count="' << rows.size.to_s << '">')
rows.each do |row_value|
str << ('<field x="' << header_index_of(row_value).to_s << '"/>')
end
str << '</rowFields>'
str << ('<rowItems count="' << rows.size.to_s << '">')
rows.size.times do |i|
str << '<i/>'
end
str << '</rowItems>'
end
if columns.empty?
str << '<colItems count="1"><i/></colItems>'
else
str << ('<colFields count="' << columns.size.to_s << '">')
columns.each do |column_value|
str << ('<field x="' << header_index_of(column_value).to_s << '"/>')
end
str << '</colFields>'
end
unless pages.empty?
str << ('<pageFields count="' << pages.size.to_s << '">')
pages.each do |page_value|
str << ('<pageField fld="' << header_index_of(page_value).to_s << '"/>')
end
str << '</pageFields>'
end
unless data.empty?
str << "<dataFields count=\"#{data.size}\">"
data.each do |datum_value|
# The correct name prefix in ["Sum","Average", etc...]
str << "<dataField name='#{(datum_value[:subtotal]||'')} of #{datum_value[:ref]}' fld='#{header_index_of(datum_value[:ref])}' baseField='0' baseItem='0'"
str << " subtotal='#{datum_value[:subtotal]}' " if datum_value[:subtotal]
str << "/>"
end
str << '</dataFields>'
end
# custom pivot table style
unless style_info.empty?
str << '<pivotTableStyleInfo'
style_info.each do |k,v|
str << ' ' << k.to_s << '="' << v.to_s << '"'
end
str << ' />'
end
str << '</pivotTableDefinition>'
end | ruby | def to_xml_string(str = '')
str << '<?xml version="1.0" encoding="UTF-8"?>'
str << ('<pivotTableDefinition xmlns="' << XML_NS << '" name="' << name << '" cacheId="' << cache_definition.cache_id.to_s << '" dataOnRows="1" applyNumberFormats="0" applyBorderFormats="0" applyFontFormats="0" applyPatternFormats="0" applyAlignmentFormats="0" applyWidthHeightFormats="1" dataCaption="Data" showMultipleLabel="0" showMemberPropertyTips="0" useAutoFormatting="1" indent="0" compact="0" compactData="0" gridDropZones="1" multipleFieldFilters="0">')
str << ('<location firstDataCol="1" firstDataRow="1" firstHeaderRow="1" ref="' << ref << '"/>')
str << ('<pivotFields count="' << header_cells_count.to_s << '">')
header_cell_values.each do |cell_value|
str << pivot_field_for(cell_value, !no_subtotals_on_headers.include?(cell_value))
end
str << '</pivotFields>'
if rows.empty?
str << '<rowFields count="1"><field x="-2"/></rowFields>'
str << '<rowItems count="2"><i><x/></i> <i i="1"><x v="1"/></i></rowItems>'
else
str << ('<rowFields count="' << rows.size.to_s << '">')
rows.each do |row_value|
str << ('<field x="' << header_index_of(row_value).to_s << '"/>')
end
str << '</rowFields>'
str << ('<rowItems count="' << rows.size.to_s << '">')
rows.size.times do |i|
str << '<i/>'
end
str << '</rowItems>'
end
if columns.empty?
str << '<colItems count="1"><i/></colItems>'
else
str << ('<colFields count="' << columns.size.to_s << '">')
columns.each do |column_value|
str << ('<field x="' << header_index_of(column_value).to_s << '"/>')
end
str << '</colFields>'
end
unless pages.empty?
str << ('<pageFields count="' << pages.size.to_s << '">')
pages.each do |page_value|
str << ('<pageField fld="' << header_index_of(page_value).to_s << '"/>')
end
str << '</pageFields>'
end
unless data.empty?
str << "<dataFields count=\"#{data.size}\">"
data.each do |datum_value|
# The correct name prefix in ["Sum","Average", etc...]
str << "<dataField name='#{(datum_value[:subtotal]||'')} of #{datum_value[:ref]}' fld='#{header_index_of(datum_value[:ref])}' baseField='0' baseItem='0'"
str << " subtotal='#{datum_value[:subtotal]}' " if datum_value[:subtotal]
str << "/>"
end
str << '</dataFields>'
end
# custom pivot table style
unless style_info.empty?
str << '<pivotTableStyleInfo'
style_info.each do |k,v|
str << ' ' << k.to_s << '="' << v.to_s << '"'
end
str << ' />'
end
str << '</pivotTableDefinition>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"str",
"<<",
"'<?xml version=\"1.0\" encoding=\"UTF-8\"?>'",
"str",
"<<",
"(",
"'<pivotTableDefinition xmlns=\"'",
"<<",
"XML_NS",
"<<",
"'\" name=\"'",
"<<",
"name",
"<<",
"'\" cacheId=\"'",
"<<",
"cache_definition",
... | Serializes the object
@param [String] str
@return [String] | [
"Serializes",
"the",
"object"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/pivot_table.rb#L170-L229 | train | Returns a string representation of the pivot table. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
2358,
2099,
1026,
1026,
1005,
1026,
1029,
20950,
2544,
1027,
1000,
1015,
1012,
1014,
1000,
17181,
1027,
1000,
21183,
2546,
1011,
1022,
1000,
1029,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_scheduler/lib/2016-03-01/generated/azure_mgmt_scheduler/jobs.rb | Azure::Scheduler::Mgmt::V2016_03_01.Jobs.run_with_http_info | def run_with_http_info(resource_group_name, job_collection_name, job_name, custom_headers:nil)
run_async(resource_group_name, job_collection_name, job_name, custom_headers:custom_headers).value!
end | ruby | def run_with_http_info(resource_group_name, job_collection_name, job_name, custom_headers:nil)
run_async(resource_group_name, job_collection_name, job_name, custom_headers:custom_headers).value!
end | [
"def",
"run_with_http_info",
"(",
"resource_group_name",
",",
"job_collection_name",
",",
"job_name",
",",
"custom_headers",
":",
"nil",
")",
"run_async",
"(",
"resource_group_name",
",",
"job_collection_name",
",",
"job_name",
",",
"custom_headers",
":custom_headers",
... | Runs a job.
@param resource_group_name [String] The resource group name.
@param job_collection_name [String] The job collection name.
@param job_name [String] The job 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. | [
"Runs",
"a",
"job",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_scheduler/lib/2016-03-01/generated/azure_mgmt_scheduler/jobs.rb#L455-L457 | train | Runs the specified job in a resource group. | [
30522,
13366,
2448,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3105,
1035,
3074,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2448,
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 | 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_backup_configuration_info | def get_partition_backup_configuration_info(partition_id, timeout:60, custom_headers:nil)
response = get_partition_backup_configuration_info_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_partition_backup_configuration_info(partition_id, timeout:60, custom_headers:nil)
response = get_partition_backup_configuration_info_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_partition_backup_configuration_info",
"(",
"partition_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_partition_backup_configuration_info_async",
"(",
"partition_id",
",",
"timeout",
":",
"timeout",
",",
"custom_... | Gets the partition backup configuration information
Gets the Service Fabric Backup configuration information for the specified
partition.
@param partition_id The identity of the partition.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PartitionBackupConfigurationInfo] operation results. | [
"Gets",
"the",
"partition",
"backup",
"configuration",
"information"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L24963-L24966 | train | Gets backup configuration information for the specified partition. | [
30522,
13366,
2131,
1035,
13571,
1035,
10200,
1035,
9563,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
13571,
1035,
10200,
1035,
9563,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/interface_endpoints.rb | Azure::Network::Mgmt::V2019_02_01.InterfaceEndpoints.get_with_http_info | def get_with_http_info(resource_group_name, interface_endpoint_name, expand:nil, custom_headers:nil)
get_async(resource_group_name, interface_endpoint_name, expand:expand, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, interface_endpoint_name, expand:nil, custom_headers:nil)
get_async(resource_group_name, interface_endpoint_name, expand:expand, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"interface_endpoint_name",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"interface_endpoint_name",
",",
"expand",
":",
"expand",
",",
"c... | Gets the specified interface endpoint by resource group.
@param resource_group_name [String] The name of the resource group.
@param interface_endpoint_name [String] The name of the interface endpoint.
@param expand [String] Expands referenced resources.
@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",
"interface",
"endpoint",
"by",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/interface_endpoints.rb#L89-L91 | train | Gets the specified network interface endpoint. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8278,
1035,
2203,
8400,
1035,
2171,
1010,
7818,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
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... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/document.rb | HQMF2.Document.setup_default_values | def setup_default_values(hqmf_contents, use_default_measure_period)
@id_generator = IdGenerator.new
@doc = @entry = Document.parse(hqmf_contents)
@id = attr_val('cda:QualityMeasureDocument/cda:id/@extension') ||
attr_val('cda:QualityMeasureDocument/cda:id/@root').upcase
@hqmf_set_id = attr_val('cda:QualityMeasureDocument/cda:setId/@extension') ||
attr_val('cda:QualityMeasureDocument/cda:setId/@root').upcase
@hqmf_version_number = attr_val('cda:QualityMeasureDocument/cda:versionNumber/@value')
# TODO: -- figure out if this is the correct thing to do -- probably not, but is
# necessary to get the bonnie comparison to work. Currently
# defaulting measure period to a period of 1 year from 2012 to 2013 this is overriden during
# calculation with correct year information . Need to investigate parsing mp from meaures.
@measure_period = extract_measure_period_or_default(use_default_measure_period)
# Extract measure attributes
# TODO: Review
@attributes = @doc.xpath('/cda:QualityMeasureDocument/cda:subjectOf/cda:measureAttribute', NAMESPACES)
.collect do |attribute|
read_attribute(attribute)
end
@data_criteria = []
@source_data_criteria = []
@data_criteria_references = {}
@occurrences_map = {}
# Used to keep track of referenced data criteria ids
@reference_ids = []
end | ruby | def setup_default_values(hqmf_contents, use_default_measure_period)
@id_generator = IdGenerator.new
@doc = @entry = Document.parse(hqmf_contents)
@id = attr_val('cda:QualityMeasureDocument/cda:id/@extension') ||
attr_val('cda:QualityMeasureDocument/cda:id/@root').upcase
@hqmf_set_id = attr_val('cda:QualityMeasureDocument/cda:setId/@extension') ||
attr_val('cda:QualityMeasureDocument/cda:setId/@root').upcase
@hqmf_version_number = attr_val('cda:QualityMeasureDocument/cda:versionNumber/@value')
# TODO: -- figure out if this is the correct thing to do -- probably not, but is
# necessary to get the bonnie comparison to work. Currently
# defaulting measure period to a period of 1 year from 2012 to 2013 this is overriden during
# calculation with correct year information . Need to investigate parsing mp from meaures.
@measure_period = extract_measure_period_or_default(use_default_measure_period)
# Extract measure attributes
# TODO: Review
@attributes = @doc.xpath('/cda:QualityMeasureDocument/cda:subjectOf/cda:measureAttribute', NAMESPACES)
.collect do |attribute|
read_attribute(attribute)
end
@data_criteria = []
@source_data_criteria = []
@data_criteria_references = {}
@occurrences_map = {}
# Used to keep track of referenced data criteria ids
@reference_ids = []
end | [
"def",
"setup_default_values",
"(",
"hqmf_contents",
",",
"use_default_measure_period",
")",
"@id_generator",
"=",
"IdGenerator",
".",
"new",
"@doc",
"=",
"@entry",
"=",
"Document",
".",
"parse",
"(",
"hqmf_contents",
")",
"@id",
"=",
"attr_val",
"(",
"'cda:Qualit... | Handles setup of the base values of the document, defined here as ones that are either
obtained from the xml directly or with limited parsing | [
"Handles",
"setup",
"of",
"the",
"base",
"values",
"of",
"the",
"document",
"defined",
"here",
"as",
"ones",
"that",
"are",
"either",
"obtained",
"from",
"the",
"xml",
"directly",
"or",
"with",
"limited",
"parsing"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/document.rb#L120-L150 | train | This function is used to setup the default values for the quality measure document. | [
30522,
13366,
16437,
1035,
12398,
1035,
5300,
1006,
16260,
2213,
2546,
1035,
8417,
1010,
2224,
1035,
12398,
1035,
5468,
1035,
2558,
1007,
1030,
8909,
1035,
13103,
1027,
8909,
6914,
6906,
4263,
1012,
2047,
1030,
9986,
1027,
1030,
4443,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | ActiveRecord.ConnectionHandling.mysql2_connection | def mysql2_connection(config)
config = config.symbolize_keys
config[:flags] ||= 0
if config[:flags].kind_of? Array
config[:flags].push "FOUND_ROWS"
else
config[:flags] |= Mysql2::Client::FOUND_ROWS
end
client = Mysql2::Client.new(config)
ConnectionAdapters::Mysql2Adapter.new(client, logger, nil, config)
rescue Mysql2::Error => error
if error.message.include?("Unknown database")
raise ActiveRecord::NoDatabaseError
else
raise
end
end | ruby | def mysql2_connection(config)
config = config.symbolize_keys
config[:flags] ||= 0
if config[:flags].kind_of? Array
config[:flags].push "FOUND_ROWS"
else
config[:flags] |= Mysql2::Client::FOUND_ROWS
end
client = Mysql2::Client.new(config)
ConnectionAdapters::Mysql2Adapter.new(client, logger, nil, config)
rescue Mysql2::Error => error
if error.message.include?("Unknown database")
raise ActiveRecord::NoDatabaseError
else
raise
end
end | [
"def",
"mysql2_connection",
"(",
"config",
")",
"config",
"=",
"config",
".",
"symbolize_keys",
"config",
"[",
":flags",
"]",
"||=",
"0",
"if",
"config",
"[",
":flags",
"]",
".",
"kind_of?",
"Array",
"config",
"[",
":flags",
"]",
".",
"push",
"\"FOUND_ROWS... | :nodoc:
Establishes a connection to the database that's used by all Active Record objects. | [
":",
"nodoc",
":",
"Establishes",
"a",
"connection",
"to",
"the",
"database",
"that",
"s",
"used",
"by",
"all",
"Active",
"Record",
"objects",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L12-L30 | train | Create a connection to a MySQL database | [
30522,
13366,
2026,
2015,
4160,
2140,
2475,
1035,
4434,
1006,
9530,
8873,
2290,
1007,
9530,
8873,
2290,
1027,
9530,
8873,
2290,
1012,
6454,
4697,
1035,
6309,
9530,
8873,
2290,
1031,
1024,
9245,
1033,
1064,
1064,
1027,
1014,
2065,
9530,
88... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_management_group_with_http_info | def list_deployments_at_management_group_with_http_info(management_group_id, remediation_name, query_options:nil, custom_headers:nil)
list_deployments_at_management_group_async(management_group_id, remediation_name, query_options:query_options, custom_headers:custom_headers).value!
end | ruby | def list_deployments_at_management_group_with_http_info(management_group_id, remediation_name, query_options:nil, custom_headers:nil)
list_deployments_at_management_group_async(management_group_id, remediation_name, query_options:query_options, custom_headers:custom_headers).value!
end | [
"def",
"list_deployments_at_management_group_with_http_info",
"(",
"management_group_id",
",",
"remediation_name",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_deployments_at_management_group_async",
"(",
"management_group_id",
",",
"remediati... | Gets all deployments for a remediation at management group scope.
@param management_group_id [String] Management group ID.
@param remediation_name [String] The name of the remediation.
@param query_options [QueryOptions] Additional parameters for the operation
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"all",
"deployments",
"for",
"a",
"remediation",
"at",
"management",
"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#L51-L53 | train | Gets the list of deployments at management group level. | [
30522,
13366,
2862,
1035,
10813,
2015,
1035,
2012,
1035,
2968,
1035,
2177,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2968,
1035,
2177,
1035,
8909,
1010,
2128,
16969,
3508,
1035,
2171,
1010,
23032,
1035,
7047,
1024,
9152,
2140,
1010,
7661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb | Azure::ApiManagement::Mgmt::V2016_10_10.ApiManagementServices.update_hostname | def update_hostname(resource_group_name, service_name, parameters, custom_headers:nil)
response = update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_hostname(resource_group_name, service_name, parameters, custom_headers:nil)
response = update_hostname_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_hostname",
"(",
"resource_group_name",
",",
"service_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_hostname_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"parameters",
",",
"custom_headers",
"... | Creates, updates, or deletes the custom hostnames for an API Management
service. The custom hostname can be applied to the Proxy and Portal endpoint.
This is a long running operation and could take several minutes to complete.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param parameters [ApiManagementServiceUpdateHostnameParameters] Parameters
supplied to the UpdateHostname operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ApiManagementServiceResource] operation results. | [
"Creates",
"updates",
"or",
"deletes",
"the",
"custom",
"hostnames",
"for",
"an",
"API",
"Management",
"service",
".",
"The",
"custom",
"hostname",
"can",
"be",
"applied",
"to",
"the",
"Proxy",
"and",
"Portal",
"endpoint",
".",
"This",
"is",
"a",
"long",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb#L1010-L1013 | train | Updates the hostname of the specified App Service Environment. | [
30522,
13366,
10651,
1035,
3677,
18442,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
3677,
18442,
1035,
2004,
6038,
2278,
1006,
7692... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Tag.detach_from_product_with_http_info | def detach_from_product_with_http_info(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers:nil)
detach_from_product_async(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers:custom_headers).value!
end | ruby | def detach_from_product_with_http_info(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers:nil)
detach_from_product_async(resource_group_name, service_name, product_id, tag_id, if_match, custom_headers:custom_headers).value!
end | [
"def",
"detach_from_product_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"product_id",
",",
"tag_id",
",",
"if_match",
",",
"custom_headers",
":",
"nil",
")",
"detach_from_product_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"p... | Detach the tag from the Product.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param product_id [String] Product identifier. Must be unique in the current
API Management service instance.
@param tag_id [String] Tag identifier. Must be unique in the current API
Management service instance.
@param if_match [String] ETag of the Entity. ETag should match the current
entity state from the header response of the GET request or it should be *
for unconditional update.
@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. | [
"Detach",
"the",
"tag",
"from",
"the",
"Product",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb#L2515-L2517 | train | Detaches a product from the specified product. | [
30522,
13366,
20010,
6776,
1035,
2013,
1035,
4031,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
4031,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
2065,
1035,
2674,
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... |
rails/rails | activerecord/lib/active_record/database_configurations.rb | ActiveRecord.DatabaseConfigurations.configs_for | def configs_for(env_name: nil, spec_name: nil, include_replicas: false)
configs = env_with_configs(env_name)
unless include_replicas
configs = configs.select do |db_config|
!db_config.replica?
end
end
if spec_name
configs.find do |db_config|
db_config.spec_name == spec_name
end
else
configs
end
end | ruby | def configs_for(env_name: nil, spec_name: nil, include_replicas: false)
configs = env_with_configs(env_name)
unless include_replicas
configs = configs.select do |db_config|
!db_config.replica?
end
end
if spec_name
configs.find do |db_config|
db_config.spec_name == spec_name
end
else
configs
end
end | [
"def",
"configs_for",
"(",
"env_name",
":",
"nil",
",",
"spec_name",
":",
"nil",
",",
"include_replicas",
":",
"false",
")",
"configs",
"=",
"env_with_configs",
"(",
"env_name",
")",
"unless",
"include_replicas",
"configs",
"=",
"configs",
".",
"select",
"do",... | Collects the configs for the environment and optionally the specification
name passed in. To include replica configurations pass <tt>include_replicas: true</tt>.
If a spec name is provided a single DatabaseConfig object will be
returned, otherwise an array of DatabaseConfig objects will be
returned that corresponds with the environment and type requested.
==== Options
* <tt>env_name:</tt> The environment name. Defaults to +nil+ which will collect
configs for all environments.
* <tt>spec_name:</tt> The specification name (i.e. primary, animals, etc.). Defaults
to +nil+.
* <tt>include_replicas:</tt> Determines whether to include replicas in
the returned list. Most of the time we're only iterating over the write
connection (i.e. migrations don't need to run for the write and read connection).
Defaults to +false+. | [
"Collects",
"the",
"configs",
"for",
"the",
"environment",
"and",
"optionally",
"the",
"specification",
"name",
"passed",
"in",
".",
"To",
"include",
"replica",
"configurations",
"pass",
"<tt",
">",
"include_replicas",
":",
"true<",
"/",
"tt",
">",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/database_configurations.rb#L36-L52 | train | Returns the configs for the specified environment | [
30522,
13366,
9530,
8873,
5620,
1035,
2005,
1006,
4372,
2615,
1035,
2171,
30524,
4983,
2421,
1035,
15059,
2015,
9530,
8873,
5620,
1027,
9530,
8873,
5620,
1012,
7276,
2079,
1064,
16962,
1035,
9530,
8873,
2290,
1064,
999,
16962,
1035,
9530,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sporkmonger/addressable | lib/addressable/uri.rb | Addressable.URI.normalized_site | def normalized_site
return nil unless self.site
@normalized_site ||= begin
site_string = "".dup
if self.normalized_scheme != nil
site_string << "#{self.normalized_scheme}:"
end
if self.normalized_authority != nil
site_string << "//#{self.normalized_authority}"
end
site_string
end
# All normalized values should be UTF-8
@normalized_site.force_encoding(Encoding::UTF_8) if @normalized_site
@normalized_site
end | ruby | def normalized_site
return nil unless self.site
@normalized_site ||= begin
site_string = "".dup
if self.normalized_scheme != nil
site_string << "#{self.normalized_scheme}:"
end
if self.normalized_authority != nil
site_string << "//#{self.normalized_authority}"
end
site_string
end
# All normalized values should be UTF-8
@normalized_site.force_encoding(Encoding::UTF_8) if @normalized_site
@normalized_site
end | [
"def",
"normalized_site",
"return",
"nil",
"unless",
"self",
".",
"site",
"@normalized_site",
"||=",
"begin",
"site_string",
"=",
"\"\"",
".",
"dup",
"if",
"self",
".",
"normalized_scheme",
"!=",
"nil",
"site_string",
"<<",
"\"#{self.normalized_scheme}:\"",
"end",
... | The normalized combination of components that represent a site.
Combines the scheme, user, password, host, and port components.
Primarily useful for HTTP and HTTPS.
For example, <code>"http://example.com/path?query"</code> would have a
<code>site</code> value of <code>"http://example.com"</code>.
@return [String] The normalized components that identify a site. | [
"The",
"normalized",
"combination",
"of",
"components",
"that",
"represent",
"a",
"site",
".",
"Combines",
"the",
"scheme",
"user",
"password",
"host",
"and",
"port",
"components",
".",
"Primarily",
"useful",
"for",
"HTTP",
"and",
"HTTPS",
"."
] | 5894c95a7768435cb46d1355954611dbd194832e | https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/uri.rb#L1458-L1473 | train | Returns the site object normalized by the scheme authority and authority. | [
30522,
13366,
3671,
3550,
1035,
2609,
2709,
9152,
2140,
4983,
2969,
1012,
2609,
1030,
3671,
3550,
1035,
2609,
1064,
1064,
1027,
4088,
2609,
1035,
5164,
1027,
1000,
1000,
1012,
4241,
2361,
2065,
2969,
1012,
3671,
3550,
1035,
5679,
999,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/managers.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Managers.create_or_update_with_http_info | def create_or_update_with_http_info(parameters, resource_group_name, manager_name, custom_headers:nil)
create_or_update_async(parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(parameters, resource_group_name, manager_name, custom_headers:nil)
create_or_update_async(parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":cus... | Creates or updates the manager.
@param parameters [Manager] The manager.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"the",
"manager",
"."
] | 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/managers.rb#L317-L319 | train | Creates or updates a managed product. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11709,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3443,
1035,
2030,
1035,
10651,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
awesome-print/awesome_print | lib/awesome_print/ext/ripple.rb | AwesomePrint.Ripple.awesome_ripple_document_instance | def awesome_ripple_document_instance(object)
return object.inspect if !defined?(::ActiveSupport::OrderedHash)
return awesome_object(object) if @options[:raw]
exclude_assoc = @options[:exclude_assoc] or @options[:exclude_associations]
data = object.attributes.inject(::ActiveSupport::OrderedHash.new) do |hash, (name, value)|
hash[name.to_sym] = object.send(name)
hash
end
unless exclude_assoc
data = object.class.embedded_associations.inject(data) do |hash, assoc|
hash[assoc.name] = object.get_proxy(assoc) # Should always be array or Ripple::EmbeddedDocument for embedded associations
hash
end
end
"#{object} " << awesome_hash(data)
end | ruby | def awesome_ripple_document_instance(object)
return object.inspect if !defined?(::ActiveSupport::OrderedHash)
return awesome_object(object) if @options[:raw]
exclude_assoc = @options[:exclude_assoc] or @options[:exclude_associations]
data = object.attributes.inject(::ActiveSupport::OrderedHash.new) do |hash, (name, value)|
hash[name.to_sym] = object.send(name)
hash
end
unless exclude_assoc
data = object.class.embedded_associations.inject(data) do |hash, assoc|
hash[assoc.name] = object.get_proxy(assoc) # Should always be array or Ripple::EmbeddedDocument for embedded associations
hash
end
end
"#{object} " << awesome_hash(data)
end | [
"def",
"awesome_ripple_document_instance",
"(",
"object",
")",
"return",
"object",
".",
"inspect",
"if",
"!",
"defined?",
"(",
"::",
"ActiveSupport",
"::",
"OrderedHash",
")",
"return",
"awesome_object",
"(",
"object",
")",
"if",
"@options",
"[",
":raw",
"]",
... | Format Ripple instance object.
NOTE: by default only instance attributes are shown. To format a Ripple document instance
as a regular object showing its instance variables and accessors use :raw => true option:
ap document, :raw => true
------------------------------------------------------------------------------ | [
"Format",
"Ripple",
"instance",
"object",
"."
] | 4564fd74721562cbef2443f7d97109bf9192343d | https://github.com/awesome-print/awesome_print/blob/4564fd74721562cbef2443f7d97109bf9192343d/lib/awesome_print/ext/ripple.rb#L38-L56 | train | Returns a hash of the object s attributes and associations | [
30522,
13366,
12476,
1035,
24644,
1035,
6254,
1035,
6013,
1006,
4874,
1007,
2709,
4874,
1012,
22459,
2065,
999,
4225,
1029,
1006,
1024,
1024,
3161,
6342,
9397,
11589,
1024,
1024,
3641,
14949,
2232,
1007,
2709,
12476,
1035,
4874,
1006,
4874,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/connection_monitors.rb | Azure::Network::Mgmt::V2018_10_01.ConnectionMonitors.begin_query | def begin_query(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil)
response = begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_query(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:nil)
response = begin_query_async(resource_group_name, network_watcher_name, connection_monitor_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_query",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"connection_monitor_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_query_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"connection_monitor_nam... | Query a snapshot of the most recent connection states.
@param resource_group_name [String] The name of the resource group containing
Network Watcher.
@param network_watcher_name [String] The name of the Network Watcher
resource.
@param connection_monitor_name [String] The name given to the connection
monitor.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ConnectionMonitorQueryResult] operation results. | [
"Query",
"a",
"snapshot",
"of",
"the",
"most",
"recent",
"connection",
"states",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-10-01/generated/azure_mgmt_network/connection_monitors.rb#L871-L874 | train | Gets the list of all the available network endpoints in a resource group. | [
30522,
13366,
4088,
1035,
23032,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
4434,
1035,
8080,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
23032,
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_consumption/lib/2018-06-30/generated/azure_mgmt_consumption/usage_details.rb | Azure::Consumption::Mgmt::V2018_06_30.UsageDetails.list_by_department_next | def list_by_department_next(next_page_link, custom_headers:nil)
response = list_by_department_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_department_next(next_page_link, custom_headers:nil)
response = list_by_department_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_department_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_department_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"... | Lists the usage details by departmentId for a scope by current billing
period. Usage details are available via this API only for May 1, 2014 or
later.
@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 [UsageDetailsListResult] operation results. | [
"Lists",
"the",
"usage",
"details",
"by",
"departmentId",
"for",
"a",
"scope",
"by",
"current",
"billing",
"period",
".",
"Usage",
"details",
"are",
"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-06-30/generated/azure_mgmt_consumption/usage_details.rb#L1608-L1611 | train | Gets the list of all the segmentation products in a given department. | [
30522,
13366,
2862,
1035,
2011,
1035,
2533,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
2533,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/lib/decidim/view_hooks.rb | Decidim.ViewHooks.render | def render(name, view_context)
hooks[name].map do |hook|
hook.render(view_context)
end.join("").html_safe
end | ruby | def render(name, view_context)
hooks[name].map do |hook|
hook.render(view_context)
end.join("").html_safe
end | [
"def",
"render",
"(",
"name",
",",
"view_context",
")",
"hooks",
"[",
"name",
"]",
".",
"map",
"do",
"|",
"hook",
"|",
"hook",
".",
"render",
"(",
"view_context",
")",
"end",
".",
"join",
"(",
"\"\"",
")",
".",
"html_safe",
"end"
] | Public: Renders all the view hooks registered for a given hook `name`.
Needs a `view_context` parameter, which will almost always be `self` from
the helper method or the view that calls this.
The easiest is to call this method from within a Helper:
module MyViewHooksRenderHelper
def my_render_hooks(name)
Decidim.view_hooks.render(name, self)
end
end
def ApplicationController
helper MyViewHooksRenderHelper
end
Then from your views you need to call `my_render_hooks(name)`.
name - The name of the view hook
`view_context` - a context to render the view hooks.
Returns an HTML safe String. | [
"Public",
":",
"Renders",
"all",
"the",
"view",
"hooks",
"registered",
"for",
"a",
"given",
"hook",
"name",
".",
"Needs",
"a",
"view_context",
"parameter",
"which",
"will",
"almost",
"always",
"be",
"self",
"from",
"the",
"helper",
"method",
"or",
"the",
"... | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/view_hooks.rb#L77-L81 | train | Renders the given hook. | [
30522,
13366,
17552,
1006,
2171,
1010,
3193,
1035,
6123,
1007,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/event_subscription.rb | Aws::RDS.EventSubscription.remove_subscriber | def remove_subscriber(options = {})
options = options.merge(subscription_name: @name)
resp = @client.remove_source_identifier_from_subscription(options)
EventSubscription.new(
name: resp.data.event_subscription.cust_subscription_id,
data: resp.data.event_subscription,
client: @client
)
end | ruby | def remove_subscriber(options = {})
options = options.merge(subscription_name: @name)
resp = @client.remove_source_identifier_from_subscription(options)
EventSubscription.new(
name: resp.data.event_subscription.cust_subscription_id,
data: resp.data.event_subscription,
client: @client
)
end | [
"def",
"remove_subscriber",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"subscription_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"remove_source_identifier_from_subscription",
"(",
"options",
")",
"EventSubscription... | @example Request syntax with placeholder values
eventsubscription = event_subscription.remove_subscriber({
source_identifier: "String", # required
})
@param [Hash] options ({})
@option options [required, String] :source_identifier
The source identifier to be removed from the subscription, such as the
**DB instance identifier** for a DB instance or the name of a security
group.
@return [EventSubscription] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/event_subscription.rb#L415-L423 | train | Remove a subscriber from the cluster | [
30522,
13366,
6366,
1035,
4942,
29234,
2099,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
15002,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
6366,
1035,
3120,
1035,
8909,
4765,
18095,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kmuto/review | lib/epubmaker/producer.rb | EPUBMaker.Producer.colophon | def colophon(wobj)
s = @epub.colophon
if !s.nil? && !wobj.nil?
wobj.puts s
end
end | ruby | def colophon(wobj)
s = @epub.colophon
if !s.nil? && !wobj.nil?
wobj.puts s
end
end | [
"def",
"colophon",
"(",
"wobj",
")",
"s",
"=",
"@epub",
".",
"colophon",
"if",
"!",
"s",
".",
"nil?",
"&&",
"!",
"wobj",
".",
"nil?",
"wobj",
".",
"puts",
"s",
"end",
"end"
] | Write colophon file to IO object +wobj+. | [
"Write",
"colophon",
"file",
"to",
"IO",
"object",
"+",
"wobj",
"+",
"."
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/producer.rb#L150-L155 | train | Return the colophon of the object | [
30522,
13366,
8902,
7361,
8747,
1006,
24185,
2497,
3501,
1007,
1055,
1027,
1030,
4958,
12083,
1012,
8902,
7361,
8747,
2065,
999,
1055,
1012,
9152,
2140,
1029,
1004,
1004,
999,
24185,
2497,
3501,
1012,
9152,
2140,
1029,
24185,
2497,
3501,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_agents.rb | Azure::SQL::Mgmt::V2015_05_01_preview.SyncAgents.generate_key_with_http_info | def generate_key_with_http_info(resource_group_name, server_name, sync_agent_name, custom_headers:nil)
generate_key_async(resource_group_name, server_name, sync_agent_name, custom_headers:custom_headers).value!
end | ruby | def generate_key_with_http_info(resource_group_name, server_name, sync_agent_name, custom_headers:nil)
generate_key_async(resource_group_name, server_name, sync_agent_name, custom_headers:custom_headers).value!
end | [
"def",
"generate_key_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"sync_agent_name",
",",
"custom_headers",
":",
"nil",
")",
"generate_key_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"sync_agent_name",
",",
"custom_headers",
":cus... | Generates a sync agent key.
@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 on which the sync agent is
hosted.
@param sync_agent_name [String] The name of the sync agent.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Generates",
"a",
"sync",
"agent",
"key",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_agents.rb#L364-L366 | train | Generates a key for a given sync agent. | [
30522,
13366,
9699,
1035,
3145,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
26351,
1035,
4005,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
9699,
1035,
3145,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rollbar/rollbar-gem | lib/rollbar/notifier.rb | Rollbar.Notifier.process_from_async_handler | def process_from_async_handler(payload)
payload = Rollbar::JSON.load(payload) if payload.is_a?(String)
item = Item.build_with(payload,
:notifier => self,
:configuration => configuration,
:logger => logger)
Rollbar.silenced do
begin
process_item(item)
rescue StandardError => e
report_internal_error(e)
raise
end
end
end | ruby | def process_from_async_handler(payload)
payload = Rollbar::JSON.load(payload) if payload.is_a?(String)
item = Item.build_with(payload,
:notifier => self,
:configuration => configuration,
:logger => logger)
Rollbar.silenced do
begin
process_item(item)
rescue StandardError => e
report_internal_error(e)
raise
end
end
end | [
"def",
"process_from_async_handler",
"(",
"payload",
")",
"payload",
"=",
"Rollbar",
"::",
"JSON",
".",
"load",
"(",
"payload",
")",
"if",
"payload",
".",
"is_a?",
"(",
"String",
")",
"item",
"=",
"Item",
".",
"build_with",
"(",
"payload",
",",
":notifier"... | We will reraise exceptions in this method so async queues
can retry the job or, in general, handle an error report some way.
At same time that exception is silenced so we don't generate
infinite reports. This example is what we want to avoid:
1. New exception in a the project is raised
2. That report enqueued to Sidekiq queue.
3. The Sidekiq job tries to send the report to our API
4. The report fails, for example cause a network failure,
and a exception is raised
5. We report an internal error for that exception
6. We reraise the exception so Sidekiq job fails and
Sidekiq can retry the job reporting the original exception
7. Because the job failed and Sidekiq can be managed by rollbar we'll
report a new exception.
8. Go to point 2.
We'll then push to Sidekiq queue indefinitely until the network failure
is fixed.
Using Rollbar.silenced we avoid the above behavior but Sidekiq
will have a chance to retry the original job. | [
"We",
"will",
"reraise",
"exceptions",
"in",
"this",
"method",
"so",
"async",
"queues",
"can",
"retry",
"the",
"job",
"or",
"in",
"general",
"handle",
"an",
"error",
"report",
"some",
"way",
"."
] | 83ef1acca2b0b1d1b74ff8ef29435ca82e8ca1d6 | https://github.com/rollbar/rollbar-gem/blob/83ef1acca2b0b1d1b74ff8ef29435ca82e8ca1d6/lib/rollbar/notifier.rb#L234-L251 | train | Process the given payload from the async handler | [
30522,
13366,
2832,
1035,
2013,
1035,
2004,
6038,
2278,
1035,
28213,
1006,
18093,
1007,
18093,
1027,
4897,
8237,
1024,
1024,
1046,
3385,
1012,
7170,
1006,
18093,
1007,
2065,
18093,
1012,
2003,
1035,
1037,
1029,
1006,
5164,
1007,
8875,
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... |
Katello/katello | app/services/katello/product_content_finder.rb | Katello.ProductContentFinder.product_content | def product_content
if match_environment
environment = consumable.lifecycle_environment
view = consumable.content_view
return [] unless environment && view
version = ContentViewVersion.in_environment(environment).where(:content_view_id => view).first
end
considered_products = match_subscription ? consumable.products : consumable.organization.products.enabled.uniq
roots = Katello::RootRepository.where(:product_id => considered_products).subscribable
roots = roots.in_content_view_version(version) if version
consumable.organization.enabled_product_content_for(roots)
end | ruby | def product_content
if match_environment
environment = consumable.lifecycle_environment
view = consumable.content_view
return [] unless environment && view
version = ContentViewVersion.in_environment(environment).where(:content_view_id => view).first
end
considered_products = match_subscription ? consumable.products : consumable.organization.products.enabled.uniq
roots = Katello::RootRepository.where(:product_id => considered_products).subscribable
roots = roots.in_content_view_version(version) if version
consumable.organization.enabled_product_content_for(roots)
end | [
"def",
"product_content",
"if",
"match_environment",
"environment",
"=",
"consumable",
".",
"lifecycle_environment",
"view",
"=",
"consumable",
".",
"content_view",
"return",
"[",
"]",
"unless",
"environment",
"&&",
"view",
"version",
"=",
"ContentViewVersion",
".",
... | consumable must implement:
content_view
lifecycle_environment
organization
products | [
"consumable",
"must",
"implement",
":",
"content_view",
"lifecycle_environment",
"organization",
"products"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/services/katello/product_content_finder.rb#L17-L31 | train | Returns the product content array for this product. | [
30522,
13366,
4031,
1035,
4180,
2065,
2674,
1035,
4044,
4044,
1027,
9530,
17421,
3085,
1012,
2166,
23490,
1035,
4044,
3193,
1027,
9530,
17421,
3085,
1012,
4180,
1035,
3193,
2709,
1031,
1033,
4983,
4044,
1004,
1004,
3193,
2544,
1027,
30524,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/row.rb | Axlsx.Row.add_cell | def add_cell(value = '', options = {})
c = Cell.new(self, value, options)
self << c
worksheet.send(:update_column_info, self, [])
c
end | ruby | def add_cell(value = '', options = {})
c = Cell.new(self, value, options)
self << c
worksheet.send(:update_column_info, self, [])
c
end | [
"def",
"add_cell",
"(",
"value",
"=",
"''",
",",
"options",
"=",
"{",
"}",
")",
"c",
"=",
"Cell",
".",
"new",
"(",
"self",
",",
"value",
",",
"options",
")",
"self",
"<<",
"c",
"worksheet",
".",
"send",
"(",
":update_column_info",
",",
"self",
",",... | Adds a single cell to the row based on the data provided and updates the worksheet's autofit data.
@return [Cell] | [
"Adds",
"a",
"single",
"cell",
"to",
"the",
"row",
"based",
"on",
"the",
"data",
"provided",
"and",
"updates",
"the",
"worksheet",
"s",
"autofit",
"data",
"."
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/row.rb#L99-L104 | train | Adds a cell to the worksheet | [
30522,
13366,
5587,
1035,
3526,
1006,
3643,
1027,
1005,
1005,
1010,
7047,
1027,
1063,
1065,
1007,
1039,
1027,
3526,
1012,
2047,
1006,
2969,
1010,
3643,
1010,
7047,
1007,
2969,
1026,
1026,
1039,
2573,
21030,
2102,
1012,
4604,
1006,
1024,
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... |
rails/rails | actionview/lib/action_view/rendering.rb | ActionView.Rendering.process | def process(*) #:nodoc:
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
super
ensure
I18n.config = old_config
end | ruby | def process(*) #:nodoc:
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
super
ensure
I18n.config = old_config
end | [
"def",
"process",
"(",
"*",
")",
"#:nodoc:",
"old_config",
",",
"I18n",
".",
"config",
"=",
"I18n",
".",
"config",
",",
"I18nProxy",
".",
"new",
"(",
"I18n",
".",
"config",
",",
"lookup_context",
")",
"super",
"ensure",
"I18n",
".",
"config",
"=",
"old... | Overwrite process to setup I18n proxy. | [
"Overwrite",
"process",
"to",
"setup",
"I18n",
"proxy",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/rendering.rb#L37-L42 | train | This method is called by the I18nProxy class to process the I18n object. | [
30522,
13366,
2832,
1006,
1008,
1007,
1001,
1024,
7293,
10085,
1024,
2214,
1035,
9530,
8873,
2290,
1010,
1045,
15136,
2078,
1012,
9530,
8873,
2290,
1027,
1045,
15136,
2078,
1012,
9530,
8873,
2290,
1010,
1045,
15136,
16275,
3217,
18037,
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... |
square/connect-ruby-sdk | lib/square_connect/models/additional_recipient_receivable.rb | SquareConnect.AdditionalRecipientReceivable.transaction_id= | def transaction_id=(transaction_id)
if transaction_id.nil?
fail ArgumentError, "transaction_id cannot be nil"
end
if transaction_id.to_s.length < 1
fail ArgumentError, "invalid value for 'transaction_id', the character length must be great than or equal to 1."
end
@transaction_id = transaction_id
end | ruby | def transaction_id=(transaction_id)
if transaction_id.nil?
fail ArgumentError, "transaction_id cannot be nil"
end
if transaction_id.to_s.length < 1
fail ArgumentError, "invalid value for 'transaction_id', the character length must be great than or equal to 1."
end
@transaction_id = transaction_id
end | [
"def",
"transaction_id",
"=",
"(",
"transaction_id",
")",
"if",
"transaction_id",
".",
"nil?",
"fail",
"ArgumentError",
",",
"\"transaction_id cannot be nil\"",
"end",
"if",
"transaction_id",
".",
"to_s",
".",
"length",
"<",
"1",
"fail",
"ArgumentError",
",",
"\"i... | Custom attribute writer method with validation
@param [Object] transaction_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/additional_recipient_receivable.rb#L158-L168 | train | Sets the transaction_id of the object. | [
30522,
13366,
12598,
1035,
8909,
1027,
1006,
12598,
1035,
8909,
1007,
2065,
12598,
1035,
8909,
1012,
9152,
2140,
1029,
8246,
6685,
2121,
29165,
1010,
1000,
12598,
1035,
8909,
3685,
2022,
9152,
2140,
1000,
2203,
2065,
12598,
1035,
8909,
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... |
Fullscreen/yt | lib/yt/request.rb | Yt.Request.run | def run
if matches_expectations?
response.tap{parse_response!}
elsif run_again?
run
else
raise response_error, error_message.to_json
end
end | ruby | def run
if matches_expectations?
response.tap{parse_response!}
elsif run_again?
run
else
raise response_error, error_message.to_json
end
end | [
"def",
"run",
"if",
"matches_expectations?",
"response",
".",
"tap",
"{",
"parse_response!",
"}",
"elsif",
"run_again?",
"run",
"else",
"raise",
"response_error",
",",
"error_message",
".",
"to_json",
"end",
"end"
] | Initializes a Request object.
@param [Hash] options the options for the request.
@option options [String, Symbol] :method (:get) The HTTP method to use.
@option options [Class] :expected_response (Net::HTTPSuccess) The class
of response that the request should obtain when run.
@option options [String, Symbol] :response_format (:json) The expected
format of the response body. If passed, the response body will be
parsed according to the format before being returned.
@option options [String] :host The host component of the request URI.
@option options [String] :path The path component of the request URI.
@option options [Hash] :params ({}) The params to use as the query
component of the request URI, for instance the Hash +{a: 1, b: 2}+
corresponds to the query parameters "a=1&b=2".
@option options [Hash] :camelize_params (true) whether to transform
each key of params into a camel-case symbol before sending the request.
@option options [Hash] :request_format (:json) The format of the
request body. If a request body is passed, it will be parsed
according to this format before sending it in the request.
@option options [#size] :body The body component of the request.
@option options [Hash] :headers ({}) The headers component of the
request.
@option options [#access_token, #refreshed_access_token?] :auth The
authentication object. If set, must respond to +access_token+ and
return the OAuth token to make an authenticated request, and must
respond to +refreshed_access_token?+ and return whether the access
token can be refreshed if expired.
Sends the request and returns the response.
If the request fails once for a temporary server error or an expired
token, tries the request again before eventually raising an error.
@return [Net::HTTPResponse] if the request succeeds and matches the
expectations, the response with the body appropriately parsed.
@raise [Yt::RequestError] if the request fails or the response does
not match the expectations. | [
"Initializes",
"a",
"Request",
"object",
"."
] | bf5c33b977cb162bb7735ad5b80d1abdb5a38215 | https://github.com/Fullscreen/yt/blob/bf5c33b977cb162bb7735ad5b80d1abdb5a38215/lib/yt/request.rb#L77-L85 | train | Runs the request against the current request. | [
30522,
13366,
2448,
2065,
3503,
1035,
10908,
1029,
3433,
1012,
11112,
1063,
11968,
3366,
1035,
3433,
999,
1065,
3449,
5332,
2546,
2448,
1035,
2153,
1029,
2448,
2842,
5333,
3433,
1035,
7561,
1010,
7561,
1035,
4471,
1012,
2000,
1035,
1046,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/router.rb | ActiveAdmin.Router.define_actions | def define_actions(config)
router.member do
config.member_actions.each { |action| build_action(action) }
end
router.collection do
config.collection_actions.each { |action| build_action(action) }
router.post :batch_action if config.batch_actions_enabled?
end
end | ruby | def define_actions(config)
router.member do
config.member_actions.each { |action| build_action(action) }
end
router.collection do
config.collection_actions.each { |action| build_action(action) }
router.post :batch_action if config.batch_actions_enabled?
end
end | [
"def",
"define_actions",
"(",
"config",
")",
"router",
".",
"member",
"do",
"config",
".",
"member_actions",
".",
"each",
"{",
"|",
"action",
"|",
"build_action",
"(",
"action",
")",
"}",
"end",
"router",
".",
"collection",
"do",
"config",
".",
"collection... | Defines member and collection actions | [
"Defines",
"member",
"and",
"collection",
"actions"
] | 0759c8dcf97865748c9344459162ac3c7e65a6cd | https://github.com/activeadmin/activeadmin/blob/0759c8dcf97865748c9344459162ac3c7e65a6cd/lib/active_admin/router.rb#L75-L84 | train | Define the actions for the given config | [
30522,
13366,
9375,
1035,
4506,
1006,
9530,
8873,
2290,
1007,
2799,
2099,
1012,
2266,
2079,
9530,
8873,
2290,
1012,
2266,
1035,
4506,
1012,
2169,
1063,
1064,
2895,
1064,
3857,
1035,
2895,
1006,
2895,
1007,
1065,
2203,
2799,
2099,
1012,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/network_interface_tap_configurations.rb | Azure::Network::Mgmt::V2019_02_01.NetworkInterfaceTapConfigurations.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, network_interface_name, tap_configuration_name, custom_headers:nil)
begin_delete_async(resource_group_name, network_interface_name, tap_configuration_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, network_interface_name, tap_configuration_name, custom_headers:nil)
begin_delete_async(resource_group_name, network_interface_name, tap_configuration_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"tap_configuration_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"tap_configuration_name"... | Deletes the specified tap configuration from the NetworkInterface.
@param resource_group_name [String] The name of the resource group.
@param network_interface_name [String] The name of the network interface.
@param tap_configuration_name [String] The name of the tap configuration.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"the",
"specified",
"tap",
"configuration",
"from",
"the",
"NetworkInterface",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/network_interface_tap_configurations.rb#L326-L328 | train | Deletes a network interface tap configuration. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
8278,
1035,
2171,
1010,
11112,
1035,
9563,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jekyll/jekyll | lib/jekyll/static_file.rb | Jekyll.StaticFile.cleaned_relative_path | def cleaned_relative_path
@cleaned_relative_path ||= begin
cleaned = relative_path[0..-extname.length - 1]
cleaned.gsub!(%r!\.*\z!, "")
cleaned.sub!(@collection.relative_directory, "") if @collection
cleaned
end
end | ruby | def cleaned_relative_path
@cleaned_relative_path ||= begin
cleaned = relative_path[0..-extname.length - 1]
cleaned.gsub!(%r!\.*\z!, "")
cleaned.sub!(@collection.relative_directory, "") if @collection
cleaned
end
end | [
"def",
"cleaned_relative_path",
"@cleaned_relative_path",
"||=",
"begin",
"cleaned",
"=",
"relative_path",
"[",
"0",
"..",
"-",
"extname",
".",
"length",
"-",
"1",
"]",
"cleaned",
".",
"gsub!",
"(",
"%r!",
"\\.",
"\\z",
"!",
",",
"\"\"",
")",
"cleaned",
".... | Similar to Jekyll::Document#cleaned_relative_path.
Generates a relative path with the collection's directory removed when applicable
and additionally removes any multiple periods in the string.
NOTE: `String#gsub!` removes all trailing periods (in comparison to `String#chomp!`)
Examples:
When `relative_path` is "_methods/site/my-cool-avatar...png":
cleaned_relative_path
# => "/site/my-cool-avatar"
Returns the cleaned relative path of the static file. | [
"Similar",
"to",
"Jekyll",
"::",
"Document#cleaned_relative_path",
".",
"Generates",
"a",
"relative",
"path",
"with",
"the",
"collection",
"s",
"directory",
"removed",
"when",
"applicable",
"and",
"additionally",
"removes",
"any",
"multiple",
"periods",
"in",
"the",... | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/static_file.rb#L146-L153 | train | cleaned relative path | [
30522,
13366,
12176,
1035,
5816,
1035,
4130,
1030,
12176,
1035,
5816,
1035,
4130,
1064,
1064,
1027,
4088,
12176,
1027,
5816,
1035,
4130,
1031,
1014,
1012,
1012,
1011,
4654,
2102,
18442,
1012,
3091,
1011,
1015,
1033,
12176,
1012,
28177,
1208... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2017-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb | Azure::Compute::Mgmt::V2017_12_01.VirtualMachineScaleSetVMs.begin_reimage_with_http_info | def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end | ruby | def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
begin_reimage_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end | [
"def",
"begin_reimage_with_http_info",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"instance_id",
",",
"custom_headers",
":",
"nil",
")",
"begin_reimage_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"instance_id",
",",
"custom_headers",
... | Reimages (upgrade the operating system) a specific virtual machine 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 instance_id [String] The instance ID of the virtual machine.
@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. | [
"Reimages",
"(",
"upgrade",
"the",
"operating",
"system",
")",
"a",
"specific",
"virtual",
"machine",
"in",
"a",
"VM",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb#L799-L801 | train | Reimage a virtual machine in a VM scale set. | [
30522,
13366,
4088,
1035,
24964,
26860,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
6013,
1035,
8909,
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... |
mojombo/chronic | lib/chronic/handlers.rb | Chronic.Handlers.handle_p_s_r | def handle_p_s_r(tokens, options)
new_tokens = [tokens[1], tokens[2], tokens[0]]
handle_s_r_p(new_tokens, options)
end | ruby | def handle_p_s_r(tokens, options)
new_tokens = [tokens[1], tokens[2], tokens[0]]
handle_s_r_p(new_tokens, options)
end | [
"def",
"handle_p_s_r",
"(",
"tokens",
",",
"options",
")",
"new_tokens",
"=",
"[",
"tokens",
"[",
"1",
"]",
",",
"tokens",
"[",
"2",
"]",
",",
"tokens",
"[",
"0",
"]",
"]",
"handle_s_r_p",
"(",
"new_tokens",
",",
"options",
")",
"end"
] | Handle pointer/scalar/repeater | [
"Handle",
"pointer",
"/",
"scalar",
"/",
"repeater"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L462-L465 | train | Handle the p s r tokens | [
30522,
13366,
5047,
1035,
1052,
1035,
1055,
1035,
1054,
1006,
19204,
2015,
1010,
7047,
1007,
2047,
1035,
19204,
2015,
1027,
1031,
19204,
2015,
1031,
1015,
1033,
1010,
19204,
2015,
1031,
1016,
1033,
1010,
19204,
2015,
1031,
1014,
1033,
1033,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_service_info_list | def get_service_info_list(application_id, service_type_name:nil, continuation_token:nil, timeout:60, custom_headers:nil)
response = get_service_info_list_async(application_id, service_type_name:service_type_name, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_service_info_list(application_id, service_type_name:nil, continuation_token:nil, timeout:60, custom_headers:nil)
response = get_service_info_list_async(application_id, service_type_name:service_type_name, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_service_info_list",
"(",
"application_id",
",",
"service_type_name",
":",
"nil",
",",
"continuation_token",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_service_info_list_async",
"(",
"application_i... | Gets the information about all services belonging to the application
specified by the application id.
Returns the information about all services belonging to the application
specified by the application id.
@param application_id [String] The identity of the application. This is
typically the full name of the application without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the application name is "fabric:/myapp/app1", the application
identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions.
@param service_type_name [String] The service type name used to filter the
services to query for.
@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 [PagedServiceInfoList] operation results. | [
"Gets",
"the",
"information",
"about",
"all",
"services",
"belonging",
"to",
"the",
"application",
"specified",
"by",
"the",
"application",
"id",
"."
] | 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#L9691-L9694 | train | Gets the service info list for the specified application. | [
30522,
13366,
2131,
30524,
1006,
4646,
1035,
8909,
1010,
2326,
1035,
2828,
1035,
2171,
1024,
9152,
2140,
1010,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lostisland/faraday | lib/faraday/rack_builder.rb | Faraday.RackBuilder.insert | def insert(index, *args, &block)
raise_if_locked
index = assert_index(index)
handler = self.class::Handler.new(*args, &block)
@handlers.insert(index, handler)
end | ruby | def insert(index, *args, &block)
raise_if_locked
index = assert_index(index)
handler = self.class::Handler.new(*args, &block)
@handlers.insert(index, handler)
end | [
"def",
"insert",
"(",
"index",
",",
"*",
"args",
",",
"&",
"block",
")",
"raise_if_locked",
"index",
"=",
"assert_index",
"(",
"index",
")",
"handler",
"=",
"self",
".",
"class",
"::",
"Handler",
".",
"new",
"(",
"args",
",",
"block",
")",
"@handlers",... | methods to push onto the various positions in the stack: | [
"methods",
"to",
"push",
"onto",
"the",
"various",
"positions",
"in",
"the",
"stack",
":"
] | 3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70 | https://github.com/lostisland/faraday/blob/3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70/lib/faraday/rack_builder.rb#L119-L124 | train | Insert a handler at the given index. | [
30522,
13366,
19274,
1006,
5950,
1010,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
5333,
1035,
2065,
1035,
5299,
5950,
1027,
20865,
1035,
5950,
1006,
5950,
1007,
28213,
1027,
2969,
1012,
2465,
1024,
1024,
28213,
1012,
2047,
1006,
1008,
12098... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb | Aws::RDS.DBInstance.snapshots | def snapshots(options = {})
batches = Enumerator.new do |y|
options = options.merge(db_instance_identifier: @id)
resp = @client.describe_db_snapshots(options)
resp.each_page do |page|
batch = []
page.data.db_snapshots.each do |d|
batch << DBSnapshot.new(
instance_id: options[:db_instance_identifier],
snapshot_id: d.db_snapshot_identifier,
data: d,
client: @client
)
end
y.yield(batch)
end
end
DBSnapshot::Collection.new(batches)
end | ruby | def snapshots(options = {})
batches = Enumerator.new do |y|
options = options.merge(db_instance_identifier: @id)
resp = @client.describe_db_snapshots(options)
resp.each_page do |page|
batch = []
page.data.db_snapshots.each do |d|
batch << DBSnapshot.new(
instance_id: options[:db_instance_identifier],
snapshot_id: d.db_snapshot_identifier,
data: d,
client: @client
)
end
y.yield(batch)
end
end
DBSnapshot::Collection.new(batches)
end | [
"def",
"snapshots",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"options",
"=",
"options",
".",
"merge",
"(",
"db_instance_identifier",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"describe_db_snap... | @example Request syntax with placeholder values
snapshots = db_instance.snapshots({
db_snapshot_identifier: "String",
snapshot_type: "String",
filters: [
{
name: "String", # required
values: ["String"], # required
},
],
include_shared: false,
include_public: false,
dbi_resource_id: "String",
})
@param [Hash] options ({})
@option options [String] :db_snapshot_identifier
A specific DB snapshot identifier to describe. This parameter can't
be used in conjunction with `DBInstanceIdentifier`. This value is
stored as a lowercase string.
Constraints:
* If supplied, must match the identifier of an existing DBSnapshot.
* If this identifier is for an automated snapshot, the `SnapshotType`
parameter must also be specified.
@option options [String] :snapshot_type
The type of snapshots to be returned. You can specify one of the
following values:
* `automated` - Return all DB snapshots that have been automatically
taken by Amazon RDS for my AWS account.
* `manual` - Return all DB snapshots that have been taken by my AWS
account.
* `shared` - Return all manual DB snapshots that have been shared to
my AWS account.
* `public` - Return all DB snapshots that have been marked as public.
* `awsbackup` - Return the DB snapshots managed by the AWS Backup
service.
For information about AWS Backup, see the [ *AWS Backup Developer
Guide.* ][1]
The `awsbackup` type does not apply to Aurora.
If you don't specify a `SnapshotType` value, then both automated and
manual snapshots are returned. Shared and public DB snapshots are not
included in the returned results by default. You can include shared
snapshots with these results by setting the `IncludeShared` parameter
to `true`. You can include public snapshots with these results by
setting the `IncludePublic` parameter to `true`.
The `IncludeShared` and `IncludePublic` parameters don't apply for
`SnapshotType` values of `manual` or `automated`. The `IncludePublic`
parameter doesn't apply when `SnapshotType` is set to `shared`. The
`IncludeShared` parameter doesn't apply when `SnapshotType` is set to
`public`.
[1]: https://docs.aws.amazon.com/aws-backup/latest/devguide/whatisbackup.html
@option options [Array<Types::Filter>] :filters
This parameter is not currently supported.
@option options [Boolean] :include_shared
True to include shared manual DB snapshots from other AWS accounts
that this AWS account has been given permission to copy or restore,
and otherwise false. The default is `false`.
You can give an AWS account permission to restore a manual DB snapshot
from another AWS account by using the ModifyDBSnapshotAttribute API
action.
@option options [Boolean] :include_public
True to include manual DB snapshots that are public and can be copied
or restored by any AWS account, and otherwise false. The default is
false.
You can share a manual DB snapshot as public by using the
ModifyDBSnapshotAttribute API.
@option options [String] :dbi_resource_id
A specific DB resource ID to describe.
@return [DBSnapshot::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb#L3157-L3175 | train | Returns a collection of DBSnapshots | [
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,
7047,
1012,
13590,
1006,
16962,
1035,
6013,
1035,
8909,
4765,
18095,
1024,
1030,
89... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elastic/apm-agent-ruby | lib/elastic_apm/instrumenter.rb | ElasticAPM.Instrumenter.start_transaction | def start_transaction(
name = nil,
type = nil,
context: nil,
trace_context: nil
)
return nil unless config.instrument?
if (transaction = current_transaction)
raise ExistingTransactionError,
"Transactions may not be nested.\nAlready inside #{transaction}"
end
sampled = trace_context ? trace_context.recorded? : random_sample?
transaction =
Transaction.new(
name,
type,
context: context,
trace_context: trace_context,
sampled: sampled,
tags: config.default_tags
)
transaction.start
self.current_transaction = transaction
end | ruby | def start_transaction(
name = nil,
type = nil,
context: nil,
trace_context: nil
)
return nil unless config.instrument?
if (transaction = current_transaction)
raise ExistingTransactionError,
"Transactions may not be nested.\nAlready inside #{transaction}"
end
sampled = trace_context ? trace_context.recorded? : random_sample?
transaction =
Transaction.new(
name,
type,
context: context,
trace_context: trace_context,
sampled: sampled,
tags: config.default_tags
)
transaction.start
self.current_transaction = transaction
end | [
"def",
"start_transaction",
"(",
"name",
"=",
"nil",
",",
"type",
"=",
"nil",
",",
"context",
":",
"nil",
",",
"trace_context",
":",
"nil",
")",
"return",
"nil",
"unless",
"config",
".",
"instrument?",
"if",
"(",
"transaction",
"=",
"current_transaction",
... | rubocop:disable Metrics/MethodLength | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"MethodLength"
] | 82190d1a9ba22af3b2c2c6fe6d23cc471f2e7ff6 | https://github.com/elastic/apm-agent-ruby/blob/82190d1a9ba22af3b2c2c6fe6d23cc471f2e7ff6/lib/elastic_apm/instrumenter.rb#L82-L110 | train | Start a new transaction | [
30522,
13366,
2707,
1035,
12598,
1006,
2171,
1027,
9152,
2140,
1010,
2828,
1027,
9152,
2140,
1010,
6123,
1024,
9152,
2140,
1010,
7637,
1035,
6123,
1024,
9152,
2140,
1007,
2709,
9152,
2140,
4983,
9530,
8873,
2290,
1012,
6602,
1029,
2065,
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... |
refile/refile | lib/refile/file.rb | Refile.File.download | def download
return io if io.is_a?(Tempfile)
Tempfile.new(id, binmode: true).tap do |tempfile|
IO.copy_stream(io, tempfile)
tempfile.rewind
tempfile.fsync
end
end | ruby | def download
return io if io.is_a?(Tempfile)
Tempfile.new(id, binmode: true).tap do |tempfile|
IO.copy_stream(io, tempfile)
tempfile.rewind
tempfile.fsync
end
end | [
"def",
"download",
"return",
"io",
"if",
"io",
".",
"is_a?",
"(",
"Tempfile",
")",
"Tempfile",
".",
"new",
"(",
"id",
",",
"binmode",
":",
"true",
")",
".",
"tap",
"do",
"|",
"tempfile",
"|",
"IO",
".",
"copy_stream",
"(",
"io",
",",
"tempfile",
")... | Downloads the file to a Tempfile on disk and returns this tempfile.
@example
file = backend.upload(StringIO.new("hello"))
tempfile = file.download
File.read(tempfile.path) # => "hello"
@return [Tempfile] a tempfile with the file's content | [
"Downloads",
"the",
"file",
"to",
"a",
"Tempfile",
"on",
"disk",
"and",
"returns",
"this",
"tempfile",
"."
] | e910f5ca5a9060c307bd0a5e813f1fec73219ed5 | https://github.com/refile/refile/blob/e910f5ca5a9060c307bd0a5e813f1fec73219ed5/lib/refile/file.rb#L69-L77 | train | Download the image from the specified file. | [
30522,
13366,
8816,
2709,
22834,
2065,
22834,
1012,
2003,
1035,
1037,
1029,
1006,
8915,
8737,
8873,
2571,
1007,
8915,
8737,
8873,
2571,
1012,
2047,
1006,
8909,
1010,
8026,
5302,
3207,
1024,
2995,
1007,
1012,
11112,
2079,
1064,
8915,
8737,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_multi_role_metrics_with_http_info | def list_multi_role_metrics_with_http_info(resource_group_name, name, start_time:nil, end_time:nil, time_grain:nil, details:nil, filter:nil, custom_headers:nil)
list_multi_role_metrics_async(resource_group_name, name, start_time:start_time, end_time:end_time, time_grain:time_grain, details:details, filter:filter, custom_headers:custom_headers).value!
end | ruby | def list_multi_role_metrics_with_http_info(resource_group_name, name, start_time:nil, end_time:nil, time_grain:nil, details:nil, filter:nil, custom_headers:nil)
list_multi_role_metrics_async(resource_group_name, name, start_time:start_time, end_time:end_time, time_grain:time_grain, details:details, filter:filter, custom_headers:custom_headers).value!
end | [
"def",
"list_multi_role_metrics_with_http_info",
"(",
"resource_group_name",
",",
"name",
",",
"start_time",
":",
"nil",
",",
"end_time",
":",
"nil",
",",
"time_grain",
":",
"nil",
",",
"details",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"custom_headers",
"... | Get metrics for a multi-role pool of an App Service Environment.
Get metrics for a multi-role pool of an App Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param start_time [String] Beginning time of the metrics query.
@param end_time [String] End time of the metrics query.
@param time_grain [String] Time granularity of the metrics query.
@param details [Boolean] Specify <code>true</code> to include instance
details. The default is <code>false</code>.
@param filter [String] Return only usages/metrics specified in the filter.
Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime eq
2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Get",
"metrics",
"for",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L2058-L2060 | train | Gets metrics for a multi - role group. | [
30522,
13366,
2862,
1035,
4800,
1035,
2535,
1035,
12046,
2015,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
2707,
1035,
2051,
1024,
9152,
2140,
1010,
2203,
1035,
2051,
1024,
9152,
2140,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.create_image_regions | def create_image_regions(project_id, batch, custom_headers:nil)
response = create_image_regions_async(project_id, batch, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_image_regions(project_id, batch, custom_headers:nil)
response = create_image_regions_async(project_id, batch, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_image_regions",
"(",
"project_id",
",",
"batch",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_image_regions_async",
"(",
"project_id",
",",
"batch",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"... | Create a set of image regions.
This API accepts a batch of image regions, and optionally tags, to update
existing images with region information.
There is a limit of 64 entries in the batch.
@param project_id The project id.
@param batch [ImageRegionCreateBatch] Batch of image regions which include a
tag and bounding box. Limited to 64.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ImageRegionCreateSummary] operation results. | [
"Create",
"a",
"set",
"of",
"image",
"regions",
"."
] | 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#L745-L748 | train | Creates an image region for the specified project. | [
30522,
13366,
3443,
1035,
3746,
1035,
4655,
1006,
2622,
1035,
8909,
1010,
14108,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
CocoaPods/Xcodeproj | lib/xcodeproj/project.rb | Xcodeproj.Project.save | def save(save_path = nil)
save_path ||= path
@dirty = false if save_path == path
FileUtils.mkdir_p(save_path)
file = File.join(save_path, 'project.pbxproj')
Atomos.atomic_write(file) do |f|
Nanaimo::Writer::PBXProjWriter.new(to_ascii_plist, :pretty => true, :output => f, :strict => false).write
end
end | ruby | def save(save_path = nil)
save_path ||= path
@dirty = false if save_path == path
FileUtils.mkdir_p(save_path)
file = File.join(save_path, 'project.pbxproj')
Atomos.atomic_write(file) do |f|
Nanaimo::Writer::PBXProjWriter.new(to_ascii_plist, :pretty => true, :output => f, :strict => false).write
end
end | [
"def",
"save",
"(",
"save_path",
"=",
"nil",
")",
"save_path",
"||=",
"path",
"@dirty",
"=",
"false",
"if",
"save_path",
"==",
"path",
"FileUtils",
".",
"mkdir_p",
"(",
"save_path",
")",
"file",
"=",
"File",
".",
"join",
"(",
"save_path",
",",
"'project.... | Serializes the project in the xcodeproj format using the path provided
during initialization or the given path (`xcodeproj` file). If a path is
provided file references depending on the root of the project are not
updated automatically, thus clients are responsible to perform any needed
modification before saving.
@param [String, Pathname] path
The optional path where the project should be saved.
@example Saving a project
project.save
project.save
@return [void] | [
"Serializes",
"the",
"project",
"in",
"the",
"xcodeproj",
"format",
"using",
"the",
"path",
"provided",
"during",
"initialization",
"or",
"the",
"given",
"path",
"(",
"xcodeproj",
"file",
")",
".",
"If",
"a",
"path",
"is",
"provided",
"file",
"references",
"... | 3be1684437a6f8e69c7836ad4c85a2b78663272f | https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/lib/xcodeproj/project.rb#L358-L366 | train | Save the project to a file | [
30522,
13366,
3828,
1006,
3828,
1035,
4130,
1027,
9152,
2140,
1007,
3828,
1035,
4130,
1064,
1064,
1027,
4130,
1030,
6530,
1027,
6270,
2065,
3828,
1035,
4130,
1027,
1027,
4130,
5371,
21823,
4877,
1012,
12395,
4305,
2099,
1035,
1052,
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/module_tool/metadata.rb | Puppet::ModuleTool.Metadata.update | def update(data)
process_name(data) if data['name']
process_version(data) if data['version']
process_source(data) if data['source']
process_data_provider(data) if data['data_provider']
merge_dependencies(data) if data['dependencies']
@data.merge!(data)
return self
end | ruby | def update(data)
process_name(data) if data['name']
process_version(data) if data['version']
process_source(data) if data['source']
process_data_provider(data) if data['data_provider']
merge_dependencies(data) if data['dependencies']
@data.merge!(data)
return self
end | [
"def",
"update",
"(",
"data",
")",
"process_name",
"(",
"data",
")",
"if",
"data",
"[",
"'name'",
"]",
"process_version",
"(",
"data",
")",
"if",
"data",
"[",
"'version'",
"]",
"process_source",
"(",
"data",
")",
"if",
"data",
"[",
"'source'",
"]",
"pr... | Merges the current set of metadata with another metadata hash. This
method also handles the validation of module names and versions, in an
effort to be proactive about module publishing constraints. | [
"Merges",
"the",
"current",
"set",
"of",
"metadata",
"with",
"another",
"metadata",
"hash",
".",
"This",
"method",
"also",
"handles",
"the",
"validation",
"of",
"module",
"names",
"and",
"versions",
"in",
"an",
"effort",
"to",
"be",
"proactive",
"about",
"mo... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/module_tool/metadata.rb#L51-L60 | train | Update the data in the object | [
30522,
13366,
10651,
1006,
2951,
1007,
2832,
1035,
2171,
1006,
2951,
1007,
2065,
2951,
1031,
1005,
2171,
1005,
1033,
2832,
1035,
2544,
1006,
2951,
1007,
2065,
2951,
1031,
1005,
2544,
1005,
1033,
2832,
1035,
3120,
1006,
2951,
1007,
2065,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb | Azure::Network::Mgmt::V2019_02_01.ApplicationGateways.begin_stop | def begin_stop(resource_group_name, application_gateway_name, custom_headers:nil)
response = begin_stop_async(resource_group_name, application_gateway_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_stop(resource_group_name, application_gateway_name, custom_headers:nil)
response = begin_stop_async(resource_group_name, application_gateway_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_stop",
"(",
"resource_group_name",
",",
"application_gateway_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_stop_async",
"(",
"resource_group_name",
",",
"application_gateway_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Stops the specified application gateway in a resource group.
@param resource_group_name [String] The name of the resource group.
@param application_gateway_name [String] The name of the application gateway.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Stops",
"the",
"specified",
"application",
"gateway",
"in",
"a",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb#L1622-L1625 | train | Stops an application gateway in a resource group. | [
30522,
13366,
4088,
1035,
2644,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4646,
1035,
11909,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
2644,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mhenrixon/sidekiq-unique-jobs | lib/sidekiq_unique_jobs/scripts.rb | SidekiqUniqueJobs.Scripts.call | def call(file_name, redis_pool, options = {})
execute_script(file_name, redis_pool, options)
rescue Redis::CommandError => ex
handle_error(ex, file_name) do
call(file_name, redis_pool, options)
end
end | ruby | def call(file_name, redis_pool, options = {})
execute_script(file_name, redis_pool, options)
rescue Redis::CommandError => ex
handle_error(ex, file_name) do
call(file_name, redis_pool, options)
end
end | [
"def",
"call",
"(",
"file_name",
",",
"redis_pool",
",",
"options",
"=",
"{",
"}",
")",
"execute_script",
"(",
"file_name",
",",
"redis_pool",
",",
"options",
")",
"rescue",
"Redis",
"::",
"CommandError",
"=>",
"ex",
"handle_error",
"(",
"ex",
",",
"file_n... | Call a lua script with the provided file_name
@note this method is recursive if we need to load a lua script
that wasn't previously loaded.
@param [Symbol] file_name the name of the lua script
@param [Sidekiq::RedisConnection, ConnectionPool] redis_pool the redis connection
@param [Hash] options arguments to pass to the script file
@option options [Array] :keys the array of keys to pass to the script
@option options [Array] :argv the array of arguments to pass to the script
@return value from script | [
"Call",
"a",
"lua",
"script",
"with",
"the",
"provided",
"file_name"
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/scripts.rb#L33-L39 | train | Execute a script | [
30522,
13366,
2655,
1006,
5371,
1035,
2171,
1010,
2417,
2483,
1035,
4770,
1010,
7047,
1027,
1063,
1065,
1007,
15389,
1035,
5896,
1006,
5371,
1035,
2171,
1010,
2417,
2483,
1035,
4770,
1010,
7047,
1007,
5343,
2417,
2483,
1024,
1024,
3474,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
k1LoW/awspec | lib/awspec/helper/client_wrap.rb | Awspec::Helper.ClientWrap.method_missing | def method_missing(m, *args, &block)
begin
results = client.send(m, *args, &block)
rescue Exception => e # rubocop:disable Lint/RescueException
raise unless e.class.to_s == symbol.to_s && backoff < backoff_limit
@backoff = backoff + (iteration * iteration * 0.5)
@iteration += 1
sleep backoff
results = self.send(m, *args, &block)
end
reset_backoff
results
end | ruby | def method_missing(m, *args, &block)
begin
results = client.send(m, *args, &block)
rescue Exception => e # rubocop:disable Lint/RescueException
raise unless e.class.to_s == symbol.to_s && backoff < backoff_limit
@backoff = backoff + (iteration * iteration * 0.5)
@iteration += 1
sleep backoff
results = self.send(m, *args, &block)
end
reset_backoff
results
end | [
"def",
"method_missing",
"(",
"m",
",",
"*",
"args",
",",
"&",
"block",
")",
"begin",
"results",
"=",
"client",
".",
"send",
"(",
"m",
",",
"args",
",",
"block",
")",
"rescue",
"Exception",
"=>",
"e",
"# rubocop:disable Lint/RescueException",
"raise",
"unl... | used to capture only the "RequestLimitExceeded" error from an aws
client api call. In the case of matching it we want to try again,
backing off successively each time, until the backoff_limit is reached or
exceeded, in which case, the error will be re-raised and it should fail
as expected. | [
"used",
"to",
"capture",
"only",
"the",
"RequestLimitExceeded",
"error",
"from",
"an",
"aws",
"client",
"api",
"call",
".",
"In",
"the",
"case",
"of",
"matching",
"it",
"we",
"want",
"to",
"try",
"again",
"backing",
"off",
"successively",
"each",
"time",
"... | d33365040c42c79fa4c8233451d7fe8f24f2c503 | https://github.com/k1LoW/awspec/blob/d33365040c42c79fa4c8233451d7fe8f24f2c503/lib/awspec/helper/client_wrap.rb#L24-L39 | train | Calls the method on the underlying connection. | [
30522,
13366,
4118,
1035,
4394,
1006,
1049,
1010,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
4088,
3463,
1027,
7396,
1012,
4604,
1006,
1049,
1010,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
5343,
6453,
1027,
1028,
1041,
1001,
14548,
24163,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/socket.rb | Mongo.Socket.read | def read(length)
handle_errors do
data = read_from_socket(length)
raise IOError unless (data.length > 0 || length == 0)
while data.length < length
chunk = read_from_socket(length - data.length)
raise IOError unless (chunk.length > 0 || length == 0)
data << chunk
end
data
end
end | ruby | def read(length)
handle_errors do
data = read_from_socket(length)
raise IOError unless (data.length > 0 || length == 0)
while data.length < length
chunk = read_from_socket(length - data.length)
raise IOError unless (chunk.length > 0 || length == 0)
data << chunk
end
data
end
end | [
"def",
"read",
"(",
"length",
")",
"handle_errors",
"do",
"data",
"=",
"read_from_socket",
"(",
"length",
")",
"raise",
"IOError",
"unless",
"(",
"data",
".",
"length",
">",
"0",
"||",
"length",
"==",
"0",
")",
"while",
"data",
".",
"length",
"<",
"len... | Create the new socket for the provided family - ipv4, piv6, or unix.
@example Create a new ipv4 socket.
Socket.new(Socket::PF_INET)
@param [ Integer ] family The socket domain.
@since 2.0.0
Will read all data from the socket for the provided number of bytes.
If no data is returned, an exception will be raised.
@example Read all the requested data from the socket.
socket.read(4096)
@param [ Integer ] length The number of bytes to read.
@raise [ Mongo::SocketError ] If not all data is returned.
@return [ Object ] The data from the socket.
@since 2.0.0 | [
"Create",
"the",
"new",
"socket",
"for",
"the",
"provided",
"family",
"-",
"ipv4",
"piv6",
"or",
"unix",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/socket.rb#L123-L134 | train | Reads a chunk of the file from the socket. | [
30522,
13366,
3191,
1006,
3091,
1007,
5047,
1035,
10697,
2079,
2951,
1027,
3191,
1035,
2013,
1035,
22278,
1006,
3091,
1007,
5333,
22834,
2121,
29165,
4983,
1006,
2951,
1012,
3091,
1028,
1014,
1064,
1064,
3091,
1027,
1027,
1014,
1007,
2096,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
magnusvk/counter_culture | lib/counter_culture/counter.rb | CounterCulture.Counter.relation_primary_key | def relation_primary_key(relation, source: nil, was: false)
reflect = relation_reflect(relation)
klass = nil
if reflect.options.key?(:polymorphic)
raise "can't handle multiple keys with polymorphic associations" unless (relation.is_a?(Symbol) || relation.length == 1)
raise "must specify source for polymorphic associations..." unless source
return relation_klass(relation, source: source, was: was).try(:primary_key)
end
reflect.association_primary_key(klass)
end | ruby | def relation_primary_key(relation, source: nil, was: false)
reflect = relation_reflect(relation)
klass = nil
if reflect.options.key?(:polymorphic)
raise "can't handle multiple keys with polymorphic associations" unless (relation.is_a?(Symbol) || relation.length == 1)
raise "must specify source for polymorphic associations..." unless source
return relation_klass(relation, source: source, was: was).try(:primary_key)
end
reflect.association_primary_key(klass)
end | [
"def",
"relation_primary_key",
"(",
"relation",
",",
"source",
":",
"nil",
",",
"was",
":",
"false",
")",
"reflect",
"=",
"relation_reflect",
"(",
"relation",
")",
"klass",
"=",
"nil",
"if",
"reflect",
".",
"options",
".",
"key?",
"(",
":polymorphic",
")",... | gets the primary key name of the given relation
relation: a symbol or array of symbols; specifies the relation
that has the counter cache column
source[optional]: the model instance that the relationship is linked from,
only needed for polymorphic associations,
probably only works with a single relation (symbol, or array of 1 symbol)
was: boolean
we're actually looking for the old value -- only can change for polymorphic relations | [
"gets",
"the",
"primary",
"key",
"name",
"of",
"the",
"given",
"relation"
] | 6b5bd4d6e1ee4f10f262ace7cfed5776af9520ba | https://github.com/magnusvk/counter_culture/blob/6b5bd4d6e1ee4f10f262ace7cfed5776af9520ba/lib/counter_culture/counter.rb#L247-L256 | train | Returns the primary key for the given relation | [
30522,
13366,
30524,
3145,
1006,
7189,
1010,
3120,
1024,
9152,
2140,
1010,
2001,
1024,
6270,
1007,
8339,
1027,
7189,
1035,
8339,
1006,
7189,
1007,
1047,
27102,
1027,
9152,
2140,
2065,
8339,
1012,
7047,
1012,
3145,
1029,
1006,
1024,
26572,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
palkan/logidze | lib/logidze/model.rb | Logidze.Model.switch_to! | def switch_to!(version, append: Logidze.append_on_undo)
return false unless at_version(version)
if append && version < log_version
update!(log_data.changes_to(version: version))
else
at_version!(version)
self.class.without_logging { save! }
end
end | ruby | def switch_to!(version, append: Logidze.append_on_undo)
return false unless at_version(version)
if append && version < log_version
update!(log_data.changes_to(version: version))
else
at_version!(version)
self.class.without_logging { save! }
end
end | [
"def",
"switch_to!",
"(",
"version",
",",
"append",
":",
"Logidze",
".",
"append_on_undo",
")",
"return",
"false",
"unless",
"at_version",
"(",
"version",
")",
"if",
"append",
"&&",
"version",
"<",
"log_version",
"update!",
"(",
"log_data",
".",
"changes_to",
... | Restore record to the specified version.
Return false if version is unknown. | [
"Restore",
"record",
"to",
"the",
"specified",
"version",
".",
"Return",
"false",
"if",
"version",
"is",
"unknown",
"."
] | ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8 | https://github.com/palkan/logidze/blob/ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8/lib/logidze/model.rb#L167-L176 | train | switch to a new version of the log | [
30522,
13366,
6942,
1035,
2000,
999,
1006,
2544,
1010,
10439,
10497,
1024,
8833,
3593,
4371,
1012,
10439,
10497,
1035,
2006,
1035,
25672,
1007,
2709,
6270,
4983,
2012,
1035,
2544,
1006,
2544,
1007,
2065,
10439,
10497,
1004,
1004,
2544,
1026... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
roo-rb/roo | lib/roo/utils.rb | Roo.Utils.number_to_letter | def number_to_letter(num)
result = +""
until num.zero?
num, index = (num - 1).divmod(26)
result.prepend(LETTERS[index])
end
result
end | ruby | def number_to_letter(num)
result = +""
until num.zero?
num, index = (num - 1).divmod(26)
result.prepend(LETTERS[index])
end
result
end | [
"def",
"number_to_letter",
"(",
"num",
")",
"result",
"=",
"+",
"\"\"",
"until",
"num",
".",
"zero?",
"num",
",",
"index",
"=",
"(",
"num",
"-",
"1",
")",
".",
"divmod",
"(",
"26",
")",
"result",
".",
"prepend",
"(",
"LETTERS",
"[",
"index",
"]",
... | convert a number to something like 'AB' (1 => 'A', 2 => 'B', ...) | [
"convert",
"a",
"number",
"to",
"something",
"like",
"AB",
"(",
"1",
"=",
">",
"A",
"2",
"=",
">",
"B",
"...",
")"
] | 4ec1104f0c3c2a29711c0c907371cd2be12bcc3c | https://github.com/roo-rb/roo/blob/4ec1104f0c3c2a29711c0c907371cd2be12bcc3c/lib/roo/utils.rb#L45-L54 | train | Convert a number to a letter | [
30522,
13366,
2193,
1035,
2000,
1035,
3661,
1006,
16371,
2213,
1007,
2765,
1027,
1009,
1000,
1000,
2127,
16371,
2213,
1012,
5717,
1029,
16371,
2213,
1010,
5950,
1027,
1006,
16371,
2213,
1011,
1015,
1007,
1012,
4487,
2615,
5302,
2094,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | 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_chaos_events | def get_chaos_events(continuation_token:nil, start_time_utc:nil, end_time_utc:nil, max_results:0, timeout:60, custom_headers:nil)
response = get_chaos_events_async(continuation_token:continuation_token, start_time_utc:start_time_utc, end_time_utc:end_time_utc, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_chaos_events(continuation_token:nil, start_time_utc:nil, end_time_utc:nil, max_results:0, timeout:60, custom_headers:nil)
response = get_chaos_events_async(continuation_token:continuation_token, start_time_utc:start_time_utc, end_time_utc:end_time_utc, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_chaos_events",
"(",
"continuation_token",
":",
"nil",
",",
"start_time_utc",
":",
"nil",
",",
"end_time_utc",
":",
"nil",
",",
"max_results",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_chaos... | Gets the next segment of the Chaos events based on the continuation token or
the time range.
To get the next segment of the Chaos events, you can specify the
ContinuationToken. To get the start of a new segment of Chaos events, you can
specify the time range
through StartTimeUtc and EndTimeUtc. You cannot specify both the
ContinuationToken and the time range in the same call.
When there are more than 100 Chaos events, the Chaos events are returned in
multiple segments where a segment contains no more than 100 Chaos events and
to get the next segment you make a call to this API with the continuation
token.
@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 start_time_utc [String] The Windows file time representing the start
time of the time range for which a Chaos report is to be generated. Please
consult [DateTime.ToFileTimeUtc
Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx)
for details.
@param end_time_utc [String] The Windows file time representing the end time
of the time range for which a Chaos report is to be generated. Please consult
[DateTime.ToFileTimeUtc
Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx)
for details.
@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 [ChaosEventsSegment] operation results. | [
"Gets",
"the",
"next",
"segment",
"of",
"the",
"Chaos",
"events",
"based",
"on",
"the",
"continuation",
"token",
"or",
"the",
"time",
"range",
"."
] | 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#L18792-L18795 | train | Gets the chaos events for a given Continuation Token. | [
30522,
13366,
2131,
1035,
8488,
1035,
2824,
1006,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
2707,
1035,
2051,
1035,
11396,
1024,
9152,
2140,
1010,
2203,
1035,
2051,
1035,
11396,
1024,
9152,
2140,
1010,
4098,
1035,
3463,
1024,
1014,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/runs.rb | Azure::ContainerRegistry::Mgmt::V2018_09_01.Runs.begin_cancel | def begin_cancel(resource_group_name, registry_name, run_id, custom_headers:nil)
response = begin_cancel_async(resource_group_name, registry_name, run_id, custom_headers:custom_headers).value!
nil
end | ruby | def begin_cancel(resource_group_name, registry_name, run_id, custom_headers:nil)
response = begin_cancel_async(resource_group_name, registry_name, run_id, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_cancel",
"(",
"resource_group_name",
",",
"registry_name",
",",
"run_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_cancel_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"run_id",
",",
"custom_headers",
":custom_head... | Cancel an existing run.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param run_id [String] The run ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Cancel",
"an",
"existing",
"run",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2018-09-01/generated/azure_mgmt_container_registry/runs.rb#L569-L572 | train | Cancels a run. | [
30522,
13366,
4088,
1035,
17542,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
2448,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
17542,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.recover_partition | def recover_partition(partition_id, timeout:60, custom_headers:nil)
response = recover_partition_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def recover_partition(partition_id, timeout:60, custom_headers:nil)
response = recover_partition_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"recover_partition",
"(",
"partition_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"recover_partition_async",
"(",
"partition_id",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".",... | Indicates to the Service Fabric cluster that it should attempt to recover a
specific partition which is currently stuck in quorum loss.
Indicates to the Service Fabric cluster that it should attempt to recover a
specific partition which is currently stuck in quorum loss. This operation
should only be performed if it is known that the replicas that are down
cannot be recovered. Incorrect use of this API can cause potential data loss.
@param partition_id The identity of the partition.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Indicates",
"to",
"the",
"Service",
"Fabric",
"cluster",
"that",
"it",
"should",
"attempt",
"to",
"recover",
"a",
"specific",
"partition",
"which",
"is",
"currently",
"stuck",
"in",
"quorum",
"loss",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L13188-L13191 | train | Recover the specified partition. | [
30522,
13366,
8980,
1035,
13571,
1006,
13571,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
8980,
1035,
13571,
1035,
2004,
6038,
2278,
1006,
13571,
1035,
8909,
1010,
2051,
5833,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kmuto/review | lib/review/compiler.rb | ReVIEW.Compiler.compile_inline | def compile_inline(str)
op, arg = /\A@<(\w+)>\{(.*?)\}\z/.match(str).captures
unless inline_defined?(op)
raise CompileError, "no such inline op: #{op}"
end
unless @strategy.respond_to?("inline_#{op}")
raise "strategy does not support inline op: @<#{op}>"
end
@strategy.__send__("inline_#{op}", arg)
rescue => e
error e.message
@strategy.nofunc_text(str)
end | ruby | def compile_inline(str)
op, arg = /\A@<(\w+)>\{(.*?)\}\z/.match(str).captures
unless inline_defined?(op)
raise CompileError, "no such inline op: #{op}"
end
unless @strategy.respond_to?("inline_#{op}")
raise "strategy does not support inline op: @<#{op}>"
end
@strategy.__send__("inline_#{op}", arg)
rescue => e
error e.message
@strategy.nofunc_text(str)
end | [
"def",
"compile_inline",
"(",
"str",
")",
"op",
",",
"arg",
"=",
"/",
"\\A",
"\\w",
"\\{",
"\\}",
"\\z",
"/",
".",
"match",
"(",
"str",
")",
".",
"captures",
"unless",
"inline_defined?",
"(",
"op",
")",
"raise",
"CompileError",
",",
"\"no such inline op:... | called from strategy | [
"called",
"from",
"strategy"
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/review/compiler.rb#L572-L584 | train | compile inline string | [
30522,
13366,
4012,
22090,
1035,
23881,
1006,
2358,
2099,
1007,
6728,
1010,
12098,
2290,
1027,
1013,
1032,
1037,
1030,
1026,
1006,
1032,
1059,
1009,
1007,
1028,
1032,
1063,
1006,
1012,
1008,
1029,
1007,
1032,
1065,
1032,
1062,
1013,
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_sql/lib/2014-04-01/generated/azure_mgmt_sql/replication_links.rb | Azure::SQL::Mgmt::V2014_04_01.ReplicationLinks.failover_async | def failover_async(resource_group_name, server_name, database_name, link_id, custom_headers:nil)
# Send request
promise = begin_failover_async(resource_group_name, server_name, database_name, link_id, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def failover_async(resource_group_name, server_name, database_name, link_id, custom_headers:nil)
# Send request
promise = begin_failover_async(resource_group_name, server_name, database_name, link_id, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"failover_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"link_id",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_failover_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"datab... | @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 that has the
replication link to be failed over.
@param link_id [String] The ID of the replication link to be failed over.
@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",
"that",
"contains",
"the",
"resource",
".",
"You",
"can",
"obtain",
"this",
"value",
"from",
"the",
"Azure",
"Resource",
"Manager",
"API",
"or",
"the",
"por... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/replication_links.rb#L264-L278 | train | Gets the failover of the specified database link. | [
30522,
13366,
8246,
7840,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
4957,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.delete_prediction | def delete_prediction(project_id, ids, custom_headers:nil)
response = delete_prediction_async(project_id, ids, custom_headers:custom_headers).value!
nil
end | ruby | def delete_prediction(project_id, ids, custom_headers:nil)
response = delete_prediction_async(project_id, ids, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete_prediction",
"(",
"project_id",
",",
"ids",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_prediction_async",
"(",
"project_id",
",",
"ids",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Delete a set of predicted images and their associated prediction results.
@param project_id The project id.
@param ids The prediction ids. Limited to 64.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"a",
"set",
"of",
"predicted",
"images",
"and",
"their",
"associated",
"prediction",
"results",
"."
] | 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#L2019-L2022 | train | Deletes a list of prediction features. | [
30522,
13366,
3972,
12870,
1035,
17547,
1006,
2622,
1035,
8909,
1010,
8909,
2015,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
17547,
1035,
2004,
6038,
2278,
1006,
2622,
1035,
8909,
1010,
8909,
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... |
meew0/discordrb | lib/discordrb/voice/voice_bot.rb | Discordrb::Voice.VoiceBot.play_dca | def play_dca(file)
stop_playing(true) if @playing
@bot.debug "Reading DCA file #{file}"
input_stream = File.open(file)
magic = input_stream.read(4)
raise ArgumentError, 'Not a DCA1 file! The file might have been corrupted, please recreate it.' unless magic == 'DCA1'
# Read the metadata header, then read the metadata and discard it as we don't care about it
metadata_header = input_stream.read(4).unpack1('l<')
input_stream.read(metadata_header)
# Play the data, without re-encoding it to opus
play_internal do
begin
# Read header
header_str = input_stream.read(2)
unless header_str
@bot.debug 'Finished DCA parsing (header is nil)'
next :stop
end
header = header_str.unpack1('s<')
raise 'Negative header in DCA file! Your file is likely corrupted.' if header.negative?
rescue EOFError
@bot.debug 'Finished DCA parsing (EOFError)'
next :stop
end
# Read bytes
input_stream.read(header)
end
end | ruby | def play_dca(file)
stop_playing(true) if @playing
@bot.debug "Reading DCA file #{file}"
input_stream = File.open(file)
magic = input_stream.read(4)
raise ArgumentError, 'Not a DCA1 file! The file might have been corrupted, please recreate it.' unless magic == 'DCA1'
# Read the metadata header, then read the metadata and discard it as we don't care about it
metadata_header = input_stream.read(4).unpack1('l<')
input_stream.read(metadata_header)
# Play the data, without re-encoding it to opus
play_internal do
begin
# Read header
header_str = input_stream.read(2)
unless header_str
@bot.debug 'Finished DCA parsing (header is nil)'
next :stop
end
header = header_str.unpack1('s<')
raise 'Negative header in DCA file! Your file is likely corrupted.' if header.negative?
rescue EOFError
@bot.debug 'Finished DCA parsing (EOFError)'
next :stop
end
# Read bytes
input_stream.read(header)
end
end | [
"def",
"play_dca",
"(",
"file",
")",
"stop_playing",
"(",
"true",
")",
"if",
"@playing",
"@bot",
".",
"debug",
"\"Reading DCA file #{file}\"",
"input_stream",
"=",
"File",
".",
"open",
"(",
"file",
")",
"magic",
"=",
"input_stream",
".",
"read",
"(",
"4",
... | Plays a stream of audio data in the DCA format. This format has the advantage that no recoding has to be
done - the file contains the data exactly as Discord needs it.
@note DCA playback will not be affected by the volume modifier ({#volume}) because the modifier operates on raw
PCM, not opus data. Modifying the volume of DCA data would involve decoding it, multiplying the samples and
re-encoding it, which defeats its entire purpose (no recoding).
@see https://github.com/bwmarrin/dca
@see #play | [
"Plays",
"a",
"stream",
"of",
"audio",
"data",
"in",
"the",
"DCA",
"format",
".",
"This",
"format",
"has",
"the",
"advantage",
"that",
"no",
"recoding",
"has",
"to",
"be",
"done",
"-",
"the",
"file",
"contains",
"the",
"data",
"exactly",
"as",
"Discord",... | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/voice/voice_bot.rb#L255-L290 | train | play a DCA file | [
30522,
13366,
2377,
1035,
5887,
2050,
1006,
5371,
1007,
2644,
1035,
2652,
1006,
2995,
1007,
2065,
1030,
2652,
1030,
28516,
1012,
2139,
8569,
2290,
1000,
3752,
5887,
2050,
5371,
1001,
1063,
5371,
1065,
1000,
7953,
1035,
5460,
1027,
5371,
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... |
heroku/legacy-cli | lib/heroku/command/addons.rb | Heroku::Command.Addons.parse_options | def parse_options(args)
config = {}
deprecated_args = []
flag = /^--/
args.size.times do
break if args.empty?
peek = args.first
next unless peek && (peek.match(flag) || peek.match(/=/))
arg = args.shift
peek = args.first
key = arg
if key.match(/=/)
deprecated_args << key unless key.match(flag)
key, value = key.split('=', 2)
elsif peek.nil? || peek.match(flag)
value = true
else
value = args.shift
end
value = true if value == 'true'
config[key.sub(flag, '')] = value
if !deprecated_args.empty?
out_string = deprecated_args.map{|a| "--#{a}"}.join(' ')
display("Warning: non-unix style params have been deprecated, use #{out_string} instead")
end
end
config
end | ruby | def parse_options(args)
config = {}
deprecated_args = []
flag = /^--/
args.size.times do
break if args.empty?
peek = args.first
next unless peek && (peek.match(flag) || peek.match(/=/))
arg = args.shift
peek = args.first
key = arg
if key.match(/=/)
deprecated_args << key unless key.match(flag)
key, value = key.split('=', 2)
elsif peek.nil? || peek.match(flag)
value = true
else
value = args.shift
end
value = true if value == 'true'
config[key.sub(flag, '')] = value
if !deprecated_args.empty?
out_string = deprecated_args.map{|a| "--#{a}"}.join(' ')
display("Warning: non-unix style params have been deprecated, use #{out_string} instead")
end
end
config
end | [
"def",
"parse_options",
"(",
"args",
")",
"config",
"=",
"{",
"}",
"deprecated_args",
"=",
"[",
"]",
"flag",
"=",
"/",
"/",
"args",
".",
"size",
".",
"times",
"do",
"break",
"if",
"args",
".",
"empty?",
"peek",
"=",
"args",
".",
"first",
"next",
"u... | this will clean up when we officially deprecate | [
"this",
"will",
"clean",
"up",
"when",
"we",
"officially",
"deprecate"
] | 6f18521a258394bfb79e6b36f7160ad8559a8e16 | https://github.com/heroku/legacy-cli/blob/6f18521a258394bfb79e6b36f7160ad8559a8e16/lib/heroku/command/addons.rb#L414-L444 | train | Parse the options | [
30522,
13366,
11968,
3366,
1035,
7047,
1006,
12098,
5620,
1007,
9530,
8873,
2290,
1027,
1063,
1065,
2139,
28139,
12921,
1035,
12098,
5620,
1027,
1031,
1033,
5210,
1027,
1013,
1034,
1011,
1011,
1013,
12098,
5620,
1012,
2946,
1012,
2335,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb | Aws::RDS.Resource.reserved_db_instances_offerings | def reserved_db_instances_offerings(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_reserved_db_instances_offerings(options)
resp.each_page do |page|
batch = []
page.data.reserved_db_instances_offerings.each do |r|
batch << ReservedDBInstancesOffering.new(
id: r.reserved_db_instances_offering_id,
data: r,
client: @client
)
end
y.yield(batch)
end
end
ReservedDBInstancesOffering::Collection.new(batches)
end | ruby | def reserved_db_instances_offerings(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_reserved_db_instances_offerings(options)
resp.each_page do |page|
batch = []
page.data.reserved_db_instances_offerings.each do |r|
batch << ReservedDBInstancesOffering.new(
id: r.reserved_db_instances_offering_id,
data: r,
client: @client
)
end
y.yield(batch)
end
end
ReservedDBInstancesOffering::Collection.new(batches)
end | [
"def",
"reserved_db_instances_offerings",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"resp",
"=",
"@client",
".",
"describe_reserved_db_instances_offerings",
"(",
"options",
")",
"resp",
".",
"each_page",
... | @example Request syntax with placeholder values
reserved_db_instances_offerings = rds.reserved_db_instances_offerings({
reserved_db_instances_offering_id: "String",
db_instance_class: "String",
duration: "String",
product_description: "String",
offering_type: "String",
multi_az: false,
filters: [
{
name: "String", # required
values: ["String"], # required
},
],
})
@param [Hash] options ({})
@option options [String] :reserved_db_instances_offering_id
The offering identifier filter value. Specify this parameter to show
only the available offering that matches the specified reservation
identifier.
Example: `438012d3-4052-4cc7-b2e3-8d3372e0e706`
@option options [String] :db_instance_class
The DB instance class filter value. Specify this parameter to show
only the available offerings matching the specified DB instance class.
@option options [String] :duration
Duration filter value, specified in years or seconds. Specify this
parameter to show only reservations for this duration.
Valid Values: `1 | 3 | 31536000 | 94608000`
@option options [String] :product_description
Product description filter value. Specify this parameter to show only
the available offerings that contain the specified product
description.
<note markdown="1"> The results show offerings that partially match the filter value.
</note>
@option options [String] :offering_type
The offering type filter value. Specify this parameter to show only
the available offerings matching the specified offering type.
Valid Values: `"Partial Upfront" | "All Upfront" | "No Upfront" `
@option options [Boolean] :multi_az
The Multi-AZ filter value. Specify this parameter to show only the
available offerings matching the specified Multi-AZ parameter.
@option options [Array<Types::Filter>] :filters
This parameter is not currently supported.
@return [ReservedDBInstancesOffering::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb#L2529-L2545 | train | Returns a collection of all reserved DB instances offerings | [
30522,
13366,
9235,
1035,
16962,
1035,
12107,
1035,
14927,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
24501,
2361,
1027,
1030,
7396,
1012,
6235,
1035,
9235,
1035,
16962,
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... |
jeremytregunna/ruby-trello | lib/trello/card.rb | Trello.Card.save | def save
# If we have an id, just update our fields.
return update! if id
from_response client.post("/cards", {
name: name,
desc: desc,
idList: list_id,
idMembers: member_ids,
idLabels: card_labels,
pos: pos,
due: due,
dueComplete: due_complete,
idCardSource: source_card_id,
keepFromSource: source_card_properties
})
end | ruby | def save
# If we have an id, just update our fields.
return update! if id
from_response client.post("/cards", {
name: name,
desc: desc,
idList: list_id,
idMembers: member_ids,
idLabels: card_labels,
pos: pos,
due: due,
dueComplete: due_complete,
idCardSource: source_card_id,
keepFromSource: source_card_properties
})
end | [
"def",
"save",
"# If we have an id, just update our fields.",
"return",
"update!",
"if",
"id",
"from_response",
"client",
".",
"post",
"(",
"\"/cards\"",
",",
"{",
"name",
":",
"name",
",",
"desc",
":",
"desc",
",",
"idList",
":",
"list_id",
",",
"idMembers",
... | Saves a record.
@raise [Trello::Error] if the card could not be saved
@return [String] The JSON representation of the saved card returned by
the Trello API. | [
"Saves",
"a",
"record",
"."
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/card.rb#L248-L264 | train | Save the current card object | [
30522,
13366,
3828,
1001,
2065,
2057,
2031,
2019,
8909,
1010,
2074,
10651,
2256,
4249,
1012,
2709,
10651,
999,
2065,
8909,
2013,
1035,
3433,
7396,
1012,
2695,
1006,
1000,
1013,
5329,
1000,
1010,
1063,
2171,
1024,
2171,
1010,
4078,
2278,
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_set_rolling_upgrades.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSetRollingUpgrades.start_osupgrade_async | def start_osupgrade_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
# Send request
promise = begin_start_osupgrade_async(resource_group_name, vm_scale_set_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 start_osupgrade_async(resource_group_name, vm_scale_set_name, custom_headers:nil)
# Send request
promise = begin_start_osupgrade_async(resource_group_name, vm_scale_set_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",
"start_osupgrade_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_start_osupgrade_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"custom_headers",
":cust... | @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 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",
"vm_scale_set_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"VM",
"scale",
"set",
".",
"@param",
"custom_headers",
"[",
"Hash",
"{",... | 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_set_rolling_upgrades.rb#L86-L100 | train | Starts an osupgrade of a virtual machine scale set. | [
30522,
13366,
2707,
1035,
9808,
6279,
24170,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
gocardless/ibandit | lib/ibandit/iban.rb | Ibandit.IBAN.swift_national_id | def swift_national_id
return if swift_bank_code.nil? && swift_branch_code.nil?
national_id = swift_bank_code.to_s
national_id += swift_branch_code.to_s
national_id.slice(0, structure[:national_id_length])
end | ruby | def swift_national_id
return if swift_bank_code.nil? && swift_branch_code.nil?
national_id = swift_bank_code.to_s
national_id += swift_branch_code.to_s
national_id.slice(0, structure[:national_id_length])
end | [
"def",
"swift_national_id",
"return",
"if",
"swift_bank_code",
".",
"nil?",
"&&",
"swift_branch_code",
".",
"nil?",
"national_id",
"=",
"swift_bank_code",
".",
"to_s",
"national_id",
"+=",
"swift_branch_code",
".",
"to_s",
"national_id",
".",
"slice",
"(",
"0",
",... | Component parts | [
"Component",
"parts"
] | 675a4437e9de6c101c5a5b29f978a710fd35cb2c | https://github.com/gocardless/ibandit/blob/675a4437e9de6c101c5a5b29f978a710fd35cb2c/lib/ibandit/iban.rb#L47-L53 | train | Returns the national id of the national_id of the national_id_genomic_code. | [
30522,
13366,
9170,
1035,
2120,
1035,
8909,
2709,
2065,
9170,
1035,
2924,
1035,
3642,
1012,
9152,
2140,
1029,
1004,
1004,
9170,
1035,
3589,
1035,
3642,
1012,
9152,
2140,
1029,
2120,
1035,
8909,
1027,
9170,
1035,
2924,
1035,
3642,
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_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb | Azure::CDN::Mgmt::V2015_06_01.Endpoints.create | def create(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:nil)
response = create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:nil)
response = create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create",
"(",
"endpoint_name",
",",
"endpoint_properties",
",",
"profile_name",
",",
"resource_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_async",
"(",
"endpoint_name",
",",
"endpoint_properties",
",",
"profile_name",
",",
"... | Creates a new CDN endpoint with the specified parameters.
@param endpoint_name [String] Name of the endpoint within the CDN profile.
@param endpoint_properties [EndpointCreateParameters] Endpoint properties
@param profile_name [String] Name of the CDN profile within the resource
group.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Endpoint] operation results. | [
"Creates",
"a",
"new",
"CDN",
"endpoint",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb#L241-L244 | train | Creates an endpoint. | [
30522,
13366,
3443,
1006,
2203,
8400,
1035,
2171,
1010,
2203,
8400,
1035,
5144,
1010,
6337,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2004,
6038,
2278,
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... |
jnunemaker/httparty | lib/httparty.rb | HTTParty.ClassMethods.copy | def copy(path, options = {}, &block)
perform_request Net::HTTP::Copy, path, options, &block
end | ruby | def copy(path, options = {}, &block)
perform_request Net::HTTP::Copy, path, options, &block
end | [
"def",
"copy",
"(",
"path",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"perform_request",
"Net",
"::",
"HTTP",
"::",
"Copy",
",",
"path",
",",
"options",
",",
"block",
"end"
] | Perform a COPY request to a path | [
"Perform",
"a",
"COPY",
"request",
"to",
"a",
"path"
] | b4099defba01231d2faaaa2660476f867e096bfb | https://github.com/jnunemaker/httparty/blob/b4099defba01231d2faaaa2660476f867e096bfb/lib/httparty.rb#L547-L549 | train | Perform a copy request to a path. | [
30522,
13366,
6100,
1006,
4130,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
4685,
1035,
5227,
5658,
1024,
1024,
8299,
1024,
1024,
6100,
1010,
4130,
1010,
7047,
1010,
1004,
3796,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heroku/rack-timeout | lib/rack/timeout/core.rb | Rack.Timeout.read_timeout_property | def read_timeout_property value, default
case value
when nil ; read_timeout_property default, default
when false ; false
when 0 ; false
else
value.is_a?(Numeric) && value > 0 or raise ArgumentError, "value #{value.inspect} should be false, zero, or a positive number."
value
end
end | ruby | def read_timeout_property value, default
case value
when nil ; read_timeout_property default, default
when false ; false
when 0 ; false
else
value.is_a?(Numeric) && value > 0 or raise ArgumentError, "value #{value.inspect} should be false, zero, or a positive number."
value
end
end | [
"def",
"read_timeout_property",
"value",
",",
"default",
"case",
"value",
"when",
"nil",
";",
"read_timeout_property",
"default",
",",
"default",
"when",
"false",
";",
"false",
"when",
"0",
";",
"false",
"else",
"value",
".",
"is_a?",
"(",
"Numeric",
")",
"&... | key where request id is stored if generated by action dispatch
helper methods to read timeout properties. Ensure they're always positive numbers or false. When set to false (or 0), their behaviour is disabled. | [
"key",
"where",
"request",
"id",
"is",
"stored",
"if",
"generated",
"by",
"action",
"dispatch",
"helper",
"methods",
"to",
"read",
"timeout",
"properties",
".",
"Ensure",
"they",
"re",
"always",
"positive",
"numbers",
"or",
"false",
".",
"When",
"set",
"to",... | d5d08c57ba3cf3f967301512df96c451e8e9fbfa | https://github.com/heroku/rack-timeout/blob/d5d08c57ba3cf3f967301512df96c451e8e9fbfa/lib/rack/timeout/core.rb#L50-L59 | train | Read the timeout property. | [
30522,
13366,
3191,
1035,
2051,
5833,
1035,
3200,
3643,
1010,
12398,
2553,
3643,
2043,
9152,
2140,
1025,
3191,
1035,
2051,
5833,
1035,
3200,
12398,
1010,
12398,
2043,
6270,
1025,
6270,
2043,
1014,
1025,
6270,
2842,
3643,
1012,
2003,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb | Azure::Web::Mgmt::V2016_03_01.WebSiteManagementClient.list_source_controls_next | def list_source_controls_next(next_page_link, custom_headers:nil)
response = list_source_controls_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_source_controls_next(next_page_link, custom_headers:nil)
response = list_source_controls_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_source_controls_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_source_controls_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",... | Gets the source controls available for Azure websites.
Gets the source controls available for Azure websites.
@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 [SourceControlCollection] operation results. | [
"Gets",
"the",
"source",
"controls",
"available",
"for",
"Azure",
"websites",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb#L1656-L1659 | train | Gets the source controls for the specified resource group. | [
30522,
13366,
2862,
1035,
3120,
1035,
7711,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
3120,
1035,
7711,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
octokit/octokit.rb | lib/octokit/client.rb | Octokit.Client.inspect | def inspect
inspected = super
# mask password
inspected.gsub! @password, '*******' if @password
inspected.gsub! @management_console_password, '*******' if @management_console_password
inspected.gsub! @bearer_token, '********' if @bearer_token
# Only show last 4 of token, secret
inspected.gsub! @access_token, "#{'*'*36}#{@access_token[36..-1]}" if @access_token
inspected.gsub! @client_secret, "#{'*'*36}#{@client_secret[36..-1]}" if @client_secret
inspected
end | ruby | def inspect
inspected = super
# mask password
inspected.gsub! @password, '*******' if @password
inspected.gsub! @management_console_password, '*******' if @management_console_password
inspected.gsub! @bearer_token, '********' if @bearer_token
# Only show last 4 of token, secret
inspected.gsub! @access_token, "#{'*'*36}#{@access_token[36..-1]}" if @access_token
inspected.gsub! @client_secret, "#{'*'*36}#{@client_secret[36..-1]}" if @client_secret
inspected
end | [
"def",
"inspect",
"inspected",
"=",
"super",
"# mask password",
"inspected",
".",
"gsub!",
"@password",
",",
"'*******'",
"if",
"@password",
"inspected",
".",
"gsub!",
"@management_console_password",
",",
"'*******'",
"if",
"@management_console_password",
"inspected",
"... | Text representation of the client, masking tokens and passwords
@return [String] | [
"Text",
"representation",
"of",
"the",
"client",
"masking",
"tokens",
"and",
"passwords"
] | ddf750601529a6a7da5fe5293d10031709b8605d | https://github.com/octokit/octokit.rb/blob/ddf750601529a6a7da5fe5293d10031709b8605d/lib/octokit/client.rb#L134-L146 | train | Returns the string representation of the object in the correct order. | [
30522,
13366,
22459,
20456,
1027,
3565,
1001,
7308,
20786,
20456,
1012,
28177,
12083,
999,
1030,
20786,
1010,
1005,
1008,
1008,
1008,
1008,
1008,
1008,
1008,
1005,
2065,
1030,
20786,
20456,
1012,
28177,
12083,
999,
1030,
2968,
1035,
10122,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2017-12-01/generated/azure_mgmt_compute/virtual_machines.rb | Azure::Compute::Mgmt::V2017_12_01.VirtualMachines.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, vm_name, parameters, custom_headers:nil)
begin_update_async(resource_group_name, vm_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"vm_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")... | The operation to update a virtual machine.
@param resource_group_name [String] The name of the resource group.
@param vm_name [String] The name of the virtual machine.
@param parameters [VirtualMachineUpdate] Parameters supplied to the Update
Virtual Machine 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. | [
"The",
"operation",
"to",
"update",
"a",
"virtual",
"machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machines.rb#L1554-L1556 | train | Updates a virtual machine. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
10651,
1035,
2004,
6038,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb | Azure::SQL::Mgmt::V2014_04_01.Databases.begin_import | def begin_import(resource_group_name, server_name, parameters, custom_headers:nil)
response = begin_import_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_import(resource_group_name, server_name, parameters, custom_headers:nil)
response = begin_import_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_import",
"(",
"resource_group_name",
",",
"server_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_import_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"parameters",
",",
"custom_headers",
":custom_... | Imports a bacpac into a new database.
@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 parameters [ImportRequest] The required parameters for importing a
Bacpac into a database.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ImportExportResponse] operation results. | [
"Imports",
"a",
"bacpac",
"into",
"a",
"new",
"database",
"."
] | 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#L1771-L1774 | train | Import a single or many - to - many data structures into a single resource. | [
30522,
13366,
4088,
1035,
12324,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
12324,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | actionview/lib/action_view/template.rb | ActionView.Template.compile | def compile(mod)
source = encode!
code = @handler.call(self, source)
# Make sure that the resulting String to be eval'd is in the
# encoding of the code
original_source = source
source = +<<-end_src
def #{method_name}(local_assigns, output_buffer)
@virtual_path = #{@virtual_path.inspect};#{locals_code};#{code}
end
end_src
# Make sure the source is in the encoding of the returned code
source.force_encoding(code.encoding)
# In case we get back a String from a handler that is not in
# BINARY or the default_internal, encode it to the default_internal
source.encode!
# Now, validate that the source we got back from the template
# handler is valid in the default_internal. This is for handlers
# that handle encoding but screw up
unless source.valid_encoding?
raise WrongEncodingError.new(source, Encoding.default_internal)
end
begin
mod.module_eval(source, identifier, 0)
rescue SyntaxError
# Account for when code in the template is not syntactically valid; e.g. if we're using
# ERB and the user writes <%= foo( %>, attempting to call a helper `foo` and interpolate
# the result into the template, but missing an end parenthesis.
raise SyntaxErrorInTemplate.new(self, original_source)
end
end | ruby | def compile(mod)
source = encode!
code = @handler.call(self, source)
# Make sure that the resulting String to be eval'd is in the
# encoding of the code
original_source = source
source = +<<-end_src
def #{method_name}(local_assigns, output_buffer)
@virtual_path = #{@virtual_path.inspect};#{locals_code};#{code}
end
end_src
# Make sure the source is in the encoding of the returned code
source.force_encoding(code.encoding)
# In case we get back a String from a handler that is not in
# BINARY or the default_internal, encode it to the default_internal
source.encode!
# Now, validate that the source we got back from the template
# handler is valid in the default_internal. This is for handlers
# that handle encoding but screw up
unless source.valid_encoding?
raise WrongEncodingError.new(source, Encoding.default_internal)
end
begin
mod.module_eval(source, identifier, 0)
rescue SyntaxError
# Account for when code in the template is not syntactically valid; e.g. if we're using
# ERB and the user writes <%= foo( %>, attempting to call a helper `foo` and interpolate
# the result into the template, but missing an end parenthesis.
raise SyntaxErrorInTemplate.new(self, original_source)
end
end | [
"def",
"compile",
"(",
"mod",
")",
"source",
"=",
"encode!",
"code",
"=",
"@handler",
".",
"call",
"(",
"self",
",",
"source",
")",
"# Make sure that the resulting String to be eval'd is in the",
"# encoding of the code",
"original_source",
"=",
"source",
"source",
"=... | Among other things, this method is responsible for properly setting
the encoding of the compiled template.
If the template engine handles encodings, we send the encoded
String to the engine without further processing. This allows
the template engine to support additional mechanisms for
specifying the encoding. For instance, ERB supports <%# encoding: %>
Otherwise, after we figure out the correct encoding, we then
encode the source into <tt>Encoding.default_internal</tt>.
In general, this means that templates will be UTF-8 inside of Rails,
regardless of the original source encoding. | [
"Among",
"other",
"things",
"this",
"method",
"is",
"responsible",
"for",
"properly",
"setting",
"the",
"encoding",
"of",
"the",
"compiled",
"template",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/template.rb#L313-L348 | train | Compile the code in the template | [
30522,
13366,
4012,
22090,
1006,
16913,
1007,
3120,
1027,
4372,
16044,
999,
3642,
1027,
1030,
28213,
1012,
2655,
1006,
2969,
1010,
3120,
1007,
1001,
2191,
2469,
2008,
1996,
4525,
5164,
2000,
2022,
9345,
2140,
1005,
1040,
2003,
1999,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
oauth-xx/oauth2 | lib/oauth2/mac_token.rb | OAuth2.MACToken.signature | def signature(timestamp, nonce, verb, uri)
signature = [
timestamp,
nonce,
verb.to_s.upcase,
uri.request_uri,
uri.host,
uri.port,
'', nil
].join("\n")
Base64.strict_encode64(OpenSSL::HMAC.digest(@algorithm, secret, signature))
end | ruby | def signature(timestamp, nonce, verb, uri)
signature = [
timestamp,
nonce,
verb.to_s.upcase,
uri.request_uri,
uri.host,
uri.port,
'', nil
].join("\n")
Base64.strict_encode64(OpenSSL::HMAC.digest(@algorithm, secret, signature))
end | [
"def",
"signature",
"(",
"timestamp",
",",
"nonce",
",",
"verb",
",",
"uri",
")",
"signature",
"=",
"[",
"timestamp",
",",
"nonce",
",",
"verb",
".",
"to_s",
".",
"upcase",
",",
"uri",
".",
"request_uri",
",",
"uri",
".",
"host",
",",
"uri",
".",
"... | Generate the Base64-encoded HMAC digest signature
@param [Fixnum] timestamp the timestamp of the request in seconds since epoch
@param [String] nonce the MAC header nonce
@param [Symbol] verb the HTTP request method
@param [String] url the HTTP URL path of the request | [
"Generate",
"the",
"Base64",
"-",
"encoded",
"HMAC",
"digest",
"signature"
] | f08ff9da169136ab133aa2faab0d74a4407deffb | https://github.com/oauth-xx/oauth2/blob/f08ff9da169136ab133aa2faab0d74a4407deffb/lib/oauth2/mac_token.rb#L80-L92 | train | Returns the signature for the request | [
30522,
13366,
8085,
1006,
2335,
15464,
2361,
1010,
2512,
3401,
1010,
12034,
1010,
24471,
2072,
1007,
8085,
1027,
1031,
2335,
15464,
2361,
1010,
2512,
3401,
1010,
12034,
1012,
2000,
1035,
1055,
1012,
2039,
18382,
1010,
24471,
2072,
1012,
522... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.delete_certificate_operation | def delete_certificate_operation(vault_base_url, certificate_name, custom_headers:nil)
response = delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_certificate_operation(vault_base_url, certificate_name, custom_headers:nil)
response = delete_certificate_operation_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_certificate_operation",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_certificate_operation_async",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"custom_headers",
":custom_headers",
")... | Deletes the creation operation for a specific certificate.
Deletes the creation operation for a specified certificate that is in the
process of being created. The certificate is no longer created. This
operation requires the certificates/update permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param certificate_name [String] The name of the certificate.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CertificateOperation] operation results. | [
"Deletes",
"the",
"creation",
"operation",
"for",
"a",
"specific",
"certificate",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L6279-L6282 | train | Deletes the specified certificate operation. | [
30522,
13366,
3972,
12870,
1035,
8196,
1035,
3169,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
8196,
1035,
3169,
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... |
elastic/apm-agent-ruby | lib/elastic_apm/context_builder.rb | ElasticAPM.ContextBuilder.apply_to_request | def apply_to_request(context, rack_env:, for_type:)
req = rails_req?(rack_env) ? rack_env : Rack::Request.new(rack_env)
context.request = Context::Request.new unless context.request
request = context.request
request.socket = Context::Request::Socket.new(req)
request.http_version = build_http_version rack_env
request.method = req.request_method
request.url = Context::Request::Url.new(req)
request.body = should_capture_body?(for_type) ? get_body(req) : SKIPPED
headers, env = get_headers_and_env(rack_env)
request.headers = headers if config.capture_headers?
request.env = env if config.capture_env?
context
end | ruby | def apply_to_request(context, rack_env:, for_type:)
req = rails_req?(rack_env) ? rack_env : Rack::Request.new(rack_env)
context.request = Context::Request.new unless context.request
request = context.request
request.socket = Context::Request::Socket.new(req)
request.http_version = build_http_version rack_env
request.method = req.request_method
request.url = Context::Request::Url.new(req)
request.body = should_capture_body?(for_type) ? get_body(req) : SKIPPED
headers, env = get_headers_and_env(rack_env)
request.headers = headers if config.capture_headers?
request.env = env if config.capture_env?
context
end | [
"def",
"apply_to_request",
"(",
"context",
",",
"rack_env",
":",
",",
"for_type",
":",
")",
"req",
"=",
"rails_req?",
"(",
"rack_env",
")",
"?",
"rack_env",
":",
"Rack",
"::",
"Request",
".",
"new",
"(",
"rack_env",
")",
"context",
".",
"request",
"=",
... | rubocop:disable Metrics/MethodLength, Metrics/AbcSize | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"MethodLength",
"Metrics",
"/",
"AbcSize"
] | 82190d1a9ba22af3b2c2c6fe6d23cc471f2e7ff6 | https://github.com/elastic/apm-agent-ruby/blob/82190d1a9ba22af3b2c2c6fe6d23cc471f2e7ff6/lib/elastic_apm/context_builder.rb#L24-L42 | train | Apply the request to the context | [
30522,
13366,
6611,
1035,
2000,
1035,
5227,
1006,
6123,
1010,
14513,
1035,
4372,
2615,
1024,
1010,
2005,
1035,
2828,
1024,
1007,
2128,
4160,
1027,
15168,
1035,
2128,
4160,
1029,
1006,
14513,
1035,
4372,
2615,
1007,
1029,
14513,
1035,
4372,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kpumuk/meta-tags | lib/meta_tags/tag.rb | MetaTags.Tag.render | def render(view)
view.tag(name, prepare_attributes(attributes), MetaTags.config.open_meta_tags?)
end | ruby | def render(view)
view.tag(name, prepare_attributes(attributes), MetaTags.config.open_meta_tags?)
end | [
"def",
"render",
"(",
"view",
")",
"view",
".",
"tag",
"(",
"name",
",",
"prepare_attributes",
"(",
"attributes",
")",
",",
"MetaTags",
".",
"config",
".",
"open_meta_tags?",
")",
"end"
] | Initializes a new instance of Tag class.
@param [String, Symbol] name HTML tag name
@param [Hash] attributes list of HTML tag attributes
Render tag into a Rails view.
@param [ActionView::Base] view instance of a Rails view.
@return [String] HTML string for the tag. | [
"Initializes",
"a",
"new",
"instance",
"of",
"Tag",
"class",
"."
] | 03585f95edf96cd17024c5c155ce46ec8bc47232 | https://github.com/kpumuk/meta-tags/blob/03585f95edf96cd17024c5c155ce46ec8bc47232/lib/meta_tags/tag.rb#L23-L25 | train | Render the tag to the given view. | [
30522,
13366,
17552,
1006,
3193,
1007,
3193,
1012,
6415,
1006,
2171,
1010,
7374,
1035,
12332,
1006,
12332,
1007,
1010,
18804,
15900,
2015,
1012,
9530,
8873,
2290,
1012,
2330,
1035,
18804,
1035,
22073,
1029,
1007,
2203,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_cluster_configuration_upgrade_status | def get_cluster_configuration_upgrade_status(timeout:60, custom_headers:nil)
response = get_cluster_configuration_upgrade_status_async(timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_cluster_configuration_upgrade_status(timeout:60, custom_headers:nil)
response = get_cluster_configuration_upgrade_status_async(timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_cluster_configuration_upgrade_status",
"(",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_cluster_configuration_upgrade_status_async",
"(",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",
")",
".",
"... | Get the cluster configuration upgrade status of a Service Fabric standalone
cluster.
Get the cluster configuration upgrade status details of a Service Fabric
standalone cluster.
@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 [ClusterConfigurationUpgradeStatusInfo] operation results. | [
"Get",
"the",
"cluster",
"configuration",
"upgrade",
"status",
"of",
"a",
"Service",
"Fabric",
"standalone",
"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#L2026-L2029 | train | Gets the cluster configuration upgrade status. | [
30522,
13366,
2131,
1035,
9324,
1035,
9563,
1035,
12200,
1035,
3570,
1006,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
9324,
1035,
9563,
1035,
12200,
1035,
3570,
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... |
boazsegev/combine_pdf | lib/combine_pdf/page_methods.rb | CombinePDF.Page_Methods.init_contents | def init_contents
self[:Contents] = self[:Contents][:referenced_object][:indirect_without_dictionary] if self[:Contents].is_a?(Hash) && self[:Contents][:referenced_object] && self[:Contents][:referenced_object].is_a?(Hash) && self[:Contents][:referenced_object][:indirect_without_dictionary]
self[:Contents] = [self[:Contents]] unless self[:Contents].is_a?(Array)
self[:Contents].delete(is_reference_only: true, referenced_object: { indirect_reference_id: 0, raw_stream_content: '' })
# un-nest any referenced arrays
self[:Contents].map! { |s| actual_value(s).is_a?(Array) ? actual_value(s) : s }
self[:Contents].flatten!
self[:Contents].compact!
# wrap content streams
insert_content 'q', 0
insert_content 'Q'
# Prep content
@contents = ''
insert_content @contents
@contents
end | ruby | def init_contents
self[:Contents] = self[:Contents][:referenced_object][:indirect_without_dictionary] if self[:Contents].is_a?(Hash) && self[:Contents][:referenced_object] && self[:Contents][:referenced_object].is_a?(Hash) && self[:Contents][:referenced_object][:indirect_without_dictionary]
self[:Contents] = [self[:Contents]] unless self[:Contents].is_a?(Array)
self[:Contents].delete(is_reference_only: true, referenced_object: { indirect_reference_id: 0, raw_stream_content: '' })
# un-nest any referenced arrays
self[:Contents].map! { |s| actual_value(s).is_a?(Array) ? actual_value(s) : s }
self[:Contents].flatten!
self[:Contents].compact!
# wrap content streams
insert_content 'q', 0
insert_content 'Q'
# Prep content
@contents = ''
insert_content @contents
@contents
end | [
"def",
"init_contents",
"self",
"[",
":Contents",
"]",
"=",
"self",
"[",
":Contents",
"]",
"[",
":referenced_object",
"]",
"[",
":indirect_without_dictionary",
"]",
"if",
"self",
"[",
":Contents",
"]",
".",
"is_a?",
"(",
"Hash",
")",
"&&",
"self",
"[",
":C... | initializes the content stream in case it was not initialized before | [
"initializes",
"the",
"content",
"stream",
"in",
"case",
"it",
"was",
"not",
"initialized",
"before"
] | 09054051019c069f551f3e60be789577c0f93900 | https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/page_methods.rb#L669-L685 | train | Initialize the contents array | [
30522,
13366,
1999,
4183,
1035,
8417,
2969,
1031,
1024,
8417,
1033,
1027,
2969,
1031,
1024,
8417,
1033,
1031,
1024,
14964,
1035,
4874,
1033,
1031,
1024,
14958,
1035,
2302,
1035,
9206,
1033,
2065,
2969,
1031,
1024,
8417,
1033,
1012,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/dsc_node_configuration_operations.rb | Azure::Automation::Mgmt::V2015_10_31.DscNodeConfigurationOperations.get_with_http_info | def get_with_http_info(resource_group_name, automation_account_name, node_configuration_name, custom_headers:nil)
get_async(resource_group_name, automation_account_name, node_configuration_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, automation_account_name, node_configuration_name, custom_headers:nil)
get_async(resource_group_name, automation_account_name, node_configuration_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"node_configuration_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"node_configuration_name",
",",
"cu... | Retrieve the Dsc node configurations by node configuration.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param node_configuration_name [String] The Dsc node configuration 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. | [
"Retrieve",
"the",
"Dsc",
"node",
"configurations",
"by",
"node",
"configuration",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/dsc_node_configuration_operations.rb#L139-L141 | train | Gets the node configuration. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
13045,
1035,
9563,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_batch/lib/2015-12-01/generated/azure_mgmt_batch/application_package_operations.rb | Azure::Batch::Mgmt::V2015_12_01.ApplicationPackageOperations.create_with_http_info | def create_with_http_info(resource_group_name, account_name, application_id, version, custom_headers:nil)
create_async(resource_group_name, account_name, application_id, version, custom_headers:custom_headers).value!
end | ruby | def create_with_http_info(resource_group_name, account_name, application_id, version, custom_headers:nil)
create_async(resource_group_name, account_name, application_id, version, custom_headers:custom_headers).value!
end | [
"def",
"create_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"application_id",
",",
"version",
",",
"custom_headers",
":",
"nil",
")",
"create_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"application_id",
",",
"version",
",",... | Creates an application package record.
@param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param application_id [String] The ID of the application.
@param version [String] The version of the application.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"an",
"application",
"package",
"record",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2015-12-01/generated/azure_mgmt_batch/application_package_operations.rb#L165-L167 | train | Creates a new chunk of a chunk of the application. | [
30522,
13366,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
2544,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3443,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
slim-template/slim | lib/slim/end_inserter.rb | Slim.EndInserter.on_multi | def on_multi(*exps)
result = [:multi]
# This variable is true if the previous line was
# (1) a control code and (2) contained indented content.
prev_indent = false
exps.each do |exp|
if control?(exp)
raise(Temple::FilterError, 'Explicit end statements are forbidden') if exp[2] =~ END_RE
# Two control code in a row. If this one is *not*
# an else block, we should close the previous one.
append_end(result) if prev_indent && exp[2] !~ ELSE_RE
# Indent if the control code starts a block.
prev_indent = exp[2] =~ IF_RE
elsif exp[0] != :newline && prev_indent
# This is *not* a control code, so we should close the previous one.
# Ignores newlines because they will be inserted after each line.
append_end(result)
prev_indent = false
end
result << compile(exp)
end
# The last line can be a control code too.
prev_indent ? append_end(result) : result
end | ruby | def on_multi(*exps)
result = [:multi]
# This variable is true if the previous line was
# (1) a control code and (2) contained indented content.
prev_indent = false
exps.each do |exp|
if control?(exp)
raise(Temple::FilterError, 'Explicit end statements are forbidden') if exp[2] =~ END_RE
# Two control code in a row. If this one is *not*
# an else block, we should close the previous one.
append_end(result) if prev_indent && exp[2] !~ ELSE_RE
# Indent if the control code starts a block.
prev_indent = exp[2] =~ IF_RE
elsif exp[0] != :newline && prev_indent
# This is *not* a control code, so we should close the previous one.
# Ignores newlines because they will be inserted after each line.
append_end(result)
prev_indent = false
end
result << compile(exp)
end
# The last line can be a control code too.
prev_indent ? append_end(result) : result
end | [
"def",
"on_multi",
"(",
"*",
"exps",
")",
"result",
"=",
"[",
":multi",
"]",
"# This variable is true if the previous line was",
"# (1) a control code and (2) contained indented content.",
"prev_indent",
"=",
"false",
"exps",
".",
"each",
"do",
"|",
"exp",
"|",
"if",
... | Handle multi expression `[:multi, *exps]`
@return [Array] Corrected Temple expression with ends inserted | [
"Handle",
"multi",
"expression",
"[",
":",
"multi",
"*",
"exps",
"]"
] | ae8e7338fcfb67256d2f6b50c64fc317210e31a2 | https://github.com/slim-template/slim/blob/ae8e7338fcfb67256d2f6b50c64fc317210e31a2/lib/slim/end_inserter.rb#L20-L48 | train | Returns a list of the expressions that are on a multi line. | [
30522,
13366,
2006,
1035,
4800,
1006,
1008,
4654,
4523,
1007,
2765,
1027,
1031,
1024,
4800,
1033,
1001,
2023,
8023,
2003,
2995,
2065,
1996,
3025,
2240,
2001,
1001,
1006,
1015,
1007,
1037,
2491,
3642,
1998,
1006,
1016,
1007,
4838,
27427,
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... |
adimichele/hubspot-ruby | lib/hubspot/deal.rb | Hubspot.Deal.update! | def update!(params)
query = {"properties" => Hubspot::Utils.hash_to_properties(params.stringify_keys!, key_name: 'name')}
Hubspot::Connection.put_json(UPDATE_DEAL_PATH, params: { deal_id: deal_id }, body: query)
@properties.merge!(params)
self
end | ruby | def update!(params)
query = {"properties" => Hubspot::Utils.hash_to_properties(params.stringify_keys!, key_name: 'name')}
Hubspot::Connection.put_json(UPDATE_DEAL_PATH, params: { deal_id: deal_id }, body: query)
@properties.merge!(params)
self
end | [
"def",
"update!",
"(",
"params",
")",
"query",
"=",
"{",
"\"properties\"",
"=>",
"Hubspot",
"::",
"Utils",
".",
"hash_to_properties",
"(",
"params",
".",
"stringify_keys!",
",",
"key_name",
":",
"'name'",
")",
"}",
"Hubspot",
"::",
"Connection",
".",
"put_js... | Updates the properties of a deal
{https://developers.hubspot.com/docs/methods/deals/update_deal}
@param params [Hash] hash of properties to update
@return [Hubspot::Deal] self | [
"Updates",
"the",
"properties",
"of",
"a",
"deal",
"{",
"https",
":",
"//",
"developers",
".",
"hubspot",
".",
"com",
"/",
"docs",
"/",
"methods",
"/",
"deals",
"/",
"update_deal",
"}"
] | 8eb0a64dd0c14c79e631e81bfdc169583e775a46 | https://github.com/adimichele/hubspot-ruby/blob/8eb0a64dd0c14c79e631e81bfdc169583e775a46/lib/hubspot/deal.rb#L134-L139 | train | Update a deal | [
30522,
13366,
10651,
999,
1006,
11498,
5244,
1007,
23032,
1027,
1063,
1000,
5144,
1000,
1027,
1028,
9594,
13102,
4140,
1024,
1024,
21183,
12146,
1012,
23325,
1035,
2000,
1035,
5144,
1006,
11498,
5244,
1012,
5164,
8757,
1035,
6309,
999,
1010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_certificate_issuers_as_lazy_with_http_info | def get_certificate_issuers_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_certificate_issuers_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | ruby | def get_certificate_issuers_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_certificate_issuers_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | [
"def",
"get_certificate_issuers_as_lazy_with_http_info",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_certificate_issuers_as_lazy_async",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_headers"... | List certificate issuers for a specified key vault.
The GetCertificateIssuers operation returns the set of certificate issuer
resources in the specified key vault. This operation requires the
certificates/manageissuers/getissuers permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param maxresults [Integer] Maximum number of results to return in a page. If
not specified the service will return up to 25 results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"List",
"certificate",
"issuers",
"for",
"a",
"specified",
"key",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L10248-L10250 | train | Gets the certificate issuers for a specified vault. | [
30522,
13366,
2131,
1035,
8196,
1035,
3277,
2869,
1035,
2004,
1035,
13971,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/storage_account_credentials.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.StorageAccountCredentials.begin_delete_with_http_info | def begin_delete_with_http_info(storage_account_credential_name, resource_group_name, manager_name, custom_headers:nil)
begin_delete_async(storage_account_credential_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(storage_account_credential_name, resource_group_name, manager_name, custom_headers:nil)
begin_delete_async(storage_account_credential_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"storage_account_credential_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"storage_account_credential_name",
",",
"resource_group_name",
",",
"manager_name",
... | Deletes the storage account credential.
@param storage_account_credential_name [String] The name of the storage
account credential.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"the",
"storage",
"account",
"credential",
"."
] | 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/storage_account_credentials.rb#L454-L456 | train | Deletes the specified storage account credential. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5527,
1035,
4070,
1035,
13675,
14728,
19909,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | sigh/lib/sigh/runner.rb | Sigh.Runner.fetch_profiles | def fetch_profiles
UI.message("Fetching profiles...")
results = profile_type.find_by_bundle_id(bundle_id: Sigh.config[:app_identifier],
mac: Sigh.config[:platform].to_s == 'macos',
sub_platform: Sigh.config[:platform].to_s == 'tvos' ? 'tvOS' : nil)
results = results.find_all do |current_profile|
if current_profile.valid? || Sigh.config[:force]
true
else
UI.message("Provisioning Profile '#{current_profile.name}' is not valid, skipping this one...")
false
end
end
# Take the provisioning profile name into account
results = filter_profiles_by_name(results) if Sigh.config[:provisioning_name].to_s.length > 0
return results if Sigh.config[:skip_certificate_verification]
UI.message("Verifying certificates...")
return results.find_all do |current_profile|
installed = false
# Attempts to download all certificates from this profile
# for checking if they are installed.
# `cert.download_raw` can fail if the user is a
# "member" and not an a "admin"
raw_certs = current_profile.certificates.map do |cert|
begin
raw_cert = cert.download_raw
rescue => error
UI.important("Cannot download cert #{cert.id} - #{error.message}")
raw_cert = nil
end
{ downloaded: raw_cert, cert: cert }
end
# Makes sure we have the certificate installed on the local machine
raw_certs.each do |current_cert|
# Skip certificates that failed to download
next unless current_cert[:downloaded]
file = Tempfile.new('cert')
file.write(current_cert[:downloaded])
file.close
if FastlaneCore::CertChecker.installed?(file.path)
installed = true
else
UI.message("Certificate for Provisioning Profile '#{current_profile.name}' not available locally: #{current_cert[:cert].id}, skipping this one...")
end
end
installed && current_profile.certificate_valid?
end
end | ruby | def fetch_profiles
UI.message("Fetching profiles...")
results = profile_type.find_by_bundle_id(bundle_id: Sigh.config[:app_identifier],
mac: Sigh.config[:platform].to_s == 'macos',
sub_platform: Sigh.config[:platform].to_s == 'tvos' ? 'tvOS' : nil)
results = results.find_all do |current_profile|
if current_profile.valid? || Sigh.config[:force]
true
else
UI.message("Provisioning Profile '#{current_profile.name}' is not valid, skipping this one...")
false
end
end
# Take the provisioning profile name into account
results = filter_profiles_by_name(results) if Sigh.config[:provisioning_name].to_s.length > 0
return results if Sigh.config[:skip_certificate_verification]
UI.message("Verifying certificates...")
return results.find_all do |current_profile|
installed = false
# Attempts to download all certificates from this profile
# for checking if they are installed.
# `cert.download_raw` can fail if the user is a
# "member" and not an a "admin"
raw_certs = current_profile.certificates.map do |cert|
begin
raw_cert = cert.download_raw
rescue => error
UI.important("Cannot download cert #{cert.id} - #{error.message}")
raw_cert = nil
end
{ downloaded: raw_cert, cert: cert }
end
# Makes sure we have the certificate installed on the local machine
raw_certs.each do |current_cert|
# Skip certificates that failed to download
next unless current_cert[:downloaded]
file = Tempfile.new('cert')
file.write(current_cert[:downloaded])
file.close
if FastlaneCore::CertChecker.installed?(file.path)
installed = true
else
UI.message("Certificate for Provisioning Profile '#{current_profile.name}' not available locally: #{current_cert[:cert].id}, skipping this one...")
end
end
installed && current_profile.certificate_valid?
end
end | [
"def",
"fetch_profiles",
"UI",
".",
"message",
"(",
"\"Fetching profiles...\"",
")",
"results",
"=",
"profile_type",
".",
"find_by_bundle_id",
"(",
"bundle_id",
":",
"Sigh",
".",
"config",
"[",
":app_identifier",
"]",
",",
"mac",
":",
"Sigh",
".",
"config",
"[... | Fetches a profile matching the user's search requirements | [
"Fetches",
"a",
"profile",
"matching",
"the",
"user",
"s",
"search",
"requirements"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/sigh/lib/sigh/runner.rb#L68-L119 | train | Fetch all profiles that are currently in use | [
30522,
13366,
18584,
1035,
17879,
21318,
1012,
4471,
1006,
1000,
18584,
2075,
17879,
1012,
1012,
1012,
1000,
1007,
3463,
1027,
6337,
1035,
2828,
1012,
2424,
1035,
2011,
1035,
14012,
1035,
8909,
1006,
14012,
1035,
8909,
1024,
6682,
1012,
953... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb | Azure::Labservices::Mgmt::V2018_10_15.Environments.begin_stop_with_http_info | def begin_stop_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
end | ruby | def begin_stop_with_http_info(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:nil)
begin_stop_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_stop_with_http_info",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
"environment_setting_name",
",",
"environment_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_stop_async",
"(",
"resource_group_name",
",",
"lab_account_name... | Stops an environment by stopping all resources inside the environment This
operation can take a while to complete
@param resource_group_name [String] The name of the resource group.
@param lab_account_name [String] The name of the lab Account.
@param lab_name [String] The name of the lab.
@param environment_setting_name [String] The name of the environment Setting.
@param environment_name [String] The name of the environment.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Stops",
"an",
"environment",
"by",
"stopping",
"all",
"resources",
"inside",
"the",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb#L1102-L1104 | train | Stops the environment. | [
30522,
13366,
4088,
1035,
2644,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
1035,
2171,
1010,
4044,
1035,
4292,
1035,
2171,
1010,
4044,
1035,
2171,
1010,
7661,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/dhcp_options.rb | Aws::EC2.DhcpOptions.delete | def delete(options = {})
options = options.merge(dhcp_options_id: @id)
resp = @client.delete_dhcp_options(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(dhcp_options_id: @id)
resp = @client.delete_dhcp_options(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"dhcp_options_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"delete_dhcp_options",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
dhcp_options.delete({
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 [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/dhcp_options.rb#L254-L258 | train | Delete a DHCP options | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
28144,
21906,
1035,
7047,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
28144,
21906,
1035,
70... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_worker_pool_skus_next | def list_worker_pool_skus_next(next_page_link, custom_headers:nil)
response = list_worker_pool_skus_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_worker_pool_skus_next(next_page_link, custom_headers:nil)
response = list_worker_pool_skus_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_worker_pool_skus_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_worker_pool_skus_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless... | Get available SKUs for scaling a worker pool.
Get available SKUs for scaling a worker pool.
@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 [SkuInfoCollection] operation results. | [
"Get",
"available",
"SKUs",
"for",
"scaling",
"a",
"worker",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L6948-L6951 | train | Gets the list of worker pool SKUs. | [
30522,
13366,
2862,
1035,
7309,
1035,
4770,
1035,
15315,
2271,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
7309,
1035,
4770,
1035,
15315,
2271,
1035,
2279,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/placement_group.rb | Aws::EC2.PlacementGroup.delete | def delete(options = {})
options = options.merge(group_name: @name)
resp = @client.delete_placement_group(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(group_name: @name)
resp = @client.delete_placement_group(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"group_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"delete_placement_group",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
placement_group.delete({
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 [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/placement_group.rb#L197-L201 | train | Delete a placement group | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2177,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
11073,
1035,
2177,
1006,
7047,
1007,
24501... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb | Azure::IotHub::Mgmt::V2017_01_19.IotHubResource.get_quota_metrics_next | def get_quota_metrics_next(next_page_link, custom_headers:nil)
response = get_quota_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_quota_metrics_next(next_page_link, custom_headers:nil)
response = get_quota_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_quota_metrics_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_quota_metrics_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"re... | Get the quota metrics for an IoT hub.
Get the quota metrics for an IoT hub.
@param next_page_link [String] The NextLink from the previous successful call
to List operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [IotHubQuotaMetricInfoListResult] operation results. | [
"Get",
"the",
"quota",
"metrics",
"for",
"an",
"IoT",
"hub",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb#L2705-L2708 | train | Gets the quota metrics for the specified resource group. | [
30522,
13366,
2131,
1035,
20563,
1035,
12046,
2015,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
20563,
1035,
12046,
2015,
1035,
2279,
1035,
2004,
6038,
2278,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.provision_cluster_with_http_info | def provision_cluster_with_http_info(provision_fabric_description, timeout:60, custom_headers:nil)
provision_cluster_async(provision_fabric_description, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def provision_cluster_with_http_info(provision_fabric_description, timeout:60, custom_headers:nil)
provision_cluster_async(provision_fabric_description, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"provision_cluster_with_http_info",
"(",
"provision_fabric_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"provision_cluster_async",
"(",
"provision_fabric_description",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":cust... | Provision the code or configuration packages of a Service Fabric cluster.
Validate and provision the code or configuration packages of a Service Fabric
cluster.
@param provision_fabric_description [ProvisionFabricDescription] Describes
the parameters for provisioning a cluster.
@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. | [
"Provision",
"the",
"code",
"or",
"configuration",
"packages",
"of",
"a",
"Service",
"Fabric",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L2380-L2382 | train | Provision a cluster. | [
30522,
13366,
9347,
1035,
9324,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
9347,
1035,
8313,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
9347,
1035,
9324,
1035,
2004,
6038,
2278,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
roo-rb/roo | lib/roo/open_office.rb | Roo.OpenOffice.open_oo_file | def open_oo_file(options)
Zip::File.open(@filename) do |zip_file|
content_entry = zip_file.glob('content.xml').first
fail ArgumentError, ERROR_MISSING_CONTENT_XML unless content_entry
roo_content_xml_path = ::File.join(@tmpdir, 'roo_content.xml')
content_entry.extract(roo_content_xml_path)
decrypt_if_necessary(zip_file, content_entry, roo_content_xml_path, options)
end
end | ruby | def open_oo_file(options)
Zip::File.open(@filename) do |zip_file|
content_entry = zip_file.glob('content.xml').first
fail ArgumentError, ERROR_MISSING_CONTENT_XML unless content_entry
roo_content_xml_path = ::File.join(@tmpdir, 'roo_content.xml')
content_entry.extract(roo_content_xml_path)
decrypt_if_necessary(zip_file, content_entry, roo_content_xml_path, options)
end
end | [
"def",
"open_oo_file",
"(",
"options",
")",
"Zip",
"::",
"File",
".",
"open",
"(",
"@filename",
")",
"do",
"|",
"zip_file",
"|",
"content_entry",
"=",
"zip_file",
".",
"glob",
"(",
"'content.xml'",
")",
".",
"first",
"fail",
"ArgumentError",
",",
"ERROR_MI... | initialization and opening of a spreadsheet file
values for packed: :zip | [
"initialization",
"and",
"opening",
"of",
"a",
"spreadsheet",
"file",
"values",
"for",
"packed",
":",
":",
"zip"
] | 4ec1104f0c3c2a29711c0c907371cd2be12bcc3c | https://github.com/roo-rb/roo/blob/4ec1104f0c3c2a29711c0c907371cd2be12bcc3c/lib/roo/open_office.rb#L56-L65 | train | Open the OO file | [
30522,
13366,
2330,
1035,
1051,
2080,
1035,
5371,
1006,
7047,
1007,
14101,
1024,
1024,
5371,
1012,
2330,
1006,
1030,
5371,
18442,
1007,
2079,
1064,
14101,
1035,
5371,
1064,
4180,
1035,
4443,
1027,
14101,
1035,
5371,
1012,
1043,
4135,
2497,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb | Azure::CDN::Mgmt::V2017_04_02.Endpoints.list_by_profile | def list_by_profile(resource_group_name, profile_name, custom_headers:nil)
first_page = list_by_profile_as_lazy(resource_group_name, profile_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_profile(resource_group_name, profile_name, custom_headers:nil)
first_page = list_by_profile_as_lazy(resource_group_name, profile_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_profile",
"(",
"resource_group_name",
",",
"profile_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_profile_as_lazy",
"(",
"resource_group_name",
",",
"profile_name",
",",
"custom_headers",
":custom_headers",
")",
"first_page",
... | Lists existing CDN endpoints.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param profile_name [String] Name of the CDN profile which is unique within
the resource group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<Endpoint>] operation results. | [
"Lists",
"existing",
"CDN",
"endpoints",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/endpoints.rb#L38-L41 | train | Gets all the segmentation rules in a profile. | [
30522,
13366,
2862,
1035,
2011,
1035,
6337,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2011,
1035,
6337,
1035,
2004,
1035,
13971,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/managers.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Managers.get_device_public_encryption_key_with_http_info | def get_device_public_encryption_key_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
get_device_public_encryption_key_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def get_device_public_encryption_key_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
get_device_public_encryption_key_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"get_device_public_encryption_key_with_http_info",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"get_device_public_encryption_key_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
... | Returns the public encryption key of the device.
@param device_name [String] The device name
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Returns",
"the",
"public",
"encryption",
"key",
"of",
"the",
"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/managers.rb#L620-L622 | train | Gets the public encryption key of the device. | [
30522,
13366,
2131,
1035,
5080,
1035,
2270,
1035,
21999,
1035,
3145,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | runtime/ms_rest_azure/lib/ms_rest_azure/credentials/msi_token_provider.rb | MsRestAzure.MSITokenProvider.set_msi_id | def set_msi_id(request_body, id_type, id_value)
user_assigned_identity = USER_ASSIGNED_IDENTITY.dup
request_body = [request_body, user_assigned_identity].join(',')
request_body['{id_type}'] = id_type
request_body['{user_assigned_identity}'] = ERB::Util.url_encode(id_value)
return request_body
end | ruby | def set_msi_id(request_body, id_type, id_value)
user_assigned_identity = USER_ASSIGNED_IDENTITY.dup
request_body = [request_body, user_assigned_identity].join(',')
request_body['{id_type}'] = id_type
request_body['{user_assigned_identity}'] = ERB::Util.url_encode(id_value)
return request_body
end | [
"def",
"set_msi_id",
"(",
"request_body",
",",
"id_type",
",",
"id_value",
")",
"user_assigned_identity",
"=",
"USER_ASSIGNED_IDENTITY",
".",
"dup",
"request_body",
"=",
"[",
"request_body",
",",
"user_assigned_identity",
"]",
".",
"join",
"(",
"','",
")",
"reques... | Sets user assigned identity value in request body
@param request_body [String] body of the request used to acquire token
@param id_type [String] type of id to send 'client_id', 'object_id' or 'msi_res_id'
@param id_value [String] id of the user assigned identity
@return [String] new request body with the addition of <id_type>=<id_value>. | [
"Sets",
"user",
"assigned",
"identity",
"value",
"in",
"request",
"body",
"@param",
"request_body",
"[",
"String",
"]",
"body",
"of",
"the",
"request",
"used",
"to",
"acquire",
"token",
"@param",
"id_type",
"[",
"String",
"]",
"type",
"of",
"id",
"to",
"se... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/runtime/ms_rest_azure/lib/ms_rest_azure/credentials/msi_token_provider.rb#L202-L209 | train | Set the MSI ID | [
30522,
13366,
2275,
1035,
5796,
2072,
1035,
8909,
1006,
5227,
1035,
2303,
1010,
8909,
1035,
2828,
1010,
8909,
1035,
3643,
1007,
5310,
1035,
4137,
1035,
4767,
1027,
5310,
1035,
4137,
1035,
4767,
1012,
4241,
2361,
5227,
1035,
2303,
1027,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb | Aws::EC2.Vpc.associate_dhcp_options | def associate_dhcp_options(options = {})
options = options.merge(vpc_id: @id)
resp = @client.associate_dhcp_options(options)
resp.data
end | ruby | def associate_dhcp_options(options = {})
options = options.merge(vpc_id: @id)
resp = @client.associate_dhcp_options(options)
resp.data
end | [
"def",
"associate_dhcp_options",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"vpc_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"associate_dhcp_options",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
vpc.associate_dhcp_options({
dhcp_options_id: "String", # required
dry_run: false,
})
@param [Hash] options ({})
@option options [required, String] :dhcp_options_id
The ID of the DHCP options set, or `default` to associate no DHCP
options with the VPC.
@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 [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb#L285-L289 | train | Associate DHCP options with this VPC | [
30522,
13366,
5482,
1035,
28144,
21906,
1035,
7047,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
21210,
2278,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
5482,
1035,
28144,
21906,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.