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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
envato/double_entry | lib/active_record/locking_extensions.rb | ActiveRecord.LockingExtensions.with_restart_on_deadlock | def with_restart_on_deadlock
yield
rescue ActiveRecord::StatementInvalid => exception
if exception.message =~ /deadlock/i || exception.message =~ /database is locked/i
ActiveSupport::Notifications.publish('deadlock_restart.double_entry', :exception => exception)
raise ActiveRecord::RestartTransaction
else
raise
end
end | ruby | def with_restart_on_deadlock
yield
rescue ActiveRecord::StatementInvalid => exception
if exception.message =~ /deadlock/i || exception.message =~ /database is locked/i
ActiveSupport::Notifications.publish('deadlock_restart.double_entry', :exception => exception)
raise ActiveRecord::RestartTransaction
else
raise
end
end | [
"def",
"with_restart_on_deadlock",
"yield",
"rescue",
"ActiveRecord",
"::",
"StatementInvalid",
"=>",
"exception",
"if",
"exception",
".",
"message",
"=~",
"/",
"/i",
"||",
"exception",
".",
"message",
"=~",
"/",
"/i",
"ActiveSupport",
"::",
"Notifications",
".",
... | Execute the given block, and retry the current restartable transaction if a
MySQL deadlock occurs. | [
"Execute",
"the",
"given",
"block",
"and",
"retry",
"the",
"current",
"restartable",
"transaction",
"if",
"a",
"MySQL",
"deadlock",
"occurs",
"."
] | 2bc7ce1810a5b443d8bcdda44444569425d98c44 | https://github.com/envato/double_entry/blob/2bc7ce1810a5b443d8bcdda44444569425d98c44/lib/active_record/locking_extensions.rb#L17-L27 | train | This method is called by the block when the block is restarted on a deadlock. | [
30522,
13366,
2007,
1035,
23818,
1035,
2006,
1035,
2757,
7878,
10750,
5343,
3161,
2890,
27108,
2094,
1024,
1024,
4861,
2378,
10175,
3593,
1027,
1028,
6453,
2065,
6453,
1012,
4471,
1027,
1066,
1013,
2757,
7878,
1013,
1045,
1064,
1064,
6453,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
uken/fluent-plugin-elasticsearch | lib/fluent/plugin/out_elasticsearch.rb | Fluent::Plugin.ElasticsearchOutput.append_record_to_messages | def append_record_to_messages(op, meta, header, record, msgs)
case op
when UPDATE_OP, UPSERT_OP
if meta.has_key?(ID_FIELD)
header[UPDATE_OP] = meta
msgs << @dump_proc.call(header) << BODY_DELIMITER
msgs << @dump_proc.call(update_body(record, op)) << BODY_DELIMITER
return true
end
when CREATE_OP
if meta.has_key?(ID_FIELD)
header[CREATE_OP] = meta
msgs << @dump_proc.call(header) << BODY_DELIMITER
msgs << @dump_proc.call(record) << BODY_DELIMITER
return true
end
when INDEX_OP
header[INDEX_OP] = meta
msgs << @dump_proc.call(header) << BODY_DELIMITER
msgs << @dump_proc.call(record) << BODY_DELIMITER
return true
end
return false
end | ruby | def append_record_to_messages(op, meta, header, record, msgs)
case op
when UPDATE_OP, UPSERT_OP
if meta.has_key?(ID_FIELD)
header[UPDATE_OP] = meta
msgs << @dump_proc.call(header) << BODY_DELIMITER
msgs << @dump_proc.call(update_body(record, op)) << BODY_DELIMITER
return true
end
when CREATE_OP
if meta.has_key?(ID_FIELD)
header[CREATE_OP] = meta
msgs << @dump_proc.call(header) << BODY_DELIMITER
msgs << @dump_proc.call(record) << BODY_DELIMITER
return true
end
when INDEX_OP
header[INDEX_OP] = meta
msgs << @dump_proc.call(header) << BODY_DELIMITER
msgs << @dump_proc.call(record) << BODY_DELIMITER
return true
end
return false
end | [
"def",
"append_record_to_messages",
"(",
"op",
",",
"meta",
",",
"header",
",",
"record",
",",
"msgs",
")",
"case",
"op",
"when",
"UPDATE_OP",
",",
"UPSERT_OP",
"if",
"meta",
".",
"has_key?",
"(",
"ID_FIELD",
")",
"header",
"[",
"UPDATE_OP",
"]",
"=",
"m... | append_record_to_messages adds a record to the bulk message
payload to be submitted to Elasticsearch. Records that do
not include '_id' field are skipped when 'write_operation'
is configured for 'create' or 'update'
returns 'true' if record was appended to the bulk message
and 'false' otherwise | [
"append_record_to_messages",
"adds",
"a",
"record",
"to",
"the",
"bulk",
"message",
"payload",
"to",
"be",
"submitted",
"to",
"Elasticsearch",
".",
"Records",
"that",
"do",
"not",
"include",
"_id",
"field",
"are",
"skipped",
"when",
"write_operation",
"is",
"con... | 9f9e51ddd012acb36c7f9d7a16e00970004098bc | https://github.com/uken/fluent-plugin-elasticsearch/blob/9f9e51ddd012acb36c7f9d7a16e00970004098bc/lib/fluent/plugin/out_elasticsearch.rb#L492-L515 | train | Append the record to the messages | [
30522,
13366,
10439,
10497,
1035,
2501,
1035,
2000,
1035,
7696,
1006,
6728,
1010,
18804,
1010,
20346,
1010,
2501,
1010,
5796,
5620,
1007,
2553,
6728,
2043,
10651,
1035,
6728,
1010,
11139,
8743,
1035,
6728,
2065,
18804,
1012,
2038,
1035,
314... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/restorable_dropped_databases.rb | Azure::SQL::Mgmt::V2014_04_01.RestorableDroppedDatabases.get_with_http_info | def get_with_http_info(resource_group_name, server_name, restorable_droppeded_database_id, custom_headers:nil)
get_async(resource_group_name, server_name, restorable_droppeded_database_id, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, server_name, restorable_droppeded_database_id, custom_headers:nil)
get_async(resource_group_name, server_name, restorable_droppeded_database_id, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"restorable_droppeded_database_id",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"restorable_droppeded_database_id",
",",
"custom_h... | Gets a deleted database that can be restored
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param restorable_droppeded_database_id [String] The id of the deleted
database in the form of databaseName,deletionTimeInFileTimeFormat
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"a",
"deleted",
"database",
"that",
"can",
"be",
"restored"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/restorable_dropped_databases.rb#L60-L62 | train | Gets the specified database s metadata. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
2717,
30524,
1035,
7809,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/app/helpers/decidim/decidim_form_helper.rb | Decidim.DecidimFormHelper.areas_for_select | def areas_for_select(organization)
return organization.areas if organization.area_types.blank?
return organization.areas if organization.area_types.all? { |at| at.area_ids.empty? }
organization.area_types
end | ruby | def areas_for_select(organization)
return organization.areas if organization.area_types.blank?
return organization.areas if organization.area_types.all? { |at| at.area_ids.empty? }
organization.area_types
end | [
"def",
"areas_for_select",
"(",
"organization",
")",
"return",
"organization",
".",
"areas",
"if",
"organization",
".",
"area_types",
".",
"blank?",
"return",
"organization",
".",
"areas",
"if",
"organization",
".",
"area_types",
".",
"all?",
"{",
"|",
"at",
"... | Handle which collection to pass to Decidim::FilterFormBuilder.areas_select | [
"Handle",
"which",
"collection",
"to",
"pass",
"to",
"Decidim",
"::",
"FilterFormBuilder",
".",
"areas_select"
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/decidim_form_helper.rb#L198-L203 | train | Returns the areas for the given organization | [
30522,
13366,
2752,
1035,
2005,
1035,
7276,
1006,
3029,
1007,
2709,
3029,
1012,
2752,
2065,
3029,
1012,
2181,
1035,
4127,
1012,
8744,
1029,
2709,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | app/services/hyrax/user_stat_importer.rb | Hyrax.UserStatImporter.sorted_users | def sorted_users
users = []
::User.find_each do |user|
users.push(UserRecord.new(user.id, user.user_key, date_since_last_cache(user)))
end
users.sort_by(&:last_stats_update)
end | ruby | def sorted_users
users = []
::User.find_each do |user|
users.push(UserRecord.new(user.id, user.user_key, date_since_last_cache(user)))
end
users.sort_by(&:last_stats_update)
end | [
"def",
"sorted_users",
"users",
"=",
"[",
"]",
"::",
"User",
".",
"find_each",
"do",
"|",
"user",
"|",
"users",
".",
"push",
"(",
"UserRecord",
".",
"new",
"(",
"user",
".",
"id",
",",
"user",
".",
"user_key",
",",
"date_since_last_cache",
"(",
"user",... | Returns an array of users sorted by the date of their last stats update. Users that have not been recently updated
will be at the top of the array. | [
"Returns",
"an",
"array",
"of",
"users",
"sorted",
"by",
"the",
"date",
"of",
"their",
"last",
"stats",
"update",
".",
"Users",
"that",
"have",
"not",
"been",
"recently",
"updated",
"will",
"be",
"at",
"the",
"top",
"of",
"the",
"array",
"."
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/services/hyrax/user_stat_importer.rb#L39-L45 | train | Returns an array of users that have been cached | [
30522,
13366,
19616,
1035,
5198,
5198,
1027,
1031,
1033,
1024,
1024,
5310,
1012,
2424,
1035,
2169,
2079,
1064,
5310,
1064,
5198,
1012,
5245,
1006,
5310,
2890,
27108,
2094,
1012,
2047,
1006,
5310,
1012,
8909,
1010,
5310,
1012,
5310,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.resume_application_upgrade | def resume_application_upgrade(application_id, resume_application_upgrade_description, timeout:60, custom_headers:nil)
response = resume_application_upgrade_async(application_id, resume_application_upgrade_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def resume_application_upgrade(application_id, resume_application_upgrade_description, timeout:60, custom_headers:nil)
response = resume_application_upgrade_async(application_id, resume_application_upgrade_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"resume_application_upgrade",
"(",
"application_id",
",",
"resume_application_upgrade_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"resume_application_upgrade_async",
"(",
"application_id",
",",
"resume_application... | Resumes upgrading an application in the Service Fabric cluster.
Resumes an unmonitored manual Service Fabric application upgrade. Service
Fabric upgrades one upgrade domain at a time. For unmonitored manual
upgrades, after Service Fabric finishes an upgrade domain, it waits for you
to call this API before proceeding to the next upgrade domain.
@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 resume_application_upgrade_description
[ResumeApplicationUpgradeDescription] Describes the parameters for resuming
an application upgrade.
@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. | [
"Resumes",
"upgrading",
"an",
"application",
"in",
"the",
"Service",
"Fabric",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L8123-L8126 | train | Resumes an application upgrade. | [
30522,
13366,
13746,
1035,
4646,
1035,
12200,
1006,
4646,
1035,
8909,
1010,
13746,
1035,
4646,
1035,
12200,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
13746,
1035,
4646,
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/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.create_or_update_worker_pool | def create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
response = create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:nil)
response = create_or_update_worker_pool_async(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update_worker_pool",
"(",
"resource_group_name",
",",
"name",
",",
"worker_pool_name",
",",
"worker_pool_envelope",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_worker_pool_async",
"(",
"resource_group_name",
",",
"name",
",... | Create or update a worker pool.
Create or update a worker pool.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param worker_pool_name [String] Name of the worker pool.
@param worker_pool_envelope [WorkerPoolResource] Properties of the worker
pool.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [WorkerPoolResource] operation results. | [
"Create",
"or",
"update",
"a",
"worker",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L3259-L3262 | train | Creates or updates a worker pool. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
7309,
1035,
4770,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7309,
1035,
4770,
1035,
2171,
1010,
7309,
1035,
4770,
1035,
11255,
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... |
Shopify/liquid | lib/liquid/standardfilters.rb | Liquid.StandardFilters.replace_first | def replace_first(input, string, replacement = ''.freeze)
input.to_s.sub(string.to_s, replacement.to_s)
end | ruby | def replace_first(input, string, replacement = ''.freeze)
input.to_s.sub(string.to_s, replacement.to_s)
end | [
"def",
"replace_first",
"(",
"input",
",",
"string",
",",
"replacement",
"=",
"''",
".",
"freeze",
")",
"input",
".",
"to_s",
".",
"sub",
"(",
"string",
".",
"to_s",
",",
"replacement",
".",
"to_s",
")",
"end"
] | Replace the first occurrences of a string with another | [
"Replace",
"the",
"first",
"occurrences",
"of",
"a",
"string",
"with",
"another"
] | b3b63a683f6daaea7e70f1602ee829abdf970ef3 | https://github.com/Shopify/liquid/blob/b3b63a683f6daaea7e70f1602ee829abdf970ef3/lib/liquid/standardfilters.rb#L258-L260 | train | Replace first string with replacement | [
30522,
13366,
5672,
1035,
2034,
1006,
7953,
1010,
5164,
1010,
6110,
1027,
1005,
1005,
1012,
13184,
1007,
7953,
1012,
2000,
1035,
1055,
1012,
4942,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_definitions.rb | Azure::Authorization::Mgmt::V2015_07_01.RoleDefinitions.create_or_update | def create_or_update(scope, role_definition_id, role_definition, custom_headers:nil)
response = create_or_update_async(scope, role_definition_id, role_definition, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(scope, role_definition_id, role_definition, custom_headers:nil)
response = create_or_update_async(scope, role_definition_id, role_definition, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"scope",
",",
"role_definition_id",
",",
"role_definition",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"scope",
",",
"role_definition_id",
",",
"role_definition",
",",
"custom_headers",
":cus... | Creates or updates a role definition.
@param scope [String] The scope of the role definition.
@param role_definition_id [String] The ID of the role definition.
@param role_definition [RoleDefinition] The values for the role definition.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RoleDefinition] operation results. | [
"Creates",
"or",
"updates",
"a",
"role",
"definition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_definitions.rb#L223-L226 | train | Creates or updates a role definition. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
9531,
1010,
2535,
1035,
6210,
1035,
8909,
1010,
2535,
1035,
6210,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2030,
1035,
10651,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/api/inventory_api.rb | SquareConnect.InventoryApi.batch_retrieve_inventory_changes | def batch_retrieve_inventory_changes(body, opts = {})
data, _status_code, _headers = batch_retrieve_inventory_changes_with_http_info(body, opts)
return data
end | ruby | def batch_retrieve_inventory_changes(body, opts = {})
data, _status_code, _headers = batch_retrieve_inventory_changes_with_http_info(body, opts)
return data
end | [
"def",
"batch_retrieve_inventory_changes",
"(",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"batch_retrieve_inventory_changes_with_http_info",
"(",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | BatchRetrieveInventoryChanges
Returns historical physical counts and adjustments based on the provided filter criteria. Results are paginated and sorted in ascending order according their `occurred_at` timestamp (oldest first). BatchRetrieveInventoryChanges is a catch-all query endpoint for queries that cannot be handled by other, simpler endpoints.
@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 [BatchRetrieveInventoryChangesResponse] | [
"BatchRetrieveInventoryChanges",
"Returns",
"historical",
"physical",
"counts",
"and",
"adjustments",
"based",
"on",
"the",
"provided",
"filter",
"criteria",
".",
"Results",
"are",
"paginated",
"and",
"sorted",
"in",
"ascending",
"order",
"according",
"their",
"occurr... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/inventory_api.rb#L80-L83 | train | Retrieve inventory changes | [
30522,
13366,
14108,
1035,
12850,
1035,
12612,
1035,
3431,
1006,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
30524,
2951,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_containers.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationProtectionContainers.list_by_replication_fabrics_next | def list_by_replication_fabrics_next(next_page_link, custom_headers:nil)
response = list_by_replication_fabrics_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_replication_fabrics_next(next_page_link, custom_headers:nil)
response = list_by_replication_fabrics_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_replication_fabrics_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_replication_fabrics_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body... | Gets the list of protection container for a fabric.
Lists the protection containers in the specified fabric.
@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 [ProtectionContainerCollection] operation results. | [
"Gets",
"the",
"list",
"of",
"protection",
"container",
"for",
"a",
"fabric",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_protection_containers.rb#L956-L959 | train | Gets the list of fabrics in a service instance. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
25123,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
21647,
1035,
25123,
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... |
decidim/decidim | decidim-core/app/helpers/decidim/traceability_helper.rb | Decidim.TraceabilityHelper.diff_renderer | def diff_renderer
@diff_renderer ||= if current_version.item_type.include? "Decidim::Proposals"
Decidim::Proposals::DiffRenderer.new(current_version)
elsif current_version.item_type.include? "Decidim::Accountability"
Decidim::Accountability::DiffRenderer.new(current_version)
end
end | ruby | def diff_renderer
@diff_renderer ||= if current_version.item_type.include? "Decidim::Proposals"
Decidim::Proposals::DiffRenderer.new(current_version)
elsif current_version.item_type.include? "Decidim::Accountability"
Decidim::Accountability::DiffRenderer.new(current_version)
end
end | [
"def",
"diff_renderer",
"@diff_renderer",
"||=",
"if",
"current_version",
".",
"item_type",
".",
"include?",
"\"Decidim::Proposals\"",
"Decidim",
"::",
"Proposals",
"::",
"DiffRenderer",
".",
"new",
"(",
"current_version",
")",
"elsif",
"current_version",
".",
"item_t... | Caches a DiffRenderer instance for the `current_version`. | [
"Caches",
"a",
"DiffRenderer",
"instance",
"for",
"the",
"current_version",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/traceability_helper.rb#L33-L39 | train | Returns the diff renderer for the current version of the item. | [
30522,
13366,
4487,
4246,
1035,
17552,
2121,
1030,
4487,
4246,
1035,
17552,
2121,
1064,
1064,
1027,
2065,
2783,
1035,
2544,
1012,
8875,
1035,
2828,
1012,
2421,
1029,
1000,
11703,
28173,
2213,
1024,
1024,
10340,
1000,
11703,
28173,
2213,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/lib/decidim/form_builder.rb | Decidim.FormBuilder.datetime_field | def datetime_field(attribute, options = {})
value = object.send(attribute)
data = { datepicker: "", timepicker: "" }
data[:startdate] = I18n.localize(value, format: :decidim_short) if value.present? && value.is_a?(ActiveSupport::TimeWithZone)
datepicker_format = ruby_format_to_datepicker(I18n.t("time.formats.decidim_short"))
data[:"date-format"] = datepicker_format
template = text_field(
attribute,
options.merge(data: data)
)
help_text = I18n.t("decidim.datepicker.help_text", datepicker_format: datepicker_format)
template += error_and_help_text(attribute, options.merge(help_text: help_text))
template.html_safe
end | ruby | def datetime_field(attribute, options = {})
value = object.send(attribute)
data = { datepicker: "", timepicker: "" }
data[:startdate] = I18n.localize(value, format: :decidim_short) if value.present? && value.is_a?(ActiveSupport::TimeWithZone)
datepicker_format = ruby_format_to_datepicker(I18n.t("time.formats.decidim_short"))
data[:"date-format"] = datepicker_format
template = text_field(
attribute,
options.merge(data: data)
)
help_text = I18n.t("decidim.datepicker.help_text", datepicker_format: datepicker_format)
template += error_and_help_text(attribute, options.merge(help_text: help_text))
template.html_safe
end | [
"def",
"datetime_field",
"(",
"attribute",
",",
"options",
"=",
"{",
"}",
")",
"value",
"=",
"object",
".",
"send",
"(",
"attribute",
")",
"data",
"=",
"{",
"datepicker",
":",
"\"\"",
",",
"timepicker",
":",
"\"\"",
"}",
"data",
"[",
":startdate",
"]",... | Public: Generates a timepicker field using foundation
datepicker library | [
"Public",
":",
"Generates",
"a",
"timepicker",
"field",
"using",
"foundation",
"datepicker",
"library"
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/form_builder.rb#L329-L343 | train | Returns a text field for the given attribute. | [
30522,
13366,
3058,
7292,
1035,
2492,
1006,
17961,
1010,
7047,
1027,
1063,
1065,
1007,
3643,
1027,
4874,
1012,
4604,
1006,
17961,
1007,
2951,
1027,
1063,
3058,
24330,
5484,
1024,
1000,
1000,
1010,
2051,
24330,
5484,
1024,
1000,
1000,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_resources_management/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/management_group_subscriptions.rb | Azure::ResourcesManagement::Mgmt::V2018_03_01_preview.ManagementGroupSubscriptions.delete_with_http_info | def delete_with_http_info(group_id, subscription_id, cache_control:'no-cache', custom_headers:nil)
delete_async(group_id, subscription_id, cache_control:cache_control, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(group_id, subscription_id, cache_control:'no-cache', custom_headers:nil)
delete_async(group_id, subscription_id, cache_control:cache_control, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"group_id",
",",
"subscription_id",
",",
"cache_control",
":",
"'no-cache'",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"group_id",
",",
"subscription_id",
",",
"cache_control",
":cache_control",
",",
"custom_head... | De-associates subscription from the management group.
@param group_id [String] Management Group ID.
@param subscription_id [String] Subscription ID.
@param cache_control [String] Indicates that the request shouldn't utilize
any caches.
@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. | [
"De",
"-",
"associates",
"subscription",
"from",
"the",
"management",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources_management/lib/2018-03-01-preview/generated/azure_mgmt_resources_management/management_group_subscriptions.rb#L142-L144 | train | Deletes the specified resource group. | [
30522,
13366,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2177,
1035,
8909,
1010,
30524,
1006,
2177,
1035,
8909,
1010,
15002,
1035,
8909,
1010,
17053,
1035,
2491,
1024,
17053,
1035,
2491,
1010,
7661,
1035,
20346,
2015,
1024,
766... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heroku/legacy-cli | lib/heroku/command/addons.rb | Heroku::Command.Addons.services | def services
if current_command == "addons:list"
deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:services` instead.")
end
display_table(get_services, %w[name human_name state], %w[Slug Name State])
display "\nSee plans with `heroku addons:plans SERVICE`"
end | ruby | def services
if current_command == "addons:list"
deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:services` instead.")
end
display_table(get_services, %w[name human_name state], %w[Slug Name State])
display "\nSee plans with `heroku addons:plans SERVICE`"
end | [
"def",
"services",
"if",
"current_command",
"==",
"\"addons:list\"",
"deprecate",
"(",
"\"`heroku #{current_command}` has been deprecated. Please use `heroku addons:services` instead.\"",
")",
"end",
"display_table",
"(",
"get_services",
",",
"%w[",
"name",
"human_name",
"state",... | addons:services
list all available add-on services | [
"addons",
":",
"services"
] | 6f18521a258394bfb79e6b36f7160ad8559a8e16 | https://github.com/heroku/legacy-cli/blob/6f18521a258394bfb79e6b36f7160ad8559a8e16/lib/heroku/command/addons.rb#L57-L64 | train | Get the services | [
30522,
13366,
2578,
2065,
2783,
1035,
3094,
1027,
1027,
1000,
5587,
5644,
1024,
2862,
1000,
2139,
28139,
16280,
1006,
1000,
1036,
5394,
5283,
1001,
1063,
2783,
1035,
3094,
1065,
1036,
2038,
2042,
2139,
28139,
12921,
1012,
3531,
2224,
1036,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
zendesk/ruby-kafka | lib/kafka/consumer.rb | Kafka.Consumer.resume | def resume(topic, partition)
pause_for(topic, partition).resume!
# During re-balancing we might have lost the paused partition. Check if partition is still in group before seek.
seek_to_next(topic, partition) if @group.assigned_to?(topic, partition)
end | ruby | def resume(topic, partition)
pause_for(topic, partition).resume!
# During re-balancing we might have lost the paused partition. Check if partition is still in group before seek.
seek_to_next(topic, partition) if @group.assigned_to?(topic, partition)
end | [
"def",
"resume",
"(",
"topic",
",",
"partition",
")",
"pause_for",
"(",
"topic",
",",
"partition",
")",
".",
"resume!",
"# During re-balancing we might have lost the paused partition. Check if partition is still in group before seek.",
"seek_to_next",
"(",
"topic",
",",
"part... | Resume processing of a topic partition.
@see #pause
@param topic [String]
@param partition [Integer]
@return [nil] | [
"Resume",
"processing",
"of",
"a",
"topic",
"partition",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/consumer.rb#L159-L164 | train | Resume a partition | [
30522,
13366,
13746,
1006,
8476,
1010,
13571,
1007,
8724,
1035,
2005,
1006,
8476,
1010,
13571,
1007,
1012,
13746,
999,
1001,
2076,
2128,
1011,
20120,
2057,
2453,
2031,
2439,
1996,
5864,
13571,
1012,
4638,
2065,
13571,
2003,
2145,
1999,
2177... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_schemas.rb | Azure::SQL::Mgmt::V2018_06_01_preview.DatabaseSchemas.list_by_database_with_http_info | def list_by_database_with_http_info(resource_group_name, server_name, database_name, filter:nil, custom_headers:nil)
list_by_database_async(resource_group_name, server_name, database_name, filter:filter, custom_headers:custom_headers).value!
end | ruby | def list_by_database_with_http_info(resource_group_name, server_name, database_name, filter:nil, custom_headers:nil)
list_by_database_async(resource_group_name, server_name, database_name, filter:filter, custom_headers:custom_headers).value!
end | [
"def",
"list_by_database_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_by_database_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_na... | List database schemas
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param database_name [String] The name of the database.
@param filter [String] An OData filter expression that filters elements in
the collection.
@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",
"database",
"schemas"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2018-06-01-preview/generated/azure_mgmt_sql/database_schemas.rb#L62-L64 | train | Gets the list of documents in a database. | [
30522,
13366,
2862,
1035,
2011,
1035,
7809,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/app/controllers/decidim/application_controller.rb | Decidim.ApplicationController.store_current_location | def store_current_location
return if (devise_controller? && params[:redirect_url].blank?) || !request.format.html?
value = params[:redirect_url] || request.url
store_location_for(:user, value)
end | ruby | def store_current_location
return if (devise_controller? && params[:redirect_url].blank?) || !request.format.html?
value = params[:redirect_url] || request.url
store_location_for(:user, value)
end | [
"def",
"store_current_location",
"return",
"if",
"(",
"devise_controller?",
"&&",
"params",
"[",
":redirect_url",
"]",
".",
"blank?",
")",
"||",
"!",
"request",
".",
"format",
".",
"html?",
"value",
"=",
"params",
"[",
":redirect_url",
"]",
"||",
"request",
... | Stores the url where the user will be redirected after login.
Uses the `redirect_url` param or the current url if there's no param.
In Devise controllers we only store the URL if it's from the params, we don't
want to overwrite the stored URL for a Devise one. | [
"Stores",
"the",
"url",
"where",
"the",
"user",
"will",
"be",
"redirected",
"after",
"login",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/controllers/decidim/application_controller.rb#L48-L53 | train | Stores the current location of the current page. | [
30522,
13366,
3573,
1035,
2783,
1035,
3295,
2709,
2065,
1006,
14386,
3366,
1035,
11486,
1029,
1004,
1004,
11498,
5244,
1031,
1024,
2417,
7442,
6593,
1035,
24471,
2140,
1033,
1012,
8744,
1029,
1007,
1064,
1064,
999,
5227,
1012,
4289,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb | Azure::Network::Mgmt::V2019_02_01.ApplicationGateways.backend_health | def backend_health(resource_group_name, application_gateway_name, expand:nil, custom_headers:nil)
response = backend_health_async(resource_group_name, application_gateway_name, expand:expand, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def backend_health(resource_group_name, application_gateway_name, expand:nil, custom_headers:nil)
response = backend_health_async(resource_group_name, application_gateway_name, expand:expand, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"backend_health",
"(",
"resource_group_name",
",",
"application_gateway_name",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"backend_health_async",
"(",
"resource_group_name",
",",
"application_gateway_name",
",",
"expand",
... | Gets the backend health of the specified application gateway in a resource
group.
@param resource_group_name [String] The name of the resource group.
@param application_gateway_name [String] The name of the application gateway.
@param expand [String] Expands BackendAddressPool and BackendHttpSettings
referenced in backend health.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ApplicationGatewayBackendHealth] operation results. | [
"Gets",
"the",
"backend",
"health",
"of",
"the",
"specified",
"application",
"gateway",
"in",
"a",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb#L507-L510 | train | Gets the health of the specified application gateway. | [
30522,
13366,
2067,
10497,
1035,
2740,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4646,
1035,
11909,
1035,
2171,
1010,
7818,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2067,
10497,
1035,
2740,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | actionpack/lib/action_dispatch/http/response.rb | ActionDispatch.Response.charset= | def charset=(charset)
content_type = parsed_content_type_header.mime_type
if false == charset
set_content_type content_type, nil
else
set_content_type content_type, charset || self.class.default_charset
end
end | ruby | def charset=(charset)
content_type = parsed_content_type_header.mime_type
if false == charset
set_content_type content_type, nil
else
set_content_type content_type, charset || self.class.default_charset
end
end | [
"def",
"charset",
"=",
"(",
"charset",
")",
"content_type",
"=",
"parsed_content_type_header",
".",
"mime_type",
"if",
"false",
"==",
"charset",
"set_content_type",
"content_type",
",",
"nil",
"else",
"set_content_type",
"content_type",
",",
"charset",
"||",
"self",... | Sets the HTTP character set. In case of +nil+ parameter
it sets the charset to +default_charset+.
response.charset = 'utf-16' # => 'utf-16'
response.charset = nil # => 'utf-8' | [
"Sets",
"the",
"HTTP",
"character",
"set",
".",
"In",
"case",
"of",
"+",
"nil",
"+",
"parameter",
"it",
"sets",
"the",
"charset",
"to",
"+",
"default_charset",
"+",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_dispatch/http/response.rb#L262-L269 | train | Set the charset of the object. | [
30522,
13366,
25869,
13462,
1027,
1006,
25869,
13462,
1007,
4180,
1035,
2828,
1027,
11968,
6924,
1035,
4180,
1035,
2828,
1035,
20346,
1012,
2771,
4168,
1035,
2828,
2065,
6270,
1027,
1027,
25869,
13462,
2275,
1035,
4180,
1035,
2828,
4180,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/sprockets | lib/sprockets/source_map_utils.rb | Sprockets.SourceMapUtils.vlq_decode_mappings | def vlq_decode_mappings(str)
mappings = []
str.split(';').each_with_index do |group, index|
mappings[index] = []
group.split(',').each do |segment|
mappings[index] << vlq_decode(segment)
end
end
mappings
end | ruby | def vlq_decode_mappings(str)
mappings = []
str.split(';').each_with_index do |group, index|
mappings[index] = []
group.split(',').each do |segment|
mappings[index] << vlq_decode(segment)
end
end
mappings
end | [
"def",
"vlq_decode_mappings",
"(",
"str",
")",
"mappings",
"=",
"[",
"]",
"str",
".",
"split",
"(",
"';'",
")",
".",
"each_with_index",
"do",
"|",
"group",
",",
"index",
"|",
"mappings",
"[",
"index",
"]",
"=",
"[",
"]",
"group",
".",
"split",
"(",
... | Public: Decode a VLQ string into mapping numbers.
str - VLQ encoded String
Returns an two dimensional Array of Integers. | [
"Public",
":",
"Decode",
"a",
"VLQ",
"string",
"into",
"mapping",
"numbers",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/source_map_utils.rb#L468-L479 | train | Decode the mappings in the string | [
30522,
13366,
1058,
2140,
4160,
1035,
21933,
3207,
1035,
12375,
2015,
1006,
2358,
2099,
1007,
12375,
2015,
1027,
1031,
1033,
2358,
2099,
1012,
3975,
1006,
1005,
1025,
1005,
1007,
1012,
2169,
1035,
2007,
1035,
5950,
2079,
1064,
2177,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2017-12-01/generated/azure_mgmt_compute/virtual_machine_scale_set_vms.rb | Azure::Compute::Mgmt::V2017_12_01.VirtualMachineScaleSetVMs.get_instance_view_with_http_info | def get_instance_view_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end | ruby | def get_instance_view_with_http_info(resource_group_name, vm_scale_set_name, instance_id, custom_headers:nil)
get_instance_view_async(resource_group_name, vm_scale_set_name, instance_id, custom_headers:custom_headers).value!
end | [
"def",
"get_instance_view_with_http_info",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"instance_id",
",",
"custom_headers",
":",
"nil",
")",
"get_instance_view_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"instance_id",
",",
"custom_hea... | Gets the status of a virtual machine from a VM scale set.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param instance_id [String] The instance ID of the virtual machine.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"status",
"of",
"a",
"virtual",
"machine",
"from",
"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#L378-L380 | train | Gets the details of the virtual machine in a VM scale set. | [
30522,
13366,
2131,
1035,
6013,
1035,
3193,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
6013,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/box_collection.rb | Vagrant.BoxCollection.with_temp_dir | def with_temp_dir(dir=nil)
dir ||= Dir.mktmpdir(TEMP_PREFIX, @temp_root)
dir = Pathname.new(dir)
yield dir
ensure
FileUtils.rm_rf(dir.to_s)
end | ruby | def with_temp_dir(dir=nil)
dir ||= Dir.mktmpdir(TEMP_PREFIX, @temp_root)
dir = Pathname.new(dir)
yield dir
ensure
FileUtils.rm_rf(dir.to_s)
end | [
"def",
"with_temp_dir",
"(",
"dir",
"=",
"nil",
")",
"dir",
"||=",
"Dir",
".",
"mktmpdir",
"(",
"TEMP_PREFIX",
",",
"@temp_root",
")",
"dir",
"=",
"Pathname",
".",
"new",
"(",
"dir",
")",
"yield",
"dir",
"ensure",
"FileUtils",
".",
"rm_rf",
"(",
"dir",... | This is a helper that makes sure that our temporary directories
are cleaned up no matter what.
@param [String] dir Path to a temporary directory
@return [Object] The result of whatever the yield is | [
"This",
"is",
"a",
"helper",
"that",
"makes",
"sure",
"that",
"our",
"temporary",
"directories",
"are",
"cleaned",
"up",
"no",
"matter",
"what",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/box_collection.rb#L466-L473 | train | Creates a new instance of the FileGenerator with a temp directory. | [
30522,
13366,
2007,
1035,
8915,
8737,
1035,
16101,
1006,
16101,
1027,
9152,
2140,
1007,
16101,
1064,
1064,
1027,
16101,
1012,
12395,
21246,
17299,
4313,
1006,
8915,
8737,
1035,
17576,
1010,
1030,
8915,
8737,
1035,
7117,
1007,
16101,
1027,
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... |
appsignal/rdkafka-ruby | lib/rdkafka/consumer.rb | Rdkafka.Consumer.assign | def assign(list)
unless list.is_a?(TopicPartitionList)
raise TypeError.new("list has to be a TopicPartitionList")
end
tpl = list.to_native_tpl
response = Rdkafka::Bindings.rd_kafka_assign(@native_kafka, tpl)
if response != 0
raise Rdkafka::RdkafkaError.new(response, "Error assigning '#{list.to_h}'")
end
end | ruby | def assign(list)
unless list.is_a?(TopicPartitionList)
raise TypeError.new("list has to be a TopicPartitionList")
end
tpl = list.to_native_tpl
response = Rdkafka::Bindings.rd_kafka_assign(@native_kafka, tpl)
if response != 0
raise Rdkafka::RdkafkaError.new(response, "Error assigning '#{list.to_h}'")
end
end | [
"def",
"assign",
"(",
"list",
")",
"unless",
"list",
".",
"is_a?",
"(",
"TopicPartitionList",
")",
"raise",
"TypeError",
".",
"new",
"(",
"\"list has to be a TopicPartitionList\"",
")",
"end",
"tpl",
"=",
"list",
".",
"to_native_tpl",
"response",
"=",
"Rdkafka",... | Atomic assignment of partitions to consume
@param list [TopicPartitionList] The topic with partitions to assign
@raise [RdkafkaError] When assigning fails | [
"Atomic",
"assignment",
"of",
"partitions",
"to",
"consume"
] | 87b3e0ddae5ea576847cb67228fcea06ec2a24d6 | https://github.com/appsignal/rdkafka-ruby/blob/87b3e0ddae5ea576847cb67228fcea06ec2a24d6/lib/rdkafka/consumer.rb#L124-L133 | train | Assign a list of TopicPartition objects to this Kafka topic. | [
30522,
13366,
23911,
1006,
2862,
1007,
4983,
2862,
1012,
2003,
1035,
1037,
1029,
1006,
8476,
19362,
3775,
3508,
9863,
1007,
5333,
2828,
2121,
29165,
1012,
2047,
1006,
1000,
2862,
2038,
2000,
2022,
1037,
8476,
19362,
3775,
3508,
9863,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-s3/lib/aws-sdk-s3/object_summary.rb | Aws::S3.ObjectSummary.copy_from | def copy_from(options = {})
options = options.merge(
bucket: @bucket_name,
key: @key
)
resp = @client.copy_object(options)
resp.data
end | ruby | def copy_from(options = {})
options = options.merge(
bucket: @bucket_name,
key: @key
)
resp = @client.copy_object(options)
resp.data
end | [
"def",
"copy_from",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"bucket",
":",
"@bucket_name",
",",
"key",
":",
"@key",
")",
"resp",
"=",
"@client",
".",
"copy_object",
"(",
"options",
")",
"resp",
".",
"data",
"... | @!group Actions
@example Request syntax with placeholder values
object_summary.copy_from({
acl: "private", # accepts private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control
cache_control: "CacheControl",
content_disposition: "ContentDisposition",
content_encoding: "ContentEncoding",
content_language: "ContentLanguage",
content_type: "ContentType",
copy_source: "CopySource", # required
copy_source_if_match: "CopySourceIfMatch",
copy_source_if_modified_since: Time.now,
copy_source_if_none_match: "CopySourceIfNoneMatch",
copy_source_if_unmodified_since: Time.now,
expires: Time.now,
grant_full_control: "GrantFullControl",
grant_read: "GrantRead",
grant_read_acp: "GrantReadACP",
grant_write_acp: "GrantWriteACP",
metadata: {
"MetadataKey" => "MetadataValue",
},
metadata_directive: "COPY", # accepts COPY, REPLACE
tagging_directive: "COPY", # accepts COPY, REPLACE
server_side_encryption: "AES256", # accepts AES256, aws:kms
storage_class: "STANDARD", # accepts STANDARD, REDUCED_REDUNDANCY, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER, DEEP_ARCHIVE
website_redirect_location: "WebsiteRedirectLocation",
sse_customer_algorithm: "SSECustomerAlgorithm",
sse_customer_key: "SSECustomerKey",
sse_customer_key_md5: "SSECustomerKeyMD5",
ssekms_key_id: "SSEKMSKeyId",
copy_source_sse_customer_algorithm: "CopySourceSSECustomerAlgorithm",
copy_source_sse_customer_key: "CopySourceSSECustomerKey",
copy_source_sse_customer_key_md5: "CopySourceSSECustomerKeyMD5",
request_payer: "requester", # accepts requester
tagging: "TaggingHeader",
object_lock_mode: "GOVERNANCE", # accepts GOVERNANCE, COMPLIANCE
object_lock_retain_until_date: Time.now,
object_lock_legal_hold_status: "ON", # accepts ON, OFF
})
@param [Hash] options ({})
@option options [String] :acl
The canned ACL to apply to the object.
@option options [String] :cache_control
Specifies caching behavior along the request/reply chain.
@option options [String] :content_disposition
Specifies presentational information for the object.
@option options [String] :content_encoding
Specifies what content encodings have been applied to the object and
thus what decoding mechanisms must be applied to obtain the media-type
referenced by the Content-Type header field.
@option options [String] :content_language
The language the content is in.
@option options [String] :content_type
A standard MIME type describing the format of the object data.
@option options [required, String] :copy_source
The name of the source bucket and key name of the source object,
separated by a slash (/). Must be URL-encoded.
@option options [String] :copy_source_if_match
Copies the object if its entity tag (ETag) matches the specified tag.
@option options [Time,DateTime,Date,Integer,String] :copy_source_if_modified_since
Copies the object if it has been modified since the specified time.
@option options [String] :copy_source_if_none_match
Copies the object if its entity tag (ETag) is different than the
specified ETag.
@option options [Time,DateTime,Date,Integer,String] :copy_source_if_unmodified_since
Copies the object if it hasn't been modified since the specified
time.
@option options [Time,DateTime,Date,Integer,String] :expires
The date and time at which the object is no longer cacheable.
@option options [String] :grant_full_control
Gives the grantee READ, READ\_ACP, and WRITE\_ACP permissions on the
object.
@option options [String] :grant_read
Allows grantee to read the object data and its metadata.
@option options [String] :grant_read_acp
Allows grantee to read the object ACL.
@option options [String] :grant_write_acp
Allows grantee to write the ACL for the applicable object.
@option options [Hash<String,String>] :metadata
A map of metadata to store with the object in S3.
@option options [String] :metadata_directive
Specifies whether the metadata is copied from the source object or
replaced with metadata provided in the request.
@option options [String] :tagging_directive
Specifies whether the object tag-set are copied from the source object
or replaced with tag-set provided in the request.
@option options [String] :server_side_encryption
The Server-side encryption algorithm used when storing this object in
S3 (e.g., AES256, aws:kms).
@option options [String] :storage_class
The type of storage to use for the object. Defaults to 'STANDARD'.
@option options [String] :website_redirect_location
If the bucket is configured as a website, redirects requests for this
object to another object in the same bucket or to an external URL.
Amazon S3 stores the value of this header in the object metadata.
@option options [String] :sse_customer_algorithm
Specifies the algorithm to use to when encrypting the object (e.g.,
AES256).
@option options [String] :sse_customer_key
Specifies the customer-provided encryption key for Amazon S3 to use in
encrypting data. This value is used to store the object and then it is
discarded; Amazon does not store the encryption key. The key must be
appropriate for use with the algorithm specified in the
x-amz-server-side-encryption-customer-algorithm header.
@option options [String] :sse_customer_key_md5
Specifies the 128-bit MD5 digest of the encryption key according to
RFC 1321. Amazon S3 uses this header for a message integrity check to
ensure the encryption key was transmitted without error.
@option options [String] :ssekms_key_id
Specifies the AWS KMS key ID to use for object encryption. All GET and
PUT requests for an object protected by AWS KMS will fail if not made
via SSL or using SigV4. Documentation on configuring any of the
officially supported AWS SDKs and CLI can be found at
http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version
@option options [String] :copy_source_sse_customer_algorithm
Specifies the algorithm to use when decrypting the source object
(e.g., AES256).
@option options [String] :copy_source_sse_customer_key
Specifies the customer-provided encryption key for Amazon S3 to use to
decrypt the source object. The encryption key provided in this header
must be one that was used when the source object was created.
@option options [String] :copy_source_sse_customer_key_md5
Specifies the 128-bit MD5 digest of the encryption key according to
RFC 1321. Amazon S3 uses this header for a message integrity check to
ensure the encryption key was transmitted without error.
@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 [String] :tagging
The tag-set for the object destination object this value must be used
in conjunction with the TaggingDirective. The tag-set must be encoded
as URL Query parameters
@option options [String] :object_lock_mode
The Object Lock mode that you want to apply to the copied object.
@option options [Time,DateTime,Date,Integer,String] :object_lock_retain_until_date
The date and time when you want the copied object's Object Lock to
expire.
@option options [String] :object_lock_legal_hold_status
Specifies whether you want to apply a Legal Hold to the copied object.
@return [Types::CopyObjectOutput] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-s3/lib/aws-sdk-s3/object_summary.rb#L394-L401 | train | Copy the object from the bucket to the key. | [
30522,
13366,
6100,
1035,
2013,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
13610,
1024,
1030,
13610,
1035,
2171,
1010,
3145,
1024,
1030,
3145,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
6100,
1035,
4874,
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_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.delete_images | def delete_images(project_id, image_ids, custom_headers:nil)
response = delete_images_async(project_id, image_ids, custom_headers:custom_headers).value!
nil
end | ruby | def delete_images(project_id, image_ids, custom_headers:nil)
response = delete_images_async(project_id, image_ids, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete_images",
"(",
"project_id",
",",
"image_ids",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_images_async",
"(",
"project_id",
",",
"image_ids",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Delete images from the set of training images.
@param project_id The project id.
@param image_ids Ids of the images to be deleted. Limited to 256 images per
batch.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"images",
"from",
"the",
"set",
"of",
"training",
"images",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb#L1491-L1494 | train | Deletes the images in the specified project. | [
30522,
13366,
3972,
12870,
1035,
4871,
1006,
2622,
1035,
8909,
1010,
3746,
1035,
8909,
2015,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
4871,
1035,
2004,
6038,
2278,
1006,
2622,
1035,
8909,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_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.begin_failover_commit | def begin_failover_commit(recovery_plan_name, custom_headers:nil)
response = begin_failover_commit_async(recovery_plan_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_failover_commit(recovery_plan_name, custom_headers:nil)
response = begin_failover_commit_async(recovery_plan_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_failover_commit",
"(",
"recovery_plan_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_failover_commit_async",
"(",
"recovery_plan_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",... | Execute commit failover of the recovery plan.
The operation to commit the fail over of 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",
"commit",
"failover",
"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#L910-L913 | train | Executes failover commit on the specified recovery plan. | [
30522,
13366,
4088,
1035,
8246,
7840,
30524,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
8246,
7840,
1035,
10797,
1035,
2004,
6038,
2278,
1006,
7233,
1035,
2933,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
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... |
castwide/solargraph | lib/solargraph/library.rb | Solargraph.Library.catalog | def catalog
@catalog_mutex.synchronize do
break if synchronized?
logger.info "Cataloging #{workspace.directory.empty? ? 'generic workspace' : workspace.directory}"
api_map.catalog bundle
@synchronized = true
logger.info "Catalog complete (#{api_map.pins.length} pins)"
end
end | ruby | def catalog
@catalog_mutex.synchronize do
break if synchronized?
logger.info "Cataloging #{workspace.directory.empty? ? 'generic workspace' : workspace.directory}"
api_map.catalog bundle
@synchronized = true
logger.info "Catalog complete (#{api_map.pins.length} pins)"
end
end | [
"def",
"catalog",
"@catalog_mutex",
".",
"synchronize",
"do",
"break",
"if",
"synchronized?",
"logger",
".",
"info",
"\"Cataloging #{workspace.directory.empty? ? 'generic workspace' : workspace.directory}\"",
"api_map",
".",
"catalog",
"bundle",
"@synchronized",
"=",
"true",
... | Update the ApiMap from the library's workspace and open files.
@return [void] | [
"Update",
"the",
"ApiMap",
"from",
"the",
"library",
"s",
"workspace",
"and",
"open",
"files",
"."
] | 47badb5d151aca775ccbe6c470236089eae7839d | https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/library.rb#L343-L351 | train | Catalog the current workspace | [
30522,
13366,
12105,
1030,
12105,
1035,
20101,
2595,
1012,
26351,
8093,
10698,
4371,
2079,
3338,
2065,
25549,
1029,
8833,
4590,
1012,
18558,
1000,
12105,
2075,
1001,
1063,
2573,
15327,
1012,
14176,
1012,
4064,
1029,
1029,
1005,
12391,
2573,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | lib/linguist/generated.rb | Linguist.Generated.compiled_coffeescript? | def compiled_coffeescript?
return false unless extname == '.js'
# CoffeeScript generated by > 1.2 include a comment on the first line
if lines[0] =~ /^\/\/ Generated by /
return true
end
if lines[0] == '(function() {' && # First line is module closure opening
lines[-2] == '}).call(this);' && # Second to last line closes module closure
lines[-1] == '' # Last line is blank
score = 0
lines.each do |line|
if line =~ /var /
# Underscored temp vars are likely to be Coffee
score += 1 * line.gsub(/(_fn|_i|_len|_ref|_results)/).count
# bind and extend functions are very Coffee specific
score += 3 * line.gsub(/(__bind|__extends|__hasProp|__indexOf|__slice)/).count
end
end
# Require a score of 3. This is fairly arbitrary. Consider
# tweaking later.
score >= 3
else
false
end
end | ruby | def compiled_coffeescript?
return false unless extname == '.js'
# CoffeeScript generated by > 1.2 include a comment on the first line
if lines[0] =~ /^\/\/ Generated by /
return true
end
if lines[0] == '(function() {' && # First line is module closure opening
lines[-2] == '}).call(this);' && # Second to last line closes module closure
lines[-1] == '' # Last line is blank
score = 0
lines.each do |line|
if line =~ /var /
# Underscored temp vars are likely to be Coffee
score += 1 * line.gsub(/(_fn|_i|_len|_ref|_results)/).count
# bind and extend functions are very Coffee specific
score += 3 * line.gsub(/(__bind|__extends|__hasProp|__indexOf|__slice)/).count
end
end
# Require a score of 3. This is fairly arbitrary. Consider
# tweaking later.
score >= 3
else
false
end
end | [
"def",
"compiled_coffeescript?",
"return",
"false",
"unless",
"extname",
"==",
"'.js'",
"# CoffeeScript generated by > 1.2 include a comment on the first line",
"if",
"lines",
"[",
"0",
"]",
"=~",
"/",
"\\/",
"\\/",
"/",
"return",
"true",
"end",
"if",
"lines",
"[",
... | Internal: Is the blob of JS generated by CoffeeScript?
CoffeeScript is meant to output JS that would be difficult to
tell if it was generated or not. Look for a number of patterns
output by the CS compiler.
Return true or false | [
"Internal",
":",
"Is",
"the",
"blob",
"of",
"JS",
"generated",
"by",
"CoffeeScript?"
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/generated.rb#L173-L203 | train | Returns true if the file is a CoffeeScript file. | [
30522,
13366,
9227,
1035,
4157,
22483,
1029,
2709,
6270,
4983,
4654,
2102,
18442,
1027,
1027,
1005,
1012,
1046,
2015,
1005,
1001,
4157,
22483,
7013,
2011,
1028,
1015,
1012,
1016,
2421,
1037,
7615,
2006,
1996,
2034,
2240,
2065,
3210,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | spaceship/lib/spaceship/tunes/tunes_client.rb | Spaceship.TunesClient.upload_geojson | def upload_geojson(app_version, upload_file)
raise "app_version is required" unless app_version
raise "upload_file is required" unless upload_file
du_client.upload_geojson(app_version, upload_file, content_provider_id, sso_token_for_image)
end | ruby | def upload_geojson(app_version, upload_file)
raise "app_version is required" unless app_version
raise "upload_file is required" unless upload_file
du_client.upload_geojson(app_version, upload_file, content_provider_id, sso_token_for_image)
end | [
"def",
"upload_geojson",
"(",
"app_version",
",",
"upload_file",
")",
"raise",
"\"app_version is required\"",
"unless",
"app_version",
"raise",
"\"upload_file is required\"",
"unless",
"upload_file",
"du_client",
".",
"upload_geojson",
"(",
"app_version",
",",
"upload_file"... | Uploads the transit app file
@param app_version (AppVersion): The version of your app
@param upload_file (UploadFile): The image to upload
@return [JSON] the response | [
"Uploads",
"the",
"transit",
"app",
"file"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/tunes/tunes_client.rb#L845-L850 | train | Upload a GeoJSON file to the server. | [
30522,
13366,
2039,
11066,
1035,
20248,
22578,
2239,
1006,
10439,
1035,
2544,
1010,
2039,
11066,
1035,
5371,
1007,
5333,
1000,
10439,
1035,
2544,
2003,
3223,
1000,
4983,
10439,
1035,
2544,
5333,
1000,
2039,
11066,
1035,
5371,
2003,
3223,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb | Azure::StorageSync::Mgmt::V2018_07_01.CloudEndpoints.begin_pre_backup_with_http_info | def begin_pre_backup_with_http_info(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:nil)
begin_pre_backup_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_pre_backup_with_http_info(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:nil)
begin_pre_backup_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_pre_backup_with_http_info",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"sync_group_name",
",",
"cloud_endpoint_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_pre_backup_async",
"(",
"resource_group_name",
",",
... | Pre Backup a given CloudEndpoint.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param storage_sync_service_name [String] Name of Storage Sync Service
resource.
@param sync_group_name [String] Name of Sync Group resource.
@param cloud_endpoint_name [String] Name of Cloud Endpoint object.
@param parameters [BackupRequest] Body of Backup request.
@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. | [
"Pre",
"Backup",
"a",
"given",
"CloudEndpoint",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb#L897-L899 | train | Creates a new backup of the specified cloud endpoint. | [
30522,
13366,
4088,
1035,
3653,
1035,
10200,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5527,
1035,
26351,
1035,
2326,
1035,
2171,
1010,
26351,
1035,
2177,
1035,
2171,
1010,
6112,
1035,
2203,
8400,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb | Azure::SQL::Mgmt::V2017_03_01_preview.JobExecutions.begin_create_or_update | def begin_create_or_update(resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create_or_update(resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers:nil)
response = begin_create_or_update_async(resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create_or_update",
"(",
"resource_group_name",
",",
"server_name",
",",
"job_agent_name",
",",
"job_name",
",",
"job_execution_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"s... | Creates or updates a job execution.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param job_agent_name [String] The name of the job agent.
@param job_name [String] The name of the job to get.
@param job_execution_id The job execution id to create the job execution
under.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [JobExecution] operation results. | [
"Creates",
"or",
"updates",
"a",
"job",
"execution",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb#L742-L745 | train | Creates or updates a job execution. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
3105,
1035,
4005,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
3105,
1035,
7781,
1035,
8909,
1010,
7661,
1035,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb | Azure::Web::Mgmt::V2016_03_01.WebSiteManagementClient.list_geo_regions_next | def list_geo_regions_next(next_page_link, custom_headers:nil)
response = list_geo_regions_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_geo_regions_next(next_page_link, custom_headers:nil)
response = list_geo_regions_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_geo_regions_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_geo_regions_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"resp... | Get a list of available geographical regions.
Get a list of available geographical regions.
@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 [GeoRegionCollection] operation results. | [
"Get",
"a",
"list",
"of",
"available",
"geographical",
"regions",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb#L1750-L1753 | train | Gets the list of geo regions. | [
30522,
13366,
2862,
1035,
20248,
1035,
4655,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
20248,
1035,
4655,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stream_analytics/lib/2016-03-01/generated/azure_mgmt_stream_analytics/transformations.rb | Azure::StreamAnalytics::Mgmt::V2016_03_01.Transformations.create_or_replace_with_http_info | def create_or_replace_with_http_info(transformation, resource_group_name, job_name, transformation_name, if_match:nil, if_none_match:nil, custom_headers:nil)
create_or_replace_async(transformation, resource_group_name, job_name, transformation_name, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
end | ruby | def create_or_replace_with_http_info(transformation, resource_group_name, job_name, transformation_name, if_match:nil, if_none_match:nil, custom_headers:nil)
create_or_replace_async(transformation, resource_group_name, job_name, transformation_name, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
end | [
"def",
"create_or_replace_with_http_info",
"(",
"transformation",
",",
"resource_group_name",
",",
"job_name",
",",
"transformation_name",
",",
"if_match",
":",
"nil",
",",
"if_none_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"create_or_replace_async",
... | Creates a transformation or replaces an already existing transformation under
an existing streaming job.
@param transformation [Transformation] The definition of the transformation
that will be used to create a new transformation or replace the existing one
under the streaming job.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param job_name [String] The name of the streaming job.
@param transformation_name [String] The name of the transformation.
@param if_match [String] The ETag of the transformation. Omit this value to
always overwrite the current transformation. Specify the last-seen ETag value
to prevent accidentally overwritting concurrent changes.
@param if_none_match [String] Set to '*' to allow a new transformation to be
created, but to prevent updating an existing transformation. Other values
will result in a 412 Pre-condition Failed response.
@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",
"transformation",
"or",
"replaces",
"an",
"already",
"existing",
"transformation",
"under",
"an",
"existing",
"streaming",
"job",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stream_analytics/lib/2016-03-01/generated/azure_mgmt_stream_analytics/transformations.rb#L75-L77 | train | Creates or replaces a transformation in the specified resource group. | [
30522,
13366,
3443,
1035,
2030,
1035,
5672,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
8651,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
8651,
1035,
2171,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
2065,
1035,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vault-ruby | lib/vault/persistent.rb | Vault.PersistentHTTP.pipeline | def pipeline uri, requests, &block # :yields: responses
connection_for uri do |connection|
connection.http.pipeline requests, &block
end
end | ruby | def pipeline uri, requests, &block # :yields: responses
connection_for uri do |connection|
connection.http.pipeline requests, &block
end
end | [
"def",
"pipeline",
"uri",
",",
"requests",
",",
"&",
"block",
"# :yields: responses",
"connection_for",
"uri",
"do",
"|",
"connection",
"|",
"connection",
".",
"http",
".",
"pipeline",
"requests",
",",
"block",
"end",
"end"
] | Pipelines +requests+ to the HTTP server at +uri+ yielding responses if a
block is given. Returns all responses recieved.
See
Net::HTTP::Pipeline[http://docs.seattlerb.org/net-http-pipeline/Net/HTTP/Pipeline.html]
for further details.
Only if <tt>net-http-pipeline</tt> was required before
<tt>net-http-persistent</tt> #pipeline will be present. | [
"Pipelines",
"+",
"requests",
"+",
"to",
"the",
"HTTP",
"server",
"at",
"+",
"uri",
"+",
"yielding",
"responses",
"if",
"a",
"block",
"is",
"given",
".",
"Returns",
"all",
"responses",
"recieved",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/persistent.rb#L762-L766 | train | Pipeline requests to a URI | [
30522,
13366,
13117,
24471,
2072,
1010,
11186,
1010,
1004,
3796,
1001,
1024,
16189,
1024,
10960,
4434,
1035,
2005,
24471,
2072,
2079,
1064,
4434,
1064,
4434,
1012,
8299,
1012,
13117,
11186,
1010,
1004,
3796,
2203,
2203,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
petergoldstein/dalli | lib/dalli/cas/client.rb | Dalli.Client.replace_cas | def replace_cas(key, value, cas, ttl=nil, options=nil)
ttl ||= @options[:expires_in].to_i
perform(:replace, key, value, ttl, cas, options)
end | ruby | def replace_cas(key, value, cas, ttl=nil, options=nil)
ttl ||= @options[:expires_in].to_i
perform(:replace, key, value, ttl, cas, options)
end | [
"def",
"replace_cas",
"(",
"key",
",",
"value",
",",
"cas",
",",
"ttl",
"=",
"nil",
",",
"options",
"=",
"nil",
")",
"ttl",
"||=",
"@options",
"[",
":expires_in",
"]",
".",
"to_i",
"perform",
"(",
":replace",
",",
"key",
",",
"value",
",",
"ttl",
"... | Conditionally add a key/value pair, verifying existing CAS, only if the
key already exists on the server. Returns the new CAS value if the
operation succeeded, or falsy otherwise. | [
"Conditionally",
"add",
"a",
"key",
"/",
"value",
"pair",
"verifying",
"existing",
"CAS",
"only",
"if",
"the",
"key",
"already",
"exists",
"on",
"the",
"server",
".",
"Returns",
"the",
"new",
"CAS",
"value",
"if",
"the",
"operation",
"succeeded",
"or",
"fa... | 5755dbfd06e333a8239f976d4b10492b4555b726 | https://github.com/petergoldstein/dalli/blob/5755dbfd06e333a8239f976d4b10492b4555b726/lib/dalli/cas/client.rb#L47-L50 | train | Replace the CAS value with the given CAS value. | [
30522,
13366,
5672,
1035,
25222,
1006,
3145,
1010,
3643,
1010,
25222,
1010,
23746,
2140,
1027,
9152,
2140,
1010,
7047,
1027,
9152,
2140,
1007,
23746,
2140,
1064,
1064,
1027,
1030,
7047,
1031,
1024,
4654,
20781,
2015,
1035,
1999,
1033,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb | Azure::CognitiveServices::Face::V1_0.LargePersonGroupPerson.add_face_from_url | def add_face_from_url(large_person_group_id, person_id, url, user_data:nil, target_face:nil, custom_headers:nil)
response = add_face_from_url_async(large_person_group_id, person_id, url, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def add_face_from_url(large_person_group_id, person_id, url, user_data:nil, target_face:nil, custom_headers:nil)
response = add_face_from_url_async(large_person_group_id, person_id, url, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"add_face_from_url",
"(",
"large_person_group_id",
",",
"person_id",
",",
"url",
",",
"user_data",
":",
"nil",
",",
"target_face",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"add_face_from_url_async",
"(",
"large_person_group_id",
... | Add a representative face to a person for identification. The input face is
specified as an image with a targetFace rectangle.
@param large_person_group_id [String] Id referencing a particular large
person group.
@param person_id Id referencing a particular person.
@param url [String] Publicly reachable URL of an image
@param user_data [String] User-specified data about the face for any purpose.
The maximum length is 1KB.
@param target_face [Array<Integer>] A face rectangle to specify the target
face to be added to a person in the format of
"targetFace=left,top,width,height". E.g. "targetFace=10,10,100,100". If there
is more than one face in the image, targetFace is required to specify which
face to add. No targetFace means there is only one face detected in the
entire image.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PersistedFace] operation results. | [
"Add",
"a",
"representative",
"face",
"to",
"a",
"person",
"for",
"identification",
".",
"The",
"input",
"face",
"is",
"specified",
"as",
"an",
"image",
"with",
"a",
"targetFace",
"rectangle",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb#L889-L892 | train | Adds a face to a person. | [
30522,
13366,
5587,
1035,
2227,
1035,
2013,
1035,
24471,
2140,
1006,
2312,
1035,
2711,
1035,
2177,
1035,
8909,
1010,
2711,
1035,
8909,
1010,
24471,
2140,
1010,
5310,
1035,
2951,
1024,
9152,
2140,
1010,
4539,
1035,
2227,
1024,
9152,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/server_endpoints.rb | Azure::StorageSync::Mgmt::V2018_07_01.ServerEndpoints.recall_action_async | def recall_action_async(resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters, custom_headers:nil)
# Send request
promise = begin_recall_action_async(resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters, 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 recall_action_async(resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters, custom_headers:nil)
# Send request
promise = begin_recall_action_async(resource_group_name, storage_sync_service_name, sync_group_name, server_endpoint_name, parameters, 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",
"recall_action_async",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"sync_group_name",
",",
"server_endpoint_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_recall_action_async",
"(",
... | @param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param storage_sync_service_name [String] Name of Storage Sync Service
resource.
@param sync_group_name [String] Name of Sync Group resource.
@param server_endpoint_name [String] Name of Server Endpoint object.
@param parameters [RecallActionParameters] Body of Recall Action object.
@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",
".",
"The",
"name",
"is",
"case",
"insensitive",
".",
"@param",
"storage_sync_service_name",
"[",
"String",
"]",
"Name",
"of",
"Storage",
"Sync",
"Service",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/server_endpoints.rb#L428-L442 | train | Recall an endpoint. | [
30522,
13366,
9131,
1035,
2895,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5527,
1035,
26351,
1035,
2326,
1035,
2171,
1010,
26351,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2203,
8400,
1035,
2171,
1010,
11709,
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... |
backup/backup | lib/backup/model.rb | Backup.Model.elapsed_time | def elapsed_time(start_time, finish_time)
duration = finish_time.to_i - start_time.to_i
hours = duration / 3600
remainder = duration - (hours * 3600)
minutes = remainder / 60
seconds = remainder - (minutes * 60)
sprintf "%02d:%02d:%02d", hours, minutes, seconds
end | ruby | def elapsed_time(start_time, finish_time)
duration = finish_time.to_i - start_time.to_i
hours = duration / 3600
remainder = duration - (hours * 3600)
minutes = remainder / 60
seconds = remainder - (minutes * 60)
sprintf "%02d:%02d:%02d", hours, minutes, seconds
end | [
"def",
"elapsed_time",
"(",
"start_time",
",",
"finish_time",
")",
"duration",
"=",
"finish_time",
".",
"to_i",
"-",
"start_time",
".",
"to_i",
"hours",
"=",
"duration",
"/",
"3600",
"remainder",
"=",
"duration",
"-",
"(",
"hours",
"*",
"3600",
")",
"minut... | Returns a string representing the elapsed time in HH:MM:SS. | [
"Returns",
"a",
"string",
"representing",
"the",
"elapsed",
"time",
"in",
"HH",
":",
"MM",
":",
"SS",
"."
] | 64370f925e859f858766b674717a3dbee0de7a26 | https://github.com/backup/backup/blob/64370f925e859f858766b674717a3dbee0de7a26/lib/backup/model.rb#L463-L470 | train | Returns the elapsed time between start_time and finish_time | [
30522,
13366,
3449,
9331,
6924,
1035,
2051,
1006,
2707,
1035,
2051,
1010,
3926,
1035,
2051,
1007,
9367,
1027,
3926,
1035,
2051,
1012,
2000,
1035,
1045,
1011,
2707,
1035,
2051,
1012,
2000,
1035,
1045,
2847,
1027,
9367,
1013,
9475,
2692,
68... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/racc | lib/racc/simulated_automaton.rb | Racc.SimulatedAutomaton.consume! | def consume!(token)
return self if @error
action = @state.action[token] || @state.defact
case action
when Shift
@sstack.push(@state)
@state = action.goto_state
shifted(token)
when Reduce
reduce_by!(action.rule)
consume!(token)
when Accept
done
when Error
@error = true
error
else
raise "Illegal action type: #{action.class}"
end
self
end | ruby | def consume!(token)
return self if @error
action = @state.action[token] || @state.defact
case action
when Shift
@sstack.push(@state)
@state = action.goto_state
shifted(token)
when Reduce
reduce_by!(action.rule)
consume!(token)
when Accept
done
when Error
@error = true
error
else
raise "Illegal action type: #{action.class}"
end
self
end | [
"def",
"consume!",
"(",
"token",
")",
"return",
"self",
"if",
"@error",
"action",
"=",
"@state",
".",
"action",
"[",
"token",
"]",
"||",
"@state",
".",
"defact",
"case",
"action",
"when",
"Shift",
"@sstack",
".",
"push",
"(",
"@state",
")",
"@state",
"... | consuming a terminal may set off a series of reduces before the terminal
is shifted | [
"consuming",
"a",
"terminal",
"may",
"set",
"off",
"a",
"series",
"of",
"reduces",
"before",
"the",
"terminal",
"is",
"shifted"
] | d3244edfa11dd6e86e43f570c6444d41c7e3552a | https://github.com/ruby/racc/blob/d3244edfa11dd6e86e43f570c6444d41c7e3552a/lib/racc/simulated_automaton.rb#L36-L58 | train | Consume a token from the current state. | [
30522,
13366,
16678,
999,
1006,
19204,
1007,
2709,
2969,
2065,
1030,
7561,
2895,
1027,
1030,
2110,
1012,
2895,
1031,
19204,
1033,
1064,
1064,
1030,
2110,
1012,
13366,
18908,
2553,
2895,
2043,
5670,
1030,
7020,
2696,
3600,
1012,
5245,
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.freeze | def freeze
self.normalized_scheme
self.normalized_user
self.normalized_password
self.normalized_userinfo
self.normalized_host
self.normalized_port
self.normalized_authority
self.normalized_site
self.normalized_path
self.normalized_query
self.normalized_fragment
self.hash
super
end | ruby | def freeze
self.normalized_scheme
self.normalized_user
self.normalized_password
self.normalized_userinfo
self.normalized_host
self.normalized_port
self.normalized_authority
self.normalized_site
self.normalized_path
self.normalized_query
self.normalized_fragment
self.hash
super
end | [
"def",
"freeze",
"self",
".",
"normalized_scheme",
"self",
".",
"normalized_user",
"self",
".",
"normalized_password",
"self",
".",
"normalized_userinfo",
"self",
".",
"normalized_host",
"self",
".",
"normalized_port",
"self",
".",
"normalized_authority",
"self",
".",... | Creates a new uri object from component parts.
@option [String, #to_str] scheme The scheme component.
@option [String, #to_str] user The user component.
@option [String, #to_str] password The password component.
@option [String, #to_str] userinfo
The userinfo component. If this is supplied, the user and password
components must be omitted.
@option [String, #to_str] host The host component.
@option [String, #to_str] port The port component.
@option [String, #to_str] authority
The authority component. If this is supplied, the user, password,
userinfo, host, and port components must be omitted.
@option [String, #to_str] path The path component.
@option [String, #to_str] query The query component.
@option [String, #to_str] fragment The fragment component.
@return [Addressable::URI] The constructed URI object.
Freeze URI, initializing instance variables.
@return [Addressable::URI] The frozen URI object. | [
"Creates",
"a",
"new",
"uri",
"object",
"from",
"component",
"parts",
"."
] | 5894c95a7768435cb46d1355954611dbd194832e | https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/uri.rb#L827-L841 | train | Freeze the object | [
30522,
13366,
13184,
2969,
1012,
3671,
3550,
1035,
5679,
2969,
1012,
3671,
3550,
1035,
5310,
2969,
1012,
3671,
3550,
1035,
20786,
2969,
1012,
3671,
3550,
1035,
5310,
2378,
14876,
2969,
1012,
3671,
3550,
1035,
3677,
2969,
1012,
3671,
3550,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongoid | lib/mongoid/config.rb | Mongoid.Config.options= | def options=(options)
if options
options.each_pair do |option, value|
Validators::Option.validate(option)
send("#{option}=", value)
end
end
end | ruby | def options=(options)
if options
options.each_pair do |option, value|
Validators::Option.validate(option)
send("#{option}=", value)
end
end
end | [
"def",
"options",
"=",
"(",
"options",
")",
"if",
"options",
"options",
".",
"each_pair",
"do",
"|",
"option",
",",
"value",
"|",
"Validators",
"::",
"Option",
".",
"validate",
"(",
"option",
")",
"send",
"(",
"\"#{option}=\"",
",",
"value",
")",
"end",
... | Set the configuration options. Will validate each one individually.
@example Set the options.
config.options = { raise_not_found_error: true }
@param [ Hash ] options The configuration options.
@since 3.0.0 | [
"Set",
"the",
"configuration",
"options",
".",
"Will",
"validate",
"each",
"one",
"individually",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/config.rb#L216-L223 | train | Sets the options for the current object. | [
30522,
13366,
7047,
1027,
1006,
7047,
1007,
2065,
7047,
7047,
1012,
2169,
1035,
3940,
2079,
1064,
5724,
1010,
3643,
1064,
9398,
18926,
1024,
1024,
5724,
1012,
9398,
3686,
1006,
5724,
1007,
4604,
1006,
1000,
1001,
1063,
5724,
1065,
1027,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-sqs/lib/aws-sdk-sqs/queue.rb | Aws::SQS.Queue.send_message | def send_message(options = {})
options = options.merge(queue_url: @url)
resp = @client.send_message(options)
resp.data
end | ruby | def send_message(options = {})
options = options.merge(queue_url: @url)
resp = @client.send_message(options)
resp.data
end | [
"def",
"send_message",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"queue_url",
":",
"@url",
")",
"resp",
"=",
"@client",
".",
"send_message",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
queue.send_message({
message_body: "String", # required
delay_seconds: 1,
message_attributes: {
"String" => {
string_value: "String",
binary_value: "data",
string_list_values: ["String"],
binary_list_values: ["data"],
data_type: "String", # required
},
},
message_deduplication_id: "String",
message_group_id: "String",
})
@param [Hash] options ({})
@option options [required, String] :message_body
The message to send. The maximum string size is 256 KB.
A message can include only XML, JSON, and unformatted text. The
following Unicode characters are allowed:
`#x9` \| `#xA` \| `#xD` \| `#x20` to `#xD7FF` \| `#xE000` to `#xFFFD`
\| `#x10000` to `#x10FFFF`
Any characters not included in this list will be rejected. For more
information, see the [W3C specification for characters][1].
[1]: http://www.w3.org/TR/REC-xml/#charsets
@option options [Integer] :delay_seconds
The length of time, in seconds, for which to delay a specific message.
Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive
`DelaySeconds` value become available for processing after the delay
period is finished. If you don't specify a value, the default value
for the queue applies.
<note markdown="1"> When you set `FifoQueue`, you can't set `DelaySeconds` per message.
You can set this parameter only on a queue level.
</note>
@option options [Hash<String,Types::MessageAttributeValue>] :message_attributes
Each message attribute consists of a `Name`, `Type`, and `Value`. For
more information, see [Amazon SQS Message Attributes][1] in the
*Amazon Simple Queue Service Developer Guide*.
[1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html
@option options [String] :message_deduplication_id
This parameter applies only to FIFO (first-in-first-out) queues.
The token used for deduplication of sent messages. If a message with a
particular `MessageDeduplicationId` is sent successfully, any messages
sent with the same `MessageDeduplicationId` are accepted successfully
but aren't delivered during the 5-minute deduplication interval. For
more information, see [ Exactly-Once Processing][1] in the *Amazon
Simple Queue Service Developer Guide*.
* Every message must have a unique `MessageDeduplicationId`,
* You may provide a `MessageDeduplicationId` explicitly.
* If you aren't able to provide a `MessageDeduplicationId` and you
enable `ContentBasedDeduplication` for your queue, Amazon SQS uses
a SHA-256 hash to generate the `MessageDeduplicationId` using the
body of the message (but not the attributes of the message).
* If you don't provide a `MessageDeduplicationId` and the queue
doesn't have `ContentBasedDeduplication` set, the action fails
with an error.
* If the queue has `ContentBasedDeduplication` set, your
`MessageDeduplicationId` overrides the generated one.
* When `ContentBasedDeduplication` is in effect, messages with
identical content sent within the deduplication interval are treated
as duplicates and only one copy of the message is delivered.
* If you send one message with `ContentBasedDeduplication` enabled and
then another message with a `MessageDeduplicationId` that is the
same as the one generated for the first `MessageDeduplicationId`,
the two messages are treated as duplicates and only one copy of the
message is delivered.
<note markdown="1"> The `MessageDeduplicationId` is available to the consumer of the
message (this can be useful for troubleshooting delivery issues).
If a message is sent successfully but the acknowledgement is lost and
the message is resent with the same `MessageDeduplicationId` after the
deduplication interval, Amazon SQS can't detect duplicate messages.
Amazon SQS continues to keep track of the message deduplication ID
even after the message is received and deleted.
</note>
The length of `MessageDeduplicationId` is 128 characters.
`MessageDeduplicationId` can contain alphanumeric characters (`a-z`,
`A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~
``).
For best practices of using `MessageDeduplicationId`, see [Using the
MessageDeduplicationId Property][2] in the *Amazon Simple Queue
Service Developer Guide*.
[1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing
[2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html
@option options [String] :message_group_id
This parameter applies only to FIFO (first-in-first-out) queues.
The tag that specifies that a message belongs to a specific message
group. Messages that belong to the same message group are processed in
a FIFO manner (however, messages in different message groups might be
processed out of order). To interleave multiple ordered streams within
a single queue, use `MessageGroupId` values (for example, session data
for multiple users). In this scenario, multiple consumers can process
the queue, but the session data of each user is processed in a FIFO
fashion.
* You must associate a non-empty `MessageGroupId` with a message. If
you don't provide a `MessageGroupId`, the action fails.
* `ReceiveMessage` might return messages with multiple
`MessageGroupId` values. For each `MessageGroupId`, the messages are
sorted by time sent. The caller can't specify a `MessageGroupId`.
The length of `MessageGroupId` is 128 characters. Valid values:
alphanumeric characters and punctuation ``
(!"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~) ``.
For best practices of using `MessageGroupId`, see [Using the
MessageGroupId Property][1] in the *Amazon Simple Queue Service
Developer Guide*.
`MessageGroupId` is required for FIFO queues. You can't use it for
Standard queues.
[1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html
@return [Types::SendMessageResult] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-sqs/lib/aws-sdk-sqs/queue.rb#L515-L519 | train | Send a message to the queue | [
30522,
13366,
4604,
1035,
4471,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
24240,
1035,
24471,
2140,
1024,
1030,
24471,
2140,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
4604,
1035,
4471,
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/manifest.rb | Sprockets.Manifest.save | def save
data = json_encode(@data)
FileUtils.mkdir_p File.dirname(@filename)
PathUtils.atomic_write(@filename) do |f|
f.write(data)
end
end | ruby | def save
data = json_encode(@data)
FileUtils.mkdir_p File.dirname(@filename)
PathUtils.atomic_write(@filename) do |f|
f.write(data)
end
end | [
"def",
"save",
"data",
"=",
"json_encode",
"(",
"@data",
")",
"FileUtils",
".",
"mkdir_p",
"File",
".",
"dirname",
"(",
"@filename",
")",
"PathUtils",
".",
"atomic_write",
"(",
"@filename",
")",
"do",
"|",
"f",
"|",
"f",
".",
"write",
"(",
"data",
")",... | Persist manfiest back to FS | [
"Persist",
"manfiest",
"back",
"to",
"FS"
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/manifest.rb#L277-L283 | train | Save the data to the file | [
30522,
13366,
3828,
2951,
1027,
1046,
3385,
1035,
4372,
16044,
1006,
1030,
2951,
1007,
5371,
21823,
4877,
1012,
12395,
4305,
2099,
1035,
1052,
5371,
1012,
16101,
18442,
1006,
1030,
5371,
18442,
1007,
4130,
21823,
4877,
1012,
9593,
1035,
433... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.purge_deleted_key | def purge_deleted_key(vault_base_url, key_name, custom_headers:nil)
response = purge_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
nil
end | ruby | def purge_deleted_key(vault_base_url, key_name, custom_headers:nil)
response = purge_deleted_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"purge_deleted_key",
"(",
"vault_base_url",
",",
"key_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"purge_deleted_key_async",
"(",
"vault_base_url",
",",
"key_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"... | Permanently deletes the specified key.
The Purge Deleted Key operation is applicable for soft-delete enabled vaults.
While the operation can be invoked on any vault, it will return an error if
invoked on a non soft-delete enabled vault. This operation requires the
keys/purge permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param key_name [String] The name of the key
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Permanently",
"deletes",
"the",
"specified",
"key",
"."
] | 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#L2448-L2451 | train | Purges the deleted key. | [
30522,
13366,
24694,
1035,
17159,
1035,
3145,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
24694,
1035,
17159,
1035,
3145,
1035,
2004,
6038,
2278,
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... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.expected_element | def expected_element(element_name, timeout=::PageObject.default_element_wait)
define_method("has_expected_element?") do
self.respond_to? "#{element_name}_element" and self.send("#{element_name}_element").when_present timeout
end
end | ruby | def expected_element(element_name, timeout=::PageObject.default_element_wait)
define_method("has_expected_element?") do
self.respond_to? "#{element_name}_element" and self.send("#{element_name}_element").when_present timeout
end
end | [
"def",
"expected_element",
"(",
"element_name",
",",
"timeout",
"=",
"::",
"PageObject",
".",
"default_element_wait",
")",
"define_method",
"(",
"\"has_expected_element?\"",
")",
"do",
"self",
".",
"respond_to?",
"\"#{element_name}_element\"",
"and",
"self",
".",
"sen... | Creates a method that provides a way to initialize a page based upon an expected element.
This is useful for pages that load dynamic content.
@param [Symbol] the name given to the element in the declaration
@param [optional, Integer] timeout default value is 5 seconds
@return [boolean]
@example Specify a text box named :address expected on the page within 10 seconds
expected_element(:address, 10)
page.has_expected_element? | [
"Creates",
"a",
"method",
"that",
"provides",
"a",
"way",
"to",
"initialize",
"a",
"page",
"based",
"upon",
"an",
"expected",
"element",
".",
"This",
"is",
"useful",
"for",
"pages",
"that",
"load",
"dynamic",
"content",
".",
"@param",
"[",
"Symbol",
"]",
... | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L109-L113 | train | Returns true if the element with the given name is expected to be present. | [
30522,
13366,
3517,
1035,
5783,
1006,
5783,
1035,
2171,
1010,
2051,
5833,
1027,
1024,
1024,
3931,
16429,
20614,
1012,
12398,
1035,
5783,
1035,
3524,
1007,
9375,
1035,
4118,
1006,
1000,
2038,
1035,
3517,
1035,
5783,
1029,
1000,
1007,
2079,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.begin_set_flow_log_configuration | def begin_set_flow_log_configuration(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_set_flow_log_configuration(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = begin_set_flow_log_configuration_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_set_flow_log_configuration",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_set_flow_log_configuration_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
"... | Configures flow log and traffic analytics (optional) on a specified
resource.
@param resource_group_name [String] The name of the network watcher resource
group.
@param network_watcher_name [String] The name of the network watcher
resource.
@param parameters [FlowLogInformation] Parameters that define the
configuration of flow log.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [FlowLogInformation] operation results. | [
"Configures",
"flow",
"log",
"and",
"traffic",
"analytics",
"(",
"optional",
")",
"on",
"a",
"specified",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L1875-L1878 | train | Sets the flow log configuration for the specified resource group. | [
30522,
13366,
4088,
1035,
2275,
1035,
4834,
1035,
8833,
1035,
9563,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
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_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb | Azure::SQL::Mgmt::V2017_03_01_preview.LongTermRetentionBackups.get | def get(location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers:nil)
response = get_async(location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get(location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers:nil)
response = get_async(location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get",
"(",
"location_name",
",",
"long_term_retention_server_name",
",",
"long_term_retention_database_name",
",",
"backup_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_async",
"(",
"location_name",
",",
"long_term_retention_server_name",
",... | Gets a long term retention backup.
@param location_name [String] The location of the database.
@param long_term_retention_server_name [String] The name of the server
@param long_term_retention_database_name [String] The name of the database
@param backup_name [String] The backup name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [LongTermRetentionBackup] operation results. | [
"Gets",
"a",
"long",
"term",
"retention",
"backup",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb#L39-L42 | train | Gets the specified long term retention policy. | [
30522,
13366,
2131,
1006,
3295,
1035,
2171,
1010,
2146,
1035,
2744,
1035,
20125,
1035,
8241,
1035,
2171,
1010,
2146,
1035,
2744,
1035,
20125,
1035,
7809,
1035,
2171,
1010,
10200,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/sprockets | lib/sprockets/sass_processor.rb | Sprockets.SassProcessor.call | def call(input)
context = input[:environment].context_class.new(input)
engine_options = merge_options({
filename: input[:filename],
syntax: self.class.syntax,
cache_store: build_cache_store(input, @cache_version),
load_paths: context.environment.paths.map { |p| @importer_class.new(p.to_s) },
importer: @importer_class.new(Pathname.new(context.filename).to_s),
sprockets: {
context: context,
environment: input[:environment],
dependencies: context.metadata[:dependencies]
}
})
engine = Autoload::Sass::Engine.new(input[:data], engine_options)
css, map = Utils.module_include(Autoload::Sass::Script::Functions, @functions) do
engine.render_with_sourcemap('')
end
css = css.sub("\n/*# sourceMappingURL= */\n", '')
map = SourceMapUtils.format_source_map(JSON.parse(map.to_json(css_uri: '')), input)
map = SourceMapUtils.combine_source_maps(input[:metadata][:map], map)
# Track all imported files
sass_dependencies = Set.new([input[:filename]])
engine.dependencies.map do |dependency|
sass_dependencies << dependency.options[:filename]
context.metadata[:dependencies] << URIUtils.build_file_digest_uri(dependency.options[:filename])
end
context.metadata.merge(data: css, sass_dependencies: sass_dependencies, map: map)
end | ruby | def call(input)
context = input[:environment].context_class.new(input)
engine_options = merge_options({
filename: input[:filename],
syntax: self.class.syntax,
cache_store: build_cache_store(input, @cache_version),
load_paths: context.environment.paths.map { |p| @importer_class.new(p.to_s) },
importer: @importer_class.new(Pathname.new(context.filename).to_s),
sprockets: {
context: context,
environment: input[:environment],
dependencies: context.metadata[:dependencies]
}
})
engine = Autoload::Sass::Engine.new(input[:data], engine_options)
css, map = Utils.module_include(Autoload::Sass::Script::Functions, @functions) do
engine.render_with_sourcemap('')
end
css = css.sub("\n/*# sourceMappingURL= */\n", '')
map = SourceMapUtils.format_source_map(JSON.parse(map.to_json(css_uri: '')), input)
map = SourceMapUtils.combine_source_maps(input[:metadata][:map], map)
# Track all imported files
sass_dependencies = Set.new([input[:filename]])
engine.dependencies.map do |dependency|
sass_dependencies << dependency.options[:filename]
context.metadata[:dependencies] << URIUtils.build_file_digest_uri(dependency.options[:filename])
end
context.metadata.merge(data: css, sass_dependencies: sass_dependencies, map: map)
end | [
"def",
"call",
"(",
"input",
")",
"context",
"=",
"input",
"[",
":environment",
"]",
".",
"context_class",
".",
"new",
"(",
"input",
")",
"engine_options",
"=",
"merge_options",
"(",
"{",
"filename",
":",
"input",
"[",
":filename",
"]",
",",
"syntax",
":... | Public: Initialize template with custom options.
options - Hash
cache_version - String custom cache version. Used to force a cache
change after code changes are made to Sass Functions. | [
"Public",
":",
"Initialize",
"template",
"with",
"custom",
"options",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/sass_processor.rb#L59-L94 | train | Calls the engine with the given input | [
30522,
13366,
2655,
1006,
7953,
1007,
6123,
1027,
7953,
1031,
1024,
4044,
1033,
1012,
6123,
1035,
2465,
1012,
2047,
1006,
7953,
1007,
3194,
1035,
7047,
1027,
13590,
1035,
7047,
1006,
1063,
5371,
18442,
1024,
7953,
1031,
1024,
5371,
18442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/plugins/plugin_manager.rb | Fastlane.PluginManager.print_plugin_information | def print_plugin_information(references)
rows = references.collect do |current|
if current[1][:actions].empty?
# Something is wrong with this plugin, no available actions
[current[0].red, current[1][:version_number], "No actions found".red]
else
[current[0], current[1][:version_number], current[1][:actions].join("\n")]
end
end
require 'terminal-table'
puts(Terminal::Table.new({
rows: FastlaneCore::PrintTable.transform_output(rows),
title: "Used plugins".green,
headings: ["Plugin", "Version", "Action"]
}))
puts("")
end | ruby | def print_plugin_information(references)
rows = references.collect do |current|
if current[1][:actions].empty?
# Something is wrong with this plugin, no available actions
[current[0].red, current[1][:version_number], "No actions found".red]
else
[current[0], current[1][:version_number], current[1][:actions].join("\n")]
end
end
require 'terminal-table'
puts(Terminal::Table.new({
rows: FastlaneCore::PrintTable.transform_output(rows),
title: "Used plugins".green,
headings: ["Plugin", "Version", "Action"]
}))
puts("")
end | [
"def",
"print_plugin_information",
"(",
"references",
")",
"rows",
"=",
"references",
".",
"collect",
"do",
"|",
"current",
"|",
"if",
"current",
"[",
"1",
"]",
"[",
":actions",
"]",
".",
"empty?",
"# Something is wrong with this plugin, no available actions",
"[",
... | Prints a table all the plugins that were loaded | [
"Prints",
"a",
"table",
"all",
"the",
"plugins",
"that",
"were",
"loaded"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/plugins/plugin_manager.rb#L319-L336 | train | Print the plugin information | [
30522,
13366,
6140,
1035,
13354,
2378,
1035,
2592,
1006,
7604,
1007,
10281,
1027,
7604,
1012,
8145,
2079,
1064,
2783,
1064,
2065,
2783,
1031,
1015,
1033,
1031,
1024,
4506,
1033,
1012,
4064,
1029,
1001,
2242,
2003,
3308,
2007,
2023,
13354,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/consumer.rb | Kafka.Consumer.each_batch | def each_batch(min_bytes: 1, max_bytes: 10485760, max_wait_time: 1, automatically_mark_as_processed: true)
@fetcher.configure(
min_bytes: min_bytes,
max_bytes: max_bytes,
max_wait_time: max_wait_time,
)
consumer_loop do
batches = fetch_batches
batches.each do |batch|
unless batch.empty?
raw_messages = batch.messages
batch.messages = raw_messages.reject(&:is_control_record)
notification = {
topic: batch.topic,
partition: batch.partition,
last_offset: batch.last_offset,
offset_lag: batch.offset_lag,
highwater_mark_offset: batch.highwater_mark_offset,
message_count: batch.messages.count,
}
# Instrument an event immediately so that subscribers don't have to wait until
# the block is completed.
@instrumenter.instrument("start_process_batch.consumer", notification)
@instrumenter.instrument("process_batch.consumer", notification) do
begin
yield batch
@current_offsets[batch.topic][batch.partition] = batch.last_offset unless batch.unknown_last_offset?
rescue => e
offset_range = (batch.first_offset..batch.last_offset || batch.highwater_mark_offset)
location = "#{batch.topic}/#{batch.partition} in offset range #{offset_range}"
backtrace = e.backtrace.join("\n")
@logger.error "Exception raised when processing #{location} -- #{e.class}: #{e}\n#{backtrace}"
raise ProcessingError.new(batch.topic, batch.partition, offset_range)
ensure
batch.messages = raw_messages
end
end
mark_message_as_processed(batch.messages.last) if automatically_mark_as_processed
# We've successfully processed a batch from the partition, so we can clear
# the pause.
pause_for(batch.topic, batch.partition).reset!
end
@offset_manager.commit_offsets_if_necessary
trigger_heartbeat
return if shutting_down?
end
# We may not have received any messages, but it's still a good idea to
# commit offsets if we've processed messages in the last set of batches.
# This also ensures the offsets are retained if we haven't read any messages
# since the offset retention period has elapsed.
@offset_manager.commit_offsets_if_necessary
end
end | ruby | def each_batch(min_bytes: 1, max_bytes: 10485760, max_wait_time: 1, automatically_mark_as_processed: true)
@fetcher.configure(
min_bytes: min_bytes,
max_bytes: max_bytes,
max_wait_time: max_wait_time,
)
consumer_loop do
batches = fetch_batches
batches.each do |batch|
unless batch.empty?
raw_messages = batch.messages
batch.messages = raw_messages.reject(&:is_control_record)
notification = {
topic: batch.topic,
partition: batch.partition,
last_offset: batch.last_offset,
offset_lag: batch.offset_lag,
highwater_mark_offset: batch.highwater_mark_offset,
message_count: batch.messages.count,
}
# Instrument an event immediately so that subscribers don't have to wait until
# the block is completed.
@instrumenter.instrument("start_process_batch.consumer", notification)
@instrumenter.instrument("process_batch.consumer", notification) do
begin
yield batch
@current_offsets[batch.topic][batch.partition] = batch.last_offset unless batch.unknown_last_offset?
rescue => e
offset_range = (batch.first_offset..batch.last_offset || batch.highwater_mark_offset)
location = "#{batch.topic}/#{batch.partition} in offset range #{offset_range}"
backtrace = e.backtrace.join("\n")
@logger.error "Exception raised when processing #{location} -- #{e.class}: #{e}\n#{backtrace}"
raise ProcessingError.new(batch.topic, batch.partition, offset_range)
ensure
batch.messages = raw_messages
end
end
mark_message_as_processed(batch.messages.last) if automatically_mark_as_processed
# We've successfully processed a batch from the partition, so we can clear
# the pause.
pause_for(batch.topic, batch.partition).reset!
end
@offset_manager.commit_offsets_if_necessary
trigger_heartbeat
return if shutting_down?
end
# We may not have received any messages, but it's still a good idea to
# commit offsets if we've processed messages in the last set of batches.
# This also ensures the offsets are retained if we haven't read any messages
# since the offset retention period has elapsed.
@offset_manager.commit_offsets_if_necessary
end
end | [
"def",
"each_batch",
"(",
"min_bytes",
":",
"1",
",",
"max_bytes",
":",
"10485760",
",",
"max_wait_time",
":",
"1",
",",
"automatically_mark_as_processed",
":",
"true",
")",
"@fetcher",
".",
"configure",
"(",
"min_bytes",
":",
"min_bytes",
",",
"max_bytes",
":... | Fetches and enumerates the messages in the topics that the consumer group
subscribes to.
Each batch of messages is yielded to the provided block. If the block returns
without raising an exception, the batch will be considered successfully
processed. At regular intervals the offset of the most recent successfully
processed message batch in each partition will be committed to the Kafka
offset store. If the consumer crashes or leaves the group, the group member
that is tasked with taking over processing of these partitions will resume
at the last committed offsets.
@param min_bytes [Integer] the minimum number of bytes to read before
returning messages from each broker; if `max_wait_time` is reached, this
is ignored.
@param max_bytes [Integer] the maximum number of bytes to read before
returning messages from each broker.
@param max_wait_time [Integer, Float] the maximum duration of time to wait before
returning messages from each broker, in seconds.
@param automatically_mark_as_processed [Boolean] whether to automatically
mark a batch's messages as successfully processed when the block returns
without an exception. Once marked successful, the offsets of processed
messages can be committed to Kafka.
@yieldparam batch [Kafka::FetchedBatch] a message batch fetched from Kafka.
@raise [Kafka::ProcessingError] if there was an error processing a batch.
The original exception will be returned by calling `#cause` on the
{Kafka::ProcessingError} instance.
@return [nil] | [
"Fetches",
"and",
"enumerates",
"the",
"messages",
"in",
"the",
"topics",
"that",
"the",
"consumer",
"group",
"subscribes",
"to",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/consumer.rb#L292-L356 | train | Yields each batch from the broker. | [
30522,
13366,
2169,
1035,
14108,
1006,
8117,
1035,
27507,
1024,
1015,
1010,
4098,
1035,
27507,
1024,
9645,
27531,
2581,
16086,
1010,
4098,
1035,
3524,
1035,
2051,
1024,
1015,
1010,
8073,
1035,
2928,
1035,
2004,
1035,
13995,
1024,
2995,
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-iam/lib/aws-sdk-iam/user_policy.rb | Aws::IAM.UserPolicy.delete | def delete(options = {})
options = options.merge(
user_name: @user_name,
policy_name: @name
)
resp = @client.delete_user_policy(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(
user_name: @user_name,
policy_name: @name
)
resp = @client.delete_user_policy(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"user_name",
":",
"@user_name",
",",
"policy_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"delete_user_policy",
"(",
"options",
")",
"resp",
".",... | @!group Actions
@example Request syntax with placeholder values
user_policy.delete()
@param [Hash] options ({})
@return [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/user_policy.rb#L188-L195 | train | Delete a policy from the user | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
5310,
1035,
2171,
1024,
1030,
5310,
1035,
2171,
1010,
3343,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | spaceship/lib/spaceship/tunes/tunes_client.rb | Spaceship.TunesClient.update_build_trains! | def update_build_trains!(app_id, testing_type, data)
raise "app_id is required" unless app_id
# The request fails if this key is present in the data
data.delete("dailySubmissionCountByPlatform")
r = request(:post) do |req|
req.url("ra/apps/#{app_id}/testingTypes/#{testing_type}/trains/")
req.body = data.to_json
req.headers['Content-Type'] = 'application/json'
end
handle_itc_response(r.body)
end | ruby | def update_build_trains!(app_id, testing_type, data)
raise "app_id is required" unless app_id
# The request fails if this key is present in the data
data.delete("dailySubmissionCountByPlatform")
r = request(:post) do |req|
req.url("ra/apps/#{app_id}/testingTypes/#{testing_type}/trains/")
req.body = data.to_json
req.headers['Content-Type'] = 'application/json'
end
handle_itc_response(r.body)
end | [
"def",
"update_build_trains!",
"(",
"app_id",
",",
"testing_type",
",",
"data",
")",
"raise",
"\"app_id is required\"",
"unless",
"app_id",
"# The request fails if this key is present in the data",
"data",
".",
"delete",
"(",
"\"dailySubmissionCountByPlatform\"",
")",
"r",
... | rubocop:enable Metrics/BlockNesting | [
"rubocop",
":",
"enable",
"Metrics",
"/",
"BlockNesting"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/tunes/tunes_client.rb#L935-L948 | train | Update build trains for an app | [
30522,
13366,
10651,
1035,
3857,
1035,
4499,
999,
1006,
10439,
1035,
8909,
1010,
5604,
1035,
2828,
1010,
2951,
1007,
5333,
1000,
10439,
1035,
8909,
2003,
3223,
1000,
4983,
10439,
1035,
8909,
1001,
1996,
5227,
11896,
2065,
2023,
3145,
2003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
brunofacca/active-record-query-trace | lib/active_record_query_trace.rb | ActiveRecordQueryTrace.CustomLogSubscriber.sql | def sql(event)
payload = event.payload
return unless display_backtrace?(payload)
setup_backtrace_cleaner
trace = fully_formatted_trace # Memoize
debug(trace) unless trace.blank?
end | ruby | def sql(event)
payload = event.payload
return unless display_backtrace?(payload)
setup_backtrace_cleaner
trace = fully_formatted_trace # Memoize
debug(trace) unless trace.blank?
end | [
"def",
"sql",
"(",
"event",
")",
"payload",
"=",
"event",
".",
"payload",
"return",
"unless",
"display_backtrace?",
"(",
"payload",
")",
"setup_backtrace_cleaner",
"trace",
"=",
"fully_formatted_trace",
"# Memoize",
"debug",
"(",
"trace",
")",
"unless",
"trace",
... | rubocop:disable Metrics/ClassLength | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"ClassLength"
] | 9584d5d49cfc2170271f75bbf2773b46145e1be4 | https://github.com/brunofacca/active-record-query-trace/blob/9584d5d49cfc2170271f75bbf2773b46145e1be4/lib/active_record_query_trace.rb#L50-L58 | train | This method is called by the sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_sql_ | [
30522,
13366,
29296,
1006,
2724,
1007,
18093,
1027,
2724,
1012,
18093,
2709,
4983,
4653,
1035,
2067,
6494,
3401,
1029,
1006,
18093,
1007,
16437,
1035,
2067,
6494,
3401,
1035,
20133,
7637,
1027,
3929,
1035,
4289,
3064,
1035,
7637,
1001,
2444... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/box.rb | Vagrant.Box.load_metadata | def load_metadata(**download_options)
tf = Tempfile.new("vagrant-load-metadata")
tf.close
url = @metadata_url
if File.file?(url) || url !~ /^[a-z0-9]+:.*$/i
url = File.expand_path(url)
url = Util::Platform.cygwin_windows_path(url)
url = "file:#{url}"
end
opts = { headers: ["Accept: application/json"] }.merge(download_options)
Util::Downloader.new(url, tf.path, **opts).download!
BoxMetadata.new(File.open(tf.path, "r"))
rescue Errors::DownloaderError => e
raise Errors::BoxMetadataDownloadError,
message: e.extra_data[:message]
ensure
tf.unlink if tf
end | ruby | def load_metadata(**download_options)
tf = Tempfile.new("vagrant-load-metadata")
tf.close
url = @metadata_url
if File.file?(url) || url !~ /^[a-z0-9]+:.*$/i
url = File.expand_path(url)
url = Util::Platform.cygwin_windows_path(url)
url = "file:#{url}"
end
opts = { headers: ["Accept: application/json"] }.merge(download_options)
Util::Downloader.new(url, tf.path, **opts).download!
BoxMetadata.new(File.open(tf.path, "r"))
rescue Errors::DownloaderError => e
raise Errors::BoxMetadataDownloadError,
message: e.extra_data[:message]
ensure
tf.unlink if tf
end | [
"def",
"load_metadata",
"(",
"**",
"download_options",
")",
"tf",
"=",
"Tempfile",
".",
"new",
"(",
"\"vagrant-load-metadata\"",
")",
"tf",
".",
"close",
"url",
"=",
"@metadata_url",
"if",
"File",
".",
"file?",
"(",
"url",
")",
"||",
"url",
"!~",
"/",
"/... | Loads the metadata URL and returns the latest metadata associated
with this box.
@param [Hash] download_options Options to pass to the downloader.
@return [BoxMetadata] | [
"Loads",
"the",
"metadata",
"URL",
"and",
"returns",
"the",
"latest",
"metadata",
"associated",
"with",
"this",
"box",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/box.rb#L123-L142 | train | Load the metadata from the server. | [
30522,
13366,
7170,
1035,
27425,
1006,
1008,
1008,
8816,
1035,
7047,
1007,
1056,
2546,
1027,
8915,
8737,
8873,
2571,
1012,
2047,
1006,
1000,
12436,
18980,
1011,
7170,
1011,
27425,
1000,
1007,
1056,
2546,
1012,
2485,
24471,
2140,
1027,
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 | management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.begin_create_or_update_certificate_with_http_info | def begin_create_or_update_certificate_with_http_info(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
begin_create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_certificate_with_http_info(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
begin_create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_certificate_with_http_info",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"name",
",",
"key_vault_certificate",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_certificate_async",
"(",
"resource_group_name",
",",
... | Creates or updates a certificate and associates with key vault secret.
Creates or updates a certificate and associates with key vault secret.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param certificate_order_name [String] Name of the certificate order.
@param name [String] Name of the certificate.
@param key_vault_certificate [AppServiceCertificateResource] Key vault
certificate resource 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. | [
"Creates",
"or",
"updates",
"a",
"certificate",
"and",
"associates",
"with",
"key",
"vault",
"secret",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L2202-L2204 | train | Creates or updates a certificate in the specified certificate order. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
8196,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8196,
1035,
2344,
1035,
2171,
1010,
2171,
1010,
3145,
1035,
11632,
1035,
8196,
1010,
7661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
httprb/http | lib/http/headers.rb | HTTP.Headers.delete | def delete(name)
name = normalize_header name.to_s
@pile.delete_if { |k, _| k == name }
end | ruby | def delete(name)
name = normalize_header name.to_s
@pile.delete_if { |k, _| k == name }
end | [
"def",
"delete",
"(",
"name",
")",
"name",
"=",
"normalize_header",
"name",
".",
"to_s",
"@pile",
".",
"delete_if",
"{",
"|",
"k",
",",
"_",
"|",
"k",
"==",
"name",
"}",
"end"
] | Removes header.
@param [#to_s] name header name
@return [void] | [
"Removes",
"header",
"."
] | f37a10ea4fab3ee411907ea2e4251ddf0ca33a93 | https://github.com/httprb/http/blob/f37a10ea4fab3ee411907ea2e4251ddf0ca33a93/lib/http/headers.rb#L41-L44 | train | Delete a header from the file | [
30522,
13366,
3972,
12870,
1006,
2171,
1007,
2171,
1027,
3671,
4697,
1035,
20346,
2171,
1012,
2000,
1035,
1055,
1030,
8632,
1012,
3972,
12870,
1035,
2065,
1063,
1064,
1047,
1010,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | spec/support/selectors.rb | Selectors.Dashboard.select_user | def select_user(user, role = 'Depositor')
first('a.select2-choice').click
find('.select2-input').set(user.user_key)
sleep 1
first('div.select2-result-label').click
within('div.add-users') do
select(role)
find('input.edit-collection-add-sharing-button').click
end
end | ruby | def select_user(user, role = 'Depositor')
first('a.select2-choice').click
find('.select2-input').set(user.user_key)
sleep 1
first('div.select2-result-label').click
within('div.add-users') do
select(role)
find('input.edit-collection-add-sharing-button').click
end
end | [
"def",
"select_user",
"(",
"user",
",",
"role",
"=",
"'Depositor'",
")",
"first",
"(",
"'a.select2-choice'",
")",
".",
"click",
"find",
"(",
"'.select2-input'",
")",
".",
"set",
"(",
"user",
".",
"user_key",
")",
"sleep",
"1",
"first",
"(",
"'div.select2-r... | For use with javascript user selector that allows for searching for an existing user
and granting them permission to an object.
@param [User] user to select
@param [String] role granting the user permission (e.g. 'Manager' | 'Depositor' | 'Viewer') | [
"For",
"use",
"with",
"javascript",
"user",
"selector",
"that",
"allows",
"for",
"searching",
"for",
"an",
"existing",
"user",
"and",
"granting",
"them",
"permission",
"to",
"an",
"object",
"."
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/spec/support/selectors.rb#L13-L22 | train | Select a user | [
30522,
13366,
7276,
1035,
5310,
1006,
5310,
1010,
2535,
1027,
1005,
12816,
2953,
1005,
1007,
2034,
1006,
1005,
1037,
1012,
7276,
2475,
1011,
3601,
1005,
1007,
1012,
11562,
2424,
1006,
1005,
1012,
7276,
2475,
1011,
7953,
1005,
1007,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb | Azure::MachineLearning::Mgmt::V2017_01_01.WebServices.list_by_resource_group | def list_by_resource_group(resource_group_name, skiptoken:nil, custom_headers:nil)
first_page = list_by_resource_group_as_lazy(resource_group_name, skiptoken:skiptoken, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_resource_group(resource_group_name, skiptoken:nil, custom_headers:nil)
first_page = list_by_resource_group_as_lazy(resource_group_name, skiptoken:skiptoken, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_resource_group",
"(",
"resource_group_name",
",",
"skiptoken",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_resource_group_as_lazy",
"(",
"resource_group_name",
",",
"skiptoken",
":",
"skiptoken",
",",
"custom_headers",... | Gets the web services in the specified resource group.
@param resource_group_name [String] Name of the resource group in which the
web service is located.
@param skiptoken [String] Continuation token for pagination.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<WebService>] operation results. | [
"Gets",
"the",
"web",
"services",
"in",
"the",
"specified",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb#L439-L442 | train | Gets all the segmentation rules in a resource group. | [
30522,
13366,
2862,
1035,
2011,
1035,
7692,
1035,
2177,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
13558,
18715,
2368,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2011,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Shopify/shipit-engine | app/models/shipit/deploy.rb | Shipit.Deploy.trigger_rollback | def trigger_rollback(user = AnonymousUser.new, env: nil, force: false)
rollback = build_rollback(user, env: env, force: force)
rollback.save!
rollback.enqueue
lock_reason = "A rollback for #{rollback.since_commit.sha} has been triggered. " \
"Please make sure the reason for the rollback has been addressed before deploying again."
stack.update!(lock_reason: lock_reason, lock_author_id: user.id)
rollback
end | ruby | def trigger_rollback(user = AnonymousUser.new, env: nil, force: false)
rollback = build_rollback(user, env: env, force: force)
rollback.save!
rollback.enqueue
lock_reason = "A rollback for #{rollback.since_commit.sha} has been triggered. " \
"Please make sure the reason for the rollback has been addressed before deploying again."
stack.update!(lock_reason: lock_reason, lock_author_id: user.id)
rollback
end | [
"def",
"trigger_rollback",
"(",
"user",
"=",
"AnonymousUser",
".",
"new",
",",
"env",
":",
"nil",
",",
"force",
":",
"false",
")",
"rollback",
"=",
"build_rollback",
"(",
"user",
",",
"env",
":",
"env",
",",
"force",
":",
"force",
")",
"rollback",
".",... | Rolls the stack back to this deploy | [
"Rolls",
"the",
"stack",
"back",
"to",
"this",
"deploy"
] | f6b93d8a242962016e0f82e99c2eb223bdc75003 | https://github.com/Shopify/shipit-engine/blob/f6b93d8a242962016e0f82e99c2eb223bdc75003/app/models/shipit/deploy.rb#L76-L86 | train | Trigger a rollback for a user | [
30522,
13366,
9495,
1035,
4897,
5963,
1006,
5310,
1027,
10812,
20330,
1012,
2047,
1010,
4372,
2615,
1024,
9152,
2140,
1010,
2486,
1024,
6270,
1007,
4897,
5963,
1027,
3857,
1035,
4897,
5963,
1006,
5310,
1010,
4372,
2615,
1024,
4372,
2615,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/workflow_versions.rb | Azure::Logic::Mgmt::V2016_06_01.WorkflowVersions.list_callback_url_with_http_info | def list_callback_url_with_http_info(resource_group_name, workflow_name, version_id, trigger_name, parameters:nil, custom_headers:nil)
list_callback_url_async(resource_group_name, workflow_name, version_id, trigger_name, parameters:parameters, custom_headers:custom_headers).value!
end | ruby | def list_callback_url_with_http_info(resource_group_name, workflow_name, version_id, trigger_name, parameters:nil, custom_headers:nil)
list_callback_url_async(resource_group_name, workflow_name, version_id, trigger_name, parameters:parameters, custom_headers:custom_headers).value!
end | [
"def",
"list_callback_url_with_http_info",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"version_id",
",",
"trigger_name",
",",
"parameters",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_callback_url_async",
"(",
"resource_group_name",
",",
"workf... | Get the callback url for a trigger of a workflow version.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param version_id [String] The workflow versionId.
@param trigger_name [String] The workflow trigger name.
@param parameters [GetCallbackUrlParameters] The callback URL parameters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Get",
"the",
"callback",
"url",
"for",
"a",
"trigger",
"of",
"a",
"workflow",
"version",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_versions.rb#L246-L248 | train | Gets the callback URL for the specified workflow version and trigger. | [
30522,
13366,
2862,
1035,
2655,
5963,
1035,
24471,
30524,
1035,
24471,
2140,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
2544,
1035,
8909,
1010,
9495,
1035,
2171,
1010,
11709,
1024,
11709... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/workflow_triggers.rb | Azure::Logic::Mgmt::V2016_06_01.WorkflowTriggers.set_state | def set_state(resource_group_name, workflow_name, trigger_name, set_state, custom_headers:nil)
response = set_state_async(resource_group_name, workflow_name, trigger_name, set_state, custom_headers:custom_headers).value!
nil
end | ruby | def set_state(resource_group_name, workflow_name, trigger_name, set_state, custom_headers:nil)
response = set_state_async(resource_group_name, workflow_name, trigger_name, set_state, custom_headers:custom_headers).value!
nil
end | [
"def",
"set_state",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"trigger_name",
",",
"set_state",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"set_state_async",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"trigger_name",
",",
"set_... | Sets the state of a workflow trigger.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param trigger_name [String] The workflow trigger name.
@param set_state [SetTriggerStateActionDefinition] The workflow trigger
state.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Sets",
"the",
"state",
"of",
"a",
"workflow",
"trigger",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_triggers.rb#L497-L500 | train | Sets the state of a workflow trigger. | [
30522,
13366,
2275,
1035,
2110,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
9495,
1035,
2171,
1010,
2275,
1035,
2110,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2275,
1035,
2110,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | actionpack/lib/action_controller/metal/request_forgery_protection.rb | ActionController.RequestForgeryProtection.verify_same_origin_request | def verify_same_origin_request # :doc:
if marked_for_same_origin_verification? && non_xhr_javascript_response?
if logger && log_warning_on_csrf_failure
logger.warn CROSS_ORIGIN_JAVASCRIPT_WARNING
end
raise ActionController::InvalidCrossOriginRequest, CROSS_ORIGIN_JAVASCRIPT_WARNING
end
end | ruby | def verify_same_origin_request # :doc:
if marked_for_same_origin_verification? && non_xhr_javascript_response?
if logger && log_warning_on_csrf_failure
logger.warn CROSS_ORIGIN_JAVASCRIPT_WARNING
end
raise ActionController::InvalidCrossOriginRequest, CROSS_ORIGIN_JAVASCRIPT_WARNING
end
end | [
"def",
"verify_same_origin_request",
"# :doc:",
"if",
"marked_for_same_origin_verification?",
"&&",
"non_xhr_javascript_response?",
"if",
"logger",
"&&",
"log_warning_on_csrf_failure",
"logger",
".",
"warn",
"CROSS_ORIGIN_JAVASCRIPT_WARNING",
"end",
"raise",
"ActionController",
"... | :startdoc:
If +verify_authenticity_token+ was run (indicating that we have
forgery protection enabled for this request) then also verify that
we aren't serving an unauthorized cross-origin response. | [
":",
"startdoc",
":",
"If",
"+",
"verify_authenticity_token",
"+",
"was",
"run",
"(",
"indicating",
"that",
"we",
"have",
"forgery",
"protection",
"enabled",
"for",
"this",
"request",
")",
"then",
"also",
"verify",
"that",
"we",
"aren",
"t",
"serving",
"an",... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_controller/metal/request_forgery_protection.rb#L263-L270 | train | Verify that the request is a cross origin request. | [
30522,
13366,
20410,
1035,
2168,
1035,
4761,
1035,
5227,
1001,
1024,
9986,
1024,
2065,
4417,
1035,
2005,
1035,
2168,
1035,
4761,
1035,
22616,
1029,
1004,
1004,
2512,
1035,
1060,
8093,
1035,
9262,
22483,
1035,
3433,
1029,
2065,
8833,
4590,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/local_network_gateways.rb | Azure::Network::Mgmt::V2018_07_01.LocalNetworkGateways.begin_delete | def begin_delete(resource_group_name, local_network_gateway_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, local_network_gateway_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, local_network_gateway_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, local_network_gateway_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"local_network_gateway_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"local_network_gateway_name",
",",
"custom_headers",
":custom_headers",
")",... | Deletes the specified local network gateway.
@param resource_group_name [String] The name of the resource group.
@param local_network_gateway_name [String] The name of the local network
gateway.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"local",
"network",
"gateway",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/local_network_gateways.rb#L474-L477 | train | Deletes a local network gateway. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2334,
1035,
2897,
1035,
11909,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
haml/haml | lib/haml/util.rb | Haml.Util.human_indentation | def human_indentation(indentation)
if !indentation.include?(?\t)
noun = 'space'
elsif !indentation.include?(?\s)
noun = 'tab'
else
return indentation.inspect
end
singular = indentation.length == 1
"#{indentation.length} #{noun}#{'s' unless singular}"
end | ruby | def human_indentation(indentation)
if !indentation.include?(?\t)
noun = 'space'
elsif !indentation.include?(?\s)
noun = 'tab'
else
return indentation.inspect
end
singular = indentation.length == 1
"#{indentation.length} #{noun}#{'s' unless singular}"
end | [
"def",
"human_indentation",
"(",
"indentation",
")",
"if",
"!",
"indentation",
".",
"include?",
"(",
"?\\t",
")",
"noun",
"=",
"'space'",
"elsif",
"!",
"indentation",
".",
"include?",
"(",
"?\\s",
")",
"noun",
"=",
"'tab'",
"else",
"return",
"indentation",
... | Formats a string for use in error messages about indentation.
@param indentation [String] The string used for indentation
@return [String] The name of the indentation (e.g. `"12 spaces"`, `"1 tab"`) | [
"Formats",
"a",
"string",
"for",
"use",
"in",
"error",
"messages",
"about",
"indentation",
"."
] | 9aa0fbe4a91b999978927be569d2ad0cd39076f1 | https://github.com/haml/haml/blob/9aa0fbe4a91b999978927be569d2ad0cd39076f1/lib/haml/util.rb#L184-L195 | train | Returns a human - readable string of the indentation. | [
30522,
13366,
2529,
1035,
27427,
19304,
1006,
27427,
19304,
1007,
2065,
999,
27427,
19304,
1012,
2421,
1029,
1006,
1029,
1032,
1056,
1007,
15156,
1027,
1005,
2686,
1005,
3449,
5332,
2546,
999,
27427,
19304,
1012,
2421,
1029,
1006,
1029,
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... |
Katello/katello | app/models/katello/repository.rb | Katello.Repository.dynflow_handled_last_sync? | def dynflow_handled_last_sync?(pulp_task_id)
task = ForemanTasks::Task::DynflowTask.for_action(::Actions::Katello::Repository::Sync).
for_resource(self).order(:started_at).last
return task && task.main_action.pulp_task_id == pulp_task_id
end | ruby | def dynflow_handled_last_sync?(pulp_task_id)
task = ForemanTasks::Task::DynflowTask.for_action(::Actions::Katello::Repository::Sync).
for_resource(self).order(:started_at).last
return task && task.main_action.pulp_task_id == pulp_task_id
end | [
"def",
"dynflow_handled_last_sync?",
"(",
"pulp_task_id",
")",
"task",
"=",
"ForemanTasks",
"::",
"Task",
"::",
"DynflowTask",
".",
"for_action",
"(",
"::",
"Actions",
"::",
"Katello",
"::",
"Repository",
"::",
"Sync",
")",
".",
"for_resource",
"(",
"self",
")... | Returns true if the pulp_task_id was triggered by the last synchronization
action for the repository. Dynflow action handles the synchronization
by it's own so no need to synchronize it again in this callback. Since the
callbacks are run just after synchronization is finished, it should be enough
to check for the last synchronization task. | [
"Returns",
"true",
"if",
"the",
"pulp_task_id",
"was",
"triggered",
"by",
"the",
"last",
"synchronization",
"action",
"for",
"the",
"repository",
".",
"Dynflow",
"action",
"handles",
"the",
"synchronization",
"by",
"it",
"s",
"own",
"so",
"no",
"need",
"to",
... | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/repository.rb#L342-L346 | train | Returns true if the last sync was handled by the pulp task | [
30522,
13366,
1040,
6038,
12314,
1035,
8971,
1035,
2197,
1035,
26351,
1029,
1006,
16016,
1035,
4708,
1035,
8909,
1007,
4708,
1027,
18031,
10230,
5705,
1024,
1024,
4708,
1024,
1024,
1040,
6038,
12314,
10230,
2243,
1012,
2005,
1035,
2895,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.begin_reimage_with_http_info | def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
begin_reimage_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
end | ruby | def begin_reimage_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
begin_reimage_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
end | [
"def",
"begin_reimage_with_http_info",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"begin_reimage_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
":... | Reimages (upgrade the operating system) one or more virtual machines in a VM
scale set.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Reimages",
"(",
"upgrade",
"the",
"operating",
"system",
")",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L2349-L2351 | train | Reimage a virtual machine in a VM scale set. | [
30522,
13366,
4088,
1035,
24964,
26860,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
1024,
9152,
2140,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
heroku/legacy-cli | lib/heroku/command/addons.rb | Heroku::Command.Addons.destroy | def destroy
if current_command == "addons:remove"
deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:destroy` instead.")
end
raise CommandFailed.new("Missing add-on name") if args.empty?
requires_preauth
confirmed_apps = []
while addon_name = args.shift
addon = resolve_addon!(addon_name)
app = addon['app']
unless confirmed_apps.include?(app['name'])
return unless confirm_command(app['name'])
confirmed_apps << app['name']
end
addon_attachments = get_attachments(:resource => addon['id'])
action("Destroying #{addon['name']} on #{app['name']}") do
addon = api.request(
:body => json_encode({
"force" => options[:force] || ENV['HEROKU_FORCE'] == '1',
}),
:expects => 200..300,
:headers => {
"Accept" => "application/vnd.heroku+json; version=3",
"Accept-Expansion" => "plan"
},
:method => :delete,
:path => "/apps/#{app['id']}/addons/#{addon['id']}"
).body
@status = "(#{format_price addon['plan']['price']})" if addon['plan'].has_key?('price')
end
if addon['config_vars'].any? # litmus test for whether the add-on's attachments have vars
# For each app that had an attachment, output a message indicating that
# the app has been restarted any any associated vars have been removed.
addon_attachments.group_by { |att| att['app']['name'] }.each do |app, attachments|
names = attachments.map { |att| att['name'] }.join(', ')
action("Removing vars for #{names} from #{app} and restarting") {
@status = api.get_release(app, 'current').body['name']
}
end
end
end
end | ruby | def destroy
if current_command == "addons:remove"
deprecate("`heroku #{current_command}` has been deprecated. Please use `heroku addons:destroy` instead.")
end
raise CommandFailed.new("Missing add-on name") if args.empty?
requires_preauth
confirmed_apps = []
while addon_name = args.shift
addon = resolve_addon!(addon_name)
app = addon['app']
unless confirmed_apps.include?(app['name'])
return unless confirm_command(app['name'])
confirmed_apps << app['name']
end
addon_attachments = get_attachments(:resource => addon['id'])
action("Destroying #{addon['name']} on #{app['name']}") do
addon = api.request(
:body => json_encode({
"force" => options[:force] || ENV['HEROKU_FORCE'] == '1',
}),
:expects => 200..300,
:headers => {
"Accept" => "application/vnd.heroku+json; version=3",
"Accept-Expansion" => "plan"
},
:method => :delete,
:path => "/apps/#{app['id']}/addons/#{addon['id']}"
).body
@status = "(#{format_price addon['plan']['price']})" if addon['plan'].has_key?('price')
end
if addon['config_vars'].any? # litmus test for whether the add-on's attachments have vars
# For each app that had an attachment, output a message indicating that
# the app has been restarted any any associated vars have been removed.
addon_attachments.group_by { |att| att['app']['name'] }.each do |app, attachments|
names = attachments.map { |att| att['name'] }.join(', ')
action("Removing vars for #{names} from #{app} and restarting") {
@status = api.get_release(app, 'current').body['name']
}
end
end
end
end | [
"def",
"destroy",
"if",
"current_command",
"==",
"\"addons:remove\"",
"deprecate",
"(",
"\"`heroku #{current_command}` has been deprecated. Please use `heroku addons:destroy` instead.\"",
")",
"end",
"raise",
"CommandFailed",
".",
"new",
"(",
"\"Missing add-on name\"",
")",
"if",... | addons:destroy ADDON_NAME [ADDON_NAME ...]
destroy add-on resources
-f, --force # allow destruction even if add-on is attached to other apps | [
"addons",
":",
"destroy",
"ADDON_NAME",
"[",
"ADDON_NAME",
"...",
"]"
] | 6f18521a258394bfb79e6b36f7160ad8559a8e16 | https://github.com/heroku/legacy-cli/blob/6f18521a258394bfb79e6b36f7160ad8559a8e16/lib/heroku/command/addons.rb#L291-L339 | train | Destroy an add - on | [
30522,
13366,
6033,
2065,
2783,
1035,
3094,
1027,
1027,
1000,
5587,
5644,
1024,
6366,
1000,
2139,
28139,
16280,
1006,
1000,
1036,
5394,
5283,
1001,
1063,
2783,
1035,
3094,
1065,
1036,
2038,
2042,
2139,
28139,
12921,
1012,
3531,
2224,
1036,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
markdownlint/markdownlint | lib/mdl/doc.rb | MarkdownLint.Doc.find_type_elements | def find_type_elements(type, nested=true, elements=@elements)
results = []
if type.class == Symbol
type = [type]
end
elements.each do |e|
results.push(e) if type.include?(e.type)
if nested and not e.children.empty?
results.concat(find_type_elements(type, nested, e.children))
end
end
results
end | ruby | def find_type_elements(type, nested=true, elements=@elements)
results = []
if type.class == Symbol
type = [type]
end
elements.each do |e|
results.push(e) if type.include?(e.type)
if nested and not e.children.empty?
results.concat(find_type_elements(type, nested, e.children))
end
end
results
end | [
"def",
"find_type_elements",
"(",
"type",
",",
"nested",
"=",
"true",
",",
"elements",
"=",
"@elements",
")",
"results",
"=",
"[",
"]",
"if",
"type",
".",
"class",
"==",
"Symbol",
"type",
"=",
"[",
"type",
"]",
"end",
"elements",
".",
"each",
"do",
"... | Find all elements of a given type, returning a list of the element
objects themselves.
Instead of a single type, a list of types can be provided instead to
find all types.
If +nested+ is set to false, this returns only top level elements of a
given type. | [
"Find",
"all",
"elements",
"of",
"a",
"given",
"type",
"returning",
"a",
"list",
"of",
"the",
"element",
"objects",
"themselves",
"."
] | a9e80fcf3989d73b654b00bb2225a00be53983e8 | https://github.com/markdownlint/markdownlint/blob/a9e80fcf3989d73b654b00bb2225a00be53983e8/lib/mdl/doc.rb#L86-L98 | train | Find all elements of a given type | [
30522,
13366,
2424,
1035,
2828,
1035,
3787,
1006,
2828,
1010,
9089,
2098,
1027,
2995,
1010,
3787,
1027,
1030,
3787,
1007,
3463,
1027,
1031,
1033,
2065,
2828,
1012,
2465,
1027,
1027,
6454,
2828,
1027,
1031,
2828,
1033,
2203,
3787,
1012,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.Page.permalink | def permalink
return nil if data.nil? || data['permalink'].nil?
if site.config['relative_permalinks']
File.join(@dir, data['permalink'])
else
# Look if there's a permalink overwrite specified for this lang
data['permalink_'+site.config['lang']] || data['permalink']
end
end | ruby | def permalink
return nil if data.nil? || data['permalink'].nil?
if site.config['relative_permalinks']
File.join(@dir, data['permalink'])
else
# Look if there's a permalink overwrite specified for this lang
data['permalink_'+site.config['lang']] || data['permalink']
end
end | [
"def",
"permalink",
"return",
"nil",
"if",
"data",
".",
"nil?",
"||",
"data",
"[",
"'permalink'",
"]",
".",
"nil?",
"if",
"site",
".",
"config",
"[",
"'relative_permalinks'",
"]",
"File",
".",
"join",
"(",
"@dir",
",",
"data",
"[",
"'permalink'",
"]",
... | ======================================
permalink
====================================== | [
"======================================",
"permalink",
"======================================"
] | 85e0e7972e6a4f94d5e7ab470ff0360905e11e4a | https://github.com/Anthony-Gaudino/jekyll-multiple-languages-plugin/blob/85e0e7972e6a4f94d5e7ab470ff0360905e11e4a/lib/jekyll-multiple-languages-plugin.rb#L202-L212 | train | Returns the permalink object for this page | [
30522,
13366,
2566,
9067,
19839,
2709,
9152,
2140,
2065,
2951,
1012,
9152,
2140,
1029,
1064,
1064,
2951,
1031,
1005,
2566,
9067,
19839,
1005,
1033,
1012,
9152,
2140,
1029,
2065,
2609,
1012,
9530,
8873,
2290,
1031,
1005,
5816,
1035,
2566,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.get_hierarchical_entity_child | def get_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil)
response = get_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, custom_headers:nil)
response = get_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_hierarchical_entity_child",
"(",
"app_id",
",",
"version_id",
",",
"h_entity_id",
",",
"h_child_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_hierarchical_entity_child_async",
"(",
"app_id",
",",
"version_id",
",",
"h_entity_id",
",",
... | Gets information about the child's model contained in an hierarchical entity
child model in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param h_entity_id The hierarchical entity extractor ID.
@param h_child_id The hierarchical entity extractor child ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [HierarchicalChildEntity] operation results. | [
"Gets",
"information",
"about",
"the",
"child",
"s",
"model",
"contained",
"in",
"an",
"hierarchical",
"entity",
"child",
"model",
"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#L4987-L4990 | train | Gets the hierarchical entity child of the entity. | [
30522,
13366,
2131,
1035,
25835,
1035,
9178,
1035,
2775,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
1044,
1035,
9178,
1035,
8909,
1010,
1044,
1035,
2775,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_links/lib/2016-09-01/generated/azure_mgmt_links/resource_links.rb | Azure::Links::Mgmt::V2016_09_01.ResourceLinks.list_at_subscription_next | def list_at_subscription_next(next_page_link, custom_headers:nil)
response = list_at_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_at_subscription_next(next_page_link, custom_headers:nil)
response = list_at_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_at_subscription_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_at_subscription_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",... | Gets all the linked resources for the subscription.
@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 [ResourceLinkResult] operation results. | [
"Gets",
"all",
"the",
"linked",
"resources",
"for",
"the",
"subscription",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_links/lib/2016-09-01/generated/azure_mgmt_links/resource_links.rb#L541-L544 | train | Gets the list of the elastic advisors. | [
30522,
13366,
2862,
1035,
2012,
1035,
15002,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2012,
1035,
15002,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
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... |
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_services_event_list | def get_services_event_list(start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
response = get_services_event_list_async(start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_services_event_list(start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
response = get_services_event_list_async(start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_services_event_list",
"(",
"start_time_utc",
",",
"end_time_utc",
",",
"timeout",
":",
"60",
",",
"events_types_filter",
":",
"nil",
",",
"exclude_analysis_events",
":",
"nil",
",",
"skip_correlation_lookup",
":",
"nil",
",",
"custom_headers",
":",
"nil"... | Gets all Services-related events.
The response is list of ServiceEvent objects.
@param start_time_utc [String] The start time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param end_time_utc [String] The end time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param events_types_filter [String] This is a comma separated string
specifying the types of FabricEvents that should only be included in the
response.
@param exclude_analysis_events [Boolean] This param disables the retrieval of
AnalysisEvents if true is passed.
@param skip_correlation_lookup [Boolean] This param disables the search of
CorrelatedEvents information if true is passed. otherwise the
CorrelationEvents get processed and HasCorrelatedEvents field in every
FabricEvent gets populated.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Gets",
"all",
"Services",
"-",
"related",
"events",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L28372-L28375 | train | Gets the list of services events. | [
30522,
13366,
2131,
1035,
2578,
1035,
2724,
1035,
2862,
1006,
2707,
1035,
2051,
1035,
11396,
1010,
2203,
1035,
2051,
1035,
11396,
1010,
2051,
5833,
1024,
3438,
1010,
2824,
1035,
4127,
1035,
11307,
1024,
9152,
2140,
1010,
23329,
1035,
4106,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mojombo/chronic | lib/chronic/handlers.rb | Chronic.Handlers.handle_sd_rmn_sy | def handle_sd_rmn_sy(tokens, options)
new_tokens = [tokens[1], tokens[0], tokens[2]]
time_tokens = tokens.last(tokens.size - 3)
handle_rmn_sd_sy(new_tokens + time_tokens, options)
end | ruby | def handle_sd_rmn_sy(tokens, options)
new_tokens = [tokens[1], tokens[0], tokens[2]]
time_tokens = tokens.last(tokens.size - 3)
handle_rmn_sd_sy(new_tokens + time_tokens, options)
end | [
"def",
"handle_sd_rmn_sy",
"(",
"tokens",
",",
"options",
")",
"new_tokens",
"=",
"[",
"tokens",
"[",
"1",
"]",
",",
"tokens",
"[",
"0",
"]",
",",
"tokens",
"[",
"2",
"]",
"]",
"time_tokens",
"=",
"tokens",
".",
"last",
"(",
"tokens",
".",
"size",
... | Handle scalar-day/repeater-month-name/scalar-year | [
"Handle",
"scalar",
"-",
"day",
"/",
"repeater",
"-",
"month",
"-",
"name",
"/",
"scalar",
"-",
"year"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L207-L211 | train | Handle the RMN sy | [
30522,
13366,
5047,
1035,
17371,
1035,
28549,
2078,
1035,
25353,
1006,
19204,
2015,
1010,
7047,
1007,
2047,
1035,
19204,
2015,
1027,
1031,
19204,
2015,
1031,
1015,
1033,
1010,
19204,
2015,
1031,
1014,
1033,
1010,
19204,
2015,
1031,
1016,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-04-01/generated/azure_mgmt_network/express_route_cross_connections.rb | Azure::Network::Mgmt::V2018_04_01.ExpressRouteCrossConnections.begin_list_routes_table_with_http_info | def begin_list_routes_table_with_http_info(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
end | ruby | def begin_list_routes_table_with_http_info(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value!
end | [
"def",
"begin_list_routes_table_with_http_info",
"(",
"resource_group_name",
",",
"cross_connection_name",
",",
"peering_name",
",",
"device_path",
",",
"custom_headers",
":",
"nil",
")",
"begin_list_routes_table_async",
"(",
"resource_group_name",
",",
"cross_connection_name",... | Gets the currently advertised routes table associated with the express route
cross connection in a resource group.
@param resource_group_name [String] The name of the resource group.
@param cross_connection_name [String] The name of the
ExpressRouteCrossConnection.
@param peering_name [String] The name of the peering.
@param device_path [String] The path of the device.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"currently",
"advertised",
"routes",
"table",
"associated",
"with",
"the",
"express",
"route",
"cross",
"connection",
"in",
"a",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-04-01/generated/azure_mgmt_network/express_route_cross_connections.rb#L997-L999 | train | Gets the route table associated with the express route cross connection. | [
30522,
13366,
4088,
1035,
2862,
1035,
5847,
1035,
2795,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2892,
1035,
4434,
1035,
2171,
1010,
16740,
1035,
2171,
1010,
5080,
1035,
4130,
1010,
7661,
1035,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb | Azure::CognitiveServices::ContentModerator::V1_0.Reviews.create_video_reviews | def create_video_reviews(content_type, team_name, create_video_reviews_body, sub_team:nil, custom_headers:nil)
response = create_video_reviews_async(content_type, team_name, create_video_reviews_body, sub_team:sub_team, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_video_reviews(content_type, team_name, create_video_reviews_body, sub_team:nil, custom_headers:nil)
response = create_video_reviews_async(content_type, team_name, create_video_reviews_body, sub_team:sub_team, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_video_reviews",
"(",
"content_type",
",",
"team_name",
",",
"create_video_reviews_body",
",",
"sub_team",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_video_reviews_async",
"(",
"content_type",
",",
"team_name",
",",
"c... | The reviews created would show up for Reviewers on your team. As Reviewers
complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on
the specified CallBackEndpoint.
<h3>CallBack Schemas </h3>
<h4>Review Completion CallBack Sample</h4>
<p>
{<br/>
"ReviewId": "<Review Id>",<br/>
"ModifiedOn": "2016-10-11T22:36:32.9934851Z",<br/>
"ModifiedBy": "<Name of the Reviewer>",<br/>
"CallBackType": "Review",<br/>
"ContentId": "<The ContentId that was specified input>",<br/>
"Metadata": {<br/>
"adultscore": "0.xxx",<br/>
"a": "False",<br/>
"racyscore": "0.xxx",<br/>
"r": "True"<br/>
},<br/>
"ReviewerResultTags": {<br/>
"a": "False",<br/>
"r": "True"<br/>
}<br/>
}<br/>
</p>.
@param content_type [String] The content type.
@param team_name [String] Your team name.
@param create_video_reviews_body [Array<CreateVideoReviewsBodyItem>] Body for
create reviews API
@param sub_team [String] SubTeam of your team, you want to assign the created
review to.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"The",
"reviews",
"created",
"would",
"show",
"up",
"for",
"Reviewers",
"on",
"your",
"team",
".",
"As",
"Reviewers",
"complete",
"reviewing",
"results",
"of",
"the",
"Review",
"would",
"be",
"POSTED",
"(",
"i",
".",
"e",
".",
"HTTP",
"POST",
")",
"on",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb#L1393-L1396 | train | Creates a video review for the specified video. | [
30522,
13366,
3443,
1035,
2678,
1035,
4391,
1006,
4180,
1035,
2828,
1010,
2136,
1035,
2171,
1010,
3443,
1035,
2678,
1035,
4391,
1035,
2303,
1010,
4942,
1035,
2136,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_cluster_health_with_http_info | def get_cluster_health_with_http_info(nodes_health_state_filter:0, applications_health_state_filter:0, events_health_state_filter:0, exclude_health_statistics:false, include_system_application_health_statistics:false, timeout:60, custom_headers:nil)
get_cluster_health_async(nodes_health_state_filter:nodes_health_state_filter, applications_health_state_filter:applications_health_state_filter, events_health_state_filter:events_health_state_filter, exclude_health_statistics:exclude_health_statistics, include_system_application_health_statistics:include_system_application_health_statistics, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_cluster_health_with_http_info(nodes_health_state_filter:0, applications_health_state_filter:0, events_health_state_filter:0, exclude_health_statistics:false, include_system_application_health_statistics:false, timeout:60, custom_headers:nil)
get_cluster_health_async(nodes_health_state_filter:nodes_health_state_filter, applications_health_state_filter:applications_health_state_filter, events_health_state_filter:events_health_state_filter, exclude_health_statistics:exclude_health_statistics, include_system_application_health_statistics:include_system_application_health_statistics, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_cluster_health_with_http_info",
"(",
"nodes_health_state_filter",
":",
"0",
",",
"applications_health_state_filter",
":",
"0",
",",
"events_health_state_filter",
":",
"0",
",",
"exclude_health_statistics",
":",
"false",
",",
"include_system_application_health_statis... | Gets the health of a Service Fabric cluster.
Gets the health of a Service Fabric cluster.
Use EventsHealthStateFilter to filter the collection of health events
reported on the cluster based on the health state.
Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to
filter the collection of nodes and applications returned based on their
aggregated health state.
@param nodes_health_state_filter [Integer] Allows filtering of the node
health state objects returned in the result of cluster health query
based on their health state. The possible values for this parameter include
integer value of one of the
following health states. Only nodes that match the filter are returned. All
nodes are used to evaluate the aggregated health state.
If not specified, all entries are returned.
The state values are flag based enumeration, so the value could be a
combination of these values obtained using bitwise 'OR' operator.
For example, if the provided value is 6 then health state of nodes with
HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param applications_health_state_filter [Integer] Allows filtering of the
application health state objects returned in the result of cluster health
query based on their health state.
The possible values for this parameter include integer value obtained from
members or bitwise operations
on members of HealthStateFilter enumeration. Only applications that match the
filter are returned.
All applications are used to evaluate the aggregated health state. If not
specified, all entries are returned.
The state values are flag based enumeration, so the value could be a
combination of these values obtained using bitwise 'OR' operator.
For example, if the provided value is 6 then health state of applications
with HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param events_health_state_filter [Integer] Allows filtering the collection
of HealthEvent objects returned based on health state.
The possible values for this parameter include integer value of one of the
following health states.
Only events that match the filter are returned. All events are used to
evaluate the aggregated health state.
If not specified, all entries are returned. The state values are flag based
enumeration, so the value could be a combination of these value obtained
using bitwise 'OR' operator. For example, If the provided value is 6 then all
of the events with HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param exclude_health_statistics [Boolean] Indicates whether the health
statistics should be returned as part of the query result. False by default.
The statistics show the number of children entities in health state Ok,
Warning, and Error.
@param include_system_application_health_statistics [Boolean] Indicates
whether the health statistics should include the fabric:/System application
health statistics. False by default.
If IncludeSystemApplicationHealthStatistics is set to true, the health
statistics include the entities that belong to the fabric:/System
application.
Otherwise, the query result includes health statistics only for user
applications.
The health statistics must be included in the query result for this parameter
to be applied.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"health",
"of",
"a",
"Service",
"Fabric",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L452-L454 | train | Gets cluster health of the specified App Service Environment. | [
30522,
13366,
2131,
1035,
9324,
1035,
2740,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
14164,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
5097,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
2824,
1035,
2740,
1035,
2110,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/instance.rb | Aws::EC2.Instance.monitor | def monitor(options = {})
options = Aws::Util.deep_merge(options, instance_ids: [@id])
resp = @client.monitor_instances(options)
resp.data
end | ruby | def monitor(options = {})
options = Aws::Util.deep_merge(options, instance_ids: [@id])
resp = @client.monitor_instances(options)
resp.data
end | [
"def",
"monitor",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"Aws",
"::",
"Util",
".",
"deep_merge",
"(",
"options",
",",
"instance_ids",
":",
"[",
"@id",
"]",
")",
"resp",
"=",
"@client",
".",
"monitor_instances",
"(",
"options",
")",
"resp",... | @example Request syntax with placeholder values
instance.monitor({
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::MonitorInstancesResult] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/instance.rb#L937-L941 | train | Monitor the instances | [
30522,
13366,
8080,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
22091,
2015,
1024,
1024,
21183,
4014,
1012,
2784,
1035,
13590,
1006,
7047,
1010,
6013,
1035,
8909,
2015,
1024,
1031,
1030,
8909,
1033,
1007,
24501,
2361,
1027,
1030,
7396,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/resource.rb | Aws::AutoScaling.Resource.create_launch_configuration | def create_launch_configuration(options = {})
resp = @client.create_launch_configuration(options)
LaunchConfiguration.new(
name: options[:launch_configuration_name],
client: @client
)
end | ruby | def create_launch_configuration(options = {})
resp = @client.create_launch_configuration(options)
LaunchConfiguration.new(
name: options[:launch_configuration_name],
client: @client
)
end | [
"def",
"create_launch_configuration",
"(",
"options",
"=",
"{",
"}",
")",
"resp",
"=",
"@client",
".",
"create_launch_configuration",
"(",
"options",
")",
"LaunchConfiguration",
".",
"new",
"(",
"name",
":",
"options",
"[",
":launch_configuration_name",
"]",
",",
... | @example Request syntax with placeholder values
launchconfiguration = auto_scaling.create_launch_configuration({
launch_configuration_name: "XmlStringMaxLen255", # required
image_id: "XmlStringMaxLen255",
key_name: "XmlStringMaxLen255",
security_groups: ["XmlString"],
classic_link_vpc_id: "XmlStringMaxLen255",
classic_link_vpc_security_groups: ["XmlStringMaxLen255"],
user_data: "XmlStringUserData",
instance_id: "XmlStringMaxLen19",
instance_type: "XmlStringMaxLen255",
kernel_id: "XmlStringMaxLen255",
ramdisk_id: "XmlStringMaxLen255",
block_device_mappings: [
{
virtual_name: "XmlStringMaxLen255",
device_name: "XmlStringMaxLen255", # required
ebs: {
snapshot_id: "XmlStringMaxLen255",
volume_size: 1,
volume_type: "BlockDeviceEbsVolumeType",
delete_on_termination: false,
iops: 1,
encrypted: false,
},
no_device: false,
},
],
instance_monitoring: {
enabled: false,
},
spot_price: "SpotPrice",
iam_instance_profile: "XmlStringMaxLen1600",
ebs_optimized: false,
associate_public_ip_address: false,
placement_tenancy: "XmlStringMaxLen64",
})
@param [Hash] options ({})
@option options [required, String] :launch_configuration_name
The name of the launch configuration. This name must be unique within
the scope of your AWS account.
@option options [String] :image_id
The ID of the Amazon Machine Image (AMI) to use to launch your EC2
instances.
If you do not specify `InstanceId`, you must specify `ImageId`.
For more information, see [Finding an AMI][1] in the *Amazon EC2 User
Guide for Linux Instances*.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/finding-an-ami.html
@option options [String] :key_name
The name of the key pair. For more information, see [Amazon EC2 Key
Pairs][1] in the *Amazon EC2 User Guide for Linux Instances*.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html
@option options [Array<String>] :security_groups
One or more security groups with which to associate the instances.
If your instances are launched in EC2-Classic, you can either specify
security group names or the security group IDs. For more information,
see [Amazon EC2 Security Groups][1] in the *Amazon EC2 User Guide for
Linux Instances*.
If your instances are launched into a VPC, specify security group IDs.
For more information, see [Security Groups for Your VPC][2] in the
*Amazon Virtual Private Cloud User Guide*.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html
[2]: https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html
@option options [String] :classic_link_vpc_id
The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances
to. This parameter is supported only if you are launching EC2-Classic
instances. For more information, see [ClassicLink][1] in the *Amazon
EC2 User Guide for Linux Instances* and [Linking EC2-Classic Instances
to a VPC][2] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html
[2]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink
@option options [Array<String>] :classic_link_vpc_security_groups
The IDs of one or more security groups for the specified
ClassicLink-enabled VPC. For more information, see [ClassicLink][1] in
the *Amazon EC2 User Guide for Linux Instances* and [Linking
EC2-Classic Instances to a VPC][2] in the *Amazon EC2 Auto Scaling
User Guide*.
Conditional: This parameter is required if you specify a
ClassicLink-enabled VPC, and is not supported otherwise.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html
[2]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-ClassicLink
@option options [String] :user_data
The user data to make available to the launched EC2 instances. For
more information, see [Instance Metadata and User Data][1] in the
*Amazon EC2 User Guide for Linux Instances*.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html
@option options [String] :instance_id
The ID of the instance to use to create the launch configuration. The
new launch configuration derives attributes from the instance, except
for the block device mapping.
If you do not specify `InstanceId`, you must specify both `ImageId`
and `InstanceType`.
To create a launch configuration with a block device mapping or
override any other instance attributes, specify them as part of the
same request.
For more information, see [Create a Launch Configuration Using an EC2
Instance][1] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-lc-with-instanceID.html
@option options [String] :instance_type
The instance type of the EC2 instance.
If you do not specify `InstanceId`, you must specify `InstanceType`.
For information about available instance types, see [Available
Instance Types][1] in the *Amazon EC2 User Guide for Linux Instances.*
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#AvailableInstanceTypes
@option options [String] :kernel_id
The ID of the kernel associated with the AMI.
@option options [String] :ramdisk_id
The ID of the RAM disk associated with the AMI.
@option options [Array<Types::BlockDeviceMapping>] :block_device_mappings
One or more mappings that specify how block devices are exposed to the
instance. For more information, see [Block Device Mapping][1] in the
*Amazon EC2 User Guide for Linux Instances*.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html
@option options [Types::InstanceMonitoring] :instance_monitoring
Enables detailed monitoring (`true`) or basic monitoring (`false`) for
the Auto Scaling instances. The default value is `true`.
@option options [String] :spot_price
The maximum hourly price to be paid for any Spot Instance launched to
fulfill the request. Spot Instances are launched when the price you
specify exceeds the current Spot market price. For more information,
see [Launching Spot Instances in Your Auto Scaling Group][1] in the
*Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html
@option options [String] :iam_instance_profile
The name or the Amazon Resource Name (ARN) of the instance profile
associated with the IAM role for the instance.
EC2 instances launched with an IAM role automatically have AWS
security credentials available. You can use IAM roles with Amazon EC2
Auto Scaling to automatically enable applications running on your EC2
instances to securely access other AWS resources. For more
information, see [Use an IAM Role for Applications That Run on Amazon
EC2 Instances][1] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/us-iam-role.html
@option options [Boolean] :ebs_optimized
Indicates whether the instance is optimized for Amazon EBS I/O. By
default, the instance is not optimized for EBS I/O. The optimization
provides dedicated throughput to Amazon EBS and an optimized
configuration stack to provide optimal I/O performance. This
optimization is not available with all instance types. Additional
usage charges apply. For more information, see [Amazon EBS-Optimized
Instances][1] in the *Amazon EC2 User Guide for Linux Instances*.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html
@option options [Boolean] :associate_public_ip_address
Used for groups that launch instances into a virtual private cloud
(VPC). Specifies whether to assign a public IP address to each
instance. For more information, see [Launching Auto Scaling Instances
in a VPC][1] in the *Amazon EC2 Auto Scaling User Guide*.
If you specify this parameter, be sure to specify at least one subnet
when you create your group.
Default: If the instance is launched into a default subnet, the
default is to assign a public IP address. If the instance is launched
into a nondefault subnet, the default is not to assign a public IP
address.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html
@option options [String] :placement_tenancy
The tenancy of the instance. An instance with a tenancy of `dedicated`
runs on single-tenant hardware and can only be launched into a VPC.
To launch Dedicated Instances into a shared tenancy VPC (a VPC with
the instance placement tenancy attribute set to `default`), you must
set the value of this parameter to `dedicated`.
If you specify this parameter, be sure to specify at least one subnet
when you create your group.
For more information, see [Launching Auto Scaling Instances in a
VPC][1] in the *Amazon EC2 Auto Scaling User Guide*.
Valid values: `default` \| `dedicated`
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html
@return [LaunchConfiguration] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/resource.rb#L513-L519 | train | Create a launch configuration | [
30522,
13366,
3443,
1035,
4888,
1035,
9563,
1006,
7047,
1027,
1063,
1065,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3443,
1035,
4888,
1035,
9563,
1006,
7047,
1007,
4888,
8663,
8873,
27390,
3370,
1012,
2047,
1006,
2171,
1024,
7047,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/xml_mini/rexml.rb | ActiveSupport.XmlMini_REXML.merge! | def merge!(hash, key, value)
if hash.has_key?(key)
if hash[key].instance_of?(Array)
hash[key] << value
else
hash[key] = [hash[key], value]
end
elsif value.instance_of?(Array)
hash[key] = [value]
else
hash[key] = value
end
hash
end | ruby | def merge!(hash, key, value)
if hash.has_key?(key)
if hash[key].instance_of?(Array)
hash[key] << value
else
hash[key] = [hash[key], value]
end
elsif value.instance_of?(Array)
hash[key] = [value]
else
hash[key] = value
end
hash
end | [
"def",
"merge!",
"(",
"hash",
",",
"key",
",",
"value",
")",
"if",
"hash",
".",
"has_key?",
"(",
"key",
")",
"if",
"hash",
"[",
"key",
"]",
".",
"instance_of?",
"(",
"Array",
")",
"hash",
"[",
"key",
"]",
"<<",
"value",
"else",
"hash",
"[",
"key"... | Adds a new key/value pair to an existing Hash. If the key to be added
already exists and the existing value associated with key is not
an Array, it will be wrapped in an Array. Then the new value is
appended to that Array.
hash::
Hash to add key/value pair to.
key::
Key to be added.
value::
Value to be associated with key. | [
"Adds",
"a",
"new",
"key",
"/",
"value",
"pair",
"to",
"an",
"existing",
"Hash",
".",
"If",
"the",
"key",
"to",
"be",
"added",
"already",
"exists",
"and",
"the",
"existing",
"value",
"associated",
"with",
"key",
"is",
"not",
"an",
"Array",
"it",
"will"... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/xml_mini/rexml.rb#L96-L109 | train | Merge the values of the hash with the value of the key. | [
30522,
13366,
13590,
999,
1006,
23325,
1010,
3145,
1010,
3643,
1007,
2065,
23325,
1012,
2038,
1035,
3145,
1029,
1006,
3145,
1007,
2065,
23325,
1031,
3145,
1033,
1012,
6013,
1035,
1997,
1029,
1006,
9140,
1007,
23325,
1031,
3145,
1033,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
GeorgeKaraszi/ActiveRecordExtended | lib/active_record_extended/utilities.rb | ActiveRecordExtended.Utilities.double_quote | def double_quote(value)
return if value.nil?
case value.to_s
# Ignore keys that contain double quotes or a Arel.star (*)[all columns]
# or if a table has already been explicitly declared (ex: users.id)
when "*", /((^".+"$)|(^[[:alpha:]]+\.[[:alnum:]]+))/
value
else
PG::Connection.quote_ident(value.to_s)
end
end | ruby | def double_quote(value)
return if value.nil?
case value.to_s
# Ignore keys that contain double quotes or a Arel.star (*)[all columns]
# or if a table has already been explicitly declared (ex: users.id)
when "*", /((^".+"$)|(^[[:alpha:]]+\.[[:alnum:]]+))/
value
else
PG::Connection.quote_ident(value.to_s)
end
end | [
"def",
"double_quote",
"(",
"value",
")",
"return",
"if",
"value",
".",
"nil?",
"case",
"value",
".",
"to_s",
"# Ignore keys that contain double quotes or a Arel.star (*)[all columns]",
"# or if a table has already been explicitly declared (ex: users.id)",
"when",
"\"*\"",
",",
... | Ensures the given value is properly double quoted.
This also ensures we don't have conflicts with reversed keywords.
IE: `user` is a reserved keyword in PG. But `"user"` is allowed and works the same
when used as an column/tbl alias. | [
"Ensures",
"the",
"given",
"value",
"is",
"properly",
"double",
"quoted",
".",
"This",
"also",
"ensures",
"we",
"don",
"t",
"have",
"conflicts",
"with",
"reversed",
"keywords",
"."
] | aca74eebb64b9957a2c8765bef6e43c7d5736fd8 | https://github.com/GeorgeKaraszi/ActiveRecordExtended/blob/aca74eebb64b9957a2c8765bef6e43c7d5736fd8/lib/active_record_extended/utilities.rb#L108-L119 | train | Double - quotes a value | [
30522,
13366,
3313,
1035,
14686,
1006,
3643,
1007,
2709,
2065,
3643,
1012,
9152,
2140,
1029,
2553,
3643,
1012,
2000,
1035,
1055,
1001,
8568,
6309,
2008,
5383,
3313,
16614,
2030,
1037,
2024,
2140,
1012,
2732,
1006,
1008,
1007,
1031,
2035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/images.rb | Azure::Compute::Mgmt::V2018_04_01.Images.begin_delete | def begin_delete(resource_group_name, image_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, image_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, image_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, image_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"image_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"image_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"... | Deletes an Image.
@param resource_group_name [String] The name of the resource group.
@param image_name [String] The name of the image.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"an",
"Image",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/images.rb#L663-L666 | train | Deletes an image. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3746,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_operational_insights/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/linked_services.rb | Azure::OperationalInsights::Mgmt::V2015_11_01_preview.LinkedServices.get_with_http_info | def get_with_http_info(resource_group_name, workspace_name, linked_service_name, custom_headers:nil)
get_async(resource_group_name, workspace_name, linked_service_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, workspace_name, linked_service_name, custom_headers:nil)
get_async(resource_group_name, workspace_name, linked_service_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"linked_service_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"linked_service_name",
",",
"custom_headers",
":custom_... | Gets a linked service instance.
@param resource_group_name [String] The name of the resource group to get.
The name is case insensitive.
@param workspace_name [String] Name of the Log Analytics Workspace that
contains the linkedServices resource
@param linked_service_name [String] Name of the linked service.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"a",
"linked",
"service",
"instance",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_operational_insights/lib/2015-11-01-preview/generated/azure_mgmt_operational_insights/linked_services.rb#L278-L280 | train | Gets the specified linked service s segmentation. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2573,
15327,
1035,
2171,
1010,
5799,
1035,
2326,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
6038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb | Azure::SQL::Mgmt::V2017_03_01_preview.JobExecutions.begin_create_with_http_info | def begin_create_with_http_info(resource_group_name, server_name, job_agent_name, job_name, custom_headers:nil)
begin_create_async(resource_group_name, server_name, job_agent_name, job_name, custom_headers:custom_headers).value!
end | ruby | def begin_create_with_http_info(resource_group_name, server_name, job_agent_name, job_name, custom_headers:nil)
begin_create_async(resource_group_name, server_name, job_agent_name, job_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"job_agent_name",
",",
"job_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"job_agent_name",
",",
"job_n... | Starts an elastic job execution.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param job_agent_name [String] The name of the job agent.
@param job_name [String] The name of the job to get.
@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. | [
"Starts",
"an",
"elastic",
"job",
"execution",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb#L653-L655 | train | Creates a new job in the specified resource group. | [
30522,
13366,
4088,
1035,
3443,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
3105,
1035,
4005,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/voice/voice_bot.rb | Discordrb::Voice.VoiceBot.play_internal | def play_internal
count = 0
@playing = true
# Default play length (ms), will be adjusted later
@length = IDEAL_LENGTH
self.speaking = true
loop do
# Starting from the tenth packet, perform length adjustment every 100 packets (2 seconds)
should_adjust_this_packet = (count % @adjust_interval == @adjust_offset)
# If we should adjust, start now
@length_adjust = Time.now.nsec if should_adjust_this_packet
break unless @playing
# If we should skip, get some data, discard it and go to the next iteration
if @skips.positive?
@skips -= 1
yield
next
end
# Track packet count, sequence and time (Discord requires this)
count += 1
increment_packet_headers
# Get packet data
buf = yield
# Stop doing anything if the stop signal was sent
break if buf == :stop
# Proceed to the next packet if we got nil
next unless buf
# Track intermediate adjustment so we can measure how much encoding contributes to the total time
@intermediate_adjust = Time.now.nsec if should_adjust_this_packet
# Send the packet
@udp.send_audio(buf, @sequence, @time)
# Set the stream time (for tracking how long we've been playing)
@stream_time = count * @length / 1000
if @length_override # Don't do adjustment because the user has manually specified an override value
@length = @length_override
elsif @length_adjust # Perform length adjustment
# Define the time once so it doesn't get inaccurate
now = Time.now.nsec
# Difference between length_adjust and now in ms
ms_diff = (now - @length_adjust) / 1_000_000.0
if ms_diff >= 0
@length = if @adjust_average
(IDEAL_LENGTH - ms_diff + @length) / 2.0
else
IDEAL_LENGTH - ms_diff
end
# Track the time it took to encode
encode_ms = (@intermediate_adjust - @length_adjust) / 1_000_000.0
@bot.debug("Length adjustment: new length #{@length} (measured #{ms_diff}, #{(100 * encode_ms) / ms_diff}% encoding)") if @adjust_debug
end
@length_adjust = nil
end
# If paused, wait
sleep 0.1 while @paused
if @length.positive?
# Wait `length` ms, then send the next packet
sleep @length / 1000.0
else
Discordrb::LOGGER.warn('Audio encoding and sending together took longer than Discord expects one packet to be (20 ms)! This may be indicative of network problems.')
end
end
@bot.debug('Sending five silent frames to clear out buffers')
5.times do
increment_packet_headers
@udp.send_audio(Encoder::OPUS_SILENCE, @sequence, @time)
# Length adjustments don't matter here, we can just wait 20 ms since nobody is going to hear it anyway
sleep IDEAL_LENGTH / 1000.0
end
@bot.debug('Performing final cleanup after stream ended')
# Final cleanup
stop_playing
# Notify any stop_playing methods running right now that we have actually stopped
@has_stopped_playing = true
end | ruby | def play_internal
count = 0
@playing = true
# Default play length (ms), will be adjusted later
@length = IDEAL_LENGTH
self.speaking = true
loop do
# Starting from the tenth packet, perform length adjustment every 100 packets (2 seconds)
should_adjust_this_packet = (count % @adjust_interval == @adjust_offset)
# If we should adjust, start now
@length_adjust = Time.now.nsec if should_adjust_this_packet
break unless @playing
# If we should skip, get some data, discard it and go to the next iteration
if @skips.positive?
@skips -= 1
yield
next
end
# Track packet count, sequence and time (Discord requires this)
count += 1
increment_packet_headers
# Get packet data
buf = yield
# Stop doing anything if the stop signal was sent
break if buf == :stop
# Proceed to the next packet if we got nil
next unless buf
# Track intermediate adjustment so we can measure how much encoding contributes to the total time
@intermediate_adjust = Time.now.nsec if should_adjust_this_packet
# Send the packet
@udp.send_audio(buf, @sequence, @time)
# Set the stream time (for tracking how long we've been playing)
@stream_time = count * @length / 1000
if @length_override # Don't do adjustment because the user has manually specified an override value
@length = @length_override
elsif @length_adjust # Perform length adjustment
# Define the time once so it doesn't get inaccurate
now = Time.now.nsec
# Difference between length_adjust and now in ms
ms_diff = (now - @length_adjust) / 1_000_000.0
if ms_diff >= 0
@length = if @adjust_average
(IDEAL_LENGTH - ms_diff + @length) / 2.0
else
IDEAL_LENGTH - ms_diff
end
# Track the time it took to encode
encode_ms = (@intermediate_adjust - @length_adjust) / 1_000_000.0
@bot.debug("Length adjustment: new length #{@length} (measured #{ms_diff}, #{(100 * encode_ms) / ms_diff}% encoding)") if @adjust_debug
end
@length_adjust = nil
end
# If paused, wait
sleep 0.1 while @paused
if @length.positive?
# Wait `length` ms, then send the next packet
sleep @length / 1000.0
else
Discordrb::LOGGER.warn('Audio encoding and sending together took longer than Discord expects one packet to be (20 ms)! This may be indicative of network problems.')
end
end
@bot.debug('Sending five silent frames to clear out buffers')
5.times do
increment_packet_headers
@udp.send_audio(Encoder::OPUS_SILENCE, @sequence, @time)
# Length adjustments don't matter here, we can just wait 20 ms since nobody is going to hear it anyway
sleep IDEAL_LENGTH / 1000.0
end
@bot.debug('Performing final cleanup after stream ended')
# Final cleanup
stop_playing
# Notify any stop_playing methods running right now that we have actually stopped
@has_stopped_playing = true
end | [
"def",
"play_internal",
"count",
"=",
"0",
"@playing",
"=",
"true",
"# Default play length (ms), will be adjusted later",
"@length",
"=",
"IDEAL_LENGTH",
"self",
".",
"speaking",
"=",
"true",
"loop",
"do",
"# Starting from the tenth packet, perform length adjustment every 100 p... | Plays the data from the @io stream as Discord requires it | [
"Plays",
"the",
"data",
"from",
"the"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/voice/voice_bot.rb#L297-L393 | train | Play the internal packet | [
30522,
13366,
2377,
1035,
4722,
4175,
1027,
1014,
1030,
2652,
1027,
2995,
1001,
12398,
2377,
3091,
1006,
5796,
1007,
1010,
2097,
2022,
10426,
2101,
1030,
3091,
1027,
7812,
1035,
3091,
2969,
1012,
4092,
1027,
2995,
7077,
2079,
1001,
3225,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ambethia/recaptcha | lib/recaptcha/client_helper.rb | Recaptcha.ClientHelper.invisible_recaptcha_tags | def invisible_recaptcha_tags(options = {})
options = {callback: 'invisibleRecaptchaSubmit', ui: :button}.merge options
text = options.delete(:text)
html, tag_attributes = Recaptcha::ClientHelper.recaptcha_components(options)
html << recaptcha_default_callback(options) if recaptcha_default_callback_required?(options)
case options[:ui]
when :button
html << %(<button type="submit" #{tag_attributes}>#{text}</button>\n)
when :invisible
html << %(<div data-size="invisible" #{tag_attributes}></div>\n)
when :input
html << %(<input type="submit" #{tag_attributes} value="#{text}"/>\n)
else
raise(RecaptchaError, "ReCAPTCHA ui `#{options[:ui]}` is not valid.")
end
html.respond_to?(:html_safe) ? html.html_safe : html
end | ruby | def invisible_recaptcha_tags(options = {})
options = {callback: 'invisibleRecaptchaSubmit', ui: :button}.merge options
text = options.delete(:text)
html, tag_attributes = Recaptcha::ClientHelper.recaptcha_components(options)
html << recaptcha_default_callback(options) if recaptcha_default_callback_required?(options)
case options[:ui]
when :button
html << %(<button type="submit" #{tag_attributes}>#{text}</button>\n)
when :invisible
html << %(<div data-size="invisible" #{tag_attributes}></div>\n)
when :input
html << %(<input type="submit" #{tag_attributes} value="#{text}"/>\n)
else
raise(RecaptchaError, "ReCAPTCHA ui `#{options[:ui]}` is not valid.")
end
html.respond_to?(:html_safe) ? html.html_safe : html
end | [
"def",
"invisible_recaptcha_tags",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"{",
"callback",
":",
"'invisibleRecaptchaSubmit'",
",",
"ui",
":",
":button",
"}",
".",
"merge",
"options",
"text",
"=",
"options",
".",
"delete",
"(",
":text",
")",
"h... | Invisible reCAPTCHA implementation | [
"Invisible",
"reCAPTCHA",
"implementation"
] | fcac97960ce29ebd7473315d9ffe89dccce6615e | https://github.com/ambethia/recaptcha/blob/fcac97960ce29ebd7473315d9ffe89dccce6615e/lib/recaptcha/client_helper.rb#L51-L67 | train | Returns an array of HTML tags that are invisible in the recaptcha page. | [
30522,
13366,
8841,
1035,
28667,
9331,
10649,
2050,
1035,
22073,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
1063,
2655,
5963,
1024,
1005,
8841,
2890,
17695,
10649,
3022,
12083,
22930,
1005,
1010,
21318,
1024,
1024,
6462,
1065,
1012,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/stylesheet/styles.rb | Axlsx.Styles.parse_num_fmt_options | def parse_num_fmt_options(options={})
return if (options.keys & [:format_code, :num_fmt]).empty?
#When the user provides format_code - we always need to create a new numFmt object
#When the type is :dxf we always need to create a new numFmt object
if options[:format_code] || options[:type] == :dxf
#If this is a standard xf we pull from numFmts the highest current and increment for num_fmt
options[:num_fmt] ||= (@numFmts.map{ |num_fmt| num_fmt.numFmtId }.max + 1) if options[:type] != :dxf
numFmt = NumFmt.new(:numFmtId => options[:num_fmt] || 0, :formatCode=> options[:format_code].to_s)
options[:type] == :dxf ? numFmt : (numFmts << numFmt; numFmt.numFmtId)
else
options[:num_fmt]
end
end | ruby | def parse_num_fmt_options(options={})
return if (options.keys & [:format_code, :num_fmt]).empty?
#When the user provides format_code - we always need to create a new numFmt object
#When the type is :dxf we always need to create a new numFmt object
if options[:format_code] || options[:type] == :dxf
#If this is a standard xf we pull from numFmts the highest current and increment for num_fmt
options[:num_fmt] ||= (@numFmts.map{ |num_fmt| num_fmt.numFmtId }.max + 1) if options[:type] != :dxf
numFmt = NumFmt.new(:numFmtId => options[:num_fmt] || 0, :formatCode=> options[:format_code].to_s)
options[:type] == :dxf ? numFmt : (numFmts << numFmt; numFmt.numFmtId)
else
options[:num_fmt]
end
end | [
"def",
"parse_num_fmt_options",
"(",
"options",
"=",
"{",
"}",
")",
"return",
"if",
"(",
"options",
".",
"keys",
"&",
"[",
":format_code",
",",
":num_fmt",
"]",
")",
".",
"empty?",
"#When the user provides format_code - we always need to create a new numFmt object",
"... | Parses Style#add_style options for number formatting.
noop if neither :format_code or :num_format options are set.
@option options [Hash] A hash describing the :format_code and/or :num_fmt integer for the style.
@return [NumFmt|Integer] | [
"Parses",
"Style#add_style",
"options",
"for",
"number",
"formatting",
".",
"noop",
"if",
"neither",
":",
"format_code",
"or",
":",
"num_format",
"options",
"are",
"set",
"."
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/stylesheet/styles.rb#L346-L359 | train | Parse numFmt options | [
30522,
13366,
11968,
3366,
1035,
16371,
2213,
1035,
4718,
2102,
1035,
7047,
1006,
7047,
1027,
1063,
1065,
1007,
2709,
2065,
1006,
7047,
1012,
6309,
1004,
1031,
1024,
4289,
1035,
3642,
1010,
1024,
16371,
2213,
1035,
4718,
2102,
1033,
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... |
httprb/http | lib/http/response.rb | HTTP.Response.content_length | def content_length
# http://greenbytes.de/tech/webdav/rfc7230.html#rfc.section.3.3.3
# Clause 3: "If a message is received with both a Transfer-Encoding
# and a Content-Length header field, the Transfer-Encoding overrides the Content-Length.
return nil if @headers.include?(Headers::TRANSFER_ENCODING)
value = @headers[Headers::CONTENT_LENGTH]
return nil unless value
begin
Integer(value)
rescue ArgumentError
nil
end
end | ruby | def content_length
# http://greenbytes.de/tech/webdav/rfc7230.html#rfc.section.3.3.3
# Clause 3: "If a message is received with both a Transfer-Encoding
# and a Content-Length header field, the Transfer-Encoding overrides the Content-Length.
return nil if @headers.include?(Headers::TRANSFER_ENCODING)
value = @headers[Headers::CONTENT_LENGTH]
return nil unless value
begin
Integer(value)
rescue ArgumentError
nil
end
end | [
"def",
"content_length",
"# http://greenbytes.de/tech/webdav/rfc7230.html#rfc.section.3.3.3",
"# Clause 3: \"If a message is received with both a Transfer-Encoding",
"# and a Content-Length header field, the Transfer-Encoding overrides the Content-Length.",
"return",
"nil",
"if",
"@headers",
".",
... | Value of the Content-Length header.
@return [nil] if Content-Length was not given, or it's value was invalid
(not an integer, e.g. empty string or string with non-digits).
@return [Integer] otherwise | [
"Value",
"of",
"the",
"Content",
"-",
"Length",
"header",
"."
] | f37a10ea4fab3ee411907ea2e4251ddf0ca33a93 | https://github.com/httprb/http/blob/f37a10ea4fab3ee411907ea2e4251ddf0ca33a93/lib/http/response.rb#L103-L117 | train | Returns the length of the message in the message. | [
30522,
13366,
4180,
1035,
3091,
1001,
8299,
1024,
1013,
1013,
2665,
3762,
4570,
1012,
2139,
1013,
6627,
1013,
4773,
29045,
1013,
14645,
2581,
21926,
2692,
1012,
16129,
1001,
14645,
1012,
2930,
1012,
1017,
1012,
1017,
1012,
1017,
1001,
11075... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.delete_channel | def delete_channel(data)
channel = Channel.new(data, self)
server = channel.server
# Handle normal and private channels separately
if server
@channels.delete(channel.id)
server.delete_channel(channel.id)
elsif channel.pm?
@pm_channels.delete(channel.recipient.id)
elsif channel.group?
@channels.delete(channel.id)
end
end | ruby | def delete_channel(data)
channel = Channel.new(data, self)
server = channel.server
# Handle normal and private channels separately
if server
@channels.delete(channel.id)
server.delete_channel(channel.id)
elsif channel.pm?
@pm_channels.delete(channel.recipient.id)
elsif channel.group?
@channels.delete(channel.id)
end
end | [
"def",
"delete_channel",
"(",
"data",
")",
"channel",
"=",
"Channel",
".",
"new",
"(",
"data",
",",
"self",
")",
"server",
"=",
"channel",
".",
"server",
"# Handle normal and private channels separately",
"if",
"server",
"@channels",
".",
"delete",
"(",
"channel... | Internal handler for CHANNEL_DELETE | [
"Internal",
"handler",
"for",
"CHANNEL_DELETE"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L828-L841 | train | Delete a channel from the server | [
30522,
13366,
3972,
12870,
1035,
3149,
1006,
2951,
1007,
3149,
1027,
3149,
1012,
2047,
1006,
2951,
1010,
2969,
1007,
8241,
1027,
3149,
1012,
8241,
1001,
5047,
3671,
1998,
2797,
6833,
10329,
2065,
8241,
1030,
6833,
1012,
3972,
12870,
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... |
ruby-git/ruby-git | lib/git/base.rb | Git.Base.add_remote | def add_remote(name, url, opts = {})
url = url.repo.path if url.is_a?(Git::Base)
self.lib.remote_add(name, url, opts)
Git::Remote.new(self, name)
end | ruby | def add_remote(name, url, opts = {})
url = url.repo.path if url.is_a?(Git::Base)
self.lib.remote_add(name, url, opts)
Git::Remote.new(self, name)
end | [
"def",
"add_remote",
"(",
"name",
",",
"url",
",",
"opts",
"=",
"{",
"}",
")",
"url",
"=",
"url",
".",
"repo",
".",
"path",
"if",
"url",
".",
"is_a?",
"(",
"Git",
"::",
"Base",
")",
"self",
".",
"lib",
".",
"remote_add",
"(",
"name",
",",
"url"... | adds a new remote to this repository
url can be a git url or a Git::Base object if it's a local reference
@git.add_remote('scotts_git', 'git://repo.or.cz/rubygit.git')
@git.fetch('scotts_git')
@git.merge('scotts_git/master')
Options:
:fetch => true
:track => <branch_name> | [
"adds",
"a",
"new",
"remote",
"to",
"this",
"repository",
"url",
"can",
"be",
"a",
"git",
"url",
"or",
"a",
"Git",
"::",
"Base",
"object",
"if",
"it",
"s",
"a",
"local",
"reference"
] | 9bd4407c56068e1604f14a1b6c0c5a84868e6378 | https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/base.rb#L369-L373 | train | Add a remote to the repository | [
30522,
13366,
5587,
1035,
6556,
1006,
2171,
1010,
24471,
2140,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
24471,
2140,
1027,
24471,
2140,
1012,
16360,
2080,
1012,
4130,
2065,
24471,
2140,
1012,
2003,
1035,
1037,
1029,
1006,
21025,
2102,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/stylesheet/styles.rb | Axlsx.Styles.parse_fill_options | def parse_fill_options(options={})
return unless options[:bg_color]
color = Color.new(:rgb=>options[:bg_color])
dxf = options[:type] == :dxf
color_key = dxf ? :bgColor : :fgColor
pattern = PatternFill.new(:patternType =>:solid, color_key=>color)
fill = Fill.new(pattern)
dxf ? fill : fills << fill
end | ruby | def parse_fill_options(options={})
return unless options[:bg_color]
color = Color.new(:rgb=>options[:bg_color])
dxf = options[:type] == :dxf
color_key = dxf ? :bgColor : :fgColor
pattern = PatternFill.new(:patternType =>:solid, color_key=>color)
fill = Fill.new(pattern)
dxf ? fill : fills << fill
end | [
"def",
"parse_fill_options",
"(",
"options",
"=",
"{",
"}",
")",
"return",
"unless",
"options",
"[",
":bg_color",
"]",
"color",
"=",
"Color",
".",
"new",
"(",
":rgb",
"=>",
"options",
"[",
":bg_color",
"]",
")",
"dxf",
"=",
"options",
"[",
":type",
"]"... | parses add_style options for fills. If the options hash contains :type => :dxf we return a Fill object. If not, we return the index of the fill after being added to the fills collection.
@note noop if :bg_color is not specified in options
@option options [String] bg_color The rgb color to apply to the fill
@return [Fill|Integer] | [
"parses",
"add_style",
"options",
"for",
"fills",
".",
"If",
"the",
"options",
"hash",
"contains",
":",
"type",
"=",
">",
":",
"dxf",
"we",
"return",
"a",
"Fill",
"object",
".",
"If",
"not",
"we",
"return",
"the",
"index",
"of",
"the",
"fill",
"after",... | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/stylesheet/styles.rb#L296-L304 | train | Parse fill options | [
30522,
13366,
11968,
3366,
1035,
6039,
1035,
7047,
1006,
7047,
1027,
1063,
1065,
1007,
2709,
4983,
7047,
1031,
1024,
1038,
2290,
1035,
3609,
1033,
3609,
1027,
3609,
1012,
2047,
1006,
1024,
1054,
18259,
1027,
1028,
7047,
1031,
1024,
1038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/network_interface_ipconfigurations.rb | Azure::Network::Mgmt::V2018_07_01.NetworkInterfaceIPConfigurations.get_with_http_info | def get_with_http_info(resource_group_name, network_interface_name, ip_configuration_name, custom_headers:nil)
get_async(resource_group_name, network_interface_name, ip_configuration_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, network_interface_name, ip_configuration_name, custom_headers:nil)
get_async(resource_group_name, network_interface_name, ip_configuration_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"ip_configuration_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"network_interface_name",
",",
"ip_configuration_name",
",",
"custom_h... | Gets the specified network interface ip configuration.
@param resource_group_name [String] The name of the resource group.
@param network_interface_name [String] The name of the network interface.
@param ip_configuration_name [String] The name of the ip configuration name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"specified",
"network",
"interface",
"ip",
"configuration",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/network_interface_ipconfigurations.rb#L143-L145 | train | Gets the specified network interface ip configuration. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
8278,
1035,
2171,
1010,
12997,
1035,
9563,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-initiatives/app/models/decidim/initiative.rb | Decidim.Initiative.publish! | def publish!
return false if published?
update(
published_at: Time.current,
state: "published",
signature_start_date: Date.current,
signature_end_date: Date.current + Decidim::Initiatives.default_signature_time_period_length
)
end | ruby | def publish!
return false if published?
update(
published_at: Time.current,
state: "published",
signature_start_date: Date.current,
signature_end_date: Date.current + Decidim::Initiatives.default_signature_time_period_length
)
end | [
"def",
"publish!",
"return",
"false",
"if",
"published?",
"update",
"(",
"published_at",
":",
"Time",
".",
"current",
",",
"state",
":",
"\"published\"",
",",
"signature_start_date",
":",
"Date",
".",
"current",
",",
"signature_end_date",
":",
"Date",
".",
"cu... | Public: Publishes this initiative
Returns true if the record was properly saved, false otherwise. | [
"Public",
":",
"Publishes",
"this",
"initiative"
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-initiatives/app/models/decidim/initiative.rb#L218-L226 | train | Publish the object to the cluster. | [
30522,
13366,
10172,
999,
2709,
6270,
2065,
2405,
1029,
10651,
1006,
2405,
1035,
2012,
1024,
2051,
1012,
2783,
1010,
2110,
1024,
1000,
2405,
1000,
1010,
8085,
1035,
2707,
1035,
3058,
1024,
3058,
1012,
2783,
1010,
8085,
1035,
2203,
1035,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.execute_site_detector_with_http_info | def execute_site_detector_with_http_info(resource_group_name, site_name, detector_name, diagnostic_category, start_time:nil, end_time:nil, time_grain:nil, custom_headers:nil)
execute_site_detector_async(resource_group_name, site_name, detector_name, diagnostic_category, start_time:start_time, end_time:end_time, time_grain:time_grain, custom_headers:custom_headers).value!
end | ruby | def execute_site_detector_with_http_info(resource_group_name, site_name, detector_name, diagnostic_category, start_time:nil, end_time:nil, time_grain:nil, custom_headers:nil)
execute_site_detector_async(resource_group_name, site_name, detector_name, diagnostic_category, start_time:start_time, end_time:end_time, time_grain:time_grain, custom_headers:custom_headers).value!
end | [
"def",
"execute_site_detector_with_http_info",
"(",
"resource_group_name",
",",
"site_name",
",",
"detector_name",
",",
"diagnostic_category",
",",
"start_time",
":",
"nil",
",",
"end_time",
":",
"nil",
",",
"time_grain",
":",
"nil",
",",
"custom_headers",
":",
"nil... | Execute Detector
Execute Detector
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param detector_name [String] Detector Resource Name
@param diagnostic_category [String] Category Name
@param start_time [DateTime] Start Time
@param end_time [DateTime] End Time
@param time_grain [String] Time Grain
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Execute",
"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#L1283-L1285 | train | Executes a site detector. | [
30522,
13366,
15389,
1035,
2609,
1035,
19034,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
19034,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
2707,
1035,
2051,
1024,
9152,
2140,
1010,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rubocop-hq/rubocop | lib/rubocop/cached_data.rb | RuboCop.CachedData.deserialize_offenses | def deserialize_offenses(offenses)
source_buffer = Parser::Source::Buffer.new(@filename)
source_buffer.source = File.read(@filename, encoding: Encoding::UTF_8)
offenses.map! do |o|
location = Parser::Source::Range.new(source_buffer,
o['location']['begin_pos'],
o['location']['end_pos'])
Cop::Offense.new(o['severity'], location,
o['message'],
o['cop_name'], o['status'].to_sym)
end
end | ruby | def deserialize_offenses(offenses)
source_buffer = Parser::Source::Buffer.new(@filename)
source_buffer.source = File.read(@filename, encoding: Encoding::UTF_8)
offenses.map! do |o|
location = Parser::Source::Range.new(source_buffer,
o['location']['begin_pos'],
o['location']['end_pos'])
Cop::Offense.new(o['severity'], location,
o['message'],
o['cop_name'], o['status'].to_sym)
end
end | [
"def",
"deserialize_offenses",
"(",
"offenses",
")",
"source_buffer",
"=",
"Parser",
"::",
"Source",
"::",
"Buffer",
".",
"new",
"(",
"@filename",
")",
"source_buffer",
".",
"source",
"=",
"File",
".",
"read",
"(",
"@filename",
",",
"encoding",
":",
"Encodin... | Restore an offense object loaded from a JSON file. | [
"Restore",
"an",
"offense",
"object",
"loaded",
"from",
"a",
"JSON",
"file",
"."
] | 2a4f4f0fdac4e1bb25891fc312af2ea60c6aa2f0 | https://github.com/rubocop-hq/rubocop/blob/2a4f4f0fdac4e1bb25891fc312af2ea60c6aa2f0/lib/rubocop/cached_data.rb#L45-L56 | train | Deserialize the offenses from the file | [
30522,
13366,
4078,
11610,
3669,
4371,
1035,
25173,
1006,
25173,
1007,
3120,
1035,
17698,
1027,
11968,
8043,
1024,
1024,
3120,
1024,
1024,
17698,
1012,
2047,
1006,
1030,
5371,
18442,
1007,
3120,
1035,
17698,
1012,
3120,
1027,
5371,
1012,
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... |
roo-rb/roo | lib/roo/open_office.rb | Roo.OpenOffice.decrypt | def decrypt(content_entry, cipher)
# Zip::Entry.extract writes a 0-length file when trying
# to extract an encrypted stream, so we read the
# raw bytes based on the offset and lengths
decrypted = ''
File.open(@filename, 'rb') do |zipfile|
zipfile.seek(
content_entry.local_header_offset +
content_entry.calculate_local_header_size
)
total_to_read = content_entry.compressed_size
block_size = 4096
block_size = total_to_read if block_size > total_to_read
while (buffer = zipfile.read(block_size))
decrypted += cipher.update(buffer)
total_to_read -= buffer.length
break if total_to_read == 0
block_size = total_to_read if block_size > total_to_read
end
end
decrypted + cipher.final
end | ruby | def decrypt(content_entry, cipher)
# Zip::Entry.extract writes a 0-length file when trying
# to extract an encrypted stream, so we read the
# raw bytes based on the offset and lengths
decrypted = ''
File.open(@filename, 'rb') do |zipfile|
zipfile.seek(
content_entry.local_header_offset +
content_entry.calculate_local_header_size
)
total_to_read = content_entry.compressed_size
block_size = 4096
block_size = total_to_read if block_size > total_to_read
while (buffer = zipfile.read(block_size))
decrypted += cipher.update(buffer)
total_to_read -= buffer.length
break if total_to_read == 0
block_size = total_to_read if block_size > total_to_read
end
end
decrypted + cipher.final
end | [
"def",
"decrypt",
"(",
"content_entry",
",",
"cipher",
")",
"# Zip::Entry.extract writes a 0-length file when trying",
"# to extract an encrypted stream, so we read the",
"# raw bytes based on the offset and lengths",
"decrypted",
"=",
"''",
"File",
".",
"open",
"(",
"@filename",
... | Block decrypt raw bytes from the zip file based on the cipher | [
"Block",
"decrypt",
"raw",
"bytes",
"from",
"the",
"zip",
"file",
"based",
"on",
"the",
"cipher"
] | 4ec1104f0c3c2a29711c0c907371cd2be12bcc3c | https://github.com/roo-rb/roo/blob/4ec1104f0c3c2a29711c0c907371cd2be12bcc3c/lib/roo/open_office.rb#L368-L394 | train | Decrypts the content entry using the cipher | [
30522,
13366,
11703,
2854,
13876,
1006,
4180,
1035,
4443,
1010,
27715,
1007,
1001,
14101,
1024,
1024,
4443,
1012,
14817,
7009,
1037,
1014,
1011,
3091,
5371,
2043,
2667,
1001,
2000,
14817,
2019,
4372,
26775,
22571,
3064,
5460,
1010,
2061,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.get_azure_reachability_report | def get_azure_reachability_report(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_azure_reachability_report(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = get_azure_reachability_report_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_azure_reachability_report",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_azure_reachability_report_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
... | Gets the relative latency score for internet service providers from a
specified location to Azure regions.
@param resource_group_name [String] The name of the network watcher resource
group.
@param network_watcher_name [String] The name of the network watcher
resource.
@param parameters [AzureReachabilityReportParameters] Parameters that
determine Azure reachability report configuration.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [AzureReachabilityReport] operation results. | [
"Gets",
"the",
"relative",
"latency",
"score",
"for",
"internet",
"service",
"providers",
"from",
"a",
"specified",
"location",
"to",
"Azure",
"regions",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L1058-L1061 | train | Gets the current network reachability report. | [
30522,
13366,
2131,
1035,
24296,
1035,
3362,
8010,
1035,
3189,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
24296,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/racc | lib/racc/grammar_file_parser.rb | Racc.GrammarFileParser.parse_user_code | def parse_user_code
epilogue = @scanner.epilogue
return unless epilogue.text
epilogue.text.scan(/^----([^\n\r]*)(?:\n|\r\n|\r)(.*?)(?=^----|\Z)/m) do
label = canonical_label($~[1])
range = epilogue.slice($~.begin(2), $~.end(2))
add_user_code(label, range)
end
end | ruby | def parse_user_code
epilogue = @scanner.epilogue
return unless epilogue.text
epilogue.text.scan(/^----([^\n\r]*)(?:\n|\r\n|\r)(.*?)(?=^----|\Z)/m) do
label = canonical_label($~[1])
range = epilogue.slice($~.begin(2), $~.end(2))
add_user_code(label, range)
end
end | [
"def",
"parse_user_code",
"epilogue",
"=",
"@scanner",
".",
"epilogue",
"return",
"unless",
"epilogue",
".",
"text",
"epilogue",
".",
"text",
".",
"scan",
"(",
"/",
"\\n",
"\\r",
"\\n",
"\\r",
"\\n",
"\\r",
"\\Z",
"/m",
")",
"do",
"label",
"=",
"canonica... | User Code Block | [
"User",
"Code",
"Block"
] | d3244edfa11dd6e86e43f570c6444d41c7e3552a | https://github.com/ruby/racc/blob/d3244edfa11dd6e86e43f570c6444d41c7e3552a/lib/racc/grammar_file_parser.rb#L255-L263 | train | Parse the user code sequence | [
30522,
13366,
11968,
3366,
1035,
5310,
1035,
3642,
24297,
1027,
1030,
26221,
1012,
24297,
2709,
4983,
24297,
1012,
3793,
24297,
1012,
3793,
1012,
13594,
1006,
1013,
1034,
1011,
1011,
1011,
1011,
1006,
1031,
1034,
1032,
1050,
1032,
1054,
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-glacier/lib/aws-sdk-glacier/job.rb | Aws::Glacier.Job.get_output | def get_output(options = {}, &block)
options = options.merge(
account_id: @account_id,
vault_name: @vault_name,
job_id: @id
)
resp = @client.get_job_output(options, &block)
resp.data
end | ruby | def get_output(options = {}, &block)
options = options.merge(
account_id: @account_id,
vault_name: @vault_name,
job_id: @id
)
resp = @client.get_job_output(options, &block)
resp.data
end | [
"def",
"get_output",
"(",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"account_id",
":",
"@account_id",
",",
"vault_name",
":",
"@vault_name",
",",
"job_id",
":",
"@id",
")",
"resp",
"=",
"@client",
"... | @!group Actions
@example Request syntax with placeholder values
job.get_output({
range: "string",
})
@param [Hash] options ({})
@option options [String] :range
The range of bytes to retrieve from the output. For example, if you
want to download the first 1,048,576 bytes, specify the range as
`bytes=0-1048575`. By default, this operation downloads the entire
output.
If the job output is large, then you can use a range to retrieve a
portion of the output. This allows you to download the entire output
in smaller chunks of bytes. For example, suppose you have 1 GB of job
output you want to download and you decide to download 128 MB chunks
of data at a time, which is a total of eight Get Job Output requests.
You use the following process to download the job output:
1. Download a 128 MB chunk of output by specifying the appropriate
byte range. Verify that all 128 MB of data was received.
2. Along with the data, the response includes a SHA256 tree hash of
the payload. You compute the checksum of the payload on the client
and compare it with the checksum you received in the response to
ensure you received all the expected data.
3. Repeat steps 1 and 2 for all the eight 128 MB chunks of output
data, each time specifying the appropriate byte range.
4. After downloading all the parts of the job output, you have a list
of eight checksum values. Compute the tree hash of these values to
find the checksum of the entire output. Using the DescribeJob API,
obtain job information of the job that provided you the output.
The response includes the checksum of the entire archive stored in
Amazon Glacier. You compare this value with the checksum you
computed to ensure you have downloaded the entire archive content
with no errors.
@return [Types::GetJobOutputOutput] | [
"@!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/job.rb#L390-L398 | train | Get output data from the job | [
30522,
13366,
2131,
1035,
6434,
1006,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
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,
3105,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
excon/excon | lib/excon/connection.rb | Excon.Connection.requests | def requests(pipeline_params)
pipeline_params.each {|params| params.merge!(:pipeline => true, :persistent => true) }
pipeline_params.last.merge!(:persistent => @data[:persistent])
responses = pipeline_params.map do |params|
request(params)
end.map do |datum|
Excon::Response.new(response(datum)[:response])
end
if @data[:persistent]
if key = responses.last[:headers].keys.detect {|k| k.casecmp('Connection') == 0 }
if responses.last[:headers][key].casecmp('close') == 0
reset
end
end
else
reset
end
responses
end | ruby | def requests(pipeline_params)
pipeline_params.each {|params| params.merge!(:pipeline => true, :persistent => true) }
pipeline_params.last.merge!(:persistent => @data[:persistent])
responses = pipeline_params.map do |params|
request(params)
end.map do |datum|
Excon::Response.new(response(datum)[:response])
end
if @data[:persistent]
if key = responses.last[:headers].keys.detect {|k| k.casecmp('Connection') == 0 }
if responses.last[:headers][key].casecmp('close') == 0
reset
end
end
else
reset
end
responses
end | [
"def",
"requests",
"(",
"pipeline_params",
")",
"pipeline_params",
".",
"each",
"{",
"|",
"params",
"|",
"params",
".",
"merge!",
"(",
":pipeline",
"=>",
"true",
",",
":persistent",
"=>",
"true",
")",
"}",
"pipeline_params",
".",
"last",
".",
"merge!",
"("... | Sends the supplied requests to the destination host using pipelining.
@pipeline_params [Array<Hash>] pipeline_params An array of one or more optional params, override defaults set in Connection.new, see #request for details | [
"Sends",
"the",
"supplied",
"requests",
"to",
"the",
"destination",
"host",
"using",
"pipelining",
"."
] | d4975a8a5b49d5901a769b289fb5054a6d064f6d | https://github.com/excon/excon/blob/d4975a8a5b49d5901a769b289fb5054a6d064f6d/lib/excon/connection.rb#L305-L326 | train | Requests the given pipeline | [
30522,
13366,
11186,
1006,
13117,
1035,
11498,
5244,
1007,
13117,
1035,
11498,
5244,
1012,
2169,
1063,
1064,
11498,
5244,
1064,
11498,
5244,
1012,
13590,
999,
1006,
1024,
13117,
1027,
1028,
2995,
1010,
1024,
14516,
1027,
1028,
2995,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.