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_service_bus/lib/2017-04-01/generated/azure_mgmt_service_bus/rules.rb | Azure::ServiceBus::Mgmt::V2017_04_01.Rules.list_by_subscriptions_as_lazy | def list_by_subscriptions_as_lazy(resource_group_name, namespace_name, topic_name, subscription_name, skip:nil, top:nil, custom_headers:nil)
response = list_by_subscriptions_async(resource_group_name, namespace_name, topic_name, subscription_name, skip:skip, top:top, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_subscriptions_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_subscriptions_as_lazy(resource_group_name, namespace_name, topic_name, subscription_name, skip:nil, top:nil, custom_headers:nil)
response = list_by_subscriptions_async(resource_group_name, namespace_name, topic_name, subscription_name, skip:skip, top:top, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_subscriptions_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_subscriptions_as_lazy",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"topic_name",
",",
"subscription_name",
",",
"skip",
":",
"nil",
",",
"top",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_subscriptions_a... | List all the rules within given topic-subscription
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The namespace name
@param topic_name [String] The topic name.
@param subscription_name [String] The subscription name.
@param skip [Integer] Skip is only used if a previous operation returned a
partial result. If a previous response contains a nextLink element, the value
of the nextLink element will include a skip parameter that specifies a
starting point to use for subsequent calls.
@param top [Integer] May be used to limit the number of results to the most
recent N usageDetails.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RuleListResult] which provide lazy access to pages of the response. | [
"List",
"all",
"the",
"rules",
"within",
"given",
"topic",
"-",
"subscription"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_bus/lib/2017-04-01/generated/azure_mgmt_service_bus/rules.rb#L611-L620 | train | Gets the list of all the managed managed | [
30522,
13366,
2862,
1035,
2011,
1035,
15002,
2015,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
8476,
1035,
2171,
1010,
15002,
1035,
2171,
1010,
13558,
1024,
9152,
2140,
1010,
2327,
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... |
rails/rails | actionpack/lib/abstract_controller/rendering.rb | AbstractController.Rendering._normalize_args | def _normalize_args(action = nil, options = {}) # :doc:
if action.respond_to?(:permitted?)
if action.permitted?
action
else
raise ArgumentError, "render parameters are not permitted"
end
elsif action.is_a?(Hash)
action
else
options
end
end | ruby | def _normalize_args(action = nil, options = {}) # :doc:
if action.respond_to?(:permitted?)
if action.permitted?
action
else
raise ArgumentError, "render parameters are not permitted"
end
elsif action.is_a?(Hash)
action
else
options
end
end | [
"def",
"_normalize_args",
"(",
"action",
"=",
"nil",
",",
"options",
"=",
"{",
"}",
")",
"# :doc:",
"if",
"action",
".",
"respond_to?",
"(",
":permitted?",
")",
"if",
"action",
".",
"permitted?",
"action",
"else",
"raise",
"ArgumentError",
",",
"\"render par... | Normalize args by converting <tt>render "foo"</tt> to
<tt>render :action => "foo"</tt> and <tt>render "foo/bar"</tt> to
<tt>render :file => "foo/bar"</tt>. | [
"Normalize",
"args",
"by",
"converting",
"<tt",
">",
"render",
"foo",
"<",
"/",
"tt",
">",
"to",
"<tt",
">",
"render",
":",
"action",
"=",
">",
"foo",
"<",
"/",
"tt",
">",
"and",
"<tt",
">",
"render",
"foo",
"/",
"bar",
"<",
"/",
"tt",
">",
"to... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/abstract_controller/rendering.rb#L78-L90 | train | Normalize the arguments for the render method. | [
30522,
13366,
1035,
3671,
4697,
1035,
12098,
5620,
1006,
2895,
1027,
9152,
2140,
1010,
7047,
1027,
1063,
1065,
1007,
1001,
1024,
9986,
1024,
2065,
2895,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
7936,
1029,
1007,
2065,
2895,
1012,
7936,
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... |
Chris911/iStats | lib/iStats/utils.rb | IStats.Utils.abs_thresholds | def abs_thresholds(scale, max_value)
at = []
scale.each { |v|
at.push(v * max_value)
}
return at
end | ruby | def abs_thresholds(scale, max_value)
at = []
scale.each { |v|
at.push(v * max_value)
}
return at
end | [
"def",
"abs_thresholds",
"(",
"scale",
",",
"max_value",
")",
"at",
"=",
"[",
"]",
"scale",
".",
"each",
"{",
"|",
"v",
"|",
"at",
".",
"push",
"(",
"v",
"*",
"max_value",
")",
"}",
"return",
"at",
"end"
] | Produce a thresholds array containing absolute values based on supplied
percentages applied to a literal max value. | [
"Produce",
"a",
"thresholds",
"array",
"containing",
"absolute",
"values",
"based",
"on",
"supplied",
"percentages",
"applied",
"to",
"a",
"literal",
"max",
"value",
"."
] | 0b86af356baa680cabc5665cc0364de29f1f5958 | https://github.com/Chris911/iStats/blob/0b86af356baa680cabc5665cc0364de29f1f5958/lib/iStats/utils.rb#L15-L21 | train | Returns the absolute threshold values for a given scale | [
30522,
13366,
14689,
1035,
11207,
2015,
1006,
4094,
1010,
4098,
1035,
3643,
1007,
2012,
1027,
1031,
1033,
4094,
1012,
2169,
1063,
1064,
1058,
1064,
2012,
1012,
5245,
1006,
1058,
1008,
4098,
1035,
3643,
1007,
1065,
2709,
2012,
2203,
102,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/app/helpers/decidim/decidim_form_helper.rb | Decidim.DecidimFormHelper.editor_field_tag | def editor_field_tag(name, value, options = {})
options[:toolbar] ||= "basic"
options[:lines] ||= 10
content_tag(:div, class: "editor") do
template = ""
template += label_tag(name, options[:label]) if options[:label] != false
template += hidden_field_tag(name, value, options)
template += content_tag(:div, nil, class: "editor-container", data: {
toolbar: options[:toolbar]
}, style: "height: #{options[:lines]}rem")
template.html_safe
end
end | ruby | def editor_field_tag(name, value, options = {})
options[:toolbar] ||= "basic"
options[:lines] ||= 10
content_tag(:div, class: "editor") do
template = ""
template += label_tag(name, options[:label]) if options[:label] != false
template += hidden_field_tag(name, value, options)
template += content_tag(:div, nil, class: "editor-container", data: {
toolbar: options[:toolbar]
}, style: "height: #{options[:lines]}rem")
template.html_safe
end
end | [
"def",
"editor_field_tag",
"(",
"name",
",",
"value",
",",
"options",
"=",
"{",
"}",
")",
"options",
"[",
":toolbar",
"]",
"||=",
"\"basic\"",
"options",
"[",
":lines",
"]",
"||=",
"10",
"content_tag",
"(",
":div",
",",
"class",
":",
"\"editor\"",
")",
... | A custom helper to include an editor field without requiring a form object
name - The input name
value - The input value
options - The set of options to send to the field
:label - The Boolean value to create or not the input label (optional) (default: true)
:toolbar - The String value to configure WYSIWYG toolbar. It should be 'basic' or
or 'full' (optional) (default: 'basic')
:lines - The Integer to indicate how many lines should editor have (optional)
Returns a rich editor to be included in an html template. | [
"A",
"custom",
"helper",
"to",
"include",
"an",
"editor",
"field",
"without",
"requiring",
"a",
"form",
"object"
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/decidim_form_helper.rb#L38-L51 | train | Returns a HTML - safe editor field tag | [
30522,
13366,
3559,
1035,
2492,
1035,
6415,
1006,
2171,
1010,
3643,
1010,
7047,
1027,
1063,
1065,
1007,
7047,
1031,
1024,
6994,
8237,
1033,
1064,
1064,
1027,
1000,
3937,
1000,
7047,
1031,
1024,
3210,
1033,
1064,
1064,
1027,
2184,
4180,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Katello/katello | app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb | Katello.Api::Rhsm::CandlepinProxiesController.additional_set_taxonomy | def additional_set_taxonomy
params[:organization_id], original = find_organization(:owner).id, params[:organization_id] if params[:owner].present?
set_taxonomy
params[:organization_id] = original if params[:owner].present?
end | ruby | def additional_set_taxonomy
params[:organization_id], original = find_organization(:owner).id, params[:organization_id] if params[:owner].present?
set_taxonomy
params[:organization_id] = original if params[:owner].present?
end | [
"def",
"additional_set_taxonomy",
"params",
"[",
":organization_id",
"]",
",",
"original",
"=",
"find_organization",
"(",
":owner",
")",
".",
"id",
",",
"params",
"[",
":organization_id",
"]",
"if",
"params",
"[",
":owner",
"]",
".",
"present?",
"set_taxonomy",
... | in case set taxonomy from core was skipped since the User.current was nil at that moment (typically AK was used instead of username/password)
we need to set proper context, unfortunately params[:organization_id] is already overridden again by set_organization_id so we need to
set correct parameter value and then reset it back | [
"in",
"case",
"set",
"taxonomy",
"from",
"core",
"was",
"skipped",
"since",
"the",
"User",
".",
"current",
"was",
"nil",
"at",
"that",
"moment",
"(",
"typically",
"AK",
"was",
"used",
"instead",
"of",
"username",
"/",
"password",
")",
"we",
"need",
"to",... | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/controllers/katello/api/rhsm/candlepin_proxies_controller.rb#L280-L284 | train | set taxonomy
| [
30522,
13366,
3176,
1035,
2275,
1035,
25274,
11498,
5244,
1031,
1024,
3029,
1035,
8909,
1033,
1010,
2434,
1027,
2424,
1035,
3029,
1006,
1024,
3954,
1007,
1012,
8909,
1010,
11498,
5244,
1031,
1024,
3029,
1035,
8909,
1033,
2065,
11498,
5244,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_commerce/lib/2015-06-01-preview/generated/azure_mgmt_commerce/usage_aggregates.rb | Azure::Commerce::Mgmt::V2015_06_01_preview.UsageAggregates.list_with_http_info | def list_with_http_info(reported_start_time, reported_end_time, show_details:nil, aggregation_granularity:nil, continuation_token:nil, custom_headers:nil)
list_async(reported_start_time, reported_end_time, show_details:show_details, aggregation_granularity:aggregation_granularity, continuation_token:continuation_token, custom_headers:custom_headers).value!
end | ruby | def list_with_http_info(reported_start_time, reported_end_time, show_details:nil, aggregation_granularity:nil, continuation_token:nil, custom_headers:nil)
list_async(reported_start_time, reported_end_time, show_details:show_details, aggregation_granularity:aggregation_granularity, continuation_token:continuation_token, custom_headers:custom_headers).value!
end | [
"def",
"list_with_http_info",
"(",
"reported_start_time",
",",
"reported_end_time",
",",
"show_details",
":",
"nil",
",",
"aggregation_granularity",
":",
"nil",
",",
"continuation_token",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_async",
"(",
"report... | Query aggregated Azure subscription consumption data for a date range.
@param reported_start_time [DateTime] The start of the time range to retrieve
data for.
@param reported_end_time [DateTime] The end of the time range to retrieve
data for.
@param show_details [Boolean] `True` returns usage data in instance-level
detail, `false` causes server-side aggregation with fewer details. For
example, if you have 3 website instances, by default you will get 3 line
items for website consumption. If you specify showDetails = false, the data
will be aggregated as a single line item for website consumption within the
time period (for the given subscriptionId, meterId, usageStartTime and
usageEndTime).
@param aggregation_granularity [AggregationGranularity] `Daily` (default)
returns the data in daily granularity, `Hourly` returns the data in hourly
granularity. Possible values include: 'Daily', 'Hourly'
@param continuation_token [String] Used when a continuation token string is
provided in the response body of the previous call, enabling paging through a
large result set. If not present, the data is retrieved from the beginning of
the day/hour (based on the granularity) passed in.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Query",
"aggregated",
"Azure",
"subscription",
"consumption",
"data",
"for",
"a",
"date",
"range",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_commerce/lib/2015-06-01-preview/generated/azure_mgmt_commerce/usage_aggregates.rb#L81-L83 | train | Gets the list of all the available data structures. | [
30522,
13366,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2988,
1035,
2707,
1035,
2051,
1010,
2988,
1035,
2203,
1035,
2051,
1010,
2265,
1035,
4751,
1024,
9152,
2140,
1010,
28041,
1035,
12604,
7934,
3012,
1024,
9152,
2140,
1010,
13633,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
dotless-de/vagrant-vbguest | lib/vagrant-vbguest/command.rb | VagrantVbguest.Command.execute | def execute
options = {
:_method => :run,
:_rebootable => true,
:auto_reboot => false
}
opts = OptionParser.new do |opts|
opts.banner = "Usage: vagrant vbguest [vm-name] "\
"[--do start|rebuild|install] "\
"[--status] "\
"[-f|--force] "\
"[-b|--auto-reboot] "\
"[-R|--no-remote] "\
"[--iso VBoxGuestAdditions.iso] "\
"[--no-cleanup]"
opts.separator ""
opts.on("--do COMMAND", [:start, :rebuild, :install], "Manually `start`, `rebuild` or `install` GuestAdditions.") do |command|
options[:_method] = command
options[:force] = true
end
opts.on("--status", "Print current GuestAdditions status and exit.") do
options[:_method] = :status
options[:_rebootable] = false
end
opts.on("-f", "--force", "Whether to force the installation. (Implied by --do start|rebuild|install)") do
options[:force] = true
end
opts.on("--auto-reboot", "-b", "Allow rebooting the VM after installation. (when GuestAdditions won't start)") do
options[:auto_reboot] = true
end
opts.on("--no-remote", "-R", "Do not attempt do download the iso file from a webserver") do
options[:no_remote] = true
end
opts.on("--iso file_or_uri", "Full path or URI to the VBoxGuestAdditions.iso") do |file_or_uri|
options[:iso_path] = file_or_uri
end
opts.on("--no-cleanup", "Do not run cleanup tasks after installation. (for debugging)") do
options[:no_cleanup] = true
end
build_start_options(opts, options)
end
argv = parse_options(opts)
return if !argv
if argv.empty?
with_target_vms(nil) { |vm| execute_on_vm(vm, options) }
else
argv.each do |vm_name|
with_target_vms(vm_name) { |vm| execute_on_vm(vm, options) }
end
end
end | ruby | def execute
options = {
:_method => :run,
:_rebootable => true,
:auto_reboot => false
}
opts = OptionParser.new do |opts|
opts.banner = "Usage: vagrant vbguest [vm-name] "\
"[--do start|rebuild|install] "\
"[--status] "\
"[-f|--force] "\
"[-b|--auto-reboot] "\
"[-R|--no-remote] "\
"[--iso VBoxGuestAdditions.iso] "\
"[--no-cleanup]"
opts.separator ""
opts.on("--do COMMAND", [:start, :rebuild, :install], "Manually `start`, `rebuild` or `install` GuestAdditions.") do |command|
options[:_method] = command
options[:force] = true
end
opts.on("--status", "Print current GuestAdditions status and exit.") do
options[:_method] = :status
options[:_rebootable] = false
end
opts.on("-f", "--force", "Whether to force the installation. (Implied by --do start|rebuild|install)") do
options[:force] = true
end
opts.on("--auto-reboot", "-b", "Allow rebooting the VM after installation. (when GuestAdditions won't start)") do
options[:auto_reboot] = true
end
opts.on("--no-remote", "-R", "Do not attempt do download the iso file from a webserver") do
options[:no_remote] = true
end
opts.on("--iso file_or_uri", "Full path or URI to the VBoxGuestAdditions.iso") do |file_or_uri|
options[:iso_path] = file_or_uri
end
opts.on("--no-cleanup", "Do not run cleanup tasks after installation. (for debugging)") do
options[:no_cleanup] = true
end
build_start_options(opts, options)
end
argv = parse_options(opts)
return if !argv
if argv.empty?
with_target_vms(nil) { |vm| execute_on_vm(vm, options) }
else
argv.each do |vm_name|
with_target_vms(vm_name) { |vm| execute_on_vm(vm, options) }
end
end
end | [
"def",
"execute",
"options",
"=",
"{",
":_method",
"=>",
":run",
",",
":_rebootable",
"=>",
"true",
",",
":auto_reboot",
"=>",
"false",
"}",
"opts",
"=",
"OptionParser",
".",
"new",
"do",
"|",
"opts",
"|",
"opts",
".",
"banner",
"=",
"\"Usage: vagrant vbgu... | Runs the vbguest installer on the VMs that are represented
by this environment. | [
"Runs",
"the",
"vbguest",
"installer",
"on",
"the",
"VMs",
"that",
"are",
"represented",
"by",
"this",
"environment",
"."
] | 934fd22864c811c951c020cfcfc5c2ef9d79d5ef | https://github.com/dotless-de/vagrant-vbguest/blob/934fd22864c811c951c020cfcfc5c2ef9d79d5ef/lib/vagrant-vbguest/command.rb#L12-L74 | train | Execute the command line options | [
30522,
13366,
15389,
7047,
1027,
1063,
1024,
1035,
4118,
1027,
1028,
1024,
2448,
1010,
1024,
1035,
2128,
27927,
3085,
1027,
1028,
2995,
1010,
1024,
8285,
1035,
2128,
27927,
1027,
1028,
6270,
1065,
23569,
2015,
1027,
5724,
19362,
8043,
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... |
attr-encrypted/attr_encrypted | lib/attr_encrypted.rb | AttrEncrypted.InstanceMethods.evaluated_attr_encrypted_options_for | def evaluated_attr_encrypted_options_for(attribute)
evaluated_options = Hash.new
attributes = encrypted_attributes[attribute.to_sym]
attribute_option_value = attributes[:attribute]
[:if, :unless, :value_present, :allow_empty_value].each do |option|
evaluated_options[option] = evaluate_attr_encrypted_option(attributes[option])
end
evaluated_options[:attribute] = attribute_option_value
evaluated_options.tap do |options|
if options[:if] && !options[:unless] && options[:value_present] || options[:allow_empty_value]
(attributes.keys - evaluated_options.keys).each do |option|
options[option] = evaluate_attr_encrypted_option(attributes[option])
end
unless options[:mode] == :single_iv_and_salt
load_iv_for_attribute(attribute, options)
end
if options[:mode] == :per_attribute_iv_and_salt
load_salt_for_attribute(attribute, options)
end
end
end
end | ruby | def evaluated_attr_encrypted_options_for(attribute)
evaluated_options = Hash.new
attributes = encrypted_attributes[attribute.to_sym]
attribute_option_value = attributes[:attribute]
[:if, :unless, :value_present, :allow_empty_value].each do |option|
evaluated_options[option] = evaluate_attr_encrypted_option(attributes[option])
end
evaluated_options[:attribute] = attribute_option_value
evaluated_options.tap do |options|
if options[:if] && !options[:unless] && options[:value_present] || options[:allow_empty_value]
(attributes.keys - evaluated_options.keys).each do |option|
options[option] = evaluate_attr_encrypted_option(attributes[option])
end
unless options[:mode] == :single_iv_and_salt
load_iv_for_attribute(attribute, options)
end
if options[:mode] == :per_attribute_iv_and_salt
load_salt_for_attribute(attribute, options)
end
end
end
end | [
"def",
"evaluated_attr_encrypted_options_for",
"(",
"attribute",
")",
"evaluated_options",
"=",
"Hash",
".",
"new",
"attributes",
"=",
"encrypted_attributes",
"[",
"attribute",
".",
"to_sym",
"]",
"attribute_option_value",
"=",
"attributes",
"[",
":attribute",
"]",
"[... | Returns attr_encrypted options evaluated in the current object's scope for the attribute specified | [
"Returns",
"attr_encrypted",
"options",
"evaluated",
"in",
"the",
"current",
"object",
"s",
"scope",
"for",
"the",
"attribute",
"specified"
] | 11df93aef14c661dd0c03169d382a0412f93124e | https://github.com/attr-encrypted/attr_encrypted/blob/11df93aef14c661dd0c03169d382a0412f93124e/lib/attr_encrypted.rb#L369-L395 | train | Evaluate encrypted options for the given attribute | [
30522,
13366,
16330,
1035,
2012,
16344,
1035,
4372,
26775,
22571,
3064,
1035,
7047,
1035,
2005,
1006,
17961,
1007,
16330,
1035,
7047,
1027,
23325,
1012,
2047,
12332,
1027,
4372,
26775,
22571,
3064,
1035,
12332,
1031,
17961,
1012,
2000,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_node_health | def get_node_health(node_name, events_health_state_filter:0, timeout:60, custom_headers:nil)
response = get_node_health_async(node_name, events_health_state_filter:events_health_state_filter, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_node_health(node_name, events_health_state_filter:0, timeout:60, custom_headers:nil)
response = get_node_health_async(node_name, events_health_state_filter:events_health_state_filter, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_node_health",
"(",
"node_name",
",",
"events_health_state_filter",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_node_health_async",
"(",
"node_name",
",",
"events_health_state_filter",
":events_health_s... | Gets the health of a Service Fabric node.
Gets the health of a Service Fabric node. Use EventsHealthStateFilter to
filter the collection of health events reported on the node based on the
health state. If the node that you specify by name does not exist in the
health store, this returns an error.
@param node_name [String] The name of the node.
@param events_health_state_filter [Integer] Allows filtering the collection
of HealthEvent objects returned based on health state.
The possible values for this parameter include integer value of one of the
following health states.
Only events that match the filter are returned. All events are used to
evaluate the aggregated health state.
If not specified, all entries are returned. The state values are flag based
enumeration, so the value could be a combination of these value obtained
using bitwise 'OR' operator. For example, If the provided value is 6 then all
of the events with HealthState value of OK (2) and Warning (4) are returned.
- Default - Default value. Matches any HealthState. The value is zero.
- None - Filter that doesn't match any HealthState value. Used in order to
return no results on a given collection of states. The value is 1.
- Ok - Filter that matches input with HealthState value Ok. The value is 2.
- Warning - Filter that matches input with HealthState value Warning. The
value is 4.
- Error - Filter that matches input with HealthState value Error. The value
is 8.
- All - Filter that matches input with any HealthState value. The value is
65535.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [NodeHealth] operation results. | [
"Gets",
"the",
"health",
"of",
"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#L3498-L3501 | train | Gets the node health of a Service Fabric node. | [
30522,
13366,
2131,
1035,
13045,
1035,
2740,
1006,
13045,
1035,
2171,
1010,
2824,
1035,
2740,
1035,
2110,
1035,
11307,
1024,
1014,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
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... |
AaronLasseigne/active_interaction | lib/active_interaction/filters/interface_filter.rb | ActiveInteraction.InterfaceFilter.matches? | def matches?(object)
methods.all? { |method| object.respond_to?(method) }
rescue NoMethodError
false
end | ruby | def matches?(object)
methods.all? { |method| object.respond_to?(method) }
rescue NoMethodError
false
end | [
"def",
"matches?",
"(",
"object",
")",
"methods",
".",
"all?",
"{",
"|",
"method",
"|",
"object",
".",
"respond_to?",
"(",
"method",
")",
"}",
"rescue",
"NoMethodError",
"false",
"end"
] | @param object [Object]
@return [Boolean] | [
"@param",
"object",
"[",
"Object",
"]"
] | fdc00a041e939ef48948baa2f7fd1ce2e4d66982 | https://github.com/AaronLasseigne/active_interaction/blob/fdc00a041e939ef48948baa2f7fd1ce2e4d66982/lib/active_interaction/filters/interface_filter.rb#L34-L38 | train | Returns true if the object matches the method | [
30522,
13366,
3503,
1029,
1006,
4874,
1007,
4725,
1012,
2035,
1029,
1063,
1064,
4118,
1064,
4874,
1012,
6869,
1035,
2000,
1029,
1006,
4118,
1007,
1065,
5343,
2053,
11368,
6806,
4063,
29165,
6270,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | activemodel/lib/active_model/errors.rb | ActiveModel.Errors.add | def add(attribute, type = :invalid, **options)
error = Error.new(
@base,
*normalize_arguments(attribute, type, options)
)
if exception = options[:strict]
exception = ActiveModel::StrictValidationFailed if exception == true
raise exception, error.full_message
end
@errors.append(error)
error
end | ruby | def add(attribute, type = :invalid, **options)
error = Error.new(
@base,
*normalize_arguments(attribute, type, options)
)
if exception = options[:strict]
exception = ActiveModel::StrictValidationFailed if exception == true
raise exception, error.full_message
end
@errors.append(error)
error
end | [
"def",
"add",
"(",
"attribute",
",",
"type",
"=",
":invalid",
",",
"**",
"options",
")",
"error",
"=",
"Error",
".",
"new",
"(",
"@base",
",",
"normalize_arguments",
"(",
"attribute",
",",
"type",
",",
"options",
")",
")",
"if",
"exception",
"=",
"opti... | Adds +message+ to the error messages and used validator type to +details+ on +attribute+.
More than one error can be added to the same +attribute+.
If no +message+ is supplied, <tt>:invalid</tt> is assumed.
person.errors.add(:name)
# => ["is invalid"]
person.errors.add(:name, :not_implemented, message: "must be implemented")
# => ["is invalid", "must be implemented"]
person.errors.messages
# => {:name=>["is invalid", "must be implemented"]}
person.errors.details
# => {:name=>[{error: :not_implemented}, {error: :invalid}]}
If +message+ is a symbol, it will be translated using the appropriate
scope (see +generate_message+).
If +message+ is a proc, it will be called, allowing for things like
<tt>Time.now</tt> to be used within an error.
If the <tt>:strict</tt> option is set to +true+, it will raise
ActiveModel::StrictValidationFailed instead of adding the error.
<tt>:strict</tt> option can also be set to any other exception.
person.errors.add(:name, :invalid, strict: true)
# => ActiveModel::StrictValidationFailed: Name is invalid
person.errors.add(:name, :invalid, strict: NameIsInvalid)
# => NameIsInvalid: Name is invalid
person.errors.messages # => {}
+attribute+ should be set to <tt>:base</tt> if the error is not
directly associated with a single attribute.
person.errors.add(:base, :name_or_email_blank,
message: "either name or email must be present")
person.errors.messages
# => {:base=>["either name or email must be present"]}
person.errors.details
# => {:base=>[{error: :name_or_email_blank}]} | [
"Adds",
"+",
"message",
"+",
"to",
"the",
"error",
"messages",
"and",
"used",
"validator",
"type",
"to",
"+",
"details",
"+",
"on",
"+",
"attribute",
"+",
".",
"More",
"than",
"one",
"error",
"can",
"be",
"added",
"to",
"the",
"same",
"+",
"attribute",... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activemodel/lib/active_model/errors.rb#L369-L383 | train | Add an error to the errors list | [
30522,
13366,
5587,
1006,
17961,
1010,
2828,
1027,
1024,
19528,
1010,
1008,
1008,
7047,
1007,
7561,
1027,
7561,
1012,
2047,
1006,
1030,
2918,
1010,
1008,
3671,
4697,
1035,
9918,
1006,
17961,
1010,
2828,
1010,
7047,
1007,
1007,
2065,
6453,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_by_product | def get_by_product(resource_group_name, service_name, product_id, tag_id, custom_headers:nil)
response = get_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_product(resource_group_name, service_name, product_id, tag_id, custom_headers:nil)
response = get_by_product_async(resource_group_name, service_name, product_id, tag_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_product",
"(",
"resource_group_name",
",",
"service_name",
",",
"product_id",
",",
"tag_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_product_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"product_id",
",",
"tag... | Get tag associated with the Product.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param product_id [String] Product identifier. Must be unique in the current
API Management service instance.
@param tag_id [String] Tag identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [TagContract] operation results. | [
"Get",
"tag",
"associated",
"with",
"the",
"Product",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb#L2244-L2247 | train | Gets the product s attributes by product ID. | [
30522,
13366,
2131,
1035,
2011,
1035,
4031,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
4031,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2011,
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_network/lib/2019-02-01/generated/azure_mgmt_network/application_security_groups.rb | Azure::Network::Mgmt::V2019_02_01.ApplicationSecurityGroups.begin_update_tags_with_http_info | def begin_update_tags_with_http_info(resource_group_name, application_security_group_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, application_security_group_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_tags_with_http_info(resource_group_name, application_security_group_name, parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, application_security_group_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_tags_with_http_info",
"(",
"resource_group_name",
",",
"application_security_group_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_tags_async",
"(",
"resource_group_name",
",",
"application_security_group_name",
",",
"paramet... | Updates an application security group's tags.
@param resource_group_name [String] The name of the resource group.
@param application_security_group_name [String] The name of the application
security group.
@param parameters [TagsObject] Parameters supplied to update application
security group tags.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"an",
"application",
"security",
"group",
"s",
"tags",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/application_security_groups.rb#L661-L663 | train | Updates a list of tags associated with the application security group. | [
30522,
13366,
4088,
1035,
10651,
1035,
22073,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4646,
1035,
3036,
1035,
2177,
1035,
2171,
1010,
11709,
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... |
rmagick/rmagick | examples/histogram.rb | Magick.Image.info_text | def info_text(fg, bg)
klass = class_type == DirectClass ? 'DirectClass' : 'PsuedoClass'
text = <<-END_TEXT
Format: #{format}
Geometry: #{columns}x#{rows}
Class: #{klass}
Depth: #{depth} bits-per-pixel component
Colors: #{number_colors}
END_TEXT
info = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do
self.background_color = bg
self.border_color = fg
end
gc = Draw.new
gc.annotate(info, 0, 0, 0, 0, text) do
self.stroke = 'transparent'
self.fill = fg
self.gravity = CenterGravity
end
info['Label'] = 'Info'
info
end | ruby | def info_text(fg, bg)
klass = class_type == DirectClass ? 'DirectClass' : 'PsuedoClass'
text = <<-END_TEXT
Format: #{format}
Geometry: #{columns}x#{rows}
Class: #{klass}
Depth: #{depth} bits-per-pixel component
Colors: #{number_colors}
END_TEXT
info = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do
self.background_color = bg
self.border_color = fg
end
gc = Draw.new
gc.annotate(info, 0, 0, 0, 0, text) do
self.stroke = 'transparent'
self.fill = fg
self.gravity = CenterGravity
end
info['Label'] = 'Info'
info
end | [
"def",
"info_text",
"(",
"fg",
",",
"bg",
")",
"klass",
"=",
"class_type",
"==",
"DirectClass",
"?",
"'DirectClass'",
":",
"'PsuedoClass'",
"text",
"=",
"<<-END_TEXT",
"#{",
"format",
"}",
"#{",
"columns",
"}",
"#{",
"rows",
"}",
"#{",
"klass",
"}",
"#{"... | Use AnnotateImage to write the stats. | [
"Use",
"AnnotateImage",
"to",
"write",
"the",
"stats",
"."
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/examples/histogram.rb#L152-L178 | train | Returns a text representation of the image. | [
30522,
13366,
18558,
1035,
3793,
1006,
1042,
2290,
1010,
1038,
2290,
1007,
1047,
27102,
1027,
2465,
1035,
2828,
1027,
1027,
3622,
26266,
1029,
1005,
3622,
26266,
1005,
1024,
1005,
8827,
5657,
3527,
26266,
1005,
3793,
1027,
1026,
1026,
1011,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
troessner/reek | lib/reek/context_builder.rb | Reek.ContextBuilder.process_if | def process_if(exp, _parent)
children = exp.children
increase_statement_count_by(children[1])
increase_statement_count_by(children[2])
decrease_statement_count
process(exp)
end | ruby | def process_if(exp, _parent)
children = exp.children
increase_statement_count_by(children[1])
increase_statement_count_by(children[2])
decrease_statement_count
process(exp)
end | [
"def",
"process_if",
"(",
"exp",
",",
"_parent",
")",
"children",
"=",
"exp",
".",
"children",
"increase_statement_count_by",
"(",
"children",
"[",
"1",
"]",
")",
"increase_statement_count_by",
"(",
"children",
"[",
"2",
"]",
")",
"decrease_statement_count",
"pr... | Handles `if` nodes.
An input example that would trigger this method would be:
if a > 5 && b < 3
puts 'bingo'
else
3
end
Counts the `if` body as one statement and the `else` body as another statement.
At the end we subtract one statement because the surrounding context was already counted
as one (e.g. via `process_def`).
`children[1]` refers to the `if` body (so `puts 'bingo'` from above) and
`children[2]` to the `else` body (so `3` from above), which might be nil. | [
"Handles",
"if",
"nodes",
"."
] | 8c6b5c0c6228a6981ab48543457889f9ea984054 | https://github.com/troessner/reek/blob/8c6b5c0c6228a6981ab48543457889f9ea984054/lib/reek/context_builder.rb#L312-L318 | train | process if statement | [
30522,
13366,
2832,
1035,
2065,
1006,
4654,
2361,
1010,
1035,
6687,
1007,
2336,
1027,
4654,
2361,
1012,
2336,
3623,
1035,
4861,
1035,
4175,
1035,
2011,
1006,
2336,
1031,
1015,
1033,
1007,
3623,
1035,
4861,
1035,
4175,
1035,
2011,
1006,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.row | def row(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'row_for', &block)
define_method("#{name}") do
return platform.row_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | ruby | def row(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'row_for', &block)
define_method("#{name}") do
return platform.row_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | [
"def",
"row",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'row_for'",
",",
"block",
")",
"define_method",
"(",
"\"#{name}\"",
")",
"do",
"return",
... | adds three methods - one to retrieve the text from a table row,
another to return the table row element, and another to check the row's
existence.
@example
row(:sums, :id => 'sum_row')
# will generate 'sums', 'sums_element', and 'sums?' methods
@param [Symbol] the name used for the generated methods
@param [Hash] identifier how we find a cell.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"text",
"from",
"a",
"table",
"row",
"another",
"to",
"return",
"the",
"table",
"row",
"element",
"and",
"another",
"to",
"check",
"the",
"row",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L537-L543 | train | Creates a row for the given name. | [
30522,
13366,
5216,
1006,
2171,
1010,
8909,
4765,
18095,
1027,
1063,
1024,
5950,
1027,
1028,
1014,
1065,
1010,
1004,
3796,
1007,
3115,
1035,
4725,
1006,
2171,
1010,
8909,
4765,
18095,
1010,
1005,
5216,
1035,
2005,
1005,
1010,
1004,
3796,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
doorkeeper-gem/doorkeeper | lib/doorkeeper/models/application_mixin.rb | Doorkeeper.ApplicationMixin.secret_matches? | def secret_matches?(input)
# return false if either is nil, since secure_compare depends on strings
# but Application secrets MAY be nil depending on confidentiality.
return false if input.nil? || secret.nil?
# When matching the secret by comparer function, all is well.
return true if secret_strategy.secret_matches?(input, secret)
# When fallback lookup is enabled, ensure applications
# with plain secrets can still be found
if fallback_secret_strategy
fallback_secret_strategy.secret_matches?(input, secret)
else
false
end
end | ruby | def secret_matches?(input)
# return false if either is nil, since secure_compare depends on strings
# but Application secrets MAY be nil depending on confidentiality.
return false if input.nil? || secret.nil?
# When matching the secret by comparer function, all is well.
return true if secret_strategy.secret_matches?(input, secret)
# When fallback lookup is enabled, ensure applications
# with plain secrets can still be found
if fallback_secret_strategy
fallback_secret_strategy.secret_matches?(input, secret)
else
false
end
end | [
"def",
"secret_matches?",
"(",
"input",
")",
"# return false if either is nil, since secure_compare depends on strings",
"# but Application secrets MAY be nil depending on confidentiality.",
"return",
"false",
"if",
"input",
".",
"nil?",
"||",
"secret",
".",
"nil?",
"# When matchin... | Check whether the given plain text secret matches our stored secret
@param input [#to_s] Plain secret provided by user
(any object that responds to `#to_s`)
@return [true] Whether the given secret matches the stored secret
of this application. | [
"Check",
"whether",
"the",
"given",
"plain",
"text",
"secret",
"matches",
"our",
"stored",
"secret"
] | f1be81891c3d54a42928c1b9e03c5d6833b8af87 | https://github.com/doorkeeper-gem/doorkeeper/blob/f1be81891c3d54a42928c1b9e03c5d6833b8af87/lib/doorkeeper/models/application_mixin.rb#L78-L93 | train | Returns true if the secret matches the input | [
30522,
13366,
3595,
1035,
3503,
1029,
1006,
7953,
1007,
1001,
2709,
6270,
2065,
2593,
2003,
9152,
2140,
1010,
2144,
5851,
1035,
12826,
9041,
2006,
7817,
1001,
2021,
4646,
7800,
2089,
2022,
9152,
2140,
5834,
2006,
18777,
3012,
1012,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/bot.rb | Discordrb.Bot.update_guild_emoji | def update_guild_emoji(data)
server_id = data['guild_id'].to_i
server = @servers[server_id]
server.update_emoji_data(data)
end | ruby | def update_guild_emoji(data)
server_id = data['guild_id'].to_i
server = @servers[server_id]
server.update_emoji_data(data)
end | [
"def",
"update_guild_emoji",
"(",
"data",
")",
"server_id",
"=",
"data",
"[",
"'guild_id'",
"]",
".",
"to_i",
"server",
"=",
"@servers",
"[",
"server_id",
"]",
"server",
".",
"update_emoji_data",
"(",
"data",
")",
"end"
] | Internal handler for GUILD_EMOJIS_UPDATE | [
"Internal",
"handler",
"for",
"GUILD_EMOJIS_UPDATE"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/bot.rb#L943-L947 | train | Update the emoji data for a guild | [
30522,
13366,
10651,
1035,
9054,
1035,
7861,
29147,
2072,
1006,
2951,
1007,
8241,
1035,
8909,
1027,
2951,
1031,
1005,
9054,
1035,
8909,
1005,
1033,
1012,
2000,
1035,
1045,
8241,
1027,
1030,
14903,
1031,
8241,
1035,
8909,
1033,
8241,
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... |
fastlane/fastlane | spaceship/lib/spaceship/tunes/tunes_client.rb | Spaceship.TunesClient.update_iap_family! | def update_iap_family!(app_id: nil, family_id: nil, data: nil)
with_tunes_retry do
r = request(:put) do |req|
req.url("ra/apps/#{app_id}/iaps/family/#{family_id}/")
req.body = data.to_json
req.headers['Content-Type'] = 'application/json'
end
handle_itc_response(r.body)
end
end | ruby | def update_iap_family!(app_id: nil, family_id: nil, data: nil)
with_tunes_retry do
r = request(:put) do |req|
req.url("ra/apps/#{app_id}/iaps/family/#{family_id}/")
req.body = data.to_json
req.headers['Content-Type'] = 'application/json'
end
handle_itc_response(r.body)
end
end | [
"def",
"update_iap_family!",
"(",
"app_id",
":",
"nil",
",",
"family_id",
":",
"nil",
",",
"data",
":",
"nil",
")",
"with_tunes_retry",
"do",
"r",
"=",
"request",
"(",
":put",
")",
"do",
"|",
"req",
"|",
"req",
".",
"url",
"(",
"\"ra/apps/#{app_id}/iaps/... | updates an In-App-Purchases-Family | [
"updates",
"an",
"In",
"-",
"App",
"-",
"Purchases",
"-",
"Family"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/tunes/tunes_client.rb#L1227-L1236 | train | Update an existing IAP family | [
30522,
13366,
10651,
1035,
24264,
2361,
1035,
2155,
999,
1006,
10439,
1035,
8909,
1024,
9152,
2140,
1010,
2155,
1035,
8909,
1024,
9152,
2140,
1010,
2951,
1024,
9152,
2140,
1007,
2007,
1035,
13281,
1035,
2128,
11129,
2079,
1054,
1027,
5227,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2017-11-01/generated/azure_mgmt_network/express_route_circuit_authorizations.rb | Azure::Network::Mgmt::V2017_11_01.ExpressRouteCircuitAuthorizations.create_or_update | def create_or_update(resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers:nil)
response = create_or_update_async(resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers:nil)
response = create_or_update_async(resource_group_name, circuit_name, authorization_name, authorization_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"resource_group_name",
",",
"circuit_name",
",",
"authorization_name",
",",
"authorization_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"resource_group_name",
",",
"circuit_name",
",",... | Creates or updates an authorization in the specified express route circuit.
@param resource_group_name [String] The name of the resource group.
@param circuit_name [String] The name of the express route circuit.
@param authorization_name [String] The name of the authorization.
@param authorization_parameters [ExpressRouteCircuitAuthorization] Parameters
supplied to the create or update express route circuit authorization
operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ExpressRouteCircuitAuthorization] operation results. | [
"Creates",
"or",
"updates",
"an",
"authorization",
"in",
"the",
"specified",
"express",
"route",
"circuit",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2017-11-01/generated/azure_mgmt_network/express_route_circuit_authorizations.rb#L174-L177 | train | Creates or updates an express route circuit authorization. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4984,
1035,
2171,
1010,
20104,
1035,
2171,
1010,
20104,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2030,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cloudfoundry/bosh | src/spec/support/wait.rb | Bosh::Spec.Waiter.wait | def wait(retries_left, &blk)
blk.call
rescue Exception => e
retries_left -= 1
if retries_left > 0
sleep(0.5)
retry
else
raise
end
end | ruby | def wait(retries_left, &blk)
blk.call
rescue Exception => e
retries_left -= 1
if retries_left > 0
sleep(0.5)
retry
else
raise
end
end | [
"def",
"wait",
"(",
"retries_left",
",",
"&",
"blk",
")",
"blk",
".",
"call",
"rescue",
"Exception",
"=>",
"e",
"retries_left",
"-=",
"1",
"if",
"retries_left",
">",
"0",
"sleep",
"(",
"0.5",
")",
"retry",
"else",
"raise",
"end",
"end"
] | Do not add retries_left default value | [
"Do",
"not",
"add",
"retries_left",
"default",
"value"
] | 2eaa7100879ddd20cd909cd698514746195e28b7 | https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/spec/support/wait.rb#L8-L18 | train | Waits for a block to finish | [
30522,
13366,
3524,
1006,
2128,
21011,
1035,
2187,
1010,
1004,
1038,
13687,
1007,
30524,
2128,
21011,
1035,
2187,
1028,
1014,
3637,
1006,
1014,
1012,
1019,
1007,
2128,
11129,
2842,
5333,
2203,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/classic_address.rb | Aws::EC2.ClassicAddress.associate | def associate(options = {})
options = options.merge(public_ip: @public_ip)
resp = @client.associate_address(options)
resp.data
end | ruby | def associate(options = {})
options = options.merge(public_ip: @public_ip)
resp = @client.associate_address(options)
resp.data
end | [
"def",
"associate",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"public_ip",
":",
"@public_ip",
")",
"resp",
"=",
"@client",
".",
"associate_address",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
classic_address.associate({
allocation_id: "String",
instance_id: "String",
allow_reassociation: false,
dry_run: false,
network_interface_id: "String",
private_ip_address: "String",
})
@param [Hash] options ({})
@option options [String] :allocation_id
\[EC2-VPC\] The allocation ID. This is required for EC2-VPC.
@option options [String] :instance_id
The ID of the instance. This is required for EC2-Classic. For EC2-VPC,
you can specify either the instance ID or the network interface ID,
but not both. The operation fails if you specify an instance ID unless
exactly one network interface is attached.
@option options [Boolean] :allow_reassociation
\[EC2-VPC\] For a VPC in an EC2-Classic account, specify true to allow
an Elastic IP address that is already associated with an instance or
network interface to be reassociated with the specified instance or
network interface. Otherwise, the operation fails. In a VPC in an
EC2-VPC-only account, reassociation is automatic, therefore you can
specify false to ensure the operation fails if the Elastic IP address
is already associated with another resource.
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@option options [String] :network_interface_id
\[EC2-VPC\] The ID of the network interface. If the instance has more
than one network interface, you must specify a network interface ID.
For EC2-VPC, you can specify either the instance ID or the network
interface ID, but not both.
@option options [String] :private_ip_address
\[EC2-VPC\] The primary or secondary private IP address to associate
with the Elastic IP address. If no private IP address is specified,
the Elastic IP address is associated with the primary private IP
address.
@return [Types::AssociateAddressResult] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/classic_address.rb#L265-L269 | train | Associate this address with the server | [
30522,
13366,
5482,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2270,
1035,
12997,
1024,
1030,
2270,
1035,
12997,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
5482,
1035,
4769,
1006,
7047,
1007,
24501,
2361,
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... |
randym/axlsx | lib/axlsx/util/options_parser.rb | Axlsx.OptionsParser.parse_options | def parse_options(options={})
options.each do |key, value|
key = :"#{key}="
self.send(key, value) if !value.nil? && self.respond_to?(key)
end
end | ruby | def parse_options(options={})
options.each do |key, value|
key = :"#{key}="
self.send(key, value) if !value.nil? && self.respond_to?(key)
end
end | [
"def",
"parse_options",
"(",
"options",
"=",
"{",
"}",
")",
"options",
".",
"each",
"do",
"|",
"key",
",",
"value",
"|",
"key",
"=",
":\"",
"#{",
"key",
"}",
"\"",
"self",
".",
"send",
"(",
"key",
",",
"value",
")",
"if",
"!",
"value",
".",
"ni... | Parses an options hash by calling any defined method by the same
name of the key postfixed with an '='
@param [Hash] options Options to parse. | [
"Parses",
"an",
"options",
"hash",
"by",
"calling",
"any",
"defined",
"method",
"by",
"the",
"same",
"name",
"of",
"the",
"key",
"postfixed",
"with",
"an",
"="
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/util/options_parser.rb#L9-L14 | train | Parse the options | [
30522,
13366,
11968,
3366,
1035,
7047,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1012,
2169,
2079,
1064,
3145,
1010,
3643,
1064,
3145,
1027,
1024,
1000,
1001,
1063,
3145,
1065,
1027,
1000,
2969,
1012,
4604,
1006,
3145,
1010,
3643,
1007,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scaling_policy.rb | Aws::AutoScaling.ScalingPolicy.delete | def delete(options = {})
options = options.merge(policy_name: @name)
resp = @client.delete_policy(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(policy_name: @name)
resp = @client.delete_policy(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"policy_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"delete_policy",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @!group Actions
@example Request syntax with placeholder values
scaling_policy.delete({
auto_scaling_group_name: "ResourceName",
})
@param [Hash] options ({})
@option options [String] :auto_scaling_group_name
The name of the Auto Scaling group.
@return [EmptyStructure] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/scaling_policy.rb#L266-L270 | train | Delete a policy | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
3343,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
3343,
1006,
7047,
1007,
24501,
2361,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/api/transactions_api.rb | SquareConnect.TransactionsApi.list_transactions | def list_transactions(location_id, opts = {})
data, _status_code, _headers = list_transactions_with_http_info(location_id, opts)
return data
end | ruby | def list_transactions(location_id, opts = {})
data, _status_code, _headers = list_transactions_with_http_info(location_id, opts)
return data
end | [
"def",
"list_transactions",
"(",
"location_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"list_transactions_with_http_info",
"(",
"location_id",
",",
"opts",
")",
"return",
"data",
"end"
] | ListTransactions
Lists transactions for a particular location. Transactions include payment information from sales and exchanges and refund information from returns and exchanges. Max results per [page](#paginatingresults): 50
@param location_id The ID of the location to list transactions for.
@param [Hash] opts the optional parameters
@option opts [String] :begin_time The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.
@option opts [String] :end_time The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.
@option opts [String] :sort_order The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`
@option opts [String] :cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
@return [ListTransactionsResponse] | [
"ListTransactions",
"Lists",
"transactions",
"for",
"a",
"particular",
"location",
".",
"Transactions",
"include",
"payment",
"information",
"from",
"sales",
"and",
"exchanges",
"and",
"refund",
"information",
"from",
"returns",
"and",
"exchanges",
".",
"Max",
"resu... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/transactions_api.rb#L280-L283 | train | Returns a list of transactions | [
30522,
13366,
2862,
1035,
11817,
1006,
3295,
1035,
8909,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
2862,
1035,
11817,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
3295,
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_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/configurations.rb | Azure::Hdinsight::Mgmt::V2018_06_01_preview.Configurations.update | def update(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:nil)
response = update_async(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def update(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:nil)
response = update_async(resource_group_name, cluster_name, configuration_name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"update",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"configuration_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_async",
"(",
"resource_group_name",
",",
"cluster_name",
",",
"configuration_name",
",",
... | Configures the HTTP settings on the specified cluster. This API is
deprecated, please use UpdateGatewaySettings in cluster endpoint instead.
@param resource_group_name [String] The name of the resource group.
@param cluster_name [String] The name of the cluster.
@param configuration_name [String] The name of the cluster configuration.
@param parameters [Hash{String => String}] The cluster configurations.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Configures",
"the",
"HTTP",
"settings",
"on",
"the",
"specified",
"cluster",
".",
"This",
"API",
"is",
"deprecated",
"please",
"use",
"UpdateGatewaySettings",
"in",
"cluster",
"endpoint",
"instead",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_hdinsight/lib/2018-06-01-preview/generated/azure_mgmt_hdinsight/configurations.rb#L127-L130 | train | Updates a cluster configuration. | [
30522,
13366,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9324,
1035,
2171,
1010,
9563,
1035,
2171,
1010,
11709,
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... |
jeremytregunna/ruby-trello | lib/trello/webhook.rb | Trello.Webhook.update! | def update!
client.put("/webhooks/#{id}", {
description: description,
idModel: id_model,
callbackURL: callback_url,
active: active
})
end | ruby | def update!
client.put("/webhooks/#{id}", {
description: description,
idModel: id_model,
callbackURL: callback_url,
active: active
})
end | [
"def",
"update!",
"client",
".",
"put",
"(",
"\"/webhooks/#{id}\"",
",",
"{",
"description",
":",
"description",
",",
"idModel",
":",
"id_model",
",",
"callbackURL",
":",
"callback_url",
",",
"active",
":",
"active",
"}",
")",
"end"
] | Update the webhook.
@raise [Trello::Error] if the Webhook could not be saved.
@return [String] the JSON representation of the updated webhook. | [
"Update",
"the",
"webhook",
"."
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/webhook.rb#L80-L87 | train | Update the current object | [
30522,
13366,
10651,
999,
7396,
1012,
2404,
1006,
1000,
1013,
4773,
6806,
6559,
2015,
1013,
1001,
1063,
8909,
1065,
1000,
1010,
1063,
6412,
1024,
6412,
1010,
8909,
5302,
9247,
1024,
8909,
1035,
2944,
1010,
2655,
5963,
3126,
2140,
1024,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/attributes.rb | Mongoid.Attributes.write_attribute | def write_attribute(name, value)
access = database_field_name(name)
if attribute_writable?(access)
_assigning do
validate_attribute_value(access, value)
localized = fields[access].try(:localized?)
attributes_before_type_cast[name.to_s] = value
typed_value = typed_value_for(access, value)
unless attributes[access] == typed_value || attribute_changed?(access)
attribute_will_change!(access)
end
if localized
attributes[access] ||= {}
attributes[access].merge!(typed_value)
else
attributes[access] = typed_value
end
typed_value
end
end
end | ruby | def write_attribute(name, value)
access = database_field_name(name)
if attribute_writable?(access)
_assigning do
validate_attribute_value(access, value)
localized = fields[access].try(:localized?)
attributes_before_type_cast[name.to_s] = value
typed_value = typed_value_for(access, value)
unless attributes[access] == typed_value || attribute_changed?(access)
attribute_will_change!(access)
end
if localized
attributes[access] ||= {}
attributes[access].merge!(typed_value)
else
attributes[access] = typed_value
end
typed_value
end
end
end | [
"def",
"write_attribute",
"(",
"name",
",",
"value",
")",
"access",
"=",
"database_field_name",
"(",
"name",
")",
"if",
"attribute_writable?",
"(",
"access",
")",
"_assigning",
"do",
"validate_attribute_value",
"(",
"access",
",",
"value",
")",
"localized",
"=",... | Write a single attribute to the document attribute hash. This will
also fire the before and after update callbacks, and perform any
necessary typecasting.
@example Write the attribute.
person.write_attribute(:title, "Mr.")
@example Write the attribute (alternate syntax.)
person[:title] = "Mr."
@param [ String, Symbol ] name The name of the attribute to update.
@param [ Object ] value The value to set for the attribute.
@since 1.0.0 | [
"Write",
"a",
"single",
"attribute",
"to",
"the",
"document",
"attribute",
"hash",
".",
"This",
"will",
"also",
"fire",
"the",
"before",
"and",
"after",
"update",
"callbacks",
"and",
"perform",
"any",
"necessary",
"typecasting",
"."
] | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/attributes.rb#L160-L180 | train | Write an attribute to the database. | [
30522,
13366,
4339,
1035,
17961,
1006,
2171,
1010,
3643,
1007,
3229,
1027,
7809,
1035,
2492,
1035,
2171,
1006,
2171,
1007,
2065,
17961,
1035,
25697,
3085,
1029,
1006,
3229,
1007,
1035,
23911,
2075,
2079,
9398,
3686,
1035,
17961,
1035,
3643,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
petergoldstein/dalli | lib/dalli/client.rb | Dalli.Client.version | def version
values = {}
ring.servers.each do |server|
values["#{server.name}"] = server.alive? ? server.request(:version) : nil
end
values
end | ruby | def version
values = {}
ring.servers.each do |server|
values["#{server.name}"] = server.alive? ? server.request(:version) : nil
end
values
end | [
"def",
"version",
"values",
"=",
"{",
"}",
"ring",
".",
"servers",
".",
"each",
"do",
"|",
"server",
"|",
"values",
"[",
"\"#{server.name}\"",
"]",
"=",
"server",
".",
"alive?",
"?",
"server",
".",
"request",
"(",
":version",
")",
":",
"nil",
"end",
... | Version of the memcache servers. | [
"Version",
"of",
"the",
"memcache",
"servers",
"."
] | 5755dbfd06e333a8239f976d4b10492b4555b726 | https://github.com/petergoldstein/dalli/blob/5755dbfd06e333a8239f976d4b10492b4555b726/lib/dalli/client.rb#L245-L251 | train | Returns the version of the server | [
30522,
13366,
2544,
5300,
1027,
1063,
1065,
3614,
1012,
14903,
1012,
2169,
2079,
1064,
8241,
1064,
5300,
1031,
1000,
1001,
1063,
8241,
1012,
2171,
1065,
1000,
1033,
1027,
8241,
1012,
4142,
1029,
1029,
8241,
1012,
5227,
1006,
1024,
2544,
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... |
plataformatec/simple_form | lib/simple_form/form_builder.rb | SimpleForm.FormBuilder.find_input | def find_input(attribute_name, options = {}, &block)
column = find_attribute_column(attribute_name)
input_type = default_input_type(attribute_name, column, options)
if block_given?
SimpleForm::Inputs::BlockInput.new(self, attribute_name, column, input_type, options, &block)
else
find_mapping(input_type).new(self, attribute_name, column, input_type, options)
end
end | ruby | def find_input(attribute_name, options = {}, &block)
column = find_attribute_column(attribute_name)
input_type = default_input_type(attribute_name, column, options)
if block_given?
SimpleForm::Inputs::BlockInput.new(self, attribute_name, column, input_type, options, &block)
else
find_mapping(input_type).new(self, attribute_name, column, input_type, options)
end
end | [
"def",
"find_input",
"(",
"attribute_name",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"column",
"=",
"find_attribute_column",
"(",
"attribute_name",
")",
"input_type",
"=",
"default_input_type",
"(",
"attribute_name",
",",
"column",
",",
"options",
... | Find an input based on the attribute name. | [
"Find",
"an",
"input",
"based",
"on",
"the",
"attribute",
"name",
"."
] | 4dd9261ebb392e46a9beeefe8d83081e7c6e56b5 | https://github.com/plataformatec/simple_form/blob/4dd9261ebb392e46a9beeefe8d83081e7c6e56b5/lib/simple_form/form_builder.rb#L530-L539 | train | Find an input for the given attribute | [
30522,
13366,
2424,
1035,
7953,
1006,
17961,
1035,
2171,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
5930,
1027,
2424,
1035,
17961,
1035,
5930,
1006,
17961,
1035,
2171,
1007,
7953,
1035,
30524,
1010,
5930,
1010,
7953,
1035,
2828,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/base.rb | AASM.Base.attribute_name | def attribute_name(column_name=nil)
if column_name
@state_machine.config.column = column_name.to_sym
else
@state_machine.config.column ||= :aasm_state
end
@state_machine.config.column
end | ruby | def attribute_name(column_name=nil)
if column_name
@state_machine.config.column = column_name.to_sym
else
@state_machine.config.column ||= :aasm_state
end
@state_machine.config.column
end | [
"def",
"attribute_name",
"(",
"column_name",
"=",
"nil",
")",
"if",
"column_name",
"@state_machine",
".",
"config",
".",
"column",
"=",
"column_name",
".",
"to_sym",
"else",
"@state_machine",
".",
"config",
".",
"column",
"||=",
":aasm_state",
"end",
"@state_mac... | This method is both a getter and a setter | [
"This",
"method",
"is",
"both",
"a",
"getter",
"and",
"a",
"setter"
] | 6a1000b489c6b2e205a7b142478a4b4e207c3dbd | https://github.com/aasm/aasm/blob/6a1000b489c6b2e205a7b142478a4b4e207c3dbd/lib/aasm/base.rb#L68-L75 | train | Returns the column name for the state machine | [
30522,
13366,
17961,
1035,
2171,
1006,
5930,
1035,
2171,
1027,
9152,
2140,
1007,
2065,
5930,
1035,
2171,
1030,
2110,
1035,
3698,
1012,
9530,
8873,
2290,
1012,
5930,
1027,
5930,
1035,
2171,
1012,
2000,
1035,
25353,
2213,
2842,
1030,
2110,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/app/models/decidim/action_log.rb | Decidim.ActionLog.log_presenter_class_for | def log_presenter_class_for(log_type)
resource_type.constantize.log_presenter_class_for(log_type)
rescue NameError
Decidim::Log::BasePresenter
end | ruby | def log_presenter_class_for(log_type)
resource_type.constantize.log_presenter_class_for(log_type)
rescue NameError
Decidim::Log::BasePresenter
end | [
"def",
"log_presenter_class_for",
"(",
"log_type",
")",
"resource_type",
".",
"constantize",
".",
"log_presenter_class_for",
"(",
"log_type",
")",
"rescue",
"NameError",
"Decidim",
"::",
"Log",
"::",
"BasePresenter",
"end"
] | Public: Finds the correct presenter class for the given
`log_type` and the related `resource_type`. If no specific
presenter can be found, it falls back to `Decidim::Log::BasePresenter`
log_type - a Symbol representing the log
Returns a Class. | [
"Public",
":",
"Finds",
"the",
"correct",
"presenter",
"class",
"for",
"the",
"given",
"log_type",
"and",
"the",
"related",
"resource_type",
".",
"If",
"no",
"specific",
"presenter",
"can",
"be",
"found",
"it",
"falls",
"back",
"to",
"Decidim",
"::",
"Log",
... | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/models/decidim/action_log.rb#L99-L103 | train | Returns the log presenter class for the given log type. | [
30522,
13366,
8833,
1035,
10044,
1035,
2465,
1035,
2005,
1006,
8833,
1035,
2828,
1007,
7692,
1035,
2828,
1012,
5377,
4697,
1012,
8833,
1035,
10044,
1035,
2465,
1035,
2005,
1006,
8833,
1035,
2828,
1007,
5343,
2171,
2121,
29165,
11703,
28173,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/subscription.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Subscription.get_with_http_info | def get_with_http_info(resource_group_name, service_name, sid, custom_headers:nil)
get_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, service_name, sid, custom_headers:nil)
get_async(resource_group_name, service_name, sid, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"service_name",
",",
"sid",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"sid",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Gets the specified Subscription entity.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param sid [String] Subscription entity Identifier. The entity represents the
association between a user and a product in API Management.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"specified",
"Subscription",
"entity",
"."
] | 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/subscription.rb#L297-L299 | train | Gets the specified resource group and service. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
15765,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_videosearch/lib/1.0/generated/azure_cognitiveservices_videosearch/videos_operations.rb | Azure::CognitiveServices::VideoSearch::V1_0.VideosOperations.trending | def trending(accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, market:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
response = trending_async(accept_language:accept_language, user_agent:user_agent, client_id:client_id, client_ip:client_ip, location:location, country_code:country_code, market:market, safe_search:safe_search, set_lang:set_lang, text_decorations:text_decorations, text_format:text_format, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def trending(accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, market:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
response = trending_async(accept_language:accept_language, user_agent:user_agent, client_id:client_id, client_ip:client_ip, location:location, country_code:country_code, market:market, safe_search:safe_search, set_lang:set_lang, text_decorations:text_decorations, text_format:text_format, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"trending",
"(",
"accept_language",
":",
"nil",
",",
"user_agent",
":",
"nil",
",",
"client_id",
":",
"nil",
",",
"client_ip",
":",
"nil",
",",
"location",
":",
"nil",
",",
"country_code",
":",
"nil",
",",
"market",
":",
"nil",
",",
"safe_search",... | The Video Trending Search API lets you search on Bing and get back a list of
videos that are trending based on search requests made by others. The videos
are broken out into different categories. For example, Top Music Videos. For
a list of markets that support trending videos, see [Trending
Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/trending-videos).
@param accept_language [String] A comma-delimited list of one or more
languages to use for user interface strings. The list is in decreasing order
of preference. For additional information, including expected format, see
[RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This
header and the
[setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlang)
query parameter are mutually exclusive; do not specify both. If you set this
header, you must also specify the
[cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc)
query parameter. To determine the market to return results for, Bing uses the
first supported language it finds from the list and combines it with the cc
parameter value. If the list does not include a supported language, Bing
finds the closest language and market that supports the request or it uses an
aggregated or default market for the results. To determine the market that
Bing used, see the BingAPIs-Market header. Use this header and the cc query
parameter only if you specify multiple languages. Otherwise, use the
[mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#mkt)
and
[setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlang)
query parameters. A user interface string is a string that's used as a label
in a user interface. There are few user interface strings in the JSON
response objects. Any links to Bing.com properties in the response objects
apply the specified language.
@param user_agent [String] The user agent originating the request. Bing uses
the user agent to provide mobile users with an optimized experience. Although
optional, you are encouraged to always specify this header. The user-agent
should be the same string that any commonly used browser sends. For
information about user agents, see [RFC
2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The following
are examples of user-agent strings. Windows Phone: Mozilla/5.0 (compatible;
MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA;
Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; en - us; SCH -
I500 Build / GINGERBREAD) AppleWebKit / 533.1 (KHTML; like Gecko) Version /
4.0 Mobile Safari / 533.1. iPhone: Mozilla / 5.0 (iPhone; CPU iPhone OS 6_1
like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142
iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3;
WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: Mozilla / 5.0 (iPad;
CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, like Gecko) Version
/ 7.0 Mobile / 11A465 Safari / 9537.53
@param client_id [String] Bing uses this header to provide users with
consistent behavior across Bing API calls. Bing often flights new features
and improvements, and it uses the client ID as a key for assigning traffic on
different flights. If you do not use the same client ID for a user across
multiple requests, then Bing may assign the user to multiple conflicting
flights. Being assigned to multiple conflicting flights can lead to an
inconsistent user experience. For example, if the second request has a
different flight assignment than the first, the experience may be unexpected.
Also, Bing can use the client ID to tailor web results to that client ID’s
search history, providing a richer experience for the user. Bing also uses
this header to help improve result rankings by analyzing the activity
generated by a client ID. The relevance improvements help with better quality
of results delivered by Bing APIs and in turn enables higher click-through
rates for the API consumer. IMPORTANT: Although optional, you should consider
this header required. Persisting the client ID across multiple requests for
the same end user and device combination enables 1) the API consumer to
receive a consistent user experience, and 2) higher click-through rates via
better quality of results from the Bing APIs. Each user that uses your
application on the device must have a unique, Bing generated client ID. If
you do not include this header in the request, Bing generates an ID and
returns it in the X-MSEdge-ClientID response header. The only time that you
should NOT include this header in a request is the first time the user uses
your app on that device. Use the client ID for each Bing API request that
your app makes for this user on the device. Persist the client ID. To persist
the ID in a browser app, use a persistent HTTP cookie to ensure the ID is
used across all sessions. Do not use a session cookie. For other apps such as
mobile apps, use the device's persistent storage to persist the ID. The next
time the user uses your app on that device, get the client ID that you
persisted. Bing responses may or may not include this header. If the response
includes this header, capture the client ID and use it for all subsequent
Bing requests for the user on that device. If you include the
X-MSEdge-ClientID, you must not include cookies in the request.
@param client_ip [String] The IPv4 or IPv6 address of the client device. The
IP address is used to discover the user's location. Bing uses the location
information to determine safe search behavior. Although optional, you are
encouraged to always specify this header and the X-Search-Location header. Do
not obfuscate the address (for example, by changing the last octet to 0).
Obfuscating the address results in the location not being anywhere near the
device's actual location, which may result in Bing serving erroneous results.
@param location [String] A semicolon-delimited list of key/value pairs that
describe the client's geographical location. Bing uses the location
information to determine safe search behavior and to return relevant local
content. Specify the key/value pair as <key>:<value>. The following are the
keys that you use to specify the user's location. lat (required): The
latitude of the client's location, in degrees. The latitude must be greater
than or equal to -90.0 and less than or equal to +90.0. Negative values
indicate southern latitudes and positive values indicate northern latitudes.
long (required): The longitude of the client's location, in degrees. The
longitude must be greater than or equal to -180.0 and less than or equal to
+180.0. Negative values indicate western longitudes and positive values
indicate eastern longitudes. re (required): The radius, in meters, which
specifies the horizontal accuracy of the coordinates. Pass the value returned
by the device's location service. Typical values might be 22m for GPS/Wi-Fi,
380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts
(optional): The UTC UNIX timestamp of when the client was at the location.
(The UNIX timestamp is the number of seconds since January 1, 1970.) head
(optional): The client's relative heading or direction of travel. Specify the
direction of travel as degrees from 0 through 360, counting clockwise
relative to true north. Specify this key only if the sp key is nonzero. sp
(optional): The horizontal velocity (speed), in meters per second, that the
client device is traveling. alt (optional): The altitude of the client
device, in meters. are (optional): The radius, in meters, that specifies the
vertical accuracy of the coordinates. Specify this key only if you specify
the alt key. Although many of the keys are optional, the more information
that you provide, the more accurate the location results are. Although
optional, you are encouraged to always specify the user's geographical
location. Providing the location is especially important if the client's IP
address does not accurately reflect the user's physical location (for
example, if the client uses VPN). For optimal results, you should include
this header and the X-MSEdge-ClientIP header, but at a minimum, you should
include this header.
@param country_code [String] A 2-character country code of the country where
the results come from. This API supports only the United States market. If
you specify this query parameter, it must be set to us. If you set this
parameter, you must also specify the Accept-Language header. Bing uses the
first supported language it finds from the languages list, and combine that
language with the country code that you specify to determine the market to
return results for. If the languages list does not include a supported
language, Bing finds the closest language and market that supports the
request, or it may use an aggregated or default market for the results
instead of a specified one. You should use this query parameter and the
Accept-Language query parameter only if you specify multiple languages;
otherwise, you should use the mkt and setLang query parameters. This
parameter and the mkt query parameter are mutually exclusive—do not specify
both.
@param market [String] The market where the results come from. Typically, mkt
is the country where the user is making the request from. However, it could
be a different country if the user is not located in a country where Bing
delivers results. The market must be in the form <language code>-<country
code>. For example, en-US. The string is case insensitive. For a list of
possible market values, see [Market
Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-codes).
NOTE: If known, you are encouraged to always specify the market. Specifying
the market helps Bing route the request and return an appropriate and optimal
response. If you specify a market that is not listed in [Market
Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-codes),
Bing uses a best fit market code based on an internal mapping that is subject
to change. This parameter and the
[cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc)
query parameter are mutually exclusive—do not specify both.
@param safe_search [SafeSearch] Filter videos for adult content. The
following are the possible filter values. Off: If the request is through the
Video Search API, the response includes adult videos and the thumbnail images
of the videos are clear (non-fuzzy). If the request is through the Web Search
API, the response includes adult videos but the thumbnail images of the
videos are pixelated (fuzzy). Moderate: If the request is through the Video
Search API, the response does not include videos with adult content. If the
request is through the Web Search API, the response may include videos with
adult content but the thumbnail images of the videos are pixelated (fuzzy).
Strict: Does not return videos with adult content. The default is Moderate.
If the request comes from a market that Bing's adult policy requires that
safeSearch is set to Strict, Bing ignores the safeSearch value and uses
Strict. If you use the site: query operator, there is the chance that the
response may contain adult content regardless of what the safeSearch query
parameter is set to. Use site: only if you are aware of the content on the
site and your scenario supports the possibility of adult content. Possible
values include: 'Off', 'Moderate', 'Strict'
@param set_lang [String] The language to use for user interface strings.
Specify the language using the ISO 639-1 2-letter language code. For example,
the language code for English is EN. The default is EN (English). Although
optional, you should always specify the language. Typically, you set setLang
to the same language specified by mkt unless the user wants the user
interface strings displayed in a different language. This parameter and the
[Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#acceptlanguage)
header are mutually exclusive; do not specify both. A user interface string
is a string that's used as a label in a user interface. There are few user
interface strings in the JSON response objects. Also, any links to Bing.com
properties in the response objects apply the specified language.
@param text_decorations [Boolean] A Boolean value that determines whether
display strings contain decoration markers such as hit highlighting
characters. If true, the strings may include markers. The default is false.
To specify whether to use Unicode characters or HTML tags as the markers, see
the
[textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#textformat)
query parameter. For information about hit highlighting, see [Hit
Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting).
@param text_format [TextFormat] The type of markers to use for text
decorations (see the textDecorations query parameter). Possible values are
Raw—Use Unicode characters to mark content that needs special formatting. The
Unicode characters are in the range E000 through E019. For example, Bing uses
E000 and E001 to mark the beginning and end of query terms for hit
highlighting. HTML—Use HTML tags to mark content that needs special
formatting. For example, use <b> tags to highlight query terms in display
strings. The default is Raw. For display strings that contain escapable HTML
characters such as <, >, and &, if textFormat is set to HTML, Bing escapes
the characters as appropriate (for example, < is escaped to <). Possible
values include: 'Raw', 'Html'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [TrendingVideos] operation results. | [
"The",
"Video",
"Trending",
"Search",
"API",
"lets",
"you",
"search",
"on",
"Bing",
"and",
"get",
"back",
"a",
"list",
"of",
"videos",
"that",
"are",
"trending",
"based",
"on",
"search",
"requests",
"made",
"by",
"others",
".",
"The",
"videos",
"are",
"b... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_videosearch/lib/1.0/generated/azure_cognitiveservices_videosearch/videos_operations.rb#L1797-L1800 | train | Returns the number of documents that are trending for a given language. | [
30522,
13366,
9874,
2075,
1006,
5138,
1035,
2653,
1024,
9152,
2140,
1010,
5310,
1035,
4005,
1024,
9152,
2140,
1010,
7396,
1035,
8909,
1024,
9152,
2140,
1010,
7396,
1035,
12997,
1024,
9152,
2140,
1010,
3295,
1024,
9152,
2140,
1010,
2406,
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_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.suspend | def suspend(resource_group_name, name, custom_headers:nil)
response = suspend_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
suspend_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def suspend(resource_group_name, name, custom_headers:nil)
response = suspend_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
suspend_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"suspend",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"suspend_async",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"unless",
"response",
".",
... | Suspend an App Service Environment.
Suspend 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 => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<Site>] which provide lazy access to pages of the response. | [
"Suspend",
"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#L2858-L2867 | train | Suspend an App Service Environment. | [
30522,
13366,
28324,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
28324,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb | Azure::SQL::Mgmt::V2015_05_01_preview.SyncGroups.trigger_sync | def trigger_sync(resource_group_name, server_name, database_name, sync_group_name, custom_headers:nil)
response = trigger_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers:custom_headers).value!
nil
end | ruby | def trigger_sync(resource_group_name, server_name, database_name, sync_group_name, custom_headers:nil)
response = trigger_sync_async(resource_group_name, server_name, database_name, sync_group_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"trigger_sync",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"sync_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"trigger_sync_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",... | Triggers a sync group synchronization.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param database_name [String] The name of the database on which the sync
group is hosted.
@param sync_group_name [String] The name of the sync group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Triggers",
"a",
"sync",
"group",
"synchronization",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2015-05-01-preview/generated/azure_mgmt_sql/sync_groups.rb#L514-L517 | train | Trigger a sync group of a database. | [
30522,
13366,
9495,
1035,
26351,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
26351,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
9495,
1035,
26351,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/cloud_appliances.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.CloudAppliances.begin_provision_with_http_info | def begin_provision_with_http_info(parameters, resource_group_name, manager_name, custom_headers:nil)
begin_provision_async(parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def begin_provision_with_http_info(parameters, resource_group_name, manager_name, custom_headers:nil)
begin_provision_async(parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_provision_with_http_info",
"(",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_provision_async",
"(",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":custo... | Provisions cloud appliance.
@param parameters [CloudAppliance] The cloud appliance
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Provisions",
"cloud",
"appliance",
"."
] | 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/cloud_appliances.rb#L184-L186 | train | Creates a new cluster provisioning policy. | [
30522,
13366,
4088,
1035,
9347,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11709,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
9347,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/overcommit | lib/overcommit/configuration.rb | Overcommit.Configuration.update_signature! | def update_signature!
result = Overcommit::Utils.execute(
%w[git config --local] + [signature_config_key, signature]
)
verify_signature_value = @hash['verify_signatures'] ? 1 : 0
result &&= Overcommit::Utils.execute(
%W[git config --local #{verify_signature_config_key} #{verify_signature_value}]
)
unless result.success?
raise Overcommit::Exceptions::GitConfigError,
"Unable to write to local repo git config: #{result.stderr}"
end
end | ruby | def update_signature!
result = Overcommit::Utils.execute(
%w[git config --local] + [signature_config_key, signature]
)
verify_signature_value = @hash['verify_signatures'] ? 1 : 0
result &&= Overcommit::Utils.execute(
%W[git config --local #{verify_signature_config_key} #{verify_signature_value}]
)
unless result.success?
raise Overcommit::Exceptions::GitConfigError,
"Unable to write to local repo git config: #{result.stderr}"
end
end | [
"def",
"update_signature!",
"result",
"=",
"Overcommit",
"::",
"Utils",
".",
"execute",
"(",
"%w[",
"git",
"config",
"--local",
"]",
"+",
"[",
"signature_config_key",
",",
"signature",
"]",
")",
"verify_signature_value",
"=",
"@hash",
"[",
"'verify_signatures'",
... | Update the currently stored signature for this hook. | [
"Update",
"the",
"currently",
"stored",
"signature",
"for",
"this",
"hook",
"."
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/configuration.rb#L234-L248 | train | Update the signature of the current object. | [
30522,
13366,
10651,
1035,
8085,
999,
2765,
1027,
2058,
9006,
22930,
1024,
1024,
21183,
12146,
1012,
15389,
1006,
1003,
1059,
1031,
21025,
2102,
9530,
8873,
2290,
1011,
1011,
2334,
1033,
1009,
1031,
8085,
1035,
9530,
8873,
2290,
1035,
3145,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.begin_delete_instances | def begin_delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
response = begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
response = begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete_instances",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_instances_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_id... | Deletes virtual machines in a VM scale set.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
of virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1652-L1655 | train | Deletes a set of virtual machines in a VM scale set. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
12107,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
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... |
square/connect-ruby-sdk | lib/square_connect/api/o_auth_api.rb | SquareConnect.OAuthApi.revoke_token | def revoke_token(body, opts = {})
data, _status_code, _headers = revoke_token_with_http_info(body, opts)
return data
end | ruby | def revoke_token(body, opts = {})
data, _status_code, _headers = revoke_token_with_http_info(body, opts)
return data
end | [
"def",
"revoke_token",
"(",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"revoke_token_with_http_info",
"(",
"body",
",",
"opts",
")",
"return",
"data",
"end"
] | RevokeToken
Revokes an access token generated with the OAuth flow. If an account has more than one OAuth access token for your application, this endpoint revokes all of them, regardless of which token you specify. When an OAuth access token is revoked, all of the active subscriptions associated with that OAuth token are canceled immediately. __Important:__ The `Authorization` header for this endpoint must have the following format: ``` Authorization: Client APPLICATION_SECRET ``` Replace `APPLICATION_SECRET` with the application secret on the Credentials page in the [application dashboard](https://connect.squareup.com/apps).
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [RevokeTokenResponse] | [
"RevokeToken",
"Revokes",
"an",
"access",
"token",
"generated",
"with",
"the",
"OAuth",
"flow",
".",
"If",
"an",
"account",
"has",
"more",
"than",
"one",
"OAuth",
"access",
"token",
"for",
"your",
"application",
"this",
"endpoint",
"revokes",
"all",
"of",
"t... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/o_auth_api.rb#L139-L142 | train | Revoke a token | [
30522,
13366,
7065,
11045,
1035,
19204,
1006,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
7065,
11045,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/error.rb | SquareConnect.Error.valid? | def valid?
return false if @category.nil?
category_validator = EnumAttributeValidator.new('String', ["API_ERROR", "AUTHENTICATION_ERROR", "INVALID_REQUEST_ERROR", "RATE_LIMIT_ERROR", "PAYMENT_METHOD_ERROR", "REFUND_ERROR"])
return false unless category_validator.valid?(@category)
return false if @code.nil?
code_validator = EnumAttributeValidator.new('String', ["INTERNAL_SERVER_ERROR", "UNAUTHORIZED", "ACCESS_TOKEN_EXPIRED", "ACCESS_TOKEN_REVOKED", "FORBIDDEN", "INSUFFICIENT_SCOPES", "APPLICATION_DISABLED", "V1_APPLICATION", "V1_ACCESS_TOKEN", "CARD_PROCESSING_NOT_ENABLED", "BAD_REQUEST", "MISSING_REQUIRED_PARAMETER", "INCORRECT_TYPE", "INVALID_TIME", "INVALID_TIME_RANGE", "INVALID_VALUE", "INVALID_CURSOR", "UNKNOWN_QUERY_PARAMETER", "CONFLICTING_PARAMETERS", "EXPECTED_JSON_BODY", "INVALID_SORT_ORDER", "VALUE_REGEX_MISMATCH", "VALUE_TOO_SHORT", "VALUE_TOO_LONG", "VALUE_TOO_LOW", "VALUE_TOO_HIGH", "VALUE_EMPTY", "ARRAY_LENGTH_TOO_LONG", "ARRAY_LENGTH_TOO_SHORT", "ARRAY_EMPTY", "EXPECTED_BOOLEAN", "EXPECTED_INTEGER", "EXPECTED_FLOAT", "EXPECTED_STRING", "EXPECTED_OBJECT", "EXPECTED_ARRAY", "EXPECTED_MAP", "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", "INVALID_ARRAY_VALUE", "INVALID_ENUM_VALUE", "INVALID_CONTENT_TYPE", "INVALID_FORM_VALUE", "ONE_INSTRUMENT_EXPECTED", "NO_FIELDS_SET", "DEPRECATED_FIELD_SET", "CARD_EXPIRED", "INVALID_EXPIRATION", "INVALID_EXPIRATION_YEAR", "INVALID_EXPIRATION_DATE", "UNSUPPORTED_CARD_BRAND", "UNSUPPORTED_ENTRY_METHOD", "INVALID_ENCRYPTED_CARD", "INVALID_CARD", "DELAYED_TRANSACTION_EXPIRED", "DELAYED_TRANSACTION_CANCELED", "DELAYED_TRANSACTION_CAPTURED", "DELAYED_TRANSACTION_FAILED", "CARD_TOKEN_EXPIRED", "CARD_TOKEN_USED", "AMOUNT_TOO_HIGH", "UNSUPPORTED_INSTRUMENT_TYPE", "REFUND_AMOUNT_INVALID", "REFUND_ALREADY_PENDING", "PAYMENT_NOT_REFUNDABLE", "INVALID_CARD_DATA", "LOCATION_MISMATCH", "IDEMPOTENCY_KEY_REUSED", "UNEXPECTED_VALUE", "SANDBOX_NOT_SUPPORTED", "INVALID_EMAIL_ADDRESS", "INVALID_PHONE_NUMBER", "CHECKOUT_EXPIRED", "BAD_CERTIFICATE", "CARD_DECLINED", "VERIFY_CVV_FAILURE", "VERIFY_AVS_FAILURE", "CARD_DECLINED_CALL_ISSUER", "NOT_FOUND", "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "REQUEST_ENTITY_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "RATE_LIMITED", "NOT_IMPLEMENTED", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT"])
return false unless code_validator.valid?(@code)
return true
end | ruby | def valid?
return false if @category.nil?
category_validator = EnumAttributeValidator.new('String', ["API_ERROR", "AUTHENTICATION_ERROR", "INVALID_REQUEST_ERROR", "RATE_LIMIT_ERROR", "PAYMENT_METHOD_ERROR", "REFUND_ERROR"])
return false unless category_validator.valid?(@category)
return false if @code.nil?
code_validator = EnumAttributeValidator.new('String', ["INTERNAL_SERVER_ERROR", "UNAUTHORIZED", "ACCESS_TOKEN_EXPIRED", "ACCESS_TOKEN_REVOKED", "FORBIDDEN", "INSUFFICIENT_SCOPES", "APPLICATION_DISABLED", "V1_APPLICATION", "V1_ACCESS_TOKEN", "CARD_PROCESSING_NOT_ENABLED", "BAD_REQUEST", "MISSING_REQUIRED_PARAMETER", "INCORRECT_TYPE", "INVALID_TIME", "INVALID_TIME_RANGE", "INVALID_VALUE", "INVALID_CURSOR", "UNKNOWN_QUERY_PARAMETER", "CONFLICTING_PARAMETERS", "EXPECTED_JSON_BODY", "INVALID_SORT_ORDER", "VALUE_REGEX_MISMATCH", "VALUE_TOO_SHORT", "VALUE_TOO_LONG", "VALUE_TOO_LOW", "VALUE_TOO_HIGH", "VALUE_EMPTY", "ARRAY_LENGTH_TOO_LONG", "ARRAY_LENGTH_TOO_SHORT", "ARRAY_EMPTY", "EXPECTED_BOOLEAN", "EXPECTED_INTEGER", "EXPECTED_FLOAT", "EXPECTED_STRING", "EXPECTED_OBJECT", "EXPECTED_ARRAY", "EXPECTED_MAP", "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", "INVALID_ARRAY_VALUE", "INVALID_ENUM_VALUE", "INVALID_CONTENT_TYPE", "INVALID_FORM_VALUE", "ONE_INSTRUMENT_EXPECTED", "NO_FIELDS_SET", "DEPRECATED_FIELD_SET", "CARD_EXPIRED", "INVALID_EXPIRATION", "INVALID_EXPIRATION_YEAR", "INVALID_EXPIRATION_DATE", "UNSUPPORTED_CARD_BRAND", "UNSUPPORTED_ENTRY_METHOD", "INVALID_ENCRYPTED_CARD", "INVALID_CARD", "DELAYED_TRANSACTION_EXPIRED", "DELAYED_TRANSACTION_CANCELED", "DELAYED_TRANSACTION_CAPTURED", "DELAYED_TRANSACTION_FAILED", "CARD_TOKEN_EXPIRED", "CARD_TOKEN_USED", "AMOUNT_TOO_HIGH", "UNSUPPORTED_INSTRUMENT_TYPE", "REFUND_AMOUNT_INVALID", "REFUND_ALREADY_PENDING", "PAYMENT_NOT_REFUNDABLE", "INVALID_CARD_DATA", "LOCATION_MISMATCH", "IDEMPOTENCY_KEY_REUSED", "UNEXPECTED_VALUE", "SANDBOX_NOT_SUPPORTED", "INVALID_EMAIL_ADDRESS", "INVALID_PHONE_NUMBER", "CHECKOUT_EXPIRED", "BAD_CERTIFICATE", "CARD_DECLINED", "VERIFY_CVV_FAILURE", "VERIFY_AVS_FAILURE", "CARD_DECLINED_CALL_ISSUER", "NOT_FOUND", "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "REQUEST_ENTITY_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "RATE_LIMITED", "NOT_IMPLEMENTED", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT"])
return false unless code_validator.valid?(@code)
return true
end | [
"def",
"valid?",
"return",
"false",
"if",
"@category",
".",
"nil?",
"category_validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"API_ERROR\"",
",",
"\"AUTHENTICATION_ERROR\"",
",",
"\"INVALID_REQUEST_ERROR\"",
",",
"\"RATE_LIMIT_ERROR\"... | Check to see if the all the properties in the model are valid
@return true if the model is valid | [
"Check",
"to",
"see",
"if",
"the",
"all",
"the",
"properties",
"in",
"the",
"model",
"are",
"valid"
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/error.rb#L112-L120 | train | Checks if the object is valid for the given object. | [
30522,
13366,
9398,
1029,
2709,
6270,
2065,
1030,
4696,
1012,
9152,
2140,
1029,
4696,
1035,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
17928,
1035,
7561,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_start | def begin_start(endpoint_name, profile_name, resource_group_name, custom_headers:nil)
response = begin_start_async(endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_start(endpoint_name, profile_name, resource_group_name, custom_headers:nil)
response = begin_start_async(endpoint_name, profile_name, resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_start",
"(",
"endpoint_name",
",",
"profile_name",
",",
"resource_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_start_async",
"(",
"endpoint_name",
",",
"profile_name",
",",
"resource_group_name",
",",
"custom_headers",
":c... | Starts an existing stopped CDN endpoint.
@param endpoint_name [String] Name of the endpoint within the CDN profile.
@param profile_name [String] Name of the CDN profile within the resource
group.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Endpoint] operation results. | [
"Starts",
"an",
"existing",
"stopped",
"CDN",
"endpoint",
"."
] | 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#L1054-L1057 | train | Starts an endpoint in the specified resource group. | [
30522,
13366,
4088,
1035,
2707,
1006,
2203,
8400,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
2707,
1035,
2004,
6038,
2278,
1006,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
haml/haml | lib/haml/parser.rb | Haml.Parser.process_line | def process_line(line)
case line.text[0]
when DIV_CLASS; push div(line)
when DIV_ID
return push plain(line) if %w[{ @ $].include?(line.text[1])
push div(line)
when ELEMENT; push tag(line)
when COMMENT; push comment(line.text[1..-1].lstrip)
when SANITIZE
return push plain(line.strip!(3), :escape_html) if line.text[1, 2] == '=='
return push script(line.strip!(2), :escape_html) if line.text[1] == SCRIPT
return push flat_script(line.strip!(2), :escape_html) if line.text[1] == FLAT_SCRIPT
return push plain(line.strip!(1), :escape_html) if line.text[1] == ?\s || line.text[1..2] == '#{'
push plain(line)
when SCRIPT
return push plain(line.strip!(2)) if line.text[1] == SCRIPT
line.text = line.text[1..-1]
push script(line)
when FLAT_SCRIPT; push flat_script(line.strip!(1))
when SILENT_SCRIPT
return push haml_comment(line.text[2..-1]) if line.text[1] == SILENT_COMMENT
push silent_script(line)
when FILTER; push filter(line.text[1..-1].downcase)
when DOCTYPE
return push doctype(line.text) if line.text[0, 3] == '!!!'
return push plain(line.strip!(3), false) if line.text[1, 2] == '=='
return push script(line.strip!(2), false) if line.text[1] == SCRIPT
return push flat_script(line.strip!(2), false) if line.text[1] == FLAT_SCRIPT
return push plain(line.strip!(1), false) if line.text[1] == ?\s || line.text[1..2] == '#{'
push plain(line)
when ESCAPE
line.text = line.text[1..-1]
push plain(line)
else; push plain(line)
end
end | ruby | def process_line(line)
case line.text[0]
when DIV_CLASS; push div(line)
when DIV_ID
return push plain(line) if %w[{ @ $].include?(line.text[1])
push div(line)
when ELEMENT; push tag(line)
when COMMENT; push comment(line.text[1..-1].lstrip)
when SANITIZE
return push plain(line.strip!(3), :escape_html) if line.text[1, 2] == '=='
return push script(line.strip!(2), :escape_html) if line.text[1] == SCRIPT
return push flat_script(line.strip!(2), :escape_html) if line.text[1] == FLAT_SCRIPT
return push plain(line.strip!(1), :escape_html) if line.text[1] == ?\s || line.text[1..2] == '#{'
push plain(line)
when SCRIPT
return push plain(line.strip!(2)) if line.text[1] == SCRIPT
line.text = line.text[1..-1]
push script(line)
when FLAT_SCRIPT; push flat_script(line.strip!(1))
when SILENT_SCRIPT
return push haml_comment(line.text[2..-1]) if line.text[1] == SILENT_COMMENT
push silent_script(line)
when FILTER; push filter(line.text[1..-1].downcase)
when DOCTYPE
return push doctype(line.text) if line.text[0, 3] == '!!!'
return push plain(line.strip!(3), false) if line.text[1, 2] == '=='
return push script(line.strip!(2), false) if line.text[1] == SCRIPT
return push flat_script(line.strip!(2), false) if line.text[1] == FLAT_SCRIPT
return push plain(line.strip!(1), false) if line.text[1] == ?\s || line.text[1..2] == '#{'
push plain(line)
when ESCAPE
line.text = line.text[1..-1]
push plain(line)
else; push plain(line)
end
end | [
"def",
"process_line",
"(",
"line",
")",
"case",
"line",
".",
"text",
"[",
"0",
"]",
"when",
"DIV_CLASS",
";",
"push",
"div",
"(",
"line",
")",
"when",
"DIV_ID",
"return",
"push",
"plain",
"(",
"line",
")",
"if",
"%w[",
"{",
"@",
"$",
"]",
".",
"... | Processes a single line of Haml.
This method doesn't return anything; it simply processes the line and
adds the appropriate code to `@precompiled`. | [
"Processes",
"a",
"single",
"line",
"of",
"Haml",
"."
] | 9aa0fbe4a91b999978927be569d2ad0cd39076f1 | https://github.com/haml/haml/blob/9aa0fbe4a91b999978927be569d2ad0cd39076f1/lib/haml/parser.rb#L252-L287 | train | Process the line | [
30522,
13366,
2832,
1035,
2240,
1006,
2240,
1007,
2553,
2240,
1012,
3793,
1031,
1014,
1033,
2043,
4487,
2615,
1035,
2465,
1025,
5245,
4487,
2615,
1006,
2240,
1007,
2043,
4487,
2615,
1035,
8909,
2709,
5245,
5810,
1006,
2240,
1007,
2065,
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... |
lostisland/faraday | lib/faraday/utils.rb | Faraday.Utils.URI | def URI(url) # rubocop:disable Naming/MethodName
if url.respond_to?(:host)
url
elsif url.respond_to?(:to_str)
default_uri_parser.call(url)
else
raise ArgumentError, 'bad argument (expected URI object or URI string)'
end
end | ruby | def URI(url) # rubocop:disable Naming/MethodName
if url.respond_to?(:host)
url
elsif url.respond_to?(:to_str)
default_uri_parser.call(url)
else
raise ArgumentError, 'bad argument (expected URI object or URI string)'
end
end | [
"def",
"URI",
"(",
"url",
")",
"# rubocop:disable Naming/MethodName",
"if",
"url",
".",
"respond_to?",
"(",
":host",
")",
"url",
"elsif",
"url",
".",
"respond_to?",
"(",
":to_str",
")",
"default_uri_parser",
".",
"call",
"(",
"url",
")",
"else",
"raise",
"Ar... | Normalize URI() behavior across Ruby versions
url - A String or URI.
Returns a parsed URI. | [
"Normalize",
"URI",
"()",
"behavior",
"across",
"Ruby",
"versions"
] | 3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70 | https://github.com/lostisland/faraday/blob/3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70/lib/faraday/utils.rb#L55-L63 | train | Returns a new URI object for the given URI. | [
30522,
13366,
24471,
2072,
1006,
24471,
2140,
1007,
1001,
14548,
24163,
2361,
1024,
4487,
19150,
10324,
1013,
4118,
18442,
2065,
24471,
2140,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
3677,
1007,
24471,
2140,
3449,
5332,
2546,
24471,
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... |
fastlane/fastlane | pilot/lib/pilot/manager.rb | Pilot.Manager.fetch_app_id | def fetch_app_id
return @apple_id if @apple_id
config[:app_identifier] = fetch_app_identifier
if config[:app_identifier]
@app ||= Spaceship::Tunes::Application.find(config[:app_identifier])
UI.user_error!("Couldn't find app '#{config[:app_identifier]}' on the account of '#{config[:username]}' on App Store Connect") unless @app
app_id ||= @app.apple_id
end
app_id ||= UI.input("Could not automatically find the app ID, please enter it here (e.g. 956814360): ")
return app_id
end | ruby | def fetch_app_id
return @apple_id if @apple_id
config[:app_identifier] = fetch_app_identifier
if config[:app_identifier]
@app ||= Spaceship::Tunes::Application.find(config[:app_identifier])
UI.user_error!("Couldn't find app '#{config[:app_identifier]}' on the account of '#{config[:username]}' on App Store Connect") unless @app
app_id ||= @app.apple_id
end
app_id ||= UI.input("Could not automatically find the app ID, please enter it here (e.g. 956814360): ")
return app_id
end | [
"def",
"fetch_app_id",
"return",
"@apple_id",
"if",
"@apple_id",
"config",
"[",
":app_identifier",
"]",
"=",
"fetch_app_identifier",
"if",
"config",
"[",
":app_identifier",
"]",
"@app",
"||=",
"Spaceship",
"::",
"Tunes",
"::",
"Application",
".",
"find",
"(",
"c... | Config Related | [
"Config",
"Related"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/pilot/lib/pilot/manager.rb#L45-L58 | train | Fetch the app ID from the app store | [
30522,
13366,
18584,
1035,
10439,
1035,
8909,
2709,
1030,
6207,
1035,
8909,
2065,
1030,
6207,
1035,
8909,
9530,
8873,
2290,
1031,
1024,
10439,
1035,
8909,
4765,
18095,
1033,
1027,
18584,
1035,
10439,
1035,
8909,
4765,
18095,
2065,
9530,
887... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/overcommit | lib/overcommit/hook_context/post_merge.rb | Overcommit::HookContext.PostMerge.modified_files | def modified_files
staged = squash?
refs = 'HEAD^ HEAD' if merge_commit?
@modified_files ||= Overcommit::GitRepo.modified_files(staged: staged, refs: refs)
end | ruby | def modified_files
staged = squash?
refs = 'HEAD^ HEAD' if merge_commit?
@modified_files ||= Overcommit::GitRepo.modified_files(staged: staged, refs: refs)
end | [
"def",
"modified_files",
"staged",
"=",
"squash?",
"refs",
"=",
"'HEAD^ HEAD'",
"if",
"merge_commit?",
"@modified_files",
"||=",
"Overcommit",
"::",
"GitRepo",
".",
"modified_files",
"(",
"staged",
":",
"staged",
",",
"refs",
":",
"refs",
")",
"end"
] | Get a list of files that were added, copied, or modified in the merge
commit. Renames and deletions are ignored, since there should be nothing
to check. | [
"Get",
"a",
"list",
"of",
"files",
"that",
"were",
"added",
"copied",
"or",
"modified",
"in",
"the",
"merge",
"commit",
".",
"Renames",
"and",
"deletions",
"are",
"ignored",
"since",
"there",
"should",
"be",
"nothing",
"to",
"check",
"."
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/hook_context/post_merge.rb#L11-L15 | train | Returns the modified files for the given object. | [
30522,
13366,
6310,
1035,
6764,
9813,
1027,
18794,
1029,
25416,
2015,
1027,
1005,
2132,
1034,
2132,
1005,
2065,
13590,
1035,
10797,
1029,
1030,
6310,
1035,
6764,
1064,
1064,
1027,
2058,
9006,
22930,
1024,
1024,
21025,
7913,
6873,
1012,
6310... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/client/repos/hooks.rb | Github.Client::Repos::Hooks.edit | def edit(*args)
arguments(args, required: [:user, :repo, :id]) do
permit VALID_HOOK_PARAM_NAMES, recursive: false
assert_required REQUIRED_PARAMS
end
patch_request("/repos/#{arguments.user}/#{arguments.repo}/hooks/#{arguments.id}", arguments.params)
end | ruby | def edit(*args)
arguments(args, required: [:user, :repo, :id]) do
permit VALID_HOOK_PARAM_NAMES, recursive: false
assert_required REQUIRED_PARAMS
end
patch_request("/repos/#{arguments.user}/#{arguments.repo}/hooks/#{arguments.id}", arguments.params)
end | [
"def",
"edit",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
",",
":id",
"]",
")",
"do",
"permit",
"VALID_HOOK_PARAM_NAMES",
",",
"recursive",
":",
"false",
"assert_required",
"REQUIRED_PARAMS",
"end",
"... | Edit a hook
@param [Hash] params
@input params [Hash] :config
Required. Key/value pairs to provide settings for this hook.
These settings vary between the services and are defined in
the github-services repository. Booleans are stored internally
as “1” for true, and “0” for false. Any JSON true/false values
will be converted automatically.
@input params [Array] :events
Determines what events the hook is triggered for. Default: ["push"]
@input params [Array] :add_events
Determines a list of events to be added to the list of events
that the Hook triggers for.
@input params [Array] :remove_events
Determines a list of events to be removed from the list of
events that the Hook triggers for.
@input params [Boolean] :active
Determines whether the hook is actually triggered on pushes.
@example
github = Github.new
github.repos.hooks.edit 'user-name', 'repo-name', 'hook-id',
"name" => "campfire",
"active" => true,
"config" => {
"subdomain" => "github",
"room" => "Commits",
"token" => "abc123"
}
@api public | [
"Edit",
"a",
"hook"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/repos/hooks.rb#L159-L166 | train | Edit a hook | [
30522,
13366,
10086,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1010,
1024,
8909,
1033,
1007,
2079,
9146,
9398,
1035,
8103,
1035,
11498,
2213,
1035,
3415,
1010,
28667... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_graph_rbac/lib/1.6/generated/azure_graph_rbac/service_principals.rb | Azure::GraphRbac::V1_6.ServicePrincipals.update_password_credentials | def update_password_credentials(object_id, parameters, custom_headers:nil)
response = update_password_credentials_async(object_id, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def update_password_credentials(object_id, parameters, custom_headers:nil)
response = update_password_credentials_async(object_id, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"update_password_credentials",
"(",
"object_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_password_credentials_async",
"(",
"object_id",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Updates the passwordCredentials associated with a service principal.
@param object_id [String] The object ID of the service principal.
@param parameters [PasswordCredentialsUpdateParameters] Parameters to update
the passwordCredentials of an existing service principal.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Updates",
"the",
"passwordCredentials",
"associated",
"with",
"a",
"service",
"principal",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/service_principals.rb#L757-L760 | train | Updates the password credentials of the specified object. | [
30522,
13366,
10651,
1035,
20786,
1035,
22496,
1006,
4874,
1035,
8909,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
20786,
1035,
22496,
1035,
2004,
6038,
2278,
1006,
4874,
1035,
8909,
1010,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_reservations/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb | Azure::Reservations::Mgmt::V2017_11_01.Reservation.begin_update | def begin_update(reservation_order_id, reservation_id, parameters, custom_headers:nil)
response = begin_update_async(reservation_order_id, reservation_id, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_update(reservation_order_id, reservation_id, parameters, custom_headers:nil)
response = begin_update_async(reservation_order_id, reservation_id, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_update",
"(",
"reservation_order_id",
",",
"reservation_id",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_update_async",
"(",
"reservation_order_id",
",",
"reservation_id",
",",
"parameters",
",",
"custom_headers",
"... | Updates a `Reservation`.
Updates the applied scopes of the `Reservation`.
@param reservation_order_id [String] Order Id of the reservation
@param reservation_id [String] Id of the Reservation Item
@param parameters [Patch] Information needed to patch a reservation item
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ReservationResponse] operation results. | [
"Updates",
"a",
"Reservation",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_reservations/lib/2017-11-01/generated/azure_mgmt_reservations/reservation.rb#L772-L775 | train | Updates a reservation s segmentation group. | [
30522,
13366,
4088,
1035,
10651,
1006,
11079,
1035,
2344,
1035,
8909,
1010,
11079,
1035,
8909,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
10651,
1035,
2004,
6038,
2278,
1006,
11079,
1035,
234... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
decidim/decidim | decidim-core/app/helpers/decidim/application_helper.rb | Decidim.ApplicationHelper.cell | def cell(name, model, options = {}, &block)
options = { context: { current_user: current_user } }.deep_merge(options)
super(name, model, options, &block)
end | ruby | def cell(name, model, options = {}, &block)
options = { context: { current_user: current_user } }.deep_merge(options)
super(name, model, options, &block)
end | [
"def",
"cell",
"(",
"name",
",",
"model",
",",
"options",
"=",
"{",
"}",
",",
"&",
"block",
")",
"options",
"=",
"{",
"context",
":",
"{",
"current_user",
":",
"current_user",
"}",
"}",
".",
"deep_merge",
"(",
"options",
")",
"super",
"(",
"name",
... | Public: Overwrites the `cell` helper method to automatically set some
common context.
name - the name of the cell to render
model - the cell model
options - a Hash with options
Renders the cell contents. | [
"Public",
":",
"Overwrites",
"the",
"cell",
"helper",
"method",
"to",
"automatically",
"set",
"some",
"common",
"context",
"."
] | 6e2b14e559a63088669904e3c5c49a5180700cf7 | https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/application_helper.rb#L65-L69 | train | Returns a cell object. | [
30522,
13366,
3526,
1006,
2171,
1010,
2944,
1010,
7047,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
7047,
1027,
1063,
6123,
1024,
1063,
2783,
1035,
5310,
1024,
2783,
1035,
5310,
1065,
1065,
1012,
2784,
1035,
13590,
1006,
7047,
1007,
3565,
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... |
etewiah/property_web_builder | app/controllers/pwb/api/v1/translations_controller.rb | Pwb.Api::V1::TranslationsController.create_for_locale | def create_for_locale
field_key = FieldKey.find_by_global_key(params[:i18n_key])
phrase = I18n::Backend::ActiveRecord::Translation.find_or_create_by(
key: field_key.global_key,
locale: params[:locale]
)
unless phrase.value.present?
I18n.backend.reload!
phrase.value = params[:i18n_value]
phrase.save!
end
render json: { success: true }
end | ruby | def create_for_locale
field_key = FieldKey.find_by_global_key(params[:i18n_key])
phrase = I18n::Backend::ActiveRecord::Translation.find_or_create_by(
key: field_key.global_key,
locale: params[:locale]
)
unless phrase.value.present?
I18n.backend.reload!
phrase.value = params[:i18n_value]
phrase.save!
end
render json: { success: true }
end | [
"def",
"create_for_locale",
"field_key",
"=",
"FieldKey",
".",
"find_by_global_key",
"(",
"params",
"[",
":i18n_key",
"]",
")",
"phrase",
"=",
"I18n",
"::",
"Backend",
"::",
"ActiveRecord",
"::",
"Translation",
".",
"find_or_create_by",
"(",
"key",
":",
"field_k... | below for adding new locale to an existing translation | [
"below",
"for",
"adding",
"new",
"locale",
"to",
"an",
"existing",
"translation"
] | fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21 | https://github.com/etewiah/property_web_builder/blob/fba4e6d4ffa7bc1f4d3b50dfa5a6a9fbfee23f21/app/controllers/pwb/api/v1/translations_controller.rb#L109-L121 | train | Create a phrase for a given locale | [
30522,
13366,
3443,
1035,
2005,
1035,
2334,
2063,
2492,
1035,
3145,
1027,
2492,
14839,
1012,
2424,
1035,
2011,
1035,
3795,
1035,
3145,
1006,
11498,
5244,
1031,
1024,
1045,
15136,
2078,
1035,
3145,
1033,
1007,
7655,
1027,
1045,
15136,
2078,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vault-ruby | lib/vault/api/approle.rb | Vault.AppRole.secret_id | def secret_id(role_name, secret_id)
opts = { secret_id: secret_id }
json = client.post("/v1/auth/approle/role/#{encode_path(role_name)}/secret-id/lookup", JSON.fast_generate(opts), {})
return nil unless json
return Secret.decode(json)
rescue HTTPError => e
if e.code == 404 || e.code == 405
begin
json = client.get("/v1/auth/approle/role/#{encode_path(role_name)}/secret-id/#{encode_path(secret_id)}")
return Secret.decode(json)
rescue HTTPError => e
return nil if e.code == 404
raise e
end
end
raise
end | ruby | def secret_id(role_name, secret_id)
opts = { secret_id: secret_id }
json = client.post("/v1/auth/approle/role/#{encode_path(role_name)}/secret-id/lookup", JSON.fast_generate(opts), {})
return nil unless json
return Secret.decode(json)
rescue HTTPError => e
if e.code == 404 || e.code == 405
begin
json = client.get("/v1/auth/approle/role/#{encode_path(role_name)}/secret-id/#{encode_path(secret_id)}")
return Secret.decode(json)
rescue HTTPError => e
return nil if e.code == 404
raise e
end
end
raise
end | [
"def",
"secret_id",
"(",
"role_name",
",",
"secret_id",
")",
"opts",
"=",
"{",
"secret_id",
":",
"secret_id",
"}",
"json",
"=",
"client",
".",
"post",
"(",
"\"/v1/auth/approle/role/#{encode_path(role_name)}/secret-id/lookup\"",
",",
"JSON",
".",
"fast_generate",
"("... | Reads out the properties of a SecretID assigned to an AppRole.
If the specified SecretID don't exist, +nil+ is returned.
@example
Vault.approle.role("testrole", "841771dc-11c9-...") #=> #<Vault::Secret lease_id="...">
@param [String] role_name
The name of the AppRole
@param [String] secret_id
SecretID belonging to AppRole
@return [Secret, nil] | [
"Reads",
"out",
"the",
"properties",
"of",
"a",
"SecretID",
"assigned",
"to",
"an",
"AppRole",
".",
"If",
"the",
"specified",
"SecretID",
"don",
"t",
"exist",
"+",
"nil",
"+",
"is",
"returned",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/approle.rb#L182-L199 | train | Returns the secret id for a role | [
30522,
13366,
3595,
1035,
8909,
1006,
2535,
1035,
2171,
1010,
3595,
1035,
8909,
1007,
23569,
2015,
1027,
1063,
3595,
1035,
8909,
1024,
3595,
1035,
8909,
1065,
1046,
3385,
1027,
7396,
1012,
2695,
1006,
1000,
1013,
1058,
2487,
1013,
8740,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/registered_servers.rb | Azure::StorageSync::Mgmt::V2018_07_01.RegisteredServers.get_with_http_info | def get_with_http_info(resource_group_name, storage_sync_service_name, server_id, custom_headers:nil)
get_async(resource_group_name, storage_sync_service_name, server_id, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, storage_sync_service_name, server_id, custom_headers:nil)
get_async(resource_group_name, storage_sync_service_name, server_id, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"server_id",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"storage_sync_service_name",
",",
"server_id",
",",
"custom_headers",
":custo... | Get a given registered server.
@param resource_group_name [String] The name of the resource group. The name
is case insensitive.
@param storage_sync_service_name [String] Name of Storage Sync Service
resource.
@param server_id [String] GUID identifying the on-premises server.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Get",
"a",
"given",
"registered",
"server",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/registered_servers.rb#L158-L160 | train | Gets the specified server s index. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5527,
1035,
26351,
1035,
2326,
1035,
2171,
1010,
8241,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb | Azure::Batch::Mgmt::V2017_09_01.PoolOperations.update_with_http_info | def update_with_http_info(resource_group_name, account_name, pool_name, parameters, if_match:nil, custom_headers:nil)
update_async(resource_group_name, account_name, pool_name, parameters, if_match:if_match, custom_headers:custom_headers).value!
end | ruby | def update_with_http_info(resource_group_name, account_name, pool_name, parameters, if_match:nil, custom_headers:nil)
update_async(resource_group_name, account_name, pool_name, parameters, if_match:if_match, custom_headers:custom_headers).value!
end | [
"def",
"update_with_http_info",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_name",
",",
"parameters",
",",
"if_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"update_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"pool_nam... | Updates the properties of an existing pool.
@param resource_group_name [String] The name of the resource group that
contains the Batch account.
@param account_name [String] The name of the Batch account.
@param pool_name [String] The pool name. This must be unique within the
account.
@param parameters [Pool] Pool properties that should be updated. Properties
that are supplied will be updated, any property not supplied will be
unchanged.
@param if_match [String] The entity state (ETag) version of the pool to
update. This value can be omitted or set to "*" to apply the operation
unconditionally.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"the",
"properties",
"of",
"an",
"existing",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/pool_operations.rb#L282-L284 | train | Updates an existing HDInsight pool. | [
30522,
13366,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4770,
1035,
2171,
1010,
11709,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/tree/haml_comment_node.rb | HamlLint::Tree.HamlCommentNode.text | def text
content = source_code
indent = content[/^ */]
content.gsub(/^#{indent}/, '')
.gsub(/^-#/, '')
.gsub(/^ /, '')
.rstrip
end | ruby | def text
content = source_code
indent = content[/^ */]
content.gsub(/^#{indent}/, '')
.gsub(/^-#/, '')
.gsub(/^ /, '')
.rstrip
end | [
"def",
"text",
"content",
"=",
"source_code",
"indent",
"=",
"content",
"[",
"/",
"/",
"]",
"content",
".",
"gsub",
"(",
"/",
"#{",
"indent",
"}",
"/",
",",
"''",
")",
".",
"gsub",
"(",
"/",
"/",
",",
"''",
")",
".",
"gsub",
"(",
"/",
"/",
",... | Returns the full text content of this comment, including newlines if a
single comment spans multiple lines.
@return [String] | [
"Returns",
"the",
"full",
"text",
"content",
"of",
"this",
"comment",
"including",
"newlines",
"if",
"a",
"single",
"comment",
"spans",
"multiple",
"lines",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/tree/haml_comment_node.rb#L18-L26 | train | Returns the text of the generated code. | [
30522,
13366,
3793,
4180,
1027,
3120,
1035,
3642,
27427,
4765,
1027,
4180,
1031,
1013,
1034,
1008,
1013,
1033,
4180,
1012,
28177,
12083,
1006,
1013,
1034,
1001,
1063,
27427,
4765,
1065,
1013,
1010,
1005,
1005,
1007,
1012,
28177,
12083,
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 | management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.begin_reimage_all_with_http_info | def begin_reimage_all_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
end | ruby | def begin_reimage_all_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
begin_reimage_all_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
end | [
"def",
"begin_reimage_all_with_http_info",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"begin_reimage_all_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_id... | Reimages all the disks ( including data disks ) in the virtual machines in a
VM scale set. This operation is only supported for managed disks.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Reimages",
"all",
"the",
"disks",
"(",
"including",
"data",
"disks",
")",
"in",
"the",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"This",
"operation",
"is",
"only",
"supported",
"for",
"managed",
"disks",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L2446-L2448 | train | Reimage all virtual machines in a VM scale set. | [
30522,
13366,
4088,
1035,
24964,
26860,
1035,
2035,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
1024,
9152,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activestorage/lib/active_storage/attached/many.rb | ActiveStorage.Attached::Many.attach | def attach(*attachables)
if record.persisted? && !record.changed?
record.update(name => blobs + attachables.flatten)
else
record.public_send("#{name}=", blobs + attachables.flatten)
end
end | ruby | def attach(*attachables)
if record.persisted? && !record.changed?
record.update(name => blobs + attachables.flatten)
else
record.public_send("#{name}=", blobs + attachables.flatten)
end
end | [
"def",
"attach",
"(",
"*",
"attachables",
")",
"if",
"record",
".",
"persisted?",
"&&",
"!",
"record",
".",
"changed?",
"record",
".",
"update",
"(",
"name",
"=>",
"blobs",
"+",
"attachables",
".",
"flatten",
")",
"else",
"record",
".",
"public_send",
"(... | Attaches one or more +attachables+ to the record.
If the record is persisted and unchanged, the attachments are saved to
the database immediately. Otherwise, they'll be saved to the DB when the
record is next saved.
document.images.attach(params[:images]) # Array of ActionDispatch::Http::UploadedFile objects
document.images.attach(params[:signed_blob_id]) # Signed reference to blob from direct upload
document.images.attach(io: File.open("/path/to/racecar.jpg"), filename: "racecar.jpg", content_type: "image/jpg")
document.images.attach([ first_blob, second_blob ]) | [
"Attaches",
"one",
"or",
"more",
"+",
"attachables",
"+",
"to",
"the",
"record",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activestorage/lib/active_storage/attached/many.rb#L30-L36 | train | Attaches the given array of blobs to the record. | [
30522,
13366,
22476,
1006,
1008,
22476,
3085,
2015,
1007,
2065,
2501,
1012,
19035,
1029,
1004,
1004,
999,
2501,
1012,
2904,
1029,
2501,
1012,
10651,
1006,
2171,
1027,
1028,
1038,
4135,
5910,
1009,
22476,
3085,
2015,
1012,
4257,
6528,
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_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachines.get_extensions | def get_extensions(resource_group_name, vm_name, expand:nil, custom_headers:nil)
response = get_extensions_async(resource_group_name, vm_name, expand:expand, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_extensions(resource_group_name, vm_name, expand:nil, custom_headers:nil)
response = get_extensions_async(resource_group_name, vm_name, expand:expand, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_extensions",
"(",
"resource_group_name",
",",
"vm_name",
",",
"expand",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_extensions_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"expand",
":",
"expand",
",",
"custo... | The operation to get all extensions of a Virtual Machine.
@param resource_group_name [String] The name of the resource group.
@param vm_name [String] The name of the virtual machine containing the
extension.
@param expand [String] The expand expression to apply on the operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VirtualMachineExtensionsListResult] operation results. | [
"The",
"operation",
"to",
"get",
"all",
"extensions",
"of",
"a",
"Virtual",
"Machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb#L36-L39 | train | Gets the extensions of the virtual machine. | [
30522,
13366,
2131,
1035,
14305,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
7818,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
14305,
1035,
2004,
6038,
2278,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_service_bus/lib/2017-04-01/generated/azure_mgmt_service_bus/disaster_recovery_configs.rb | Azure::ServiceBus::Mgmt::V2017_04_01.DisasterRecoveryConfigs.break_pairing_with_http_info | def break_pairing_with_http_info(resource_group_name, namespace_name, alias_parameter, custom_headers:nil)
break_pairing_async(resource_group_name, namespace_name, alias_parameter, custom_headers:custom_headers).value!
end | ruby | def break_pairing_with_http_info(resource_group_name, namespace_name, alias_parameter, custom_headers:nil)
break_pairing_async(resource_group_name, namespace_name, alias_parameter, custom_headers:custom_headers).value!
end | [
"def",
"break_pairing_with_http_info",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"alias_parameter",
",",
"custom_headers",
":",
"nil",
")",
"break_pairing_async",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"alias_parameter",
",",
"custom_headers",... | This operation disables the Disaster Recovery and stops replicating changes
from primary to secondary namespaces
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param namespace_name [String] The namespace name
@param alias_parameter [String] The Disaster Recovery configuration name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"This",
"operation",
"disables",
"the",
"Disaster",
"Recovery",
"and",
"stops",
"replicating",
"changes",
"from",
"primary",
"to",
"secondary",
"namespaces"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_service_bus/lib/2017-04-01/generated/azure_mgmt_service_bus/disaster_recovery_configs.rb#L587-L589 | train | Break a pairing of namespace and alias. | [
30522,
13366,
3338,
1035,
22778,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
14593,
1035,
16381,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3338,
1035,
22778,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
floere/phony | lib/phony/country.rb | Phony.Country.split | def split national_number
_, trunk, ndc, *rest = internal_split national_number
[trunk, ndc, *rest]
end | ruby | def split national_number
_, trunk, ndc, *rest = internal_split national_number
[trunk, ndc, *rest]
end | [
"def",
"split",
"national_number",
"_",
",",
"trunk",
",",
"ndc",
",",
"*",
"rest",
"=",
"internal_split",
"national_number",
"[",
"trunk",
",",
"ndc",
",",
"rest",
"]",
"end"
] | A number is split with the code handlers as given in the initializer.
Note: If the ndc is nil, it will not return it.
@return [Trunk, String (ndc), Array<String> (national pieces)] | [
"A",
"number",
"is",
"split",
"with",
"the",
"code",
"handlers",
"as",
"given",
"in",
"the",
"initializer",
"."
] | 9ca50743499cf478a25fdb927bcdacd29d2c90c7 | https://github.com/floere/phony/blob/9ca50743499cf478a25fdb927bcdacd29d2c90c7/lib/phony/country.rb#L55-L58 | train | Split national number into national number components. | [
30522,
13366,
3975,
2120,
1035,
2193,
1035,
1010,
8260,
1010,
1050,
16409,
1010,
1008,
2717,
1027,
4722,
1035,
3975,
2120,
1035,
2193,
1031,
8260,
1010,
1050,
16409,
1010,
1008,
2717,
1033,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.purge_deleted_certificate | def purge_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
response = purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
nil
end | ruby | def purge_deleted_certificate(vault_base_url, certificate_name, custom_headers:nil)
response = purge_deleted_certificate_async(vault_base_url, certificate_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"purge_deleted_certificate",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"purge_deleted_certificate_async",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"custom_headers",
":custom_headers",
")",
"... | Permanently deletes the specified deleted certificate.
The PurgeDeletedCertificate operation performs an irreversible deletion of
the specified certificate, without possibility for recovery. The operation is
not available if the recovery level does not specify 'Purgeable'. This
operation requires the certificate/purge permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param certificate_name [String] The name of the certificate
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Permanently",
"deletes",
"the",
"specified",
"deleted",
"certificate",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L6757-L6760 | train | Purges the deleted certificate. | [
30522,
13366,
24694,
1035,
17159,
1035,
8196,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
24694,
1035,
17159,
1035,
8196,
1035,
2004,
6038,
2278,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/partners.rb | Azure::Logic::Mgmt::V2016_06_01.Partners.list_by_integration_accounts_next | def list_by_integration_accounts_next(next_page_link, custom_headers:nil)
response = list_by_integration_accounts_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_integration_accounts_next(next_page_link, custom_headers:nil)
response = list_by_integration_accounts_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_integration_accounts_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_integration_accounts_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"bo... | Gets a list of integration account partners.
@param next_page_link [String] The NextLink from the previous successful call
to List operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [IntegrationAccountPartnerListResult] operation results. | [
"Gets",
"a",
"list",
"of",
"integration",
"account",
"partners",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/partners.rb#L540-L543 | train | Gets the integration accounts for the integration accounts. | [
30522,
13366,
2862,
1035,
2011,
1035,
8346,
1035,
6115,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
8346,
1035,
6115,
1035,
2279,
1035,
2004,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.4.0.36/generated/azure_service_fabric/mesh_secret_value.rb | Azure::ServiceFabric::V6_4_0_36.MeshSecretValue.add_value_with_http_info | def add_value_with_http_info(secret_resource_name, secret_value_resource_name, secret_value_resource_description, custom_headers:nil)
add_value_async(secret_resource_name, secret_value_resource_name, secret_value_resource_description, custom_headers:custom_headers).value!
end | ruby | def add_value_with_http_info(secret_resource_name, secret_value_resource_name, secret_value_resource_description, custom_headers:nil)
add_value_async(secret_resource_name, secret_value_resource_name, secret_value_resource_description, custom_headers:custom_headers).value!
end | [
"def",
"add_value_with_http_info",
"(",
"secret_resource_name",
",",
"secret_value_resource_name",
",",
"secret_value_resource_description",
",",
"custom_headers",
":",
"nil",
")",
"add_value_async",
"(",
"secret_resource_name",
",",
"secret_value_resource_name",
",",
"secret_v... | Adds the specified value as a new version of the specified secret resource.
Creates a new value of the specified secret resource. The name of the value
is typically the version identifier. Once created the value cannot be
changed.
@param secret_resource_name [String] The name of the secret resource.
@param secret_value_resource_name [String] The name of the secret resource
value which is typically the version identifier for the value.
@param secret_value_resource_description [SecretValueResourceDescription]
Description for creating a value of a secret resource.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Adds",
"the",
"specified",
"value",
"as",
"a",
"new",
"version",
"of",
"the",
"specified",
"secret",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.4.0.36/generated/azure_service_fabric/mesh_secret_value.rb#L64-L66 | train | Adds a value to the specified secret resource. | [
30522,
13366,
5587,
1035,
3643,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
3595,
1035,
7692,
1035,
2171,
1010,
3595,
1035,
3643,
1035,
7692,
1035,
2171,
1010,
3595,
1035,
3643,
1035,
7692,
1035,
6412,
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... |
rails/sprockets | lib/sprockets/source_map_utils.rb | Sprockets.SourceMapUtils.vlq_encode | def vlq_encode(ary)
result = []
ary.each do |n|
vlq = n < 0 ? ((-n) << 1) + 1 : n << 1
loop do
digit = vlq & VLQ_BASE_MASK
vlq >>= VLQ_BASE_SHIFT
digit |= VLQ_CONTINUATION_BIT if vlq > 0
result << BASE64_DIGITS[digit]
break unless vlq > 0
end
end
result.join
end | ruby | def vlq_encode(ary)
result = []
ary.each do |n|
vlq = n < 0 ? ((-n) << 1) + 1 : n << 1
loop do
digit = vlq & VLQ_BASE_MASK
vlq >>= VLQ_BASE_SHIFT
digit |= VLQ_CONTINUATION_BIT if vlq > 0
result << BASE64_DIGITS[digit]
break unless vlq > 0
end
end
result.join
end | [
"def",
"vlq_encode",
"(",
"ary",
")",
"result",
"=",
"[",
"]",
"ary",
".",
"each",
"do",
"|",
"n",
"|",
"vlq",
"=",
"n",
"<",
"0",
"?",
"(",
"(",
"-",
"n",
")",
"<<",
"1",
")",
"+",
"1",
":",
"n",
"<<",
"1",
"loop",
"do",
"digit",
"=",
... | Public: Encode a list of numbers into a compact VLQ string.
ary - An Array of Integers
Returns a VLQ String. | [
"Public",
":",
"Encode",
"a",
"list",
"of",
"numbers",
"into",
"a",
"compact",
"VLQ",
"string",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/source_map_utils.rb#L408-L422 | train | Encodes a list of vlq numbers in the array | [
30522,
13366,
1058,
2140,
4160,
1035,
4372,
16044,
1006,
12098,
2100,
1007,
2765,
1027,
1031,
1033,
12098,
2100,
1012,
2169,
30524,
1004,
1058,
2140,
4160,
1035,
2918,
1035,
7308,
1058,
2140,
4160,
1028,
1028,
1027,
1058,
2140,
4160,
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_logic/lib/2016-06-01/generated/azure_mgmt_logic/sessions.rb | Azure::Logic::Mgmt::V2016_06_01.Sessions.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, integration_account_name, session_name, session, custom_headers:nil)
create_or_update_async(resource_group_name, integration_account_name, session_name, session, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, integration_account_name, session_name, session, custom_headers:nil)
create_or_update_async(resource_group_name, integration_account_name, session_name, session, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"session_name",
",",
"session",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"s... | Creates or updates an integration account session.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param session_name [String] The integration account session name.
@param session [IntegrationAccountSession] The integration account session.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"session",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/sessions.rb#L250-L252 | train | Creates or updates an integration account session. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8346,
1035,
4070,
1035,
2171,
1010,
5219,
1035,
2171,
1010,
5219,
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_by_api | def get_by_api(resource_group_name, service_name, api_id, tag_id, custom_headers:nil)
response = get_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_by_api(resource_group_name, service_name, api_id, tag_id, custom_headers:nil)
response = get_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_by_api",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"tag_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_by_api_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"tag_id",
",",
"... | Get tag associated with the API.
@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 instance. Non-current revision has ;rev=n as a suffix
where n is the revision number.
@param tag_id [String] Tag identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [TagContract] operation results. | [
"Get",
"tag",
"associated",
"with",
"the",
"API",
"."
] | 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#L953-L956 | train | Gets the specified tag. | [
30522,
13366,
2131,
1035,
2011,
1035,
17928,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
17928,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
zendesk/ruby-kafka | lib/kafka/consumer.rb | Kafka.Consumer.subscribe | def subscribe(topic_or_regex, default_offset: nil, start_from_beginning: true, max_bytes_per_partition: 1048576)
default_offset ||= start_from_beginning ? :earliest : :latest
if topic_or_regex.is_a?(Regexp)
cluster_topics.select { |topic| topic =~ topic_or_regex }.each do |topic|
subscribe_to_topic(topic, default_offset, start_from_beginning, max_bytes_per_partition)
end
else
subscribe_to_topic(topic_or_regex, default_offset, start_from_beginning, max_bytes_per_partition)
end
nil
end | ruby | def subscribe(topic_or_regex, default_offset: nil, start_from_beginning: true, max_bytes_per_partition: 1048576)
default_offset ||= start_from_beginning ? :earliest : :latest
if topic_or_regex.is_a?(Regexp)
cluster_topics.select { |topic| topic =~ topic_or_regex }.each do |topic|
subscribe_to_topic(topic, default_offset, start_from_beginning, max_bytes_per_partition)
end
else
subscribe_to_topic(topic_or_regex, default_offset, start_from_beginning, max_bytes_per_partition)
end
nil
end | [
"def",
"subscribe",
"(",
"topic_or_regex",
",",
"default_offset",
":",
"nil",
",",
"start_from_beginning",
":",
"true",
",",
"max_bytes_per_partition",
":",
"1048576",
")",
"default_offset",
"||=",
"start_from_beginning",
"?",
":earliest",
":",
":latest",
"if",
"top... | Subscribes the consumer to a topic.
Typically you either want to start reading messages from the very
beginning of the topic's partitions or you simply want to wait for new
messages to be written. In the former case, set `start_from_beginning`
to true (the default); in the latter, set it to false.
@param topic_or_regex [String, Regexp] subscribe to single topic with a string
or multiple topics matching a regex.
@param default_offset [Symbol] whether to start from the beginning or the
end of the topic's partitions. Deprecated.
@param start_from_beginning [Boolean] whether to start from the beginning
of the topic or just subscribe to new messages being produced. This
only applies when first consuming a topic partition – once the consumer
has checkpointed its progress, it will always resume from the last
checkpoint.
@param max_bytes_per_partition [Integer] the maximum amount of data fetched
from a single partition at a time.
@return [nil] | [
"Subscribes",
"the",
"consumer",
"to",
"a",
"topic",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/consumer.rb#L97-L109 | train | Subscribe to a topic or a regex | [
30522,
13366,
4942,
29234,
1006,
8476,
1035,
2030,
1035,
19723,
10288,
1010,
12398,
1035,
16396,
1024,
9152,
2140,
1010,
2707,
1035,
2013,
1035,
2927,
1024,
2995,
1010,
4098,
1035,
27507,
1035,
2566,
1035,
13571,
1024,
9645,
27531,
2581,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/sprockets | lib/sprockets/resolve.rb | Sprockets.Resolve.resolve! | def resolve!(path, **kargs)
uri, deps = resolve(path, **kargs)
unless uri
message = String.new("couldn't find file '#{path}'")
if relative_path?(path) && kargs[:base_path]
load_path, _ = paths_split(config[:paths], kargs[:base_path])
message << " under '#{load_path}'"
end
message << " with type '#{kargs[:accept]}'" if kargs[:accept]
load_paths = kargs[:load_paths] || config[:paths]
message << "\nChecked in these paths: \n #{ load_paths.join("\n ") }"
raise FileNotFound, message
end
return uri, deps
end | ruby | def resolve!(path, **kargs)
uri, deps = resolve(path, **kargs)
unless uri
message = String.new("couldn't find file '#{path}'")
if relative_path?(path) && kargs[:base_path]
load_path, _ = paths_split(config[:paths], kargs[:base_path])
message << " under '#{load_path}'"
end
message << " with type '#{kargs[:accept]}'" if kargs[:accept]
load_paths = kargs[:load_paths] || config[:paths]
message << "\nChecked in these paths: \n #{ load_paths.join("\n ") }"
raise FileNotFound, message
end
return uri, deps
end | [
"def",
"resolve!",
"(",
"path",
",",
"**",
"kargs",
")",
"uri",
",",
"deps",
"=",
"resolve",
"(",
"path",
",",
"**",
"kargs",
")",
"unless",
"uri",
"message",
"=",
"String",
".",
"new",
"(",
"\"couldn't find file '#{path}'\"",
")",
"if",
"relative_path?",
... | Public: Same as resolve() but raises a FileNotFound exception instead of
nil if no assets are found. | [
"Public",
":",
"Same",
"as",
"resolve",
"()",
"but",
"raises",
"a",
"FileNotFound",
"exception",
"instead",
"of",
"nil",
"if",
"no",
"assets",
"are",
"found",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/resolve.rb#L46-L66 | train | Resolve a file | [
30522,
13366,
10663,
999,
1006,
4130,
1010,
1008,
1008,
10556,
10623,
2015,
1007,
24471,
2072,
1010,
2139,
4523,
1027,
10663,
1006,
4130,
1010,
1008,
1008,
10556,
10623,
2015,
1007,
4983,
24471,
2072,
4471,
1027,
5164,
1012,
2047,
1006,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/client/gitignore.rb | Github.Client::Gitignore.get | def get(*args)
arguments(args, required: [:name])
params = arguments.params
if (media = params.delete('accept'))
params['accept'] = media
params['raw'] = true
end
get_request("/gitignore/templates/#{arguments.name}", params)
end | ruby | def get(*args)
arguments(args, required: [:name])
params = arguments.params
if (media = params.delete('accept'))
params['accept'] = media
params['raw'] = true
end
get_request("/gitignore/templates/#{arguments.name}", params)
end | [
"def",
"get",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":name",
"]",
")",
"params",
"=",
"arguments",
".",
"params",
"if",
"(",
"media",
"=",
"params",
".",
"delete",
"(",
"'accept'",
")",
")",
"params",
"[",
"'ac... | Get a single template
@see https://developer.github.com/v3/gitignore/#get-a-single-template
@example
github = Github.new
github.gitignore.get "template-name"
Use the raw media type to get the raw contents.
@examples
github = Github.new
github.gitignore.get "template-name", accept: 'applicatin/vnd.github.raw'
@api public | [
"Get",
"a",
"single",
"template"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/gitignore.rb#L44-L54 | train | Get a template | [
30522,
13366,
2131,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
2171,
1033,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
2065,
1006,
2865,
1027,
11498,
5244,
1012,
3972,
12870,
1006,
1005,
5138... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | actiontext/app/helpers/action_text/tag_helper.rb | ActionView::Helpers.FormHelper.rich_text_area | def rich_text_area(object_name, method, options = {})
Tags::ActionText.new(object_name, method, self, options).render
end | ruby | def rich_text_area(object_name, method, options = {})
Tags::ActionText.new(object_name, method, self, options).render
end | [
"def",
"rich_text_area",
"(",
"object_name",
",",
"method",
",",
"options",
"=",
"{",
"}",
")",
"Tags",
"::",
"ActionText",
".",
"new",
"(",
"object_name",
",",
"method",
",",
"self",
",",
"options",
")",
".",
"render",
"end"
] | Returns a +trix-editor+ tag that instantiates the Trix JavaScript editor as well as a hidden field
that Trix will write to on changes, so the content will be sent on form submissions.
==== Options
* <tt>:class</tt> - Defaults to "trix-content" which ensures default styling is applied.
==== Example
form_with(model: @message) do |form|
form.rich_text_area :content
end
# <input type="hidden" name="message[content]" id="message_content_trix_input_message_1">
# <trix-editor id="content" input="message_content_trix_input_message_1" class="trix-content" ...></trix-editor> | [
"Returns",
"a",
"+",
"trix",
"-",
"editor",
"+",
"tag",
"that",
"instantiates",
"the",
"Trix",
"JavaScript",
"editor",
"as",
"well",
"as",
"a",
"hidden",
"field",
"that",
"Trix",
"will",
"write",
"to",
"on",
"changes",
"so",
"the",
"content",
"will",
"be... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actiontext/app/helpers/action_text/tag_helper.rb#L69-L71 | train | Render a rich text area | [
30522,
13366,
4138,
1035,
3793,
1035,
2181,
1006,
4874,
1035,
2171,
1010,
4118,
1010,
7047,
1027,
1063,
1065,
1007,
22073,
1024,
1024,
2895,
18209,
1012,
2047,
1006,
4874,
1035,
2171,
1010,
4118,
1010,
2969,
1010,
7047,
1007,
1012,
17552,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | lib/linguist/heuristics.rb | Linguist.Heuristics.call | def call(data)
matched = @rules.find do |rule|
rule['pattern'].match(data)
end
if !matched.nil?
languages = matched['language']
if languages.is_a?(Array)
languages.map{ |l| Language[l] }
else
Language[languages]
end
end
end | ruby | def call(data)
matched = @rules.find do |rule|
rule['pattern'].match(data)
end
if !matched.nil?
languages = matched['language']
if languages.is_a?(Array)
languages.map{ |l| Language[l] }
else
Language[languages]
end
end
end | [
"def",
"call",
"(",
"data",
")",
"matched",
"=",
"@rules",
".",
"find",
"do",
"|",
"rule",
"|",
"rule",
"[",
"'pattern'",
"]",
".",
"match",
"(",
"data",
")",
"end",
"if",
"!",
"matched",
".",
"nil?",
"languages",
"=",
"matched",
"[",
"'language'",
... | Internal: Perform the heuristic | [
"Internal",
":",
"Perform",
"the",
"heuristic"
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/heuristics.rb#L101-L113 | train | Returns the language of the data | [
30522,
13366,
2655,
1006,
2951,
1007,
10349,
1027,
1030,
3513,
1012,
2424,
2079,
1064,
3627,
1064,
3627,
1031,
1005,
5418,
1005,
1033,
1012,
2674,
1006,
2951,
1007,
2203,
2065,
999,
10349,
1012,
9152,
2140,
1029,
4155,
1027,
10349,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/models/error.rb | SquareConnect.Error.code= | def code=(code)
validator = EnumAttributeValidator.new('String', ["INTERNAL_SERVER_ERROR", "UNAUTHORIZED", "ACCESS_TOKEN_EXPIRED", "ACCESS_TOKEN_REVOKED", "FORBIDDEN", "INSUFFICIENT_SCOPES", "APPLICATION_DISABLED", "V1_APPLICATION", "V1_ACCESS_TOKEN", "CARD_PROCESSING_NOT_ENABLED", "BAD_REQUEST", "MISSING_REQUIRED_PARAMETER", "INCORRECT_TYPE", "INVALID_TIME", "INVALID_TIME_RANGE", "INVALID_VALUE", "INVALID_CURSOR", "UNKNOWN_QUERY_PARAMETER", "CONFLICTING_PARAMETERS", "EXPECTED_JSON_BODY", "INVALID_SORT_ORDER", "VALUE_REGEX_MISMATCH", "VALUE_TOO_SHORT", "VALUE_TOO_LONG", "VALUE_TOO_LOW", "VALUE_TOO_HIGH", "VALUE_EMPTY", "ARRAY_LENGTH_TOO_LONG", "ARRAY_LENGTH_TOO_SHORT", "ARRAY_EMPTY", "EXPECTED_BOOLEAN", "EXPECTED_INTEGER", "EXPECTED_FLOAT", "EXPECTED_STRING", "EXPECTED_OBJECT", "EXPECTED_ARRAY", "EXPECTED_MAP", "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", "INVALID_ARRAY_VALUE", "INVALID_ENUM_VALUE", "INVALID_CONTENT_TYPE", "INVALID_FORM_VALUE", "ONE_INSTRUMENT_EXPECTED", "NO_FIELDS_SET", "DEPRECATED_FIELD_SET", "CARD_EXPIRED", "INVALID_EXPIRATION", "INVALID_EXPIRATION_YEAR", "INVALID_EXPIRATION_DATE", "UNSUPPORTED_CARD_BRAND", "UNSUPPORTED_ENTRY_METHOD", "INVALID_ENCRYPTED_CARD", "INVALID_CARD", "DELAYED_TRANSACTION_EXPIRED", "DELAYED_TRANSACTION_CANCELED", "DELAYED_TRANSACTION_CAPTURED", "DELAYED_TRANSACTION_FAILED", "CARD_TOKEN_EXPIRED", "CARD_TOKEN_USED", "AMOUNT_TOO_HIGH", "UNSUPPORTED_INSTRUMENT_TYPE", "REFUND_AMOUNT_INVALID", "REFUND_ALREADY_PENDING", "PAYMENT_NOT_REFUNDABLE", "INVALID_CARD_DATA", "LOCATION_MISMATCH", "IDEMPOTENCY_KEY_REUSED", "UNEXPECTED_VALUE", "SANDBOX_NOT_SUPPORTED", "INVALID_EMAIL_ADDRESS", "INVALID_PHONE_NUMBER", "CHECKOUT_EXPIRED", "BAD_CERTIFICATE", "CARD_DECLINED", "VERIFY_CVV_FAILURE", "VERIFY_AVS_FAILURE", "CARD_DECLINED_CALL_ISSUER", "NOT_FOUND", "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "REQUEST_ENTITY_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "RATE_LIMITED", "NOT_IMPLEMENTED", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT"])
unless validator.valid?(code)
fail ArgumentError, "invalid value for 'code', must be one of #{validator.allowable_values}."
end
@code = code
end | ruby | def code=(code)
validator = EnumAttributeValidator.new('String', ["INTERNAL_SERVER_ERROR", "UNAUTHORIZED", "ACCESS_TOKEN_EXPIRED", "ACCESS_TOKEN_REVOKED", "FORBIDDEN", "INSUFFICIENT_SCOPES", "APPLICATION_DISABLED", "V1_APPLICATION", "V1_ACCESS_TOKEN", "CARD_PROCESSING_NOT_ENABLED", "BAD_REQUEST", "MISSING_REQUIRED_PARAMETER", "INCORRECT_TYPE", "INVALID_TIME", "INVALID_TIME_RANGE", "INVALID_VALUE", "INVALID_CURSOR", "UNKNOWN_QUERY_PARAMETER", "CONFLICTING_PARAMETERS", "EXPECTED_JSON_BODY", "INVALID_SORT_ORDER", "VALUE_REGEX_MISMATCH", "VALUE_TOO_SHORT", "VALUE_TOO_LONG", "VALUE_TOO_LOW", "VALUE_TOO_HIGH", "VALUE_EMPTY", "ARRAY_LENGTH_TOO_LONG", "ARRAY_LENGTH_TOO_SHORT", "ARRAY_EMPTY", "EXPECTED_BOOLEAN", "EXPECTED_INTEGER", "EXPECTED_FLOAT", "EXPECTED_STRING", "EXPECTED_OBJECT", "EXPECTED_ARRAY", "EXPECTED_MAP", "EXPECTED_BASE64_ENCODED_BYTE_ARRAY", "INVALID_ARRAY_VALUE", "INVALID_ENUM_VALUE", "INVALID_CONTENT_TYPE", "INVALID_FORM_VALUE", "ONE_INSTRUMENT_EXPECTED", "NO_FIELDS_SET", "DEPRECATED_FIELD_SET", "CARD_EXPIRED", "INVALID_EXPIRATION", "INVALID_EXPIRATION_YEAR", "INVALID_EXPIRATION_DATE", "UNSUPPORTED_CARD_BRAND", "UNSUPPORTED_ENTRY_METHOD", "INVALID_ENCRYPTED_CARD", "INVALID_CARD", "DELAYED_TRANSACTION_EXPIRED", "DELAYED_TRANSACTION_CANCELED", "DELAYED_TRANSACTION_CAPTURED", "DELAYED_TRANSACTION_FAILED", "CARD_TOKEN_EXPIRED", "CARD_TOKEN_USED", "AMOUNT_TOO_HIGH", "UNSUPPORTED_INSTRUMENT_TYPE", "REFUND_AMOUNT_INVALID", "REFUND_ALREADY_PENDING", "PAYMENT_NOT_REFUNDABLE", "INVALID_CARD_DATA", "LOCATION_MISMATCH", "IDEMPOTENCY_KEY_REUSED", "UNEXPECTED_VALUE", "SANDBOX_NOT_SUPPORTED", "INVALID_EMAIL_ADDRESS", "INVALID_PHONE_NUMBER", "CHECKOUT_EXPIRED", "BAD_CERTIFICATE", "CARD_DECLINED", "VERIFY_CVV_FAILURE", "VERIFY_AVS_FAILURE", "CARD_DECLINED_CALL_ISSUER", "NOT_FOUND", "APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND", "METHOD_NOT_ALLOWED", "NOT_ACCEPTABLE", "REQUEST_TIMEOUT", "CONFLICT", "REQUEST_ENTITY_TOO_LARGE", "UNSUPPORTED_MEDIA_TYPE", "RATE_LIMITED", "NOT_IMPLEMENTED", "SERVICE_UNAVAILABLE", "GATEWAY_TIMEOUT"])
unless validator.valid?(code)
fail ArgumentError, "invalid value for 'code', must be one of #{validator.allowable_values}."
end
@code = code
end | [
"def",
"code",
"=",
"(",
"code",
")",
"validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"INTERNAL_SERVER_ERROR\"",
",",
"\"UNAUTHORIZED\"",
",",
"\"ACCESS_TOKEN_EXPIRED\"",
",",
"\"ACCESS_TOKEN_REVOKED\"",
",",
"\"FORBIDDEN\"",
",",
... | Custom attribute writer method checking allowed values (enum).
@param [Object] code 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/error.rb#L134-L140 | train | Returns the key value pair for the given code. | [
30522,
13366,
3642,
1027,
1006,
3642,
1007,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
4722,
1035,
8241,
1035,
7561,
1000,
1010,
1000,
24641,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2017-03-30/generated/azure_mgmt_network/public_ipaddresses.rb | Azure::Network::Mgmt::V2017_03_30.PublicIPAddresses.list_virtual_machine_scale_set_public_ipaddresses_as_lazy | def list_virtual_machine_scale_set_public_ipaddresses_as_lazy(resource_group_name, virtual_machine_scale_set_name, custom_headers:nil)
response = list_virtual_machine_scale_set_public_ipaddresses_async(resource_group_name, virtual_machine_scale_set_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_virtual_machine_scale_set_public_ipaddresses_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_virtual_machine_scale_set_public_ipaddresses_as_lazy(resource_group_name, virtual_machine_scale_set_name, custom_headers:nil)
response = list_virtual_machine_scale_set_public_ipaddresses_async(resource_group_name, virtual_machine_scale_set_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_virtual_machine_scale_set_public_ipaddresses_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_virtual_machine_scale_set_public_ipaddresses_as_lazy",
"(",
"resource_group_name",
",",
"virtual_machine_scale_set_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_virtual_machine_scale_set_public_ipaddresses_async",
"(",
"resource_group_name",
",",
... | Gets information about all public IP addresses on a virtual machine scale set
level.
@param resource_group_name [String] The name of the resource group.
@param virtual_machine_scale_set_name [String] The name of the virtual
machine scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PublicIPAddressListResult] which provide lazy access to pages of the
response. | [
"Gets",
"information",
"about",
"all",
"public",
"IP",
"addresses",
"on",
"a",
"virtual",
"machine",
"scale",
"set",
"level",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2017-03-30/generated/azure_mgmt_network/public_ipaddresses.rb#L544-L553 | train | Gets all public IP addresses for a virtual machine in a VM scale set. | [
30522,
13366,
2862,
1035,
7484,
1035,
3698,
1035,
4094,
1035,
2275,
1035,
2270,
1035,
25249,
16200,
11393,
2015,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
3698,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/resource.rb | Aws::CloudFormation.Resource.create_stack | def create_stack(options = {})
resp = @client.create_stack(options)
Stack.new(
name: options[:stack_name],
client: @client
)
end | ruby | def create_stack(options = {})
resp = @client.create_stack(options)
Stack.new(
name: options[:stack_name],
client: @client
)
end | [
"def",
"create_stack",
"(",
"options",
"=",
"{",
"}",
")",
"resp",
"=",
"@client",
".",
"create_stack",
"(",
"options",
")",
"Stack",
".",
"new",
"(",
"name",
":",
"options",
"[",
":stack_name",
"]",
",",
"client",
":",
"@client",
")",
"end"
] | @!group Actions
@example Request syntax with placeholder values
stack = cloud_formation.create_stack({
stack_name: "StackName", # required
template_body: "TemplateBody",
template_url: "TemplateURL",
parameters: [
{
parameter_key: "ParameterKey",
parameter_value: "ParameterValue",
use_previous_value: false,
resolved_value: "ParameterValue",
},
],
disable_rollback: false,
rollback_configuration: {
rollback_triggers: [
{
arn: "Arn", # required
type: "Type", # required
},
],
monitoring_time_in_minutes: 1,
},
timeout_in_minutes: 1,
notification_arns: ["NotificationARN"],
capabilities: ["CAPABILITY_IAM"], # accepts CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_AUTO_EXPAND
resource_types: ["ResourceType"],
role_arn: "RoleARN",
on_failure: "DO_NOTHING", # accepts DO_NOTHING, ROLLBACK, DELETE
stack_policy_body: "StackPolicyBody",
stack_policy_url: "StackPolicyURL",
tags: [
{
key: "TagKey", # required
value: "TagValue", # required
},
],
client_request_token: "ClientRequestToken",
enable_termination_protection: false,
})
@param [Hash] options ({})
@option options [required, String] :stack_name
The name that is associated with the stack. The name must be unique in
the region in which you are creating the stack.
<note markdown="1"> A stack name can contain only alphanumeric characters (case sensitive)
and hyphens. It must start with an alphabetic character and cannot be
longer than 128 characters.
</note>
@option options [String] :template_body
Structure containing the template body with a minimum length of 1 byte
and a maximum length of 51,200 bytes. For more information, go to
[Template Anatomy][1] in the AWS CloudFormation User Guide.
Conditional: You must specify either the `TemplateBody` or the
`TemplateURL` parameter, but not both.
[1]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html
@option options [String] :template_url
Location of file containing the template body. The URL must point to a
template (max size: 460,800 bytes) that is located in an Amazon S3
bucket. For more information, go to the [Template Anatomy][1] in the
AWS CloudFormation User Guide.
Conditional: You must specify either the `TemplateBody` or the
`TemplateURL` parameter, but not both.
[1]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html
@option options [Array<Types::Parameter>] :parameters
A list of `Parameter` structures that specify input parameters for the
stack. For more information, see the [Parameter][1] data type.
[1]: https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Parameter.html
@option options [Boolean] :disable_rollback
Set to `true` to disable rollback of the stack if stack creation
failed. You can specify either `DisableRollback` or `OnFailure`, but
not both.
Default: `false`
@option options [Types::RollbackConfiguration] :rollback_configuration
The rollback triggers for AWS CloudFormation to monitor during stack
creation and updating operations, and for the specified monitoring
period afterwards.
@option options [Integer] :timeout_in_minutes
The amount of time that can pass before the stack status becomes
CREATE\_FAILED; if `DisableRollback` is not set or is set to `false`,
the stack will be rolled back.
@option options [Array<String>] :notification_arns
The Simple Notification Service (SNS) topic ARNs to publish stack
related events. You can find your SNS topic ARNs using the SNS console
or your Command Line Interface (CLI).
@option options [Array<String>] :capabilities
In some cases, you must explicity acknowledge that your stack template
contains certain capabilities in order for AWS CloudFormation to
create the stack.
* `CAPABILITY_IAM` and `CAPABILITY_NAMED_IAM`
Some stack templates might include resources that can affect
permissions in your AWS account; for example, by creating new AWS
Identity and Access Management (IAM) users. For those stacks, you
must explicitly acknowledge this by specifying one of these
capabilities.
The following IAM resources require you to specify either the
`CAPABILITY_IAM` or `CAPABILITY_NAMED_IAM` capability.
* If you have IAM resources, you can specify either capability.
* If you have IAM resources with custom names, you *must* specify
`CAPABILITY_NAMED_IAM`.
* If you don't specify either of these capabilities, AWS
CloudFormation returns an `InsufficientCapabilities` error.
If your stack template contains these resources, we recommend that
you review all permissions associated with them and edit their
permissions if necessary.
* [ AWS::IAM::AccessKey][1]
* [ AWS::IAM::Group][2]
* [ AWS::IAM::InstanceProfile][3]
* [ AWS::IAM::Policy][4]
* [ AWS::IAM::Role][5]
* [ AWS::IAM::User][6]
* [ AWS::IAM::UserToGroupAddition][7]
For more information, see [Acknowledging IAM Resources in AWS
CloudFormation Templates][8].
* `CAPABILITY_AUTO_EXPAND`
Some template contain macros. Macros perform custom processing on
templates; this can include simple actions like find-and-replace
operations, all the way to extensive transformations of entire
templates. Because of this, users typically create a change set from
the processed template, so that they can review the changes
resulting from the macros before actually creating the stack. If
your stack template contains one or more macros, and you choose to
create a stack directly from the processed template, without first
reviewing the resulting changes in a change set, you must
acknowledge this capability. This includes the [AWS::Include][9] and
[AWS::Serverless][10] transforms, which are macros hosted by AWS
CloudFormation.
Change sets do not currently support nested stacks. If you want to
create a stack from a stack template that contains macros *and*
nested stacks, you must create the stack directly from the template
using this capability.
You should only create stacks directly from a stack template that
contains macros if you know what processing the macro performs.
Each macro relies on an underlying Lambda service function for
processing stack templates. Be aware that the Lambda function owner
can update the function operation without AWS CloudFormation being
notified.
For more information, see [Using AWS CloudFormation Macros to
Perform Custom Processing on Templates][11].
[1]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-accesskey.html
[2]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html
[3]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html
[4]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-policy.html
[5]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html
[6]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html
[7]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-addusertogroup.html
[8]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#capabilities
[9]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/create-reusable-transform-function-snippets-and-add-to-your-template-with-aws-include-transform.html
[10]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-aws-serverless.html
[11]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html
@option options [Array<String>] :resource_types
The template resource types that you have permissions to work with for
this create stack action, such as `AWS::EC2::Instance`, `AWS::EC2::*`,
or `Custom::MyCustomInstance`. Use the following syntax to describe
template resource types: `AWS::*` (for all AWS resource), `Custom::*`
(for all custom resources), `Custom::logical_ID ` (for a specific
custom resource), `AWS::service_name::*` (for all resources of a
particular AWS service), and `AWS::service_name::resource_logical_ID `
(for a specific AWS resource).
If the list of resource types doesn't include a resource that you're
creating, the stack creation fails. By default, AWS CloudFormation
grants permissions to all resource types. AWS Identity and Access
Management (IAM) uses this parameter for AWS CloudFormation-specific
condition keys in IAM policies. For more information, see [Controlling
Access with AWS Identity and Access Management][1].
[1]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html
@option options [String] :role_arn
The Amazon Resource Name (ARN) of an AWS Identity and Access
Management (IAM) role that AWS CloudFormation assumes to create the
stack. AWS CloudFormation uses the role's credentials to make calls
on your behalf. AWS CloudFormation always uses this role for all
future operations on the stack. As long as users have permission to
operate on the stack, AWS CloudFormation uses this role even if the
users don't have permission to pass it. Ensure that the role grants
least privilege.
If you don't specify a value, AWS CloudFormation uses the role that
was previously associated with the stack. If no role is available, AWS
CloudFormation uses a temporary session that is generated from your
user credentials.
@option options [String] :on_failure
Determines what action will be taken if stack creation fails. This
must be one of: DO\_NOTHING, ROLLBACK, or DELETE. You can specify
either `OnFailure` or `DisableRollback`, but not both.
Default: `ROLLBACK`
@option options [String] :stack_policy_body
Structure containing the stack policy body. For more information, go
to [ Prevent Updates to Stack Resources][1] in the *AWS CloudFormation
User Guide*. You can specify either the `StackPolicyBody` or the
`StackPolicyURL` parameter, but not both.
[1]: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html
@option options [String] :stack_policy_url
Location of a file containing the stack policy. The URL must point to
a policy (maximum size: 16 KB) located in an S3 bucket in the same
region as the stack. You can specify either the `StackPolicyBody` or
the `StackPolicyURL` parameter, but not both.
@option options [Array<Types::Tag>] :tags
Key-value pairs to associate with this stack. AWS CloudFormation also
propagates these tags to the resources created in the stack. A maximum
number of 50 tags can be specified.
@option options [String] :client_request_token
A unique identifier for this `CreateStack` request. Specify this token
if you plan to retry requests so that AWS CloudFormation knows that
you're not attempting to create a stack with the same name. You might
retry `CreateStack` requests to ensure that AWS CloudFormation
successfully received them.
All events triggered by a given stack operation are assigned the same
client request token, which you can use to track operations. For
example, if you execute a `CreateStack` operation with the token
`token1`, then all the `StackEvents` generated by that operation will
have `ClientRequestToken` set as `token1`.
In the console, stack operations display the client request token on
the Events tab. Stack operations that are initiated from the console
use the token format *Console-StackOperation-ID*, which helps you
easily identify the stack operation . For example, if you create a
stack using the console, each stack event would be assigned the same
token in the following format:
`Console-CreateStack-7f59c3cf-00d2-40c7-b2ff-e75db0987002`.
@option options [Boolean] :enable_termination_protection
Whether to enable termination protection on the specified stack. If a
user attempts to delete a stack with termination protection enabled,
the operation fails and the stack remains unchanged. For more
information, see [Protecting a Stack From Being Deleted][1] in the
*AWS CloudFormation User Guide*. Termination protection is disabled on
stacks by default.
For [nested stacks][2], termination protection is set on the root
stack and cannot be changed directly on the nested stack.
[1]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html
[2]: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html
@return [Stack] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/resource.rb#L306-L312 | train | Create a new stack | [
30522,
13366,
3443,
1035,
9991,
1006,
7047,
1027,
1063,
1065,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/bolt | lib/bolt_server/file_cache.rb | BoltServer.FileCache.create_cache_dir | def create_cache_dir(sha)
file_dir = File.join(@cache_dir, sha)
@cache_dir_mutex.with_read_lock do
# mkdir_p doesn't error if the file exists
FileUtils.mkdir_p(file_dir, mode: 0o750)
FileUtils.touch(file_dir)
end
file_dir
end | ruby | def create_cache_dir(sha)
file_dir = File.join(@cache_dir, sha)
@cache_dir_mutex.with_read_lock do
# mkdir_p doesn't error if the file exists
FileUtils.mkdir_p(file_dir, mode: 0o750)
FileUtils.touch(file_dir)
end
file_dir
end | [
"def",
"create_cache_dir",
"(",
"sha",
")",
"file_dir",
"=",
"File",
".",
"join",
"(",
"@cache_dir",
",",
"sha",
")",
"@cache_dir_mutex",
".",
"with_read_lock",
"do",
"# mkdir_p doesn't error if the file exists",
"FileUtils",
".",
"mkdir_p",
"(",
"file_dir",
",",
... | Create a cache dir if necessary and update it's last write time. Returns the dir.
Acquires @cache_dir_mutex to ensure we don't try to purge the directory at the same time.
Uses the directory mtime because it's simpler to ensure the directory exists and update
mtime in a single place than with a file in a directory that may not exist. | [
"Create",
"a",
"cache",
"dir",
"if",
"necessary",
"and",
"update",
"it",
"s",
"last",
"write",
"time",
".",
"Returns",
"the",
"dir",
".",
"Acquires"
] | 50689a33699939d262ea7c822a4b24fd8c4f8d8a | https://github.com/puppetlabs/bolt/blob/50689a33699939d262ea7c822a4b24fd8c4f8d8a/lib/bolt_server/file_cache.rb#L120-L128 | train | Create the cache directory for the given sha. | [
30522,
13366,
3443,
1035,
17053,
1035,
16101,
1006,
21146,
1007,
5371,
1035,
16101,
1027,
5371,
1012,
3693,
1006,
1030,
17053,
1035,
16101,
1010,
21146,
1007,
1030,
17053,
1035,
16101,
1035,
20101,
2595,
1012,
2007,
1035,
3191,
1035,
5843,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_multi_role_pool_skus_as_lazy | def list_multi_role_pool_skus_as_lazy(resource_group_name, name, custom_headers:nil)
response = list_multi_role_pool_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_pool_skus_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_multi_role_pool_skus_as_lazy(resource_group_name, name, custom_headers:nil)
response = list_multi_role_pool_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_pool_skus_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_multi_role_pool_skus_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_multi_role_pool_skus_async",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Get available SKUs for scaling a multi-role pool.
Get available SKUs for scaling a multi-role pool.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SkuInfoCollection] which provide lazy access to pages of the
response. | [
"Get",
"available",
"SKUs",
"for",
"scaling",
"a",
"multi",
"-",
"role",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L7696-L7705 | train | Gets the list of all the skus in a multi - role pool. | [
30522,
13366,
2862,
1035,
4800,
1035,
2535,
1035,
4770,
1035,
15315,
2271,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
4800,
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_logic/lib/2016-06-01/generated/azure_mgmt_logic/partners.rb | Azure::Logic::Mgmt::V2016_06_01.Partners.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, integration_account_name, partner_name, partner, custom_headers:nil)
create_or_update_async(resource_group_name, integration_account_name, partner_name, partner, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, integration_account_name, partner_name, partner, custom_headers:nil)
create_or_update_async(resource_group_name, integration_account_name, partner_name, partner, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"partner_name",
",",
"partner",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"integration_account_name",
",",
"p... | Creates or updates an integration account partner.
@param resource_group_name [String] The resource group name.
@param integration_account_name [String] The integration account name.
@param partner_name [String] The integration account partner name.
@param partner [IntegrationAccountPartner] The integration account partner.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"partner",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/partners.rb#L250-L252 | train | Creates or updates an integration account partner. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8346,
1035,
4070,
1035,
2171,
1010,
4256,
1035,
2171,
1010,
4256,
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... |
github/linguist | samples/Ruby/inflector.rb | ActiveSupport.Inflector.camelize | def camelize(term, uppercase_first_letter = true)
string = term.to_s
if uppercase_first_letter
string = string.sub(/^[a-z\d]*/) { inflections.acronyms[$&] || $&.capitalize }
else
string = string.sub(/^(?:#{inflections.acronym_regex}(?=\b|[A-Z_])|\w)/) { $&.downcase }
end
string.gsub(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{inflections.acronyms[$2] || $2.capitalize}" }.gsub('/', '::')
end | ruby | def camelize(term, uppercase_first_letter = true)
string = term.to_s
if uppercase_first_letter
string = string.sub(/^[a-z\d]*/) { inflections.acronyms[$&] || $&.capitalize }
else
string = string.sub(/^(?:#{inflections.acronym_regex}(?=\b|[A-Z_])|\w)/) { $&.downcase }
end
string.gsub(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{inflections.acronyms[$2] || $2.capitalize}" }.gsub('/', '::')
end | [
"def",
"camelize",
"(",
"term",
",",
"uppercase_first_letter",
"=",
"true",
")",
"string",
"=",
"term",
".",
"to_s",
"if",
"uppercase_first_letter",
"string",
"=",
"string",
".",
"sub",
"(",
"/",
"\\d",
"/",
")",
"{",
"inflections",
".",
"acronyms",
"[",
... | By default, +camelize+ converts strings to UpperCamelCase. If the argument to +camelize+
is set to <tt>:lower</tt> then +camelize+ produces lowerCamelCase.
+camelize+ will also convert '/' to '::' which is useful for converting paths to namespaces.
"active_model".camelize # => "ActiveModel"
"active_model".camelize(:lower) # => "activeModel"
"active_model/errors".camelize # => "ActiveModel::Errors"
"active_model/errors".camelize(:lower) # => "activeModel::Errors"
As a rule of thumb you can think of +camelize+ as the inverse of +underscore+,
though there are cases where that does not hold:
"SSLError".underscore.camelize # => "SslError" | [
"By",
"default",
"+",
"camelize",
"+",
"converts",
"strings",
"to",
"UpperCamelCase",
".",
"If",
"the",
"argument",
"to",
"+",
"camelize",
"+",
"is",
"set",
"to",
"<tt",
">",
":",
"lower<",
"/",
"tt",
">",
"then",
"+",
"camelize",
"+",
"produces",
"low... | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/samples/Ruby/inflector.rb#L53-L61 | train | CamelCase a term | [
30522,
13366,
19130,
4697,
1006,
2744,
1010,
3356,
18382,
1035,
2034,
1035,
3661,
1027,
2995,
1007,
5164,
1027,
2744,
1012,
2000,
1035,
1055,
2065,
3356,
18382,
1035,
2034,
1035,
3661,
5164,
1027,
5164,
1012,
4942,
1006,
1013,
1034,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/scss-lint | lib/scss_lint/sass/tree.rb | Sass::Tree.Node.add_line_number | def add_line_number(node)
node.line ||= line if node.is_a?(::Sass::Script::Tree::Node)
node
end | ruby | def add_line_number(node)
node.line ||= line if node.is_a?(::Sass::Script::Tree::Node)
node
end | [
"def",
"add_line_number",
"(",
"node",
")",
"node",
".",
"line",
"||=",
"line",
"if",
"node",
".",
"is_a?",
"(",
"::",
"Sass",
"::",
"Script",
"::",
"Tree",
"::",
"Node",
")",
"node",
"end"
] | The Sass parser sometimes doesn't assign line numbers in cases where it
should. This is a helper to easily correct that. | [
"The",
"Sass",
"parser",
"sometimes",
"doesn",
"t",
"assign",
"line",
"numbers",
"in",
"cases",
"where",
"it",
"should",
".",
"This",
"is",
"a",
"helper",
"to",
"easily",
"correct",
"that",
"."
] | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/sass/tree.rb#L16-L19 | train | Add line number to node | [
30522,
13366,
5587,
1035,
2240,
1035,
2193,
1006,
13045,
1007,
13045,
1012,
30524,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/stylesheet/font.rb | Axlsx.Font.to_xml_string | def to_xml_string(str = '')
str << '<font>'
instance_values.each do |k, v|
v.is_a?(Color) ? v.to_xml_string(str) : (str << ('<' << k.to_s << ' val="' << Axlsx.booleanize(v).to_s << '"/>'))
end
str << '</font>'
end | ruby | def to_xml_string(str = '')
str << '<font>'
instance_values.each do |k, v|
v.is_a?(Color) ? v.to_xml_string(str) : (str << ('<' << k.to_s << ' val="' << Axlsx.booleanize(v).to_s << '"/>'))
end
str << '</font>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"str",
"<<",
"'<font>'",
"instance_values",
".",
"each",
"do",
"|",
"k",
",",
"v",
"|",
"v",
".",
"is_a?",
"(",
"Color",
")",
"?",
"v",
".",
"to_xml_string",
"(",
"str",
")",
":",
"(",
"str",
"<... | Serializes the object
@param [String] str
@return [String] | [
"Serializes",
"the",
"object"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/stylesheet/font.rb#L140-L146 | train | Convert the object to XML string. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
2358,
2099,
1026,
1026,
1005,
1026,
15489,
1028,
1005,
6013,
1035,
5300,
1012,
2169,
2079,
1064,
1047,
1010,
1058,
1064,
1058,
1012,
2003,
1035,
1037,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
castwide/solargraph | lib/solargraph/library.rb | Solargraph.Library.completions_at | def completions_at filename, line, column
position = Position.new(line, column)
cursor = Source::Cursor.new(checkout(filename), position)
api_map.clip(cursor).complete
end | ruby | def completions_at filename, line, column
position = Position.new(line, column)
cursor = Source::Cursor.new(checkout(filename), position)
api_map.clip(cursor).complete
end | [
"def",
"completions_at",
"filename",
",",
"line",
",",
"column",
"position",
"=",
"Position",
".",
"new",
"(",
"line",
",",
"column",
")",
"cursor",
"=",
"Source",
"::",
"Cursor",
".",
"new",
"(",
"checkout",
"(",
"filename",
")",
",",
"position",
")",
... | Get completion suggestions at the specified file and location.
@param filename [String] The file to analyze
@param line [Integer] The zero-based line number
@param column [Integer] The zero-based column number
@return [SourceMap::Completion]
@todo Take a Location instead of filename/line/column | [
"Get",
"completion",
"suggestions",
"at",
"the",
"specified",
"file",
"and",
"location",
"."
] | 47badb5d151aca775ccbe6c470236089eae7839d | https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/library.rb#L160-L164 | train | Returns the completions at the given position | [
30522,
13366,
6503,
2015,
1035,
2012,
5371,
18442,
1010,
2240,
1010,
5930,
2597,
1027,
2597,
1012,
2047,
1006,
2240,
1010,
5930,
1007,
12731,
25301,
2099,
1027,
3120,
1024,
1024,
12731,
25301,
2099,
1012,
2047,
1006,
4638,
5833,
1006,
5371,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
chaps-io/public_activity | lib/public_activity/utility/view_helpers.rb | PublicActivity.ViewHelpers.single_content_for | def single_content_for(name, content = nil, &block)
@view_flow.set(name, ActiveSupport::SafeBuffer.new)
content_for(name, content, &block)
end | ruby | def single_content_for(name, content = nil, &block)
@view_flow.set(name, ActiveSupport::SafeBuffer.new)
content_for(name, content, &block)
end | [
"def",
"single_content_for",
"(",
"name",
",",
"content",
"=",
"nil",
",",
"&",
"block",
")",
"@view_flow",
".",
"set",
"(",
"name",
",",
"ActiveSupport",
"::",
"SafeBuffer",
".",
"new",
")",
"content_for",
"(",
"name",
",",
"content",
",",
"block",
")",... | Helper for setting content_for in activity partial, needed to
flush remains in between partial renders. | [
"Helper",
"for",
"setting",
"content_for",
"in",
"activity",
"partial",
"needed",
"to",
"flush",
"remains",
"in",
"between",
"partial",
"renders",
"."
] | e4357cd14db67299e0cbbd656300f51b7069ea9b | https://github.com/chaps-io/public_activity/blob/e4357cd14db67299e0cbbd656300f51b7069ea9b/lib/public_activity/utility/view_helpers.rb#L21-L24 | train | Create a single content for a view flow | [
30522,
13366,
2309,
1035,
4180,
1035,
2005,
1006,
2171,
1010,
4180,
1027,
9152,
2140,
1010,
1004,
3796,
1007,
1030,
3193,
1035,
4834,
1012,
2275,
1006,
2171,
1010,
3161,
6342,
9397,
11589,
1024,
1024,
3647,
8569,
12494,
1012,
2047,
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... |
refile/refile | lib/refile/attachment.rb | Refile.Attachment.attachment | def attachment(name, cache: :cache, store: :store, raise_errors: true, type: nil, extension: nil, content_type: nil)
definition = AttachmentDefinition.new(name,
cache: cache,
store: store,
raise_errors: raise_errors,
type: type,
extension: extension,
content_type: content_type
)
define_singleton_method :"#{name}_attachment_definition" do
definition
end
mod = Module.new do
attacher = :"#{name}_attacher"
define_method :"#{name}_attachment_definition" do
definition
end
define_method attacher do
ivar = :"@#{attacher}"
instance_variable_get(ivar) or instance_variable_set(ivar, Attacher.new(definition, self))
end
define_method "#{name}=" do |value|
send(attacher).set(value)
end
define_method name do
send(attacher).get
end
define_method "remove_#{name}=" do |remove|
send(attacher).remove = remove
end
define_method "remove_#{name}" do
send(attacher).remove
end
define_method "remote_#{name}_url=" do |url|
send(attacher).download(url)
end
define_method "remote_#{name}_url" do
end
define_method "#{name}_url" do |*args|
Refile.attachment_url(self, name, *args)
end
define_method "presigned_#{name}_url" do |expires_in = 900|
attachment = send(attacher)
attachment.store.object(attachment.id).presigned_url(:get, expires_in: expires_in) unless attachment.id.nil?
end
define_method "#{name}_data" do
send(attacher).data
end
define_singleton_method("to_s") { "Refile::Attachment(#{name})" }
define_singleton_method("inspect") { "Refile::Attachment(#{name})" }
end
include mod
end | ruby | def attachment(name, cache: :cache, store: :store, raise_errors: true, type: nil, extension: nil, content_type: nil)
definition = AttachmentDefinition.new(name,
cache: cache,
store: store,
raise_errors: raise_errors,
type: type,
extension: extension,
content_type: content_type
)
define_singleton_method :"#{name}_attachment_definition" do
definition
end
mod = Module.new do
attacher = :"#{name}_attacher"
define_method :"#{name}_attachment_definition" do
definition
end
define_method attacher do
ivar = :"@#{attacher}"
instance_variable_get(ivar) or instance_variable_set(ivar, Attacher.new(definition, self))
end
define_method "#{name}=" do |value|
send(attacher).set(value)
end
define_method name do
send(attacher).get
end
define_method "remove_#{name}=" do |remove|
send(attacher).remove = remove
end
define_method "remove_#{name}" do
send(attacher).remove
end
define_method "remote_#{name}_url=" do |url|
send(attacher).download(url)
end
define_method "remote_#{name}_url" do
end
define_method "#{name}_url" do |*args|
Refile.attachment_url(self, name, *args)
end
define_method "presigned_#{name}_url" do |expires_in = 900|
attachment = send(attacher)
attachment.store.object(attachment.id).presigned_url(:get, expires_in: expires_in) unless attachment.id.nil?
end
define_method "#{name}_data" do
send(attacher).data
end
define_singleton_method("to_s") { "Refile::Attachment(#{name})" }
define_singleton_method("inspect") { "Refile::Attachment(#{name})" }
end
include mod
end | [
"def",
"attachment",
"(",
"name",
",",
"cache",
":",
":cache",
",",
"store",
":",
":store",
",",
"raise_errors",
":",
"true",
",",
"type",
":",
"nil",
",",
"extension",
":",
"nil",
",",
"content_type",
":",
"nil",
")",
"definition",
"=",
"AttachmentDefin... | Macro which generates accessors for the given column which make it
possible to upload and retrieve previously uploaded files through the
generated accessors.
The `raise_errors` option controls whether assigning an invalid file
should immediately raise an error, or save the error and defer handling
it until later.
Given a record with an attachment named `image`, the following methods
will be added:
- `image`
- `image=`
- `remove_image`
- `remove_image=`
- `remote_image_url`
- `remote_image_url=`
- `image_url`
- `image_presigned_url`
@example
class User
extend Refile::Attachment
attachment :image
attr_accessor :image_id
end
@param [String] name Name of the column which accessor are generated for
@param [#to_s] cache Name of a backend in {Refile.backends} to use as transient cache
@param [#to_s] store Name of a backend in {Refile.backends} to use as permanent store
@param [true, false] raise_errors Whether to raise errors in case an invalid file is assigned
@param [Symbol, nil] type The type of file that can be uploaded, see {Refile.types}
@param [String, Array<String>, nil] extension Limit the uploaded file to the given extension or list of extensions
@param [String, Array<String>, nil] content_type Limit the uploaded file to the given content type or list of content types
@return [void] | [
"Macro",
"which",
"generates",
"accessors",
"for",
"the",
"given",
"column",
"which",
"make",
"it",
"possible",
"to",
"upload",
"and",
"retrieve",
"previously",
"uploaded",
"files",
"through",
"the",
"generated",
"accessors",
"."
] | e910f5ca5a9060c307bd0a5e813f1fec73219ed5 | https://github.com/refile/refile/blob/e910f5ca5a9060c307bd0a5e813f1fec73219ed5/lib/refile/attachment.rb#L39-L106 | train | Creates a new instance of the attachment class. | [
30522,
13366,
14449,
1006,
2171,
1010,
17053,
1024,
1024,
17053,
1010,
3573,
1024,
1024,
3573,
1010,
5333,
1035,
10697,
1024,
2995,
1010,
2828,
1024,
9152,
2140,
1010,
5331,
1024,
9152,
2140,
1010,
4180,
1035,
2828,
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... |
ffaker/ffaker | lib/ffaker/tweet.rb | FFaker.Tweet.tweet | def tweet(args = {})
options = {
num_hashtags: [0, rand(1..10) - 6].max,
num_mentions: [0, rand(1..10) - 8].max,
reply: (rand(1..10) == 1),
body_length: rand(20..140)
}.merge(args)
my_reply = options[:reply] ? "#{mention} " : ''
my_mentions = options[:num_mentions] > 0 ? "#{mentions(options[:num_mentions])} " : ''
my_tags = tags(options[:num_hashtags])
remaining = [
options[:body_length],
140 - (my_reply.size + my_mentions.size + my_tags.size)
].min
"#{my_reply}#{body(remaining)}#{my_mentions}#{my_tags}"
end | ruby | def tweet(args = {})
options = {
num_hashtags: [0, rand(1..10) - 6].max,
num_mentions: [0, rand(1..10) - 8].max,
reply: (rand(1..10) == 1),
body_length: rand(20..140)
}.merge(args)
my_reply = options[:reply] ? "#{mention} " : ''
my_mentions = options[:num_mentions] > 0 ? "#{mentions(options[:num_mentions])} " : ''
my_tags = tags(options[:num_hashtags])
remaining = [
options[:body_length],
140 - (my_reply.size + my_mentions.size + my_tags.size)
].min
"#{my_reply}#{body(remaining)}#{my_mentions}#{my_tags}"
end | [
"def",
"tweet",
"(",
"args",
"=",
"{",
"}",
")",
"options",
"=",
"{",
"num_hashtags",
":",
"[",
"0",
",",
"rand",
"(",
"1",
"..",
"10",
")",
"-",
"6",
"]",
".",
"max",
",",
"num_mentions",
":",
"[",
"0",
",",
"rand",
"(",
"1",
"..",
"10",
"... | Options
num_hashtags: How many hashtags (default: (skewed (40%) 1-4))
num_mentions: How many mentions (default: (skewed (20% 1-2))
reply: Add reply? (default: (random 10%)
body_length: Target length (rand(20..140)) (will be <= target) | [
"Options",
"num_hashtags",
":",
"How",
"many",
"hashtags",
"(",
"default",
":",
"(",
"skewed",
"(",
"40%",
")",
"1",
"-",
"4",
"))",
"num_mentions",
":",
"How",
"many",
"mentions",
"(",
"default",
":",
"(",
"skewed",
"(",
"20%",
"1",
"-",
"2",
"))",
... | 9570ac54874fec66a99b9c86401fb878f1e3e951 | https://github.com/ffaker/ffaker/blob/9570ac54874fec66a99b9c86401fb878f1e3e951/lib/ffaker/tweet.rb#L13-L31 | train | Returns a tweet with the given options | [
30522,
13366,
1056,
28394,
2102,
1006,
12098,
5620,
1027,
1063,
1065,
1007,
7047,
1027,
1063,
16371,
2213,
1035,
23325,
15900,
2015,
1024,
1031,
1014,
1010,
14566,
1006,
1015,
1012,
1012,
2184,
1007,
1011,
1020,
1033,
1012,
4098,
1010,
1637... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/resource.rb | Aws::AutoScaling.Resource.create_group | def create_group(options = {})
resp = @client.create_auto_scaling_group(options)
AutoScalingGroup.new(
name: options[:auto_scaling_group_name],
client: @client
)
end | ruby | def create_group(options = {})
resp = @client.create_auto_scaling_group(options)
AutoScalingGroup.new(
name: options[:auto_scaling_group_name],
client: @client
)
end | [
"def",
"create_group",
"(",
"options",
"=",
"{",
"}",
")",
"resp",
"=",
"@client",
".",
"create_auto_scaling_group",
"(",
"options",
")",
"AutoScalingGroup",
".",
"new",
"(",
"name",
":",
"options",
"[",
":auto_scaling_group_name",
"]",
",",
"client",
":",
"... | @!group Actions
@example Request syntax with placeholder values
autoscalinggroup = auto_scaling.create_group({
auto_scaling_group_name: "XmlStringMaxLen255", # required
launch_configuration_name: "ResourceName",
launch_template: {
launch_template_id: "XmlStringMaxLen255",
launch_template_name: "LaunchTemplateName",
version: "XmlStringMaxLen255",
},
mixed_instances_policy: {
launch_template: {
launch_template_specification: {
launch_template_id: "XmlStringMaxLen255",
launch_template_name: "LaunchTemplateName",
version: "XmlStringMaxLen255",
},
overrides: [
{
instance_type: "XmlStringMaxLen255",
},
],
},
instances_distribution: {
on_demand_allocation_strategy: "XmlString",
on_demand_base_capacity: 1,
on_demand_percentage_above_base_capacity: 1,
spot_allocation_strategy: "XmlString",
spot_instance_pools: 1,
spot_max_price: "MixedInstanceSpotPrice",
},
},
instance_id: "XmlStringMaxLen19",
min_size: 1, # required
max_size: 1, # required
desired_capacity: 1,
default_cooldown: 1,
availability_zones: ["XmlStringMaxLen255"],
load_balancer_names: ["XmlStringMaxLen255"],
target_group_arns: ["XmlStringMaxLen511"],
health_check_type: "XmlStringMaxLen32",
health_check_grace_period: 1,
placement_group: "XmlStringMaxLen255",
vpc_zone_identifier: "XmlStringMaxLen2047",
termination_policies: ["XmlStringMaxLen1600"],
new_instances_protected_from_scale_in: false,
lifecycle_hook_specification_list: [
{
lifecycle_hook_name: "AsciiStringMaxLen255", # required
lifecycle_transition: "LifecycleTransition", # required
notification_metadata: "XmlStringMaxLen1023",
heartbeat_timeout: 1,
default_result: "LifecycleActionResult",
notification_target_arn: "NotificationTargetResourceName",
role_arn: "ResourceName",
},
],
tags: [
{
resource_id: "XmlString",
resource_type: "XmlString",
key: "TagKey", # required
value: "TagValue",
propagate_at_launch: false,
},
],
service_linked_role_arn: "ResourceName",
})
@param [Hash] options ({})
@option options [required, String] :auto_scaling_group_name
The name of the Auto Scaling group. This name must be unique within
the scope of your AWS account.
@option options [String] :launch_configuration_name
The name of the launch configuration. This parameter, a launch
template, a mixed instances policy, or an EC2 instance must be
specified.
For more information, see [Creating an Auto Scaling Group Using a
Launch Configuration][1] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg.html
@option options [Types::LaunchTemplateSpecification] :launch_template
The launch template to use to launch instances. This parameter, a
launch configuration, a mixed instances policy, or an EC2 instance
must be specified.
For more information, see [Creating an Auto Scaling Group Using a
Launch Template][1] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-launch-template.html
@option options [Types::MixedInstancesPolicy] :mixed_instances_policy
The mixed instances policy to use to launch instances. This parameter,
a launch template, a launch configuration, or an EC2 instance must be
specified.
For more information, see [Auto Scaling Groups with Multiple Instance
Types and Purchase Options][1] in the *Amazon EC2 Auto Scaling User
Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-purchase-options.html
@option options [String] :instance_id
The ID of the instance used to create a launch configuration for the
group. This parameter, a launch configuration, a launch template, or a
mixed instances policy must be specified.
When you specify an ID of an instance, Amazon EC2 Auto Scaling creates
a new launch configuration and associates it with the group. This
launch configuration derives its attributes from the specified
instance, except for the block device mapping.
For more information, see [Create an Auto Scaling Group Using an EC2
Instance][1] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-asg-from-instance.html
@option options [required, Integer] :min_size
The minimum size of the group.
@option options [required, Integer] :max_size
The maximum size of the group.
@option options [Integer] :desired_capacity
The number of EC2 instances that should be running in the group. This
number must be greater than or equal to the minimum size of the group
and less than or equal to the maximum size of the group. If you do not
specify a desired capacity, the default is the minimum size of the
group.
@option options [Integer] :default_cooldown
The amount of time, in seconds, after a scaling activity completes
before another scaling activity can start. The default value is `300`.
For more information, see [Scaling Cooldowns][1] in the *Amazon EC2
Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/Cooldown.html
@option options [Array<String>] :availability_zones
One or more Availability Zones for the group. This parameter is
optional if you specify one or more subnets for `VPCZoneIdentifier`.
Conditional: If your account supports EC2-Classic and VPC, this
parameter is required to launch instances into EC2-Classic.
@option options [Array<String>] :load_balancer_names
One or more Classic Load Balancers. To specify an Application Load
Balancer or a Network Load Balancer, use `TargetGroupARNs` instead.
For more information, see [Using a Load Balancer With an Auto Scaling
Group][1] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-load-balancer.html
@option options [Array<String>] :target_group_arns
The Amazon Resource Names (ARN) of the target groups.
@option options [String] :health_check_type
The service to use for the health checks. The valid values are `EC2`
and `ELB`. The default value is `EC2`. If you configure an Auto
Scaling group to use ELB health checks, it considers the instance
unhealthy if it fails either the EC2 status checks or the load
balancer health checks.
For more information, see [Health Checks for Auto Scaling
Instances][1] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html
@option options [Integer] :health_check_grace_period
The amount of time, in seconds, that Amazon EC2 Auto Scaling waits
before checking the health status of an EC2 instance that has come
into service. During this time, any health check failures for the
instance are ignored. The default value is `0`.
For more information, see [Health Checks for Auto Scaling
Instances][1] in the *Amazon EC2 Auto Scaling User Guide*.
Conditional: This parameter is required if you are adding an `ELB`
health check.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/healthcheck.html
@option options [String] :placement_group
The name of the placement group into which to launch your instances,
if any. A placement group is a logical grouping of instances within a
single Availability Zone. You cannot specify multiple Availability
Zones and a placement group. For more information, see [Placement
Groups][1] in the *Amazon EC2 User Guide for Linux Instances*.
[1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html
@option options [String] :vpc_zone_identifier
A comma-separated list of subnet IDs for your virtual private cloud
(VPC).
If you specify `VPCZoneIdentifier` with `AvailabilityZones`, the
subnets that you specify for this parameter must reside in those
Availability Zones.
Conditional: If your account supports EC2-Classic and VPC, this
parameter is required to launch instances into a VPC.
@option options [Array<String>] :termination_policies
One or more termination policies used to select the instance to
terminate. These policies are executed in the order that they are
listed.
For more information, see [Controlling Which Instances Auto Scaling
Terminates During Scale In][1] in the *Amazon EC2 Auto Scaling User
Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html
@option options [Boolean] :new_instances_protected_from_scale_in
Indicates whether newly launched instances are protected from
termination by Amazon EC2 Auto Scaling when scaling in.
For more information about preventing instances from terminating on
scale in, see [Instance Protection][1] in the *Amazon EC2 Auto Scaling
User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection
@option options [Array<Types::LifecycleHookSpecification>] :lifecycle_hook_specification_list
One or more lifecycle hooks.
@option options [Array<Types::Tag>] :tags
One or more tags.
For more information, see [Tagging Auto Scaling Groups and
Instances][1] in the *Amazon EC2 Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-tagging.html
@option options [String] :service_linked_role_arn
The Amazon Resource Name (ARN) of the service-linked role that the
Auto Scaling group uses to call other AWS services on your behalf. By
default, Amazon EC2 Auto Scaling uses a service-linked role named
AWSServiceRoleForAutoScaling, which it creates if it does not exist.
For more information, see [Service-Linked Roles][1] in the *Amazon EC2
Auto Scaling User Guide*.
[1]: https://docs.aws.amazon.com/autoscaling/ec2/userguide/autoscaling-service-linked-role.html
@return [AutoScalingGroup] | [
"@!group",
"Actions",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/resource.rb#L278-L284 | train | Creates an Auto Scaling Group | [
30522,
13366,
3443,
1035,
2177,
1006,
7047,
1027,
1063,
1065,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3443,
1035,
8285,
1035,
25169,
1035,
2177,
1006,
7047,
1007,
8285,
15782,
2989,
17058,
1012,
2047,
1006,
2171,
1024,
7047,
1031,
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... |
opal/opal | opal/corelib/marshal/read_buffer.rb | Marshal.ReadBuffer.read_primitive_with_ivars | def read_primitive_with_ivars
object = read
primitive_ivars = read_hash(cache: false)
if primitive_ivars.any? && object.is_a?(String)
object = `new String(object)`
end
primitive_ivars.each do |name, value|
if name != 'E'
object.instance_variable_set(name, value)
end
end
object
end | ruby | def read_primitive_with_ivars
object = read
primitive_ivars = read_hash(cache: false)
if primitive_ivars.any? && object.is_a?(String)
object = `new String(object)`
end
primitive_ivars.each do |name, value|
if name != 'E'
object.instance_variable_set(name, value)
end
end
object
end | [
"def",
"read_primitive_with_ivars",
"object",
"=",
"read",
"primitive_ivars",
"=",
"read_hash",
"(",
"cache",
":",
"false",
")",
"if",
"primitive_ivars",
".",
"any?",
"&&",
"object",
".",
"is_a?",
"(",
"String",
")",
"object",
"=",
"`",
"`",
"end",
"primitiv... | Reads a primitive object with instance variables
(classes that have their own marshalling rules, like Array/Hash/Regexp/etc)
@example
arr = [100, 200, 300]
arr.instance_variable_set(:@ivar, :value)
arr
is encoded as
'I', [100, 200, 300], {:@ivar => value} | [
"Reads",
"a",
"primitive",
"object",
"with",
"instance",
"variables",
"(",
"classes",
"that",
"have",
"their",
"own",
"marshalling",
"rules",
"like",
"Array",
"/",
"Hash",
"/",
"Regexp",
"/",
"etc",
")"
] | 41aedc0fd62aab00d3c117ba0caf00206bedd981 | https://github.com/opal/opal/blob/41aedc0fd62aab00d3c117ba0caf00206bedd981/opal/corelib/marshal/read_buffer.rb#L454-L470 | train | Reads the object with the ivars and returns the object. | [
30522,
13366,
3191,
1035,
10968,
1035,
2007,
1035,
4921,
11650,
4874,
1027,
3191,
10968,
1035,
4921,
11650,
1027,
3191,
1035,
23325,
1006,
17053,
1024,
6270,
1007,
2065,
10968,
1035,
4921,
11650,
1012,
2151,
1029,
1004,
1004,
4874,
1012,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb | Azure::Locks::Mgmt::V2015_01_01.ManagementLocks.create_or_update_at_resource_group_level | def create_or_update_at_resource_group_level(resource_group_name, lock_name, parameters, custom_headers:nil)
response = create_or_update_at_resource_group_level_async(resource_group_name, lock_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update_at_resource_group_level(resource_group_name, lock_name, parameters, custom_headers:nil)
response = create_or_update_at_resource_group_level_async(resource_group_name, lock_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update_at_resource_group_level",
"(",
"resource_group_name",
",",
"lock_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_at_resource_group_level_async",
"(",
"resource_group_name",
",",
"lock_name",
",",
... | Create or update a management lock at the resource group level.
@param resource_group_name [String] The resource group name.
@param lock_name [String] The lock name.
@param parameters [ManagementLockObject] The management lock parameters.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ManagementLockObject] operation results. | [
"Create",
"or",
"update",
"a",
"management",
"lock",
"at",
"the",
"resource",
"group",
"level",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb#L35-L38 | train | Creates or updates a lock at resource group level. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2012,
1035,
7692,
1035,
2177,
1035,
2504,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
5843,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fluent/fluentd | lib/fluent/plugin/out_file.rb | Fluent::Plugin.FileOutput.generate_path_template | def generate_path_template(original, timekey, append, compress, path_suffix: '', time_slice_format: nil)
comp_suffix = compression_suffix(compress)
index_placeholder = append ? '' : '_**'
if original.index('*')
raise "BUG: configuration error must be raised for path including '*' without timekey" unless timekey
time_placeholders_part = time_slice_format || timekey_to_timeformat(timekey)
original.gsub('*', time_placeholders_part + index_placeholder) + comp_suffix
else
if timekey
if time_slice_format
"#{original}.#{time_slice_format}#{index_placeholder}#{path_suffix}#{comp_suffix}"
else
time_placeholders = timekey_to_timeformat(timekey)
if time_placeholders.scan(/../).any?{|ph| original.include?(ph) }
raise Fluent::ConfigError, "insufficient timestamp placeholders in path" if time_placeholders.scan(/../).any?{|ph| !original.include?(ph) }
"#{original}#{index_placeholder}#{path_suffix}#{comp_suffix}"
else
"#{original}.#{time_placeholders}#{index_placeholder}#{path_suffix}#{comp_suffix}"
end
end
else
"#{original}#{index_placeholder}#{path_suffix}#{comp_suffix}"
end
end
end | ruby | def generate_path_template(original, timekey, append, compress, path_suffix: '', time_slice_format: nil)
comp_suffix = compression_suffix(compress)
index_placeholder = append ? '' : '_**'
if original.index('*')
raise "BUG: configuration error must be raised for path including '*' without timekey" unless timekey
time_placeholders_part = time_slice_format || timekey_to_timeformat(timekey)
original.gsub('*', time_placeholders_part + index_placeholder) + comp_suffix
else
if timekey
if time_slice_format
"#{original}.#{time_slice_format}#{index_placeholder}#{path_suffix}#{comp_suffix}"
else
time_placeholders = timekey_to_timeformat(timekey)
if time_placeholders.scan(/../).any?{|ph| original.include?(ph) }
raise Fluent::ConfigError, "insufficient timestamp placeholders in path" if time_placeholders.scan(/../).any?{|ph| !original.include?(ph) }
"#{original}#{index_placeholder}#{path_suffix}#{comp_suffix}"
else
"#{original}.#{time_placeholders}#{index_placeholder}#{path_suffix}#{comp_suffix}"
end
end
else
"#{original}#{index_placeholder}#{path_suffix}#{comp_suffix}"
end
end
end | [
"def",
"generate_path_template",
"(",
"original",
",",
"timekey",
",",
"append",
",",
"compress",
",",
"path_suffix",
":",
"''",
",",
"time_slice_format",
":",
"nil",
")",
"comp_suffix",
"=",
"compression_suffix",
"(",
"compress",
")",
"index_placeholder",
"=",
... | /path/to/dir/file.* -> /path/to/dir/file.%Y%m%d
/path/to/dir/file.*.data -> /path/to/dir/file.%Y%m%d.data
/path/to/dir/file -> /path/to/dir/file.%Y%m%d.log
%Y%m%d -> %Y%m%d_** (non append)
+ .gz (gzipped)
TODO: remove time_slice_format when end of support of compat_parameters | [
"/",
"path",
"/",
"to",
"/",
"dir",
"/",
"file",
".",
"*",
"-",
">",
"/",
"path",
"/",
"to",
"/",
"dir",
"/",
"file",
".",
"%Y%m%d",
"/",
"path",
"/",
"to",
"/",
"dir",
"/",
"file",
".",
"*",
".",
"data",
"-",
">",
"/",
"path",
"/",
"to",... | add2af9a5b7f74fc36957b8e6138b3c5a2871a92 | https://github.com/fluent/fluentd/blob/add2af9a5b7f74fc36957b8e6138b3c5a2871a92/lib/fluent/plugin/out_file.rb#L281-L305 | train | Generate a path template based on the given original and timekey. | [
30522,
13366,
9699,
1035,
4130,
1035,
23561,
1006,
2434,
1010,
2051,
14839,
1010,
10439,
10497,
1010,
4012,
20110,
1010,
4130,
1035,
16809,
1024,
1005,
1005,
1010,
2051,
1035,
14704,
1035,
4289,
1024,
9152,
2140,
1007,
4012,
2361,
1035,
168... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
guard/guard | lib/guard/cli.rb | Guard.CLI.init | def init(*plugin_names)
env = Cli::Environments::Valid.new(options)
exitcode = env.initialize_guardfile(plugin_names)
exit(exitcode)
end | ruby | def init(*plugin_names)
env = Cli::Environments::Valid.new(options)
exitcode = env.initialize_guardfile(plugin_names)
exit(exitcode)
end | [
"def",
"init",
"(",
"*",
"plugin_names",
")",
"env",
"=",
"Cli",
"::",
"Environments",
"::",
"Valid",
".",
"new",
"(",
"options",
")",
"exitcode",
"=",
"env",
".",
"initialize_guardfile",
"(",
"plugin_names",
")",
"exit",
"(",
"exitcode",
")",
"end"
] | Initializes the templates of all installed Guard plugins and adds them
to the `Guardfile` when no Guard name is passed. When passing
Guard plugin names it does the same but only for those Guard plugins.
@see Guard::Guardfile.initialize_template
@see Guard::Guardfile.initialize_all_templates
@param [Array<String>] plugin_names the name of the Guard plugins to
initialize | [
"Initializes",
"the",
"templates",
"of",
"all",
"installed",
"Guard",
"plugins",
"and",
"adds",
"them",
"to",
"the",
"Guardfile",
"when",
"no",
"Guard",
"name",
"is",
"passed",
".",
"When",
"passing",
"Guard",
"plugin",
"names",
"it",
"does",
"the",
"same",
... | e2508cd83badf0d537dbaba35d307adc35d92e4f | https://github.com/guard/guard/blob/e2508cd83badf0d537dbaba35d307adc35d92e4f/lib/guard/cli.rb#L181-L185 | train | Initialize the Guardfile | [
30522,
13366,
1999,
4183,
1006,
1008,
13354,
2378,
1035,
3415,
1007,
4372,
2615,
1027,
18856,
2072,
1024,
1024,
10058,
1024,
1024,
9398,
1012,
2047,
1006,
7047,
1007,
6164,
16044,
1027,
4372,
2615,
1012,
3988,
4697,
1035,
3457,
8873,
2571,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
plaid/plaid-ruby | lib/plaid/products/asset_report.rb | Plaid.AssetReport.refresh | def refresh(asset_report_token, days_requested, options = {})
post_with_auth 'asset_report/refresh',
AssetReportRefreshResponse,
asset_report_token: asset_report_token,
days_requested: days_requested,
options: options
end | ruby | def refresh(asset_report_token, days_requested, options = {})
post_with_auth 'asset_report/refresh',
AssetReportRefreshResponse,
asset_report_token: asset_report_token,
days_requested: days_requested,
options: options
end | [
"def",
"refresh",
"(",
"asset_report_token",
",",
"days_requested",
",",
"options",
"=",
"{",
"}",
")",
"post_with_auth",
"'asset_report/refresh'",
",",
"AssetReportRefreshResponse",
",",
"asset_report_token",
":",
"asset_report_token",
",",
"days_requested",
":",
"days... | Public: Create a new, refreshed asset report.
asset_report_token - The asset report token for the asset report you want
to refresh.
days_requested - Days of transaction history requested to be included
in the Asset Report. Plaid will return as much data
as possible within the implied date range, up to a
maximum of 730 days (2 years) of history.
options - An optional object containing client-provided user
information, a client-provided report ID, and a
webhook. For more information, see the website
listed above.
Returns a AssetReportRefreshResponse object. | [
"Public",
":",
"Create",
"a",
"new",
"refreshed",
"asset",
"report",
"."
] | ce3da1c5559c739de88c5f59e54eef875f296673 | https://github.com/plaid/plaid-ruby/blob/ce3da1c5559c739de88c5f59e54eef875f296673/lib/plaid/products/asset_report.rb#L55-L61 | train | Refresh an asset report | [
30522,
13366,
25416,
21898,
1006,
11412,
1035,
3189,
1035,
19204,
1010,
2420,
1035,
7303,
1010,
7047,
1027,
1063,
1065,
1007,
2695,
1035,
2007,
1035,
8740,
2705,
1005,
11412,
1035,
3189,
1013,
25416,
21898,
1005,
1010,
11412,
2890,
6442,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
abonas/kubeclient | lib/kubeclient/common.rb | Kubeclient.ClientMixin.delete_entity | def delete_entity(resource_name, name, namespace = nil, delete_options: {})
delete_options_hash = delete_options.to_hash
ns_prefix = build_namespace_prefix(namespace)
payload = delete_options_hash.to_json unless delete_options_hash.empty?
response = handle_exception do
rs = rest_client[ns_prefix + resource_name + "/#{name}"]
RestClient::Request.execute(
rs.options.merge(
method: :delete,
url: rs.url,
headers: { 'Content-Type' => 'application/json' }.merge(@headers),
payload: payload
)
)
end
format_response(@as, response.body)
end | ruby | def delete_entity(resource_name, name, namespace = nil, delete_options: {})
delete_options_hash = delete_options.to_hash
ns_prefix = build_namespace_prefix(namespace)
payload = delete_options_hash.to_json unless delete_options_hash.empty?
response = handle_exception do
rs = rest_client[ns_prefix + resource_name + "/#{name}"]
RestClient::Request.execute(
rs.options.merge(
method: :delete,
url: rs.url,
headers: { 'Content-Type' => 'application/json' }.merge(@headers),
payload: payload
)
)
end
format_response(@as, response.body)
end | [
"def",
"delete_entity",
"(",
"resource_name",
",",
"name",
",",
"namespace",
"=",
"nil",
",",
"delete_options",
":",
"{",
"}",
")",
"delete_options_hash",
"=",
"delete_options",
".",
"to_hash",
"ns_prefix",
"=",
"build_namespace_prefix",
"(",
"namespace",
")",
"... | delete_options are passed as a JSON payload in the delete request | [
"delete_options",
"are",
"passed",
"as",
"a",
"JSON",
"payload",
"in",
"the",
"delete",
"request"
] | 3630f6c82532fba04f3e1a62d6b99c6cf2910451 | https://github.com/abonas/kubeclient/blob/3630f6c82532fba04f3e1a62d6b99c6cf2910451/lib/kubeclient/common.rb#L350-L366 | train | Delete an entity | [
30522,
13366,
3972,
12870,
1035,
9178,
1006,
7692,
1035,
2171,
1010,
2171,
1010,
3415,
15327,
1027,
9152,
2140,
1010,
3972,
12870,
1035,
7047,
1024,
1063,
1065,
1007,
3972,
12870,
1035,
7047,
1035,
23325,
1027,
3972,
12870,
1035,
7047,
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_container_registry/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb | Azure::ContainerRegistry::Mgmt::V2017_10_01.Registries.begin_update_policies_with_http_info | def begin_update_policies_with_http_info(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_policies_with_http_info(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:nil)
begin_update_policies_async(resource_group_name, registry_name, registry_policies_update_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_policies_with_http_info",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_policies_update_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_policies_async",
"(",
"resource_group_name",
",",
"registry_name",
",",
"registry_p... | Updates the policies for the specified container registry.
@param resource_group_name [String] The name of the resource group to which
the container registry belongs.
@param registry_name [String] The name of the container registry.
@param registry_policies_update_parameters [RegistryPolicies] The parameters
for updating policies of a container registry.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"the",
"policies",
"for",
"the",
"specified",
"container",
"registry",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_registry/lib/2017-10-01/generated/azure_mgmt_container_registry/registries.rb#L1513-L1515 | train | Updates the policies of the specified container registry. | [
30522,
13366,
4088,
1035,
10651,
1035,
6043,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
15584,
1035,
2171,
1010,
15584,
1035,
6043,
1035,
10651,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
214... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/api/v1_items_api.rb | SquareConnect.V1ItemsApi.update_category | def update_category(location_id, category_id, body, opts = {})
data, _status_code, _headers = update_category_with_http_info(location_id, category_id, body, opts)
return data
end | ruby | def update_category(location_id, category_id, body, opts = {})
data, _status_code, _headers = update_category_with_http_info(location_id, category_id, body, opts)
return data
end | [
"def",
"update_category",
"(",
"location_id",
",",
"category_id",
",",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"update_category_with_http_info",
"(",
"location_id",
",",
"category_id",
",",
"body",
",",
"opts... | UpdateCategory
Modifies the details of an existing item category.
@param location_id The ID of the category's associated location.
@param category_id The ID of the category to edit.
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [V1Category] | [
"UpdateCategory",
"Modifies",
"the",
"details",
"of",
"an",
"existing",
"item",
"category",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L1879-L1882 | train | Update a category | [
30522,
13366,
10651,
1035,
4696,
1006,
3295,
1035,
8909,
1010,
4696,
1035,
8909,
1010,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
10651,
1035,
4696,
1035,
2007,
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... |
piotrmurach/github | lib/github_api/client/projects/cards.rb | Github.Client::Projects::Cards.list | def list(*args)
arguments(args, required: [:column_id])
params = arguments.params
params["accept"] ||= ::Github::Client::Projects::PREVIEW_MEDIA
response = get_request("/projects/columns/#{arguments.column_id}/cards", params)
return response unless block_given?
response.each { |el| yield el }
end | ruby | def list(*args)
arguments(args, required: [:column_id])
params = arguments.params
params["accept"] ||= ::Github::Client::Projects::PREVIEW_MEDIA
response = get_request("/projects/columns/#{arguments.column_id}/cards", params)
return response unless block_given?
response.each { |el| yield el }
end | [
"def",
"list",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":column_id",
"]",
")",
"params",
"=",
"arguments",
".",
"params",
"params",
"[",
"\"accept\"",
"]",
"||=",
"::",
"Github",
"::",
"Client",
"::",
"Projects",
"::... | List project cards for a column
@example
github = Github.new
github.projects.cards.list :column_id
@see https://developer.github.com/v3/projects/cards/#list-project-cards
@api public | [
"List",
"project",
"cards",
"for",
"a",
"column"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/projects/cards.rb#L19-L29 | train | List the cards of a column | [
30522,
13366,
2862,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5930,
1035,
8909,
1033,
1007,
11498,
5244,
1027,
9918,
1012,
11498,
5244,
11498,
5244,
1031,
1000,
5138,
1000,
1033,
1064,
1064,
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 | 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_backup_policy_list | def get_backup_policy_list(continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
response = get_backup_policy_list_async(continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_backup_policy_list(continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
response = get_backup_policy_list_async(continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_backup_policy_list",
"(",
"continuation_token",
":",
"nil",
",",
"max_results",
":",
"0",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_backup_policy_list_async",
"(",
"continuation_token",
":continuation_token",
... | Gets all the backup policies configured.
Get a list of all the backup policies configured.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PagedBackupPolicyDescriptionList] operation results. | [
"Gets",
"all",
"the",
"backup",
"policies",
"configured",
"."
] | 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#L22444-L22447 | train | Gets backup policy list. | [
30522,
13366,
2131,
1035,
10200,
1035,
3343,
1035,
2862,
1006,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
4098,
1035,
3463,
1024,
1014,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb | Azure::EventGrid::Mgmt::V2018_01_01.EventSubscriptions.begin_create_or_update | def begin_create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
response = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_create_or_update(scope, event_subscription_name, event_subscription_info, custom_headers:nil)
response = begin_create_or_update_async(scope, event_subscription_name, event_subscription_info, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_create_or_update",
"(",
"scope",
",",
"event_subscription_name",
",",
"event_subscription_info",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_create_or_update_async",
"(",
"scope",
",",
"event_subscription_name",
",",
"event_subscription_inf... | Create or update an event subscription
Asynchronously creates a new event subscription or updates an existing event
subscription based on the specified scope.
@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}/' for a subscription,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
resource group, and
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
for a resource, and
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
for an EventGrid topic.
@param event_subscription_name [String] Name of the event subscription. Event
subscription names must be between 3 and 64 characters in length and should
use alphanumeric letters only.
@param event_subscription_info [EventSubscription] Event subscription
properties containing the destination and filter information
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EventSubscription] operation results. | [
"Create",
"or",
"update",
"an",
"event",
"subscription"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb#L1428-L1431 | train | Creates or updates an event subscription. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1006,
9531,
1010,
2724,
1035,
15002,
1035,
2171,
1010,
2724,
1035,
15002,
1035,
18558,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3443,
1035,
2030,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/pops/loaders.rb | Puppet::Pops.Loaders.[] | def [](loader_name)
loader = @loaders_by_name[loader_name]
if loader.nil?
# Unable to find the module private loader. Try resolving the module
loader = private_loader_for_module(loader_name[0..-9]) if loader_name.end_with?(' private')
raise Puppet::ParseError, _("Unable to find loader named '%{loader_name}'") % { loader_name: loader_name } if loader.nil?
end
loader
end | ruby | def [](loader_name)
loader = @loaders_by_name[loader_name]
if loader.nil?
# Unable to find the module private loader. Try resolving the module
loader = private_loader_for_module(loader_name[0..-9]) if loader_name.end_with?(' private')
raise Puppet::ParseError, _("Unable to find loader named '%{loader_name}'") % { loader_name: loader_name } if loader.nil?
end
loader
end | [
"def",
"[]",
"(",
"loader_name",
")",
"loader",
"=",
"@loaders_by_name",
"[",
"loader_name",
"]",
"if",
"loader",
".",
"nil?",
"# Unable to find the module private loader. Try resolving the module",
"loader",
"=",
"private_loader_for_module",
"(",
"loader_name",
"[",
"0",... | Lookup a loader by its unique name.
@param [String] loader_name the name of the loader to lookup
@return [Loader] the found loader
@raise [Puppet::ParserError] if no loader is found | [
"Lookup",
"a",
"loader",
"by",
"its",
"unique",
"name",
"."
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/pops/loaders.rb#L183-L191 | train | Returns the object containing the specified loader. | [
30522,
13366,
1031,
1033,
1006,
7170,
2121,
1035,
2171,
1007,
7170,
2121,
1027,
1030,
7170,
2545,
1035,
2011,
1035,
2171,
1031,
7170,
2121,
1035,
2171,
1033,
2065,
7170,
2121,
1012,
9152,
2140,
1029,
1001,
4039,
2000,
2424,
1996,
11336,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_msi/lib/2015-08-31-preview/generated/azure_mgmt_msi/user_assigned_identities.rb | Azure::ManagedServiceIdentity::Mgmt::V2015_08_31_preview.UserAssignedIdentities.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, resource_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, resource_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"resource_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"parameters",
",",
"custom_headers",
":c... | Create or update an identity in the specified subscription and resource
group.
@param resource_group_name [String] The name of the Resource Group to which
the identity belongs.
@param resource_name [String] The name of the identity resource.
@param parameters [Identity] Parameters to create or update the identity
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Create",
"or",
"update",
"an",
"identity",
"in",
"the",
"specified",
"subscription",
"and",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_msi/lib/2015-08-31-preview/generated/azure_mgmt_msi/user_assigned_identities.rb#L236-L238 | train | Creates or updates a specific resource. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3443,
1035,
2030,
1035,
10651,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.delete_data_lake_store_account | def delete_data_lake_store_account(resource_group_name, account_name, data_lake_store_account_name, custom_headers:nil)
response = delete_data_lake_store_account_async(resource_group_name, account_name, data_lake_store_account_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete_data_lake_store_account(resource_group_name, account_name, data_lake_store_account_name, custom_headers:nil)
response = delete_data_lake_store_account_async(resource_group_name, account_name, data_lake_store_account_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete_data_lake_store_account",
"(",
"resource_group_name",
",",
"account_name",
",",
"data_lake_store_account_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_data_lake_store_account_async",
"(",
"resource_group_name",
",",
"account_name",
","... | Updates the Data Lake Analytics account specified to remove the specified
Data Lake Store account.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Analytics account.
@param account_name [String] The name of the Data Lake Analytics account from
which to remove the Data Lake Store account.
@param data_lake_store_account_name [String] The name of the Data Lake Store
account to remove
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Updates",
"the",
"Data",
"Lake",
"Analytics",
"account",
"specified",
"to",
"remove",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L911-L914 | train | Deletes the specified Data Lake Store account. | [
30522,
13366,
3972,
12870,
1035,
2951,
1035,
2697,
1035,
3573,
1035,
4070,
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,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/puppet | lib/puppet/functions.rb | Puppet::Functions.LocalTypeAliasesBuilder.type | def type(assignment_string)
# Get location to use in case of error - this produces ruby filename and where call to 'type' occurred
# but strips off the rest of the internal "where" as it is not meaningful to user.
#
rb_location = caller[0]
begin
result = parser.parse_string("type #{assignment_string}", nil)
rescue StandardError => e
rb_location = rb_location.gsub(/:in.*$/, '')
# Create a meaningful location for parse errors - show both what went wrong with the parsing
# and in which ruby file it was found.
raise ArgumentError, _("Parsing of 'type \"%{assignment_string}\"' failed with message: <%{message}>.\n" +
"Called from <%{ruby_file_location}>") % {
assignment_string: assignment_string,
message: e.message,
ruby_file_location: rb_location
}
end
unless result.body.kind_of?(Puppet::Pops::Model::TypeAlias)
rb_location = rb_location.gsub(/:in.*$/, '')
raise ArgumentError, _("Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'.\n"+
"Called from <%{ruby_file_location}>") % {
assignment_string: assignment_string,
ruby_file_location: rb_location
}
end
@local_types << result.body
end | ruby | def type(assignment_string)
# Get location to use in case of error - this produces ruby filename and where call to 'type' occurred
# but strips off the rest of the internal "where" as it is not meaningful to user.
#
rb_location = caller[0]
begin
result = parser.parse_string("type #{assignment_string}", nil)
rescue StandardError => e
rb_location = rb_location.gsub(/:in.*$/, '')
# Create a meaningful location for parse errors - show both what went wrong with the parsing
# and in which ruby file it was found.
raise ArgumentError, _("Parsing of 'type \"%{assignment_string}\"' failed with message: <%{message}>.\n" +
"Called from <%{ruby_file_location}>") % {
assignment_string: assignment_string,
message: e.message,
ruby_file_location: rb_location
}
end
unless result.body.kind_of?(Puppet::Pops::Model::TypeAlias)
rb_location = rb_location.gsub(/:in.*$/, '')
raise ArgumentError, _("Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'.\n"+
"Called from <%{ruby_file_location}>") % {
assignment_string: assignment_string,
ruby_file_location: rb_location
}
end
@local_types << result.body
end | [
"def",
"type",
"(",
"assignment_string",
")",
"# Get location to use in case of error - this produces ruby filename and where call to 'type' occurred",
"# but strips off the rest of the internal \"where\" as it is not meaningful to user.",
"#",
"rb_location",
"=",
"caller",
"[",
"0",
"]",
... | Defines a local type alias, the given string should be a Puppet Language type alias expression
in string form without the leading 'type' keyword.
Calls to local_type must be made before the first parameter definition or an error will
be raised.
@param assignment_string [String] a string on the form 'AliasType = ExistingType'
@api public | [
"Defines",
"a",
"local",
"type",
"alias",
"the",
"given",
"string",
"should",
"be",
"a",
"Puppet",
"Language",
"type",
"alias",
"expression",
"in",
"string",
"form",
"without",
"the",
"leading",
"type",
"keyword",
".",
"Calls",
"to",
"local_type",
"must",
"b... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/functions.rb#L623-L651 | train | Returns the location of the type assignment | [
30522,
13366,
2828,
1006,
8775,
1035,
5164,
1007,
1001,
2131,
3295,
2000,
2224,
1999,
2553,
1997,
7561,
1011,
2023,
7137,
10090,
5371,
18442,
1998,
2073,
2655,
2000,
1005,
2828,
1005,
4158,
1001,
2021,
12970,
2125,
1996,
2717,
1997,
1996,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.