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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | management/azure_mgmt_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb | Azure::Storage::Mgmt::V2018_11_01.StorageAccounts.list_service_sas | def list_service_sas(resource_group_name, account_name, parameters, custom_headers:nil)
response = list_service_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_service_sas(resource_group_name, account_name, parameters, custom_headers:nil)
response = list_service_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_service_sas",
"(",
"resource_group_name",
",",
"account_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_service_sas_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"parameters",
",",
"custom_headers",
... | List service SAS credentials of a specific resource.
@param resource_group_name [String] The name of the resource group within the
user's subscription. The name is case insensitive.
@param account_name [String] The name of the storage account within the
specified resource group. Storage account names must be between 3 and 24
characters in length and use numbers and lower-case letters only.
@param parameters [ServiceSasParameters] The parameters to provide to list
service SAS credentials.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ListServiceSasResponse] operation results. | [
"List",
"service",
"SAS",
"credentials",
"of",
"a",
"specific",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb#L1110-L1113 | train | Gets the SAS of the specified service account. | [
30522,
13366,
2862,
1035,
2326,
1035,
21871,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2326,
1035,
21871,
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... |
Dynamoid/dynamoid | lib/dynamoid/persistence.rb | Dynamoid.Persistence.update_attributes! | def update_attributes!(attributes)
attributes.each { |attribute, value| write_attribute(attribute, value) }
save!
end | ruby | def update_attributes!(attributes)
attributes.each { |attribute, value| write_attribute(attribute, value) }
save!
end | [
"def",
"update_attributes!",
"(",
"attributes",
")",
"attributes",
".",
"each",
"{",
"|",
"attribute",
",",
"value",
"|",
"write_attribute",
"(",
"attribute",
",",
"value",
")",
"}",
"save!",
"end"
] | Updates multiple attributes at once, saving the object once the updates are complete.
Raises a Dynamoid::Errors::DocumentNotValid exception if there is vaidation and it fails.
@param [Hash] attributes a hash of attributes to update | [
"Updates",
"multiple",
"attributes",
"at",
"once",
"saving",
"the",
"object",
"once",
"the",
"updates",
"are",
"complete",
".",
"Raises",
"a",
"Dynamoid",
"::",
"Errors",
"::",
"DocumentNotValid",
"exception",
"if",
"there",
"is",
"vaidation",
"and",
"it",
"fa... | 9e3d006b039e45877b003564ded65509b10b6354 | https://github.com/Dynamoid/dynamoid/blob/9e3d006b039e45877b003564ded65509b10b6354/lib/dynamoid/persistence.rb#L167-L170 | train | Update the attributes of the object. | [
30522,
13366,
10651,
1035,
12332,
999,
1006,
12332,
1007,
12332,
1012,
2169,
1063,
1064,
17961,
1010,
3643,
1064,
4339,
1035,
17961,
1006,
17961,
1010,
3643,
1007,
1065,
3828,
999,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/node_reports.rb | Azure::Automation::Mgmt::V2015_10_31.NodeReports.get_content_with_http_info | def get_content_with_http_info(resource_group_name, automation_account_name, node_id, report_id, custom_headers:nil)
get_content_async(resource_group_name, automation_account_name, node_id, report_id, custom_headers:custom_headers).value!
end | ruby | def get_content_with_http_info(resource_group_name, automation_account_name, node_id, report_id, custom_headers:nil)
get_content_async(resource_group_name, automation_account_name, node_id, report_id, custom_headers:custom_headers).value!
end | [
"def",
"get_content_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"node_id",
",",
"report_id",
",",
"custom_headers",
":",
"nil",
")",
"get_content_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"node_id",
",",... | Retrieve the Dsc node reports by node id and report id.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param node_id [String] The Dsc node id.
@param report_id [String] The report id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Retrieve",
"the",
"Dsc",
"node",
"reports",
"by",
"node",
"id",
"and",
"report",
"id",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/node_reports.rb#L258-L260 | train | Gets the content of the node. | [
30522,
13366,
2131,
1035,
4180,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
13045,
1035,
8909,
1010,
3189,
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... |
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.delete_image_store_content | def delete_image_store_content(content_path, timeout:60, custom_headers:nil)
response = delete_image_store_content_async(content_path, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def delete_image_store_content(content_path, timeout:60, custom_headers:nil)
response = delete_image_store_content_async(content_path, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete_image_store_content",
"(",
"content_path",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_image_store_content_async",
"(",
"content_path",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_heade... | Deletes existing image store content.
Deletes existing image store content being found within the given image store
relative path. This can be used to delete uploaded application packages once
they are provisioned.
@param content_path [String] Relative path to file or folder in the image
store from its root.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"existing",
"image",
"store",
"content",
"."
] | 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#L19413-L19416 | train | Delete the content of an image store. | [
30522,
13366,
3972,
12870,
1035,
3746,
1035,
3573,
1035,
4180,
1006,
4180,
1035,
4130,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
3746,
1035,
3573,
1035,
4180,
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... |
Katello/katello | app/models/katello/kt_environment.rb | Katello.KTEnvironment.insert_successor | def insert_successor(create_params, path)
self.class.transaction do
new_successor = self.class.create!(create_params)
if library?
if path
old_successor = path.first
old_successor.prior = new_successor
end
save_successor new_successor
elsif successor.nil?
save_successor new_successor
else
old_successor = successor
old_successor.prior = new_successor
save_successor new_successor
end
fail HttpErrors::UnprocessableEntity, _('An environment is missing a prior') unless all_have_prior?
new_successor
end
end | ruby | def insert_successor(create_params, path)
self.class.transaction do
new_successor = self.class.create!(create_params)
if library?
if path
old_successor = path.first
old_successor.prior = new_successor
end
save_successor new_successor
elsif successor.nil?
save_successor new_successor
else
old_successor = successor
old_successor.prior = new_successor
save_successor new_successor
end
fail HttpErrors::UnprocessableEntity, _('An environment is missing a prior') unless all_have_prior?
new_successor
end
end | [
"def",
"insert_successor",
"(",
"create_params",
",",
"path",
")",
"self",
".",
"class",
".",
"transaction",
"do",
"new_successor",
"=",
"self",
".",
"class",
".",
"create!",
"(",
"create_params",
")",
"if",
"library?",
"if",
"path",
"old_successor",
"=",
"p... | creates new env from create_params with self as a prior | [
"creates",
"new",
"env",
"from",
"create_params",
"with",
"self",
"as",
"a",
"prior"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/kt_environment.rb#L104-L123 | train | Insert a successor into the database | [
30522,
13366,
19274,
1035,
6332,
1006,
3443,
1035,
11498,
5244,
1010,
4130,
1007,
2969,
1012,
2465,
1012,
12598,
2079,
2047,
1035,
6332,
1027,
2969,
1012,
2465,
1012,
3443,
999,
1006,
3443,
1035,
11498,
5244,
1007,
2065,
3075,
1029,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activerecord/lib/active_record/autosave_association.rb | ActiveRecord.AutosaveAssociation.save_has_one_association | def save_has_one_association(reflection)
association = association_instance_get(reflection.name)
record = association && association.load_target
if record && !record.destroyed?
autosave = reflection.options[:autosave]
if autosave && record.marked_for_destruction?
record.destroy
elsif autosave != false
key = reflection.options[:primary_key] ? send(reflection.options[:primary_key]) : id
if (autosave && record.changed_for_autosave?) || new_record? || record_changed?(reflection, record, key)
unless reflection.through_reflection
record[reflection.foreign_key] = key
if inverse_reflection = reflection.inverse_of
record.association(inverse_reflection.name).loaded!
end
end
saved = record.save(validate: !autosave)
raise ActiveRecord::Rollback if !saved && autosave
saved
end
end
end
end | ruby | def save_has_one_association(reflection)
association = association_instance_get(reflection.name)
record = association && association.load_target
if record && !record.destroyed?
autosave = reflection.options[:autosave]
if autosave && record.marked_for_destruction?
record.destroy
elsif autosave != false
key = reflection.options[:primary_key] ? send(reflection.options[:primary_key]) : id
if (autosave && record.changed_for_autosave?) || new_record? || record_changed?(reflection, record, key)
unless reflection.through_reflection
record[reflection.foreign_key] = key
if inverse_reflection = reflection.inverse_of
record.association(inverse_reflection.name).loaded!
end
end
saved = record.save(validate: !autosave)
raise ActiveRecord::Rollback if !saved && autosave
saved
end
end
end
end | [
"def",
"save_has_one_association",
"(",
"reflection",
")",
"association",
"=",
"association_instance_get",
"(",
"reflection",
".",
"name",
")",
"record",
"=",
"association",
"&&",
"association",
".",
"load_target",
"if",
"record",
"&&",
"!",
"record",
".",
"destro... | Saves the associated record if it's new or <tt>:autosave</tt> is enabled
on the association.
In addition, it will destroy the association if it was marked for
destruction with #mark_for_destruction.
This all happens inside a transaction, _if_ the Transactions module is included into
ActiveRecord::Base after the AutosaveAssociation module, which it does by default. | [
"Saves",
"the",
"associated",
"record",
"if",
"it",
"s",
"new",
"or",
"<tt",
">",
":",
"autosave<",
"/",
"tt",
">",
"is",
"enabled",
"on",
"the",
"association",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/autosave_association.rb#L428-L454 | train | Save has_one association to database | [
30522,
13366,
3828,
1035,
2038,
1035,
2028,
1035,
2523,
1006,
9185,
1007,
2523,
1027,
2523,
1035,
6013,
1035,
2131,
1006,
9185,
1012,
2171,
1007,
2501,
1027,
2523,
1004,
1004,
2523,
1012,
7170,
1035,
4539,
2065,
2501,
1004,
1004,
999,
250... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_search/lib/2015-08-19/generated/azure_mgmt_search/services.rb | Azure::Search::Mgmt::V2015_08_19.Services.update_with_http_info | def update_with_http_info(resource_group_name, search_service_name, service, search_management_request_options:nil, custom_headers:nil)
update_async(resource_group_name, search_service_name, service, search_management_request_options:search_management_request_options, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, search_service_name, service, search_management_request_options:nil, custom_headers:nil)
update_async(resource_group_name, search_service_name, service, search_management_request_options:search_management_request_options, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"search_service_name",
",",
"service",
",",
"search_management_request_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
"search_service_name",
",... | Updates an existing Search service in the given resource group.
@param resource_group_name [String] The name of the resource group within the
current subscription. You can obtain this value from the Azure Resource
Manager API or the portal.
@param search_service_name [String] The name of the Azure Search service to
update.
@param service [SearchService] The definition of the Search service to
update.
@param search_management_request_options [SearchManagementRequestOptions]
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. | [
"Updates",
"an",
"existing",
"Search",
"service",
"in",
"the",
"given",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_search/lib/2015-08-19/generated/azure_mgmt_search/services.rb#L131-L133 | train | Updates an existing search service s index. | [
30522,
13366,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3945,
1035,
2326,
1035,
2171,
1010,
2326,
1010,
3945,
1035,
2968,
1035,
5227,
1035,
7047,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.get_site_detector_slot_next | def get_site_detector_slot_next(next_page_link, custom_headers:nil)
response = get_site_detector_slot_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_site_detector_slot_next(next_page_link, custom_headers:nil)
response = get_site_detector_slot_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_site_detector_slot_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_site_detector_slot_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unle... | Get Detector
Get Detector
@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 [DiagnosticDetectorCollection] operation results. | [
"Get",
"Detector"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L3474-L3477 | train | Gets the site detector slot. | [
30522,
13366,
2131,
1035,
2609,
1035,
19034,
1035,
10453,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2609,
1035,
19034,
1035,
10453,
1035,
2279,
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_network/lib/2019-02-01/generated/azure_mgmt_network/interface_endpoints.rb | Azure::Network::Mgmt::V2019_02_01.InterfaceEndpoints.delete | def delete(resource_group_name, interface_endpoint_name, custom_headers:nil)
response = delete_async(resource_group_name, interface_endpoint_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, interface_endpoint_name, custom_headers:nil)
response = delete_async(resource_group_name, interface_endpoint_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"interface_endpoint_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"interface_endpoint_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!"... | Deletes the specified interface endpoint.
@param resource_group_name [String] The name of the resource group.
@param interface_endpoint_name [String] The name of the interface endpoint.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"interface",
"endpoint",
"."
] | 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#L32-L35 | train | Deletes an interface endpoint. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8278,
1035,
2203,
8400,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/app/commands/decidim/invite_user_again.rb | Decidim.InviteUserAgain.call | def call
return broadcast(:invalid) unless user&.invited_to_sign_up?
user.invite!(user.invited_by, invitation_instructions: instructions)
broadcast(:ok)
end | ruby | def call
return broadcast(:invalid) unless user&.invited_to_sign_up?
user.invite!(user.invited_by, invitation_instructions: instructions)
broadcast(:ok)
end | [
"def",
"call",
"return",
"broadcast",
"(",
":invalid",
")",
"unless",
"user",
"&.",
"invited_to_sign_up?",
"user",
".",
"invite!",
"(",
"user",
".",
"invited_by",
",",
"invitation_instructions",
":",
"instructions",
")",
"broadcast",
"(",
":ok",
")",
"end"
] | Public: Initializes the command.
form - A form object with the params. | [
"Public",
":",
"Initializes",
"the",
"command",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/commands/decidim/invite_user_again.rb#L14-L20 | train | invites the user to sign up and returns the result of the call | [
30522,
13366,
2655,
2709,
3743,
1006,
1024,
19528,
1007,
4983,
5310,
1004,
1012,
4778,
1035,
2000,
1035,
3696,
1035,
2039,
1029,
5310,
1012,
13260,
999,
1006,
5310,
1012,
4778,
1035,
2011,
1010,
8468,
1035,
8128,
1024,
8128,
1007,
3743,
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... |
roo-rb/roo | lib/roo/excelx.rb | Roo.Excelx.extract_worksheet_ids | def extract_worksheet_ids(entries, path)
wb = entries.find { |e| e.name[/workbook.xml$/] }
fail ArgumentError 'missing required workbook file' if wb.nil?
wb.extract(path)
workbook_doc = Roo::Utils.load_xml(path).remove_namespaces!
workbook_doc.xpath('//sheet').map { |s| s['id'] }
end | ruby | def extract_worksheet_ids(entries, path)
wb = entries.find { |e| e.name[/workbook.xml$/] }
fail ArgumentError 'missing required workbook file' if wb.nil?
wb.extract(path)
workbook_doc = Roo::Utils.load_xml(path).remove_namespaces!
workbook_doc.xpath('//sheet').map { |s| s['id'] }
end | [
"def",
"extract_worksheet_ids",
"(",
"entries",
",",
"path",
")",
"wb",
"=",
"entries",
".",
"find",
"{",
"|",
"e",
"|",
"e",
".",
"name",
"[",
"/",
"/",
"]",
"}",
"fail",
"ArgumentError",
"'missing required workbook file'",
"if",
"wb",
".",
"nil?",
"wb"... | Internal: extracts the worksheet_ids from the workbook.xml file. xlsx
documents require a workbook.xml file, so a if the file is missing
it is not a valid xlsx file. In these cases, an ArgumentError is
raised.
wb - a Zip::Entry for the workbook.xml file.
path - A String for Zip::Entry's destination path.
Examples
extract_worksheet_ids(<Zip::Entry>, 'tmpdir/roo_workbook.xml')
# => ["rId1", "rId2", "rId3"]
Returns an Array of Strings. | [
"Internal",
":",
"extracts",
"the",
"worksheet_ids",
"from",
"the",
"workbook",
".",
"xml",
"file",
".",
"xlsx",
"documents",
"require",
"a",
"workbook",
".",
"xml",
"file",
"so",
"a",
"if",
"the",
"file",
"is",
"missing",
"it",
"is",
"not",
"a",
"valid"... | 4ec1104f0c3c2a29711c0c907371cd2be12bcc3c | https://github.com/roo-rb/roo/blob/4ec1104f0c3c2a29711c0c907371cd2be12bcc3c/lib/roo/excelx.rb#L331-L338 | train | Extract the sheet ids from the workbook file | [
30522,
13366,
14817,
1035,
2573,
21030,
2102,
1035,
8909,
2015,
1006,
10445,
1010,
4130,
1007,
25610,
1027,
10445,
1012,
2424,
1063,
1064,
1041,
1064,
1041,
1012,
2171,
1031,
1013,
2147,
8654,
1012,
20950,
1002,
1013,
1033,
1065,
8246,
6685... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
etewiah/property_web_builder | app/services/pwb/page_part_manager.rb | Pwb.PagePartManager.seed_container_block_content | def seed_container_block_content(locale, seed_content)
page_part_editor_setup = page_part.editor_setup
raise "Invalid editorBlocks for page_part_editor_setup" unless page_part_editor_setup && page_part_editor_setup["editorBlocks"].present?
# page = page_part.page
# page_part_key uniquely identifies a fragment
# page_part_key = page_part.page_part_key
# container for json to be attached to page details
locale_block_content_json = {"blocks" => {}}
# {"blocks"=>{"title_a"=>{"content"=>"about our agency"}, "content_a"=>{"content"=>""}}}
page_part_editor_setup["editorBlocks"].each do |configColBlocks|
configColBlocks.each do |configRowBlock|
row_block_label = configRowBlock["label"]
row_block_content = ""
# find the content for current block from within the seed content
if seed_content[row_block_label]
if configRowBlock["isImage"]
photo = seed_fragment_photo row_block_label, seed_content[row_block_label]
if photo.present? && photo.optimized_image_url.present?
# optimized_image_url is defined in content_photo and will
# return cloudinary url or filesystem url depending on settings
row_block_content = photo.optimized_image_url
else
row_block_content = "http://via.placeholder.com/350x250"
end
else
row_block_content = seed_content[row_block_label]
end
end
locale_block_content_json["blocks"][row_block_label] = {"content" => row_block_content}
end
end
# # save the block contents (in associated page_part model)
# updated_details = container.set_page_part_block_contents page_part_key, locale, locale_block_content_json
# # retrieve the contents saved above and use to rebuild html for that page_part
# # (and save it in associated page_content model)
# fragment_html = container.rebuild_page_content page_part_key, locale
update_page_part_content locale, locale_block_content_json
p " #{page_part_key} content set for #{locale}."
end | ruby | def seed_container_block_content(locale, seed_content)
page_part_editor_setup = page_part.editor_setup
raise "Invalid editorBlocks for page_part_editor_setup" unless page_part_editor_setup && page_part_editor_setup["editorBlocks"].present?
# page = page_part.page
# page_part_key uniquely identifies a fragment
# page_part_key = page_part.page_part_key
# container for json to be attached to page details
locale_block_content_json = {"blocks" => {}}
# {"blocks"=>{"title_a"=>{"content"=>"about our agency"}, "content_a"=>{"content"=>""}}}
page_part_editor_setup["editorBlocks"].each do |configColBlocks|
configColBlocks.each do |configRowBlock|
row_block_label = configRowBlock["label"]
row_block_content = ""
# find the content for current block from within the seed content
if seed_content[row_block_label]
if configRowBlock["isImage"]
photo = seed_fragment_photo row_block_label, seed_content[row_block_label]
if photo.present? && photo.optimized_image_url.present?
# optimized_image_url is defined in content_photo and will
# return cloudinary url or filesystem url depending on settings
row_block_content = photo.optimized_image_url
else
row_block_content = "http://via.placeholder.com/350x250"
end
else
row_block_content = seed_content[row_block_label]
end
end
locale_block_content_json["blocks"][row_block_label] = {"content" => row_block_content}
end
end
# # save the block contents (in associated page_part model)
# updated_details = container.set_page_part_block_contents page_part_key, locale, locale_block_content_json
# # retrieve the contents saved above and use to rebuild html for that page_part
# # (and save it in associated page_content model)
# fragment_html = container.rebuild_page_content page_part_key, locale
update_page_part_content locale, locale_block_content_json
p " #{page_part_key} content set for #{locale}."
end | [
"def",
"seed_container_block_content",
"(",
"locale",
",",
"seed_content",
")",
"page_part_editor_setup",
"=",
"page_part",
".",
"editor_setup",
"raise",
"\"Invalid editorBlocks for page_part_editor_setup\"",
"unless",
"page_part_editor_setup",
"&&",
"page_part_editor_setup",
"["... | seed_content is ... | [
"seed_content",
"is",
"..."
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/services/pwb/page_part_manager.rb#L56-L97 | train | seed the content of a block in a page part | [
30522,
13366,
6534,
1035,
11661,
1035,
3796,
1035,
4180,
1006,
2334,
2063,
1010,
6534,
1035,
4180,
1007,
3931,
1035,
2112,
1035,
3559,
1035,
16437,
1027,
3931,
1035,
2112,
1012,
3559,
1035,
30524,
1033,
1012,
2556,
1029,
1001,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_service_fabric/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb | Azure::ServiceFabric::Mgmt::V2017_07_01_preview.Clusters.begin_update_with_http_info | def begin_update_with_http_info(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
begin_update_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_with_http_info(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:nil)
begin_update_async(resource_group_name, cluster_name, api_version, subscription_id, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_with_http_info",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"api_version",
",",
"subscription_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_async",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"api... | Update cluster configuration
Update cluster configuration
@param resource_group_name [String] The name of the resource group.
@param cluster_name [String] The name of the cluster resource
@param api_version [String] The version of the API.
@param subscription_id [String] The customer subscription identifier
@param parameters [ClusterUpdateParameters] The parameters which contains the
property value and property name which used to update the cluster
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. | [
"Update",
"cluster",
"configuration"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_fabric/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb#L694-L696 | train | Updates a cluster s existing specification. | [
30522,
13366,
4088,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9324,
1035,
2171,
1010,
17928,
1035,
2544,
1010,
15002,
1035,
8909,
1010,
11709,
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... |
activeadmin/activeadmin | lib/active_admin/form_builder.rb | ActiveAdmin.HasManyBuilder.render_has_many_form | def render_has_many_form(form_builder, parent, &block)
index = parent && form_builder.send(:parent_child_index, parent)
template.concat template.capture { yield(form_builder, index) }
template.concat has_many_actions(form_builder, "".html_safe)
end | ruby | def render_has_many_form(form_builder, parent, &block)
index = parent && form_builder.send(:parent_child_index, parent)
template.concat template.capture { yield(form_builder, index) }
template.concat has_many_actions(form_builder, "".html_safe)
end | [
"def",
"render_has_many_form",
"(",
"form_builder",
",",
"parent",
",",
"&",
"block",
")",
"index",
"=",
"parent",
"&&",
"form_builder",
".",
"send",
"(",
":parent_child_index",
",",
"parent",
")",
"template",
".",
"concat",
"template",
".",
"capture",
"{",
... | Renders the Formtastic inputs then appends ActiveAdmin delete and sort actions. | [
"Renders",
"the",
"Formtastic",
"inputs",
"then",
"appends",
"ActiveAdmin",
"delete",
"and",
"sort",
"actions",
"."
] | 0759c8dcf97865748c9344459162ac3c7e65a6cd | https://github.com/activeadmin/activeadmin/blob/0759c8dcf97865748c9344459162ac3c7e65a6cd/lib/active_admin/form_builder.rb#L101-L105 | train | Renders a has_many form. | [
30522,
13366,
17552,
1035,
2038,
1035,
2116,
1035,
2433,
1006,
2433,
1035,
12508,
1010,
6687,
1010,
1004,
3796,
1007,
5950,
1027,
6687,
1004,
1004,
2433,
1035,
12508,
1012,
4604,
1006,
1024,
6687,
1035,
2775,
1035,
5950,
1010,
6687,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_monitor/lib/2017-04-01/generated/azure_mgmt_monitor/activity_log_alerts.rb | Azure::Monitor::Mgmt::V2017_04_01.ActivityLogAlerts.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, activity_log_alert_name, activity_log_alert, custom_headers:nil)
create_or_update_async(resource_group_name, activity_log_alert_name, activity_log_alert, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, activity_log_alert_name, activity_log_alert, custom_headers:nil)
create_or_update_async(resource_group_name, activity_log_alert_name, activity_log_alert, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"activity_log_alert_name",
",",
"activity_log_alert",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"activity_log_alert_name",
",",
"activity_log_aler... | Create a new activity log alert or update an existing one.
@param resource_group_name [String] The name of the resource group.
@param activity_log_alert_name [String] The name of the activity log alert.
@param activity_log_alert [ActivityLogAlertResource] The activity log alert
to create or use for the 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. | [
"Create",
"a",
"new",
"activity",
"log",
"alert",
"or",
"update",
"an",
"existing",
"one",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_monitor/lib/2017-04-01/generated/azure_mgmt_monitor/activity_log_alerts.rb#L53-L55 | train | Creates or updates an existing ActivityLogAlert. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4023,
1035,
8833,
1035,
9499,
1035,
2171,
1010,
4023,
1035,
8833,
1035,
9499,
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... |
stympy/faker | lib/helpers/unique_generator.rb | Faker.UniqueGenerator.method_missing | def method_missing(name, *arguments)
self.class.marked_unique.add(self)
@max_retries.times do
result = @generator.public_send(name, *arguments)
next if @previous_results[[name, arguments]].include?(result)
@previous_results[[name, arguments]] << result
return result
end
raise RetryLimitExceeded, "Retry limit exceeded for #{name}"
end | ruby | def method_missing(name, *arguments)
self.class.marked_unique.add(self)
@max_retries.times do
result = @generator.public_send(name, *arguments)
next if @previous_results[[name, arguments]].include?(result)
@previous_results[[name, arguments]] << result
return result
end
raise RetryLimitExceeded, "Retry limit exceeded for #{name}"
end | [
"def",
"method_missing",
"(",
"name",
",",
"*",
"arguments",
")",
"self",
".",
"class",
".",
"marked_unique",
".",
"add",
"(",
"self",
")",
"@max_retries",
".",
"times",
"do",
"result",
"=",
"@generator",
".",
"public_send",
"(",
"name",
",",
"arguments",
... | rubocop:disable Style/MethodMissingSuper | [
"rubocop",
":",
"disable",
"Style",
"/",
"MethodMissingSuper"
] | cc9f09e287fea252339c485046fe99a9ff41df07 | https://github.com/stympy/faker/blob/cc9f09e287fea252339c485046fe99a9ff41df07/lib/helpers/unique_generator.rb#L18-L31 | train | Calls the generator method with the given name and arguments. | [
30522,
13366,
4118,
1035,
4394,
1006,
2171,
1010,
1008,
9918,
1007,
2969,
1012,
2465,
1012,
4417,
1035,
4310,
1012,
5587,
1006,
2969,
1007,
1030,
4098,
1035,
2128,
21011,
1012,
2335,
2079,
2765,
1027,
1030,
13103,
1012,
2270,
1035,
4604,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/response/raise_error.rb | Github.Response::RaiseError.on_complete | def on_complete(env)
status_code = env[:status].to_i
service_error = Github::Error::ServiceError
error_class = service_error.error_mapping[status_code]
if !error_class and (400...600) === status_code
error_class = service_error
end
raise error_class.new(env) if error_class
end | ruby | def on_complete(env)
status_code = env[:status].to_i
service_error = Github::Error::ServiceError
error_class = service_error.error_mapping[status_code]
if !error_class and (400...600) === status_code
error_class = service_error
end
raise error_class.new(env) if error_class
end | [
"def",
"on_complete",
"(",
"env",
")",
"status_code",
"=",
"env",
"[",
":status",
"]",
".",
"to_i",
"service_error",
"=",
"Github",
"::",
"Error",
"::",
"ServiceError",
"error_class",
"=",
"service_error",
".",
"error_mapping",
"[",
"status_code",
"]",
"if",
... | Check if status code requires raising a ServiceError
@api private | [
"Check",
"if",
"status",
"code",
"requires",
"raising",
"a",
"ServiceError"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/response/raise_error.rb#L12-L20 | train | Returns an array of error objects for the given environment. | [
30522,
13366,
2006,
1035,
3143,
1006,
4372,
2615,
1007,
3570,
1035,
3642,
1027,
4372,
2615,
1031,
1024,
3570,
1033,
1012,
2000,
1035,
1045,
2326,
1035,
7561,
1027,
21025,
2705,
12083,
1024,
1024,
7561,
1024,
1024,
2326,
2121,
29165,
7561,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/client/repos/comments.rb | Github.Client::Repos::Comments.update | def update(*args)
arguments(args, required: [:user, :repo, :id]) do
assert_required REQUIRED_COMMENT_OPTIONS
end
patch_request("/repos/#{arguments.user}/#{arguments.repo}/comments/#{arguments.id}", arguments.params)
end | ruby | def update(*args)
arguments(args, required: [:user, :repo, :id]) do
assert_required REQUIRED_COMMENT_OPTIONS
end
patch_request("/repos/#{arguments.user}/#{arguments.repo}/comments/#{arguments.id}", arguments.params)
end | [
"def",
"update",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
",",
":id",
"]",
")",
"do",
"assert_required",
"REQUIRED_COMMENT_OPTIONS",
"end",
"patch_request",
"(",
"\"/repos/#{arguments.user}/#{arguments.repo... | Update a commit comment
@param [Hash] params
@option params [String] :body
Required. The contents of the comment.
@example
github = Github.new
github.repos.comments.update 'user-name', 'repo-name', 'id',
body: "Nice change"
@api public | [
"Update",
"a",
"commit",
"comment"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/repos/comments.rb#L104-L110 | train | Update a comment | [
30522,
13366,
10651,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1010,
1024,
30524,
11498,
5244,
1007,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | frameit/lib/frameit/config_parser.rb | Frameit.ConfigParser.validate_values | def validate_values(values)
values.each do |key, value|
if value.kind_of?(Hash)
validate_values(value) # recursive call
else
validate_key(key, value)
end
end
end | ruby | def validate_values(values)
values.each do |key, value|
if value.kind_of?(Hash)
validate_values(value) # recursive call
else
validate_key(key, value)
end
end
end | [
"def",
"validate_values",
"(",
"values",
")",
"values",
".",
"each",
"do",
"|",
"key",
",",
"value",
"|",
"if",
"value",
".",
"kind_of?",
"(",
"Hash",
")",
"validate_values",
"(",
"value",
")",
"# recursive call",
"else",
"validate_key",
"(",
"key",
",",
... | Make sure the paths/colors are valid | [
"Make",
"sure",
"the",
"paths",
"/",
"colors",
"are",
"valid"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/frameit/lib/frameit/config_parser.rb#L67-L75 | train | Validate the values | [
30522,
13366,
9398,
3686,
1035,
5300,
1006,
5300,
1007,
5300,
1012,
2169,
2079,
1064,
3145,
1010,
3643,
1064,
2065,
3643,
1012,
2785,
1035,
1997,
1029,
1006,
23325,
1007,
9398,
3686,
1035,
5300,
1006,
3643,
1007,
1001,
28667,
9236,
3512,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_next | def list_deployments_at_management_group_next(next_page_link, custom_headers:nil)
response = list_deployments_at_management_group_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_deployments_at_management_group_next(next_page_link, custom_headers:nil)
response = list_deployments_at_management_group_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_deployments_at_management_group_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_deployments_at_management_group_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"respons... | Gets all deployments for a remediation at management group scope.
@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 [RemediationDeploymentsListResult] operation results. | [
"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#L2357-L2360 | train | Gets the list of deployments at management group level. | [
30522,
13366,
2862,
1035,
10813,
2015,
1035,
2012,
1035,
2968,
1035,
2177,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
10813,
2015,
1035,
2012,
1035,
2968,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/linter.rb | HamlLint.Linter.inline_node_content | def inline_node_content(node)
inline_content = node.script
if contains_interpolation?(inline_content)
strip_surrounding_quotes(inline_content)
else
inline_content
end
end | ruby | def inline_node_content(node)
inline_content = node.script
if contains_interpolation?(inline_content)
strip_surrounding_quotes(inline_content)
else
inline_content
end
end | [
"def",
"inline_node_content",
"(",
"node",
")",
"inline_content",
"=",
"node",
".",
"script",
"if",
"contains_interpolation?",
"(",
"inline_content",
")",
"strip_surrounding_quotes",
"(",
"inline_content",
")",
"else",
"inline_content",
"end",
"end"
] | Get the inline content for this node.
Inline content is the content that appears inline right after the
tag/script. For example, in the code below...
%tag Some inline content
..."Some inline content" would be the inline content.
@param node [HamlLint::Tree::Node]
@return [String] | [
"Get",
"the",
"inline",
"content",
"for",
"this",
"node",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/linter.rb#L138-L146 | train | Returns the inline content of the node | [
30522,
13366,
23881,
1035,
13045,
1035,
4180,
1006,
13045,
1007,
23881,
1035,
4180,
1027,
13045,
1012,
5896,
2065,
3397,
1035,
6970,
18155,
3370,
1029,
1006,
23881,
1035,
4180,
1007,
6167,
1035,
4193,
1035,
16614,
1006,
23881,
1035,
4180,
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/renderer/template_renderer.rb | ActionView.TemplateRenderer.determine_template | def determine_template(options)
keys = options.has_key?(:locals) ? options[:locals].keys : []
if options.key?(:body)
Template::Text.new(options[:body])
elsif options.key?(:plain)
Template::Text.new(options[:plain])
elsif options.key?(:html)
Template::HTML.new(options[:html], formats.first)
elsif options.key?(:file)
if File.exist?(options[:file])
Template::RawFile.new(options[:file])
else
ActiveSupport::Deprecation.warn "render file: should be given the absolute path to a file"
@lookup_context.with_fallbacks.find_template(options[:file], nil, false, keys, @details)
end
elsif options.key?(:inline)
handler = Template.handler_for_extension(options[:type] || "erb")
format = if handler.respond_to?(:default_format)
handler.default_format
else
@lookup_context.formats.first
end
Template::Inline.new(options[:inline], "inline template", handler, locals: keys, format: format)
elsif options.key?(:template)
if options[:template].respond_to?(:render)
options[:template]
else
@lookup_context.find_template(options[:template], options[:prefixes], false, keys, @details)
end
else
raise ArgumentError, "You invoked render but did not give any of :partial, :template, :inline, :file, :plain, :html or :body option."
end
end | ruby | def determine_template(options)
keys = options.has_key?(:locals) ? options[:locals].keys : []
if options.key?(:body)
Template::Text.new(options[:body])
elsif options.key?(:plain)
Template::Text.new(options[:plain])
elsif options.key?(:html)
Template::HTML.new(options[:html], formats.first)
elsif options.key?(:file)
if File.exist?(options[:file])
Template::RawFile.new(options[:file])
else
ActiveSupport::Deprecation.warn "render file: should be given the absolute path to a file"
@lookup_context.with_fallbacks.find_template(options[:file], nil, false, keys, @details)
end
elsif options.key?(:inline)
handler = Template.handler_for_extension(options[:type] || "erb")
format = if handler.respond_to?(:default_format)
handler.default_format
else
@lookup_context.formats.first
end
Template::Inline.new(options[:inline], "inline template", handler, locals: keys, format: format)
elsif options.key?(:template)
if options[:template].respond_to?(:render)
options[:template]
else
@lookup_context.find_template(options[:template], options[:prefixes], false, keys, @details)
end
else
raise ArgumentError, "You invoked render but did not give any of :partial, :template, :inline, :file, :plain, :html or :body option."
end
end | [
"def",
"determine_template",
"(",
"options",
")",
"keys",
"=",
"options",
".",
"has_key?",
"(",
":locals",
")",
"?",
"options",
"[",
":locals",
"]",
".",
"keys",
":",
"[",
"]",
"if",
"options",
".",
"key?",
"(",
":body",
")",
"Template",
"::",
"Text",
... | Determine the template to be rendered using the given options. | [
"Determine",
"the",
"template",
"to",
"be",
"rendered",
"using",
"the",
"given",
"options",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/renderer/template_renderer.rb#L19-L52 | train | Determine the template object | [
30522,
13366,
5646,
1035,
23561,
1006,
7047,
1007,
6309,
1027,
7047,
1012,
2038,
1035,
3145,
1029,
1006,
1024,
10575,
1007,
1029,
7047,
1031,
1024,
10575,
1033,
1012,
6309,
1024,
1031,
1033,
2065,
7047,
1012,
3145,
1029,
1006,
1024,
2303,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
watir/watir | lib/watir/elements/element.rb | Watir.Element.click | def click(*modifiers)
# TODO: Should wait_for_enabled be default, or `Button` specific behavior?
element_call(:wait_for_enabled) do
if modifiers.any?
action = driver.action
modifiers.each { |mod| action.key_down mod }
action.click @element
modifiers.each { |mod| action.key_up mod }
action.perform
else
@element.click
end
end
browser.after_hooks.run
end | ruby | def click(*modifiers)
# TODO: Should wait_for_enabled be default, or `Button` specific behavior?
element_call(:wait_for_enabled) do
if modifiers.any?
action = driver.action
modifiers.each { |mod| action.key_down mod }
action.click @element
modifiers.each { |mod| action.key_up mod }
action.perform
else
@element.click
end
end
browser.after_hooks.run
end | [
"def",
"click",
"(",
"*",
"modifiers",
")",
"# TODO: Should wait_for_enabled be default, or `Button` specific behavior?",
"element_call",
"(",
":wait_for_enabled",
")",
"do",
"if",
"modifiers",
".",
"any?",
"action",
"=",
"driver",
".",
"action",
"modifiers",
".",
"each... | Clicks the element, optionally while pressing the given modifier keys.
Note that support for holding a modifier key is currently experimental,
and may not work at all.
@example Click an element
browser.element(name: "new_user_button").click
@example Click an element with shift key pressed
browser.element(name: "new_user_button").click(:shift)
@example Click an element with several modifier keys pressed
browser.element(name: "new_user_button").click(:shift, :control)
@param [:shift, :alt, :control, :command, :meta] modifiers to press while clicking. | [
"Clicks",
"the",
"element",
"optionally",
"while",
"pressing",
"the",
"given",
"modifier",
"keys",
".",
"Note",
"that",
"support",
"for",
"holding",
"a",
"modifier",
"key",
"is",
"currently",
"experimental",
"and",
"may",
"not",
"work",
"at",
"all",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/elements/element.rb#L143-L159 | train | Clicks the element with the given modifiers. | [
30522,
13366,
11562,
1006,
1008,
16913,
28295,
1007,
1001,
28681,
2080,
1024,
2323,
3524,
1035,
2005,
1035,
9124,
2022,
12398,
1010,
2030,
1036,
6462,
1036,
3563,
5248,
1029,
5783,
1035,
2655,
1006,
1024,
3524,
1035,
2005,
1035,
9124,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_analysis_services/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb | Azure::AnalysisServices::Mgmt::V2017_08_01_beta.Servers.list_skus_for_existing | def list_skus_for_existing(resource_group_name, server_name, custom_headers:nil)
response = list_skus_for_existing_async(resource_group_name, server_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_skus_for_existing(resource_group_name, server_name, custom_headers:nil)
response = list_skus_for_existing_async(resource_group_name, server_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_skus_for_existing",
"(",
"resource_group_name",
",",
"server_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_skus_for_existing_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Lists eligible SKUs for an Analysis Services resource.
@param resource_group_name [String] The name of the Azure Resource group of
which a given Analysis Services server is part. This name must be at least 1
character in length, and no more than 90.
@param server_name [String] The name of the Analysis Services server. It must
be at least 3 characters in length, and no more than 63.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SkuEnumerationForExistingResourceResult] operation results. | [
"Lists",
"eligible",
"SKUs",
"for",
"an",
"Analysis",
"Services",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_analysis_services/lib/2017-08-01-beta/generated/azure_mgmt_analysis_services/servers.rb#L648-L651 | train | Gets the skus for the specified server. | [
30522,
13366,
2862,
1035,
15315,
2271,
1035,
2005,
1035,
4493,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
15315,
2271,
1035,
2005,
1035,
4493,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | build_tools/changelog.rb | BuildTools.Changelog.add_entry | def add_entry(options)
add_unreleased_changes_section unless read.lines.to_a[0].strip == 'Unreleased Changes'
lines = read.lines.to_a
lines = lines[0..2] + Entry.new(options).lines + lines[3..-1]
write(lines.join)
end | ruby | def add_entry(options)
add_unreleased_changes_section unless read.lines.to_a[0].strip == 'Unreleased Changes'
lines = read.lines.to_a
lines = lines[0..2] + Entry.new(options).lines + lines[3..-1]
write(lines.join)
end | [
"def",
"add_entry",
"(",
"options",
")",
"add_unreleased_changes_section",
"unless",
"read",
".",
"lines",
".",
"to_a",
"[",
"0",
"]",
".",
"strip",
"==",
"'Unreleased Changes'",
"lines",
"=",
"read",
".",
"lines",
".",
"to_a",
"lines",
"=",
"lines",
"[",
... | @option options [required, Symbol] :type
Must be one of the following:
* :feature
* :issue
@option options [required, String<markdown>] :text
A description of the change. This should be formatted as markdown.
@option options [optional, Integer] :issue A related GitHub issue number.
@option options [optional, Integer] :pull A related GitHub pull request number. | [
"@option",
"options",
"[",
"required",
"Symbol",
"]",
":",
"type",
"Must",
"be",
"one",
"of",
"the",
"following",
":"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/build_tools/changelog.rb#L51-L56 | train | Add an entry to the archive | [
30522,
13366,
5587,
1035,
4443,
1006,
7047,
1007,
5587,
1035,
13270,
1035,
3431,
1035,
2930,
4983,
3191,
1012,
3210,
1012,
2000,
1035,
1037,
1031,
1014,
1033,
1012,
30524,
1012,
1011,
1015,
1033,
4339,
1006,
3210,
1012,
3693,
1007,
2203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/api/v1_items_api.rb | SquareConnect.V1ItemsApi.update_page_cell | def update_page_cell(location_id, page_id, body, opts = {})
data, _status_code, _headers = update_page_cell_with_http_info(location_id, page_id, body, opts)
return data
end | ruby | def update_page_cell(location_id, page_id, body, opts = {})
data, _status_code, _headers = update_page_cell_with_http_info(location_id, page_id, body, opts)
return data
end | [
"def",
"update_page_cell",
"(",
"location_id",
",",
"page_id",
",",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"update_page_cell_with_http_info",
"(",
"location_id",
",",
"page_id",
",",
"body",
",",
"opts",
"... | UpdatePageCell
Modifies a cell of a Favorites page in Square Register.
@param location_id The ID of the Favorites page's associated location.
@param page_id The ID of the page the cell belongs to.
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [V1Page] | [
"UpdatePageCell",
"Modifies",
"a",
"cell",
"of",
"a",
"Favorites",
"page",
"in",
"Square",
"Register",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L2324-L2327 | train | UpdatePageCell Update a page cell | [
30522,
13366,
10651,
1035,
3931,
1035,
3526,
1006,
3295,
1035,
8909,
1010,
3931,
1035,
8909,
1010,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
10651,
1035,
3931,
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... |
braintree/braintree_ruby | lib/braintree/address.rb | Braintree.Address.update | def update(attributes)
warn "[DEPRECATED] update as an instance method is deprecated. Please use Address.update"
result = @gateway.address.update(customer_id, id, attributes)
if result.success?
copy_instance_variables_from_object result.address
end
result
end | ruby | def update(attributes)
warn "[DEPRECATED] update as an instance method is deprecated. Please use Address.update"
result = @gateway.address.update(customer_id, id, attributes)
if result.success?
copy_instance_variables_from_object result.address
end
result
end | [
"def",
"update",
"(",
"attributes",
")",
"warn",
"\"[DEPRECATED] update as an instance method is deprecated. Please use Address.update\"",
"result",
"=",
"@gateway",
".",
"address",
".",
"update",
"(",
"customer_id",
",",
"id",
",",
"attributes",
")",
"if",
"result",
".... | Deprecated. Use Braintree::Address.update | [
"Deprecated",
".",
"Use",
"Braintree",
"::",
"Address",
".",
"update"
] | 6e56c7099ea55bcdc4073cbea60b2688cef69663 | https://github.com/braintree/braintree_ruby/blob/6e56c7099ea55bcdc4073cbea60b2688cef69663/lib/braintree/address.rb#L63-L70 | train | Update an existing address | [
30522,
13366,
10651,
1006,
12332,
1007,
11582,
1000,
1031,
2139,
28139,
12921,
1033,
10651,
2004,
2019,
6013,
4118,
2003,
2139,
28139,
12921,
1012,
3531,
2224,
4769,
1012,
10651,
1000,
2765,
1027,
1030,
11909,
1012,
4769,
1012,
10651,
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... |
sporkmonger/addressable | lib/addressable/uri.rb | Addressable.URI.userinfo | def userinfo
current_user = self.user
current_password = self.password
(current_user || current_password) && @userinfo ||= begin
if current_user && current_password
"#{current_user}:#{current_password}"
elsif current_user && !current_password
"#{current_user}"
end
end
end | ruby | def userinfo
current_user = self.user
current_password = self.password
(current_user || current_password) && @userinfo ||= begin
if current_user && current_password
"#{current_user}:#{current_password}"
elsif current_user && !current_password
"#{current_user}"
end
end
end | [
"def",
"userinfo",
"current_user",
"=",
"self",
".",
"user",
"current_password",
"=",
"self",
".",
"password",
"(",
"current_user",
"||",
"current_password",
")",
"&&",
"@userinfo",
"||=",
"begin",
"if",
"current_user",
"&&",
"current_password",
"\"#{current_user}:#... | The userinfo component for this URI.
Combines the user and password components.
@return [String] The userinfo component. | [
"The",
"userinfo",
"component",
"for",
"this",
"URI",
".",
"Combines",
"the",
"user",
"and",
"password",
"components",
"."
] | 5894c95a7768435cb46d1355954611dbd194832e | https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/uri.rb#L1019-L1029 | train | Returns the userinfo object | [
30522,
13366,
5310,
2378,
14876,
2783,
1035,
5310,
1027,
2969,
1012,
5310,
2783,
1035,
20786,
1027,
2969,
1012,
20786,
1006,
2783,
1035,
5310,
1064,
1064,
2783,
1035,
20786,
1007,
1004,
1004,
1030,
5310,
2378,
14876,
1064,
1064,
1027,
4088,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cloudfoundry/bosh | src/bosh-director/lib/bosh/director/instance_updater/state_applier.rb | Bosh::Director.InstanceUpdater::StateApplier.watch_schedule | def watch_schedule(min_watch_time, max_watch_time)
delta = (max_watch_time - min_watch_time).to_f
watch_intervals = 10
step = [1000, delta / (watch_intervals - 1), 15000].sort[1]
[min_watch_time] + ([step] * (delta / step).floor)
end | ruby | def watch_schedule(min_watch_time, max_watch_time)
delta = (max_watch_time - min_watch_time).to_f
watch_intervals = 10
step = [1000, delta / (watch_intervals - 1), 15000].sort[1]
[min_watch_time] + ([step] * (delta / step).floor)
end | [
"def",
"watch_schedule",
"(",
"min_watch_time",
",",
"max_watch_time",
")",
"delta",
"=",
"(",
"max_watch_time",
"-",
"min_watch_time",
")",
".",
"to_f",
"watch_intervals",
"=",
"10",
"step",
"=",
"[",
"1000",
",",
"delta",
"/",
"(",
"watch_intervals",
"-",
... | Returns an array of wait times distributed
on the [min_watch_time..max_watch_time] interval.
Tries to respect intervals but doesn't allow an interval to
fall below 1 second or go over 15 seconds.
All times are in milliseconds.
@param [Numeric] min_watch_time minimum time to watch the jobs
@param [Numeric] max_watch_time maximum time to watch the jobs
@return [Array<Numeric>] watch schedule | [
"Returns",
"an",
"array",
"of",
"wait",
"times",
"distributed",
"on",
"the",
"[",
"min_watch_time",
"..",
"max_watch_time",
"]",
"interval",
"."
] | 2eaa7100879ddd20cd909cd698514746195e28b7 | https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/instance_updater/state_applier.rb#L97-L103 | train | Returns the watch schedule for the given time range | [
30522,
13366,
3422,
1035,
6134,
1006,
8117,
1035,
3422,
1035,
2051,
1010,
4098,
1035,
3422,
1035,
2051,
1007,
7160,
1027,
1006,
4098,
1035,
3422,
1035,
2051,
1011,
8117,
1035,
3422,
1035,
2051,
1007,
1012,
2000,
1035,
1042,
3422,
1035,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb | Azure::MixedReality::Mgmt::V2019_02_28_preview.SpatialAnchorsAccounts.update | def update(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
response = update_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
response = update_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update",
"(",
"resource_group_name",
",",
"spatial_anchors_account_name",
",",
"spatial_anchors_account",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"resource_group_name",
",",
"spatial_anchors_account_name",
",",
"spatial_anchors_... | Updating a Spatial Anchors Account
@param resource_group_name [String] Name of an Azure resource group.
@param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
Anchors Account.
@param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors
Account parameter.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SpatialAnchorsAccount] operation results. | [
"Updating",
"a",
"Spatial",
"Anchors",
"Account"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_mixedreality/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb#L403-L406 | train | Updates a spatial anchors account. | [
30522,
13366,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
13589,
1035,
24674,
1035,
4070,
1035,
2171,
1010,
13589,
1035,
24674,
1035,
4070,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
2004,
6038,
227... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.start_data_loss_with_http_info | def start_data_loss_with_http_info(service_id, partition_id, operation_id, data_loss_mode, timeout:60, custom_headers:nil)
start_data_loss_async(service_id, partition_id, operation_id, data_loss_mode, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def start_data_loss_with_http_info(service_id, partition_id, operation_id, data_loss_mode, timeout:60, custom_headers:nil)
start_data_loss_async(service_id, partition_id, operation_id, data_loss_mode, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"start_data_loss_with_http_info",
"(",
"service_id",
",",
"partition_id",
",",
"operation_id",
",",
"data_loss_mode",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"start_data_loss_async",
"(",
"service_id",
",",
"partition_id",
",",
"ope... | This API will induce data loss for the specified partition. It will trigger a
call to the OnDataLossAsync API of the partition.
This API will induce data loss for the specified partition. It will trigger a
call to the OnDataLoss API of the partition.
Actual data loss will depend on the specified DataLossMode
PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is
triggered for the partition but actual data loss depends on the presence of
in-flight replication.
FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss
is triggered.
This API should only be called with a stateful service as the target.
Calling this API with a system service as the target is not advised.
Note: Once this API has been called, it cannot be reversed. Calling
CancelOperation will only stop execution and clean up internal system state.
It will not restore data if the command has progressed far enough to cause
data loss.
Call the GetDataLossProgress API with the same OperationId to return
information on the operation started with this API.
@param service_id [String] The identity of the service. This is typically the
full name of the service without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the service name is "fabric:/myapp/app1/svc1", the service
identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous
versions.
@param partition_id The identity of the partition.
@param operation_id A GUID that identifies a call of this API. This is
passed into the corresponding GetProgress API
@param data_loss_mode [DataLossMode] This enum is passed to the StartDataLoss
API to indicate what type of data loss to induce. Possible values include:
'Invalid', 'PartialDataLoss', 'FullDataLoss'
@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. | [
"This",
"API",
"will",
"induce",
"data",
"loss",
"for",
"the",
"specified",
"partition",
".",
"It",
"will",
"trigger",
"a",
"call",
"to",
"the",
"OnDataLossAsync",
"API",
"of",
"the",
"partition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L20738-L20740 | train | Starts data loss for the specified partition. | [
30522,
13366,
2707,
1035,
2951,
1035,
3279,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2326,
1035,
8909,
1010,
13571,
1035,
8909,
1010,
3169,
1035,
8909,
1010,
2951,
1035,
3279,
1035,
5549,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
david942j/one_gadget | lib/one_gadget/helper.rb | OneGadget.Helper.objdump_arch_supported? | def objdump_arch_supported?(bin, arch)
return false if bin.nil?
arch = objdump_arch(arch)
`#{::Shellwords.join([bin, '--help'])}`.lines.any? { |c| c.split.include?(arch) }
end | ruby | def objdump_arch_supported?(bin, arch)
return false if bin.nil?
arch = objdump_arch(arch)
`#{::Shellwords.join([bin, '--help'])}`.lines.any? { |c| c.split.include?(arch) }
end | [
"def",
"objdump_arch_supported?",
"(",
"bin",
",",
"arch",
")",
"return",
"false",
"if",
"bin",
".",
"nil?",
"arch",
"=",
"objdump_arch",
"(",
"arch",
")",
"`",
"#{",
"::",
"Shellwords",
".",
"join",
"(",
"[",
"bin",
",",
"'--help'",
"]",
")",
"}",
"... | Checks if the given objdump supports certain architecture.
@param [String] bin
@param [Symbol] arch
@return [Boolean]
@example
Helper.objdump_arch_supported?('/usr/bin/objdump', :i386)
#=> true | [
"Checks",
"if",
"the",
"given",
"objdump",
"supports",
"certain",
"architecture",
"."
] | ff6ef04541e83441bfe3c2664a6febd1640f4263 | https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/helper.rb#L292-L297 | train | Returns true if the arch is supported by the objdump. | [
30522,
13366,
27885,
3501,
8566,
8737,
1035,
7905,
1035,
3569,
1029,
1006,
8026,
1010,
7905,
1007,
2709,
6270,
2065,
8026,
1012,
9152,
2140,
1029,
7905,
1027,
27885,
3501,
8566,
8737,
1035,
7905,
1006,
7905,
1007,
1036,
1001,
1063,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.report_service_health | def report_service_health(service_id, health_information, immediate:false, timeout:60, custom_headers:nil)
response = report_service_health_async(service_id, health_information, immediate:immediate, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def report_service_health(service_id, health_information, immediate:false, timeout:60, custom_headers:nil)
response = report_service_health_async(service_id, health_information, immediate:immediate, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"report_service_health",
"(",
"service_id",
",",
"health_information",
",",
"immediate",
":",
"false",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"report_service_health_async",
"(",
"service_id",
",",
"health_informati... | Sends a health report on the Service Fabric service.
Reports health state of the specified Service Fabric service. The report must
contain the information about the source of the health report and property on
which it is reported.
The report is sent to a Service Fabric gateway Service, which forwards to the
health store.
The report may be accepted by the gateway, but rejected by the health store
after extra validation.
For example, the health store may reject the report because of an invalid
parameter, like a stale sequence number.
To see whether the report was applied in the health store, run
GetServiceHealth and check that the report appears in the HealthEvents
section.
@param service_id [String] The identity of the service. This is typically the
full name of the service without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the service name is "fabric:/myapp/app1/svc1", the service
identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous
versions.
@param health_information [HealthInformation] Describes the health
information for the health report. This information needs to be present in
all of the health reports sent to the health manager.
@param immediate [Boolean] A flag which indicates whether the report should
be sent immediately.
A health report is sent to a Service Fabric gateway Application, which
forwards to the health store.
If Immediate is set to true, the report is sent immediately from HTTP Gateway
to the health store, regardless of the fabric client settings that the HTTP
Gateway Application is using.
This is useful for critical reports that should be sent as soon as possible.
Depending on timing and other conditions, sending the report may still fail,
for example if the HTTP Gateway is closed or the message doesn't reach the
Gateway.
If Immediate is set to false, the report is sent based on the health client
settings from the HTTP Gateway. Therefore, it will be batched according to
the HealthReportSendInterval configuration.
This is the recommended setting because it allows the health client to
optimize health reporting messages to health store as well as health report
processing.
By default, reports are not sent immediately.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Sends",
"a",
"health",
"report",
"on",
"the",
"Service",
"Fabric",
"service",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L11464-L11467 | train | Report service health. | [
30522,
13366,
3189,
1035,
2326,
1035,
2740,
1006,
2326,
1035,
8909,
1010,
2740,
1035,
2592,
1010,
6234,
1024,
6270,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3189,
1035,
2326,
1035,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.recover_deleted_certificate | def recover_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
response = recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def recover_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
response = recover_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"recover_deleted_certificate",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"recover_deleted_certificate_async",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"custom_headers",
":custom_headers",
")",... | Recovers the deleted certificate back to its current version under
/certificates.
The RecoverDeletedCertificate operation performs the reversal of the Delete
operation. The operation is applicable in vaults enabled for soft-delete, and
must be issued during the retention interval (available in the deleted
certificate's attributes). This operation requires the certificates/recover
permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param certificate_name [String] The name of the deleted certificate
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CertificateBundle] operation results. | [
"Recovers",
"the",
"deleted",
"certificate",
"back",
"to",
"its",
"current",
"version",
"under",
"/",
"certificates",
"."
] | 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#L6859-L6862 | train | Recover the deleted certificate. | [
30522,
13366,
8980,
1035,
17159,
1035,
8196,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
8980,
1035,
17159,
1035,
8196,
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... |
zendesk/ruby-kafka | lib/kafka/connection.rb | Kafka.Connection.write_request | def write_request(request, notification)
message = Kafka::Protocol::RequestMessage.new(
api_key: request.api_key,
api_version: request.respond_to?(:api_version) ? request.api_version : 0,
correlation_id: @correlation_id,
client_id: @client_id,
request: request,
)
data = Kafka::Protocol::Encoder.encode_with(message)
notification[:request_size] = data.bytesize
@encoder.write_bytes(data)
nil
rescue Errno::ETIMEDOUT
@logger.error "Timed out while writing request #{@correlation_id}"
raise
end | ruby | def write_request(request, notification)
message = Kafka::Protocol::RequestMessage.new(
api_key: request.api_key,
api_version: request.respond_to?(:api_version) ? request.api_version : 0,
correlation_id: @correlation_id,
client_id: @client_id,
request: request,
)
data = Kafka::Protocol::Encoder.encode_with(message)
notification[:request_size] = data.bytesize
@encoder.write_bytes(data)
nil
rescue Errno::ETIMEDOUT
@logger.error "Timed out while writing request #{@correlation_id}"
raise
end | [
"def",
"write_request",
"(",
"request",
",",
"notification",
")",
"message",
"=",
"Kafka",
"::",
"Protocol",
"::",
"RequestMessage",
".",
"new",
"(",
"api_key",
":",
"request",
".",
"api_key",
",",
"api_version",
":",
"request",
".",
"respond_to?",
"(",
":ap... | Writes a request over the connection.
@param request [#encode] the request that should be encoded and written.
@return [nil] | [
"Writes",
"a",
"request",
"over",
"the",
"connection",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/connection.rb#L156-L174 | train | Write a request to the client | [
30522,
13366,
4339,
1035,
5227,
1006,
5227,
1010,
26828,
1007,
30524,
2050,
1024,
1024,
8778,
1024,
1024,
5227,
7834,
3736,
3351,
1012,
2047,
1006,
17928,
1035,
3145,
1024,
5227,
1012,
17928,
1035,
3145,
1010,
17928,
1035,
2544,
1024,
5227,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb | Azure::CognitiveServices::ComputerVision::V2_0.ComputerVisionClient.analyze_image_in_stream | def analyze_image_in_stream(image, visual_features:nil, details:nil, language:nil, custom_headers:nil)
response = analyze_image_in_stream_async(image, visual_features:visual_features, details:details, language:language, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def analyze_image_in_stream(image, visual_features:nil, details:nil, language:nil, custom_headers:nil)
response = analyze_image_in_stream_async(image, visual_features:visual_features, details:details, language:language, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"analyze_image_in_stream",
"(",
"image",
",",
"visual_features",
":",
"nil",
",",
"details",
":",
"nil",
",",
"language",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"analyze_image_in_stream_async",
"(",
"image",
",",
"visual_feat... | This operation extracts a rich set of visual features based on the image
content.
Two input methods are supported -- (1) Uploading an image or (2) specifying
an image URL. Within your request, there is an optional parameter to allow
you to choose which features to return. By default, image categories are
returned in the response.
A successful response will be returned in JSON. If the request failed, the
response will contain an error code and a message to help understand what
went wrong.
@param image An image stream.
@param visual_features [Array<VisualFeatureTypes>] A string indicating what
visual feature types to return. Multiple values should be comma-separated.
Valid visual feature types include: Categories - categorizes image content
according to a taxonomy defined in documentation. Tags - tags the image with
a detailed list of words related to the image content. Description -
describes the image content with a complete English sentence. Faces - detects
if faces are present. If present, generate coordinates, gender and age.
ImageType - detects if image is clipart or a line drawing. Color - determines
the accent color, dominant color, and whether an image is black&white. Adult
- detects if the image is pornographic in nature (depicts nudity or a sex
act). Sexually suggestive content is also detected. Objects - detects
various objects within an image, including the approximate location. The
Objects argument is only available in English. Brands - detects various
brands within an image, including the approximate location. The Brands
argument is only available in English.
@param details [Array<Details>] A string indicating which domain-specific
details to return. Multiple values should be comma-separated. Valid visual
feature types include: Celebrities - identifies celebrities if detected in
the image, Landmarks - identifies notable landmarks in the image.
@param language [Enum] The desired language for output generation. If this
parameter is not specified, the default value is "en".Supported
languages:en - English, Default. es - Spanish, ja - Japanese, pt -
Portuguese, zh - Simplified Chinese. Possible values include: 'en', 'es',
'ja', 'pt', 'zh'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ImageAnalysis] operation results. | [
"This",
"operation",
"extracts",
"a",
"rich",
"set",
"of",
"visual",
"features",
"based",
"on",
"the",
"image",
"content",
".",
"Two",
"input",
"methods",
"are",
"supported",
"--",
"(",
"1",
")",
"Uploading",
"an",
"image",
"or",
"(",
"2",
")",
"specifyi... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb#L1821-L1824 | train | Analyze an image in an image stream. | [
30522,
13366,
17908,
1035,
3746,
1035,
1999,
1035,
5460,
1006,
3746,
1010,
5107,
1035,
2838,
1024,
9152,
2140,
1010,
4751,
1024,
9152,
2140,
1010,
2653,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/event_subscription.rb | Aws::RDS.EventSubscription.modify | def modify(options = {})
options = options.merge(subscription_name: @name)
resp = @client.modify_event_subscription(options)
EventSubscription.new(
name: resp.data.event_subscription.cust_subscription_id,
data: resp.data.event_subscription,
client: @client
)
end | ruby | def modify(options = {})
options = options.merge(subscription_name: @name)
resp = @client.modify_event_subscription(options)
EventSubscription.new(
name: resp.data.event_subscription.cust_subscription_id,
data: resp.data.event_subscription,
client: @client
)
end | [
"def",
"modify",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"subscription_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"modify_event_subscription",
"(",
"options",
")",
"EventSubscription",
".",
"new",
"(",
... | @example Request syntax with placeholder values
eventsubscription = event_subscription.modify({
sns_topic_arn: "String",
source_type: "String",
event_categories: ["String"],
enabled: false,
})
@param [Hash] options ({})
@option options [String] :sns_topic_arn
The Amazon Resource Name (ARN) of the SNS topic created for event
notification. The ARN is created by Amazon SNS when you create a topic
and subscribe to it.
@option options [String] :source_type
The type of source that is generating the events. For example, if you
want to be notified of events generated by a DB instance, you would
set this parameter to db-instance. if this value is not specified, all
events are returned.
Valid values: db-instance \| db-parameter-group \| db-security-group
\| db-snapshot
@option options [Array<String>] :event_categories
A list of event categories for a SourceType that you want to subscribe
to. You can see a list of the categories for a given SourceType in the
[Events][1] topic in the *Amazon RDS User Guide* or by using the
**DescribeEventCategories** action.
[1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Events.html
@option options [Boolean] :enabled
A Boolean value; set to **true** to activate the subscription.
@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#L394-L402 | train | Modify an existing event subscription | [
30522,
13366,
19933,
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,
19933,
1035,
2724,
1035,
15002,
1006,
7047,
1007,
2824,
12083,
224... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/record_identifier.rb | ActionView.RecordIdentifier.dom_id | def dom_id(record, prefix = nil)
if record_id = record_key_for_dom_id(record)
"#{dom_class(record, prefix)}#{JOIN}#{record_id}"
else
dom_class(record, prefix || NEW)
end
end | ruby | def dom_id(record, prefix = nil)
if record_id = record_key_for_dom_id(record)
"#{dom_class(record, prefix)}#{JOIN}#{record_id}"
else
dom_class(record, prefix || NEW)
end
end | [
"def",
"dom_id",
"(",
"record",
",",
"prefix",
"=",
"nil",
")",
"if",
"record_id",
"=",
"record_key_for_dom_id",
"(",
"record",
")",
"\"#{dom_class(record, prefix)}#{JOIN}#{record_id}\"",
"else",
"dom_class",
"(",
"record",
",",
"prefix",
"||",
"NEW",
")",
"end",
... | The DOM id convention is to use the singular form of an object or class with the id following an underscore.
If no id is found, prefix with "new_" instead.
dom_id(Post.find(45)) # => "post_45"
dom_id(Post.new) # => "new_post"
If you need to address multiple instances of the same class in the same view, you can prefix the dom_id:
dom_id(Post.find(45), :edit) # => "edit_post_45"
dom_id(Post.new, :custom) # => "custom_post" | [
"The",
"DOM",
"id",
"convention",
"is",
"to",
"use",
"the",
"singular",
"form",
"of",
"an",
"object",
"or",
"class",
"with",
"the",
"id",
"following",
"an",
"underscore",
".",
"If",
"no",
"id",
"is",
"found",
"prefix",
"with",
"new_",
"instead",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/record_identifier.rb#L89-L95 | train | Returns the dom_id for the given record. | [
30522,
13366,
14383,
1035,
8909,
1006,
2501,
1010,
17576,
1027,
9152,
2140,
1007,
2065,
2501,
1035,
8909,
1027,
2501,
1035,
3145,
1035,
2005,
1035,
14383,
1035,
8909,
1006,
2501,
1007,
1000,
1001,
1063,
14383,
1035,
2465,
1006,
2501,
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... |
plataformatec/simple_form | lib/simple_form/form_builder.rb | SimpleForm.FormBuilder.hint | def hint(attribute_name, options = {})
options = options.dup
options[:hint_html] = options.except(:hint_tag, :hint)
if attribute_name.is_a?(String)
options[:hint] = attribute_name
attribute_name, column, input_type = nil, nil, nil
else
column = find_attribute_column(attribute_name)
input_type = default_input_type(attribute_name, column, options)
end
wrapper.find(:hint).
render(SimpleForm::Inputs::Base.new(self, attribute_name, column, input_type, options))
end | ruby | def hint(attribute_name, options = {})
options = options.dup
options[:hint_html] = options.except(:hint_tag, :hint)
if attribute_name.is_a?(String)
options[:hint] = attribute_name
attribute_name, column, input_type = nil, nil, nil
else
column = find_attribute_column(attribute_name)
input_type = default_input_type(attribute_name, column, options)
end
wrapper.find(:hint).
render(SimpleForm::Inputs::Base.new(self, attribute_name, column, input_type, options))
end | [
"def",
"hint",
"(",
"attribute_name",
",",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"dup",
"options",
"[",
":hint_html",
"]",
"=",
"options",
".",
"except",
"(",
":hint_tag",
",",
":hint",
")",
"if",
"attribute_name",
".",
"is_a?",
... | Creates a hint tag for the given attribute. Accepts a symbol indicating
an attribute for I18n lookup or a string. All the given options are sent
as :hint_html.
== Examples
f.hint :name # Do I18n lookup
f.hint :name, id: "cool_hint"
f.hint "Don't forget to accept this" | [
"Creates",
"a",
"hint",
"tag",
"for",
"the",
"given",
"attribute",
".",
"Accepts",
"a",
"symbol",
"indicating",
"an",
"attribute",
"for",
"I18n",
"lookup",
"or",
"a",
"string",
".",
"All",
"the",
"given",
"options",
"are",
"sent",
"as",
":",
"hint_html",
... | 4dd9261ebb392e46a9beeefe8d83081e7c6e56b5 | https://github.com/plataformatec/simple_form/blob/4dd9261ebb392e46a9beeefe8d83081e7c6e56b5/lib/simple_form/form_builder.rb#L294-L308 | train | Renders the hint for the given attribute. | [
30522,
13366,
9374,
1006,
17961,
1035,
2171,
1010,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
4241,
2361,
7047,
1031,
1024,
9374,
1035,
16129,
1033,
1027,
7047,
1012,
3272,
1006,
1024,
9374,
1035,
6415,
1010,
1024,
9374,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-glacier/lib/aws-sdk-glacier/multipart_upload.rb | Aws::Glacier.MultipartUpload.abort | def abort(options = {})
options = options.merge(
account_id: @account_id,
vault_name: @vault_name,
upload_id: @id
)
resp = @client.abort_multipart_upload(options)
resp.data
end | ruby | def abort(options = {})
options = options.merge(
account_id: @account_id,
vault_name: @vault_name,
upload_id: @id
)
resp = @client.abort_multipart_upload(options)
resp.data
end | [
"def",
"abort",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"account_id",
":",
"@account_id",
",",
"vault_name",
":",
"@vault_name",
",",
"upload_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"abort_multipart_uplo... | @!group Actions
@example Request syntax with placeholder values
multipart_upload.abort()
@param [Hash] options ({})
@return [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-glacier/lib/aws-sdk-glacier/multipart_upload.rb#L209-L217 | train | Aborts the current upload | [
30522,
13366,
11113,
11589,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
4070,
1035,
8909,
1024,
1030,
4070,
1035,
8909,
1010,
11632,
1035,
2171,
1024,
1030,
11632,
1035,
2171,
1010,
2039,
11066,
1035,
8909,
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_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/property.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Property.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, service_name, prop_id, parameters, if_match:nil, custom_headers:nil)
create_or_update_async(resource_group_name, service_name, prop_id, parameters, if_match:if_match, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, service_name, prop_id, parameters, if_match:nil, custom_headers:nil)
create_or_update_async(resource_group_name, service_name, prop_id, parameters, if_match:if_match, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"prop_id",
",",
"parameters",
",",
"if_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"service_name",
... | Creates or updates a property.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param prop_id [String] Identifier of the property.
@param parameters [PropertyContract] Create parameters.
@param if_match [String] ETag of the Entity. Not required when creating an
entity, but required when updating an entity.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"a",
"property",
"."
] | 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/property.rb#L375-L377 | train | Creates or updates a property in the specified service. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
17678,
1035,
8909,
1010,
11709,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
7661,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.update_instances_async | def update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
# Send request
promise = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, 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 update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
# Send request
promise = begin_update_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, 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",
"update_instances_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_update_instances_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
","... | @param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
of virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [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",
"vm_instance_ids",
"[",
"VirtualMachi... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1034-L1048 | train | Updates a set of virtual machines in a VM scale set. | [
30522,
13366,
10651,
1035,
12107,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
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... |
hashicorp/vagrant | lib/vagrant/machine.rb | Vagrant.Machine.communicate | def communicate
if !@communicator
requested = @config.vm.communicator
requested ||= :ssh
klass = Vagrant.plugin("2").manager.communicators[requested]
raise Errors::CommunicatorNotFound, comm: requested.to_s if !klass
@communicator = klass.new(self)
end
@communicator
end | ruby | def communicate
if !@communicator
requested = @config.vm.communicator
requested ||= :ssh
klass = Vagrant.plugin("2").manager.communicators[requested]
raise Errors::CommunicatorNotFound, comm: requested.to_s if !klass
@communicator = klass.new(self)
end
@communicator
end | [
"def",
"communicate",
"if",
"!",
"@communicator",
"requested",
"=",
"@config",
".",
"vm",
".",
"communicator",
"requested",
"||=",
":ssh",
"klass",
"=",
"Vagrant",
".",
"plugin",
"(",
"\"2\"",
")",
".",
"manager",
".",
"communicators",
"[",
"requested",
"]",... | Returns a communication object for executing commands on the remote
machine. Note that the _exact_ semantics of this are up to the
communication provider itself. Despite this, the semantics are expected
to be consistent across operating systems. For example, all linux-based
systems should have similar communication (usually a shell). All
Windows systems should have similar communication as well. Therefore,
prior to communicating with the machine, users of this method are
expected to check the guest OS to determine their behavior.
This method will _always_ return some valid communication object.
The `ready?` API can be used on the object to check if communication
is actually ready.
@return [Object] | [
"Returns",
"a",
"communication",
"object",
"for",
"executing",
"commands",
"on",
"the",
"remote",
"machine",
".",
"Note",
"that",
"the",
"_exact_",
"semantics",
"of",
"this",
"are",
"up",
"to",
"the",
"communication",
"provider",
"itself",
".",
"Despite",
"thi... | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/machine.rb#L255-L265 | train | Returns the communicator object for this VM. | [
30522,
13366,
10639,
2065,
999,
1030,
4012,
23041,
5555,
4263,
7303,
1027,
1030,
9530,
8873,
2290,
1012,
1058,
2213,
1012,
4012,
23041,
5555,
4263,
7303,
1064,
1064,
1027,
1024,
7020,
2232,
1047,
27102,
1027,
12436,
18980,
1012,
13354,
2378... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/galleries.rb | Azure::Compute::Mgmt::V2019_03_01.Galleries.create_or_update_async | def create_or_update_async(resource_group_name, gallery_name, gallery, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, gallery_name, gallery, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Compute::Mgmt::V2019_03_01::Models::Gallery.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def create_or_update_async(resource_group_name, gallery_name, gallery, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, gallery_name, gallery, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Compute::Mgmt::V2019_03_01::Models::Gallery.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"create_or_update_async",
"(",
"resource_group_name",
",",
"gallery_name",
",",
"gallery",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"gallery_name",
",",
"gallery",
"... | @param resource_group_name [String] The name of the resource group.
@param gallery_name [String] The name of the Shared Image Gallery. The
allowed characters are alphabets and numbers with dots and periods allowed in
the middle. The maximum length is 80 characters.
@param gallery [Gallery] Parameters supplied to the create or update Shared
Image Gallery operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"resource",
"group",
".",
"@param",
"gallery_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"Shared",
"Image",
"Gallery",
".",
"The",
"allowed",
"characters",
"are",
"al... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/galleries.rb#L56-L72 | train | Creates or updates a gallery. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3916,
1035,
2171,
1010,
3916,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb | Azure::Web::Mgmt::V2018_02_01.Recommendations.disable_recommendation_for_site_with_http_info | def disable_recommendation_for_site_with_http_info(resource_group_name, site_name, name, custom_headers:nil)
disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:custom_headers).value!
end | ruby | def disable_recommendation_for_site_with_http_info(resource_group_name, site_name, name, custom_headers:nil)
disable_recommendation_for_site_async(resource_group_name, site_name, name, custom_headers:custom_headers).value!
end | [
"def",
"disable_recommendation_for_site_with_http_info",
"(",
"resource_group_name",
",",
"site_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"disable_recommendation_for_site_async",
"(",
"resource_group_name",
",",
"site_name",
",",
"name",
",",
"custom_heade... | Disables the specific rule for a web site permanently.
Disables the specific rule for a web site permanently.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site name
@param name [String] Rule name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Disables",
"the",
"specific",
"rule",
"for",
"a",
"web",
"site",
"permanently",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb#L891-L893 | train | Disables the recommendations for a site. | [
30522,
13366,
4487,
19150,
1035,
12832,
1035,
2005,
1035,
2609,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4487,
19150,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_customvisionprediction/lib/3.0/generated/azure_cognitiveservices_customvisionprediction/customvisionprediction_client.rb | Azure::CognitiveServices::Customvisionprediction::V3_0.CustomvisionpredictionClient.classify_image_with_http_info | def classify_image_with_http_info(project_id, published_name, image_data, application:nil, custom_headers:nil)
classify_image_async(project_id, published_name, image_data, application:application, custom_headers:custom_headers).value!
end | ruby | def classify_image_with_http_info(project_id, published_name, image_data, application:nil, custom_headers:nil)
classify_image_async(project_id, published_name, image_data, application:application, custom_headers:custom_headers).value!
end | [
"def",
"classify_image_with_http_info",
"(",
"project_id",
",",
"published_name",
",",
"image_data",
",",
"application",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"classify_image_async",
"(",
"project_id",
",",
"published_name",
",",
"image_data",
",",
"ap... | Classify an image and saves the result.
@param project_id The project id.
@param published_name [String] Specifies the name of the model to evaluate
against.
@param image_data Binary image data. Supported formats are JPEG, GIF, PNG,
and BMP. Supports images up to 4MB.
@param application [String] Optional. Specifies the name of application using
the endpoint.
@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. | [
"Classify",
"an",
"image",
"and",
"saves",
"the",
"result",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisionprediction/lib/3.0/generated/azure_cognitiveservices_customvisionprediction/customvisionprediction_client.rb#L266-L268 | train | Classifies the image. | [
30522,
13366,
26268,
1035,
3746,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2622,
1035,
8909,
1010,
2405,
1035,
2171,
1010,
3746,
1035,
2951,
1010,
4646,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
26268,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | app/presenters/hyrax/admin_set_options_presenter.rb | Hyrax.AdminSetOptionsPresenter.data_attributes | def data_attributes(admin_set)
# Get permission template associated with this AdminSet (if any)
permission_template = PermissionTemplate.find_by(source_id: admin_set.id)
# Only add data attributes if permission template exists
return {} unless permission_template
attributes_for(permission_template: permission_template)
end | ruby | def data_attributes(admin_set)
# Get permission template associated with this AdminSet (if any)
permission_template = PermissionTemplate.find_by(source_id: admin_set.id)
# Only add data attributes if permission template exists
return {} unless permission_template
attributes_for(permission_template: permission_template)
end | [
"def",
"data_attributes",
"(",
"admin_set",
")",
"# Get permission template associated with this AdminSet (if any)",
"permission_template",
"=",
"PermissionTemplate",
".",
"find_by",
"(",
"source_id",
":",
"admin_set",
".",
"id",
")",
"# Only add data attributes if permission tem... | Create a hash of HTML5 'data' attributes. These attributes are added to select_options and
later utilized by Javascript to limit new Work options based on AdminSet selected | [
"Create",
"a",
"hash",
"of",
"HTML5",
"data",
"attributes",
".",
"These",
"attributes",
"are",
"added",
"to",
"select_options",
"and",
"later",
"utilized",
"by",
"Javascript",
"to",
"limit",
"new",
"Work",
"options",
"based",
"on",
"AdminSet",
"selected"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/presenters/hyrax/admin_set_options_presenter.rb#L20-L27 | train | Get the data attributes for this AdminSet | [
30522,
13366,
2951,
1035,
12332,
1006,
4748,
10020,
1035,
2275,
1007,
1001,
2131,
6656,
23561,
3378,
2007,
2023,
4748,
21266,
3388,
1006,
2065,
2151,
1007,
6656,
1035,
23561,
1027,
6656,
18532,
15725,
1012,
2424,
1035,
2011,
1006,
3120,
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... |
decidim/decidim | decidim-core/app/helpers/decidim/scopes_helper.rb | Decidim.ScopesHelper.scopes_picker_tag | def scopes_picker_tag(name, value, options = {})
root = try(:current_participatory_space)&.scope
field = options[:field] || name
scopes_picker_field_tag name, value, id: options[:id] do |scope|
{ url: decidim.scopes_picker_path(root: root, current: scope&.id, field: field),
text: scope_name_for_picker(scope, I18n.t("decidim.scopes.global")) }
end
end | ruby | def scopes_picker_tag(name, value, options = {})
root = try(:current_participatory_space)&.scope
field = options[:field] || name
scopes_picker_field_tag name, value, id: options[:id] do |scope|
{ url: decidim.scopes_picker_path(root: root, current: scope&.id, field: field),
text: scope_name_for_picker(scope, I18n.t("decidim.scopes.global")) }
end
end | [
"def",
"scopes_picker_tag",
"(",
"name",
",",
"value",
",",
"options",
"=",
"{",
"}",
")",
"root",
"=",
"try",
"(",
":current_participatory_space",
")",
"&.",
"scope",
"field",
"=",
"options",
"[",
":field",
"]",
"||",
"name",
"scopes_picker_field_tag",
"nam... | Renders a scopes picker field in a form, not linked to a specific model.
name - name for the input
value - value for the input
Returns nothing. | [
"Renders",
"a",
"scopes",
"picker",
"field",
"in",
"a",
"form",
"not",
"linked",
"to",
"a",
"specific",
"model",
".",
"name",
"-",
"name",
"for",
"the",
"input",
"value",
"-",
"value",
"for",
"the",
"input"
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/scopes_helper.rb#L54-L62 | train | Returns a scope picker tag | [
30522,
13366,
9531,
2015,
1035,
4060,
2121,
1035,
6415,
1006,
2171,
1010,
3643,
1010,
7047,
1027,
1063,
1065,
1007,
7117,
1027,
3046,
1006,
1024,
2783,
1035,
2112,
28775,
4502,
7062,
1035,
2686,
1007,
1004,
1012,
9531,
2492,
1027,
7047,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | fastlane/lib/fastlane/swift_runner_upgrader.rb | Fastlane.SwiftRunnerUpgrader.add_missing_groups_and_files! | def add_missing_groups_and_files!(dry_run: false)
missing_groups = self.find_missing_groups.to_set
unless missing_groups.length > 0
UI.verbose("No missing groups found, so we don't need to worry about adding new groups")
return false
end
# well, we know we have some changes to make, so if this is a dry run,
# don't bother doing anything and just return true
return true if dry_run
missing_groups.each do |missing_group_name|
new_group = @root_group.new_group(missing_group_name)
# find every file in the manifest that belongs to the new group, and add it to the new group
self.manifest_hash.each do |filename, group|
next unless group.casecmp(missing_group_name.downcase).zero?
# assumes this is a new file, we don't handle moving files between groups
new_file_reference = new_group.new_file("#{RELATIVE_SOURCE_FILE_PATH}#{filename}")
# add references to the target, and make sure they are added to the build phase to
self.fastlane_runner_target.source_build_phase.add_file_reference(new_file_reference)
end
end
return true # yup, we definitely updated groups
end | ruby | def add_missing_groups_and_files!(dry_run: false)
missing_groups = self.find_missing_groups.to_set
unless missing_groups.length > 0
UI.verbose("No missing groups found, so we don't need to worry about adding new groups")
return false
end
# well, we know we have some changes to make, so if this is a dry run,
# don't bother doing anything and just return true
return true if dry_run
missing_groups.each do |missing_group_name|
new_group = @root_group.new_group(missing_group_name)
# find every file in the manifest that belongs to the new group, and add it to the new group
self.manifest_hash.each do |filename, group|
next unless group.casecmp(missing_group_name.downcase).zero?
# assumes this is a new file, we don't handle moving files between groups
new_file_reference = new_group.new_file("#{RELATIVE_SOURCE_FILE_PATH}#{filename}")
# add references to the target, and make sure they are added to the build phase to
self.fastlane_runner_target.source_build_phase.add_file_reference(new_file_reference)
end
end
return true # yup, we definitely updated groups
end | [
"def",
"add_missing_groups_and_files!",
"(",
"dry_run",
":",
"false",
")",
"missing_groups",
"=",
"self",
".",
"find_missing_groups",
".",
"to_set",
"unless",
"missing_groups",
".",
"length",
">",
"0",
"UI",
".",
"verbose",
"(",
"\"No missing groups found, so we don't... | adds new groups, and the files inside those groups
Note: this does not add new files to existing groups, that is in add_new_files_to_groups! | [
"adds",
"new",
"groups",
"and",
"the",
"files",
"inside",
"those",
"groups",
"Note",
":",
"this",
"does",
"not",
"add",
"new",
"files",
"to",
"existing",
"groups",
"that",
"is",
"in",
"add_new_files_to_groups!"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/swift_runner_upgrader.rb#L178-L204 | train | Add missing files to the target | [
30522,
13366,
5587,
1035,
4394,
1035,
2967,
1035,
1998,
1035,
6764,
999,
1006,
4318,
1035,
2448,
1024,
6270,
1007,
4394,
1035,
2967,
1027,
2969,
1012,
2424,
1035,
4394,
1035,
2967,
1012,
2000,
1035,
2275,
4983,
4394,
1035,
2967,
1012,
309... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.get_osupgrade_history_next | def get_osupgrade_history_next(next_page_link, custom_headers:nil)
response = get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_osupgrade_history_next(next_page_link, custom_headers:nil)
response = get_osupgrade_history_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_osupgrade_history_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_osupgrade_history_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless... | Gets list of OS upgrades on a VM scale set instance.
@param next_page_link [String] The NextLink from the previous successful call
to List operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VirtualMachineScaleSetListOSUpgradeHistory] operation results. | [
"Gets",
"list",
"of",
"OS",
"upgrades",
"on",
"a",
"VM",
"scale",
"set",
"instance",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L2799-L2802 | train | Gets the current OS upgrade history. | [
30522,
13366,
2131,
1035,
9808,
6279,
24170,
1035,
2381,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
9808,
6279,
24170,
1035,
2381,
1035,
2279,
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_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflows.rb | Azure::Logic::Mgmt::V2016_06_01.Workflows.validate_workflow_with_http_info | def validate_workflow_with_http_info(resource_group_name, workflow_name, validate, custom_headers:nil)
validate_workflow_async(resource_group_name, workflow_name, validate, custom_headers:custom_headers).value!
end | ruby | def validate_workflow_with_http_info(resource_group_name, workflow_name, validate, custom_headers:nil)
validate_workflow_async(resource_group_name, workflow_name, validate, custom_headers:custom_headers).value!
end | [
"def",
"validate_workflow_with_http_info",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"validate",
",",
"custom_headers",
":",
"nil",
")",
"validate_workflow_async",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"validate",
",",
"custom_headers",
":cus... | Validates the workflow.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param validate [Workflow] The workflow.
@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. | [
"Validates",
"the",
"workflow",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflows.rb#L1259-L1261 | train | Validates the specified workflow. | [
30522,
13366,
9398,
3686,
1035,
2147,
12314,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
9398,
3686,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
9398,
3686,
30524,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Features.add_phrase_list_with_http_info | def add_phrase_list_with_http_info(app_id, version_id, phraselist_create_object, custom_headers:nil)
add_phrase_list_async(app_id, version_id, phraselist_create_object, custom_headers:custom_headers).value!
end | ruby | def add_phrase_list_with_http_info(app_id, version_id, phraselist_create_object, custom_headers:nil)
add_phrase_list_async(app_id, version_id, phraselist_create_object, custom_headers:custom_headers).value!
end | [
"def",
"add_phrase_list_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"phraselist_create_object",
",",
"custom_headers",
":",
"nil",
")",
"add_phrase_list_async",
"(",
"app_id",
",",
"version_id",
",",
"phraselist_create_object",
",",
"custom_headers",
":custom_... | Creates a new phraselist feature in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param phraselist_create_object [PhraselistCreateObject] A Phraselist object
containing Name, comma-separated Phrases and the isExchangeable boolean.
Default value for isExchangeable is true.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"a",
"new",
"phraselist",
"feature",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/features.rb#L178-L180 | train | Adds a phrase list to the application version. | [
30522,
13366,
5587,
1035,
7655,
1035,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
7655,
9863,
1035,
3443,
1035,
4874,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
5587,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/machine_index.rb | Vagrant.MachineIndex.find_by_prefix | def find_by_prefix(prefix)
@machines.each do |uuid, data|
return data.merge("id" => uuid) if uuid.start_with?(prefix)
end
nil
end | ruby | def find_by_prefix(prefix)
@machines.each do |uuid, data|
return data.merge("id" => uuid) if uuid.start_with?(prefix)
end
nil
end | [
"def",
"find_by_prefix",
"(",
"prefix",
")",
"@machines",
".",
"each",
"do",
"|",
"uuid",
",",
"data",
"|",
"return",
"data",
".",
"merge",
"(",
"\"id\"",
"=>",
"uuid",
")",
"if",
"uuid",
".",
"start_with?",
"(",
"prefix",
")",
"end",
"nil",
"end"
] | Finds a machine where the UUID is prefixed by the given string.
@return [Hash] | [
"Finds",
"a",
"machine",
"where",
"the",
"UUID",
"is",
"prefixed",
"by",
"the",
"given",
"string",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/machine_index.rb#L239-L245 | train | Find the first match for a given prefix | [
30522,
13366,
2424,
1035,
2011,
1035,
17576,
1006,
17576,
1007,
1030,
6681,
1012,
2169,
2079,
1064,
1057,
21272,
1010,
2951,
1064,
2709,
2951,
1012,
13590,
1006,
1000,
8909,
1000,
1027,
1028,
1057,
21272,
1007,
2065,
1057,
21272,
1012,
2707... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.disable_classic_link | def disable_classic_link(options = {})
options = options.merge(vpc_id: @id)
resp = @client.disable_vpc_classic_link(options)
resp.data
end | ruby | def disable_classic_link(options = {})
options = options.merge(vpc_id: @id)
resp = @client.disable_vpc_classic_link(options)
resp.data
end | [
"def",
"disable_classic_link",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"vpc_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"disable_vpc_classic_link",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
vpc.disable_classic_link({
dry_run: false,
})
@param [Hash] options ({})
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@return [Types::DisableVpcClassicLinkResult] | [
"@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#L593-L597 | train | Disable a particular VPC classified link | [
30522,
13366,
4487,
19150,
1035,
4438,
1035,
4957,
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,
4487,
19150,
1035,
21210,
2278... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/views.rb | Azure::CustomerInsights::Mgmt::V2017_01_01.Views.list_by_hub_as_lazy | def list_by_hub_as_lazy(resource_group_name, hub_name, user_id, custom_headers:nil)
response = list_by_hub_async(resource_group_name, hub_name, user_id, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_hub_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_hub_as_lazy(resource_group_name, hub_name, user_id, custom_headers:nil)
response = list_by_hub_async(resource_group_name, hub_name, user_id, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_hub_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_hub_as_lazy",
"(",
"resource_group_name",
",",
"hub_name",
",",
"user_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_hub_async",
"(",
"resource_group_name",
",",
"hub_name",
",",
"user_id",
",",
"custom_headers",
":custom_header... | Gets all available views for given user in the specified hub.
@param resource_group_name [String] The name of the resource group.
@param hub_name [String] The name of the hub.
@param user_id [String] The user ID. Use * to retreive hub level views.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ViewListResult] which provide lazy access to pages of the response. | [
"Gets",
"all",
"available",
"views",
"for",
"given",
"user",
"in",
"the",
"specified",
"hub",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/views.rb#L523-L532 | train | Gets the list of all the user s terms. | [
30522,
13366,
2862,
1035,
2011,
1035,
9594,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9594,
1035,
2171,
1010,
5310,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/tree/node.rb | HamlLint::Tree.Node.line_numbers | def line_numbers
return (line..line) unless @value && text
end_line = line + lines.count
end_line = nontrivial_end_line if line == end_line
(line..end_line)
end | ruby | def line_numbers
return (line..line) unless @value && text
end_line = line + lines.count
end_line = nontrivial_end_line if line == end_line
(line..end_line)
end | [
"def",
"line_numbers",
"return",
"(",
"line",
"..",
"line",
")",
"unless",
"@value",
"&&",
"text",
"end_line",
"=",
"line",
"+",
"lines",
".",
"count",
"end_line",
"=",
"nontrivial_end_line",
"if",
"line",
"==",
"end_line",
"(",
"line",
"..",
"end_line",
"... | The line numbers that are contained within the node.
@api public
@return [Range] | [
"The",
"line",
"numbers",
"that",
"are",
"contained",
"within",
"the",
"node",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/tree/node.rb#L104-L111 | train | Returns the line numbers of the next line in the document. | [
30522,
13366,
2240,
1035,
3616,
2709,
1006,
2240,
1012,
1012,
2240,
1007,
4983,
1030,
3643,
1004,
1004,
3793,
2203,
1035,
2240,
1027,
2240,
1009,
3210,
1012,
4175,
2203,
1035,
2240,
1027,
2512,
18886,
18660,
1035,
2203,
1035,
2240,
2065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
oauth-xx/oauth2 | lib/oauth2/access_token.rb | OAuth2.AccessToken.request | def request(verb, path, opts = {}, &block)
configure_authentication!(opts)
@client.request(verb, path, opts, &block)
end | ruby | def request(verb, path, opts = {}, &block)
configure_authentication!(opts)
@client.request(verb, path, opts, &block)
end | [
"def",
"request",
"(",
"verb",
",",
"path",
",",
"opts",
"=",
"{",
"}",
",",
"&",
"block",
")",
"configure_authentication!",
"(",
"opts",
")",
"@client",
".",
"request",
"(",
"verb",
",",
"path",
",",
"opts",
",",
"block",
")",
"end"
] | Make a request with the Access Token
@param [Symbol] verb the HTTP request method
@param [String] path the HTTP URL path of the request
@param [Hash] opts the options to make the request with
@see Client#request | [
"Make",
"a",
"request",
"with",
"the",
"Access",
"Token"
] | f08ff9da169136ab133aa2faab0d74a4407deffb | https://github.com/oauth-xx/oauth2/blob/f08ff9da169136ab133aa2faab0d74a4407deffb/lib/oauth2/access_token.rb#L111-L114 | train | Perform a request to the server. | [
30522,
13366,
5227,
1006,
12034,
1010,
4130,
1010,
23569,
2015,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
9530,
8873,
27390,
2063,
1035,
27280,
999,
1006,
23569,
2015,
1007,
1030,
7396,
1012,
5227,
1006,
12034,
1010,
4130,
1010,
23569,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/code_builder.rb | AwsSdkCodeGenerator.CodeBuilder.source | def source
code = @gem_dependencies.map { |gem_name, _| "require '#{gem_name}'" }
source_files.each.with_index do |(file_name, src_code), n|
# skip the service module and customizations
next if file_name.include? '/customizations.rb'
next unless file_name.include? '/'
# skip markdown files
next if file_name.include? 'README.md'
code << src_code
end
code.join("\n")
end | ruby | def source
code = @gem_dependencies.map { |gem_name, _| "require '#{gem_name}'" }
source_files.each.with_index do |(file_name, src_code), n|
# skip the service module and customizations
next if file_name.include? '/customizations.rb'
next unless file_name.include? '/'
# skip markdown files
next if file_name.include? 'README.md'
code << src_code
end
code.join("\n")
end | [
"def",
"source",
"code",
"=",
"@gem_dependencies",
".",
"map",
"{",
"|",
"gem_name",
",",
"_",
"|",
"\"require '#{gem_name}'\"",
"}",
"source_files",
".",
"each",
".",
"with_index",
"do",
"|",
"(",
"file_name",
",",
"src_code",
")",
",",
"n",
"|",
"# skip ... | @option options [required, Service] :service
@option options [required, String] :aws_sdk_core_lib_path
Path to the lib directory for the source code of the
AWS SDK for Ruby. This is needed so that documentation
can be generated for default plugins and their options.
@option options [Hash<String, Array<Hash>] :client_examples ({})
A hash of client examples. Hash keys should be API operation method
names (snake_cased). Hash values should be arrays of hashes.
Each hash should contain the following keys:
* `:name` - The name of the example
* `:code` - The Ruby example code
Generates the source for a library as a single string.
@return [String<code>]
@api private | [
"@option",
"options",
"[",
"required",
"Service",
"]",
":",
"service"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/code_builder.rb#L37-L48 | train | Returns the source code for the gem. | [
30522,
13366,
3120,
3642,
1027,
1030,
17070,
1035,
12530,
15266,
1012,
4949,
1063,
1064,
17070,
1035,
2171,
1010,
1035,
1064,
1000,
5478,
1005,
1001,
1063,
17070,
1035,
2171,
1065,
1005,
1000,
1065,
3120,
1035,
6764,
1012,
2169,
1012,
2007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.restart | def restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
response = restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def restart(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
response = restart_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"restart",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"instance_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"restart_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"instance_id",
",",
"custom_headers",
":cus... | Restarts a 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 [OperationStatusResponse] operation results. | [
"Restarts",
"a",
"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#L605-L608 | train | Restarts a virtual machine in a VM scale set. | [
30522,
13366,
23818,
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,
1007,
3433,
1027,
23818,
1035,
2004,
6038,
2278,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.list_pattern_any_entity_roles | def list_pattern_any_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
response = list_pattern_any_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_pattern_any_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
response = list_pattern_any_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_pattern_any_entity_roles",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_pattern_any_entity_roles_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"custom_headers",
":cus... | Get all roles for a Pattern.any entity in a version of the application
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id entity Id
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Get",
"all",
"roles",
"for",
"a",
"Pattern",
".",
"any",
"entity",
"in",
"a",
"version",
"of",
"the",
"application"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L7265-L7268 | train | Gets the roles of any entity in a version of the application. | [
30522,
13366,
2862,
1035,
5418,
1035,
2151,
1035,
9178,
1035,
4395,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
5418,
1035,
2151,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2016-06-27-preview/generated/azure_mgmt_container_registry/registries.rb | Azure::ContainerRegistry::Mgmt::V2016_06_27_preview.Registries.update_with_http_info | def update_with_http_info(resource_group_name, registry_name, registry_update_parameters, custom_headers:nil)
update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, registry_name, registry_update_parameters, custom_headers:nil)
update_async(resource_group_name, registry_name, registry_update_parameters, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_update_parameters",
",",
"custom_hea... | Updates a container registry with the specified parameters.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param registry_update_parameters [RegistryUpdateParameters] The parameters
for updating a container registry.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"a",
"container",
"registry",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2016-06-27-preview/generated/azure_mgmt_container_registry/registries.rb#L447-L449 | train | Updates a container registry. | [
30522,
13366,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
15584,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
10651,
1035,
2004,
6038,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/connection.rb | Github.Connection.stack | def stack(options = {})
@stack ||= begin
builder_class = if defined?(Faraday::RackBuilder)
Faraday::RackBuilder
else
Faraday::Builder
end
builder_class.new(&Github.default_middleware(options))
end
end | ruby | def stack(options = {})
@stack ||= begin
builder_class = if defined?(Faraday::RackBuilder)
Faraday::RackBuilder
else
Faraday::Builder
end
builder_class.new(&Github.default_middleware(options))
end
end | [
"def",
"stack",
"(",
"options",
"=",
"{",
"}",
")",
"@stack",
"||=",
"begin",
"builder_class",
"=",
"if",
"defined?",
"(",
"Faraday",
"::",
"RackBuilder",
")",
"Faraday",
"::",
"RackBuilder",
"else",
"Faraday",
"::",
"Builder",
"end",
"builder_class",
".",
... | Exposes middleware builder to facilitate custom stacks and easy
addition of new extensions such as cache adapter.
@api public | [
"Exposes",
"middleware",
"builder",
"to",
"facilitate",
"custom",
"stacks",
"and",
"easy",
"addition",
"of",
"new",
"extensions",
"such",
"as",
"cache",
"adapter",
"."
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/connection.rb#L55-L64 | train | Returns the stack for the current request | [
30522,
13366,
9991,
1006,
7047,
1027,
1063,
1065,
1007,
1030,
9991,
1064,
1064,
1027,
4088,
12508,
1035,
2465,
1027,
2065,
4225,
1029,
1006,
2521,
28039,
1024,
1024,
14513,
8569,
23891,
2099,
1007,
2521,
28039,
1024,
1024,
14513,
8569,
2389... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.report_replica_health_with_http_info | def report_replica_health_with_http_info(partition_id, replica_id, replica_health_report_service_kind, health_information, immediate:false, timeout:60, custom_headers:nil)
report_replica_health_async(partition_id, replica_id, replica_health_report_service_kind, health_information, immediate:immediate, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def report_replica_health_with_http_info(partition_id, replica_id, replica_health_report_service_kind, health_information, immediate:false, timeout:60, custom_headers:nil)
report_replica_health_async(partition_id, replica_id, replica_health_report_service_kind, health_information, immediate:immediate, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"report_replica_health_with_http_info",
"(",
"partition_id",
",",
"replica_id",
",",
"replica_health_report_service_kind",
",",
"health_information",
",",
"immediate",
":",
"false",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"report_replic... | Sends a health report on the Service Fabric replica.
Reports health state of the specified Service Fabric replica. The report must
contain the information about the source of the health report and property on
which it is reported.
The report is sent to a Service Fabric gateway Replica, which forwards to the
health store.
The report may be accepted by the gateway, but rejected by the health store
after extra validation.
For example, the health store may reject the report because of an invalid
parameter, like a stale sequence number.
To see whether the report was applied in the health store, run
GetReplicaHealth and check that the report appears in the HealthEvents
section.
@param partition_id The identity of the partition.
@param replica_id [String] The identifier of the replica.
@param replica_health_report_service_kind [ReplicaHealthReportServiceKind]
The kind of service replica (Stateless or Stateful) for which the health is
being reported. Following are the possible values. Possible values include:
'Stateless', 'Stateful'
@param health_information [HealthInformation] Describes the health
information for the health report. This information needs to be present in
all of the health reports sent to the health manager.
@param immediate [Boolean] A flag which indicates whether the report should
be sent immediately.
A health report is sent to a Service Fabric gateway Application, which
forwards to the health store.
If Immediate is set to true, the report is sent immediately from HTTP Gateway
to the health store, regardless of the fabric client settings that the HTTP
Gateway Application is using.
This is useful for critical reports that should be sent as soon as possible.
Depending on timing and other conditions, sending the report may still fail,
for example if the HTTP Gateway is closed or the message doesn't reach the
Gateway.
If Immediate is set to false, the report is sent based on the health client
settings from the HTTP Gateway. Therefore, it will be batched according to
the HealthReportSendInterval configuration.
This is the recommended setting because it allows the health client to
optimize health reporting messages to health store as well as health report
processing.
By default, reports are not sent immediately.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Sends",
"a",
"health",
"report",
"on",
"the",
"Service",
"Fabric",
"replica",
"."
] | 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#L15183-L15185 | train | Report health of a replica. | [
30522,
13366,
3189,
1035,
15059,
1035,
2740,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13571,
1035,
8909,
1010,
15059,
1035,
8909,
1010,
15059,
1035,
2740,
1035,
3189,
1035,
2326,
1035,
2785,
1010,
2740,
1035,
2592,
1010,
6234,
30524,
8909... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/data_criteria.rb | HQMF2.DataCriteria.basic_setup | def basic_setup
@status = attr_val('./*/cda:statusCode/@code')
@id_xpath = './*/cda:id/@extension'
@id = "#{attr_val('./*/cda:id/@extension')}_#{attr_val('./*/cda:id/@root')}"
@comments = @entry.xpath("./#{CRITERIA_GLOB}/cda:text/cda:xml/cda:qdmUserComments/cda:item/text()",
HQMF2::Document::NAMESPACES).map(&:content)
@code_list_xpath = './*/cda:code'
@value_xpath = './*/cda:value'
@is_derived_specific_occurrence_variable = false
simple_extractions = DataCriteriaBaseExtractions.new(@entry)
@template_ids = simple_extractions.extract_template_ids
@local_variable_name = simple_extractions.extract_local_variable_name
@temporal_references = simple_extractions.extract_temporal_references
@derivation_operator = simple_extractions.extract_derivation_operator
@children_criteria = simple_extractions.extract_child_criteria
@subset_operators = simple_extractions.extract_subset_operators
@negation, @negation_code_list_id = simple_extractions.extract_negation
end | ruby | def basic_setup
@status = attr_val('./*/cda:statusCode/@code')
@id_xpath = './*/cda:id/@extension'
@id = "#{attr_val('./*/cda:id/@extension')}_#{attr_val('./*/cda:id/@root')}"
@comments = @entry.xpath("./#{CRITERIA_GLOB}/cda:text/cda:xml/cda:qdmUserComments/cda:item/text()",
HQMF2::Document::NAMESPACES).map(&:content)
@code_list_xpath = './*/cda:code'
@value_xpath = './*/cda:value'
@is_derived_specific_occurrence_variable = false
simple_extractions = DataCriteriaBaseExtractions.new(@entry)
@template_ids = simple_extractions.extract_template_ids
@local_variable_name = simple_extractions.extract_local_variable_name
@temporal_references = simple_extractions.extract_temporal_references
@derivation_operator = simple_extractions.extract_derivation_operator
@children_criteria = simple_extractions.extract_child_criteria
@subset_operators = simple_extractions.extract_subset_operators
@negation, @negation_code_list_id = simple_extractions.extract_negation
end | [
"def",
"basic_setup",
"@status",
"=",
"attr_val",
"(",
"'./*/cda:statusCode/@code'",
")",
"@id_xpath",
"=",
"'./*/cda:id/@extension'",
"@id",
"=",
"\"#{attr_val('./*/cda:id/@extension')}_#{attr_val('./*/cda:id/@root')}\"",
"@comments",
"=",
"@entry",
".",
"xpath",
"(",
"\"./#... | Handles elments that can be extracted directly from the xml. Utilises the "BaseExtractions" class. | [
"Handles",
"elments",
"that",
"can",
"be",
"extracted",
"directly",
"from",
"the",
"xml",
".",
"Utilises",
"the",
"BaseExtractions",
"class",
"."
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/data_criteria.rb#L184-L201 | train | This method is called by the basic_setup method. | [
30522,
13366,
3937,
1035,
16437,
1030,
3570,
1027,
2012,
16344,
1035,
11748,
1006,
1005,
1012,
1013,
1008,
1013,
3729,
2050,
1024,
3570,
16044,
1013,
1030,
3642,
1005,
1007,
1030,
8909,
1035,
26726,
8988,
1027,
1005,
1012,
1013,
1008,
1013,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/streaming_endpoints.rb | Azure::MediaServices::Mgmt::V2018_07_01.StreamingEndpoints.begin_update | def begin_update(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:nil)
response = begin_update_async(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:nil)
response = begin_update_async(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update",
"(",
"resource_group_name",
",",
"account_name",
",",
"streaming_endpoint_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"streaming_end... | Update StreamingEndpoint
Updates a existing StreamingEndpoint.
@param resource_group_name [String] The name of the resource group within the
Azure subscription.
@param account_name [String] The Media Services account name.
@param streaming_endpoint_name [String] The name of the StreamingEndpoint.
@param parameters [StreamingEndpoint] StreamingEndpoint properties needed for
creation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [StreamingEndpoint] operation results. | [
"Update",
"StreamingEndpoint"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/streaming_endpoints.rb#L675-L678 | train | Updates an existing streaming endpoint. | [
30522,
13366,
4088,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
11058,
1035,
2203,
8400,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
10651,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/puppet | lib/puppet/util.rb | Puppet.Util.benchmark | def benchmark(*args)
msg = args.pop
level = args.pop
object = if args.empty?
if respond_to?(level)
self
else
Puppet
end
else
args.pop
end
#TRANSLATORS 'benchmark' is a method name and should not be translated
raise Puppet::DevError, _("Failed to provide level to benchmark") unless level
unless level == :none or object.respond_to? level
raise Puppet::DevError, _("Benchmarked object does not respond to %{value}") % { value: level }
end
# Only benchmark if our log level is high enough
if level != :none and Puppet::Util::Log.sendlevel?(level)
seconds = Benchmark.realtime {
yield
}
object.send(level, msg % { seconds: "%0.2f" % seconds })
return seconds
else
yield
end
end | ruby | def benchmark(*args)
msg = args.pop
level = args.pop
object = if args.empty?
if respond_to?(level)
self
else
Puppet
end
else
args.pop
end
#TRANSLATORS 'benchmark' is a method name and should not be translated
raise Puppet::DevError, _("Failed to provide level to benchmark") unless level
unless level == :none or object.respond_to? level
raise Puppet::DevError, _("Benchmarked object does not respond to %{value}") % { value: level }
end
# Only benchmark if our log level is high enough
if level != :none and Puppet::Util::Log.sendlevel?(level)
seconds = Benchmark.realtime {
yield
}
object.send(level, msg % { seconds: "%0.2f" % seconds })
return seconds
else
yield
end
end | [
"def",
"benchmark",
"(",
"*",
"args",
")",
"msg",
"=",
"args",
".",
"pop",
"level",
"=",
"args",
".",
"pop",
"object",
"=",
"if",
"args",
".",
"empty?",
"if",
"respond_to?",
"(",
"level",
")",
"self",
"else",
"Puppet",
"end",
"else",
"args",
".",
"... | execute a block of work and based on the logging level provided, log the provided message with the seconds taken
The message 'msg' should include string ' in %{seconds} seconds' as part of the message and any content should escape
any percent signs '%' so that they are not interpreted as formatting commands
escaped_str = str.gsub(/%/, '%%')
@param msg [String] the message to be formated to assigned the %{seconds} seconds take to execute,
other percent signs '%' need to be escaped
@param level [Symbol] the logging level for this message
@param object [Object] The object use for logging the message | [
"execute",
"a",
"block",
"of",
"work",
"and",
"based",
"on",
"the",
"logging",
"level",
"provided",
"log",
"the",
"provided",
"message",
"with",
"the",
"seconds",
"taken",
"The",
"message",
"msg",
"should",
"include",
"string",
"in",
"%",
"{",
"seconds",
"... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util.rb#L208-L238 | train | Benchmarks the given object. | [
30522,
13366,
6847,
10665,
1006,
1008,
12098,
5620,
1007,
5796,
2290,
1027,
12098,
5620,
1012,
3769,
2504,
1027,
12098,
5620,
1012,
3769,
4874,
1027,
2065,
12098,
5620,
1012,
4064,
1029,
2065,
6869,
1035,
2000,
1029,
1006,
2504,
1007,
2969,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_recovery_plans.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationRecoveryPlans.reprotect | def reprotect(recovery_plan_name, custom_headers:nil)
response = reprotect_async(recovery_plan_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def reprotect(recovery_plan_name, custom_headers:nil)
response = reprotect_async(recovery_plan_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"reprotect",
"(",
"recovery_plan_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"reprotect_async",
"(",
"recovery_plan_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
... | Execute reprotect of the recovery plan.
The operation to reprotect(reverse replicate) a recovery plan.
@param recovery_plan_name [String] Recovery plan name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RecoveryPlan] operation results. | [
"Execute",
"reprotect",
"of",
"the",
"recovery",
"plan",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_recovery_plans.rb#L435-L438 | train | Reprotect the specified recovery plan. | [
30522,
13366,
16360,
21709,
22471,
1006,
7233,
1035,
2933,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
16360,
21709,
22471,
1035,
2004,
6038,
2278,
1006,
7233,
1035,
2933,
1035,
2171,
1010,
30524,
3643,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chef/chef | lib/chef/shell/model_wrapper.rb | Shell.ModelWrapper.transform | def transform(what_to_transform)
if what_to_transform == :all
objects_to_transform = list_objects
else
objects_to_transform = search(what_to_transform)
end
objects_to_transform.each do |obj|
if result = yield(obj)
obj.save
end
end
end | ruby | def transform(what_to_transform)
if what_to_transform == :all
objects_to_transform = list_objects
else
objects_to_transform = search(what_to_transform)
end
objects_to_transform.each do |obj|
if result = yield(obj)
obj.save
end
end
end | [
"def",
"transform",
"(",
"what_to_transform",
")",
"if",
"what_to_transform",
"==",
":all",
"objects_to_transform",
"=",
"list_objects",
"else",
"objects_to_transform",
"=",
"search",
"(",
"what_to_transform",
")",
"end",
"objects_to_transform",
".",
"each",
"do",
"|"... | FIXME: yard with @yield | [
"FIXME",
":",
"yard",
"with"
] | 61f69e18e69e0dca6e8cffdcd7451181d874cdb3 | https://github.com/chef/chef/blob/61f69e18e69e0dca6e8cffdcd7451181d874cdb3/lib/chef/shell/model_wrapper.rb#L63-L74 | train | Transform the object to the desired type. | [
30522,
13366,
10938,
1006,
2054,
1035,
2000,
1035,
10938,
1007,
2065,
2054,
1035,
2000,
1035,
10938,
1027,
1027,
1024,
2035,
5200,
1035,
2000,
1035,
10938,
1027,
2862,
1035,
5200,
2842,
5200,
1035,
2000,
1035,
10938,
1027,
3945,
1006,
2054,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/utils.rb | HamlLint.Utils.count_consecutive | def count_consecutive(items, offset = 0)
count = 1
count += 1 while (offset + count < items.count) && yield(items[offset + count])
count
end | ruby | def count_consecutive(items, offset = 0)
count = 1
count += 1 while (offset + count < items.count) && yield(items[offset + count])
count
end | [
"def",
"count_consecutive",
"(",
"items",
",",
"offset",
"=",
"0",
")",
"count",
"=",
"1",
"count",
"+=",
"1",
"while",
"(",
"offset",
"+",
"count",
"<",
"items",
".",
"count",
")",
"&&",
"yield",
"(",
"items",
"[",
"offset",
"+",
"count",
"]",
")"... | Count the number of consecutive items satisfying the given {Proc}.
@param items [Array]
@param offset [Fixnum] index to start searching from
@yield [item] Passes item to the provided block.
@yieldparam item [Object] Item to evaluate as matching criteria for
inclusion
@yieldreturn [Boolean] whether to include the item
@return [Integer] | [
"Count",
"the",
"number",
"of",
"consecutive",
"items",
"satisfying",
"the",
"given",
"{",
"Proc",
"}",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/utils.rb#L133-L137 | train | Count the number of consecutive items in the collection. | [
30522,
13366,
4175,
1035,
5486,
1006,
5167,
1010,
16396,
1027,
1014,
1007,
4175,
1027,
1015,
4175,
1009,
1027,
1015,
2096,
1006,
16396,
1009,
4175,
1026,
5167,
1012,
4175,
1007,
1004,
1004,
10750,
1006,
5167,
1031,
16396,
1009,
4175,
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_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_deleted_secrets_as_lazy | def get_deleted_secrets_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_deleted_secrets_as_lazy_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def get_deleted_secrets_as_lazy(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_deleted_secrets_as_lazy_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"get_deleted_secrets_as_lazy",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"get_deleted_secrets_as_lazy_as_lazy",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_header... | Lists deleted secrets for the specified vault.
The Get Deleted Secrets operation returns the secrets that have been deleted
for a vault enabled for soft-delete. This operation requires the secrets/list
permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param maxresults [Integer] Maximum number of results to return in a page. If
not specified the service will return up to 25 results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DeletedSecretListResult] operation results. | [
"Lists",
"deleted",
"secrets",
"for",
"the",
"specified",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L10017-L10020 | train | Gets the deleted secrets. | [
30522,
13366,
2131,
1035,
17159,
1035,
7800,
1035,
2004,
1035,
13971,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
30524,
2140,
1007,
2034,
1035,
3931,
1027,
2131,
1035,
1715... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
stevegraham/slanger | lib/slanger/handler.rb | Slanger.Handler.onmessage | def onmessage(msg)
msg = Oj.strict_load(msg)
msg['data'] = Oj.strict_load(msg['data']) if msg['data'].is_a? String
event = msg['event'].gsub(/\Apusher:/, 'pusher_')
if event =~ /\Aclient-/
msg['socket_id'] = connection.socket_id
Channel.send_client_message msg
elsif respond_to? event, true
send event, msg
end
rescue JSON::ParserError
error({ code: 5001, message: "Invalid JSON" })
rescue Exception => e
error({ code: 500, message: "#{e.message}\n #{e.backtrace.join "\n"}" })
end | ruby | def onmessage(msg)
msg = Oj.strict_load(msg)
msg['data'] = Oj.strict_load(msg['data']) if msg['data'].is_a? String
event = msg['event'].gsub(/\Apusher:/, 'pusher_')
if event =~ /\Aclient-/
msg['socket_id'] = connection.socket_id
Channel.send_client_message msg
elsif respond_to? event, true
send event, msg
end
rescue JSON::ParserError
error({ code: 5001, message: "Invalid JSON" })
rescue Exception => e
error({ code: 500, message: "#{e.message}\n #{e.backtrace.join "\n"}" })
end | [
"def",
"onmessage",
"(",
"msg",
")",
"msg",
"=",
"Oj",
".",
"strict_load",
"(",
"msg",
")",
"msg",
"[",
"'data'",
"]",
"=",
"Oj",
".",
"strict_load",
"(",
"msg",
"[",
"'data'",
"]",
")",
"if",
"msg",
"[",
"'data'",
"]",
".",
"is_a?",
"String",
"e... | Dispatches message handling to method with same name as
the event name | [
"Dispatches",
"message",
"handling",
"to",
"method",
"with",
"same",
"name",
"as",
"the",
"event",
"name"
] | f26f80c675dc4d853bce401743779a6959981af1 | https://github.com/stevegraham/slanger/blob/f26f80c675dc4d853bce401743779a6959981af1/lib/slanger/handler.rb#L27-L45 | train | Send a message to the server | [
30522,
13366,
2006,
7834,
3736,
3351,
1006,
5796,
2290,
1007,
5796,
2290,
1027,
1051,
3501,
1012,
9384,
1035,
7170,
1006,
5796,
2290,
1007,
5796,
2290,
1031,
1005,
2951,
1005,
1033,
1027,
1051,
3501,
1012,
9384,
1035,
7170,
1006,
5796,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb | Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.get_at_resource | def get_at_resource(resource_id, remediation_name, custom_headers:nil)
response = get_at_resource_async(resource_id, remediation_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_at_resource(resource_id, remediation_name, custom_headers:nil)
response = get_at_resource_async(resource_id, remediation_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_at_resource",
"(",
"resource_id",
",",
"remediation_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_at_resource_async",
"(",
"resource_id",
",",
"remediation_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"respons... | Gets an existing remediation at resource scope.
@param resource_id [String] Resource ID.
@param remediation_name [String] The name of the remediation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Remediation] operation results. | [
"Gets",
"an",
"existing",
"remediation",
"at",
"resource",
"scope",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L2173-L2176 | train | Gets the information about the remediation at resource scope. | [
30522,
13366,
2131,
1035,
2012,
1035,
7692,
1006,
7692,
1035,
8909,
1010,
2128,
16969,
3508,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2012,
1035,
7692,
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... |
square/connect-ruby-sdk | lib/square_connect/api/catalog_api.rb | SquareConnect.CatalogApi.update_item_taxes | def update_item_taxes(body, opts = {})
data, _status_code, _headers = update_item_taxes_with_http_info(body, opts)
return data
end | ruby | def update_item_taxes(body, opts = {})
data, _status_code, _headers = update_item_taxes_with_http_info(body, opts)
return data
end | [
"def",
"update_item_taxes",
"(",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"update_item_taxes_with_http_info",
"(",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | UpdateItemTaxes
Updates the [CatalogTax](#type-catalogtax) objects that apply to the targeted [CatalogItem](#type-catalogitem) without having to perform an upsert on the entire item.
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [UpdateItemTaxesResponse] | [
"UpdateItemTaxes",
"Updates",
"the",
"[",
"CatalogTax",
"]",
"(",
"#type",
"-",
"catalogtax",
")",
"objects",
"that",
"apply",
"to",
"the",
"targeted",
"[",
"CatalogItem",
"]",
"(",
"#type",
"-",
"catalogitem",
")",
"without",
"having",
"to",
"perform",
"an"... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/catalog_api.rb#L521-L524 | train | Updates item taxes | [
30522,
13366,
10651,
1035,
8875,
1035,
7773,
1006,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
10651,
1035,
8875,
1035,
7773,
1035,
2007,
1035,
8299,
1035,
18558,
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... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/types.rb | HQMF2.Range.to_model | def to_model
lm = low.try(:to_model)
hm = high.try(:to_model)
wm = width.try(:to_model)
model_type = type
if @entry.at_xpath('./cda:uncertainRange', HQMF2::Document::NAMESPACES)
model_type = 'IVL_PQ'
end
if generate_any_value?(lm, hm)
# Generate AnyValue if the only elements in the range are AnyValues.
HQMF::AnyValue.new
elsif generate_value?(lm, hm)
# Generate a singel value if both low and high are the same
HQMF::Value.new(lm.type, nil, lm.value, lm.inclusive?, lm.derived?, lm.expression)
else
HQMF::Range.new(model_type, lm, hm, wm)
end
end | ruby | def to_model
lm = low.try(:to_model)
hm = high.try(:to_model)
wm = width.try(:to_model)
model_type = type
if @entry.at_xpath('./cda:uncertainRange', HQMF2::Document::NAMESPACES)
model_type = 'IVL_PQ'
end
if generate_any_value?(lm, hm)
# Generate AnyValue if the only elements in the range are AnyValues.
HQMF::AnyValue.new
elsif generate_value?(lm, hm)
# Generate a singel value if both low and high are the same
HQMF::Value.new(lm.type, nil, lm.value, lm.inclusive?, lm.derived?, lm.expression)
else
HQMF::Range.new(model_type, lm, hm, wm)
end
end | [
"def",
"to_model",
"lm",
"=",
"low",
".",
"try",
"(",
":to_model",
")",
"hm",
"=",
"high",
".",
"try",
"(",
":to_model",
")",
"wm",
"=",
"width",
".",
"try",
"(",
":to_model",
")",
"model_type",
"=",
"type",
"if",
"@entry",
".",
"at_xpath",
"(",
"'... | Generates this classes hqmf-model equivalent | [
"Generates",
"this",
"classes",
"hqmf",
"-",
"model",
"equivalent"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/types.rb#L132-L150 | train | Returns a new HQMF object for this range. | [
30522,
13366,
2000,
1035,
2944,
1048,
2213,
1027,
2659,
1012,
3046,
1006,
1024,
2000,
1035,
2944,
1007,
20287,
1027,
2152,
1012,
3046,
1006,
1024,
2000,
1035,
2944,
1007,
1059,
2213,
1027,
9381,
1012,
3046,
1006,
1024,
2000,
1035,
2944,
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... |
palkan/logidze | lib/logidze/model.rb | Logidze.Model.association | def association(name)
association = super
return association unless Logidze.associations_versioning
should_apply_logidze =
logidze_past? &&
association.klass.respond_to?(:has_logidze?) &&
!association.singleton_class.include?(Logidze::VersionedAssociation)
return association unless should_apply_logidze
association.singleton_class.prepend Logidze::VersionedAssociation
if association.is_a? ActiveRecord::Associations::CollectionAssociation
association.singleton_class.prepend(
Logidze::VersionedAssociation::CollectionAssociation
)
end
association
end | ruby | def association(name)
association = super
return association unless Logidze.associations_versioning
should_apply_logidze =
logidze_past? &&
association.klass.respond_to?(:has_logidze?) &&
!association.singleton_class.include?(Logidze::VersionedAssociation)
return association unless should_apply_logidze
association.singleton_class.prepend Logidze::VersionedAssociation
if association.is_a? ActiveRecord::Associations::CollectionAssociation
association.singleton_class.prepend(
Logidze::VersionedAssociation::CollectionAssociation
)
end
association
end | [
"def",
"association",
"(",
"name",
")",
"association",
"=",
"super",
"return",
"association",
"unless",
"Logidze",
".",
"associations_versioning",
"should_apply_logidze",
"=",
"logidze_past?",
"&&",
"association",
".",
"klass",
".",
"respond_to?",
"(",
":has_logidze?"... | rubocop: disable Metrics/MethodLength | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"MethodLength"
] | ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8 | https://github.com/palkan/logidze/blob/ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8/lib/logidze/model.rb#L179-L200 | train | Returns the association with the given name. | [
30522,
13366,
2523,
1006,
2171,
1007,
2523,
1027,
3565,
2709,
2523,
4983,
8833,
3593,
4371,
1012,
8924,
1035,
2544,
2075,
2323,
1035,
6611,
1035,
8833,
3593,
4371,
1027,
8833,
3593,
4371,
1035,
2627,
1029,
1004,
1004,
2523,
1012,
1047,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/cache.rb | Discordrb.Cache.user | def user(id)
id = id.resolve_id
return @users[id] if @users[id]
LOGGER.out("Resolving user #{id}")
begin
response = API::User.resolve(token, id)
rescue RestClient::ResourceNotFound
return nil
end
user = User.new(JSON.parse(response), self)
@users[id] = user
end | ruby | def user(id)
id = id.resolve_id
return @users[id] if @users[id]
LOGGER.out("Resolving user #{id}")
begin
response = API::User.resolve(token, id)
rescue RestClient::ResourceNotFound
return nil
end
user = User.new(JSON.parse(response), self)
@users[id] = user
end | [
"def",
"user",
"(",
"id",
")",
"id",
"=",
"id",
".",
"resolve_id",
"return",
"@users",
"[",
"id",
"]",
"if",
"@users",
"[",
"id",
"]",
"LOGGER",
".",
"out",
"(",
"\"Resolving user #{id}\"",
")",
"begin",
"response",
"=",
"API",
"::",
"User",
".",
"re... | Gets a user by its ID.
@note This can only resolve users known by the bot (i.e. that share a server with the bot).
@param id [Integer] The user ID that should be resolved.
@return [User, nil] The user identified by the ID, or `nil` if it couldn't be found. | [
"Gets",
"a",
"user",
"by",
"its",
"ID",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/cache.rb#L75-L87 | train | Returns a user object for the given user ID. | [
30522,
13366,
5310,
1006,
8909,
1007,
8909,
1027,
8909,
1012,
10663,
1035,
8909,
2709,
1030,
5198,
1031,
8909,
1033,
2065,
1030,
5198,
1031,
8909,
1033,
8833,
4590,
1012,
2041,
1006,
1000,
29304,
5310,
1001,
1063,
8909,
1065,
1000,
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... |
puppetlabs/puppet | lib/puppet/functions.rb | Puppet::Functions.InternalFunction.call_function_with_scope | def call_function_with_scope(scope, function_name, *args, &block)
internal_call_function(scope, function_name, args, &block)
end | ruby | def call_function_with_scope(scope, function_name, *args, &block)
internal_call_function(scope, function_name, args, &block)
end | [
"def",
"call_function_with_scope",
"(",
"scope",
",",
"function_name",
",",
"*",
"args",
",",
"&",
"block",
")",
"internal_call_function",
"(",
"scope",
",",
"function_name",
",",
"args",
",",
"block",
")",
"end"
] | Allows the implementation of a function to call other functions by name and pass the caller
scope. The callable functions are those visible to the same loader that loaded this function
(the calling function).
@param scope [Puppet::Parser::Scope] The caller scope
@param function_name [String] The name of the function
@param *args [Object] splat of arguments
@return [Object] The result returned by the called function
@api public | [
"Allows",
"the",
"implementation",
"of",
"a",
"function",
"to",
"call",
"other",
"functions",
"by",
"name",
"and",
"pass",
"the",
"caller",
"scope",
".",
"The",
"callable",
"functions",
"are",
"those",
"visible",
"to",
"the",
"same",
"loader",
"that",
"loade... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/functions.rb#L678-L680 | train | Calls a function in the current scope. | [
30522,
13366,
2655,
1035,
3853,
1035,
2007,
1035,
9531,
1006,
9531,
1010,
3853,
1035,
2171,
1010,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
4722,
1035,
2655,
1035,
3853,
1006,
9531,
1010,
3853,
1035,
2171,
1010,
12098,
5620,
1010,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | railties/lib/rails/engine.rb | Rails.Engine.routes | def routes(&block)
@routes ||= ActionDispatch::Routing::RouteSet.new_with_config(config)
@routes.append(&block) if block_given?
@routes
end | ruby | def routes(&block)
@routes ||= ActionDispatch::Routing::RouteSet.new_with_config(config)
@routes.append(&block) if block_given?
@routes
end | [
"def",
"routes",
"(",
"&",
"block",
")",
"@routes",
"||=",
"ActionDispatch",
"::",
"Routing",
"::",
"RouteSet",
".",
"new_with_config",
"(",
"config",
")",
"@routes",
".",
"append",
"(",
"block",
")",
"if",
"block_given?",
"@routes",
"end"
] | Defines the routes for this engine. If a block is given to
routes, it is appended to the engine. | [
"Defines",
"the",
"routes",
"for",
"this",
"engine",
".",
"If",
"a",
"block",
"is",
"given",
"to",
"routes",
"it",
"is",
"appended",
"to",
"the",
"engine",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/railties/lib/rails/engine.rb#L536-L540 | train | Returns a new RouteSet with the routes defined in the config. | [
30522,
13366,
5847,
1006,
1004,
3796,
1007,
1030,
5847,
1064,
1064,
1027,
2895,
10521,
4502,
10649,
1024,
1024,
16972,
1024,
1024,
5847,
3388,
1012,
2047,
1035,
2007,
1035,
9530,
8873,
2290,
1006,
9530,
8873,
2290,
1007,
1030,
5847,
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... |
benbalter/word-to-markdown | lib/cliver/dependency_ext.rb | Cliver.Dependency.version | def version
return @detected_version if defined? @detected_version
return if Gem.win_platform?
version = installed_versions.find { |p, _v| p == path }
@detected_version = version.nil? ? nil : version[1]
end | ruby | def version
return @detected_version if defined? @detected_version
return if Gem.win_platform?
version = installed_versions.find { |p, _v| p == path }
@detected_version = version.nil? ? nil : version[1]
end | [
"def",
"version",
"return",
"@detected_version",
"if",
"defined?",
"@detected_version",
"return",
"if",
"Gem",
".",
"win_platform?",
"version",
"=",
"installed_versions",
".",
"find",
"{",
"|",
"p",
",",
"_v",
"|",
"p",
"==",
"path",
"}",
"@detected_version",
... | Returns the version of the resolved dependency | [
"Returns",
"the",
"version",
"of",
"the",
"resolved",
"dependency"
] | 48031ffd70c9a8caa9978fa576c6de24b736df20 | https://github.com/benbalter/word-to-markdown/blob/48031ffd70c9a8caa9978fa576c6de24b736df20/lib/cliver/dependency_ext.rb#L26-L32 | train | Returns the version number of the current version of the project. | [
30522,
13366,
2544,
2709,
1030,
11156,
1035,
2544,
2065,
4225,
1029,
1030,
11156,
1035,
2544,
2709,
2065,
17070,
1012,
2663,
1035,
4132,
1029,
2544,
1027,
5361,
1035,
4617,
1012,
2424,
1063,
1064,
1052,
1010,
1035,
1058,
1064,
1052,
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... |
CanCanCommunity/cancancan | lib/cancan/ability.rb | CanCan.Ability.merge | def merge(ability)
ability.rules.each do |rule|
add_rule(rule.dup)
end
@aliased_actions = aliased_actions.merge(ability.aliased_actions)
self
end | ruby | def merge(ability)
ability.rules.each do |rule|
add_rule(rule.dup)
end
@aliased_actions = aliased_actions.merge(ability.aliased_actions)
self
end | [
"def",
"merge",
"(",
"ability",
")",
"ability",
".",
"rules",
".",
"each",
"do",
"|",
"rule",
"|",
"add_rule",
"(",
"rule",
".",
"dup",
")",
"end",
"@aliased_actions",
"=",
"aliased_actions",
".",
"merge",
"(",
"ability",
".",
"aliased_actions",
")",
"se... | Copies all rules and aliased actions of the given +CanCan::Ability+ and adds them to +self+.
class ReadAbility
include CanCan::Ability
def initialize
can :read, User
alias_action :show, :index, to: :see
end
end
class WritingAbility
include CanCan::Ability
def initialize
can :edit, User
alias_action :create, :update, to: :modify
end
end
read_ability = ReadAbility.new
read_ability.can? :edit, User.new #=> false
read_ability.merge(WritingAbility.new)
read_ability.can? :edit, User.new #=> true
read_ability.aliased_actions #=> [:see => [:show, :index], :modify => [:create, :update]]
If there are collisions when merging the +aliased_actions+, the actions on +self+ will be
overwritten.
class ReadAbility
include CanCan::Ability
def initialize
alias_action :show, :index, to: :see
end
end
class ShowAbility
include CanCan::Ability
def initialize
alias_action :show, to: :see
end
end
read_ability = ReadAbility.new
read_ability.merge(ShowAbility)
read_ability.aliased_actions #=> [:see => [:show]] | [
"Copies",
"all",
"rules",
"and",
"aliased",
"actions",
"of",
"the",
"given",
"+",
"CanCan",
"::",
"Ability",
"+",
"and",
"adds",
"them",
"to",
"+",
"self",
"+",
".",
"class",
"ReadAbility",
"include",
"CanCan",
"::",
"Ability"
] | b2e5660c6b9b683fc45b8f425b90c4d06e2f24bf | https://github.com/CanCanCommunity/cancancan/blob/b2e5660c6b9b683fc45b8f425b90c4d06e2f24bf/lib/cancan/ability.rb#L248-L254 | train | Merge the rules of this rule with the ability. | [
30522,
13366,
13590,
1006,
3754,
1007,
3754,
1012,
3513,
1012,
2169,
2079,
1064,
3627,
1064,
5587,
1035,
3627,
1006,
3627,
1012,
4241,
2361,
1007,
2203,
1030,
14593,
2098,
1035,
4506,
1027,
14593,
2098,
1035,
4506,
1012,
13590,
1006,
3754,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sensu/sensu | lib/sensu/utilities.rb | Sensu.Utilities.determine_check_cron_time | def determine_check_cron_time(check)
cron_parser = CronParser.new(check[:cron])
current_time = Time.now
next_cron_time = cron_parser.next(current_time)
next_cron_time - current_time
end | ruby | def determine_check_cron_time(check)
cron_parser = CronParser.new(check[:cron])
current_time = Time.now
next_cron_time = cron_parser.next(current_time)
next_cron_time - current_time
end | [
"def",
"determine_check_cron_time",
"(",
"check",
")",
"cron_parser",
"=",
"CronParser",
".",
"new",
"(",
"check",
"[",
":cron",
"]",
")",
"current_time",
"=",
"Time",
".",
"now",
"next_cron_time",
"=",
"cron_parser",
".",
"next",
"(",
"current_time",
")",
"... | Determine the next check cron time.
@param check [Hash] definition. | [
"Determine",
"the",
"next",
"check",
"cron",
"time",
"."
] | 51319e4b58c8d9986f101ad71ff729aa3e51e951 | https://github.com/sensu/sensu/blob/51319e4b58c8d9986f101ad71ff729aa3e51e951/lib/sensu/utilities.rb#L390-L395 | train | Determine the cron time for a check | [
30522,
13366,
5646,
1035,
4638,
1035,
13675,
2239,
1035,
2051,
1006,
4638,
1007,
13675,
2239,
1035,
11968,
8043,
1027,
13675,
2239,
19362,
8043,
1012,
2047,
1006,
4638,
1031,
1024,
13675,
2239,
1033,
1007,
2783,
1035,
2051,
1027,
2051,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.set_storage_account | def set_storage_account(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil)
response = set_storage_account_async(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:storage_account_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def set_storage_account(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:nil, storage_account_attributes:nil, tags:nil, custom_headers:nil)
response = set_storage_account_async(vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period:regeneration_period, storage_account_attributes:storage_account_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"set_storage_account",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"resource_id",
",",
"active_key_name",
",",
"auto_regenerate_key",
",",
"regeneration_period",
":",
"nil",
",",
"storage_account_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",... | Creates or updates a new storage account. This operation requires the
storage/set permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param storage_account_name [String] The name of the storage account.
@param resource_id [String] Storage account resource id.
@param active_key_name [String] Current active storage account key name.
@param auto_regenerate_key [Boolean] whether keyvault should manage the
storage account for the user.
@param regeneration_period [String] The key regeneration time duration
specified in ISO-8601 format.
@param storage_account_attributes [StorageAccountAttributes] The attributes
of the storage account.
@param tags [Hash{String => String}] Application specific metadata in the
form of key-value pairs.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [StorageBundle] operation results. | [
"Creates",
"or",
"updates",
"a",
"new",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"set",
"permission",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L7278-L7281 | train | Sets the storage account. | [
30522,
13366,
2275,
1035,
5527,
1035,
4070,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
7692,
1035,
8909,
1010,
3161,
1035,
3145,
1035,
2171,
1010,
8285,
1035,
19723,
24454,
3686,
1035,
3145,
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... |
rails/sprockets | lib/sprockets/path_utils.rb | Sprockets.PathUtils.entries | def entries(path)
if File.directory?(path)
entries = Dir.entries(path, encoding: Encoding.default_internal)
entries.reject! { |entry|
entry.start_with?(".".freeze) ||
(entry.start_with?("#".freeze) && entry.end_with?("#".freeze)) ||
entry.end_with?("~".freeze)
}
entries.sort!
entries
else
[]
end
end | ruby | def entries(path)
if File.directory?(path)
entries = Dir.entries(path, encoding: Encoding.default_internal)
entries.reject! { |entry|
entry.start_with?(".".freeze) ||
(entry.start_with?("#".freeze) && entry.end_with?("#".freeze)) ||
entry.end_with?("~".freeze)
}
entries.sort!
entries
else
[]
end
end | [
"def",
"entries",
"(",
"path",
")",
"if",
"File",
".",
"directory?",
"(",
"path",
")",
"entries",
"=",
"Dir",
".",
"entries",
"(",
"path",
",",
"encoding",
":",
"Encoding",
".",
"default_internal",
")",
"entries",
".",
"reject!",
"{",
"|",
"entry",
"|"... | Public: A version of `Dir.entries` that filters out `.` files and `~`
swap files.
path - String directory path
Returns an empty `Array` if the directory does not exist. | [
"Public",
":",
"A",
"version",
"of",
"Dir",
".",
"entries",
"that",
"filters",
"out",
".",
"files",
"and",
"~",
"swap",
"files",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/path_utils.rb#L56-L69 | train | Returns an array of the directory entries in the given path. | [
30522,
13366,
10445,
1006,
4130,
1007,
2065,
5371,
1012,
14176,
1029,
1006,
4130,
1007,
10445,
1027,
16101,
1012,
10445,
1006,
4130,
1010,
17181,
1024,
17181,
1012,
12398,
1035,
4722,
1007,
10445,
1012,
15454,
999,
1063,
1064,
4443,
1064,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-s3/lib/aws-sdk-s3/bucket.rb | Aws::S3.Bucket.delete_objects | def delete_objects(options = {})
options = options.merge(bucket: @name)
resp = @client.delete_objects(options)
resp.data
end | ruby | def delete_objects(options = {})
options = options.merge(bucket: @name)
resp = @client.delete_objects(options)
resp.data
end | [
"def",
"delete_objects",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"bucket",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"delete_objects",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
bucket.delete_objects({
delete: { # required
objects: [ # required
{
key: "ObjectKey", # required
version_id: "ObjectVersionId",
},
],
quiet: false,
},
mfa: "MFA",
request_payer: "requester", # accepts requester
bypass_governance_retention: false,
})
@param [Hash] options ({})
@option options [required, Types::Delete] :delete
@option options [String] :mfa
The concatenation of the authentication device's serial number, a
space, and the value that is displayed on your authentication device.
@option options [String] :request_payer
Confirms that the requester knows that she or he will be charged for
the request. Bucket owners need not specify this parameter in their
requests. Documentation on downloading objects from requester pays
buckets can be found at
http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html
@option options [Boolean] :bypass_governance_retention
Specifies whether you want to delete this object even if it has a
Governance-type Object Lock in place. You must have sufficient
permissions to perform this operation.
@return [Types::DeleteObjectsOutput] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-s3/lib/aws-sdk-s3/bucket.rb#L297-L301 | train | Delete all objects in the bucket. | [
30522,
13366,
3972,
12870,
1035,
5200,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
13610,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
5200,
1006,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/bot.rb | Discordrb.Bot.send_message | def send_message(channel, content, tts = false, embed = nil)
channel = channel.resolve_id
debug("Sending message to #{channel} with content '#{content}'")
response = API::Channel.create_message(token, channel, content, tts, embed ? embed.to_hash : nil)
Message.new(JSON.parse(response), self)
end | ruby | def send_message(channel, content, tts = false, embed = nil)
channel = channel.resolve_id
debug("Sending message to #{channel} with content '#{content}'")
response = API::Channel.create_message(token, channel, content, tts, embed ? embed.to_hash : nil)
Message.new(JSON.parse(response), self)
end | [
"def",
"send_message",
"(",
"channel",
",",
"content",
",",
"tts",
"=",
"false",
",",
"embed",
"=",
"nil",
")",
"channel",
"=",
"channel",
".",
"resolve_id",
"debug",
"(",
"\"Sending message to #{channel} with content '#{content}'\"",
")",
"response",
"=",
"API",
... | Sends a text message to a channel given its ID and the message's content.
@param channel [Channel, Integer, #resolve_id] The channel to send something to.
@param content [String] The text that should be sent as a message. It is limited to 2000 characters (Discord imposed).
@param tts [true, false] Whether or not this message should be sent using Discord text-to-speech.
@param embed [Hash, Discordrb::Webhooks::Embed, nil] The rich embed to append to this message.
@return [Message] The message that was sent. | [
"Sends",
"a",
"text",
"message",
"to",
"a",
"channel",
"given",
"its",
"ID",
"and",
"the",
"message",
"s",
"content",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L366-L372 | train | Send a message to a channel | [
30522,
13366,
4604,
1035,
4471,
1006,
3149,
1010,
4180,
1010,
23746,
2015,
1027,
6270,
1010,
7861,
8270,
1027,
9152,
2140,
1007,
3149,
1027,
3149,
1012,
10663,
1035,
8909,
2139,
8569,
2290,
1006,
1000,
6016,
4471,
2000,
1001,
1063,
3149,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/client/authorizations/app.rb | Github.Client::Authorizations::App.create | def create(*args)
raise_authentication_error unless authenticated?
arguments(args, required: [:client_id])
if arguments.client_id
put_request("/authorizations/clients/#{arguments.client_id}", arguments.params)
else
raise raise_app_authentication_error
end
end | ruby | def create(*args)
raise_authentication_error unless authenticated?
arguments(args, required: [:client_id])
if arguments.client_id
put_request("/authorizations/clients/#{arguments.client_id}", arguments.params)
else
raise raise_app_authentication_error
end
end | [
"def",
"create",
"(",
"*",
"args",
")",
"raise_authentication_error",
"unless",
"authenticated?",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":client_id",
"]",
")",
"if",
"arguments",
".",
"client_id",
"put_request",
"(",
"\"/authorizations/clients/#{argum... | Get-or-create an authorization for a specific app
@see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app
@param [Hash] params
@option params [String] client_secret
The 40 character OAuth app client secret associated with the client
ID specified in the URL.
@option params [Array] :scopes
Optional array - A list of scopes that this authorization is in.
@option params [String] :note
Optional string - A note to remind you what the OAuth token is for.
@option params [String] :note_url
Optional string - A URL to remind you what the OAuth token is for.
@example
github = Github.new
github.oauth.app.create 'client-id', client_secret: '...'
@api public | [
"Get",
"-",
"or",
"-",
"create",
"an",
"authorization",
"for",
"a",
"specific",
"app"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/authorizations/app.rb#L27-L36 | train | Create a new client | [
30522,
13366,
3443,
1006,
1008,
12098,
5620,
1007,
5333,
1035,
27280,
1035,
7561,
4983,
14469,
4383,
1029,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
7396,
1035,
8909,
1033,
1007,
2065,
9918,
1012,
7396,
1035,
8909,
2404,
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_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb | Azure::SQL::Mgmt::V2015_05_01_preview.SyncGroups.list_sync_database_ids_next | def list_sync_database_ids_next(next_page_link, custom_headers:nil)
response = list_sync_database_ids_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_sync_database_ids_next(next_page_link, custom_headers:nil)
response = list_sync_database_ids_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_sync_database_ids_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_sync_database_ids_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unle... | Gets a collection of sync database ids.
@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 [SyncDatabaseIdListResult] operation results. | [
"Gets",
"a",
"collection",
"of",
"sync",
"database",
"ids",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb#L1424-L1427 | train | Gets the list of sync database IDs. | [
30522,
13366,
2862,
1035,
26351,
1035,
7809,
1035,
8909,
2015,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
26351,
1035,
7809,
1035,
8909,
2015,
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... |
rollbar/rollbar-gem | lib/rollbar/logger.rb | Rollbar.Logger.rollbar | def rollbar
notifier = Rollbar.scope
notifier.configuration.logger = ::Logger.new('/dev/null')
notifier
end | ruby | def rollbar
notifier = Rollbar.scope
notifier.configuration.logger = ::Logger.new('/dev/null')
notifier
end | [
"def",
"rollbar",
"notifier",
"=",
"Rollbar",
".",
"scope",
"notifier",
".",
"configuration",
".",
"logger",
"=",
"::",
"Logger",
".",
"new",
"(",
"'/dev/null'",
")",
"notifier",
"end"
] | Returns a Rollbar::Notifier instance with the current global scope and
with a logger writing to /dev/null so we don't have a infinite loop
when Rollbar.configuration.logger is Rails.logger. | [
"Returns",
"a",
"Rollbar",
"::",
"Notifier",
"instance",
"with",
"the",
"current",
"global",
"scope",
"and",
"with",
"a",
"logger",
"writing",
"to",
"/",
"dev",
"/",
"null",
"so",
"we",
"don",
"t",
"have",
"a",
"infinite",
"loop",
"when",
"Rollbar",
".",... | 83ef1acca2b0b1d1b74ff8ef29435ca82e8ca1d6 | https://github.com/rollbar/rollbar-gem/blob/83ef1acca2b0b1d1b74ff8ef29435ca82e8ca1d6/lib/rollbar/logger.rb#L59-L64 | train | Returns the index of the current object in the rollbar. | [
30522,
13366,
4897,
8237,
2025,
18095,
1027,
4897,
8237,
1012,
9531,
2025,
18095,
1012,
9563,
1012,
8833,
4590,
1027,
1024,
1024,
8833,
4590,
1012,
2047,
1006,
1005,
1013,
16475,
1013,
19701,
1005,
1007,
2025,
18095,
2203,
102,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_application_backup_list | def get_application_backup_list(application_id, timeout:60, latest:false, start_date_time_filter:nil, end_date_time_filter:nil, continuation_token:nil, max_results:0, custom_headers:nil)
response = get_application_backup_list_async(application_id, timeout:timeout, latest:latest, start_date_time_filter:start_date_time_filter, end_date_time_filter:end_date_time_filter, continuation_token:continuation_token, max_results:max_results, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_application_backup_list(application_id, timeout:60, latest:false, start_date_time_filter:nil, end_date_time_filter:nil, continuation_token:nil, max_results:0, custom_headers:nil)
response = get_application_backup_list_async(application_id, timeout:timeout, latest:latest, start_date_time_filter:start_date_time_filter, end_date_time_filter:end_date_time_filter, continuation_token:continuation_token, max_results:max_results, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_application_backup_list",
"(",
"application_id",
",",
"timeout",
":",
"60",
",",
"latest",
":",
"false",
",",
"start_date_time_filter",
":",
"nil",
",",
"end_date_time_filter",
":",
"nil",
",",
"continuation_token",
":",
"nil",
",",
"max_results",
":",... | Gets the list of backups available for every partition in this application.
Returns a list of backups available for every partition in this Service
Fabric application. The server enumerates all the backups available at the
backup location configured in the backup policy. It also allows filtering of
the result based on start and end datetime or just fetching the latest
available backup for every partition.
@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 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 latest [Boolean] Specifies whether to get only the most recent backup
available for a partition for the specified time range.
@param start_date_time_filter [DateTime] Specify the start date time from
which to enumerate backups, in datetime format. The date time must be
specified in ISO8601 format. This is an optional parameter. If not specified,
all backups from the beginning are enumerated.
@param end_date_time_filter [DateTime] Specify the end date time till which
to enumerate backups, in datetime format. The date time must be specified in
ISO8601 format. This is an optional parameter. If not specified, enumeration
is done till the most recent backup.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PagedBackupInfoList] operation results. | [
"Gets",
"the",
"list",
"of",
"backups",
"available",
"for",
"every",
"partition",
"in",
"this",
"application",
"."
] | 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#L23404-L23407 | train | Gets the backup list of the applications. | [
30522,
13366,
2131,
1035,
4646,
1035,
10200,
1035,
2862,
1006,
4646,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
6745,
1024,
6270,
1010,
2707,
1035,
3058,
1035,
2051,
1035,
11307,
1024,
9152,
2140,
1010,
2203,
1035,
3058,
1035,
2051,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb | Azure::Network::Mgmt::V2019_02_01.ApplicationGateways.begin_update_tags_with_http_info | def begin_update_tags_with_http_info(resource_group_name, application_gateway_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, application_gateway_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_tags_with_http_info(resource_group_name, application_gateway_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, application_gateway_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_tags_with_http_info",
"(",
"resource_group_name",
",",
"application_gateway_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_tags_async",
"(",
"resource_group_name",
",",
"application_gateway_name",
",",
"parameters",
",",
... | Updates the specified application gateway tags.
@param resource_group_name [String] The name of the resource group.
@param application_gateway_name [String] The name of the application gateway.
@param parameters [TagsObject] Parameters supplied to update application
gateway tags.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"the",
"specified",
"application",
"gateway",
"tags",
"."
] | 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#L1455-L1457 | train | Updates a resource group tags on an application gateway. | [
30522,
13366,
4088,
1035,
10651,
1035,
22073,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4646,
1035,
11909,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
1065... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cerebris/jsonapi-resources | lib/jsonapi/resource_id_tree.rb | JSONAPI.RelatedResourceIdTree.add_resource_fragment | def add_resource_fragment(fragment, include_related)
init_included_relationships(fragment, include_related)
fragment.related_from.each do |rid|
@source_resource_id_tree.fragments[rid].add_related_identity(parent_relationship.name, fragment.identity)
end
@fragments[fragment.identity] = fragment
end | ruby | def add_resource_fragment(fragment, include_related)
init_included_relationships(fragment, include_related)
fragment.related_from.each do |rid|
@source_resource_id_tree.fragments[rid].add_related_identity(parent_relationship.name, fragment.identity)
end
@fragments[fragment.identity] = fragment
end | [
"def",
"add_resource_fragment",
"(",
"fragment",
",",
"include_related",
")",
"init_included_relationships",
"(",
"fragment",
",",
"include_related",
")",
"fragment",
".",
"related_from",
".",
"each",
"do",
"|",
"rid",
"|",
"@source_resource_id_tree",
".",
"fragments"... | Adds a Resource Fragment to the fragments hash
@param fragment [JSONAPI::ResourceFragment]
@param include_related [Hash]
@return [null] | [
"Adds",
"a",
"Resource",
"Fragment",
"to",
"the",
"fragments",
"hash"
] | 1ac6bba777e364eaa36706f888792b99b63d8d1a | https://github.com/cerebris/jsonapi-resources/blob/1ac6bba777e364eaa36706f888792b99b63d8d1a/lib/jsonapi/resource_id_tree.rb#L102-L110 | train | Add a fragment to the resource id tree | [
30522,
13366,
5587,
1035,
7692,
1035,
15778,
1006,
15778,
1010,
2421,
1035,
3141,
1007,
1999,
4183,
1035,
2443,
1035,
6550,
1006,
15778,
1010,
2421,
1035,
3141,
1007,
15778,
1012,
3141,
1035,
2013,
1012,
2169,
2079,
1064,
9436,
1064,
1030,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_certificates_with_http_info | def get_certificates_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_certificates_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | ruby | def get_certificates_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_certificates_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | [
"def",
"get_certificates_with_http_info",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_certificates_async",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_headers",
":custom_headers",
")",
... | List certificates in a specified key vault
The GetCertificates operation returns the set of certificates resources in
the specified key vault. This operation requires the certificates/list
permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param maxresults [Integer] Maximum number of results to return in a page. If
not specified the service will return up to 25 results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"List",
"certificates",
"in",
"a",
"specified",
"key",
"vault"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L4046-L4048 | train | Gets the certificates associated with the specified vault. | [
30522,
13366,
2131,
1035,
17987,
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,
9152,
2140,
1007,
2131,
1035,
17987,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/table.rb | Aws::DynamoDB.Table.delete_item | def delete_item(options = {})
options = options.merge(table_name: @name)
resp = @client.delete_item(options)
resp.data
end | ruby | def delete_item(options = {})
options = options.merge(table_name: @name)
resp = @client.delete_item(options)
resp.data
end | [
"def",
"delete_item",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"table_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"delete_item",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
table.delete_item({
key: { # required
"AttributeName" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
},
expected: {
"AttributeName" => {
value: "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
exists: false,
comparison_operator: "EQ", # accepts EQ, NE, IN, LE, LT, GE, GT, BETWEEN, NOT_NULL, NULL, CONTAINS, NOT_CONTAINS, BEGINS_WITH
attribute_value_list: ["value"], # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
},
},
conditional_operator: "AND", # accepts AND, OR
return_values: "NONE", # accepts NONE, ALL_OLD, UPDATED_OLD, ALL_NEW, UPDATED_NEW
return_consumed_capacity: "INDEXES", # accepts INDEXES, TOTAL, NONE
return_item_collection_metrics: "SIZE", # accepts SIZE, NONE
condition_expression: "ConditionExpression",
expression_attribute_names: {
"ExpressionAttributeNameVariable" => "AttributeName",
},
expression_attribute_values: {
"ExpressionAttributeValueVariable" => "value", # value <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
},
})
@param [Hash] options ({})
@option options [required, Hash<String,Types::AttributeValue>] :key
A map of attribute names to `AttributeValue` objects, representing the
primary key of the item to delete.
For the primary key, you must provide all of the attributes. For
example, with a simple primary key, you only need to provide a value
for the partition key. For a composite primary key, you must provide
values for both the partition key and the sort key.
@option options [Hash<String,Types::ExpectedAttributeValue>] :expected
This is a legacy parameter. Use `ConditionExpression` instead. For
more information, see [Expected][1] in the *Amazon DynamoDB Developer
Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html
@option options [String] :conditional_operator
This is a legacy parameter. Use `ConditionExpression` instead. For
more information, see [ConditionalOperator][1] in the *Amazon DynamoDB
Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html
@option options [String] :return_values
Use `ReturnValues` if you want to get the item attributes as they
appeared before they were deleted. For `DeleteItem`, the valid values
are:
* `NONE` - If `ReturnValues` is not specified, or if its value is
`NONE`, then nothing is returned. (This setting is the default for
`ReturnValues`.)
* `ALL_OLD` - The content of the old item is returned.
<note markdown="1"> The `ReturnValues` parameter is used by several DynamoDB operations;
however, `DeleteItem` does not recognize any values other than `NONE`
or `ALL_OLD`.
</note>
@option options [String] :return_consumed_capacity
Determines the level of detail about provisioned throughput
consumption that is returned in the response:
* `INDEXES` - The response includes the aggregate `ConsumedCapacity`
for the operation, together with `ConsumedCapacity` for each table
and secondary index that was accessed.
Note that some operations, such as `GetItem` and `BatchGetItem`, do
not access any indexes at all. In these cases, specifying `INDEXES`
will only return `ConsumedCapacity` information for table(s).
* `TOTAL` - The response includes only the aggregate
`ConsumedCapacity` for the operation.
* `NONE` - No `ConsumedCapacity` details are included in the response.
@option options [String] :return_item_collection_metrics
Determines whether item collection metrics are returned. If set to
`SIZE`, the response includes statistics about item collections, if
any, that were modified during the operation are returned in the
response. If set to `NONE` (the default), no statistics are returned.
@option options [String] :condition_expression
A condition that must be satisfied in order for a conditional
`DeleteItem` to succeed.
An expression can contain any of the following:
* Functions: `attribute_exists | attribute_not_exists | attribute_type
| contains | begins_with | size`
These function names are case-sensitive.
* Comparison operators: `= | <> | < | > | <= | >= | BETWEEN | IN `
* Logical operators: `AND | OR | NOT`
For more information on condition expressions, see [Specifying
Conditions][1] in the *Amazon DynamoDB Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html
@option options [Hash<String,String>] :expression_attribute_names
One or more substitution tokens for attribute names in an expression.
The following are some use cases for using
`ExpressionAttributeNames`\:
* To access an attribute whose name conflicts with a DynamoDB reserved
word.
* To create a placeholder for repeating occurrences of an attribute
name in an expression.
* To prevent special characters in an attribute name from being
misinterpreted in an expression.
Use the **#** character in an expression to dereference an attribute
name. For example, consider the following attribute name:
* `Percentile`
^
The name of this attribute conflicts with a reserved word, so it
cannot be used directly in an expression. (For the complete list of
reserved words, see [Reserved Words][1] in the *Amazon DynamoDB
Developer Guide*). To work around this, you could specify the
following for `ExpressionAttributeNames`\:
* `\{"#P":"Percentile"\}`
^
You could then use this substitution in an expression, as in this
example:
* `#P = :val`
^
<note markdown="1"> Tokens that begin with the **\:** character are *expression attribute
values*, which are placeholders for the actual value at runtime.
</note>
For more information on expression attribute names, see [Accessing
Item Attributes][2] in the *Amazon DynamoDB Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ReservedWords.html
[2]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html
@option options [Hash<String,Types::AttributeValue>] :expression_attribute_values
One or more values that can be substituted in an expression.
Use the **\:** (colon) character in an expression to dereference an
attribute value. For example, suppose that you wanted to check whether
the value of the *ProductStatus* attribute was one of the following:
`Available | Backordered | Discontinued`
You would first need to specify `ExpressionAttributeValues` as
follows:
`\{ ":avail":\{"S":"Available"\}, ":back":\{"S":"Backordered"\},
":disc":\{"S":"Discontinued"\} \}`
You could then use these values in an expression, such as this:
`ProductStatus IN (:avail, :back, :disc)`
For more information on expression attribute values, see [Specifying
Conditions][1] in the *Amazon DynamoDB Developer Guide*.
[1]: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.SpecifyingConditions.html
@return [Types::DeleteItemOutput] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/table.rb#L641-L645 | train | Delete an item from the table | [
30522,
13366,
3972,
12870,
1035,
8875,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2795,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
8875,
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... |
rails/sprockets | lib/sprockets/dependencies.rb | Sprockets.Dependencies.add_dependency | def add_dependency(uri)
self.config = hash_reassoc(config, :dependencies) do |set|
set + Set.new([uri])
end
end | ruby | def add_dependency(uri)
self.config = hash_reassoc(config, :dependencies) do |set|
set + Set.new([uri])
end
end | [
"def",
"add_dependency",
"(",
"uri",
")",
"self",
".",
"config",
"=",
"hash_reassoc",
"(",
"config",
",",
":dependencies",
")",
"do",
"|",
"set",
"|",
"set",
"+",
"Set",
".",
"new",
"(",
"[",
"uri",
"]",
")",
"end",
"end"
] | Public: Add environmental dependency inheirted by all assets.
uri - String dependency URI
Returns nothing. | [
"Public",
":",
"Add",
"environmental",
"dependency",
"inheirted",
"by",
"all",
"assets",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/dependencies.rb#L48-L52 | train | Add a dependency to the current configuration | [
30522,
13366,
5587,
1035,
24394,
1006,
24471,
2072,
1007,
2969,
1012,
9530,
8873,
2290,
1027,
23325,
1035,
2128,
12054,
10085,
1006,
9530,
8873,
2290,
1010,
1024,
12530,
15266,
1007,
2079,
1064,
2275,
1064,
2275,
1009,
2275,
1012,
2047,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.ImageList.reject | def reject(&block)
current = get_current
ilist = self.class.new
a = @images.reject(&block)
a.each { |image| ilist << image }
ilist.set_current current
ilist
end | ruby | def reject(&block)
current = get_current
ilist = self.class.new
a = @images.reject(&block)
a.each { |image| ilist << image }
ilist.set_current current
ilist
end | [
"def",
"reject",
"(",
"&",
"block",
")",
"current",
"=",
"get_current",
"ilist",
"=",
"self",
".",
"class",
".",
"new",
"a",
"=",
"@images",
".",
"reject",
"(",
"block",
")",
"a",
".",
"each",
"{",
"|",
"image",
"|",
"ilist",
"<<",
"image",
"}",
... | override Enumerable's reject | [
"override",
"Enumerable",
"s",
"reject"
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L1669-L1676 | train | rejects all images that match the block. | [
30522,
13366,
15454,
1006,
1004,
3796,
1007,
2783,
1027,
2131,
1035,
2783,
6335,
2923,
1027,
2969,
1012,
2465,
1012,
2047,
1037,
1027,
1030,
4871,
1012,
15454,
1006,
1004,
3796,
1007,
1037,
1012,
2169,
1063,
1064,
3746,
1064,
6335,
2923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby2d/ruby2d | lib/ruby2d/window.rb | Ruby2D.Window.controller_callback | def controller_callback(which, type, axis, value, button)
# All controller events
@events[:controller].each do |id, e|
e.call(ControllerEvent.new(which, type, axis, value, button))
end
case type
# When controller axis motion, like analog sticks
when :axis
@events[:controller_axis].each do |id, e|
e.call(ControllerAxisEvent.new(which, axis, value))
end
# When controller button is pressed
when :button_down
@events[:controller_button_down].each do |id, e|
e.call(ControllerButtonEvent.new(which, button))
end
# When controller button is released
when :button_up
@events[:controller_button_up].each do |id, e|
e.call(ControllerButtonEvent.new(which, button))
end
end
end | ruby | def controller_callback(which, type, axis, value, button)
# All controller events
@events[:controller].each do |id, e|
e.call(ControllerEvent.new(which, type, axis, value, button))
end
case type
# When controller axis motion, like analog sticks
when :axis
@events[:controller_axis].each do |id, e|
e.call(ControllerAxisEvent.new(which, axis, value))
end
# When controller button is pressed
when :button_down
@events[:controller_button_down].each do |id, e|
e.call(ControllerButtonEvent.new(which, button))
end
# When controller button is released
when :button_up
@events[:controller_button_up].each do |id, e|
e.call(ControllerButtonEvent.new(which, button))
end
end
end | [
"def",
"controller_callback",
"(",
"which",
",",
"type",
",",
"axis",
",",
"value",
",",
"button",
")",
"# All controller events",
"@events",
"[",
":controller",
"]",
".",
"each",
"do",
"|",
"id",
",",
"e",
"|",
"e",
".",
"call",
"(",
"ControllerEvent",
... | Controller callback method, called by the native and web extentions | [
"Controller",
"callback",
"method",
"called",
"by",
"the",
"native",
"and",
"web",
"extentions"
] | 43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4 | https://github.com/ruby2d/ruby2d/blob/43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4/lib/ruby2d/window.rb#L341-L364 | train | This method is called by the controller event handler. | [
30522,
13366,
11486,
1035,
2655,
5963,
1006,
2029,
1010,
30524,
1012,
2169,
2079,
1064,
8909,
1010,
1041,
1064,
1041,
1012,
2655,
1006,
11486,
18697,
3372,
1012,
2047,
1006,
2029,
1010,
2828,
1010,
8123,
1010,
3643,
1010,
6462,
1007,
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... |
Anthony-Gaudino/jekyll-multiple-languages-plugin | lib/jekyll-multiple-languages-plugin.rb | Jekyll.LocalizeLink.render | def render(context)
if "#{context[@key]}" != "" # Check for page variable
key = "#{context[@key]}"
else
key = @key
end
key = Liquid::Template.parse(key).render(context) # Parses and renders some Liquid syntax on arguments (allows expansions)
site = context.registers[:site] # Jekyll site object
key = key.split
namespace = key[0]
lang = key[1] || site.config[ 'lang']
default_lang = site.config['default_lang']
baseurl = site.baseurl
pages = site.pages
url = "";
if default_lang != lang
baseurl = baseurl + "/" + lang
end
for p in pages
unless p['namespace'].nil?
page_namespace = p['namespace']
if namespace == page_namespace
permalink = p['permalink_'+lang] || p['permalink']
url = baseurl + permalink
end
end
end
url
end | ruby | def render(context)
if "#{context[@key]}" != "" # Check for page variable
key = "#{context[@key]}"
else
key = @key
end
key = Liquid::Template.parse(key).render(context) # Parses and renders some Liquid syntax on arguments (allows expansions)
site = context.registers[:site] # Jekyll site object
key = key.split
namespace = key[0]
lang = key[1] || site.config[ 'lang']
default_lang = site.config['default_lang']
baseurl = site.baseurl
pages = site.pages
url = "";
if default_lang != lang
baseurl = baseurl + "/" + lang
end
for p in pages
unless p['namespace'].nil?
page_namespace = p['namespace']
if namespace == page_namespace
permalink = p['permalink_'+lang] || p['permalink']
url = baseurl + permalink
end
end
end
url
end | [
"def",
"render",
"(",
"context",
")",
"if",
"\"#{context[@key]}\"",
"!=",
"\"\"",
"# Check for page variable",
"key",
"=",
"\"#{context[@key]}\"",
"else",
"key",
"=",
"@key",
"end",
"key",
"=",
"Liquid",
"::",
"Template",
".",
"parse",
"(",
"key",
")",
".",
... | ======================================
initialize
======================================
======================================
render
====================================== | [
"======================================",
"initialize",
"======================================",
"======================================",
"render",
"======================================"
] | 85e0e7972e6a4f94d5e7ab470ff0360905e11e4a | https://github.com/Anthony-Gaudino/jekyll-multiple-languages-plugin/blob/85e0e7972e6a4f94d5e7ab470ff0360905e11e4a/lib/jekyll-multiple-languages-plugin.rb#L425-L460 | train | Renders the template | [
30522,
13366,
17552,
1006,
6123,
1007,
2065,
1000,
1001,
1063,
6123,
1031,
1030,
3145,
1033,
1065,
1000,
999,
1027,
1000,
1000,
1001,
4638,
2005,
3931,
8023,
3145,
1027,
1000,
1001,
1063,
6123,
1031,
1030,
3145,
1033,
1065,
1000,
2842,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Shopify/liquid | lib/liquid/standardfilters.rb | Liquid.StandardFilters.replace | def replace(input, string, replacement = ''.freeze)
input.to_s.gsub(string.to_s, replacement.to_s)
end | ruby | def replace(input, string, replacement = ''.freeze)
input.to_s.gsub(string.to_s, replacement.to_s)
end | [
"def",
"replace",
"(",
"input",
",",
"string",
",",
"replacement",
"=",
"''",
".",
"freeze",
")",
"input",
".",
"to_s",
".",
"gsub",
"(",
"string",
".",
"to_s",
",",
"replacement",
".",
"to_s",
")",
"end"
] | Replace occurrences of a string with another | [
"Replace",
"occurrences",
"of",
"a",
"string",
"with",
"another"
] | b3b63a683f6daaea7e70f1602ee829abdf970ef3 | https://github.com/Shopify/liquid/blob/b3b63a683f6daaea7e70f1602ee829abdf970ef3/lib/liquid/standardfilters.rb#L253-L255 | train | Replace the string with the replacement | [
30522,
13366,
5672,
1006,
7953,
1010,
5164,
1010,
6110,
1027,
1005,
1005,
1012,
13184,
1007,
7953,
1012,
2000,
1035,
1055,
1012,
28177,
12083,
1006,
5164,
1012,
2000,
1035,
1055,
1010,
6110,
1012,
2000,
1035,
1055,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Katello/katello | app/models/katello/repository.rb | Katello.Repository.build_clone | def build_clone(options)
to_env = options[:environment]
version = options[:version]
content_view = options[:content_view] || to_env.default_content_view
to_version = version || content_view.version(to_env)
fail _("Cannot clone into the Default Content View") if content_view.default?
if to_env && version
fail "Cannot clone into both an environment and a content view version archive"
end
if to_version.nil?
fail _("View %{view} has not been promoted to %{env}") %
{:view => content_view.name, :env => to_env.name}
end
if to_env && self.clones.in_content_views([content_view]).in_environment(to_env).any?
fail _("Repository has already been cloned to %{cv_name} in environment %{to_env}") %
{:to_env => to_env, :cv_name => content_view.name}
end
if self.yum?
if self.library_instance?
checksum_type = root.checksum_type || pulp_scratchpad_checksum_type
else
checksum_type = self.saved_checksum_type
end
end
clone = Repository.new(:environment => to_env,
:library_instance => self.library_instance || self,
:root => self.root,
:content_view_version => to_version,
:saved_checksum_type => checksum_type)
clone.relative_path = clone.docker? ? clone.generate_docker_repo_path : clone.generate_repo_path
clone
end | ruby | def build_clone(options)
to_env = options[:environment]
version = options[:version]
content_view = options[:content_view] || to_env.default_content_view
to_version = version || content_view.version(to_env)
fail _("Cannot clone into the Default Content View") if content_view.default?
if to_env && version
fail "Cannot clone into both an environment and a content view version archive"
end
if to_version.nil?
fail _("View %{view} has not been promoted to %{env}") %
{:view => content_view.name, :env => to_env.name}
end
if to_env && self.clones.in_content_views([content_view]).in_environment(to_env).any?
fail _("Repository has already been cloned to %{cv_name} in environment %{to_env}") %
{:to_env => to_env, :cv_name => content_view.name}
end
if self.yum?
if self.library_instance?
checksum_type = root.checksum_type || pulp_scratchpad_checksum_type
else
checksum_type = self.saved_checksum_type
end
end
clone = Repository.new(:environment => to_env,
:library_instance => self.library_instance || self,
:root => self.root,
:content_view_version => to_version,
:saved_checksum_type => checksum_type)
clone.relative_path = clone.docker? ? clone.generate_docker_repo_path : clone.generate_repo_path
clone
end | [
"def",
"build_clone",
"(",
"options",
")",
"to_env",
"=",
"options",
"[",
":environment",
"]",
"version",
"=",
"options",
"[",
":version",
"]",
"content_view",
"=",
"options",
"[",
":content_view",
"]",
"||",
"to_env",
".",
"default_content_view",
"to_version",
... | TODO: break up method | [
"TODO",
":",
"break",
"up",
"method"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/repository.rb#L392-L429 | train | Creates a new repository object | [
30522,
13366,
3857,
1035,
17598,
1006,
7047,
1007,
2000,
1035,
4372,
2615,
1027,
7047,
1031,
1024,
4044,
1033,
2544,
1027,
7047,
1031,
1024,
2544,
1033,
4180,
1035,
3193,
1027,
7047,
1031,
1024,
4180,
1035,
3193,
1033,
1064,
1064,
2000,
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_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/registries.rb | Azure::ContainerRegistry::Mgmt::V2017_06_01_preview.Registries.list_credentials | def list_credentials(resource_group_name, registry_name, custom_headers:nil)
response = list_credentials_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_credentials(resource_group_name, registry_name, custom_headers:nil)
response = list_credentials_async(resource_group_name, registry_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_credentials",
"(",
"resource_group_name",
",",
"registry_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_credentials_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!"... | Lists the login credentials for the specified container registry.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RegistryListCredentialsResult] operation results. | [
"Lists",
"the",
"login",
"credentials",
"for",
"the",
"specified",
"container",
"registry",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-06-01-preview/generated/azure_mgmt_container_registry/registries.rb#L546-L549 | train | Gets the credentials for the specified container registry. | [
30522,
13366,
2862,
1035,
22496,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
22496,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.