repo stringclasses 237
values | path stringlengths 11 168 | func_name stringlengths 10 147 | original_string stringlengths 79 124k | language stringclasses 1
value | code stringlengths 79 124k | code_tokens listlengths 16 45.3k | docstring stringlengths 4 23.5k | docstring_tokens listlengths 1 452 | sha stringclasses 237
values | url stringlengths 95 268 | partition stringclasses 1
value | summary stringlengths 8 229 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb | Azure::Web::Mgmt::V2018_02_01.Recommendations.list_history_for_web_app_as_lazy | def list_history_for_web_app_as_lazy(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
response = list_history_for_web_app_async(resource_group_name, site_name, expired_only:expired_only, filter:filter, custom_headers:custom_headers).value!
unless response.nil?
page =... | ruby | def list_history_for_web_app_as_lazy(resource_group_name, site_name, expired_only:nil, filter:nil, custom_headers:nil)
response = list_history_for_web_app_async(resource_group_name, site_name, expired_only:expired_only, filter:filter, custom_headers:custom_headers).value!
unless response.nil?
page =... | [
"def",
"list_history_for_web_app_as_lazy",
"(",
"resource_group_name",
",",
"site_name",
",",
"expired_only",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_history_for_web_app_async",
"(",
"resource_group_name",
... | Get past recommendations for an app, optionally specified by the time range.
Get past recommendations for an app, optionally specified by the time range.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Name of the app.
@param expired_only [B... | [
"Get",
"past",
"recommendations",
"for",
"an",
"app",
"optionally",
"specified",
"by",
"the",
"time",
"range",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb#L1288-L1297 | train | Gets the history for the specified App Service Environment. | [
30522,
13366,
2862,
1035,
2381,
1035,
2005,
1035,
4773,
1035,
10439,
1035,
30524,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
13735,
1035,
2069,
1024,
13735,
1035,
2069,
1010,
11307,
1024,
11307,
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... |
refinery/refinerycms | core/app/helpers/refinery/site_bar_helper.rb | Refinery.SiteBarHelper.site_bar_switch_link | def site_bar_switch_link
link_to_if(admin?, t('.switch_to_your_website', site_bar_translate_locale_args),
refinery.root_path(site_bar_translate_locale_args),
'data-turbolinks' => false) do
link_to t('.switch_to_your_website_editor', site_bar_translate_loca... | ruby | def site_bar_switch_link
link_to_if(admin?, t('.switch_to_your_website', site_bar_translate_locale_args),
refinery.root_path(site_bar_translate_locale_args),
'data-turbolinks' => false) do
link_to t('.switch_to_your_website_editor', site_bar_translate_loca... | [
"def",
"site_bar_switch_link",
"link_to_if",
"(",
"admin?",
",",
"t",
"(",
"'.switch_to_your_website'",
",",
"site_bar_translate_locale_args",
")",
",",
"refinery",
".",
"root_path",
"(",
"site_bar_translate_locale_args",
")",
",",
"'data-turbolinks'",
"=>",
"false",
")... | Generates the link to determine where the site bar switch button returns to. | [
"Generates",
"the",
"link",
"to",
"determine",
"where",
"the",
"site",
"bar",
"switch",
"button",
"returns",
"to",
"."
] | 67f117f937c5264ec0aeabe8e7eac1d562c5bc7b | https://github.com/refinery/refinerycms/blob/67f117f937c5264ec0aeabe8e7eac1d562c5bc7b/core/app/helpers/refinery/site_bar_helper.rb#L5-L12 | train | Link to the site bar | [
30522,
13366,
2609,
1035,
3347,
1035,
6942,
1035,
4957,
4957,
1035,
2000,
1035,
2065,
1006,
4748,
10020,
1029,
1010,
1056,
1006,
1005,
1012,
6942,
1035,
2000,
1035,
2115,
1035,
4037,
1005,
1010,
2609,
1035,
3347,
1035,
17637,
1035,
2334,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_secret_versions_as_lazy | def get_secret_versions_as_lazy(vault_base_url, secret_name, maxresults:nil, custom_headers:nil)
first_page = get_secret_versions_as_lazy_as_lazy(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def get_secret_versions_as_lazy(vault_base_url, secret_name, maxresults:nil, custom_headers:nil)
first_page = get_secret_versions_as_lazy_as_lazy(vault_base_url, secret_name, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"get_secret_versions_as_lazy",
"(",
"vault_base_url",
",",
"secret_name",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"get_secret_versions_as_lazy_as_lazy",
"(",
"vault_base_url",
",",
"secret_name",
",",
"maxresults"... | List all versions of the specified secret.
The full secret identifier and attributes are provided in the response. No
values are returned for the secrets. This operations requires the
secrets/list permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param secr... | [
"List",
"all",
"versions",
"of",
"the",
"specified",
"secret",
"."
] | 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#L9908-L9911 | train | Gets the versions of the specified secret. | [
30522,
13366,
2131,
1035,
3595,
1035,
4617,
1035,
2004,
1035,
13971,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3595,
1035,
2171,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/data_validation.rb | Axlsx.DataValidation.to_xml_string | def to_xml_string(str = '')
valid_attributes = get_valid_attributes
str << '<dataValidation '
str << instance_values.map do |key, value|
'' << key << '="' << Axlsx.booleanize(value).to_s << '"' if (valid_attributes.include?(key.to_sym) && !CHILD_ELEMENTS.include?(key.to_sym))
end.join... | ruby | def to_xml_string(str = '')
valid_attributes = get_valid_attributes
str << '<dataValidation '
str << instance_values.map do |key, value|
'' << key << '="' << Axlsx.booleanize(value).to_s << '"' if (valid_attributes.include?(key.to_sym) && !CHILD_ELEMENTS.include?(key.to_sym))
end.join... | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"valid_attributes",
"=",
"get_valid_attributes",
"str",
"<<",
"'<dataValidation '",
"str",
"<<",
"instance_values",
".",
"map",
"do",
"|",
"key",
",",
"value",
"|",
"''",
"<<",
"key",
"<<",
"'=\"'",
"<<",
... | Serializes the data validation
@param [String] str
@return [String] | [
"Serializes",
"the",
"data",
"validation"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/data_validation.rb#L215-L226 | train | Returns the XML string for this data validation. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
9398,
1035,
12332,
1027,
2131,
1035,
9398,
1035,
12332,
2358,
2099,
1026,
1026,
1005,
1026,
2951,
10175,
8524,
3508,
1005,
2358,
2099,
1026,
1026,
6013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.create_composite_entity_role | def create_composite_entity_role(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:nil)
response = create_composite_entity_role_async(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_composite_entity_role(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:nil)
response = create_composite_entity_role_async(app_id, version_id, c_entity_id, entity_role_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_composite_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"c_entity_id",
",",
"entity_role_create_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_composite_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"c_entity... | Create a role for a composite entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param c_entity_id The composite entity extractor ID.
@param entity_role_create_object [EntityRoleCreateObject] An entity role
object containing the name of role.
@pa... | [
"Create",
"a",
"role",
"for",
"a",
"composite",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L7151-L7154 | train | Creates a composite entity role for a given entity. | [
30522,
13366,
3443,
1035,
12490,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
1039,
1035,
9178,
1035,
8909,
1010,
9178,
1035,
2535,
1035,
3443,
1035,
4874,
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... |
RailsEventStore/rails_event_store | ruby_event_store/lib/ruby_event_store/specification.rb | RubyEventStore.Specification.stream | def stream(stream_name)
Specification.new(reader, result.dup { |r| r.stream = Stream.new(stream_name) })
end | ruby | def stream(stream_name)
Specification.new(reader, result.dup { |r| r.stream = Stream.new(stream_name) })
end | [
"def",
"stream",
"(",
"stream_name",
")",
"Specification",
".",
"new",
"(",
"reader",
",",
"result",
".",
"dup",
"{",
"|",
"r",
"|",
"r",
".",
"stream",
"=",
"Stream",
".",
"new",
"(",
"stream_name",
")",
"}",
")",
"end"
] | @api private
@private
Limits the query to certain stream.
{http://railseventstore.org/docs/read/ Find out more}.
@param stream_name [String] name of the stream to get events from
@return [Specification] | [
"@api",
"private",
"@private",
"Limits",
"the",
"query",
"to",
"certain",
"stream",
".",
"{",
"http",
":",
"//",
"railseventstore",
".",
"org",
"/",
"docs",
"/",
"read",
"/",
"Find",
"out",
"more",
"}",
"."
] | 3ee4f3148499794154ee6fec74ccf6d4670d85ac | https://github.com/RailsEventStore/rails_event_store/blob/3ee4f3148499794154ee6fec74ccf6d4670d85ac/ruby_event_store/lib/ruby_event_store/specification.rb#L18-L20 | train | Returns a new Specification with the stream | [
30522,
13366,
5460,
1006,
5460,
1035,
2171,
1007,
12827,
1012,
2047,
1006,
8068,
1010,
2765,
1012,
4241,
2361,
1063,
1064,
1054,
1064,
1054,
1012,
5460,
1027,
5460,
1012,
2047,
1006,
5460,
1035,
2171,
1007,
1065,
1007,
2203,
102,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mikel/mail | lib/mail/network/delivery_methods/smtp_connection.rb | Mail.SMTPConnection.deliver! | def deliver!(mail)
envelope = Mail::SmtpEnvelope.new(mail)
response = smtp.sendmail(dot_stuff(envelope.message), envelope.from, envelope.to)
settings[:return_response] ? response : self
end | ruby | def deliver!(mail)
envelope = Mail::SmtpEnvelope.new(mail)
response = smtp.sendmail(dot_stuff(envelope.message), envelope.from, envelope.to)
settings[:return_response] ? response : self
end | [
"def",
"deliver!",
"(",
"mail",
")",
"envelope",
"=",
"Mail",
"::",
"SmtpEnvelope",
".",
"new",
"(",
"mail",
")",
"response",
"=",
"smtp",
".",
"sendmail",
"(",
"dot_stuff",
"(",
"envelope",
".",
"message",
")",
",",
"envelope",
".",
"from",
",",
"enve... | Send the message via SMTP.
The from and to attributes are optional. If not set, they are retrieve from the Message. | [
"Send",
"the",
"message",
"via",
"SMTP",
".",
"The",
"from",
"and",
"to",
"attributes",
"are",
"optional",
".",
"If",
"not",
"set",
"they",
"are",
"retrieve",
"from",
"the",
"Message",
"."
] | fb53fb369eb2bf0494ac70675970c90cdcc3f495 | https://github.com/mikel/mail/blob/fb53fb369eb2bf0494ac70675970c90cdcc3f495/lib/mail/network/delivery_methods/smtp_connection.rb#L51-L55 | train | Send a mail to the server | [
30522,
13366,
8116,
999,
1006,
5653,
1007,
11255,
1027,
5653,
1024,
1024,
15488,
25856,
2368,
15985,
17635,
1012,
2047,
1006,
5653,
1007,
3433,
1027,
15488,
25856,
1012,
4604,
21397,
1006,
11089,
1035,
4933,
1006,
11255,
1012,
4471,
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... |
forward3d/rbhive | lib/rbhive/t_c_l_i_connection.rb | RBHive.TCLIConnection.fetch_rows | def fetch_rows(op_handle, orientation = :first, max_rows = 1000)
fetch_req = prepare_fetch_results(op_handle, orientation, max_rows)
fetch_results = @client.FetchResults(fetch_req)
raise_error_if_failed!(fetch_results)
rows = fetch_results.results.rows
TCLIResultSet.new(rows, TCLISchemaDef... | ruby | def fetch_rows(op_handle, orientation = :first, max_rows = 1000)
fetch_req = prepare_fetch_results(op_handle, orientation, max_rows)
fetch_results = @client.FetchResults(fetch_req)
raise_error_if_failed!(fetch_results)
rows = fetch_results.results.rows
TCLIResultSet.new(rows, TCLISchemaDef... | [
"def",
"fetch_rows",
"(",
"op_handle",
",",
"orientation",
"=",
":first",
",",
"max_rows",
"=",
"1000",
")",
"fetch_req",
"=",
"prepare_fetch_results",
"(",
"op_handle",
",",
"orientation",
",",
"max_rows",
")",
"fetch_results",
"=",
"@client",
".",
"FetchResult... | Pull rows from the query result | [
"Pull",
"rows",
"from",
"the",
"query",
"result"
] | a630b57332f2face03501da3ecad2905c78056fa | https://github.com/forward3d/rbhive/blob/a630b57332f2face03501da3ecad2905c78056fa/lib/rbhive/t_c_l_i_connection.rb#L300-L306 | train | Fetch the rows of a given operation handle. | [
30522,
13366,
18584,
1035,
10281,
1006,
6728,
1035,
5047,
1010,
10296,
1027,
1024,
2034,
1010,
4098,
1035,
10281,
1027,
6694,
1007,
18584,
1035,
2128,
4160,
1027,
7374,
1035,
18584,
1035,
3463,
1006,
6728,
1035,
5047,
1010,
10296,
1010,
409... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/compiler.rb | Haml.Compiler.push_silent | def push_silent(text, can_suppress = false)
flush_merged_text
return if can_suppress && @options.suppress_eval?
newline = (text == "end") ? ";" : "\n"
@temple << [:code, "#{resolve_newlines}#{text}#{newline}"]
@output_line = @output_line + text.count("\n") + newline.count("\n")
end | ruby | def push_silent(text, can_suppress = false)
flush_merged_text
return if can_suppress && @options.suppress_eval?
newline = (text == "end") ? ";" : "\n"
@temple << [:code, "#{resolve_newlines}#{text}#{newline}"]
@output_line = @output_line + text.count("\n") + newline.count("\n")
end | [
"def",
"push_silent",
"(",
"text",
",",
"can_suppress",
"=",
"false",
")",
"flush_merged_text",
"return",
"if",
"can_suppress",
"&&",
"@options",
".",
"suppress_eval?",
"newline",
"=",
"(",
"text",
"==",
"\"end\"",
")",
"?",
"\";\"",
":",
"\"\\n\"",
"@temple",... | Evaluates `text` in the context of the scope object, but
does not output the result. | [
"Evaluates",
"text",
"in",
"the",
"context",
"of",
"the",
"scope",
"object",
"but",
"does",
"not",
"output",
"the",
"result",
"."
] | 9aa0fbe4a91b999978927be569d2ad0cd39076f1 | https://github.com/haml/haml/blob/9aa0fbe4a91b999978927be569d2ad0cd39076f1/lib/haml/compiler.rb#L219-L225 | train | Push a single line of code to the output. | [
30522,
13366,
5245,
1035,
4333,
1006,
3793,
1010,
2064,
1035,
16081,
1027,
6270,
1007,
13862,
1035,
5314,
1035,
3793,
2709,
2065,
2064,
1035,
16081,
1004,
1004,
1030,
7047,
1012,
16081,
1035,
9345,
2140,
1029,
2047,
4179,
1027,
1006,
3793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
stripe/stripe-ruby | lib/stripe/stripe_client.rb | Stripe.StripeClient.specific_oauth_error | def specific_oauth_error(resp, error_code, context)
description = resp.data[:error_description] || error_code
Util.log_error("Stripe OAuth error",
status: resp.http_status,
error_code: error_code,
error_description: description,
... | ruby | def specific_oauth_error(resp, error_code, context)
description = resp.data[:error_description] || error_code
Util.log_error("Stripe OAuth error",
status: resp.http_status,
error_code: error_code,
error_description: description,
... | [
"def",
"specific_oauth_error",
"(",
"resp",
",",
"error_code",
",",
"context",
")",
"description",
"=",
"resp",
".",
"data",
"[",
":error_description",
"]",
"||",
"error_code",
"Util",
".",
"log_error",
"(",
"\"Stripe OAuth error\"",
",",
"status",
":",
"resp",
... | Attempts to look at a response's error code and return an OAuth error if
one matches. Will return `nil` if the code isn't recognized. | [
"Attempts",
"to",
"look",
"at",
"a",
"response",
"s",
"error",
"code",
"and",
"return",
"an",
"OAuth",
"error",
"if",
"one",
"matches",
".",
"Will",
"return",
"nil",
"if",
"the",
"code",
"isn",
"t",
"recognized",
"."
] | 322a8c60be8a9b9ac8aad8857864680a32176935 | https://github.com/stripe/stripe-ruby/blob/322a8c60be8a9b9ac8aad8857864680a32176935/lib/stripe/stripe_client.rb#L398-L425 | train | Returns an error object for the specific error code | [
30522,
13366,
3563,
1035,
1051,
4887,
2705,
1035,
7561,
1006,
24501,
2361,
1010,
7561,
1035,
3642,
1010,
6123,
1007,
6412,
1027,
24501,
2361,
1012,
2951,
1031,
1024,
7561,
1035,
6412,
1033,
1064,
1064,
7561,
1035,
3642,
21183,
4014,
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_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_pattern_any_entity_role | def delete_pattern_any_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = delete_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_pattern_any_entity_role(app_id, version_id, entity_id, role_id, custom_headers:nil)
response = delete_pattern_any_entity_role_async(app_id, version_id, entity_id, role_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_pattern_any_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_pattern_any_entity_role_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"ro... | Delete a role for a given Pattern.any entity in a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity ID.
@param role_id The entity role Id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added ... | [
"Delete",
"a",
"role",
"for",
"a",
"given",
"Pattern",
".",
"any",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L10554-L10557 | train | Deletes a role for an entity in a version of the application. | [
30522,
13366,
3972,
12870,
1035,
5418,
1035,
2151,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/collection.rb | Mongo.Collection.find_one_and_update | def find_one_and_update(filter, update, options = {})
find(filter, options).find_one_and_update(update, options)
end | ruby | def find_one_and_update(filter, update, options = {})
find(filter, options).find_one_and_update(update, options)
end | [
"def",
"find_one_and_update",
"(",
"filter",
",",
"update",
",",
"options",
"=",
"{",
"}",
")",
"find",
"(",
"filter",
",",
"options",
")",
".",
"find_one_and_update",
"(",
"update",
",",
"options",
")",
"end"
] | Finds a single document via findAndModify and updates it, returning the original doc unless
otherwise specified.
@example Find a document and update it, returning the original.
collection.find_one_and_update({ name: 'test' }, { "$set" => { name: 'test1' }})
@example Find a document and update it, returning the ... | [
"Finds",
"a",
"single",
"document",
"via",
"findAndModify",
"and",
"updates",
"it",
"returning",
"the",
"original",
"doc",
"unless",
"otherwise",
"specified",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/collection.rb#L725-L727 | train | Find the first element and update the first element | [
30522,
13366,
2424,
1035,
2028,
1035,
1998,
1035,
10651,
1006,
11307,
1010,
10651,
1010,
7047,
1027,
1063,
1065,
1007,
2424,
1006,
11307,
1010,
7047,
1007,
1012,
2424,
1035,
2028,
1035,
1998,
1035,
10651,
1006,
10651,
1010,
7047,
1007,
2203... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.delete_key | def delete_key(vault_base_url, key_name, custom_headers:nil)
response = delete_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_key(vault_base_url, key_name, custom_headers:nil)
response = delete_key_async(vault_base_url, key_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_key",
"(",
"vault_base_url",
",",
"key_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_key_async",
"(",
"vault_base_url",
",",
"key_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",... | Deletes a key of any type from storage in Azure Key Vault.
The delete key operation cannot be used to remove individual versions of a
key. This operation removes the cryptographic material associated with the
key, which means the key is not usable for Sign/Verify, Wrap/Unwrap or
Encrypt/Decrypt operations. This op... | [
"Deletes",
"a",
"key",
"of",
"any",
"type",
"from",
"storage",
"in",
"Azure",
"Key",
"Vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L441-L444 | train | Deletes the specified key. | [
30522,
13366,
3972,
12870,
1035,
3145,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
3145,
1035,
2004,
6038,
2278,
1006,
11632,
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... |
fastlane/fastlane | spaceship/lib/spaceship/client.rb | Spaceship.Client.persistent_cookie_path | def persistent_cookie_path
if ENV["SPACESHIP_COOKIE_PATH"]
path = File.expand_path(File.join(ENV["SPACESHIP_COOKIE_PATH"], "spaceship", self.user, "cookie"))
else
[File.join(self.fastlane_user_dir, "spaceship"), "~/.spaceship", "/var/tmp/spaceship", "#{Dir.tmpdir}/spaceship"].each do |dir|
... | ruby | def persistent_cookie_path
if ENV["SPACESHIP_COOKIE_PATH"]
path = File.expand_path(File.join(ENV["SPACESHIP_COOKIE_PATH"], "spaceship", self.user, "cookie"))
else
[File.join(self.fastlane_user_dir, "spaceship"), "~/.spaceship", "/var/tmp/spaceship", "#{Dir.tmpdir}/spaceship"].each do |dir|
... | [
"def",
"persistent_cookie_path",
"if",
"ENV",
"[",
"\"SPACESHIP_COOKIE_PATH\"",
"]",
"path",
"=",
"File",
".",
"expand_path",
"(",
"File",
".",
"join",
"(",
"ENV",
"[",
"\"SPACESHIP_COOKIE_PATH\"",
"]",
",",
"\"spaceship\"",
",",
"self",
".",
"user",
",",
"\"c... | Returns preferred path for storing cookie
for two step verification. | [
"Returns",
"preferred",
"path",
"for",
"storing",
"cookie",
"for",
"two",
"step",
"verification",
"."
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/client.rb#L285-L299 | train | Returns the persistent cookie path for the current user. | [
30522,
13366,
14516,
1035,
17387,
1035,
4130,
2065,
4372,
2615,
1031,
1000,
25516,
1035,
17387,
1035,
4130,
1000,
1033,
4130,
1027,
5371,
1012,
7818,
1035,
4130,
1006,
5371,
1012,
3693,
1006,
4372,
2615,
1031,
1000,
25516,
1035,
17387,
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... |
coinbase/geoengineer | lib/geoengineer/resources/aws/api_gateway/helpers.rb | GeoEngineer::ApiGatewayHelpers.ClassMethods._fetch_remote_rest_apis | def _fetch_remote_rest_apis(provider)
cache = GeoEngineer::ApiGatewayHelpers._rest_api_cache
return cache[provider] if cache[provider]
ret = _client(provider).get_rest_apis['items'].map(&:to_h).map do |rr|
rr[:_terraform_id] = rr[:id]
rr[:_geo_id] = rr[:name]
rr[:r... | ruby | def _fetch_remote_rest_apis(provider)
cache = GeoEngineer::ApiGatewayHelpers._rest_api_cache
return cache[provider] if cache[provider]
ret = _client(provider).get_rest_apis['items'].map(&:to_h).map do |rr|
rr[:_terraform_id] = rr[:id]
rr[:_geo_id] = rr[:name]
rr[:r... | [
"def",
"_fetch_remote_rest_apis",
"(",
"provider",
")",
"cache",
"=",
"GeoEngineer",
"::",
"ApiGatewayHelpers",
".",
"_rest_api_cache",
"return",
"cache",
"[",
"provider",
"]",
"if",
"cache",
"[",
"provider",
"]",
"ret",
"=",
"_client",
"(",
"provider",
")",
"... | Rest API | [
"Rest",
"API"
] | d26f8850a492ddb3d27e78b25d1313cf593df5a9 | https://github.com/coinbase/geoengineer/blob/d26f8850a492ddb3d27e78b25d1313cf593df5a9/lib/geoengineer/resources/aws/api_gateway/helpers.rb#L28-L40 | train | Fetch the REST APIs for a given provider | [
30522,
13366,
1035,
18584,
1035,
6556,
1035,
2717,
1035,
17928,
2015,
1006,
10802,
1007,
17053,
1027,
20248,
13159,
3170,
2121,
1024,
1024,
17928,
5867,
4576,
16001,
7347,
1012,
1035,
2717,
1035,
17928,
1035,
17053,
2709,
17053,
1031,
10802,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.DeviceSettings.begin_update_security_settings_with_http_info | def begin_update_security_settings_with_http_info(device_name, parameters, resource_group_name, manager_name, custom_headers:nil)
begin_update_security_settings_async(device_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def begin_update_security_settings_with_http_info(device_name, parameters, resource_group_name, manager_name, custom_headers:nil)
begin_update_security_settings_async(device_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_security_settings_with_http_info",
"(",
"device_name",
",",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_security_settings_async",
"(",
"device_name",
",",
"parameters",
",",
"resou... | Patch Security properties of the specified device name.
@param device_name [String] The device name
@param parameters [SecuritySettingsPatch] The security settings properties to
be patched.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_hea... | [
"Patch",
"Security",
"properties",
"of",
"the",
"specified",
"device",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb#L891-L893 | train | Updates security settings of the specified device. | [
30522,
13366,
4088,
1035,
10651,
1035,
3036,
1035,
10906,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5080,
1035,
2171,
1010,
11709,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Tag.get_entity_state_by_operation | def get_entity_state_by_operation(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers:nil)
response = get_entity_state_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers:custom_headers).value!
nil
end | ruby | def get_entity_state_by_operation(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers:nil)
response = get_entity_state_by_operation_async(resource_group_name, service_name, api_id, operation_id, tag_id, custom_headers:custom_headers).value!
nil
end | [
"def",
"get_entity_state_by_operation",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"operation_id",
",",
"tag_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_entity_state_by_operation_async",
"(",
"resource_group_name",
",",
"... | Gets the entity state version of the tag specified by its identifier.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param api_id [String] API revision identifier. Must be unique in the current
API Management service instanc... | [
"Gets",
"the",
"entity",
"state",
"version",
"of",
"the",
"tag",
"specified",
"by",
"its",
"identifier",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb#L1490-L1493 | train | Gets the entity state of the specified API. | [
30522,
13366,
2131,
1035,
9178,
1035,
2110,
1035,
2011,
1035,
3169,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
17928,
1035,
8909,
1010,
3169,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Devices.begin_deactivate_with_http_info | def begin_deactivate_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
begin_deactivate_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def begin_deactivate_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
begin_deactivate_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_deactivate_with_http_info",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_deactivate_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":c... | Deactivates the device.
@param device_name [String] The device name
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::Azur... | [
"Deactivates",
"the",
"device",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb#L1418-L1420 | train | Deactivates the specified managed hardware. | [
30522,
13366,
4088,
1035,
26709,
6593,
21466,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
26709,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activerecord/lib/active_record/relation/spawn_methods.rb | ActiveRecord.SpawnMethods.merge | def merge(other)
if other.is_a?(Array)
records & other
elsif other
spawn.merge!(other)
else
raise ArgumentError, "invalid argument: #{other.inspect}."
end
end | ruby | def merge(other)
if other.is_a?(Array)
records & other
elsif other
spawn.merge!(other)
else
raise ArgumentError, "invalid argument: #{other.inspect}."
end
end | [
"def",
"merge",
"(",
"other",
")",
"if",
"other",
".",
"is_a?",
"(",
"Array",
")",
"records",
"&",
"other",
"elsif",
"other",
"spawn",
".",
"merge!",
"(",
"other",
")",
"else",
"raise",
"ArgumentError",
",",
"\"invalid argument: #{other.inspect}.\"",
"end",
... | Merges in the conditions from <tt>other</tt>, if <tt>other</tt> is an ActiveRecord::Relation.
Returns an array representing the intersection of the resulting records with <tt>other</tt>, if <tt>other</tt> is an array.
Post.where(published: true).joins(:comments).merge( Comment.where(spam: false) )
# Performs a ... | [
"Merges",
"in",
"the",
"conditions",
"from",
"<tt",
">",
"other<",
"/",
"tt",
">",
"if",
"<tt",
">",
"other<",
"/",
"tt",
">",
"is",
"an",
"ActiveRecord",
"::",
"Relation",
".",
"Returns",
"an",
"array",
"representing",
"the",
"intersection",
"of",
"the"... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/relation/spawn_methods.rb#L31-L39 | train | Merge the two records into this one. | [
30522,
13366,
13590,
1006,
2060,
1007,
2065,
2060,
1012,
2003,
1035,
1037,
1029,
1006,
9140,
1007,
2636,
1004,
2060,
3449,
5332,
2546,
2060,
25645,
1012,
13590,
999,
1006,
2060,
1007,
2842,
5333,
6685,
2121,
29165,
1010,
1000,
19528,
6685,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Shopify/liquid | lib/liquid/parser.rb | Liquid.Parser.id? | def id?(str)
token = @tokens[@p]
return false unless token && token[0] == :id
return false unless token[1] == str
@p += 1
token[1]
end | ruby | def id?(str)
token = @tokens[@p]
return false unless token && token[0] == :id
return false unless token[1] == str
@p += 1
token[1]
end | [
"def",
"id?",
"(",
"str",
")",
"token",
"=",
"@tokens",
"[",
"@p",
"]",
"return",
"false",
"unless",
"token",
"&&",
"token",
"[",
"0",
"]",
"==",
":id",
"return",
"false",
"unless",
"token",
"[",
"1",
"]",
"==",
"str",
"@p",
"+=",
"1",
"token",
"... | Like consume? Except for an :id token of a certain name | [
"Like",
"consume?",
"Except",
"for",
"an",
":",
"id",
"token",
"of",
"a",
"certain",
"name"
] | b3b63a683f6daaea7e70f1602ee829abdf970ef3 | https://github.com/Shopify/liquid/blob/b3b63a683f6daaea7e70f1602ee829abdf970ef3/lib/liquid/parser.rb#L33-L39 | train | Returns true if the token is an ID token. | [
30522,
13366,
8909,
1029,
1006,
2358,
2099,
1007,
19204,
1027,
1030,
19204,
2015,
1031,
1030,
1052,
1033,
2709,
6270,
4983,
19204,
1004,
1004,
19204,
1031,
1014,
1033,
1027,
1027,
1024,
8909,
2709,
6270,
4983,
19204,
1031,
1015,
1033,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/lib/decidim/form_builder.rb | Decidim.FormBuilder.scopes_picker | def scopes_picker(attribute, options = {})
picker_options = {
id: "#{@object_name}_#{attribute}",
class: "picker-#{options[:multiple] ? "multiple" : "single"}",
name: "#{@object_name}[#{attribute}]"
}
picker_options[:class] += " is-invalid-input" if error?(attribute)
pr... | ruby | def scopes_picker(attribute, options = {})
picker_options = {
id: "#{@object_name}_#{attribute}",
class: "picker-#{options[:multiple] ? "multiple" : "single"}",
name: "#{@object_name}[#{attribute}]"
}
picker_options[:class] += " is-invalid-input" if error?(attribute)
pr... | [
"def",
"scopes_picker",
"(",
"attribute",
",",
"options",
"=",
"{",
"}",
")",
"picker_options",
"=",
"{",
"id",
":",
"\"#{@object_name}_#{attribute}\"",
",",
"class",
":",
"\"picker-#{options[:multiple] ? \"multiple\" : \"single\"}\"",
",",
"name",
":",
"\"#{@object_nam... | Public: Generates a picker field for scope selection.
attribute - The name of the field (usually scope_id)
options - An optional Hash with options:
- multiple - Multiple mode, to allow multiple scopes selection.
- label - Show label?
- checkboxes_on_top - Show checked picker values on top (defa... | [
"Public",
":",
"Generates",
"a",
"picker",
"field",
"for",
"scope",
"selection",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/form_builder.rb#L247-L267 | train | Generates a picker for the given attribute. | [
30522,
13366,
9531,
2015,
1035,
4060,
2121,
1006,
17961,
1010,
7047,
1027,
1063,
1065,
1007,
4060,
2121,
1035,
7047,
1027,
1063,
8909,
1024,
1000,
1001,
1063,
1030,
4874,
1035,
2171,
1065,
1035,
1001,
1063,
17961,
1065,
1000,
1010,
2465,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb | Azure::CDN::Mgmt::V2015_06_01.Endpoints.begin_create | def begin_create(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:nil)
response = begin_create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:nil)
response = begin_create_async(endpoint_name, endpoint_properties, profile_name, resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create",
"(",
"endpoint_name",
",",
"endpoint_properties",
",",
"profile_name",
",",
"resource_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_async",
"(",
"endpoint_name",
",",
"endpoint_properties",
",",
"profile_name"... | Creates a new CDN endpoint with the specified parameters.
@param endpoint_name [String] Name of the endpoint within the CDN profile.
@param endpoint_properties [EndpointCreateParameters] Endpoint properties
@param profile_name [String] Name of the CDN profile within the resource
group.
@param resource_group_name ... | [
"Creates",
"a",
"new",
"CDN",
"endpoint",
"with",
"the",
"specified",
"parameters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2015-06-01/generated/azure_mgmt_cdn/endpoints.rb#L699-L702 | train | Creates an endpoint. | [
30522,
13366,
4088,
1035,
3443,
1006,
2203,
8400,
1035,
2171,
1010,
2203,
8400,
1035,
5144,
1010,
6337,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3443,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/accounts.rb | Azure::DataLakeAnalytics::Mgmt::V2016_11_01.Accounts.list_as_lazy | def list_as_lazy(filter:nil, top:nil, skip:nil, select:nil, orderby:nil, count:nil, custom_headers:nil)
response = list_async(filter:filter, top:top, skip:skip, select:select, orderby:orderby, count:count, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.n... | ruby | def list_as_lazy(filter:nil, top:nil, skip:nil, select:nil, orderby:nil, count:nil, custom_headers:nil)
response = list_async(filter:filter, top:top, skip:skip, select:select, orderby:orderby, count:count, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.n... | [
"def",
"list_as_lazy",
"(",
"filter",
":",
"nil",
",",
"top",
":",
"nil",
",",
"skip",
":",
"nil",
",",
"select",
":",
"nil",
",",
"orderby",
":",
"nil",
",",
"count",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_async",... | Gets the first page of Data Lake Analytics accounts, if any, within the
current subscription. This includes a link to the next page, if any.
@param filter [String] OData filter. Optional.
@param top [Integer] The number of items to return. Optional.
@param skip [Integer] The number of items to skip over before ret... | [
"Gets",
"the",
"first",
"page",
"of",
"Data",
"Lake",
"Analytics",
"accounts",
"if",
"any",
"within",
"the",
"current",
"subscription",
".",
"This",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/accounts.rb#L1154-L1163 | train | Gets a list of all the available image types. | [
30522,
13366,
2862,
1035,
2004,
1035,
13971,
1006,
11307,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
13558,
1024,
9152,
2140,
1010,
7276,
1024,
9152,
2140,
1010,
2344,
3762,
1024,
9152,
2140,
1010,
4175,
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... |
CocoaPods/Xcodeproj | lib/xcodeproj/project.rb | Xcodeproj.Project.new_from_plist | def new_from_plist(uuid, objects_by_uuid_plist, root_object = false)
attributes = objects_by_uuid_plist[uuid]
if attributes
klass = Object.const_get(attributes['isa'])
object = klass.new(self, uuid)
objects_by_uuid[uuid] = object
object.add_referrer(self) if root_object
... | ruby | def new_from_plist(uuid, objects_by_uuid_plist, root_object = false)
attributes = objects_by_uuid_plist[uuid]
if attributes
klass = Object.const_get(attributes['isa'])
object = klass.new(self, uuid)
objects_by_uuid[uuid] = object
object.add_referrer(self) if root_object
... | [
"def",
"new_from_plist",
"(",
"uuid",
",",
"objects_by_uuid_plist",
",",
"root_object",
"=",
"false",
")",
"attributes",
"=",
"objects_by_uuid_plist",
"[",
"uuid",
"]",
"if",
"attributes",
"klass",
"=",
"Object",
".",
"const_get",
"(",
"attributes",
"[",
"'isa'"... | @!group Plist serialization
-------------------------------------------------------------------------
Creates a new object from the given UUID and `objects` hash (of a plist).
The method sets up any relationship of the new object, generating the
destination object(s) if not already present in the project.
@note ... | [
"@!group",
"Plist",
"serialization",
"-------------------------------------------------------------------------",
"Creates",
"a",
"new",
"object",
"from",
"the",
"given",
"UUID",
"and",
"objects",
"hash",
"(",
"of",
"a",
"plist",
")",
"."
] | 3be1684437a6f8e69c7836ad4c85a2b78663272f | https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/lib/xcodeproj/project.rb#L264-L274 | train | Creates a new object from a PList object. | [
30522,
13366,
2047,
1035,
2013,
1035,
20228,
2923,
1006,
1057,
21272,
1010,
5200,
1035,
2011,
1035,
1057,
21272,
1035,
20228,
2923,
1010,
7117,
1035,
4874,
1027,
6270,
1007,
12332,
1027,
5200,
1035,
2011,
1035,
1057,
21272,
1035,
20228,
292... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb | Azure::EventGrid::Mgmt::V2019_02_01_preview.Topics.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, topic_name, topic_info, custom_headers:nil)
begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, topic_name, topic_info, custom_headers:nil)
begin_create_or_update_async(resource_group_name, topic_name, topic_info, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"topic_name",
",",
"topic_info",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"topic_name",
",",
"topic_info",
",",
"custom_headers",... | Create a topic
Asynchronously creates a new topic with the specified parameters.
@param resource_group_name [String] The name of the resource group within the
user's subscription.
@param topic_name [String] Name of the topic
@param topic_info [Topic] Topic information
@param custom_headers [Hash{String => Strin... | [
"Create",
"a",
"topic"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2019-02-01-preview/generated/azure_mgmt_event_grid/topics.rb#L822-L824 | train | Creates or updates a topic. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8476,
1035,
2171,
1010,
8476,
1035,
18558,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.report_node_health | def report_node_health(node_name, health_information, immediate:false, timeout:60, custom_headers:nil)
response = report_node_health_async(node_name, health_information, immediate:immediate, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def report_node_health(node_name, health_information, immediate:false, timeout:60, custom_headers:nil)
response = report_node_health_async(node_name, health_information, immediate:immediate, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"report_node_health",
"(",
"node_name",
",",
"health_information",
",",
"immediate",
":",
"false",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"report_node_health_async",
"(",
"node_name",
",",
"health_information",
"... | Sends a health report on the Service Fabric node.
Reports health state of the specified Service Fabric node. The report must
contain the information about the source of the health report and property on
which it is reported.
The report is sent to a Service Fabric gateway node, which forwards to the
health store.
... | [
"Sends",
"a",
"health",
"report",
"on",
"the",
"Service",
"Fabric",
"node",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L3887-L3890 | train | Report node health. | [
30522,
13366,
3189,
1035,
13045,
1035,
2740,
1006,
13045,
1035,
2171,
1010,
2740,
1035,
2592,
1010,
6234,
1024,
6270,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3189,
1035,
13045,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Katello/katello | app/models/katello/product_content.rb | Katello.ProductContent.repositories | def repositories
Katello::Repository.where(:root_id => product.root_repositories.has_url.where(:content_id => content.cp_content_id))
end | ruby | def repositories
Katello::Repository.where(:root_id => product.root_repositories.has_url.where(:content_id => content.cp_content_id))
end | [
"def",
"repositories",
"Katello",
"::",
"Repository",
".",
"where",
"(",
":root_id",
"=>",
"product",
".",
"root_repositories",
".",
"has_url",
".",
"where",
"(",
":content_id",
"=>",
"content",
".",
"cp_content_id",
")",
")",
"end"
] | used by Katello::Api::V2::RepositorySetsController#index | [
"used",
"by",
"Katello",
"::",
"Api",
"::",
"V2",
"::",
"RepositorySetsController#index"
] | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/product_content.rb#L38-L40 | train | Returns the list of repositories that have a URL for the given content | [
30522,
13366,
16360,
20049,
29469,
2229,
5736,
7174,
1024,
1024,
22409,
1012,
2073,
1006,
30524,
8909,
1007,
1007,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb | Azure::EventGrid::Mgmt::V2019_01_01.EventSubscriptions.create_or_update_async | def create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining... | ruby | def create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining... | [
"def",
"create_or_update_async",
"(",
"scope",
",",
"event_subscription_name",
",",
"event_subscription_info",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_or_update_async",
"(",
"scope",
",",
"event_subscription_name",
",",
"eve... | @param scope [String] The identifier of the resource to which the event
subscription needs to be created or updated. The scope can be a subscription,
or a resource group, or a top level resource belonging to a resource provider
namespace, or an EventGrid topic. For example, use
'/subscriptions/{subscriptionId}/' fo... | [
"@param",
"scope",
"[",
"String",
"]",
"The",
"identifier",
"of",
"the",
"resource",
"to",
"which",
"the",
"event",
"subscription",
"needs",
"to",
"be",
"created",
"or",
"updated",
".",
"The",
"scope",
"can",
"be",
"a",
"subscription",
"or",
"a",
"resource... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2019-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb#L204-L220 | train | Creates or updates an event subscription. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2004,
6038,
2278,
1006,
9531,
1010,
2724,
1035,
15002,
1035,
2171,
1010,
2724,
1035,
15002,
1035,
18558,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/data_lake_store_accounts.rb | Azure::DataLakeAnalytics::Mgmt::V2016_11_01.DataLakeStoreAccounts.get_with_http_info | def get_with_http_info(resource_group_name, account_name, data_lake_store_account_name, custom_headers:nil)
get_async(resource_group_name, account_name, data_lake_store_account_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, account_name, data_lake_store_account_name, custom_headers:nil)
get_async(resource_group_name, account_name, data_lake_store_account_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"data_lake_store_account_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"data_lake_store_account_name",
",",
"custom_headers... | Gets the specified Data Lake Store account details in the specified Data Lake
Analytics account.
@param resource_group_name [String] The name of the Azure resource group.
@param account_name [String] The name of the Data Lake Analytics account.
@param data_lake_store_account_name [String] The name of the Data Lake... | [
"Gets",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"details",
"in",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/data_lake_store_accounts.rb#L301-L303 | train | Gets the specified data lake store account s covering specification. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
2951,
1035,
2697,
1035,
3573,
1035,
4070,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | actionview/lib/action_view/rendering.rb | ActionView.Rendering._render_template | def _render_template(options)
variant = options.delete(:variant)
assigns = options.delete(:assigns)
context = view_context
context.assign assigns if assigns
lookup_context.variants = variant if variant
rendered_template = context.in_rendering_context(options) do |render... | ruby | def _render_template(options)
variant = options.delete(:variant)
assigns = options.delete(:assigns)
context = view_context
context.assign assigns if assigns
lookup_context.variants = variant if variant
rendered_template = context.in_rendering_context(options) do |render... | [
"def",
"_render_template",
"(",
"options",
")",
"variant",
"=",
"options",
".",
"delete",
"(",
":variant",
")",
"assigns",
"=",
"options",
".",
"delete",
"(",
":assigns",
")",
"context",
"=",
"view_context",
"context",
".",
"assign",
"assigns",
"if",
"assign... | Find and render a template based on the options given. | [
"Find",
"and",
"render",
"a",
"template",
"based",
"on",
"the",
"options",
"given",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/rendering.rb#L109-L125 | train | Renders the template | [
30522,
13366,
1035,
17552,
1035,
23561,
1006,
7047,
1007,
8349,
1027,
7047,
1012,
3972,
12870,
1006,
1024,
8349,
1007,
24022,
1027,
7047,
1012,
3972,
12870,
1006,
1024,
24022,
1007,
6123,
1027,
3193,
1035,
6123,
6123,
1012,
23911,
24022,
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... |
aasm/aasm | lib/aasm/core/event.rb | AASM::Core.Event.initialize_copy | def initialize_copy(orig)
super
@transitions = @transitions.collect { |transition| transition.clone }
@guards = @guards.dup
@unless = @unless.dup
@options = {}
orig.options.each_pair { |name, setting| @options[name] = setting.is_a?(Hash) || setting.is_a?(Array) ? settin... | ruby | def initialize_copy(orig)
super
@transitions = @transitions.collect { |transition| transition.clone }
@guards = @guards.dup
@unless = @unless.dup
@options = {}
orig.options.each_pair { |name, setting| @options[name] = setting.is_a?(Hash) || setting.is_a?(Array) ? settin... | [
"def",
"initialize_copy",
"(",
"orig",
")",
"super",
"@transitions",
"=",
"@transitions",
".",
"collect",
"{",
"|",
"transition",
"|",
"transition",
".",
"clone",
"}",
"@guards",
"=",
"@guards",
".",
"dup",
"@unless",
"=",
"@unless",
".",
"dup",
"@options",
... | called internally by Ruby 1.9 after clone() | [
"called",
"internally",
"by",
"Ruby",
"1",
".",
"9",
"after",
"clone",
"()"
] | 6a1000b489c6b2e205a7b142478a4b4e207c3dbd | https://github.com/aasm/aasm/blob/6a1000b489c6b2e205a7b142478a4b4e207c3dbd/lib/aasm/core/event.rb#L33-L40 | train | Initialize a copy of the object. | [
30522,
13366,
3988,
4697,
1035,
6100,
1006,
2030,
8004,
1007,
3565,
1030,
22166,
1027,
1030,
22166,
1012,
8145,
1063,
1064,
6653,
1064,
6653,
1012,
17598,
1065,
1030,
4932,
1027,
1030,
4932,
1012,
4241,
2361,
1030,
4983,
1027,
1030,
4983,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/face.rb | Azure::CognitiveServices::Face::V1_0.Face.detect_with_url | def detect_with_url(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
response = detect_with_url_async(url, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes... | ruby | def detect_with_url(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
response = detect_with_url_async(url, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes... | [
"def",
"detect_with_url",
"(",
"url",
",",
"return_face_id",
":",
"true",
",",
"return_face_landmarks",
":",
"false",
",",
"return_face_attributes",
":",
"nil",
",",
"recognition_model",
":",
"nil",
",",
"return_recognition_model",
":",
"false",
",",
"custom_headers... | Detect human faces in an image, return face rectangles, and optionally with
faceIds, landmarks, and attributes.<br />
* Optional parameters including faceId, landmarks, and attributes. Attributes
include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
makeup, occlusion, accessories, blur, exposure... | [
"Detect",
"human",
"faces",
"in",
"an",
"image",
"return",
"face",
"rectangles",
"and",
"optionally",
"with",
"faceIds",
"landmarks",
"and",
"attributes",
".",
"<br",
"/",
">",
"*",
"Optional",
"parameters",
"including",
"faceId",
"landmarks",
"and",
"attributes... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/face.rb#L886-L889 | train | Detects a given face in a given CDN. | [
30522,
13366,
11487,
1035,
2007,
1035,
24471,
2140,
1006,
24471,
2140,
1010,
2709,
1035,
2227,
1035,
8909,
1024,
2995,
1010,
2709,
1035,
2227,
1035,
16209,
1024,
6270,
1010,
2709,
1035,
2227,
1035,
12332,
1024,
9152,
2140,
1010,
5038,
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... |
etewiah/property_web_builder | app/controllers/pwb/api/v1/website_controller.rb | Pwb.Api::V1::WebsiteController.update | def update
website = Website.unique_instance
if website
website.update(website_params)
# http://patshaughnessy.net/2014/6/16/a-rule-of-thumb-for-strong-parameters
# adding :social_media to the list permitted by strong params does not work so doing below
# which is ugly but w... | ruby | def update
website = Website.unique_instance
if website
website.update(website_params)
# http://patshaughnessy.net/2014/6/16/a-rule-of-thumb-for-strong-parameters
# adding :social_media to the list permitted by strong params does not work so doing below
# which is ugly but w... | [
"def",
"update",
"website",
"=",
"Website",
".",
"unique_instance",
"if",
"website",
"website",
".",
"update",
"(",
"website_params",
")",
"# http://patshaughnessy.net/2014/6/16/a-rule-of-thumb-for-strong-parameters",
"# adding :social_media to the list permitted by strong params doe... | protect_from_forgery with: :null_session | [
"protect_from_forgery",
"with",
":",
":",
"null_session"
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/controllers/pwb/api/v1/website_controller.rb#L7-L23 | train | update the object in the database | [
30522,
13366,
10651,
4037,
1027,
4037,
1012,
4310,
1035,
6013,
2065,
4037,
4037,
1012,
10651,
1006,
4037,
1035,
11498,
5244,
1007,
1001,
8299,
1024,
1013,
1013,
6986,
7377,
8953,
25441,
1012,
5658,
1013,
2297,
1013,
1020,
1013,
2385,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmagick/rmagick | lib/rvg/rvg.rb | Magick.RVG.bgfill | def bgfill
if @background_fill.nil?
color = Magick::Pixel.new(0, 0, 0, Magick::TransparentOpacity)
else
color = @background_fill
color.opacity = (1.0 - @background_fill_opacity) * Magick::TransparentOpacity
end
color
end | ruby | def bgfill
if @background_fill.nil?
color = Magick::Pixel.new(0, 0, 0, Magick::TransparentOpacity)
else
color = @background_fill
color.opacity = (1.0 - @background_fill_opacity) * Magick::TransparentOpacity
end
color
end | [
"def",
"bgfill",
"if",
"@background_fill",
".",
"nil?",
"color",
"=",
"Magick",
"::",
"Pixel",
".",
"new",
"(",
"0",
",",
"0",
",",
"0",
",",
"Magick",
"::",
"TransparentOpacity",
")",
"else",
"color",
"=",
"@background_fill",
"color",
".",
"opacity",
"=... | background_fill defaults to 'none'. If background_fill has been set to something
else, combine it with the background_fill_opacity. | [
"background_fill",
"defaults",
"to",
"none",
".",
"If",
"background_fill",
"has",
"been",
"set",
"to",
"something",
"else",
"combine",
"it",
"with",
"the",
"background_fill_opacity",
"."
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rvg/rvg.rb#L61-L69 | train | Returns the color of the image. | [
30522,
13366,
1038,
25708,
8591,
2065,
1030,
4281,
1035,
6039,
1012,
9152,
2140,
1029,
3609,
1027,
3894,
2243,
1024,
1024,
22138,
1012,
2047,
1006,
1014,
1010,
1014,
1010,
1014,
1010,
3894,
2243,
1024,
1024,
13338,
29477,
12972,
1007,
2842,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_orr | def handle_orr(tokens, outer_span, options)
repeater = tokens[1].get_tag(Repeater)
repeater.start = outer_span.begin - 1
ordinal = tokens[0].get_tag(Ordinal).type
span = nil
ordinal.times do
span = repeater.next(:future)
if span.begin >= outer_span.end
span = ni... | ruby | def handle_orr(tokens, outer_span, options)
repeater = tokens[1].get_tag(Repeater)
repeater.start = outer_span.begin - 1
ordinal = tokens[0].get_tag(Ordinal).type
span = nil
ordinal.times do
span = repeater.next(:future)
if span.begin >= outer_span.end
span = ni... | [
"def",
"handle_orr",
"(",
"tokens",
",",
"outer_span",
",",
"options",
")",
"repeater",
"=",
"tokens",
"[",
"1",
"]",
".",
"get_tag",
"(",
"Repeater",
")",
"repeater",
".",
"start",
"=",
"outer_span",
".",
"begin",
"-",
"1",
"ordinal",
"=",
"tokens",
"... | narrows
Handle oridinal repeaters | [
"narrows",
"Handle",
"oridinal",
"repeaters"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L488-L504 | train | Handle orr tokens | [
30522,
13366,
5047,
1035,
26914,
1006,
19204,
2015,
1010,
6058,
1035,
8487,
1010,
7047,
1007,
9377,
2121,
1027,
19204,
2015,
1031,
1015,
1033,
1012,
2131,
1035,
6415,
1006,
9377,
2121,
1007,
9377,
2121,
1012,
2707,
1027,
6058,
1035,
8487,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
coinbase/geoengineer | lib/geoengineer/resources/aws/api_gateway/helpers.rb | GeoEngineer::ApiGatewayHelpers.ClassMethods._fetch_method | def _fetch_method(provider, rr, res, meth)
return _client(provider).get_method({
rest_api_id: rr[:_terraform_id],
resource_id: res[:_terraform_id],
http_method: meth
... | ruby | def _fetch_method(provider, rr, res, meth)
return _client(provider).get_method({
rest_api_id: rr[:_terraform_id],
resource_id: res[:_terraform_id],
http_method: meth
... | [
"def",
"_fetch_method",
"(",
"provider",
",",
"rr",
",",
"res",
",",
"meth",
")",
"return",
"_client",
"(",
"provider",
")",
".",
"get_method",
"(",
"{",
"rest_api_id",
":",
"rr",
"[",
":_terraform_id",
"]",
",",
"resource_id",
":",
"res",
"[",
":_terraf... | Method | [
"Method"
] | d26f8850a492ddb3d27e78b25d1313cf593df5a9 | https://github.com/coinbase/geoengineer/blob/d26f8850a492ddb3d27e78b25d1313cf593df5a9/lib/geoengineer/resources/aws/api_gateway/helpers.rb#L100-L108 | train | Fetch the method from the API | [
30522,
13366,
1035,
18584,
1035,
4118,
1006,
10802,
1010,
25269,
1010,
24501,
1010,
2777,
2232,
1007,
2709,
1035,
7396,
1006,
10802,
1007,
1012,
2131,
1035,
4118,
1006,
1063,
2717,
1035,
17928,
1035,
8909,
1024,
25269,
1031,
1024,
1035,
144... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/mobile_authorization_api.rb | SquareConnect.MobileAuthorizationApi.create_mobile_authorization_code | def create_mobile_authorization_code(body, opts = {})
data, _status_code, _headers = create_mobile_authorization_code_with_http_info(body, opts)
return data
end | ruby | def create_mobile_authorization_code(body, opts = {})
data, _status_code, _headers = create_mobile_authorization_code_with_http_info(body, opts)
return data
end | [
"def",
"create_mobile_authorization_code",
"(",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"create_mobile_authorization_code_with_http_info",
"(",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | CreateMobileAuthorizationCode
Generates code to authorize a mobile application to connect to a Square card reader Authorization codes are one-time-use and expire __60 minutes__ after being issued. __Important:__ The `Authorization` header you provide to this endpoint must have the following format: ``` Authorizatio... | [
"CreateMobileAuthorizationCode",
"Generates",
"code",
"to",
"authorize",
"a",
"mobile",
"application",
"to",
"connect",
"to",
"a",
"Square",
"card",
"reader",
"Authorization",
"codes",
"are",
"one",
"-",
"time",
"-",
"use",
"and",
"expire",
"__60",
"minutes__",
... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/mobile_authorization_api.rb#L25-L28 | train | Creates a mobile authorization code | [
30522,
13366,
30524,
1007,
2709,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
geokit/geokit | lib/geokit/polygon.rb | Geokit.Polygon.contains? | def contains?(point)
last_point = @points[-1]
oddNodes = false
x = point.lng
y = point.lat
@points.each do |p|
yi = p.lat
xi = p.lng
yj = last_point.lat
xj = last_point.lng
if yi < y && yj >= y ||
yj < y && yi >= y
oddNodes = !... | ruby | def contains?(point)
last_point = @points[-1]
oddNodes = false
x = point.lng
y = point.lat
@points.each do |p|
yi = p.lat
xi = p.lng
yj = last_point.lat
xj = last_point.lng
if yi < y && yj >= y ||
yj < y && yi >= y
oddNodes = !... | [
"def",
"contains?",
"(",
"point",
")",
"last_point",
"=",
"@points",
"[",
"-",
"1",
"]",
"oddNodes",
"=",
"false",
"x",
"=",
"point",
".",
"lng",
"y",
"=",
"point",
".",
"lat",
"@points",
".",
"each",
"do",
"|",
"p",
"|",
"yi",
"=",
"p",
".",
"... | Pass in an array of Geokit::LatLng | [
"Pass",
"in",
"an",
"array",
"of",
"Geokit",
"::",
"LatLng"
] | b7c13376bd85bf14f9534228ea466d09ac0afbf4 | https://github.com/geokit/geokit/blob/b7c13376bd85bf14f9534228ea466d09ac0afbf4/lib/geokit/polygon.rb#L15-L35 | train | Returns whether the point is inside the graph. | [
30522,
13366,
3397,
1029,
1006,
2391,
1007,
2197,
1035,
2391,
1027,
1030,
2685,
1031,
1011,
1015,
1033,
5976,
3630,
6155,
1027,
6270,
1060,
1027,
2391,
1012,
1048,
3070,
1061,
1027,
2391,
1012,
2474,
2102,
1030,
2685,
1012,
2169,
2079,
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... |
puppetlabs/puppet | lib/puppet/util/windows/service.rb | Puppet::Util::Windows.Service.service_start_type | def service_start_type(service_name)
start_type = nil
open_service(service_name, SC_MANAGER_CONNECT, SERVICE_QUERY_CONFIG) do |service|
query_config(service) do |config|
start_type = SERVICE_START_TYPES[config[:dwStartType]]
end
end
if start_type.nil?
raise Pupp... | ruby | def service_start_type(service_name)
start_type = nil
open_service(service_name, SC_MANAGER_CONNECT, SERVICE_QUERY_CONFIG) do |service|
query_config(service) do |config|
start_type = SERVICE_START_TYPES[config[:dwStartType]]
end
end
if start_type.nil?
raise Pupp... | [
"def",
"service_start_type",
"(",
"service_name",
")",
"start_type",
"=",
"nil",
"open_service",
"(",
"service_name",
",",
"SC_MANAGER_CONNECT",
",",
"SERVICE_QUERY_CONFIG",
")",
"do",
"|",
"service",
"|",
"query_config",
"(",
"service",
")",
"do",
"|",
"config",
... | Query the configuration of a service using QueryServiceConfigW
@param [String] service_name name of the service to query
@return [QUERY_SERVICE_CONFIGW.struct] the configuration of the service | [
"Query",
"the",
"configuration",
"of",
"a",
"service",
"using",
"QueryServiceConfigW"
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/windows/service.rb#L383-L394 | train | Get the start type of a service | [
30522,
13366,
2326,
1035,
2707,
1035,
2828,
1006,
2326,
1035,
2171,
1007,
2707,
1035,
2828,
1027,
9152,
2140,
2330,
1035,
2326,
1006,
2326,
1035,
2171,
1010,
8040,
1035,
3208,
1035,
7532,
1010,
2326,
1035,
23032,
1035,
9530,
8873,
2290,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_redis/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb | Azure::Redis::Mgmt::V2017_02_01.Redis.begin_export_data_with_http_info | def begin_export_data_with_http_info(resource_group_name, name, parameters, custom_headers:nil)
begin_export_data_async(resource_group_name, name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_export_data_with_http_info(resource_group_name, name, parameters, custom_headers:nil)
begin_export_data_async(resource_group_name, name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_export_data_with_http_info",
"(",
"resource_group_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_export_data_async",
"(",
"resource_group_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
... | Export data from the redis cache to blobs in a container.
@param resource_group_name [String] The name of the resource group.
@param name [String] The name of the Redis cache.
@param parameters [ExportRDBParameters] Parameters for Redis export
operation.
@param custom_headers [Hash{String => String}] A hash of cu... | [
"Export",
"data",
"from",
"the",
"redis",
"cache",
"to",
"blobs",
"in",
"a",
"container",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_redis/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb#L1199-L1201 | train | Export a list of data to a given CDN. | [
30522,
13366,
4088,
1035,
9167,
1035,
2951,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
9167,
1035,
2951,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.delete_image_tags_with_http_info | def delete_image_tags_with_http_info(project_id, image_ids, tag_ids, custom_headers:nil)
delete_image_tags_async(project_id, image_ids, tag_ids, custom_headers:custom_headers).value!
end | ruby | def delete_image_tags_with_http_info(project_id, image_ids, tag_ids, custom_headers:nil)
delete_image_tags_async(project_id, image_ids, tag_ids, custom_headers:custom_headers).value!
end | [
"def",
"delete_image_tags_with_http_info",
"(",
"project_id",
",",
"image_ids",
",",
"tag_ids",
",",
"custom_headers",
":",
"nil",
")",
"delete_image_tags_async",
"(",
"project_id",
",",
"image_ids",
",",
"tag_ids",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Remove a set of tags from a set of images.
@param project_id The project id.
@param image_ids Image ids. Limited to 64 images.
@param tag_ids Tags to be deleted from the specified images. Limited to 20
tags.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP re... | [
"Remove",
"a",
"set",
"of",
"tags",
"from",
"a",
"set",
"of",
"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#L664-L666 | train | Deletes the tags from an image. | [
30522,
13366,
3972,
12870,
1035,
3746,
1035,
22073,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2622,
1035,
8909,
1010,
3746,
1035,
8909,
2015,
1010,
6415,
1035,
8909,
2015,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3972,
12870,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
titusfortner/webdrivers | lib/webdrivers/logger.rb | Webdrivers.Logger.level= | def level=(severity)
if severity.is_a?(Integer)
@logger.level = severity
else
case severity.to_s.downcase
when 'debug'
@logger.level = DEBUG
when 'info'
@logger.level = INFO
when 'warn'
@logger.level = WARN
when 'error'
... | ruby | def level=(severity)
if severity.is_a?(Integer)
@logger.level = severity
else
case severity.to_s.downcase
when 'debug'
@logger.level = DEBUG
when 'info'
@logger.level = INFO
when 'warn'
@logger.level = WARN
when 'error'
... | [
"def",
"level",
"=",
"(",
"severity",
")",
"if",
"severity",
".",
"is_a?",
"(",
"Integer",
")",
"@logger",
".",
"level",
"=",
"severity",
"else",
"case",
"severity",
".",
"to_s",
".",
"downcase",
"when",
"'debug'",
"@logger",
".",
"level",
"=",
"DEBUG",
... | For Ruby < 2.3 compatibility
Based on https://github.com/ruby/ruby/blob/ruby_2_3/lib/logger.rb#L250 | [
"For",
"Ruby",
"<",
"2",
".",
"3",
"compatibility",
"Based",
"on",
"https",
":",
"//",
"github",
".",
"com",
"/",
"ruby",
"/",
"ruby",
"/",
"blob",
"/",
"ruby_2_3",
"/",
"lib",
"/",
"logger",
".",
"rb#L250"
] | 17c084e5b2bce8079032235af56628ce39b5b76e | https://github.com/titusfortner/webdrivers/blob/17c084e5b2bce8079032235af56628ce39b5b76e/lib/webdrivers/logger.rb#L50-L71 | train | Sets the logger level. | [
30522,
13366,
2504,
1027,
1006,
18976,
1007,
2065,
18976,
1012,
2003,
1035,
1037,
1029,
1006,
16109,
1007,
1030,
8833,
4590,
1012,
2504,
1027,
18976,
2842,
2553,
18976,
1012,
2000,
1035,
1055,
1012,
2091,
18382,
2043,
1005,
2139,
8569,
2290... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mrkn/pycall.rb | lib/pycall/import.rb | PyCall.Import.pyfrom | def pyfrom(mod_name, import: nil)
raise ArgumentError, "missing identifier(s) to be imported" unless import
mod_name = mod_name.to_str if mod_name.respond_to? :to_str
mod_name = mod_name.to_s if mod_name.is_a? Symbol
import = Array(import)
fromlist = import.map.with_index do |import_name... | ruby | def pyfrom(mod_name, import: nil)
raise ArgumentError, "missing identifier(s) to be imported" unless import
mod_name = mod_name.to_str if mod_name.respond_to? :to_str
mod_name = mod_name.to_s if mod_name.is_a? Symbol
import = Array(import)
fromlist = import.map.with_index do |import_name... | [
"def",
"pyfrom",
"(",
"mod_name",
",",
"import",
":",
"nil",
")",
"raise",
"ArgumentError",
",",
"\"missing identifier(s) to be imported\"",
"unless",
"import",
"mod_name",
"=",
"mod_name",
".",
"to_str",
"if",
"mod_name",
".",
"respond_to?",
":to_str",
"mod_name",
... | This function is implemented as a mimic of `import_from` function defined in `Python/ceval.c`. | [
"This",
"function",
"is",
"implemented",
"as",
"a",
"mimic",
"of",
"import_from",
"function",
"defined",
"in",
"Python",
"/",
"ceval",
".",
"c",
"."
] | c3de6375ee0c0ce76341acf95c4786fbf015d357 | https://github.com/mrkn/pycall.rb/blob/c3de6375ee0c0ce76341acf95c4786fbf015d357/lib/pycall/import.rb#L23-L75 | train | Import a module into the current context. | [
30522,
13366,
1052,
2100,
19699,
5358,
1006,
16913,
1035,
2171,
1010,
12324,
1024,
9152,
2140,
1007,
5333,
6685,
2121,
29165,
1010,
1000,
4394,
8909,
4765,
18095,
1006,
1055,
1007,
2000,
2022,
10964,
1000,
4983,
12324,
16913,
1035,
2171,
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... |
decidim/decidim | decidim-core/lib/decidim/form_builder.rb | Decidim.FormBuilder.abide_error_element | def abide_error_element(attribute)
defaults = []
defaults << :"decidim.forms.errors.#{object.class.model_name.i18n_key}.#{attribute}"
defaults << :"decidim.forms.errors.#{attribute}"
defaults << :"forms.errors.#{attribute}"
defaults << :"decidim.forms.errors.error"
options = { count... | ruby | def abide_error_element(attribute)
defaults = []
defaults << :"decidim.forms.errors.#{object.class.model_name.i18n_key}.#{attribute}"
defaults << :"decidim.forms.errors.#{attribute}"
defaults << :"forms.errors.#{attribute}"
defaults << :"decidim.forms.errors.error"
options = { count... | [
"def",
"abide_error_element",
"(",
"attribute",
")",
"defaults",
"=",
"[",
"]",
"defaults",
"<<",
":\"",
"#{",
"object",
".",
"class",
".",
"model_name",
".",
"i18n_key",
"}",
"#{",
"attribute",
"}",
"\"",
"defaults",
"<<",
":\"",
"#{",
"attribute",
"}",
... | rubocop:enable Metrics/PerceivedComplexity
rubocop:enable Metrics/CyclomaticComplexity
Private: Builds a span to be shown when there's a validation error in a field.
It looks for the text that will be the content in a similar way `human_attribute_name`
does it.
attribute - The name of the attribute of the field.
... | [
"rubocop",
":",
"enable",
"Metrics",
"/",
"PerceivedComplexity",
"rubocop",
":",
"enable",
"Metrics",
"/",
"CyclomaticComplexity",
"Private",
":",
"Builds",
"a",
"span",
"to",
"be",
"shown",
"when",
"there",
"s",
"a",
"validation",
"error",
"in",
"a",
"field",... | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/form_builder.rb#L564-L575 | train | Returns an error element for the given attribute. | [
30522,
13366,
11113,
5178,
1035,
7561,
1035,
5783,
1006,
17961,
1007,
12398,
2015,
1027,
1031,
1033,
12398,
2015,
1026,
1026,
1024,
30524,
1012,
3596,
1012,
10697,
1012,
1001,
1063,
4874,
1012,
2465,
1012,
2944,
1035,
2171,
1012,
1045,
1513... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/client/pull_requests/reviews.rb | Github.Client::PullRequests::Reviews.dismiss | def dismiss(*args)
arguments(args, required: [:user, :repo, :number, :id])
params = arguments.params
params["accept"] ||= PREVIEW_MEDIA
put_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/reviews/#{arguments.id}/dismissals", params)
end | ruby | def dismiss(*args)
arguments(args, required: [:user, :repo, :number, :id])
params = arguments.params
params["accept"] ||= PREVIEW_MEDIA
put_request("/repos/#{arguments.user}/#{arguments.repo}/pulls/#{arguments.number}/reviews/#{arguments.id}/dismissals", params)
end | [
"def",
"dismiss",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
",",
":number",
",",
":id",
"]",
")",
"params",
"=",
"arguments",
".",
"params",
"params",
"[",
"\"accept\"",
"]",
"||=",
"PREVIEW_MEDI... | @option params [String] :message
Optional string - Reason for dismissal
@example
github = Github.new oauth_token: '...'
github.pull_requests.reviews.dismiss 'user-name', 'repo-name', 'number', 'review-id'
message: "I can't get to this right now."
@api public | [
"@option",
"params",
"[",
"String",
"]",
":",
"message",
"Optional",
"string",
"-",
"Reason",
"for",
"dismissal"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/pull_requests/reviews.rb#L130-L137 | train | Dismiss a review | [
30522,
13366,
19776,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1010,
1024,
2193,
1010,
1024,
8909,
1033,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
11498,
524... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_client.rb | SquareConnect.ApiClient.get_v1_batch_token_from_headers | def get_v1_batch_token_from_headers(headers)
if headers.is_a?(Hash) && headers.has_key?('Link')
match = /^<([^>]+)>;rel='next'$/.match(headers['Link'])
if match
uri = URI.parse(match[1])
params = CGI.parse(uri.query)
return params['batch_token'][0]
end
e... | ruby | def get_v1_batch_token_from_headers(headers)
if headers.is_a?(Hash) && headers.has_key?('Link')
match = /^<([^>]+)>;rel='next'$/.match(headers['Link'])
if match
uri = URI.parse(match[1])
params = CGI.parse(uri.query)
return params['batch_token'][0]
end
e... | [
"def",
"get_v1_batch_token_from_headers",
"(",
"headers",
")",
"if",
"headers",
".",
"is_a?",
"(",
"Hash",
")",
"&&",
"headers",
".",
"has_key?",
"(",
"'Link'",
")",
"match",
"=",
"/",
"/",
".",
"match",
"(",
"headers",
"[",
"'Link'",
"]",
")",
"if",
"... | Extract batch_token from Link header if present
@param [Hash] headers hash with response headers
@return [String] batch_token or nil if no token is present | [
"Extract",
"batch_token",
"from",
"Link",
"header",
"if",
"present"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api_client.rb#L388-L397 | train | Returns the batch token from the headers | [
30522,
13366,
2131,
1035,
1058,
2487,
1035,
14108,
1035,
19204,
1035,
2013,
1035,
20346,
2015,
1006,
20346,
2015,
1007,
2065,
20346,
2015,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
1004,
1004,
20346,
2015,
1012,
2038,
1035,
3145,
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... |
meew0/discordrb | lib/discordrb/data/role.rb | Discordrb.Role.update_data | def update_data(new_data)
@name = new_data[:name] || new_data['name'] || @name
@hoist = new_data['hoist'] unless new_data['hoist'].nil?
@hoist = new_data[:hoist] unless new_data[:hoist].nil?
@colour = new_data[:colour] || (new_data['color'] ? ColourRGB.new(new_data['color']) : @colour)
end | ruby | def update_data(new_data)
@name = new_data[:name] || new_data['name'] || @name
@hoist = new_data['hoist'] unless new_data['hoist'].nil?
@hoist = new_data[:hoist] unless new_data[:hoist].nil?
@colour = new_data[:colour] || (new_data['color'] ? ColourRGB.new(new_data['color']) : @colour)
end | [
"def",
"update_data",
"(",
"new_data",
")",
"@name",
"=",
"new_data",
"[",
":name",
"]",
"||",
"new_data",
"[",
"'name'",
"]",
"||",
"@name",
"@hoist",
"=",
"new_data",
"[",
"'hoist'",
"]",
"unless",
"new_data",
"[",
"'hoist'",
"]",
".",
"nil?",
"@hoist"... | Updates the data cache from a hash containing data
@note For internal use only
@!visibility private | [
"Updates",
"the",
"data",
"cache",
"from",
"a",
"hash",
"containing",
"data"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/role.rb#L100-L105 | train | Update the data from the given hash | [
30522,
13366,
10651,
1035,
2951,
1006,
2047,
1035,
2951,
1007,
1030,
2171,
1027,
2047,
1035,
2951,
1031,
1024,
2171,
1033,
1064,
1064,
2047,
1035,
2951,
1031,
1005,
2171,
1005,
1033,
1064,
1064,
1030,
2171,
1030,
7570,
2923,
1027,
2047,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
refinery/refinerycms | core/app/helpers/refinery/image_helper.rb | Refinery.ImageHelper.image_fu | def image_fu(image, geometry = nil, options = {})
return nil if image.blank?
thumbnail_args = options.slice(:strip)
thumbnail_args[:geometry] = geometry if geometry
image_tag_args = (image.thumbnail_dimensions(geometry) rescue {})
image_tag_args[:alt] = image.respond_to?(:title) ? image.... | ruby | def image_fu(image, geometry = nil, options = {})
return nil if image.blank?
thumbnail_args = options.slice(:strip)
thumbnail_args[:geometry] = geometry if geometry
image_tag_args = (image.thumbnail_dimensions(geometry) rescue {})
image_tag_args[:alt] = image.respond_to?(:title) ? image.... | [
"def",
"image_fu",
"(",
"image",
",",
"geometry",
"=",
"nil",
",",
"options",
"=",
"{",
"}",
")",
"return",
"nil",
"if",
"image",
".",
"blank?",
"thumbnail_args",
"=",
"options",
".",
"slice",
"(",
":strip",
")",
"thumbnail_args",
"[",
":geometry",
"]",
... | image_fu is a helper for inserting an image that has been uploaded into a template.
Say for example that we had a @model.image (@model having a belongs_to :image relationship)
and we wanted to display a thumbnail cropped to 200x200 then we can use image_fu like this:
<%= image_fu @model.image, '200x200' %> or with n... | [
"image_fu",
"is",
"a",
"helper",
"for",
"inserting",
"an",
"image",
"that",
"has",
"been",
"uploaded",
"into",
"a",
"template",
".",
"Say",
"for",
"example",
"that",
"we",
"had",
"a"
] | 67f117f937c5264ec0aeabe8e7eac1d562c5bc7b | https://github.com/refinery/refinerycms/blob/67f117f937c5264ec0aeabe8e7eac1d562c5bc7b/core/app/helpers/refinery/image_helper.rb#L23-L33 | train | Returns the image_tag for the image | [
30522,
13366,
3746,
1035,
11865,
1006,
3746,
1010,
10988,
1027,
9152,
2140,
1010,
7047,
1027,
1063,
1065,
1007,
2709,
9152,
2140,
2065,
3746,
1012,
8744,
1029,
7639,
25464,
1035,
12098,
5620,
1027,
7047,
1012,
14704,
1006,
1024,
6167,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_gateways.rb | Azure::Network::Mgmt::V2019_02_01.ApplicationGateways.begin_backend_health_on_demand_with_http_info | def begin_backend_health_on_demand_with_http_info(resource_group_name, application_gateway_name, probe_request, expand:nil, custom_headers:nil)
begin_backend_health_on_demand_async(resource_group_name, application_gateway_name, probe_request, expand:expand, custom_headers:custom_headers).value!
end | ruby | def begin_backend_health_on_demand_with_http_info(resource_group_name, application_gateway_name, probe_request, expand:nil, custom_headers:nil)
begin_backend_health_on_demand_async(resource_group_name, application_gateway_name, probe_request, expand:expand, custom_headers:custom_headers).value!
end | [
"def",
"begin_backend_health_on_demand_with_http_info",
"(",
"resource_group_name",
",",
"application_gateway_name",
",",
"probe_request",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"begin_backend_health_on_demand_async",
"(",
"resource_group_name",
",... | Gets the backend health for given combination of backend pool and http
setting 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 probe_request [Applicatio... | [
"Gets",
"the",
"backend",
"health",
"for",
"given",
"combination",
"of",
"backend",
"pool",
"and",
"http",
"setting",
"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#L1830-L1832 | train | Gets the backend health of the specified application gateway. | [
30522,
13366,
4088,
1035,
2067,
10497,
1035,
2740,
1035,
2006,
1035,
5157,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4646,
1035,
11909,
1035,
2171,
1010,
15113,
1035,
5227,
1010,
7818,
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... |
awesome-print/awesome_print | lib/awesome_print/ext/nokogiri.rb | AwesomePrint.Nokogiri.cast_with_nokogiri | def cast_with_nokogiri(object, type)
cast = cast_without_nokogiri(object, type)
if (defined?(::Nokogiri::XML::Node) && object.is_a?(::Nokogiri::XML::Node)) ||
(defined?(::Nokogiri::XML::NodeSet) && object.is_a?(::Nokogiri::XML::NodeSet))
cast = :nokogiri_xml_node
end
cast
en... | ruby | def cast_with_nokogiri(object, type)
cast = cast_without_nokogiri(object, type)
if (defined?(::Nokogiri::XML::Node) && object.is_a?(::Nokogiri::XML::Node)) ||
(defined?(::Nokogiri::XML::NodeSet) && object.is_a?(::Nokogiri::XML::NodeSet))
cast = :nokogiri_xml_node
end
cast
en... | [
"def",
"cast_with_nokogiri",
"(",
"object",
",",
"type",
")",
"cast",
"=",
"cast_without_nokogiri",
"(",
"object",
",",
"type",
")",
"if",
"(",
"defined?",
"(",
"::",
"Nokogiri",
"::",
"XML",
"::",
"Node",
")",
"&&",
"object",
".",
"is_a?",
"(",
"::",
... | Add Nokogiri XML Node and NodeSet names to the dispatcher pipeline.
------------------------------------------------------------------------------ | [
"Add",
"Nokogiri",
"XML",
"Node",
"and",
"NodeSet",
"names",
"to",
"the",
"dispatcher",
"pipeline",
".",
"------------------------------------------------------------------------------"
] | 4564fd74721562cbef2443f7d97109bf9192343d | https://github.com/awesome-print/awesome_print/blob/4564fd74721562cbef2443f7d97109bf9192343d/lib/awesome_print/ext/nokogiri.rb#L16-L23 | train | Casts the given object with Nokogiri | [
30522,
13366,
3459,
1035,
2007,
1035,
2053,
3683,
23243,
1006,
4874,
1010,
2828,
1007,
3459,
1027,
3459,
1035,
2302,
1035,
2053,
3683,
23243,
1006,
4874,
1010,
2828,
1007,
2065,
1006,
4225,
1029,
1006,
1024,
1024,
2053,
3683,
23243,
1024,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/drawing/drawing.rb | Axlsx.Drawing.hyperlinks | def hyperlinks
links = self.images.select { |a| a.hyperlink.is_a?(Hyperlink) }
links.map { |a| a.hyperlink }
end | ruby | def hyperlinks
links = self.images.select { |a| a.hyperlink.is_a?(Hyperlink) }
links.map { |a| a.hyperlink }
end | [
"def",
"hyperlinks",
"links",
"=",
"self",
".",
"images",
".",
"select",
"{",
"|",
"a",
"|",
"a",
".",
"hyperlink",
".",
"is_a?",
"(",
"Hyperlink",
")",
"}",
"links",
".",
"map",
"{",
"|",
"a",
"|",
"a",
".",
"hyperlink",
"}",
"end"
] | An array of hyperlink objects associated with this drawings images
@return [Array] | [
"An",
"array",
"of",
"hyperlink",
"objects",
"associated",
"with",
"this",
"drawings",
"images"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/drawing.rb#L111-L114 | train | Returns an array of Hyperlink objects for the image. | [
30522,
13366,
23760,
13767,
2015,
6971,
1027,
2969,
1012,
4871,
1012,
7276,
1063,
1064,
1037,
1064,
1037,
1012,
23760,
13767,
1012,
2003,
1035,
1037,
1029,
1006,
23760,
13767,
1007,
1065,
6971,
1012,
4949,
1063,
1064,
1037,
1064,
1037,
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/2018-07-01/generated/azure_mgmt_network/route_filter_rules.rb | Azure::Network::Mgmt::V2018_07_01.RouteFilterRules.update | def update(resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers:nil)
response = update_async(resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update(resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers:nil)
response = update_async(resource_group_name, route_filter_name, rule_name, route_filter_rule_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update",
"(",
"resource_group_name",
",",
"route_filter_name",
",",
"rule_name",
",",
"route_filter_rule_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"resource_group_name",
",",
"route_filter_name",
",",
"rule_name",... | Updates a route in the specified route filter.
@param resource_group_name [String] The name of the resource group.
@param route_filter_name [String] The name of the route filter.
@param rule_name [String] The name of the route filter rule.
@param route_filter_rule_parameters [PatchRouteFilterRule] Parameters
supp... | [
"Updates",
"a",
"route",
"in",
"the",
"specified",
"route",
"filter",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/route_filter_rules.rb#L221-L224 | train | Updates a route filter rule. | [
30522,
13366,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2799,
1035,
11307,
1035,
2171,
1010,
3627,
1035,
2171,
1010,
2799,
1035,
11307,
1035,
3627,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/user_policy.rb | Aws::IAM.UserPolicy.put | def put(options = {})
options = options.merge(
user_name: @user_name,
policy_name: @name
)
resp = @client.put_user_policy(options)
resp.data
end | ruby | def put(options = {})
options = options.merge(
user_name: @user_name,
policy_name: @name
)
resp = @client.put_user_policy(options)
resp.data
end | [
"def",
"put",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"user_name",
":",
"@user_name",
",",
"policy_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"put_user_policy",
"(",
"options",
")",
"resp",
".",
"da... | @example Request syntax with placeholder values
user_policy.put({
policy_document: "policyDocumentType", # required
})
@param [Hash] options ({})
@option options [required, String] :policy_document
The policy document.
The [regex pattern][1] used to validate this parameter is a string of
charact... | [
"@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#L222-L229 | train | Put a user policy | [
30522,
13366,
2404,
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,
2404,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby-git/ruby-git | lib/git/base.rb | Git.Base.is_local_branch? | def is_local_branch?(branch)
branch_names = self.branches.local.map {|b| b.name}
branch_names.include?(branch)
end | ruby | def is_local_branch?(branch)
branch_names = self.branches.local.map {|b| b.name}
branch_names.include?(branch)
end | [
"def",
"is_local_branch?",
"(",
"branch",
")",
"branch_names",
"=",
"self",
".",
"branches",
".",
"local",
".",
"map",
"{",
"|",
"b",
"|",
"b",
".",
"name",
"}",
"branch_names",
".",
"include?",
"(",
"branch",
")",
"end"
] | returns +true+ if the branch exists locally | [
"returns",
"+",
"true",
"+",
"if",
"the",
"branch",
"exists",
"locally"
] | 9bd4407c56068e1604f14a1b6c0c5a84868e6378 | https://github.com/ruby-git/ruby-git/blob/9bd4407c56068e1604f14a1b6c0c5a84868e6378/lib/git/base.rb#L163-L166 | train | Returns true if the branch is local | [
30522,
13366,
2003,
1035,
2334,
1035,
3589,
1029,
1006,
3589,
1007,
3589,
1035,
3415,
1027,
2969,
1012,
5628,
1012,
2334,
1012,
4949,
1063,
1064,
1038,
1064,
1038,
1012,
2171,
1065,
3589,
1035,
3415,
1012,
2421,
1029,
1006,
3589,
1007,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/linter.rb | HamlLint.Linter.following_node_line | def following_node_line(node)
[
[node.children.first, next_node(node)].compact.map(&:line),
@document.source_lines.count + 1,
].flatten.min
end | ruby | def following_node_line(node)
[
[node.children.first, next_node(node)].compact.map(&:line),
@document.source_lines.count + 1,
].flatten.min
end | [
"def",
"following_node_line",
"(",
"node",
")",
"[",
"[",
"node",
".",
"children",
".",
"first",
",",
"next_node",
"(",
"node",
")",
"]",
".",
"compact",
".",
"map",
"(",
":line",
")",
",",
"@document",
".",
"source_lines",
".",
"count",
"+",
"1",
",... | Returns the line of the "following node" (child of this node or sibling or
the last line in the file).
@param node [HamlLint::Tree::Node] | [
"Returns",
"the",
"line",
"of",
"the",
"following",
"node",
"(",
"child",
"of",
"this",
"node",
"or",
"sibling",
"or",
"the",
"last",
"line",
"in",
"the",
"file",
")",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/linter.rb#L167-L172 | train | Returns the number of lines following the given node. | [
30522,
13366,
2206,
1035,
13045,
1035,
2240,
1006,
13045,
1007,
1031,
1031,
13045,
1012,
2336,
1012,
2034,
1010,
2279,
1035,
13045,
1006,
13045,
1007,
1033,
1012,
9233,
1012,
4949,
1006,
1004,
1024,
2240,
1007,
1010,
1030,
6254,
1012,
3120,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.remove_replica_with_http_info | def remove_replica_with_http_info(node_name, partition_id, replica_id, force_remove:nil, timeout:60, custom_headers:nil)
remove_replica_async(node_name, partition_id, replica_id, force_remove:force_remove, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def remove_replica_with_http_info(node_name, partition_id, replica_id, force_remove:nil, timeout:60, custom_headers:nil)
remove_replica_async(node_name, partition_id, replica_id, force_remove:force_remove, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"remove_replica_with_http_info",
"(",
"node_name",
",",
"partition_id",
",",
"replica_id",
",",
"force_remove",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"remove_replica_async",
"(",
"node_name",
",",
"partition_id",
","... | Removes a service replica running on a node.
This API simulates a Service Fabric replica failure by removing a replica
from a Service Fabric cluster. The removal closes the replica, transitions
the replica to the role None, and then removes all of the state information
of the replica from the cluster. This API tes... | [
"Removes",
"a",
"service",
"replica",
"running",
"on",
"a",
"node",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L15882-L15884 | train | Remove a replica from the node. | [
30522,
13366,
6366,
1035,
15059,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13045,
1035,
2171,
1010,
13571,
1035,
8909,
1010,
15059,
1035,
8909,
1010,
2486,
1035,
6366,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
3438,
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... |
sds/scss-lint | lib/scss_lint/control_comment_processor.rb | SCSSLint.ControlCommentProcessor.before_node_visit | def before_node_visit(node)
return unless (commands = Array(extract_commands(node))).any?
commands.each do |command|
linters = command[:linters]
next unless linters.include?('all') || linters.include?(@linter.name)
process_command(command, node)
# Is the control comment th... | ruby | def before_node_visit(node)
return unless (commands = Array(extract_commands(node))).any?
commands.each do |command|
linters = command[:linters]
next unless linters.include?('all') || linters.include?(@linter.name)
process_command(command, node)
# Is the control comment th... | [
"def",
"before_node_visit",
"(",
"node",
")",
"return",
"unless",
"(",
"commands",
"=",
"Array",
"(",
"extract_commands",
"(",
"node",
")",
")",
")",
".",
"any?",
"commands",
".",
"each",
"do",
"|",
"command",
"|",
"linters",
"=",
"command",
"[",
":linte... | Executed before a node has been visited.
@param node [Sass::Tree::Node] | [
"Executed",
"before",
"a",
"node",
"has",
"been",
"visited",
"."
] | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/control_comment_processor.rb#L22-L38 | train | This method is called before visiting a node | [
30522,
13366,
2077,
1035,
13045,
1035,
3942,
1006,
13045,
1007,
2709,
4983,
1006,
10954,
1027,
9140,
1006,
14817,
1035,
10954,
1006,
13045,
1007,
1007,
1007,
1012,
2151,
1029,
10954,
1012,
2169,
2079,
1064,
3094,
1064,
11409,
7747,
1027,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
boazsegev/combine_pdf | lib/combine_pdf/pdf_protected.rb | CombinePDF.PDF.add_referenced | def add_referenced()
# an existing object map
resolved = {}.dup
existing = {}.dup
should_resolve = [].dup
#set all existing objects as resolved and register their children for future resolution
@objects.each { |obj| existing[obj] = obj ; resolved[obj.object_id] = obj; should_resolve ... | ruby | def add_referenced()
# an existing object map
resolved = {}.dup
existing = {}.dup
should_resolve = [].dup
#set all existing objects as resolved and register their children for future resolution
@objects.each { |obj| existing[obj] = obj ; resolved[obj.object_id] = obj; should_resolve ... | [
"def",
"add_referenced",
"(",
")",
"# an existing object map",
"resolved",
"=",
"{",
"}",
".",
"dup",
"existing",
"=",
"{",
"}",
".",
"dup",
"should_resolve",
"=",
"[",
"]",
".",
"dup",
"#set all existing objects as resolved and register their children for future resolu... | RECORSIVE_PROTECTION = { Parent: true, Last: true}.freeze
@private
Some PDF objects contain references to other PDF objects.
this function adds the references contained in these objects.
this is used for internal operations, such as injectng data using the << operator. | [
"RECORSIVE_PROTECTION",
"=",
"{",
"Parent",
":",
"true",
"Last",
":",
"true",
"}",
".",
"freeze",
"@private",
"Some",
"PDF",
"objects",
"contain",
"references",
"to",
"other",
"PDF",
"objects",
"."
] | 09054051019c069f551f3e60be789577c0f93900 | https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/pdf_protected.rb#L22-L62 | train | Add the referenced objects to the resolved object map | [
30522,
13366,
5587,
1035,
14964,
1006,
1007,
1001,
2019,
4493,
4874,
4949,
10395,
1027,
1063,
1065,
1012,
4241,
2361,
4493,
1027,
1063,
1065,
1012,
4241,
2361,
2323,
1035,
10663,
1027,
1031,
1033,
1012,
4241,
2361,
1001,
2275,
2035,
4493,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/models/order_fulfillment.rb | SquareConnect.OrderFulfillment.state= | def state=(state)
validator = EnumAttributeValidator.new('String', ["PROPOSED", "RESERVED", "PREPARED", "COMPLETED", "CANCELED", "FAILED"])
unless validator.valid?(state)
fail ArgumentError, "invalid value for 'state', must be one of #{validator.allowable_values}."
end
@state = state
... | ruby | def state=(state)
validator = EnumAttributeValidator.new('String', ["PROPOSED", "RESERVED", "PREPARED", "COMPLETED", "CANCELED", "FAILED"])
unless validator.valid?(state)
fail ArgumentError, "invalid value for 'state', must be one of #{validator.allowable_values}."
end
@state = state
... | [
"def",
"state",
"=",
"(",
"state",
")",
"validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"PROPOSED\"",
",",
"\"RESERVED\"",
",",
"\"PREPARED\"",
",",
"\"COMPLETED\"",
",",
"\"CANCELED\"",
",",
"\"FAILED\"",
"]",
")",
"unless... | Custom attribute writer method checking allowed values (enum).
@param [Object] state Object to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"checking",
"allowed",
"values",
"(",
"enum",
")",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/order_fulfillment.rb#L115-L121 | train | Set the state of the resource. | [
30522,
13366,
2110,
1027,
1006,
2110,
1007,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
3818,
1000,
1010,
1000,
9235,
1000,
1010,
1000,
4810,
1000,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | fastlane_core/lib/fastlane_core/project.rb | FastlaneCore.Project.schemes | def schemes
@schemes ||= if workspace?
workspace.schemes.reject do |k, v|
v.include?("Pods/Pods.xcodeproj")
end.keys
else
Xcodeproj::Project.schemes(path)
end
end | ruby | def schemes
@schemes ||= if workspace?
workspace.schemes.reject do |k, v|
v.include?("Pods/Pods.xcodeproj")
end.keys
else
Xcodeproj::Project.schemes(path)
end
end | [
"def",
"schemes",
"@schemes",
"||=",
"if",
"workspace?",
"workspace",
".",
"schemes",
".",
"reject",
"do",
"|",
"k",
",",
"v",
"|",
"v",
".",
"include?",
"(",
"\"Pods/Pods.xcodeproj\"",
")",
"end",
".",
"keys",
"else",
"Xcodeproj",
"::",
"Project",
".",
... | Get all available schemes in an array | [
"Get",
"all",
"available",
"schemes",
"in",
"an",
"array"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane_core/lib/fastlane_core/project.rb#L118-L126 | train | Returns the list of schemes that are available for this project. | [
30522,
13366,
11683,
1030,
11683,
1064,
1064,
1027,
2065,
2573,
15327,
1029,
2573,
15327,
1012,
11683,
1012,
15454,
2079,
1064,
1047,
1010,
1058,
1064,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/data/channel.rb | Discordrb.Channel.delete_overwrite | def delete_overwrite(target, reason = nil)
raise 'Tried deleting a overwrite for an invalid target' unless target.is_a?(Member) || target.is_a?(User) || target.is_a?(Role) || target.is_a?(Profile) || target.is_a?(Recipient) || target.respond_to?(:resolve_id)
API::Channel.delete_permission(@bot.token, @id, ... | ruby | def delete_overwrite(target, reason = nil)
raise 'Tried deleting a overwrite for an invalid target' unless target.is_a?(Member) || target.is_a?(User) || target.is_a?(Role) || target.is_a?(Profile) || target.is_a?(Recipient) || target.respond_to?(:resolve_id)
API::Channel.delete_permission(@bot.token, @id, ... | [
"def",
"delete_overwrite",
"(",
"target",
",",
"reason",
"=",
"nil",
")",
"raise",
"'Tried deleting a overwrite for an invalid target'",
"unless",
"target",
".",
"is_a?",
"(",
"Member",
")",
"||",
"target",
".",
"is_a?",
"(",
"User",
")",
"||",
"target",
".",
... | Deletes a permission overwrite for this channel
@param target [Member, User, Role, Profile, Recipient, #resolve_id] What permission overwrite to delete
@param reason [String] The reason the for the overwrite deletion. | [
"Deletes",
"a",
"permission",
"overwrite",
"for",
"this",
"channel"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/channel.rb#L482-L486 | train | Delete a permission for a channel | [
30522,
13366,
3972,
12870,
1035,
2058,
26373,
1006,
4539,
1010,
3114,
1027,
9152,
2140,
1007,
5333,
1005,
2699,
3972,
20624,
3070,
1037,
2058,
26373,
2005,
2019,
19528,
4539,
1005,
4983,
4539,
1012,
2003,
1035,
1037,
1029,
1006,
2266,
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... |
ankane/pgsync | lib/pgsync/client.rb | PgSync.Client.perform | def perform
return if @exit
args, opts = @arguments, @options
[:to, :from, :to_safe, :exclude, :schemas].each do |opt|
opts[opt] ||= config[opt.to_s]
end
map_deprecations(args, opts)
if opts[:init]
setup(db_config_file(args[0]) || config_file || ".pgsync.yml")
... | ruby | def perform
return if @exit
args, opts = @arguments, @options
[:to, :from, :to_safe, :exclude, :schemas].each do |opt|
opts[opt] ||= config[opt.to_s]
end
map_deprecations(args, opts)
if opts[:init]
setup(db_config_file(args[0]) || config_file || ".pgsync.yml")
... | [
"def",
"perform",
"return",
"if",
"@exit",
"args",
",",
"opts",
"=",
"@arguments",
",",
"@options",
"[",
":to",
",",
":from",
",",
":to_safe",
",",
":exclude",
",",
":schemas",
"]",
".",
"each",
"do",
"|",
"opt",
"|",
"opts",
"[",
"opt",
"]",
"||=",
... | TODO clean up this mess | [
"TODO",
"clean",
"up",
"this",
"mess"
] | 2aa4741538ca09070efe86de6dd1281e13a1b5c5 | https://github.com/ankane/pgsync/blob/2aa4741538ca09070efe86de6dd1281e13a1b5c5/lib/pgsync/client.rb#L12-L28 | train | Perform the necessary tasks | [
30522,
13366,
4685,
2709,
2065,
1030,
6164,
12098,
5620,
1010,
23569,
2015,
1027,
1030,
9918,
1010,
1030,
7047,
1031,
1024,
2000,
1010,
1024,
2013,
1010,
1024,
2000,
1035,
3647,
1010,
1024,
23329,
1010,
1024,
8040,
28433,
2015,
1033,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_tde_certificates.rb | Azure::SQL::Mgmt::V2017_10_01_preview.ManagedInstanceTdeCertificates.begin_create | def begin_create(resource_group_name, managed_instance_name, parameters, custom_headers:nil)
response = begin_create_async(resource_group_name, managed_instance_name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def begin_create(resource_group_name, managed_instance_name, parameters, custom_headers:nil)
response = begin_create_async(resource_group_name, managed_instance_name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_create",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_async",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"parameters",
",",
"custom_h... | Creates a TDE certificate for a given server.
@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 managed_instance_name [String] The name of the managed instance.
@param parameters [TdeCe... | [
"Creates",
"a",
"TDE",
"certificate",
"for",
"a",
"given",
"server",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_tde_certificates.rb#L86-L89 | train | Creates a managed instance. | [
30522,
13366,
4088,
1035,
3443,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
6013,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3443,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_deployed_application_info | def get_deployed_application_info(node_name, application_id, timeout:60, include_health_state:false, custom_headers:nil)
response = get_deployed_application_info_async(node_name, application_id, timeout:timeout, include_health_state:include_health_state, custom_headers:custom_headers).value!
response.body u... | ruby | def get_deployed_application_info(node_name, application_id, timeout:60, include_health_state:false, custom_headers:nil)
response = get_deployed_application_info_async(node_name, application_id, timeout:timeout, include_health_state:include_health_state, custom_headers:custom_headers).value!
response.body u... | [
"def",
"get_deployed_application_info",
"(",
"node_name",
",",
"application_id",
",",
"timeout",
":",
"60",
",",
"include_health_state",
":",
"false",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_deployed_application_info_async",
"(",
"node_name",
","... | Gets the information about an application deployed on a Service Fabric node.
Gets the information about an application deployed on a Service Fabric node.
This query returns system application information if the application ID
provided is for system application. Results encompass deployed applications
in active, ac... | [
"Gets",
"the",
"information",
"about",
"an",
"application",
"deployed",
"on",
"a",
"Service",
"Fabric",
"node",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L8578-L8581 | train | Gets the information about the deployment of the application. | [
30522,
13366,
2131,
1035,
7333,
1035,
4646,
1035,
18558,
1006,
13045,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
2421,
1035,
2740,
1035,
2110,
1024,
6270,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongoid | lib/mongoid/reloadable.rb | Mongoid.Reloadable.reload_embedded_document | def reload_embedded_document
extract_embedded_attributes({}.merge(
collection(_root).find(_id: _root._id).read(mode: :primary).first
))
end | ruby | def reload_embedded_document
extract_embedded_attributes({}.merge(
collection(_root).find(_id: _root._id).read(mode: :primary).first
))
end | [
"def",
"reload_embedded_document",
"extract_embedded_attributes",
"(",
"{",
"}",
".",
"merge",
"(",
"collection",
"(",
"_root",
")",
".",
"find",
"(",
"_id",
":",
"_root",
".",
"_id",
")",
".",
"read",
"(",
"mode",
":",
":primary",
")",
".",
"first",
")"... | Reload the embedded document.
@example Reload the document.
document.reload_embedded_document
@return [ Hash ] The reloaded attributes.
@since 2.3.2 | [
"Reload",
"the",
"embedded",
"document",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/reloadable.rb#L73-L77 | train | Reload the document from the database | [
30522,
13366,
2128,
11066,
1035,
11157,
1035,
6254,
14817,
1035,
11157,
1035,
12332,
1006,
1063,
1065,
1012,
13590,
1006,
3074,
1006,
1035,
7117,
1007,
1012,
2424,
1006,
1035,
8909,
1024,
1035,
7117,
1012,
1035,
8909,
1007,
1012,
3191,
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_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.import_certificate_with_http_info | def import_certificate_with_http_info(vault_base_url, certificate_name, base64encoded_certificate, password:nil, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password:password, certificate_po... | ruby | def import_certificate_with_http_info(vault_base_url, certificate_name, base64encoded_certificate, password:nil, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
import_certificate_async(vault_base_url, certificate_name, base64encoded_certificate, password:password, certificate_po... | [
"def",
"import_certificate_with_http_info",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"base64encoded_certificate",
",",
"password",
":",
"nil",
",",
"certificate_policy",
":",
"nil",
",",
"certificate_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
... | Imports a certificate into a specified key vault.
Imports an existing valid certificate, containing a private key, into Azure
Key Vault. The certificate to be imported can be in either PFX or PEM format.
If the certificate is in PEM format the PEM file must contain the key as well
as x509 certificates. This operat... | [
"Imports",
"a",
"certificate",
"into",
"a",
"specified",
"key",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L5337-L5339 | train | Import a certificate into a vault. | [
30522,
13366,
12324,
1035,
8196,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
2918,
21084,
2368,
16044,
2094,
1035,
8196,
1010,
20786,
1024,
9152,
2140,
1010,
8196,
1035,
334... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jekyll/jekyll | lib/jekyll/regenerator.rb | Jekyll.Regenerator.add | def add(path)
return true unless File.exist?(path)
metadata[path] = {
"mtime" => File.mtime(path),
"deps" => [],
}
cache[path] = true
end | ruby | def add(path)
return true unless File.exist?(path)
metadata[path] = {
"mtime" => File.mtime(path),
"deps" => [],
}
cache[path] = true
end | [
"def",
"add",
"(",
"path",
")",
"return",
"true",
"unless",
"File",
".",
"exist?",
"(",
"path",
")",
"metadata",
"[",
"path",
"]",
"=",
"{",
"\"mtime\"",
"=>",
"File",
".",
"mtime",
"(",
"path",
")",
",",
"\"deps\"",
"=>",
"[",
"]",
",",
"}",
"ca... | Add a path to the metadata
Returns true, also on failure. | [
"Add",
"a",
"path",
"to",
"the",
"metadata"
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/regenerator.rb#L40-L48 | train | Add a file to the cache | [
30522,
13366,
5587,
1006,
4130,
1007,
2709,
2995,
4983,
5371,
1012,
4839,
1029,
1006,
4130,
1007,
27425,
1031,
4130,
1033,
1027,
1063,
1000,
11047,
14428,
1000,
1027,
1028,
5371,
1012,
11047,
14428,
1006,
4130,
1007,
1010,
1000,
2139,
4523,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_metric_definitions | def list_metric_definitions(resource_group_name, name, custom_headers:nil)
response = list_metric_definitions_async(resource_group_name, name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_metric_definitions(resource_group_name, name, custom_headers:nil)
response = list_metric_definitions_async(resource_group_name, name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_metric_definitions",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_metric_definitions_async",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Get global metric definitions of an App Service Environment.
Get global metric definitions of an App Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param custom_headers [Hash{String => S... | [
"Get",
"global",
"metric",
"definitions",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L1071-L1074 | train | Gets the metric definitions for a resource group. | [
30522,
13366,
2862,
1035,
12046,
1035,
15182,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
12046,
1035,
15182,
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... |
decidim/decidim | decidim-core/lib/decidim/authorization_form_builder.rb | Decidim.AuthorizationFormBuilder.all_fields | def all_fields
fields = public_attributes.map do |name, type|
@template.content_tag(:div, input_field(name, type), class: "field")
end
safe_join(fields)
end | ruby | def all_fields
fields = public_attributes.map do |name, type|
@template.content_tag(:div, input_field(name, type), class: "field")
end
safe_join(fields)
end | [
"def",
"all_fields",
"fields",
"=",
"public_attributes",
".",
"map",
"do",
"|",
"name",
",",
"type",
"|",
"@template",
".",
"content_tag",
"(",
":div",
",",
"input_field",
"(",
"name",
",",
"type",
")",
",",
"class",
":",
"\"field\"",
")",
"end",
"safe_j... | Renders all form attributes defined by the handler.
Returns a String. | [
"Renders",
"all",
"form",
"attributes",
"defined",
"by",
"the",
"handler",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/authorization_form_builder.rb#L11-L17 | train | Returns all fields | [
30522,
13366,
2035,
1035,
4249,
4249,
1027,
2270,
1035,
12332,
1012,
4949,
2079,
1064,
2171,
1010,
2828,
1064,
1030,
23561,
1012,
4180,
1035,
6415,
1006,
1024,
4487,
2615,
1010,
7953,
1035,
2492,
1006,
2171,
1010,
2828,
1007,
1010,
2465,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
opal/opal | stdlib/racc/parser.rb | Racc.Parser.racc_read_token | def racc_read_token(t, tok, val)
@racc_debug_out.print 'read '
@racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
@racc_debug_out.puts val.inspect
@racc_debug_out.puts
end | ruby | def racc_read_token(t, tok, val)
@racc_debug_out.print 'read '
@racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
@racc_debug_out.puts val.inspect
@racc_debug_out.puts
end | [
"def",
"racc_read_token",
"(",
"t",
",",
"tok",
",",
"val",
")",
"@racc_debug_out",
".",
"print",
"'read '",
"@racc_debug_out",
".",
"print",
"tok",
".",
"inspect",
",",
"'('",
",",
"racc_token2str",
"(",
"t",
")",
",",
"') '",
"@racc_debug_out",
".",
"... | For debugging output | [
"For",
"debugging",
"output"
] | 41aedc0fd62aab00d3c117ba0caf00206bedd981 | https://github.com/opal/opal/blob/41aedc0fd62aab00d3c117ba0caf00206bedd981/stdlib/racc/parser.rb#L555-L560 | train | Read a token from the input stream | [
30522,
13366,
10958,
9468,
1035,
3191,
1035,
19204,
1006,
1056,
1010,
2000,
2243,
1010,
11748,
1007,
1030,
10958,
9468,
1035,
2139,
8569,
2290,
1035,
2041,
1012,
6140,
1005,
3191,
1005,
1030,
10958,
9468,
1035,
2139,
8569,
2290,
1035,
2041,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sunspot/sunspot | sunspot/lib/sunspot/indexer.rb | Sunspot.Indexer.remove_by_id | def remove_by_id(class_name, *ids)
ids.flatten!
@connection.delete_by_id(
ids.map { |id| Adapters::InstanceAdapter.index_id_for(class_name, id) }
)
end | ruby | def remove_by_id(class_name, *ids)
ids.flatten!
@connection.delete_by_id(
ids.map { |id| Adapters::InstanceAdapter.index_id_for(class_name, id) }
)
end | [
"def",
"remove_by_id",
"(",
"class_name",
",",
"*",
"ids",
")",
"ids",
".",
"flatten!",
"@connection",
".",
"delete_by_id",
"(",
"ids",
".",
"map",
"{",
"|",
"id",
"|",
"Adapters",
"::",
"InstanceAdapter",
".",
"index_id_for",
"(",
"class_name",
",",
"id",... | Remove the model from the Solr index by specifying the class and ID | [
"Remove",
"the",
"model",
"from",
"the",
"Solr",
"index",
"by",
"specifying",
"the",
"class",
"and",
"ID"
] | 31dd76cd7a14a4ef7bd541de97483d8cd72ff685 | https://github.com/sunspot/sunspot/blob/31dd76cd7a14a4ef7bd541de97483d8cd72ff685/sunspot/lib/sunspot/indexer.rb#L56-L61 | train | Remove a class from the database | [
30522,
13366,
6366,
1035,
2011,
1035,
8909,
1006,
2465,
1035,
2171,
1010,
1008,
8909,
2015,
1007,
8909,
2015,
1012,
4257,
6528,
999,
1030,
4434,
1012,
3972,
12870,
1035,
2011,
1035,
8909,
1006,
8909,
2015,
1012,
4949,
1063,
1064,
8909,
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... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.ImageList.scene= | def scene=(n)
if n.nil?
Kernel.raise IndexError, 'scene number out of bounds' unless @images.length.zero?
@scene = nil
return @scene
elsif @images.length.zero?
Kernel.raise IndexError, 'scene number out of bounds'
end
n = Integer(n)
Kernel.raise IndexError,... | ruby | def scene=(n)
if n.nil?
Kernel.raise IndexError, 'scene number out of bounds' unless @images.length.zero?
@scene = nil
return @scene
elsif @images.length.zero?
Kernel.raise IndexError, 'scene number out of bounds'
end
n = Integer(n)
Kernel.raise IndexError,... | [
"def",
"scene",
"=",
"(",
"n",
")",
"if",
"n",
".",
"nil?",
"Kernel",
".",
"raise",
"IndexError",
",",
"'scene number out of bounds'",
"unless",
"@images",
".",
"length",
".",
"zero?",
"@scene",
"=",
"nil",
"return",
"@scene",
"elsif",
"@images",
".",
"len... | Allow scene to be set to nil | [
"Allow",
"scene",
"to",
"be",
"set",
"to",
"nil"
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L1271-L1284 | train | Returns the scene number. | [
30522,
13366,
3496,
1027,
1006,
1050,
1007,
2065,
1050,
1012,
9152,
2140,
1029,
16293,
1012,
5333,
5950,
2121,
29165,
1010,
1005,
3496,
2193,
2041,
1997,
19202,
1005,
4983,
1030,
4871,
1012,
3091,
1012,
5717,
1029,
1030,
3496,
1027,
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... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_keys_as_lazy_with_http_info | def get_keys_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | ruby | def get_keys_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_keys_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | [
"def",
"get_keys_as_lazy_with_http_info",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_keys_as_lazy_async",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_headers",
":custom_headers",
")",
... | List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that
contain the public part of a stored key. The LIST operation is applicable to
all key types, however only the base key identifier, attributes, and tags are
provided in the response. Individual versions of... | [
"List",
"keys",
"in",
"the",
"specified",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L9599-L9601 | train | Gets the keys of the specified vault. | [
30522,
13366,
2131,
1035,
6309,
1035,
2004,
1035,
13971,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/scss-lint | lib/scss_lint/linter/qualifying_element.rb | SCSSLint.Linter::QualifyingElement.seq_contains_sel_class? | def seq_contains_sel_class?(seq, selector_class)
seq.members.any? do |simple|
simple.is_a?(selector_class)
end
end | ruby | def seq_contains_sel_class?(seq, selector_class)
seq.members.any? do |simple|
simple.is_a?(selector_class)
end
end | [
"def",
"seq_contains_sel_class?",
"(",
"seq",
",",
"selector_class",
")",
"seq",
".",
"members",
".",
"any?",
"do",
"|",
"simple",
"|",
"simple",
".",
"is_a?",
"(",
"selector_class",
")",
"end",
"end"
] | Checks if a simple sequence contains a
simple selector of a certain class.
@param seq [Sass::Selector::SimpleSequence]
@param selector_class [Sass::Selector::Simple]
@returns [Boolean] | [
"Checks",
"if",
"a",
"simple",
"sequence",
"contains",
"a",
"simple",
"selector",
"of",
"a",
"certain",
"class",
"."
] | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/linter/qualifying_element.rb#L21-L25 | train | Returns true if the given sequence contains the given selector class. | [
30522,
13366,
7367,
4160,
1035,
3397,
1035,
7367,
2140,
1035,
2465,
1029,
1006,
7367,
4160,
1010,
27000,
1035,
2465,
1007,
7367,
4160,
1012,
2372,
1012,
2151,
1029,
2079,
1064,
3722,
1064,
3722,
1012,
2003,
1035,
1037,
1029,
1006,
27000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
phusion/passenger | src/ruby_supportlib/phusion_passenger/utils.rb | PhusionPassenger.Utils.global_backtrace_report | def global_backtrace_report
if Kernel.respond_to?(:caller_for_all_threads)
all_thread_stacks = caller_for_all_threads
elsif Thread.respond_to?(:list) && Thread.public_method_defined?(:backtrace)
all_thread_stacks = {}
Thread.list.each do |thread|
all_thread_stacks[thread] =... | ruby | def global_backtrace_report
if Kernel.respond_to?(:caller_for_all_threads)
all_thread_stacks = caller_for_all_threads
elsif Thread.respond_to?(:list) && Thread.public_method_defined?(:backtrace)
all_thread_stacks = {}
Thread.list.each do |thread|
all_thread_stacks[thread] =... | [
"def",
"global_backtrace_report",
"if",
"Kernel",
".",
"respond_to?",
"(",
":caller_for_all_threads",
")",
"all_thread_stacks",
"=",
"caller_for_all_threads",
"elsif",
"Thread",
".",
"respond_to?",
"(",
":list",
")",
"&&",
"Thread",
".",
"public_method_defined?",
"(",
... | Returns a string which reports the backtraces for all threads,
or if that's not supported the backtrace for the current thread. | [
"Returns",
"a",
"string",
"which",
"reports",
"the",
"backtraces",
"for",
"all",
"threads",
"or",
"if",
"that",
"s",
"not",
"supported",
"the",
"backtrace",
"for",
"the",
"current",
"thread",
"."
] | 970964b53e0ba86959acdf40f06c99b0c4a128ca | https://github.com/phusion/passenger/blob/970964b53e0ba86959acdf40f06c99b0c4a128ca/src/ruby_supportlib/phusion_passenger/utils.rb#L201-L238 | train | Returns a string containing the backtrace dump for the current thread. | [
30522,
13366,
3795,
1035,
2067,
6494,
3401,
1035,
3189,
2065,
16293,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
20587,
30524,
1035,
4225,
1029,
1006,
1024,
2067,
6494,
3401,
1007,
2035,
1035,
11689,
1035,
20829,
1027,
1063,
1065,
11689,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/instance.rb | Aws::EC2.Instance.describe_attribute | def describe_attribute(options = {})
options = options.merge(instance_id: @id)
resp = @client.describe_instance_attribute(options)
resp.data
end | ruby | def describe_attribute(options = {})
options = options.merge(instance_id: @id)
resp = @client.describe_instance_attribute(options)
resp.data
end | [
"def",
"describe_attribute",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"instance_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"describe_instance_attribute",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
instance.describe_attribute({
attribute: "instanceType", # required, accepts instanceType, kernel, ramdisk, userData, disableApiTermination, instanceInitiatedShutdownBehavior, rootDeviceName, blockDeviceMapping, productCodes, sourceDestCheck, groupSet, ebsOptimiz... | [
"@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#L725-L729 | train | Describe the attributes of the instance. | [
30522,
13366,
6235,
1035,
17961,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
6013,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
6235,
1035,
6013,
1035,
17961,
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... |
ruby/rake | lib/rake/file_list.rb | Rake.FileList.excluded_from_list? | def excluded_from_list?(fn)
return true if @exclude_patterns.any? do |pat|
case pat
when Regexp
fn =~ pat
when GLOB_PATTERN
flags = File::FNM_PATHNAME
# Ruby <= 1.9.3 does not support File::FNM_EXTGLOB
flags |= File::FNM_EXTGLOB if defined? File::FNM... | ruby | def excluded_from_list?(fn)
return true if @exclude_patterns.any? do |pat|
case pat
when Regexp
fn =~ pat
when GLOB_PATTERN
flags = File::FNM_PATHNAME
# Ruby <= 1.9.3 does not support File::FNM_EXTGLOB
flags |= File::FNM_EXTGLOB if defined? File::FNM... | [
"def",
"excluded_from_list?",
"(",
"fn",
")",
"return",
"true",
"if",
"@exclude_patterns",
".",
"any?",
"do",
"|",
"pat",
"|",
"case",
"pat",
"when",
"Regexp",
"fn",
"=~",
"pat",
"when",
"GLOB_PATTERN",
"flags",
"=",
"File",
"::",
"FNM_PATHNAME",
"# Ruby <= ... | Should the given file name be excluded from the list?
NOTE: This method was formerly named "exclude?", but Rails
introduced an exclude? method as an array method and setup a
conflict with file list. We renamed the method to avoid
confusion. If you were using "FileList#exclude?" in your user
code, you will need to... | [
"Should",
"the",
"given",
"file",
"name",
"be",
"excluded",
"from",
"the",
"list?"
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/file_list.rb#L364-L379 | train | Returns true if the file is excluded from the list | [
30522,
13366,
12421,
1035,
2013,
1035,
2862,
1029,
1006,
1042,
2078,
1007,
2709,
2995,
2065,
1030,
23329,
1035,
7060,
1012,
2151,
1029,
2079,
1064,
6986,
1064,
2553,
6986,
2043,
19723,
10288,
2361,
1042,
2078,
1027,
1066,
6986,
2043,
1043,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/client.rb | Dalli.Client.multi | def multi
old, Thread.current[:dalli_multi] = Thread.current[:dalli_multi], true
yield
ensure
Thread.current[:dalli_multi] = old
end | ruby | def multi
old, Thread.current[:dalli_multi] = Thread.current[:dalli_multi], true
yield
ensure
Thread.current[:dalli_multi] = old
end | [
"def",
"multi",
"old",
",",
"Thread",
".",
"current",
"[",
":dalli_multi",
"]",
"=",
"Thread",
".",
"current",
"[",
":dalli_multi",
"]",
",",
"true",
"yield",
"ensure",
"Thread",
".",
"current",
"[",
":dalli_multi",
"]",
"=",
"old",
"end"
] | Dalli::Client is the main class which developers will use to interact with
the memcached server. Usage:
Dalli::Client.new(['localhost:11211:10', 'cache-2.example.com:11211:5', '192.168.0.1:22122:5', '/var/run/memcached/socket'],
:threadsafe => true, :failover => true, :expires_in => 300)
serv... | [
"Dalli",
"::",
"Client",
"is",
"the",
"main",
"class",
"which",
"developers",
"will",
"use",
"to",
"interact",
"with",
"the",
"memcached",
"server",
".",
"Usage",
":"
] | 5755dbfd06e333a8239f976d4b10492b4555b726 | https://github.com/petergoldstein/dalli/blob/5755dbfd06e333a8239f976d4b10492b4555b726/lib/dalli/client.rb#L48-L53 | train | This method is used to generate the multi - basis for the block. | [
30522,
13366,
4800,
2214,
1010,
11689,
1012,
2783,
1031,
1024,
17488,
3669,
1035,
4800,
1033,
1027,
11689,
1012,
2783,
1031,
1024,
17488,
3669,
1035,
4800,
1033,
1010,
2995,
10750,
5676,
11689,
1012,
2783,
1031,
1024,
17488,
3669,
1035,
480... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/replication_network_mappings.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2016_08_10.ReplicationNetworkMappings.list_by_replication_networks | def list_by_replication_networks(fabric_name, network_name, custom_headers:nil)
first_page = list_by_replication_networks_as_lazy(fabric_name, network_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_replication_networks(fabric_name, network_name, custom_headers:nil)
first_page = list_by_replication_networks_as_lazy(fabric_name, network_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_replication_networks",
"(",
"fabric_name",
",",
"network_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_replication_networks_as_lazy",
"(",
"fabric_name",
",",
"network_name",
",",
"custom_headers",
":custom_headers",
")",
"firs... | Gets all the network mappings under a network.
Lists all ASR network mappings for the specified network.
@param fabric_name [String] Primary fabric name.
@param network_name [String] Primary network name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP reque... | [
"Gets",
"all",
"the",
"network",
"mappings",
"under",
"a",
"network",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/replication_network_mappings.rb#L128-L131 | train | Gets all the virtual network replication networks. | [
30522,
13366,
2862,
1035,
2011,
1035,
21647,
1035,
6125,
1006,
8313,
1035,
2171,
1010,
2897,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2862,
1035,
2011,
1035,
21647,
1035,
6125,
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... |
slim-template/slim | lib/slim/code_attributes.rb | Slim.CodeAttributes.on_slim_attrvalue | def on_slim_attrvalue(escape, code)
# We perform attribute merging on Array values
if delimiter = options[:merge_attrs][@attr]
tmp = unique_name
[:multi,
[:code, "#{tmp} = #{code}"],
[:if, "Array === #{tmp}",
[:multi,
[:code, "#{tmp} = #{tmp}.flatten"],... | ruby | def on_slim_attrvalue(escape, code)
# We perform attribute merging on Array values
if delimiter = options[:merge_attrs][@attr]
tmp = unique_name
[:multi,
[:code, "#{tmp} = #{code}"],
[:if, "Array === #{tmp}",
[:multi,
[:code, "#{tmp} = #{tmp}.flatten"],... | [
"def",
"on_slim_attrvalue",
"(",
"escape",
",",
"code",
")",
"# We perform attribute merging on Array values",
"if",
"delimiter",
"=",
"options",
"[",
":merge_attrs",
"]",
"[",
"@attr",
"]",
"tmp",
"=",
"unique_name",
"[",
":multi",
",",
"[",
":code",
",",
"\"#{... | Handle attribute expression `[:slim, :attrvalue, escape, code]`
@param [Boolean] escape Escape html
@param [String] code Ruby code
@return [Array] Compiled temple expression | [
"Handle",
"attribute",
"expression",
"[",
":",
"slim",
":",
"attrvalue",
"escape",
"code",
"]"
] | ae8e7338fcfb67256d2f6b50c64fc317210e31a2 | https://github.com/slim-template/slim/blob/ae8e7338fcfb67256d2f6b50c64fc317210e31a2/lib/slim/code_attributes.rb#L49-L65 | train | This method is called when a slim attribute value is set to a string. | [
30522,
13366,
2006,
1035,
11754,
1035,
2012,
16344,
10175,
5657,
1006,
4019,
1010,
3642,
1007,
1001,
2057,
4685,
17961,
16468,
2006,
9140,
5300,
2065,
3972,
27605,
3334,
1027,
7047,
1031,
1024,
13590,
1035,
2012,
16344,
2015,
1033,
1031,
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... |
jhund/filterrific | lib/filterrific/active_record_extension.rb | Filterrific.ActiveRecordExtension.filterrific_find | def filterrific_find(filterrific_param_set)
unless filterrific_param_set.is_a?(Filterrific::ParamSet)
raise(
ArgumentError,
"Invalid Filterrific::ParamSet: #{ filterrific_param_set.inspect }"
)
end
# Initialize ActiveRecord::Relation
ar_rel = if ActiveRecord:... | ruby | def filterrific_find(filterrific_param_set)
unless filterrific_param_set.is_a?(Filterrific::ParamSet)
raise(
ArgumentError,
"Invalid Filterrific::ParamSet: #{ filterrific_param_set.inspect }"
)
end
# Initialize ActiveRecord::Relation
ar_rel = if ActiveRecord:... | [
"def",
"filterrific_find",
"(",
"filterrific_param_set",
")",
"unless",
"filterrific_param_set",
".",
"is_a?",
"(",
"Filterrific",
"::",
"ParamSet",
")",
"raise",
"(",
"ArgumentError",
",",
"\"Invalid Filterrific::ParamSet: #{ filterrific_param_set.inspect }\"",
")",
"end",
... | Returns ActiveRecord relation based on filterrific_param_set.
Use like so: `ModelClass.filterrific_find(@filterrific)`
@param filterrific_param_set [Filterrific::ParamSet]
@return [ActiveRecord::Relation] with filters applied | [
"Returns",
"ActiveRecord",
"relation",
"based",
"on",
"filterrific_param_set",
".",
"Use",
"like",
"so",
":",
"ModelClass",
".",
"filterrific_find",
"(",
"@filterrific",
")"
] | 811edc57d3e2a3e538c1f0e9554e0909be052881 | https://github.com/jhund/filterrific/blob/811edc57d3e2a3e538c1f0e9554e0909be052881/lib/filterrific/active_record_extension.rb#L45-L70 | train | Find a relation by filtering the given param set | [
30522,
13366,
11307,
3089,
8873,
2278,
1035,
2424,
1006,
11307,
3089,
8873,
2278,
1035,
11498,
2213,
1035,
2275,
1007,
4983,
11307,
3089,
8873,
2278,
1035,
11498,
2213,
1035,
2275,
1012,
2003,
1035,
1037,
1029,
1006,
11307,
3089,
8873,
2278... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Devices.authorize_for_service_encryption_key_rollover | def authorize_for_service_encryption_key_rollover(device_name, resource_group_name, manager_name, custom_headers:nil)
response = authorize_for_service_encryption_key_rollover_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | ruby | def authorize_for_service_encryption_key_rollover(device_name, resource_group_name, manager_name, custom_headers:nil)
response = authorize_for_service_encryption_key_rollover_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"authorize_for_service_encryption_key_rollover",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"authorize_for_service_encryption_key_rollover_async",
"(",
"device_name",
",",
"resource_group_... | Authorizes the specified device for service data encryption key rollover.
@param device_name [String] The device name
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added... | [
"Authorizes",
"the",
"specified",
"device",
"for",
"service",
"data",
"encryption",
"key",
"rollover",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb#L437-L440 | train | Authorize for service encryption key rollover. | [
30522,
13366,
3166,
4697,
1035,
2005,
1035,
2326,
1035,
21999,
1035,
3145,
1035,
4897,
7840,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
lostisland/faraday | lib/faraday/options.rb | Faraday.Options.to_hash | def to_hash
hash = {}
members.each do |key|
value = send(key)
hash[key.to_sym] = value unless value.nil?
end
hash
end | ruby | def to_hash
hash = {}
members.each do |key|
value = send(key)
hash[key.to_sym] = value unless value.nil?
end
hash
end | [
"def",
"to_hash",
"hash",
"=",
"{",
"}",
"members",
".",
"each",
"do",
"|",
"key",
"|",
"value",
"=",
"send",
"(",
"key",
")",
"hash",
"[",
"key",
".",
"to_sym",
"]",
"=",
"value",
"unless",
"value",
".",
"nil?",
"end",
"hash",
"end"
] | Public | [
"Public"
] | 3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70 | https://github.com/lostisland/faraday/blob/3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70/lib/faraday/options.rb#L138-L145 | train | Returns a hash of the object. | [
30522,
13366,
2000,
1035,
23325,
23325,
1027,
1063,
1065,
2372,
1012,
2169,
2079,
1064,
3145,
1064,
3643,
1027,
4604,
1006,
3145,
1007,
23325,
1031,
3145,
1012,
2000,
1035,
25353,
2213,
1033,
1027,
3643,
4983,
3643,
1012,
9152,
2140,
1029,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.Devices.deactivate | def deactivate(device_name, resource_group_name, manager_name, custom_headers:nil)
response = deactivate_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | ruby | def deactivate(device_name, resource_group_name, manager_name, custom_headers:nil)
response = deactivate_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"deactivate",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"deactivate_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":custom_... | Deactivates the device.
@param device_name [String] The device name
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deactivates",
"the",
"device",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/devices.rb#L523-L526 | train | Deactivates the specified managed network interface. | [
30522,
13366,
26709,
6593,
21466,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
26709,
6593,
21466,
1035,
2004,
6038,
2278,
1006,
5080,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mhenrixon/sidekiq-unique-jobs | lib/sidekiq_unique_jobs/digests.rb | SidekiqUniqueJobs.Digests.del | def del(digest: nil, pattern: nil, count: DEFAULT_COUNT)
return delete_by_pattern(pattern, count: count) if pattern
return delete_by_digest(digest) if digest
raise ArgumentError, "either digest or pattern need to be provided"
end | ruby | def del(digest: nil, pattern: nil, count: DEFAULT_COUNT)
return delete_by_pattern(pattern, count: count) if pattern
return delete_by_digest(digest) if digest
raise ArgumentError, "either digest or pattern need to be provided"
end | [
"def",
"del",
"(",
"digest",
":",
"nil",
",",
"pattern",
":",
"nil",
",",
"count",
":",
"DEFAULT_COUNT",
")",
"return",
"delete_by_pattern",
"(",
"pattern",
",",
"count",
":",
"count",
")",
"if",
"pattern",
"return",
"delete_by_digest",
"(",
"digest",
")",... | Deletes unique digest either by a digest or pattern
@param [String] digest the full digest to delete
@param [String] pattern a key pattern to match with
@param [Integer] count the maximum number
@raise [ArgumentError] when both pattern and digest are nil
@return [Array<String>] with unique digests | [
"Deletes",
"unique",
"digest",
"either",
"by",
"a",
"digest",
"or",
"pattern"
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/digests.rb#L57-L62 | train | Delete the object from the database. | [
30522,
13366,
3972,
1006,
17886,
1024,
9152,
2140,
1010,
5418,
1024,
9152,
2140,
1010,
4175,
1024,
12398,
1035,
4175,
1007,
2709,
3972,
12870,
1035,
2011,
1035,
5418,
1006,
5418,
1010,
4175,
1024,
4175,
1007,
2065,
5418,
2709,
3972,
12870,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.list_site_detectors_slot_as_lazy | def list_site_detectors_slot_as_lazy(resource_group_name, site_name, diagnostic_category, slot, custom_headers:nil)
response = list_site_detectors_slot_async(resource_group_name, site_name, diagnostic_category, slot, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
... | ruby | def list_site_detectors_slot_as_lazy(resource_group_name, site_name, diagnostic_category, slot, custom_headers:nil)
response = list_site_detectors_slot_async(resource_group_name, site_name, diagnostic_category, slot, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
... | [
"def",
"list_site_detectors_slot_as_lazy",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_category",
",",
"slot",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_site_detectors_slot_async",
"(",
"resource_group_name",
",",
"site_name",
",",
... | Get Detectors
Get Detectors
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param diagnostic_category [String] Diagnostic Category
@param slot [String] Slot Name
@param custom_headers [Hash{String => String}] A hash of custom he... | [
"Get",
"Detectors"
] | 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#L3805-L3814 | train | Gets all the detectors for a site. | [
30522,
13366,
2862,
1035,
2609,
1035,
25971,
1035,
10453,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
10453,
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... |
apache/thrift | lib/rb/lib/thrift/protocol/json_protocol.rb | Thrift.JsonProtocol.read_json_string | def read_json_string(skipContext = false)
# This string's characters must match up with the elements in escape_char_vals.
# I don't have '/' on this list even though it appears on www.json.org --
# it is not in the RFC -> it is. See RFC 4627
escape_chars = "\"\\/bfnrt"
# The elements of t... | ruby | def read_json_string(skipContext = false)
# This string's characters must match up with the elements in escape_char_vals.
# I don't have '/' on this list even though it appears on www.json.org --
# it is not in the RFC -> it is. See RFC 4627
escape_chars = "\"\\/bfnrt"
# The elements of t... | [
"def",
"read_json_string",
"(",
"skipContext",
"=",
"false",
")",
"# This string's characters must match up with the elements in escape_char_vals.",
"# I don't have '/' on this list even though it appears on www.json.org --",
"# it is not in the RFC -> it is. See RFC 4627",
"escape_chars",
"="... | Decodes a JSON string, including unescaping, and returns the string via str | [
"Decodes",
"a",
"JSON",
"string",
"including",
"unescaping",
"and",
"returns",
"the",
"string",
"via",
"str"
] | 27d8387c49a49fcf193893f834e9766ae0b051c1 | https://github.com/apache/thrift/blob/27d8387c49a49fcf193893f834e9766ae0b051c1/lib/rb/lib/thrift/protocol/json_protocol.rb#L508-L546 | train | Read a JSON string from the stream. | [
30522,
13366,
3191,
1035,
1046,
3385,
1035,
5164,
1006,
13558,
8663,
18209,
1027,
6270,
1007,
1001,
2023,
5164,
1005,
1055,
3494,
2442,
2674,
2039,
2007,
1996,
3787,
1999,
4019,
1035,
25869,
1035,
11748,
2015,
1012,
1001,
1045,
2123,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
geokit/geokit | lib/geokit/geo_loc.rb | Geokit.GeoLoc.to_geocodeable_s | def to_geocodeable_s
a = [street_address, district, city, state, zip, country_code].compact
a.delete_if { |e| !e || e == '' }
a.join(', ')
end | ruby | def to_geocodeable_s
a = [street_address, district, city, state, zip, country_code].compact
a.delete_if { |e| !e || e == '' }
a.join(', ')
end | [
"def",
"to_geocodeable_s",
"a",
"=",
"[",
"street_address",
",",
"district",
",",
"city",
",",
"state",
",",
"zip",
",",
"country_code",
"]",
".",
"compact",
"a",
".",
"delete_if",
"{",
"|",
"e",
"|",
"!",
"e",
"||",
"e",
"==",
"''",
"}",
"a",
".",... | Returns a comma-delimited string consisting of the street address, city,
state, zip, and country code. Only includes those attributes that are
non-blank. | [
"Returns",
"a",
"comma",
"-",
"delimited",
"string",
"consisting",
"of",
"the",
"street",
"address",
"city",
"state",
"zip",
"and",
"country",
"code",
".",
"Only",
"includes",
"those",
"attributes",
"that",
"are",
"non",
"-",
"blank",
"."
] | b7c13376bd85bf14f9534228ea466d09ac0afbf4 | https://github.com/geokit/geokit/blob/b7c13376bd85bf14f9534228ea466d09ac0afbf4/lib/geokit/geo_loc.rb#L138-L142 | train | Convert the geocodeable object to a geocodeable string. | [
30522,
13366,
2000,
1035,
20248,
16044,
3085,
1035,
1055,
1037,
1027,
1031,
2395,
1035,
4769,
1010,
2212,
1010,
2103,
1010,
2110,
1010,
14101,
1010,
2406,
1035,
3642,
1033,
1012,
9233,
1037,
1012,
3972,
12870,
1035,
30524,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-protobuf/protobuf | lib/protobuf/message.rb | Protobuf.Message.to_hash | def to_hash
result = {}
@values.each_key do |field_name|
field = _protobuf_message_field[field_name]
field.to_message_hash(@values, result)
end
result
end | ruby | def to_hash
result = {}
@values.each_key do |field_name|
field = _protobuf_message_field[field_name]
field.to_message_hash(@values, result)
end
result
end | [
"def",
"to_hash",
"result",
"=",
"{",
"}",
"@values",
".",
"each_key",
"do",
"|",
"field_name",
"|",
"field",
"=",
"_protobuf_message_field",
"[",
"field_name",
"]",
"field",
".",
"to_message_hash",
"(",
"@values",
",",
"result",
")",
"end",
"result",
"end"
... | Return a hash-representation of the given fields for this message type. | [
"Return",
"a",
"hash",
"-",
"representation",
"of",
"the",
"given",
"fields",
"for",
"this",
"message",
"type",
"."
] | a2e0cbb783d49d37648c07d795dc4f7eb8d14eb1 | https://github.com/ruby-protobuf/protobuf/blob/a2e0cbb783d49d37648c07d795dc4f7eb8d14eb1/lib/protobuf/message.rb#L114-L123 | train | Returns a hash of the message fields | [
30522,
13366,
2000,
1035,
23325,
2765,
1027,
1063,
1065,
1030,
5300,
1012,
2169,
1035,
3145,
2079,
1064,
2492,
1035,
2171,
1064,
2492,
1027,
1035,
15053,
8569,
2546,
1035,
4471,
1035,
2492,
1031,
2492,
1035,
2171,
1033,
2492,
1012,
2000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_cluster_configuration_with_http_info | def get_cluster_configuration_with_http_info(configuration_api_version, timeout:60, custom_headers:nil)
get_cluster_configuration_async(configuration_api_version, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_cluster_configuration_with_http_info(configuration_api_version, timeout:60, custom_headers:nil)
get_cluster_configuration_async(configuration_api_version, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_cluster_configuration_with_http_info",
"(",
"configuration_api_version",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_cluster_configuration_async",
"(",
"configuration_api_version",
",",
"timeout",
":",
"timeout",
",",
"custom_headers"... | Get the Service Fabric standalone cluster configuration.
Get the Service Fabric standalone cluster configuration. The cluster
configuration contains properties of the cluster that include different node
types on the cluster,
security configurations, fault and upgrade domain topologies, etc.
@param configuration_... | [
"Get",
"the",
"Service",
"Fabric",
"standalone",
"cluster",
"configuration",
"."
] | 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#L1935-L1937 | train | Gets the configuration of the specified cluster. | [
30522,
13366,
2131,
1035,
9324,
1035,
9563,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
9563,
1035,
17928,
1035,
2544,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
9324,
1035,
9563,
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/2014-04-01/generated/azure_mgmt_sql/elastic_pools.rb | Azure::SQL::Mgmt::V2014_04_01.ElasticPools.list_metrics_with_http_info | def list_metrics_with_http_info(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:nil)
list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:custom_headers).value!
end | ruby | def list_metrics_with_http_info(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:nil)
list_metrics_async(resource_group_name, server_name, elastic_pool_name, filter, custom_headers:custom_headers).value!
end | [
"def",
"list_metrics_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"elastic_pool_name",
",",
"filter",
",",
"custom_headers",
":",
"nil",
")",
"list_metrics_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"elastic_pool_name",
",",
"f... | Returns elastic pool metrics.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param elastic_pool_name [String] The name of the elastic p... | [
"Returns",
"elastic",
"pool",
"metrics",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/elastic_pools.rb#L462-L464 | train | Gets metrics for the elastic pool. | [
30522,
13366,
2862,
1035,
12046,
2015,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
21274,
1035,
4770,
1035,
2171,
1010,
11307,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb | Azure::Labservices::Mgmt::V2018_10_15.LabAccounts.update | def update(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
response = update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
response = update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_account",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_account",
",",
"custom_headers",
":custom_... | Modify properties of lab accounts.
@param resource_group_name [String] The name of the resource group.
@param lab_account_name [String] The name of the lab Account.
@param lab_account [LabAccountFragment] Represents a lab account.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will b... | [
"Modify",
"properties",
"of",
"lab",
"accounts",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb#L498-L501 | train | Updates a lab account s index. | [
30522,
13366,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
1035,
4070,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
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... |
watir/watir | lib/watir/after_hooks.rb | Watir.AfterHooks.run | def run
# We can't just rescue exception because Firefox automatically closes alert when exception raised
return unless @after_hooks.any? && !@browser.alert.exists?
each { |after_hook| after_hook.call(@browser) }
rescue Selenium::WebDriver::Error::NoSuchWindowError => ex
Watir.logger.info "... | ruby | def run
# We can't just rescue exception because Firefox automatically closes alert when exception raised
return unless @after_hooks.any? && !@browser.alert.exists?
each { |after_hook| after_hook.call(@browser) }
rescue Selenium::WebDriver::Error::NoSuchWindowError => ex
Watir.logger.info "... | [
"def",
"run",
"# We can't just rescue exception because Firefox automatically closes alert when exception raised",
"return",
"unless",
"@after_hooks",
".",
"any?",
"&&",
"!",
"@browser",
".",
"alert",
".",
"exists?",
"each",
"{",
"|",
"after_hook",
"|",
"after_hook",
".",
... | Runs after hooks. | [
"Runs",
"after",
"hooks",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/after_hooks.rb#L67-L74 | train | Run after hooks | [
30522,
13366,
2448,
1001,
2057,
2064,
1005,
1056,
2074,
5343,
6453,
2138,
2543,
14876,
2595,
8073,
14572,
9499,
2043,
6453,
2992,
2709,
4983,
1030,
2044,
1035,
18008,
1012,
2151,
1029,
1004,
1004,
999,
1030,
16602,
1012,
9499,
1012,
6526,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.origin= | def origin=(new_origin)
if new_origin
if !new_origin.respond_to?(:to_str)
raise TypeError, "Can't convert #{new_origin.class} into String."
end
new_origin = new_origin.to_str
new_scheme = new_origin[/^([^:\/?#]+):\/\//, 1]
unless new_scheme
raise Invalid... | ruby | def origin=(new_origin)
if new_origin
if !new_origin.respond_to?(:to_str)
raise TypeError, "Can't convert #{new_origin.class} into String."
end
new_origin = new_origin.to_str
new_scheme = new_origin[/^([^:\/?#]+):\/\//, 1]
unless new_scheme
raise Invalid... | [
"def",
"origin",
"=",
"(",
"new_origin",
")",
"if",
"new_origin",
"if",
"!",
"new_origin",
".",
"respond_to?",
"(",
":to_str",
")",
"raise",
"TypeError",
",",
"\"Can't convert #{new_origin.class} into String.\"",
"end",
"new_origin",
"=",
"new_origin",
".",
"to_str"... | Sets the origin for this URI, serialized to ASCII, as per
RFC 6454, section 6.2. This assignment will reset the `userinfo`
component.
@param [String, #to_str] new_origin The new origin component. | [
"Sets",
"the",
"origin",
"for",
"this",
"URI",
"serialized",
"to",
"ASCII",
"as",
"per",
"RFC",
"6454",
"section",
"6",
".",
"2",
".",
"This",
"assignment",
"will",
"reset",
"the",
"userinfo",
"component",
"."
] | 5894c95a7768435cb46d1355954611dbd194832e | https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/uri.rb#L1304-L1335 | train | Sets the origin of the URI. | [
30522,
13366,
4761,
1027,
1006,
2047,
1035,
4761,
1007,
2065,
2047,
1035,
4761,
2065,
999,
2047,
1035,
4761,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
2000,
1035,
2358,
2099,
1007,
5333,
2828,
2121,
29165,
1010,
1000,
2064,
1005,
1056,
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_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb | Azure::IotHub::Mgmt::V2017_01_19.IotHubResource.get_keys_for_key_name | def get_keys_for_key_name(resource_group_name, resource_name, key_name, custom_headers:nil)
response = get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_keys_for_key_name(resource_group_name, resource_name, key_name, custom_headers:nil)
response = get_keys_for_key_name_async(resource_group_name, resource_name, key_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_keys_for_key_name",
"(",
"resource_group_name",
",",
"resource_name",
",",
"key_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_keys_for_key_name_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"key_name",
",",
"custom_hea... | Get a shared access policy by name from an IoT hub. For more information,
see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
Get a shared access policy by name from an IoT hub. For more information,
see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security.
@param resource_grou... | [
"Get",
"a",
"shared",
"access",
"policy",
"by",
"name",
"from",
"an",
"IoT",
"hub",
".",
"For",
"more",
"information",
"see",
":",
"https",
":",
"//",
"docs",
".",
"microsoft",
".",
"com",
"/",
"azure",
"/",
"iot",
"-",
"hub",
"/",
"iot",
"-",
"hub... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb#L1610-L1613 | train | Gets the keys for a given key. | [
30522,
13366,
2131,
1035,
6309,
1035,
2005,
1035,
3145,
1035,
2171,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
3145,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
6309,
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... |
randym/axlsx | lib/axlsx/drawing/line_chart.rb | Axlsx.LineChart.node_name | def node_name
path = self.class.to_s
if i = path.rindex('::')
path = path[(i+2)..-1]
end
path[0] = path[0].chr.downcase
path
end | ruby | def node_name
path = self.class.to_s
if i = path.rindex('::')
path = path[(i+2)..-1]
end
path[0] = path[0].chr.downcase
path
end | [
"def",
"node_name",
"path",
"=",
"self",
".",
"class",
".",
"to_s",
"if",
"i",
"=",
"path",
".",
"rindex",
"(",
"'::'",
")",
"path",
"=",
"path",
"[",
"(",
"i",
"+",
"2",
")",
"..",
"-",
"1",
"]",
"end",
"path",
"[",
"0",
"]",
"=",
"path",
... | The node name to use in serialization. As LineChart is used as the
base class for Liine3DChart we need to be sure to serialize the
chart based on the actual class type and not a fixed node name.
@return [String] | [
"The",
"node",
"name",
"to",
"use",
"in",
"serialization",
".",
"As",
"LineChart",
"is",
"used",
"as",
"the",
"base",
"class",
"for",
"Liine3DChart",
"we",
"need",
"to",
"be",
"sure",
"to",
"serialize",
"the",
"chart",
"based",
"on",
"the",
"actual",
"cl... | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/line_chart.rb#L66-L73 | train | Returns the node name for the given object. | [
30522,
13366,
13045,
1035,
2171,
4130,
1027,
2969,
1012,
2465,
1012,
2000,
1035,
1055,
2065,
1045,
1027,
4130,
1012,
15544,
13629,
2595,
1006,
1005,
1024,
1024,
1005,
1007,
4130,
1027,
4130,
1031,
1006,
1045,
1009,
1016,
1007,
1012,
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_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_composite_entity | def delete_composite_entity(app_id, version_id, c_entity_id, custom_headers:nil)
response = delete_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def delete_composite_entity(app_id, version_id, c_entity_id, custom_headers:nil)
response = delete_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"delete_composite_entity",
"(",
"app_id",
",",
"version_id",
",",
"c_entity_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_composite_entity_async",
"(",
"app_id",
",",
"version_id",
",",
"c_entity_id",
",",
"custom_headers",
":custom_head... | Deletes a composite entity from a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param c_entity_id The composite entity extractor ID.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return... | [
"Deletes",
"a",
"composite",
"entity",
"from",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L2937-L2940 | train | Deletes a composite entity. | [
30522,
13366,
3972,
12870,
1035,
12490,
1035,
9178,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
1039,
1035,
9178,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
12490,
1035,
9178... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
comfy/comfortable-mexican-sofa | lib/comfortable_mexican_sofa/seeds.rb | ComfortableMexicanSofa::Seeds.Importer.parse_file_content | def parse_file_content(file_path)
text = ::File.read(file_path)
tokens = text.split(%r{^\[(.*?)\]\r?\n})
tokens.shift # first item should be blank
tokens.in_groups_of(2).each_with_object({}) do |pair, h|
h[pair[0]] = pair[1]
end
end | ruby | def parse_file_content(file_path)
text = ::File.read(file_path)
tokens = text.split(%r{^\[(.*?)\]\r?\n})
tokens.shift # first item should be blank
tokens.in_groups_of(2).each_with_object({}) do |pair, h|
h[pair[0]] = pair[1]
end
end | [
"def",
"parse_file_content",
"(",
"file_path",
")",
"text",
"=",
"::",
"File",
".",
"read",
"(",
"file_path",
")",
"tokens",
"=",
"text",
".",
"split",
"(",
"%r{",
"\\[",
"\\]",
"\\r",
"\\n",
"}",
")",
"tokens",
".",
"shift",
"# first item should be blank"... | Splitting file content in sections delimited by headers that look like this:
[header]
some content
[header 2]
some more content | [
"Splitting",
"file",
"content",
"in",
"sections",
"delimited",
"by",
"headers",
"that",
"look",
"like",
"this",
":",
"[",
"header",
"]",
"some",
"content",
"[",
"header",
"2",
"]",
"some",
"more",
"content"
] | 38a31428f6e2c07d5bda64f0371eebfb29a3abc4 | https://github.com/comfy/comfortable-mexican-sofa/blob/38a31428f6e2c07d5bda64f0371eebfb29a3abc4/lib/comfortable_mexican_sofa/seeds.rb#L47-L54 | train | Parse the file content | [
30522,
13366,
11968,
3366,
1035,
5371,
1035,
4180,
1006,
5371,
1035,
4130,
1007,
3793,
1027,
1024,
1024,
5371,
1012,
3191,
30524,
5670,
1001,
2034,
8875,
2323,
2022,
8744,
19204,
2015,
1012,
1999,
1035,
2967,
1035,
1997,
1006,
1016,
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-polly/lib/aws-sdk-polly/client.rb | Aws::Polly.Client.synthesize_speech | def synthesize_speech(params = {}, options = {}, &block)
req = build_request(:synthesize_speech, params)
req.send_request(options, &block)
end | ruby | def synthesize_speech(params = {}, options = {}, &block)
req = build_request(:synthesize_speech, params)
req.send_request(options, &block)
end | [
"def",
"synthesize_speech",
"(",
"params",
"=",
"{",
"}",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"req",
"=",
"build_request",
"(",
":synthesize_speech",
",",
"params",
")",
"req",
".",
"send_request",
"(",
"options",
",",
"block",
")",
... | Synthesizes UTF-8 input, plain text or SSML, to a stream of bytes.
SSML input must be valid, well-formed SSML. Some alphabets might not
be available with all the voices (for example, Cyrillic might not be
read at all by English voices) unless phoneme mapping is used. For
more information, see [How it Works][1].
... | [
"Synthesizes",
"UTF",
"-",
"8",
"input",
"plain",
"text",
"or",
"SSML",
"to",
"a",
"stream",
"of",
"bytes",
".",
"SSML",
"input",
"must",
"be",
"valid",
"well",
"-",
"formed",
"SSML",
".",
"Some",
"alphabets",
"might",
"not",
"be",
"available",
"with",
... | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-polly/lib/aws-sdk-polly/client.rb#L940-L943 | train | Synthesize speech | [
30522,
13366,
24203,
2229,
4697,
1035,
4613,
1006,
11498,
5244,
1027,
1063,
1065,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
2128,
4160,
1027,
3857,
1035,
5227,
1006,
1024,
24203,
2229,
4697,
1035,
4613,
1010,
11498,
5244,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.execute_site_analysis_with_http_info | def execute_site_analysis_with_http_info(resource_group_name, site_name, diagnostic_category, analysis_name, start_time:nil, end_time:nil, time_grain:nil, custom_headers:nil)
execute_site_analysis_async(resource_group_name, site_name, diagnostic_category, analysis_name, start_time:start_time, end_time:end_time, t... | ruby | def execute_site_analysis_with_http_info(resource_group_name, site_name, diagnostic_category, analysis_name, start_time:nil, end_time:nil, time_grain:nil, custom_headers:nil)
execute_site_analysis_async(resource_group_name, site_name, diagnostic_category, analysis_name, start_time:start_time, end_time:end_time, t... | [
"def",
"execute_site_analysis_with_http_info",
"(",
"resource_group_name",
",",
"site_name",
",",
"diagnostic_category",
",",
"analysis_name",
",",
"start_time",
":",
"nil",
",",
"end_time",
":",
"nil",
",",
"time_grain",
":",
"nil",
",",
"custom_headers",
":",
"nil... | Execute Analysis
Execute Analysis
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param diagnostic_category [String] Category Name
@param analysis_name [String] Analysis Resource Name
@param start_time [DateTime] Start Time
@pa... | [
"Execute",
"Analysis"
] | 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#L941-L943 | train | Executes analysis on a site. | [
30522,
13366,
15389,
1035,
2609,
1035,
4106,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
4106,
1035,
2171,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.