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::Rest... | 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::Rest... | [
"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
... | 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
... | [
"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 [Stri... | [
"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 proceedi... | [
"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?
... | 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?
... | [
"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 [WorkerPoo... | [
"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
w... | [
"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 ha... | [
"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 requ... | [
"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::Accountab... | 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::Accountab... | [
"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(... | 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(... | [
"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
... | [
"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 SERV... | 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 SERV... | [
"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 filt... | [
"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 i... | [
"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 ... | [
"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 ... | 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 ... | [
"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: "ContentDi... | [
"@!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)"
... | 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)"
... | [
"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[... | 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[... | [
"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!
... | 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!
... | [
"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] Nam... | [
"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 respon... | 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 respon... | [
"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 age... | [
"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 [G... | [
"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:c... | 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:c... | [
"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 [Str... | [
"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-persisten... | [
"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?
... | 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?
... | [
"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... | [
"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:... | 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:... | [
"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.
@para... | [
"@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
... | 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
... | [
"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_f... | 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_f... | [
"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 passwor... | [
"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: ["... | [
"@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 [St... | [
"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... | [
"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
conf... | [
"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... | 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... | [
"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{... | [
"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_cla... | 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_cla... | [
"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... | 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... | [
"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 ... | 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 ... | [
"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
... | [
"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/... | 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/... | [
"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
opt... | 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
opt... | [
"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 ... | [
"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
e... | 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
e... | [
"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 ... | [
"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... | 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... | [
"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 [GetCallbackUrlParame... | [
"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{St... | [
"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_JAVASC... | 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_JAVASC... | [
"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 l... | [
"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 instanc... | [
"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_na... | 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_na... | [
"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,... | 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,... | [
"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']
... | 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']
... | [
"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 ... | [
"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_anal... | 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_anal... | [
"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 timeou... | [
"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 pee... | [
"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":... | [
"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_... | 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_... | [
"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 nod... | [
"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... | [
"@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: "... | [
"@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
... | 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
... | [
"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 ... | [
"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
... | 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
... | [
"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.
@pa... | [
"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.... | [
"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 = (... | 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 = (... | [
"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_callba... | 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_callba... | [
"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] == :... | 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] == :... | [
"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_ENCO... | 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_ENCO... | [
"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)
... | 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)
... | [
"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 ? f... | 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 ? f... | [
"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 [... | [
"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 => Str... | [
"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, t... | 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, t... | [
"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
@pa... | [
"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']['b... | 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']['b... | [
"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... | 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... | [
"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 [AzureReachabilityReportP... | [
"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
`by... | [
"@!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(... | 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(... | [
"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.