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!
un... | 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!
un... | [
"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 [Integ... | [
"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
... | 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
... | [
"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)
... | 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)
... | [
"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 con... | [
"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 rese... | [
"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_... | 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_... | [
"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-lev... | [
"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] "\
... | 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] "\
... | [
"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] = ... | 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] = ... | [
"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_nam... | [
"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
... | 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
... | [
"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: "mus... | [
"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 ide... | [
"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... | [
"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) ... | 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) ... | [
"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. v... | [
"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... | [
"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 sec... | 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 sec... | [
"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_respons... | 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_respons... | [
"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... | 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... | [
"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 [Expr... | [
"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 ({})
@opt... | [
"@!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 t... | [
"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 c... | [
"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 = ty... | 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 = ty... | [
"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 [ St... | [
"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
... | 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
... | [
"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.
... | [
"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_i... | 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_i... | [
"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.mi... | [
"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_h... | 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_h... | [
"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 add... | [
"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 datab... | [
"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 [Ms... | [
"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_... | 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_... | [
"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 ... | [
"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 ... | [
"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... | 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... | [
"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 [... | [
"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... | 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... | [
"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[:use... | 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[:use... | [
"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 val... | [
"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}... | [
"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 => Stri... | [
"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 = para... | 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 = para... | [
"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 ==... | 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 ==... | [
"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 be... | [
"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 =... | [
"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] Poo... | [
"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 [VirtualMachineSc... | [
"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
... | [
"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... | [
"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 con... | [
"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/p... | [
"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 res... | [
"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 secre... | [
"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
... | 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
... | [
"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 accoun... | [
"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... | [
"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|
subscrib... | 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|
subscrib... | [
"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_o... | [
"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}'"
... | 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}'"
... | [
"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... | [
"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(mo... | [
"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_REQUIRE... | 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_REQUIRE... | [
"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... | 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... | [
"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... | [
"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: "Parame... | [
"@!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 t... | [
"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|
... | 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|
... | [
"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 cust... | [
"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 accoun... | [
"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
st... | 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
st... | [
"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"
"ac... | [
"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: c... | 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: c... | [
"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.... | [
"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_mention... | 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_mention... | [
"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_templa... | [
"@!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... | 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... | [
"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... | [
"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 timek... | 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 timek... | [
"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>... | [
"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
... | [
"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[n... | 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[n... | [
"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 ... | [
"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.
... | [
"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... | 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... | [
"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 ... | [
"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... | [
"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 '%... | 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 '%... | [
"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... | [
"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 t... | [
"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 ... | 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 ... | [
"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 = Ex... | [
"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.