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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
randym/axlsx | lib/axlsx/drawing/scaling.rb | Axlsx.Scaling.to_xml_string | def to_xml_string(str = '')
str << '<c:scaling>'
str << ('<c:logBase val="' << @logBase.to_s << '"/>') unless @logBase.nil?
str << ('<c:orientation val="' << @orientation.to_s << '"/>') unless @orientation.nil?
str << ('<c:min val="' << @min.to_s << '"/>') unless @min.nil?
str << ('<c:max val="' << @max.to_s << '"/>') unless @max.nil?
str << '</c:scaling>'
end | ruby | def to_xml_string(str = '')
str << '<c:scaling>'
str << ('<c:logBase val="' << @logBase.to_s << '"/>') unless @logBase.nil?
str << ('<c:orientation val="' << @orientation.to_s << '"/>') unless @orientation.nil?
str << ('<c:min val="' << @min.to_s << '"/>') unless @min.nil?
str << ('<c:max val="' << @max.to_s << '"/>') unless @max.nil?
str << '</c:scaling>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"str",
"<<",
"'<c:scaling>'",
"str",
"<<",
"(",
"'<c:logBase val=\"'",
"<<",
"@logBase",
".",
"to_s",
"<<",
"'\"/>'",
")",
"unless",
"@logBase",
".",
"nil?",
"str",
"<<",
"(",
"'<c:orientation val=\"'",
"<<... | Serializes the object
@param [String] str
@return [String] | [
"Serializes",
"the",
"object"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/scaling.rb#L50-L57 | 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,
1039,
1024,
25169,
1028,
1005,
2358,
2099,
1026,
1026,
1006,
1005,
1026,
1039,
1024,
8833,
15058,
11748,
1027,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
resque/resque | lib/resque/worker.rb | Resque.Worker.shutdown! | def shutdown!
shutdown
if term_child
if fork_per_job?
new_kill_child
else
# Raise TermException in the same process
trap('TERM') do
# ignore subsequent terms
end
raise TermException.new("SIGTERM")
end
else
kill_child
end
end | ruby | def shutdown!
shutdown
if term_child
if fork_per_job?
new_kill_child
else
# Raise TermException in the same process
trap('TERM') do
# ignore subsequent terms
end
raise TermException.new("SIGTERM")
end
else
kill_child
end
end | [
"def",
"shutdown!",
"shutdown",
"if",
"term_child",
"if",
"fork_per_job?",
"new_kill_child",
"else",
"# Raise TermException in the same process",
"trap",
"(",
"'TERM'",
")",
"do",
"# ignore subsequent terms",
"end",
"raise",
"TermException",
".",
"new",
"(",
"\"SIGTERM\""... | Kill the child and shutdown immediately.
If not forking, abort this process. | [
"Kill",
"the",
"child",
"and",
"shutdown",
"immediately",
".",
"If",
"not",
"forking",
"abort",
"this",
"process",
"."
] | adb633a0f6b98b1eb5a5a85bb36ebac9309978fd | https://github.com/resque/resque/blob/adb633a0f6b98b1eb5a5a85bb36ebac9309978fd/lib/resque/worker.rb#L434-L449 | train | Shuts down the process | [
30522,
13366,
3844,
7698,
999,
3844,
7698,
2065,
2744,
1035,
2775,
2065,
9292,
1035,
2566,
1035,
3105,
1029,
2047,
1035,
3102,
1035,
2775,
2842,
1001,
5333,
2744,
10288,
24422,
1999,
1996,
2168,
2832,
8132,
1006,
1005,
2744,
1005,
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... |
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 | def list_virtual_machine_scale_set_public_ipaddresses(resource_group_name, virtual_machine_scale_set_name, custom_headers:nil)
first_page = list_virtual_machine_scale_set_public_ipaddresses_as_lazy(resource_group_name, virtual_machine_scale_set_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_virtual_machine_scale_set_public_ipaddresses(resource_group_name, virtual_machine_scale_set_name, custom_headers:nil)
first_page = list_virtual_machine_scale_set_public_ipaddresses_as_lazy(resource_group_name, virtual_machine_scale_set_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_virtual_machine_scale_set_public_ipaddresses",
"(",
"resource_group_name",
",",
"virtual_machine_scale_set_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_virtual_machine_scale_set_public_ipaddresses_as_lazy",
"(",
"resource_group_name",
",",
"v... | Gets information about all public IP addresses on a virtual machine scale set
level.
@param resource_group_name [String] The name of the resource group.
@param virtual_machine_scale_set_name [String] The name of the virtual
machine scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<PublicIPAddress>] operation results. | [
"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#L39-L42 | train | Gets all public IP addresses of a virtual machine. | [
30522,
13366,
2862,
1035,
7484,
1035,
3698,
1035,
4094,
1035,
2275,
1035,
2270,
1035,
25249,
16200,
11393,
2015,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
3698,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.apply_fee | def apply_fee(location_id, item_id, fee_id, opts = {})
data, _status_code, _headers = apply_fee_with_http_info(location_id, item_id, fee_id, opts)
return data
end | ruby | def apply_fee(location_id, item_id, fee_id, opts = {})
data, _status_code, _headers = apply_fee_with_http_info(location_id, item_id, fee_id, opts)
return data
end | [
"def",
"apply_fee",
"(",
"location_id",
",",
"item_id",
",",
"fee_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"apply_fee_with_http_info",
"(",
"location_id",
",",
"item_id",
",",
"fee_id",
",",
"opts",
")",
"ret... | ApplyFee
Associates a fee with an item, meaning the fee is automatically applied to the item in Square Register.
@param location_id The ID of the fee's associated location.
@param item_id The ID of the item to add the fee to.
@param fee_id The ID of the fee to apply.
@param [Hash] opts the optional parameters
@return [V1Item] | [
"ApplyFee",
"Associates",
"a",
"fee",
"with",
"an",
"item",
"meaning",
"the",
"fee",
"is",
"automatically",
"applied",
"to",
"the",
"item",
"in",
"Square",
"Register",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L90-L93 | train | Apply a fee to an item | [
30522,
13366,
6611,
1035,
7408,
1006,
3295,
1035,
8909,
1010,
8875,
1035,
8909,
1010,
7408,
1035,
8909,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
6611,
1035,
7408,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb | Aws::EC2.Vpc.create_subnet | def create_subnet(options = {})
options = options.merge(vpc_id: @id)
resp = @client.create_subnet(options)
Subnet.new(
id: resp.data.subnet.subnet_id,
data: resp.data.subnet,
client: @client
)
end | ruby | def create_subnet(options = {})
options = options.merge(vpc_id: @id)
resp = @client.create_subnet(options)
Subnet.new(
id: resp.data.subnet.subnet_id,
data: resp.data.subnet,
client: @client
)
end | [
"def",
"create_subnet",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"vpc_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"create_subnet",
"(",
"options",
")",
"Subnet",
".",
"new",
"(",
"id",
":",
"resp",
".",... | @example Request syntax with placeholder values
subnet = vpc.create_subnet({
availability_zone: "String",
availability_zone_id: "String",
cidr_block: "String", # required
ipv_6_cidr_block: "String",
dry_run: false,
})
@param [Hash] options ({})
@option options [String] :availability_zone
The Availability Zone for the subnet.
Default: AWS selects one for you. If you create more than one subnet
in your VPC, we may not necessarily select a different zone for each
subnet.
@option options [String] :availability_zone_id
The AZ ID of the subnet.
@option options [required, String] :cidr_block
The IPv4 network range for the subnet, in CIDR notation. For example,
`10.0.0.0/24`.
@option options [String] :ipv_6_cidr_block
The IPv6 network range for the subnet, in CIDR notation. The subnet
size must use a /64 prefix length.
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@return [Subnet] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/vpc.rb#L453-L461 | train | Create a subnet | [
30522,
13366,
3443,
1035,
4942,
7159,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
21210,
2278,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3443,
1035,
4942,
7159,
1006,
7047,
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... |
alexreisner/geocoder | lib/geocoder/lookups/mapquest.rb | Geocoder::Lookup.Mapquest.results | def results(query)
return [] unless doc = fetch_data(query)
return doc["results"][0]['locations'] if doc['info']['statuscode'] == 0 # A successful geocode call
messages = doc['info']['messages'].join
case doc['info']['statuscode']
when 400 # Error with input
raise_error(Geocoder::InvalidRequest, messages) ||
Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
when 403 # Key related error
raise_error(Geocoder::InvalidApiKey, messages) ||
Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
when 500 # Unknown error
raise_error(Geocoder::Error, messages) ||
Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
end
[]
end | ruby | def results(query)
return [] unless doc = fetch_data(query)
return doc["results"][0]['locations'] if doc['info']['statuscode'] == 0 # A successful geocode call
messages = doc['info']['messages'].join
case doc['info']['statuscode']
when 400 # Error with input
raise_error(Geocoder::InvalidRequest, messages) ||
Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
when 403 # Key related error
raise_error(Geocoder::InvalidApiKey, messages) ||
Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
when 500 # Unknown error
raise_error(Geocoder::Error, messages) ||
Geocoder.log(:warn, "Mapquest Geocoding API error: #{messages}")
end
[]
end | [
"def",
"results",
"(",
"query",
")",
"return",
"[",
"]",
"unless",
"doc",
"=",
"fetch_data",
"(",
"query",
")",
"return",
"doc",
"[",
"\"results\"",
"]",
"[",
"0",
"]",
"[",
"'locations'",
"]",
"if",
"doc",
"[",
"'info'",
"]",
"[",
"'statuscode'",
"]... | http://www.mapquestapi.com/geocoding/status_codes.html
http://open.mapquestapi.com/geocoding/status_codes.html | [
"http",
":",
"//",
"www",
".",
"mapquestapi",
".",
"com",
"/",
"geocoding",
"/",
"status_codes",
".",
"html",
"http",
":",
"//",
"open",
".",
"mapquestapi",
".",
"com",
"/",
"geocoding",
"/",
"status_codes",
".",
"html"
] | e087dc2759264ee6f307b926bb2de4ec2406859e | https://github.com/alexreisner/geocoder/blob/e087dc2759264ee6f307b926bb2de4ec2406859e/lib/geocoder/lookups/mapquest.rb#L37-L55 | train | Returns an array of locations for the results of a query | [
30522,
13366,
3463,
1006,
23032,
1007,
2709,
1031,
1033,
4983,
9986,
1027,
18584,
1035,
2951,
1006,
23032,
1007,
2709,
9986,
1031,
1000,
3463,
1000,
1033,
1031,
1014,
1033,
1031,
1005,
5269,
1005,
1033,
2065,
9986,
1031,
1005,
18558,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
brunofacca/active-record-query-trace | lib/active_record_query_trace.rb | ActiveRecordQueryTrace.CustomLogSubscriber.setup_backtrace_cleaner_path | def setup_backtrace_cleaner_path
return unless Rails.backtrace_cleaner.instance_variable_get(:@root) == '/'
Rails.backtrace_cleaner.instance_variable_set :@root, Rails.root.to_s
end | ruby | def setup_backtrace_cleaner_path
return unless Rails.backtrace_cleaner.instance_variable_get(:@root) == '/'
Rails.backtrace_cleaner.instance_variable_set :@root, Rails.root.to_s
end | [
"def",
"setup_backtrace_cleaner_path",
"return",
"unless",
"Rails",
".",
"backtrace_cleaner",
".",
"instance_variable_get",
"(",
":@root",
")",
"==",
"'/'",
"Rails",
".",
"backtrace_cleaner",
".",
"instance_variable_set",
":@root",
",",
"Rails",
".",
"root",
".",
"t... | Rails relies on backtrace cleaner to set the application root directory
filter. The problem is that the backtrace cleaner is initialized before
this gem. This ensures that the value of `root` used by the filter
is correct. | [
"Rails",
"relies",
"on",
"backtrace",
"cleaner",
"to",
"set",
"the",
"application",
"root",
"directory",
"filter",
".",
"The",
"problem",
"is",
"that",
"the",
"backtrace",
"cleaner",
"is",
"initialized",
"before",
"this",
"gem",
".",
"This",
"ensures",
"that",... | 9584d5d49cfc2170271f75bbf2773b46145e1be4 | https://github.com/brunofacca/active-record-query-trace/blob/9584d5d49cfc2170271f75bbf2773b46145e1be4/lib/active_record_query_trace.rb#L152-L155 | train | Setup the backtrace cleaner for the current path | [
30522,
13366,
16437,
1035,
2067,
6494,
3401,
1035,
20133,
1035,
4130,
2709,
4983,
15168,
1012,
2067,
6494,
3401,
1035,
20133,
1012,
6013,
1035,
8023,
1035,
2131,
1006,
1024,
1030,
7117,
1007,
1027,
1027,
1005,
1013,
1005,
15168,
1012,
2067,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_agents.rb | Azure::SQL::Mgmt::V2015_05_01_preview.SyncAgents.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, server_name, sync_agent_name, custom_headers:nil)
begin_delete_async(resource_group_name, server_name, sync_agent_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, server_name, sync_agent_name, custom_headers:nil)
begin_delete_async(resource_group_name, server_name, sync_agent_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"sync_agent_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"sync_agent_name",
",",
"custom_headers",
":cus... | Deletes a sync agent.
@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 on which the sync agent is
hosted.
@param sync_agent_name [String] The name of the sync agent.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"a",
"sync",
"agent",
"."
] | 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_agents.rb#L699-L701 | train | Deletes a sync agent. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
26351,
1035,
4005,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github-changelog-generator/github-changelog-generator | lib/github_changelog_generator/reader.rb | GitHubChangelogGenerator.Reader.parse | def parse(data)
sections = data.split(/^## .+?$/)
headings = data.scan(/^## .+?$/)
headings.each_with_index.map do |heading, index|
section = parse_heading(heading)
section["content"] = sections.at(index + 1)
section
end
end | ruby | def parse(data)
sections = data.split(/^## .+?$/)
headings = data.scan(/^## .+?$/)
headings.each_with_index.map do |heading, index|
section = parse_heading(heading)
section["content"] = sections.at(index + 1)
section
end
end | [
"def",
"parse",
"(",
"data",
")",
"sections",
"=",
"data",
".",
"split",
"(",
"/",
"/",
")",
"headings",
"=",
"data",
".",
"scan",
"(",
"/",
"/",
")",
"headings",
".",
"each_with_index",
".",
"map",
"do",
"|",
"heading",
",",
"index",
"|",
"section... | Parse the given ChangeLog data into a list of Hashes
@param [String] data File data from the ChangeLog.md
@return [Array<Hash>] Parsed data, e.g. [{ 'version' => ..., 'url' => ..., 'date' => ..., 'content' => ...}, ...] | [
"Parse",
"the",
"given",
"ChangeLog",
"data",
"into",
"a",
"list",
"of",
"Hashes"
] | f18c64b5cc0d7473b059275b88385ac11ca8b564 | https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/reader.rb#L71-L80 | train | Parse the given data | [
30522,
13366,
11968,
3366,
1006,
2951,
1007,
5433,
1027,
2951,
1012,
3975,
1006,
1013,
1034,
1001,
1001,
1012,
1009,
1029,
1002,
1013,
1007,
5825,
2015,
1027,
2951,
1012,
13594,
1006,
1013,
1034,
1001,
1001,
1012,
1009,
1029,
1002,
1013,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_states.rb | Azure::PolicyInsights::Mgmt::V2018_04_04.PolicyStates.summarize_for_policy_definition | def summarize_for_policy_definition(subscription_id, policy_definition_name, query_options:nil, custom_headers:nil)
response = summarize_for_policy_definition_async(subscription_id, policy_definition_name, query_options:query_options, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def summarize_for_policy_definition(subscription_id, policy_definition_name, query_options:nil, custom_headers:nil)
response = summarize_for_policy_definition_async(subscription_id, policy_definition_name, query_options:query_options, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"summarize_for_policy_definition",
"(",
"subscription_id",
",",
"policy_definition_name",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"summarize_for_policy_definition_async",
"(",
"subscription_id",
",",
"policy_definiti... | Summarizes policy states for the subscription level policy definition.
@param subscription_id [String] Microsoft Azure subscription ID.
@param policy_definition_name [String] Policy definition name.
@param query_options [QueryOptions] Additional parameters for the operation
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SummarizeResults] operation results. | [
"Summarizes",
"policy",
"states",
"for",
"the",
"subscription",
"level",
"policy",
"definition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_states.rb#L1383-L1386 | train | Summarizes policy specification for the subscription. | [
30522,
13366,
7680,
7849,
4697,
1035,
2005,
1035,
3343,
1035,
6210,
1006,
15002,
1035,
8909,
1010,
3343,
1035,
6210,
1035,
2171,
1010,
23032,
1035,
7047,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sensu/sensu | lib/sensu/utilities.rb | Sensu.Utilities.process_cpu_times | def process_cpu_times(&callback)
determine_cpu_times = Proc.new do
::Process.times.to_a rescue [nil, nil, nil, nil]
end
EM::defer(determine_cpu_times, callback)
end | ruby | def process_cpu_times(&callback)
determine_cpu_times = Proc.new do
::Process.times.to_a rescue [nil, nil, nil, nil]
end
EM::defer(determine_cpu_times, callback)
end | [
"def",
"process_cpu_times",
"(",
"&",
"callback",
")",
"determine_cpu_times",
"=",
"Proc",
".",
"new",
"do",
"::",
"Process",
".",
"times",
".",
"to_a",
"rescue",
"[",
"nil",
",",
"nil",
",",
"nil",
",",
"nil",
"]",
"end",
"EM",
"::",
"defer",
"(",
"... | Retrieve the process CPU times. If the cpu times cannot be
determined and an error is thrown, `[nil, nil, nil, nil]` will
be returned.
@return [Array] CPU times: utime, stime, cutime, cstime | [
"Retrieve",
"the",
"process",
"CPU",
"times",
".",
"If",
"the",
"cpu",
"times",
"cannot",
"be",
"determined",
"and",
"an",
"error",
"is",
"thrown",
"[",
"nil",
"nil",
"nil",
"nil",
"]",
"will",
"be",
"returned",
"."
] | 51319e4b58c8d9986f101ad71ff729aa3e51e951 | https://github.com/sensu/sensu/blob/51319e4b58c8d9986f101ad71ff729aa3e51e951/lib/sensu/utilities.rb#L103-L108 | train | Returns the cpu times of the process. | [
30522,
13366,
2832,
1035,
17368,
1035,
2335,
1006,
1004,
2655,
5963,
1007,
5646,
1035,
17368,
1035,
2335,
1027,
4013,
2278,
1012,
2047,
2079,
1024,
1024,
2832,
1012,
2335,
1012,
2000,
1035,
1037,
5343,
1031,
9152,
2140,
1010,
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_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.list_site_detectors_slot_next | def list_site_detectors_slot_next(next_page_link, custom_headers:nil)
response = list_site_detectors_slot_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_site_detectors_slot_next(next_page_link, custom_headers:nil)
response = list_site_detectors_slot_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_site_detectors_slot_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_site_detectors_slot_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"... | Get Detectors
Get Detectors
@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 [DiagnosticDetectorCollection] operation results. | [
"Get",
"Detectors"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L3380-L3383 | train | Gets the site detectors for a site. | [
30522,
13366,
2862,
1035,
2609,
1035,
25971,
1035,
10453,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2609,
1035,
25971,
1035,
10453,
1035,
2279,
1035,
2004,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kpumuk/meta-tags | lib/meta_tags/renderer.rb | MetaTags.Renderer.process_tree | def process_tree(tags, property, content, **opts)
method = case content
when Hash
:process_hash
when Array
:process_array
else
:render_tag
end
__send__(method, tags, property, content, **opts)
end | ruby | def process_tree(tags, property, content, **opts)
method = case content
when Hash
:process_hash
when Array
:process_array
else
:render_tag
end
__send__(method, tags, property, content, **opts)
end | [
"def",
"process_tree",
"(",
"tags",
",",
"property",
",",
"content",
",",
"**",
"opts",
")",
"method",
"=",
"case",
"content",
"when",
"Hash",
":process_hash",
"when",
"Array",
":process_array",
"else",
":render_tag",
"end",
"__send__",
"(",
"method",
",",
"... | Recursive method to process all the hashes and arrays on meta tags
@param [Array<Tag>] tags a buffer object to store tag in.
@param [String, Symbol] property a Hash or a String to render as meta tag.
@param [Hash, Array, String, Symbol] content text content or a symbol reference to
top-level meta tag. | [
"Recursive",
"method",
"to",
"process",
"all",
"the",
"hashes",
"and",
"arrays",
"on",
"meta",
"tags"
] | 03585f95edf96cd17024c5c155ce46ec8bc47232 | https://github.com/kpumuk/meta-tags/blob/03585f95edf96cd17024c5c155ce46ec8bc47232/lib/meta_tags/renderer.rb#L204-L214 | train | Process the tree | [
30522,
13366,
2832,
1035,
3392,
1006,
22073,
1010,
3200,
1010,
4180,
1010,
1008,
1008,
23569,
2015,
1007,
4118,
1027,
2553,
4180,
2043,
23325,
1024,
2832,
1035,
23325,
2043,
9140,
1024,
2832,
1035,
9140,
2842,
1024,
17552,
1035,
6415,
2203,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceCertificateOrders.create_or_update_async | def create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceCertificateOrder.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil)
# Send request
promise = begin_create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServiceCertificateOrder.mapper()
parsed_response = @client.deserialize(result_mapper, parsed_response)
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"create_or_update_async",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"certificate_distinguished_name",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"certi... | @param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param certificate_order_name [String] Name of the certificate order.
@param certificate_distinguished_name [AppServiceCertificateOrder]
Distinguished name to to use for the certificate order.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"Name",
"of",
"the",
"resource",
"group",
"to",
"which",
"the",
"resource",
"belongs",
".",
"@param",
"certificate_order_name",
"[",
"String",
"]",
"Name",
"of",
"the",
"certificate",
"order",
".",
"@param",
... | 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_certificate_orders.rb#L443-L459 | train | Creates or updates a certificate order. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8196,
1035,
2344,
1035,
2171,
1010,
8196,
1035,
5182,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb | Azure::CDN::Mgmt::V2017_04_02.CustomDomains.enable_custom_https_with_http_info | def enable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:nil)
enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:custom_headers).value!
end | ruby | def enable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:nil)
enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers:custom_headers).value!
end | [
"def",
"enable_custom_https_with_http_info",
"(",
"resource_group_name",
",",
"profile_name",
",",
"endpoint_name",
",",
"custom_domain_name",
",",
"custom_headers",
":",
"nil",
")",
"enable_custom_https_async",
"(",
"resource_group_name",
",",
"profile_name",
",",
"endpoin... | Enable https delivery of the custom domain.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param profile_name [String] Name of the CDN profile which is unique within
the resource group.
@param endpoint_name [String] Name of the endpoint under the profile which is
unique globally.
@param custom_domain_name [String] Name of the custom domain within an
endpoint.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Enable",
"https",
"delivery",
"of",
"the",
"custom",
"domain",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2017-04-02/generated/azure_mgmt_cdn/custom_domains.rb#L513-L515 | train | Enables the specified CDN endpoint for CDN CDN. | [
30522,
13366,
9585,
1035,
7661,
1035,
16770,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
2203,
8400,
1035,
2171,
1010,
7661,
1035,
5884,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
palkan/logidze | lib/logidze/history.rb | Logidze.History.changes_to | def changes_to(time: nil, version: nil, data: {}, from: 0)
raise ArgumentError, "Time or version must be specified" if time.nil? && version.nil?
filter = time.nil? ? method(:version_filter) : method(:time_filter)
versions.each_with_object(data.dup) do |v, acc|
next if v.version < from
break acc if filter.call(v, version, time)
acc.merge!(v.changes)
end
end | ruby | def changes_to(time: nil, version: nil, data: {}, from: 0)
raise ArgumentError, "Time or version must be specified" if time.nil? && version.nil?
filter = time.nil? ? method(:version_filter) : method(:time_filter)
versions.each_with_object(data.dup) do |v, acc|
next if v.version < from
break acc if filter.call(v, version, time)
acc.merge!(v.changes)
end
end | [
"def",
"changes_to",
"(",
"time",
":",
"nil",
",",
"version",
":",
"nil",
",",
"data",
":",
"{",
"}",
",",
"from",
":",
"0",
")",
"raise",
"ArgumentError",
",",
"\"Time or version must be specified\"",
"if",
"time",
".",
"nil?",
"&&",
"version",
".",
"ni... | Return diff from the initial state to specified time or version.
Optional `data` paramater can be used as initial diff state. | [
"Return",
"diff",
"from",
"the",
"initial",
"state",
"to",
"specified",
"time",
"or",
"version",
".",
"Optional",
"data",
"paramater",
"can",
"be",
"used",
"as",
"initial",
"diff",
"state",
"."
] | ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8 | https://github.com/palkan/logidze/blob/ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8/lib/logidze/history.rb#L60-L70 | train | Returns the changes to the given time version and data | [
30522,
13366,
3431,
1035,
2000,
1006,
2051,
1024,
9152,
2140,
1010,
2544,
1024,
9152,
2140,
1010,
2951,
1024,
1063,
1065,
1010,
2013,
1024,
1014,
1007,
5333,
6685,
2121,
29165,
1010,
1000,
2051,
2030,
2544,
2442,
2022,
9675,
1000,
2065,
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... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/population_criteria.rb | HQMF2.PopulationCriteria.handle_observation_criteria | def handle_observation_criteria
exp = @entry.at_xpath('./cda:measureObservationDefinition/cda:value/cda:expression/@value',
HQMF2::Document::NAMESPACES)
# Measure Observations criteria rely on computed expressions. If it doesn't have one,
# then it is likely formatted improperly.
fail 'Measure Observations criteria is missing computed expression(s) ' if exp.nil?
parts = exp.to_s.split('-')
dc = parse_parts_to_dc(parts)
@doc.add_data_criteria(dc)
# Update reference_ids with any newly referenced data criteria
dc.children_criteria.each { |cc| @doc.add_reference_id(cc) } unless dc.children_criteria.nil?
dc
end | ruby | def handle_observation_criteria
exp = @entry.at_xpath('./cda:measureObservationDefinition/cda:value/cda:expression/@value',
HQMF2::Document::NAMESPACES)
# Measure Observations criteria rely on computed expressions. If it doesn't have one,
# then it is likely formatted improperly.
fail 'Measure Observations criteria is missing computed expression(s) ' if exp.nil?
parts = exp.to_s.split('-')
dc = parse_parts_to_dc(parts)
@doc.add_data_criteria(dc)
# Update reference_ids with any newly referenced data criteria
dc.children_criteria.each { |cc| @doc.add_reference_id(cc) } unless dc.children_criteria.nil?
dc
end | [
"def",
"handle_observation_criteria",
"exp",
"=",
"@entry",
".",
"at_xpath",
"(",
"'./cda:measureObservationDefinition/cda:value/cda:expression/@value'",
",",
"HQMF2",
"::",
"Document",
"::",
"NAMESPACES",
")",
"# Measure Observations criteria rely on computed expressions. If it does... | extracts out any measure observation definitons, creating from them the proper criteria to generate a precondition | [
"extracts",
"out",
"any",
"measure",
"observation",
"definitons",
"creating",
"from",
"them",
"the",
"proper",
"criteria",
"to",
"generate",
"a",
"precondition"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/population_criteria.rb#L69-L81 | train | Handle Measure Observations criteria | [
30522,
13366,
5047,
1035,
8089,
1035,
9181,
4654,
2361,
1027,
1030,
4443,
1012,
2012,
1035,
26726,
8988,
1006,
1005,
1012,
1013,
3729,
2050,
1024,
5468,
16429,
8043,
21596,
3207,
16294,
22753,
1013,
3729,
2050,
1024,
3643,
1013,
3729,
2050,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hanami/hanami | lib/hanami/early_hints.rb | Hanami.EarlyHints.send_early_hints | def send_early_hints(env)
return if Thread.current[CACHE_KEY].nil?
Thread.current[CACHE_KEY].each_slice(BATCH_SIZE) do |slice|
link = slice.map do |asset, options|
ret = %(<#{asset}>; rel=preload)
ret += "; as=#{options[:as]}" unless options[:as].nil?
ret += "; crossorigin" if options[:crossorigin]
ret
end.join("\n")
send_early_hints_response(env, link)
end
end | ruby | def send_early_hints(env)
return if Thread.current[CACHE_KEY].nil?
Thread.current[CACHE_KEY].each_slice(BATCH_SIZE) do |slice|
link = slice.map do |asset, options|
ret = %(<#{asset}>; rel=preload)
ret += "; as=#{options[:as]}" unless options[:as].nil?
ret += "; crossorigin" if options[:crossorigin]
ret
end.join("\n")
send_early_hints_response(env, link)
end
end | [
"def",
"send_early_hints",
"(",
"env",
")",
"return",
"if",
"Thread",
".",
"current",
"[",
"CACHE_KEY",
"]",
".",
"nil?",
"Thread",
".",
"current",
"[",
"CACHE_KEY",
"]",
".",
"each_slice",
"(",
"BATCH_SIZE",
")",
"do",
"|",
"slice",
"|",
"link",
"=",
... | Tries to send multiple Early Hints (103) HTTP responses, if there are
assets eligible.
@param env [Hash] Rack env
@raise [Hanami::EarlyHints::NotSupportedByServerError] if the current Ruby
server doesn't support Early Hints
@since 1.2.0
@api private | [
"Tries",
"to",
"send",
"multiple",
"Early",
"Hints",
"(",
"103",
")",
"HTTP",
"responses",
"if",
"there",
"are",
"assets",
"eligible",
"."
] | 8c6e5147e92ef869b25379448572da3698eacfdc | https://github.com/hanami/hanami/blob/8c6e5147e92ef869b25379448572da3698eacfdc/lib/hanami/early_hints.rb#L97-L110 | train | Send early hints response | [
30522,
13366,
4604,
1035,
2220,
1035,
20385,
1006,
4372,
2615,
1007,
2709,
2065,
11689,
1012,
2783,
1031,
17053,
1035,
3145,
1033,
1012,
9152,
2140,
1029,
11689,
30524,
2128,
2140,
1027,
3653,
11066,
1007,
2128,
2102,
1009,
1027,
1000,
1025... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/spec.rb | Reek.Spec.reek_only_of | def reek_only_of(smell_type, configuration = Configuration::AppConfiguration.default)
ShouldReekOnlyOf.new(smell_type, configuration)
end | ruby | def reek_only_of(smell_type, configuration = Configuration::AppConfiguration.default)
ShouldReekOnlyOf.new(smell_type, configuration)
end | [
"def",
"reek_only_of",
"(",
"smell_type",
",",
"configuration",
"=",
"Configuration",
"::",
"AppConfiguration",
".",
"default",
")",
"ShouldReekOnlyOf",
".",
"new",
"(",
"smell_type",
",",
"configuration",
")",
"end"
] | See the documentaton for "reek_of".
Notable differences to reek_of:
1.) "reek_of" doesn't mind if there are other smells of a different type.
"reek_only_of" will fail in that case.
2.) "reek_only_of" doesn't support the additional smell_details hash.
@param smell_type [Symbol, String] The "smell type" to check for.
@public
@quality :reek:UtilityFunction | [
"See",
"the",
"documentaton",
"for",
"reek_of",
"."
] | 8c6b5c0c6228a6981ab48543457889f9ea984054 | https://github.com/troessner/reek/blob/8c6b5c0c6228a6981ab48543457889f9ea984054/lib/reek/spec.rb#L107-L109 | train | Returns the sequencer that should be reeked only of the given smell type. | [
30522,
13366,
2128,
5937,
1035,
2069,
1035,
1997,
1006,
5437,
1035,
2828,
1010,
9563,
1027,
9563,
1024,
1024,
10439,
8663,
8873,
27390,
3370,
1012,
12398,
1007,
2323,
9910,
19648,
2135,
11253,
1012,
2047,
1006,
5437,
1035,
2828,
1010,
9563,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmosolgo/graphql-ruby | lib/graphql/subscriptions.rb | GraphQL.Subscriptions.execute_all | def execute_all(event, object)
each_subscription_id(event) do |subscription_id|
execute(subscription_id, event, object)
end
end | ruby | def execute_all(event, object)
each_subscription_id(event) do |subscription_id|
execute(subscription_id, event, object)
end
end | [
"def",
"execute_all",
"(",
"event",
",",
"object",
")",
"each_subscription_id",
"(",
"event",
")",
"do",
"|",
"subscription_id",
"|",
"execute",
"(",
"subscription_id",
",",
"event",
",",
"object",
")",
"end",
"end"
] | Event `event` occurred on `object`,
Update all subscribers.
@param event [Subscriptions::Event]
@param object [Object]
@return [void] | [
"Event",
"event",
"occurred",
"on",
"object",
"Update",
"all",
"subscribers",
"."
] | d5be13a816f220b9efbabeaa69a3e56fedf311f5 | https://github.com/rmosolgo/graphql-ruby/blob/d5be13a816f220b9efbabeaa69a3e56fedf311f5/lib/graphql/subscriptions.rb#L116-L120 | train | Execute all the resources in the specified event. | [
30522,
13366,
15389,
1035,
2035,
1006,
2724,
1010,
4874,
1007,
2169,
1035,
15002,
1035,
8909,
1006,
2724,
1007,
2079,
1064,
15002,
1035,
8909,
1064,
15389,
1006,
15002,
1035,
8909,
1010,
2724,
1010,
4874,
1007,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb | Azure::Web::Mgmt::V2018_02_01.Diagnostics.execute_site_detector | def execute_site_detector(resource_group_name, site_name, detector_name, diagnostic_category, start_time:nil, end_time:nil, time_grain:nil, custom_headers:nil)
response = execute_site_detector_async(resource_group_name, site_name, detector_name, diagnostic_category, start_time:start_time, end_time:end_time, time_grain:time_grain, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def execute_site_detector(resource_group_name, site_name, detector_name, diagnostic_category, start_time:nil, end_time:nil, time_grain:nil, custom_headers:nil)
response = execute_site_detector_async(resource_group_name, site_name, detector_name, diagnostic_category, start_time:start_time, end_time:end_time, time_grain:time_grain, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"execute_site_detector",
"(",
"resource_group_name",
",",
"site_name",
",",
"detector_name",
",",
"diagnostic_category",
",",
"start_time",
":",
"nil",
",",
"end_time",
":",
"nil",
",",
"time_grain",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"re... | Execute Detector
Execute Detector
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param site_name [String] Site Name
@param detector_name [String] Detector Resource Name
@param diagnostic_category [String] Category Name
@param start_time [DateTime] Start Time
@param end_time [DateTime] End Time
@param time_grain [String] Time Grain
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DiagnosticDetectorResponse] operation results. | [
"Execute",
"Detector"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L1260-L1263 | train | Executes a site detector. | [
30522,
13366,
15389,
1035,
2609,
1035,
19034,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2609,
1035,
2171,
1010,
19034,
1035,
2171,
1010,
16474,
1035,
4696,
1010,
2707,
1035,
2051,
1024,
9152,
2140,
1010,
2203,
1035,
2051,
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... |
fastlane/fastlane | spaceship/lib/spaceship/tunes/tunes_client.rb | Spaceship.TunesClient.upload_trailer | def upload_trailer(app_version, upload_trailer)
raise "app_version is required" unless app_version
raise "upload_trailer is required" unless upload_trailer
du_client.upload_trailer(app_version, upload_trailer, content_provider_id, sso_token_for_video)
end | ruby | def upload_trailer(app_version, upload_trailer)
raise "app_version is required" unless app_version
raise "upload_trailer is required" unless upload_trailer
du_client.upload_trailer(app_version, upload_trailer, content_provider_id, sso_token_for_video)
end | [
"def",
"upload_trailer",
"(",
"app_version",
",",
"upload_trailer",
")",
"raise",
"\"app_version is required\"",
"unless",
"app_version",
"raise",
"\"upload_trailer is required\"",
"unless",
"upload_trailer",
"du_client",
".",
"upload_trailer",
"(",
"app_version",
",",
"upl... | Uploads the transit app file
@param app_version (AppVersion): The version of your app
@param upload_trailer (UploadFile): The trailer to upload
@return [JSON] the response | [
"Uploads",
"the",
"transit",
"app",
"file"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/spaceship/lib/spaceship/tunes/tunes_client.rb#L856-L861 | train | Upload a trailer to the specified app version. | [
30522,
13366,
2039,
11066,
1035,
9117,
1006,
10439,
1035,
2544,
1010,
2039,
11066,
1035,
9117,
1007,
5333,
1000,
10439,
1035,
2544,
2003,
3223,
1000,
4983,
10439,
1035,
2544,
5333,
1000,
2039,
11066,
1035,
9117,
2003,
3223,
1000,
4983,
2039... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb | Azure::SQL::Mgmt::V2017_03_01_preview.JobExecutions.cancel_with_http_info | def cancel_with_http_info(resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers:nil)
cancel_async(resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers:custom_headers).value!
end | ruby | def cancel_with_http_info(resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers:nil)
cancel_async(resource_group_name, server_name, job_agent_name, job_name, job_execution_id, custom_headers:custom_headers).value!
end | [
"def",
"cancel_with_http_info",
"(",
"resource_group_name",
",",
"server_name",
",",
"job_agent_name",
",",
"job_name",
",",
"job_execution_id",
",",
"custom_headers",
":",
"nil",
")",
"cancel_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"job_agent_name"... | Requests cancellation of a job execution.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param job_agent_name [String] The name of the job agent.
@param job_name [String] The name of the job.
@param job_execution_id The id of the job execution to cancel.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Requests",
"cancellation",
"of",
"a",
"job",
"execution",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/job_executions.rb#L199-L201 | train | Cancels a job execution. | [
30522,
13366,
17542,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
3105,
1035,
4005,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
3105,
1035,
7781,
1035,
8909,
1010,
7661,
1035,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
refinery/refinerycms | core/app/helpers/refinery/tag_helper.rb | Refinery.TagHelper.refinery_help_tag | def refinery_help_tag(title='Tip')
title = title.html_safe? ? title : h(title)
action_icon(:info, '#', title, {tooltip: title})
end | ruby | def refinery_help_tag(title='Tip')
title = title.html_safe? ? title : h(title)
action_icon(:info, '#', title, {tooltip: title})
end | [
"def",
"refinery_help_tag",
"(",
"title",
"=",
"'Tip'",
")",
"title",
"=",
"title",
".",
"html_safe?",
"?",
"title",
":",
"h",
"(",
"title",
")",
"action_icon",
"(",
":info",
",",
"'#'",
",",
"title",
",",
"{",
"tooltip",
":",
"title",
"}",
")",
"end... | Returns <img class='help' tooltip='Your Input' src='refinery/icons/information.png' />
Remember to wrap your block with <span class='label_with_help'></span> if you're using a label next to the help tag. | [
"Returns",
"<img",
"class",
"=",
"help",
"tooltip",
"=",
"Your",
"Input",
"src",
"=",
"refinery",
"/",
"icons",
"/",
"information",
".",
"png",
"/",
">",
"Remember",
"to",
"wrap",
"your",
"block",
"with",
"<span",
"class",
"=",
"label_with_help",
">",
"<... | 67f117f937c5264ec0aeabe8e7eac1d562c5bc7b | https://github.com/refinery/refinerycms/blob/67f117f937c5264ec0aeabe8e7eac1d562c5bc7b/core/app/helpers/refinery/tag_helper.rb#L7-L10 | train | Returns a refinery help tag | [
30522,
13366,
21034,
1035,
2393,
1035,
6415,
1006,
2516,
1027,
1005,
5955,
1005,
1007,
2516,
1027,
2516,
1012,
16129,
1035,
3647,
1029,
1029,
2516,
1024,
1044,
1006,
2516,
1007,
2895,
1035,
12696,
1006,
1024,
18558,
1010,
1005,
1001,
1005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/cli.rb | HamlLint.CLI.print_available_linters | def print_available_linters
log.info 'Available linters:'
linter_names = HamlLint::LinterRegistry.linters.map do |linter|
linter.name.split('::').last
end
linter_names.sort.each do |linter_name|
log.log " - #{linter_name}"
end
end | ruby | def print_available_linters
log.info 'Available linters:'
linter_names = HamlLint::LinterRegistry.linters.map do |linter|
linter.name.split('::').last
end
linter_names.sort.each do |linter_name|
log.log " - #{linter_name}"
end
end | [
"def",
"print_available_linters",
"log",
".",
"info",
"'Available linters:'",
"linter_names",
"=",
"HamlLint",
"::",
"LinterRegistry",
".",
"linters",
".",
"map",
"do",
"|",
"linter",
"|",
"linter",
".",
"name",
".",
"split",
"(",
"'::'",
")",
".",
"last",
"... | Outputs a list of all currently available linters. | [
"Outputs",
"a",
"list",
"of",
"all",
"currently",
"available",
"linters",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/cli.rb#L114-L124 | train | Print the available linters | [
30522,
13366,
6140,
1035,
2800,
1035,
11409,
7747,
8833,
1012,
18558,
1005,
2800,
11409,
7747,
1024,
1005,
11409,
3334,
1035,
3415,
1027,
10654,
21202,
2102,
1024,
1024,
11409,
3334,
2890,
24063,
2854,
1012,
11409,
7747,
1012,
4949,
2079,
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 | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.update_explicit_list_item_with_http_info | def update_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, item, custom_headers:nil)
update_explicit_list_item_async(app_id, version_id, entity_id, item_id, item, custom_headers:custom_headers).value!
end | ruby | def update_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, item, custom_headers:nil)
update_explicit_list_item_async(app_id, version_id, entity_id, item_id, item, custom_headers:custom_headers).value!
end | [
"def",
"update_explicit_list_item_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"item_id",
",",
"item",
",",
"custom_headers",
":",
"nil",
")",
"update_explicit_list_item_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"i... | Updates an explicit (exception) list item for a Pattern.Any entity in a
version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The Pattern.Any entity extractor ID.
@param item_id [Integer] The explicit list item ID.
@param item [ExplicitListItemUpdateObject] The new explicit list item.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"an",
"explicit",
"(",
"exception",
")",
"list",
"item",
"for",
"a",
"Pattern",
".",
"Any",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L11401-L11403 | train | Updates an explicit list item. | [
30522,
13366,
10651,
1035,
13216,
1035,
2862,
1035,
8875,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
8875,
1035,
8909,
1010,
8875,
1010,
7661,
1035,
20346,
2015,
1024,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.deallocate_async | def deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
# Send request
promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
# Send request
promise = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"deallocate_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_deallocate_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
... | @param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@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",
"[",
"VirtualMachi... | 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#L274-L288 | train | Deallocates a virtual machine from a VM scale set. | [
30522,
13366,
3066,
4135,
16280,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
1024,
9152,
2140,
1010,
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... |
algolia/algoliasearch-rails | lib/algoliasearch-rails.rb | AlgoliaSearch.SafeIndex.get_settings | def get_settings(*args)
SafeIndex.log_or_throw(:get_settings, @raise_on_failure) do
begin
@index.get_settings(*args)
rescue Algolia::AlgoliaError => e
return {} if e.code == 404 # not fatal
raise e
end
end
end | ruby | def get_settings(*args)
SafeIndex.log_or_throw(:get_settings, @raise_on_failure) do
begin
@index.get_settings(*args)
rescue Algolia::AlgoliaError => e
return {} if e.code == 404 # not fatal
raise e
end
end
end | [
"def",
"get_settings",
"(",
"*",
"args",
")",
"SafeIndex",
".",
"log_or_throw",
"(",
":get_settings",
",",
"@raise_on_failure",
")",
"do",
"begin",
"@index",
".",
"get_settings",
"(",
"args",
")",
"rescue",
"Algolia",
"::",
"AlgoliaError",
"=>",
"e",
"return",... | special handling of get_settings to avoid raising errors on 404 | [
"special",
"handling",
"of",
"get_settings",
"to",
"avoid",
"raising",
"errors",
"on",
"404"
] | 360e47d733476e6611d9874cf89e57942b7f2939 | https://github.com/algolia/algoliasearch-rails/blob/360e47d733476e6611d9874cf89e57942b7f2939/lib/algoliasearch-rails.rb#L328-L337 | train | Get the settings of the index | [
30522,
13366,
2131,
1035,
10906,
1006,
1008,
12098,
5620,
1007,
3647,
22254,
10288,
1012,
8833,
1035,
2030,
1035,
5466,
1006,
1024,
2131,
1035,
10906,
1010,
1030,
5333,
1035,
2006,
1035,
4945,
1007,
2079,
4088,
1030,
5950,
1012,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb | Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.list_deployments_at_resource_next | def list_deployments_at_resource_next(next_page_link, custom_headers:nil)
response = list_deployments_at_resource_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_deployments_at_resource_next(next_page_link, custom_headers:nil)
response = list_deployments_at_resource_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_deployments_at_resource_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_deployments_at_resource_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"bo... | Gets all deployments for a remediation at resource scope.
@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 [RemediationDeploymentsListResult] operation results. | [
"Gets",
"all",
"deployments",
"for",
"a",
"remediation",
"at",
"resource",
"scope",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L2885-L2888 | train | Gets the list of deployments at resource scope. | [
30522,
13366,
2862,
1035,
10813,
2015,
1035,
2012,
1035,
7692,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
10813,
2015,
1035,
2012,
1035,
7692,
1035,
2279,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb | Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.get_at_subscription | def get_at_subscription(remediation_name, custom_headers:nil)
response = get_at_subscription_async(remediation_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_at_subscription(remediation_name, custom_headers:nil)
response = get_at_subscription_async(remediation_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_at_subscription",
"(",
"remediation_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_at_subscription_async",
"(",
"remediation_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"resp... | Gets an existing remediation at subscription scope.
@param remediation_name [String] The name of the remediation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Remediation] operation results. | [
"Gets",
"an",
"existing",
"remediation",
"at",
"subscription",
"scope",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L1007-L1010 | train | Gets the specified remediation at subscription scope. | [
30522,
13366,
2131,
1035,
2012,
1035,
15002,
1006,
2128,
16969,
3508,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
2012,
1035,
15002,
1035,
2004,
6038,
2278,
1006,
2128,
16969,
3508,
1035,
2171,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | app/models/hyrax/operation.rb | Hyrax.Operation.fail! | def fail!(message = nil)
run_callbacks :failure do
update(status: FAILURE, message: message)
parent&.rollup_status
end
end | ruby | def fail!(message = nil)
run_callbacks :failure do
update(status: FAILURE, message: message)
parent&.rollup_status
end
end | [
"def",
"fail!",
"(",
"message",
"=",
"nil",
")",
"run_callbacks",
":failure",
"do",
"update",
"(",
"status",
":",
"FAILURE",
",",
"message",
":",
"message",
")",
"parent",
"&.",
"rollup_status",
"end",
"end"
] | Mark this operation as a FAILURE. If this is a child operation, roll up to
the parent any failures.
@param [String, nil] message record any failure message
@see Hyrax::Operation::FAILURE
@see #rollup_status
@note This will run any registered :failure callbacks
@todo Where are these callbacks defined? Document this | [
"Mark",
"this",
"operation",
"as",
"a",
"FAILURE",
".",
"If",
"this",
"is",
"a",
"child",
"operation",
"roll",
"up",
"to",
"the",
"parent",
"any",
"failures",
"."
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/models/hyrax/operation.rb#L76-L81 | train | fails the current process | [
30522,
13366,
8246,
999,
1006,
4471,
1027,
9152,
2140,
1007,
2448,
1035,
2655,
12221,
1024,
4945,
2079,
10651,
1006,
3570,
1024,
4945,
1010,
4471,
1024,
4471,
1007,
6687,
1004,
1012,
4897,
6279,
1035,
3570,
2203,
2203,
102,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jch/html-pipeline | lib/html/pipeline.rb | HTML.Pipeline.call | def call(html, context = {}, result = nil)
context = @default_context.merge(context)
context = context.freeze
result ||= @result_class.new
payload = default_payload filters: @filters.map(&:name),
context: context, result: result
instrument 'call_pipeline.html_pipeline', payload do
result[:output] =
@filters.inject(html) do |doc, filter|
perform_filter(filter, doc, context, result)
end
end
result
end | ruby | def call(html, context = {}, result = nil)
context = @default_context.merge(context)
context = context.freeze
result ||= @result_class.new
payload = default_payload filters: @filters.map(&:name),
context: context, result: result
instrument 'call_pipeline.html_pipeline', payload do
result[:output] =
@filters.inject(html) do |doc, filter|
perform_filter(filter, doc, context, result)
end
end
result
end | [
"def",
"call",
"(",
"html",
",",
"context",
"=",
"{",
"}",
",",
"result",
"=",
"nil",
")",
"context",
"=",
"@default_context",
".",
"merge",
"(",
"context",
")",
"context",
"=",
"context",
".",
"freeze",
"result",
"||=",
"@result_class",
".",
"new",
"p... | Apply all filters in the pipeline to the given HTML.
html - A String containing HTML or a DocumentFragment object.
context - The context hash passed to each filter. See the Filter docs
for more info on possible values. This object MUST NOT be modified
in place by filters. Use the Result for passing state back.
result - The result Hash passed to each filter for modification. This
is where Filters store extracted information from the content.
Returns the result Hash after being filtered by this Pipeline. Contains an
:output key with the DocumentFragment or String HTML markup based on the
output of the last filter in the pipeline. | [
"Apply",
"all",
"filters",
"in",
"the",
"pipeline",
"to",
"the",
"given",
"HTML",
"."
] | f1bbce4858876dc2619c61a8b18637b5d3321b1c | https://github.com/jch/html-pipeline/blob/f1bbce4858876dc2619c61a8b18637b5d3321b1c/lib/html/pipeline.rb#L107-L120 | train | Calls the pipeline with the given HTML | [
30522,
13366,
2655,
1006,
16129,
1010,
6123,
1027,
1063,
1065,
1010,
2765,
1027,
9152,
2140,
1007,
6123,
1027,
1030,
12398,
1035,
6123,
1012,
13590,
1006,
6123,
1007,
6123,
1027,
6123,
1012,
13184,
2765,
1064,
1064,
1027,
1030,
2765,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | fastlane/lib/fastlane/other_action.rb | Fastlane.OtherAction.method_missing | def method_missing(method_sym, *arguments, &_block)
# We have to go inside the fastlane directory
# since in the fastlane runner.rb we do the following
# custom_dir = ".."
# Dir.chdir(custom_dir) do
# this goes one folder up, since we're inside the "fastlane"
# folder at that point
# Since we call an action from an action we need to go inside
# the fastlane folder too
self.runner.trigger_action_by_name(method_sym,
FastlaneCore::FastlaneFolder.path,
true,
*arguments)
end | ruby | def method_missing(method_sym, *arguments, &_block)
# We have to go inside the fastlane directory
# since in the fastlane runner.rb we do the following
# custom_dir = ".."
# Dir.chdir(custom_dir) do
# this goes one folder up, since we're inside the "fastlane"
# folder at that point
# Since we call an action from an action we need to go inside
# the fastlane folder too
self.runner.trigger_action_by_name(method_sym,
FastlaneCore::FastlaneFolder.path,
true,
*arguments)
end | [
"def",
"method_missing",
"(",
"method_sym",
",",
"*",
"arguments",
",",
"&",
"_block",
")",
"# We have to go inside the fastlane directory",
"# since in the fastlane runner.rb we do the following",
"# custom_dir = \"..\"",
"# Dir.chdir(custom_dir) do",
"# this goes one folder up, s... | Allows the user to call an action from an action | [
"Allows",
"the",
"user",
"to",
"call",
"an",
"action",
"from",
"an",
"action"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/fastlane/lib/fastlane/other_action.rb#L13-L27 | train | This method is called by the FastlaneRunner. | [
30522,
13366,
4118,
1035,
4394,
1006,
4118,
1035,
25353,
2213,
1010,
1008,
9918,
1010,
1004,
1035,
3796,
1007,
1001,
2057,
2031,
2000,
2175,
2503,
1996,
3435,
20644,
14176,
1001,
2144,
1999,
1996,
3435,
20644,
5479,
1012,
21144,
2057,
2079,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_computervision/lib/1.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb | Azure::CognitiveServices::ComputerVision::V1_0.ComputerVisionClient.recognize_text_with_http_info | def recognize_text_with_http_info(url, detect_handwriting:false, custom_headers:nil)
recognize_text_async(url, detect_handwriting:detect_handwriting, custom_headers:custom_headers).value!
end | ruby | def recognize_text_with_http_info(url, detect_handwriting:false, custom_headers:nil)
recognize_text_async(url, detect_handwriting:detect_handwriting, custom_headers:custom_headers).value!
end | [
"def",
"recognize_text_with_http_info",
"(",
"url",
",",
"detect_handwriting",
":",
"false",
",",
"custom_headers",
":",
"nil",
")",
"recognize_text_async",
"(",
"url",
",",
"detect_handwriting",
":detect_handwriting",
",",
"custom_headers",
":custom_headers",
")",
".",... | Recognize Text operation. When you use the Recognize Text interface, the
response contains a field called 'Operation-Location'. The
'Operation-Location' field contains the URL that you must use for your Get
Handwritten Text Operation Result operation.
@param url [String] Publicly reachable URL of an image
@param detect_handwriting [Boolean] If 'true' is specified, handwriting
recognition is performed. If this parameter is set to 'false' or is not
specified, printed text recognition is performed.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Recognize",
"Text",
"operation",
".",
"When",
"you",
"use",
"the",
"Recognize",
"Text",
"interface",
"the",
"response",
"contains",
"a",
"field",
"called",
"Operation",
"-",
"Location",
".",
"The",
"Operation",
"-",
"Location",
"field",
"contains",
"the",
"UR... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_computervision/lib/1.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb#L1108-L1110 | train | Recognizes text in a given URL. | [
30522,
13366,
6807,
1035,
3793,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
24471,
2140,
1010,
11487,
1035,
24149,
1024,
6270,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
6807,
1035,
3793,
1035,
2004,
6038,
2278,
1006,
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... |
sds/overcommit | lib/overcommit/configuration_validator.rb | Overcommit.ConfigurationValidator.check_hook_name_format | def check_hook_name_format(hash)
errors = []
Overcommit::Utils.supported_hook_type_classes.each do |hook_type|
hash.fetch(hook_type) { {} }.each_key do |hook_name|
next if hook_name == 'ALL'
unless hook_name.match?(/\A[A-Za-z0-9]+\z/)
errors << "#{hook_type}::#{hook_name} has an invalid name " \
"#{hook_name}. It must contain only alphanumeric " \
'characters (no underscores or dashes, etc.)'
end
end
end
if errors.any?
if @log
@log.error errors.join("\n")
@log.newline
end
raise Overcommit::Exceptions::ConfigurationError,
'One or more hooks had invalid names'
end
end | ruby | def check_hook_name_format(hash)
errors = []
Overcommit::Utils.supported_hook_type_classes.each do |hook_type|
hash.fetch(hook_type) { {} }.each_key do |hook_name|
next if hook_name == 'ALL'
unless hook_name.match?(/\A[A-Za-z0-9]+\z/)
errors << "#{hook_type}::#{hook_name} has an invalid name " \
"#{hook_name}. It must contain only alphanumeric " \
'characters (no underscores or dashes, etc.)'
end
end
end
if errors.any?
if @log
@log.error errors.join("\n")
@log.newline
end
raise Overcommit::Exceptions::ConfigurationError,
'One or more hooks had invalid names'
end
end | [
"def",
"check_hook_name_format",
"(",
"hash",
")",
"errors",
"=",
"[",
"]",
"Overcommit",
"::",
"Utils",
".",
"supported_hook_type_classes",
".",
"each",
"do",
"|",
"hook_type",
"|",
"hash",
".",
"fetch",
"(",
"hook_type",
")",
"{",
"{",
"}",
"}",
".",
"... | Prints an error message and raises an exception if a hook has an
invalid name, since this can result in strange errors elsewhere. | [
"Prints",
"an",
"error",
"message",
"and",
"raises",
"an",
"exception",
"if",
"a",
"hook",
"has",
"an",
"invalid",
"name",
"since",
"this",
"can",
"result",
"in",
"strange",
"errors",
"elsewhere",
"."
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/configuration_validator.rb#L98-L121 | train | Check the hook name format | [
30522,
13366,
4638,
1035,
8103,
1035,
2171,
1035,
4289,
1006,
23325,
1007,
10697,
1027,
1031,
1033,
2058,
9006,
22930,
1024,
1024,
21183,
12146,
1012,
3569,
1035,
8103,
1035,
2828,
1035,
4280,
1012,
2169,
2079,
1064,
8103,
1035,
2828,
1064,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.begin_get_troubleshooting_result_with_http_info | def begin_get_troubleshooting_result_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_get_troubleshooting_result_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
begin_get_troubleshooting_result_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_get_troubleshooting_result_with_http_info",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_get_troubleshooting_result_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
... | Get the last completed troubleshooting result on a specified resource
@param resource_group_name [String] The name of the resource group.
@param network_watcher_name [String] The name of the network watcher
resource.
@param parameters [QueryTroubleshootingParameters] Parameters that define the
resource to query the troubleshooting result.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Get",
"the",
"last",
"completed",
"troubleshooting",
"result",
"on",
"a",
"specified",
"resource"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L1772-L1774 | train | Gets the troubleshooting result of a specified resource group. | [
30522,
13366,
4088,
1035,
2131,
30524,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
2131,
1035,
13460,
23416,
2075,
1035,
2765,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/db_security_group.rb | Aws::RDS.DBSecurityGroup.subscribe_to | def subscribe_to(options = {})
options = options.merge(source_identifier: @name)
resp = @client.add_source_identifier_to_subscription(options)
EventSubscription.new(
name: resp.data.event_subscription.cust_subscription_id,
data: resp.data.event_subscription,
client: @client
)
end | ruby | def subscribe_to(options = {})
options = options.merge(source_identifier: @name)
resp = @client.add_source_identifier_to_subscription(options)
EventSubscription.new(
name: resp.data.event_subscription.cust_subscription_id,
data: resp.data.event_subscription,
client: @client
)
end | [
"def",
"subscribe_to",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"source_identifier",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"add_source_identifier_to_subscription",
"(",
"options",
")",
"EventSubscription",
".",
... | @example Request syntax with placeholder values
eventsubscription = db_security_group.subscribe_to({
subscription_name: "String", # required
})
@param [Hash] options ({})
@option options [required, String] :subscription_name
The name of the RDS event notification subscription you want to add a
source identifier to.
@return [EventSubscription] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_security_group.rb#L334-L342 | train | Subscribe to the source identifier | [
30522,
13366,
4942,
29234,
1035,
2000,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
3120,
1035,
8909,
4765,
18095,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
5587,
1035,
3120,
1035,
8909,
4765,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jnunemaker/flipper | lib/flipper/feature.rb | Flipper.Feature.enabled_gates | def enabled_gates
values = gate_values
gates.select { |gate| gate.enabled?(values[gate.key]) }
end | ruby | def enabled_gates
values = gate_values
gates.select { |gate| gate.enabled?(values[gate.key]) }
end | [
"def",
"enabled_gates",
"values",
"=",
"gate_values",
"gates",
".",
"select",
"{",
"|",
"gate",
"|",
"gate",
".",
"enabled?",
"(",
"values",
"[",
"gate",
".",
"key",
"]",
")",
"}",
"end"
] | Public: Get the gates that have been enabled for the feature.
Returns an Array of Flipper::Gate instances. | [
"Public",
":",
"Get",
"the",
"gates",
"that",
"have",
"been",
"enabled",
"for",
"the",
"feature",
"."
] | df0352b663ad3ed45d68710f10a8170249ff9d78 | https://github.com/jnunemaker/flipper/blob/df0352b663ad3ed45d68710f10a8170249ff9d78/lib/flipper/feature.rb#L292-L295 | train | Returns the index of the gates that are enabled | [
30522,
13366,
9124,
1035,
6733,
5300,
1027,
4796,
1035,
5300,
6733,
1012,
7276,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.list_global_by_resource_group | def list_global_by_resource_group(resource_group_name, custom_headers:nil)
response = list_global_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_global_by_resource_group(resource_group_name, custom_headers:nil)
response = list_global_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_global_by_resource_group",
"(",
"resource_group_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_global_by_resource_group_async",
"(",
"resource_group_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"... | List all global event subscriptions under an Azure subscription and resource
group
List all global event subscriptions under a specific Azure subscription and
resource group
@param resource_group_name [String] The name of the resource group within the
user's subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [EventSubscriptionsListResult] operation results. | [
"List",
"all",
"global",
"event",
"subscriptions",
"under",
"an",
"Azure",
"subscription",
"and",
"resource",
"group"
] | 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#L680-L683 | train | Gets all the global policy rules in a resource group. | [
30522,
13366,
2862,
1035,
3795,
1035,
2011,
1035,
7692,
1035,
2177,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
30524,
3795,
1035,
2011,
1035,
7692,
1035,
2177,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_store/lib/2015-10-01-preview/generated/azure_mgmt_datalake_store/account.rb | Azure::DataLakeStore::Mgmt::V2015_10_01_preview.Account.enable_key_vault | def enable_key_vault(resource_group_name, account_name, custom_headers:nil)
response = enable_key_vault_async(resource_group_name, account_name, custom_headers:custom_headers).value!
nil
end | ruby | def enable_key_vault(resource_group_name, account_name, custom_headers:nil)
response = enable_key_vault_async(resource_group_name, account_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"enable_key_vault",
"(",
"resource_group_name",
",",
"account_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"enable_key_vault_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Attempts to enable a user managed key vault for encryption of the specified
Data Lake Store account.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Store account.
@param account_name [String] The name of the Data Lake Store account to
attempt to enable the Key Vault for.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Attempts",
"to",
"enable",
"a",
"user",
"managed",
"key",
"vault",
"for",
"encryption",
"of",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_store/lib/2015-10-01-preview/generated/azure_mgmt_datalake_store/account.rb#L685-L688 | train | Enables the key vault for the specified Data Lake Store account. | [
30522,
13366,
9585,
1035,
3145,
1035,
11632,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
9585,
1035,
3145,
1035,
11632,
1035,
2004,
6038,
2278,
1006,
7692,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/cli.rb | HamlLint.CLI.run | def run(args)
options = HamlLint::Options.new.parse(args)
act_on_options(options)
rescue StandardError => e
handle_exception(e)
end | ruby | def run(args)
options = HamlLint::Options.new.parse(args)
act_on_options(options)
rescue StandardError => e
handle_exception(e)
end | [
"def",
"run",
"(",
"args",
")",
"options",
"=",
"HamlLint",
"::",
"Options",
".",
"new",
".",
"parse",
"(",
"args",
")",
"act_on_options",
"(",
"options",
")",
"rescue",
"StandardError",
"=>",
"e",
"handle_exception",
"(",
"e",
")",
"end"
] | rubocop:disable Metrics/ClassLength
Create a CLI that outputs to the specified logger.
@param logger [HamlLint::Logger]
Parses the given command-line arguments and executes appropriate logic
based on those arguments.
@param args [Array<String>] command line arguments
@return [Integer] exit status code | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"ClassLength",
"Create",
"a",
"CLI",
"that",
"outputs",
"to",
"the",
"specified",
"logger",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/cli.rb#L23-L28 | train | Run the command | [
30522,
13366,
2448,
1006,
12098,
5620,
1007,
7047,
1027,
10654,
21202,
2102,
1024,
1024,
7047,
1012,
2047,
1012,
11968,
3366,
1006,
12098,
5620,
1007,
2552,
1035,
2006,
1035,
7047,
1006,
7047,
1007,
5343,
3115,
2121,
29165,
1027,
1028,
1041... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/document_helpers/doc_population_helper.rb | HQMF2.DocumentPopulationHelper.handle_base_populations | def handle_base_populations(population_def, population)
{
HQMF::PopulationCriteria::IPP => 'initialPopulationCriteria',
HQMF::PopulationCriteria::DENOM => 'denominatorCriteria',
HQMF::PopulationCriteria::NUMER => 'numeratorCriteria',
HQMF::PopulationCriteria::NUMEX => 'numeratorExclusionCriteria',
HQMF::PopulationCriteria::DENEXCEP => 'denominatorExceptionCriteria',
HQMF::PopulationCriteria::DENEX => 'denominatorExclusionCriteria',
HQMF::PopulationCriteria::MSRPOPL => 'measurePopulationCriteria',
HQMF::PopulationCriteria::MSRPOPLEX => 'measurePopulationExclusionCriteria'
}.each_pair do |criteria_id, criteria_element_name|
criteria_def = population_def.at_xpath("cda:component[cda:#{criteria_element_name}]", HQMF2::Document::NAMESPACES)
if criteria_def
build_population_criteria(criteria_def, criteria_id, population)
end
end
end | ruby | def handle_base_populations(population_def, population)
{
HQMF::PopulationCriteria::IPP => 'initialPopulationCriteria',
HQMF::PopulationCriteria::DENOM => 'denominatorCriteria',
HQMF::PopulationCriteria::NUMER => 'numeratorCriteria',
HQMF::PopulationCriteria::NUMEX => 'numeratorExclusionCriteria',
HQMF::PopulationCriteria::DENEXCEP => 'denominatorExceptionCriteria',
HQMF::PopulationCriteria::DENEX => 'denominatorExclusionCriteria',
HQMF::PopulationCriteria::MSRPOPL => 'measurePopulationCriteria',
HQMF::PopulationCriteria::MSRPOPLEX => 'measurePopulationExclusionCriteria'
}.each_pair do |criteria_id, criteria_element_name|
criteria_def = population_def.at_xpath("cda:component[cda:#{criteria_element_name}]", HQMF2::Document::NAMESPACES)
if criteria_def
build_population_criteria(criteria_def, criteria_id, population)
end
end
end | [
"def",
"handle_base_populations",
"(",
"population_def",
",",
"population",
")",
"{",
"HQMF",
"::",
"PopulationCriteria",
"::",
"IPP",
"=>",
"'initialPopulationCriteria'",
",",
"HQMF",
"::",
"PopulationCriteria",
"::",
"DENOM",
"=>",
"'denominatorCriteria'",
",",
"HQM... | Builds populations based an a predfined set of expected populations | [
"Builds",
"populations",
"based",
"an",
"a",
"predfined",
"set",
"of",
"expected",
"populations"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/document_helpers/doc_population_helper.rb#L92-L108 | train | This function handles the base population criteria | [
30522,
13366,
5047,
1035,
2918,
1035,
7080,
1006,
2313,
1035,
13366,
1010,
2313,
1007,
1063,
16260,
2213,
2546,
1024,
1024,
2313,
26775,
21646,
2401,
1024,
1024,
12997,
2361,
1027,
1028,
1005,
3988,
16340,
9513,
26775,
21646,
2401,
1005,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | 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.update_application_upgrade | def update_application_upgrade(application_id, application_upgrade_update_description, timeout:60, custom_headers:nil)
response = update_application_upgrade_async(application_id, application_upgrade_update_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def update_application_upgrade(application_id, application_upgrade_update_description, timeout:60, custom_headers:nil)
response = update_application_upgrade_async(application_id, application_upgrade_update_description, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"update_application_upgrade",
"(",
"application_id",
",",
"application_upgrade_update_description",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_application_upgrade_async",
"(",
"application_id",
",",
"application_upgrad... | Updates an ongoing application upgrade in the Service Fabric cluster.
Updates the parameters of an ongoing application upgrade from the ones
specified at the time of starting the application upgrade. This may be
required to mitigate stuck application upgrades due to incorrect parameters
or issues in the application to make progress.
@param application_id [String] The identity of the application. This is
typically the full name of the application without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the application name is "fabric:/myapp/app1", the application
identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions.
@param application_upgrade_update_description
[ApplicationUpgradeUpdateDescription] Parameters for updating an existing
application upgrade.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Updates",
"an",
"ongoing",
"application",
"upgrade",
"in",
"the",
"Service",
"Fabric",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L7986-L7989 | train | Updates an application upgrade. | [
30522,
13366,
10651,
1035,
4646,
1035,
12200,
1006,
4646,
1035,
8909,
1010,
4646,
1035,
12200,
1035,
10651,
1035,
6412,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
4646,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb | Azure::CognitiveServices::Face::V1_0.SnapshotOperations.list | def list(type:nil, apply_scope:nil, custom_headers:nil)
response = list_async(type:type, apply_scope:apply_scope, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list(type:nil, apply_scope:nil, custom_headers:nil)
response = list_async(type:type, apply_scope:apply_scope, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list",
"(",
"type",
":",
"nil",
",",
"apply_scope",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_async",
"(",
"type",
":",
"type",
",",
"apply_scope",
":apply_scope",
",",
"custom_headers",
":custom_headers",
")",
".",
... | List all accessible snapshots with related information, including snapshots
that were taken by the user, or snapshots to be applied to the user
(subscription id was included in the applyScope in Snapshot - Take).
@param type [SnapshotObjectType] User specified object type as a search
filter. Possible values include: 'FaceList', 'LargeFaceList',
'LargePersonGroup', 'PersonGroup'
@param apply_scope User specified snapshot apply scopes as a search filter.
ApplyScope is an array of the target Azure subscription ids for the snapshot,
specified by the user who created the snapshot by Snapshot - Take.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"List",
"all",
"accessible",
"snapshots",
"with",
"related",
"information",
"including",
"snapshots",
"that",
"were",
"taken",
"by",
"the",
"user",
"or",
"snapshots",
"to",
"be",
"applied",
"to",
"the",
"user",
"(",
"subscription",
"id",
"was",
"included",
"in... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb#L263-L266 | train | Gets the list of all the available image types. | [
30522,
13366,
2862,
1006,
2828,
1024,
9152,
2140,
1010,
6611,
1035,
9531,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2004,
6038,
2278,
1006,
2828,
1024,
2828,
1010,
6611,
1035,
9531,
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 | data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_image.rb | Azure::CognitiveServices::ContentModerator::V1_0.ListManagementImage.add_image_with_http_info | def add_image_with_http_info(list_id, tag:nil, label:nil, custom_headers:nil)
add_image_async(list_id, tag:tag, label:label, custom_headers:custom_headers).value!
end | ruby | def add_image_with_http_info(list_id, tag:nil, label:nil, custom_headers:nil)
add_image_async(list_id, tag:tag, label:label, custom_headers:custom_headers).value!
end | [
"def",
"add_image_with_http_info",
"(",
"list_id",
",",
"tag",
":",
"nil",
",",
"label",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"add_image_async",
"(",
"list_id",
",",
"tag",
":",
"tag",
",",
"label",
":",
"label",
",",
"custom_headers",
":cus... | Add an image to the list with list Id equal to list Id passed.
@param list_id [String] List Id of the image list.
@param tag [Integer] Tag for the image.
@param label [String] The image label.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Add",
"an",
"image",
"to",
"the",
"list",
"with",
"list",
"Id",
"equal",
"to",
"list",
"Id",
"passed",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_image.rb#L61-L63 | train | Adds an image to a list. | [
30522,
13366,
5587,
1035,
3746,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2862,
1035,
8909,
1010,
6415,
1024,
9152,
2140,
1010,
3830,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
5587,
1035,
3746,
1035,
2004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_property_info_list_with_http_info | def get_property_info_list_with_http_info(name_id, include_values:false, continuation_token:nil, timeout:60, custom_headers:nil)
get_property_info_list_async(name_id, include_values:include_values, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_property_info_list_with_http_info(name_id, include_values:false, continuation_token:nil, timeout:60, custom_headers:nil)
get_property_info_list_async(name_id, include_values:include_values, continuation_token:continuation_token, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_property_info_list_with_http_info",
"(",
"name_id",
",",
"include_values",
":",
"false",
",",
"continuation_token",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_property_info_list_async",
"(",
"name_id",
",",
"inclu... | Gets information on all Service Fabric properties under a given name.
A Service Fabric name can have one or more named properties that stores
custom information. This operation gets the information about these
properties in a paged list. The information include name, value and metadata
about each of the properties.
@param name_id [String] The Service Fabric name, without the 'fabric:' URI
scheme.
@param include_values [Boolean] Allows specifying whether to include the
values of the properties returned. True if values should be returned with the
metadata; False to return only property metadata.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"information",
"on",
"all",
"Service",
"Fabric",
"properties",
"under",
"a",
"given",
"name",
"."
] | 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#L26624-L26626 | train | Gets the list of property information for a given App Service Environment. | [
30522,
13366,
2131,
1035,
3200,
1035,
18558,
1035,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2171,
1035,
8909,
1010,
2421,
1035,
5300,
1024,
6270,
1010,
13633,
1035,
19204,
1024,
9152,
2140,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/data/audit_logs.rb | Discordrb.AuditLogs.process_users | def process_users(users)
users.each do |element|
user = User.new(element, @bot)
@users[user.id] = user
end
end | ruby | def process_users(users)
users.each do |element|
user = User.new(element, @bot)
@users[user.id] = user
end
end | [
"def",
"process_users",
"(",
"users",
")",
"users",
".",
"each",
"do",
"|",
"element",
"|",
"user",
"=",
"User",
".",
"new",
"(",
"element",
",",
"@bot",
")",
"@users",
"[",
"user",
".",
"id",
"]",
"=",
"user",
"end",
"end"
] | Process user objects given by the request
@note For internal use only
@!visibility private | [
"Process",
"user",
"objects",
"given",
"by",
"the",
"request"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/audit_logs.rb#L268-L273 | train | Process users | [
30522,
13366,
2832,
1035,
5198,
1006,
5198,
1007,
5198,
1012,
2169,
2079,
1064,
5783,
1064,
5310,
1027,
5310,
1012,
2047,
1006,
5783,
1010,
1030,
28516,
1007,
1030,
5198,
1031,
5310,
1012,
8909,
1033,
1027,
5310,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rubocop-hq/rubocop | lib/rubocop/processed_source.rb | RuboCop.ProcessedSource.create_parser | def create_parser(ruby_version)
builder = RuboCop::AST::Builder.new
parser_class(ruby_version).new(builder).tap do |parser|
# On JRuby there's a risk that we hang in tokenize() if we
# don't set the all errors as fatal flag. The problem is caused by a bug
# in Racc that is discussed in issue #93 of the whitequark/parser
# project on GitHub.
parser.diagnostics.all_errors_are_fatal = (RUBY_ENGINE != 'ruby')
parser.diagnostics.ignore_warnings = false
parser.diagnostics.consumer = lambda do |diagnostic|
@diagnostics << diagnostic
end
end
end | ruby | def create_parser(ruby_version)
builder = RuboCop::AST::Builder.new
parser_class(ruby_version).new(builder).tap do |parser|
# On JRuby there's a risk that we hang in tokenize() if we
# don't set the all errors as fatal flag. The problem is caused by a bug
# in Racc that is discussed in issue #93 of the whitequark/parser
# project on GitHub.
parser.diagnostics.all_errors_are_fatal = (RUBY_ENGINE != 'ruby')
parser.diagnostics.ignore_warnings = false
parser.diagnostics.consumer = lambda do |diagnostic|
@diagnostics << diagnostic
end
end
end | [
"def",
"create_parser",
"(",
"ruby_version",
")",
"builder",
"=",
"RuboCop",
"::",
"AST",
"::",
"Builder",
".",
"new",
"parser_class",
"(",
"ruby_version",
")",
".",
"new",
"(",
"builder",
")",
".",
"tap",
"do",
"|",
"parser",
"|",
"# On JRuby there's a risk... | rubocop:enable Metrics/MethodLength | [
"rubocop",
":",
"enable",
"Metrics",
"/",
"MethodLength"
] | 2a4f4f0fdac4e1bb25891fc312af2ea60c6aa2f0 | https://github.com/rubocop-hq/rubocop/blob/2a4f4f0fdac4e1bb25891fc312af2ea60c6aa2f0/lib/rubocop/processed_source.rb#L194-L208 | train | Create a parser object | [
30522,
13366,
3443,
1035,
11968,
8043,
1006,
10090,
1035,
2544,
1007,
12508,
1027,
14548,
24163,
2361,
1024,
1024,
2004,
2102,
1024,
1024,
12508,
1012,
2047,
11968,
8043,
1035,
2465,
1006,
10090,
1035,
2544,
1007,
1012,
2047,
1006,
12508,
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_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb | Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.list_deployments_at_management_group_as_lazy | def list_deployments_at_management_group_as_lazy(management_group_id, remediation_name, query_options:nil, custom_headers:nil)
response = list_deployments_at_management_group_async(management_group_id, remediation_name, query_options:query_options, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_deployments_at_management_group_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_deployments_at_management_group_as_lazy(management_group_id, remediation_name, query_options:nil, custom_headers:nil)
response = list_deployments_at_management_group_async(management_group_id, remediation_name, query_options:query_options, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_deployments_at_management_group_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_deployments_at_management_group_as_lazy",
"(",
"management_group_id",
",",
"remediation_name",
",",
"query_options",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_deployments_at_management_group_async",
"(",
"management_group_id",
","... | Gets all deployments for a remediation at management group scope.
@param management_group_id [String] Management group ID.
@param remediation_name [String] The name of the remediation.
@param query_options [QueryOptions] Additional parameters for the operation
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RemediationDeploymentsListResult] which provide lazy access to pages
of the response. | [
"Gets",
"all",
"deployments",
"for",
"a",
"remediation",
"at",
"management",
"group",
"scope",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L3063-L3072 | train | Gets the list of deployments at management group level. | [
30522,
13366,
2862,
1035,
10813,
2015,
1035,
2012,
1035,
2968,
1035,
2177,
1035,
2004,
1035,
13971,
1006,
2968,
1035,
2177,
1035,
8909,
1010,
2128,
16969,
3508,
1035,
2171,
1010,
23032,
1035,
7047,
1024,
9152,
2140,
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... |
github/linguist | lib/linguist/heuristics.rb | Linguist.Heuristics.matches? | def matches?(filename, candidates)
filename = filename.downcase
candidates = candidates.compact.map(&:name)
@exts_and_langs.any? { |ext| filename.end_with?(ext) }
end | ruby | def matches?(filename, candidates)
filename = filename.downcase
candidates = candidates.compact.map(&:name)
@exts_and_langs.any? { |ext| filename.end_with?(ext) }
end | [
"def",
"matches?",
"(",
"filename",
",",
"candidates",
")",
"filename",
"=",
"filename",
".",
"downcase",
"candidates",
"=",
"candidates",
".",
"compact",
".",
"map",
"(",
":name",
")",
"@exts_and_langs",
".",
"any?",
"{",
"|",
"ext",
"|",
"filename",
".",... | Internal
Internal: Check if this heuristic matches the candidate filenames or
languages. | [
"Internal",
"Internal",
":",
"Check",
"if",
"this",
"heuristic",
"matches",
"the",
"candidate",
"filenames",
"or",
"languages",
"."
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/heuristics.rb#L94-L98 | train | Returns true if the filename matches the candidates. | [
30522,
13366,
3503,
1029,
1006,
5371,
18442,
1010,
5347,
1007,
5371,
18442,
1027,
5371,
18442,
1012,
2091,
18382,
5347,
1027,
5347,
1012,
9233,
1012,
4949,
1006,
1004,
1024,
2171,
1007,
1030,
4654,
3215,
1035,
1998,
1035,
11374,
2015,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.list_closed_lists_with_http_info | def list_closed_lists_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_closed_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | ruby | def list_closed_lists_with_http_info(app_id, version_id, skip:0, take:100, custom_headers:nil)
list_closed_lists_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
end | [
"def",
"list_closed_lists_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"0",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"list_closed_lists_async",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"skip",
",",
"... | Gets information about all the list entity models in a version of the
application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param skip [Integer] The number of entries to skip. Default value is 0.
@param take [Integer] The number of entries to return. Maximum page size is
500. Default is 100.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"information",
"about",
"all",
"the",
"list",
"entity",
"models",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L994-L996 | train | Gets the list of all the closed lists in a version of the application. | [
30522,
13366,
2862,
1035,
2701,
1035,
7201,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
13558,
1024,
1014,
1010,
2202,
1024,
2531,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2015-05-01-preview/generated/azure_mgmt_network/network_interfaces.rb | Azure::Network::Mgmt::V2015_05_01_preview.NetworkInterfaces.list_virtual_machine_scale_set_network_interfaces_next | def list_virtual_machine_scale_set_network_interfaces_next(next_page_link, custom_headers:nil)
response = list_virtual_machine_scale_set_network_interfaces_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_virtual_machine_scale_set_network_interfaces_next(next_page_link, custom_headers:nil)
response = list_virtual_machine_scale_set_network_interfaces_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_virtual_machine_scale_set_network_interfaces_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_virtual_machine_scale_set_network_interfaces_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
"... | The list network interface operation retrieves information about all network
interfaces in a virtual machine scale set.
@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 [NetworkInterfaceListResult] operation results. | [
"The",
"list",
"network",
"interface",
"operation",
"retrieves",
"information",
"about",
"all",
"network",
"interfaces",
"in",
"a",
"virtual",
"machine",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2015-05-01-preview/generated/azure_mgmt_network/network_interfaces.rb#L986-L989 | train | Gets the virtual machine scale set network interfaces. | [
30522,
13366,
2862,
1035,
7484,
1035,
3698,
1035,
4094,
1035,
2275,
1035,
2897,
1035,
19706,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
7484,
1035,
3698,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/auth.rb | Vault.Authenticate.userpass | def userpass(username, password, options = {})
payload = { password: password }.merge(options)
json = client.post("/v1/auth/userpass/login/#{encode_path(username)}", JSON.fast_generate(payload))
secret = Secret.decode(json)
client.token = secret.auth.client_token
return secret
end | ruby | def userpass(username, password, options = {})
payload = { password: password }.merge(options)
json = client.post("/v1/auth/userpass/login/#{encode_path(username)}", JSON.fast_generate(payload))
secret = Secret.decode(json)
client.token = secret.auth.client_token
return secret
end | [
"def",
"userpass",
"(",
"username",
",",
"password",
",",
"options",
"=",
"{",
"}",
")",
"payload",
"=",
"{",
"password",
":",
"password",
"}",
".",
"merge",
"(",
"options",
")",
"json",
"=",
"client",
".",
"post",
"(",
"\"/v1/auth/userpass/login/#{encode_... | Authenticate via the "userpass" authentication method. If authentication
is successful, the resulting token will be stored on the client and used
for future requests.
@example
Vault.auth.userpass("sethvargo", "s3kr3t") #=> #<Vault::Secret lease_id="">
@example with a custom mount point
Vault.auth.userpass("sethvargo", "s3kr3t", mount: "admin-login") #=> #<Vault::Secret lease_id="">
@param [String] username
@param [String] password
@param [Hash] options
additional options to pass to the authentication call, such as a custom
mount point
@return [Secret] | [
"Authenticate",
"via",
"the",
"userpass",
"authentication",
"method",
".",
"If",
"authentication",
"is",
"successful",
"the",
"resulting",
"token",
"will",
"be",
"stored",
"on",
"the",
"client",
"and",
"used",
"for",
"future",
"requests",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/auth.rb#L118-L124 | train | login to a user | [
30522,
13366,
5310,
15194,
1006,
5310,
18442,
1010,
20786,
1010,
7047,
1027,
1063,
1065,
1007,
18093,
1027,
1063,
20786,
1024,
20786,
1065,
1012,
13590,
1006,
7047,
1007,
1046,
3385,
1027,
7396,
1012,
2695,
1006,
1000,
1013,
1058,
2487,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/rake | lib/rake/task_manager.rb | Rake.TaskManager.tasks_in_scope | def tasks_in_scope(scope)
prefix = scope.path
tasks.select { |t|
/^#{prefix}:/ =~ t.name
}
end | ruby | def tasks_in_scope(scope)
prefix = scope.path
tasks.select { |t|
/^#{prefix}:/ =~ t.name
}
end | [
"def",
"tasks_in_scope",
"(",
"scope",
")",
"prefix",
"=",
"scope",
".",
"path",
"tasks",
".",
"select",
"{",
"|",
"t",
"|",
"/",
"#{",
"prefix",
"}",
"/",
"=~",
"t",
".",
"name",
"}",
"end"
] | List of all the tasks defined in the given scope (and its
sub-scopes). | [
"List",
"of",
"all",
"the",
"tasks",
"defined",
"in",
"the",
"given",
"scope",
"(",
"and",
"its",
"sub",
"-",
"scopes",
")",
"."
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/task_manager.rb#L167-L172 | train | Returns the tasks in the given scope | [
30522,
13366,
8518,
1035,
1999,
1035,
9531,
1006,
9531,
1007,
17576,
1027,
9531,
1012,
4130,
8518,
1012,
7276,
1063,
1064,
1056,
1064,
1013,
1034,
1001,
1063,
17576,
1065,
1024,
1013,
1027,
1066,
1056,
1012,
2171,
1065,
2203,
102,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongoid | lib/mongoid/interceptable.rb | Mongoid.Interceptable.child_callback_type | def child_callback_type(kind, child)
if kind == :update
return :create if child.new_record?
return :destroy if child.flagged_for_destroy?
kind
else
kind
end
end | ruby | def child_callback_type(kind, child)
if kind == :update
return :create if child.new_record?
return :destroy if child.flagged_for_destroy?
kind
else
kind
end
end | [
"def",
"child_callback_type",
"(",
"kind",
",",
"child",
")",
"if",
"kind",
"==",
":update",
"return",
":create",
"if",
"child",
".",
"new_record?",
"return",
":destroy",
"if",
"child",
".",
"flagged_for_destroy?",
"kind",
"else",
"kind",
"end",
"end"
] | Get the name of the callback that the child should fire. This changes
depending on whether or not the child is new. A persisted parent with a
new child would fire :update from the parent, but needs to fire :create
on the child.
@example Get the callback type.
document.child_callback_type(:update, doc)
@param [ Symbol ] kind The type of callback.
@param [ Document ] child The child document
@return [ Symbol ] The name of the callback.
@since 2.3.0 | [
"Get",
"the",
"name",
"of",
"the",
"callback",
"that",
"the",
"child",
"should",
"fire",
".",
"This",
"changes",
"depending",
"on",
"whether",
"or",
"not",
"the",
"child",
"is",
"new",
".",
"A",
"persisted",
"parent",
"with",
"a",
"new",
"child",
"would"... | 56976e32610f4c2450882b0bfe14da099f0703f4 | https://github.com/mongodb/mongoid/blob/56976e32610f4c2450882b0bfe14da099f0703f4/lib/mongoid/interceptable.rb#L213-L221 | train | Returns the callback type for a child | [
30522,
13366,
2775,
1035,
2655,
5963,
1035,
2828,
1006,
2785,
1010,
2775,
1007,
2065,
2785,
1027,
1027,
1024,
10651,
2709,
1024,
3443,
2065,
2775,
1012,
2047,
1035,
2501,
1029,
2709,
1024,
6033,
2065,
2775,
1012,
5210,
5999,
1035,
2005,
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_key_vault/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb | Azure::KeyVault::Mgmt::V2018_02_14.Vaults.list_deleted_as_lazy | def list_deleted_as_lazy(custom_headers:nil)
response = list_deleted_async(custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_deleted_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_deleted_as_lazy(custom_headers:nil)
response = list_deleted_async(custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_deleted_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_deleted_as_lazy",
"(",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_deleted_async",
"(",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"unless",
"response",
".",
"nil?",
"page",
"=",
"response",
".",
"body",
"page",
".",
"nex... | Gets information about the deleted vaults in a subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [DeletedVaultListResult] which provide lazy access to pages of the
response. | [
"Gets",
"information",
"about",
"the",
"deleted",
"vaults",
"in",
"a",
"subscription",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_key_vault/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb#L1705-L1714 | train | Gets the list of deleted resources. | [
30522,
13366,
2862,
1035,
17159,
1035,
2004,
1035,
13971,
1006,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
17159,
1035,
2004,
6038,
2278,
1006,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.import_key | def import_key(vault_base_url, key_name, key, hsm:nil, key_attributes:nil, tags:nil, custom_headers:nil)
response = import_key_async(vault_base_url, key_name, key, hsm:hsm, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def import_key(vault_base_url, key_name, key, hsm:nil, key_attributes:nil, tags:nil, custom_headers:nil)
response = import_key_async(vault_base_url, key_name, key, hsm:hsm, key_attributes:key_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"import_key",
"(",
"vault_base_url",
",",
"key_name",
",",
"key",
",",
"hsm",
":",
"nil",
",",
"key_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"import_key_async",
"(",
"vault_base_url",
... | Imports an externally created key, stores it, and returns key parameters and
attributes to the client.
The import key operation may be used to import any key type into an Azure Key
Vault. If the named key already exists, Azure Key Vault creates a new version
of the key. This operation requires the keys/import permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param key_name [String] Name for the imported key.
@param key [JsonWebKey] The Json web key
@param hsm [Boolean] Whether to import as a hardware key (HSM) or software
key.
@param key_attributes [KeyAttributes] The key management attributes.
@param tags [Hash{String => String}] Application specific metadata in the
form of key-value pairs.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [KeyBundle] operation results. | [
"Imports",
"an",
"externally",
"created",
"key",
"stores",
"it",
"and",
"returns",
"key",
"parameters",
"and",
"attributes",
"to",
"the",
"client",
"."
] | 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#L302-L305 | train | Import a key into a key group. | [
30522,
13366,
12324,
1035,
3145,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
3145,
1035,
2171,
1010,
3145,
1010,
26236,
2213,
1024,
9152,
2140,
1010,
3145,
1035,
12332,
1024,
9152,
2140,
1010,
22073,
1024,
9152,
2140,
1010,
7661,
1035... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/bolt | lib/bolt/inventory.rb | Bolt.Inventory.update_target | def update_target(target)
data = @groups.data_for(target.name)
data ||= {}
unless data['config']
@logger.debug("Did not find config for #{target.name} in inventory")
data['config'] = {}
end
data = self.class.localhost_defaults(data) if target.name == 'localhost'
# These should only get set from the inventory if they have not yet
# been instantiated
set_vars_from_hash(target.name, data['vars']) unless @target_vars[target.name]
set_facts(target.name, data['facts']) unless @target_facts[target.name]
data['features']&.each { |feature| set_feature(target, feature) } unless @target_features[target.name]
# Use Config object to ensure config section is treated consistently with config file
conf = @config.deep_clone
conf.update_from_inventory(data['config'])
conf.validate
target.update_conf(conf.transport_conf)
unless target.transport.nil? || Bolt::TRANSPORTS.include?(target.transport.to_sym)
raise Bolt::UnknownTransportError.new(target.transport, target.uri)
end
target
end | ruby | def update_target(target)
data = @groups.data_for(target.name)
data ||= {}
unless data['config']
@logger.debug("Did not find config for #{target.name} in inventory")
data['config'] = {}
end
data = self.class.localhost_defaults(data) if target.name == 'localhost'
# These should only get set from the inventory if they have not yet
# been instantiated
set_vars_from_hash(target.name, data['vars']) unless @target_vars[target.name]
set_facts(target.name, data['facts']) unless @target_facts[target.name]
data['features']&.each { |feature| set_feature(target, feature) } unless @target_features[target.name]
# Use Config object to ensure config section is treated consistently with config file
conf = @config.deep_clone
conf.update_from_inventory(data['config'])
conf.validate
target.update_conf(conf.transport_conf)
unless target.transport.nil? || Bolt::TRANSPORTS.include?(target.transport.to_sym)
raise Bolt::UnknownTransportError.new(target.transport, target.uri)
end
target
end | [
"def",
"update_target",
"(",
"target",
")",
"data",
"=",
"@groups",
".",
"data_for",
"(",
"target",
".",
"name",
")",
"data",
"||=",
"{",
"}",
"unless",
"data",
"[",
"'config'",
"]",
"@logger",
".",
"debug",
"(",
"\"Did not find config for #{target.name} in in... | Pass a target to get_targets for a public version of this
Should this reconfigure configured targets? | [
"Pass",
"a",
"target",
"to",
"get_targets",
"for",
"a",
"public",
"version",
"of",
"this",
"Should",
"this",
"reconfigure",
"configured",
"targets?"
] | 50689a33699939d262ea7c822a4b24fd8c4f8d8a | https://github.com/puppetlabs/bolt/blob/50689a33699939d262ea7c822a4b24fd8c4f8d8a/lib/bolt/inventory.rb#L197-L225 | train | Update the target object | [
30522,
13366,
10651,
1035,
4539,
1006,
4539,
1007,
2951,
1027,
1030,
2967,
1012,
2951,
1035,
2005,
1006,
4539,
1012,
2171,
1007,
2951,
1064,
1064,
1027,
1063,
1065,
4983,
2951,
1031,
1005,
9530,
8873,
2290,
1005,
1033,
30524,
1065,
2203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | railties/lib/rails/source_annotation_extractor.rb | Rails.SourceAnnotationExtractor.extract_annotations_from | def extract_annotations_from(file, pattern)
lineno = 0
result = File.readlines(file, encoding: Encoding::BINARY).inject([]) do |list, line|
lineno += 1
next list unless line =~ pattern
list << Annotation.new(lineno, $1, $2)
end
result.empty? ? {} : { file => result }
end | ruby | def extract_annotations_from(file, pattern)
lineno = 0
result = File.readlines(file, encoding: Encoding::BINARY).inject([]) do |list, line|
lineno += 1
next list unless line =~ pattern
list << Annotation.new(lineno, $1, $2)
end
result.empty? ? {} : { file => result }
end | [
"def",
"extract_annotations_from",
"(",
"file",
",",
"pattern",
")",
"lineno",
"=",
"0",
"result",
"=",
"File",
".",
"readlines",
"(",
"file",
",",
"encoding",
":",
"Encoding",
"::",
"BINARY",
")",
".",
"inject",
"(",
"[",
"]",
")",
"do",
"|",
"list",
... | If +file+ is the filename of a file that contains annotations this method returns
a hash with a single entry that maps +file+ to an array of its annotations.
Otherwise it returns an empty hash. | [
"If",
"+",
"file",
"+",
"is",
"the",
"filename",
"of",
"a",
"file",
"that",
"contains",
"annotations",
"this",
"method",
"returns",
"a",
"hash",
"with",
"a",
"single",
"entry",
"that",
"maps",
"+",
"file",
"+",
"to",
"an",
"array",
"of",
"its",
"annota... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/railties/lib/rails/source_annotation_extractor.rb#L139-L147 | train | Extract annotations from a file | [
30522,
13366,
14817,
1035,
5754,
17287,
9285,
1035,
2013,
1006,
5371,
1010,
5418,
1007,
17517,
2080,
1027,
1014,
2765,
1027,
5371,
1012,
3191,
12735,
1006,
5371,
1010,
17181,
1024,
17181,
1024,
1024,
12441,
1007,
1012,
1999,
20614,
1006,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_deleted_certificates | def get_deleted_certificates(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_deleted_certificates_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def get_deleted_certificates(vault_base_url, maxresults:nil, custom_headers:nil)
first_page = get_deleted_certificates_as_lazy(vault_base_url, maxresults:maxresults, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"get_deleted_certificates",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"get_deleted_certificates_as_lazy",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_headers",
... | Lists the deleted certificates in the specified vault currently available for
recovery.
The GetDeletedCertificates operation retrieves the certificates in the
current vault which are in a deleted state and ready for recovery or purging.
This operation includes deletion-specific information. This operation
requires the certificates/get/list permission. This operation can only be
enabled on soft-delete enabled vaults.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param maxresults [Integer] Maximum number of results to return in a page. If
not specified the service will return up to 25 results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<DeletedCertificateItem>] operation results. | [
"Lists",
"the",
"deleted",
"certificates",
"in",
"the",
"specified",
"vault",
"currently",
"available",
"for",
"recovery",
"."
] | 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#L6532-L6535 | train | Gets the deleted certificates. | [
30522,
13366,
2131,
1035,
17159,
1035,
17987,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
1027,
2131,
1035,
17159,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/job_operations.rb | Azure::Automation::Mgmt::V2015_10_31.JobOperations.get_runbook_content_with_http_info | def get_runbook_content_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers:nil)
get_runbook_content_async(resource_group_name, automation_account_name, job_id, custom_headers:custom_headers).value!
end | ruby | def get_runbook_content_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers:nil)
get_runbook_content_async(resource_group_name, automation_account_name, job_id, custom_headers:custom_headers).value!
end | [
"def",
"get_runbook_content_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"job_id",
",",
"custom_headers",
":",
"nil",
")",
"get_runbook_content_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"job_id",
",",
"cust... | Retrieve the runbook content of the job identified by job id.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param job_id [String] The job id.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Retrieve",
"the",
"runbook",
"content",
"of",
"the",
"job",
"identified",
"by",
"job",
"id",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/job_operations.rb#L157-L159 | train | Gets the runbook content of a job. | [
30522,
13366,
2131,
1035,
2448,
8654,
1035,
4180,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
3105,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
puppetlabs/puppet | lib/puppet/pops/evaluator/runtime3_converter.rb | Puppet::Pops::Evaluator.Runtime3Converter.map_args | def map_args(args, scope, undef_value)
args.map {|a| convert(a, scope, undef_value) }
end | ruby | def map_args(args, scope, undef_value)
args.map {|a| convert(a, scope, undef_value) }
end | [
"def",
"map_args",
"(",
"args",
",",
"scope",
",",
"undef_value",
")",
"args",
".",
"map",
"{",
"|",
"a",
"|",
"convert",
"(",
"a",
",",
"scope",
",",
"undef_value",
")",
"}",
"end"
] | Converts 4x supported values to a 3x values.
@param args [Array] Array of values to convert
@param scope [Puppet::Parser::Scope] The scope to use when converting
@param undef_value [Object] The value that nil is converted to
@return [Array] The converted values | [
"Converts",
"4x",
"supported",
"values",
"to",
"a",
"3x",
"values",
"."
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/pops/evaluator/runtime3_converter.rb#L48-L50 | train | Convert the given array of arguments to the correct type. | [
30522,
13366,
4949,
1035,
12098,
5620,
1006,
12098,
5620,
1010,
9531,
1010,
6151,
12879,
1035,
3643,
1007,
12098,
5620,
1012,
4949,
1063,
1064,
1037,
1064,
10463,
1006,
1037,
1010,
9531,
1010,
6151,
12879,
1035,
3643,
1007,
1065,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mislav/will_paginate | lib/will_paginate/view_helpers/action_view.rb | WillPaginate.ActionView.paginated_section | def paginated_section(*args, &block)
pagination = will_paginate(*args)
if pagination
pagination + capture(&block) + pagination
else
capture(&block)
end
end | ruby | def paginated_section(*args, &block)
pagination = will_paginate(*args)
if pagination
pagination + capture(&block) + pagination
else
capture(&block)
end
end | [
"def",
"paginated_section",
"(",
"*",
"args",
",",
"&",
"block",
")",
"pagination",
"=",
"will_paginate",
"(",
"args",
")",
"if",
"pagination",
"pagination",
"+",
"capture",
"(",
"block",
")",
"+",
"pagination",
"else",
"capture",
"(",
"block",
")",
"end",... | Wrapper for rendering pagination links at both top and bottom of a block
of content.
<% paginated_section @posts do %>
<ol id="posts">
<% for post in @posts %>
<li> ... </li>
<% end %>
</ol>
<% end %>
will result in:
<div class="pagination"> ... </div>
<ol id="posts">
...
</ol>
<div class="pagination"> ... </div>
Arguments are passed to a <tt>will_paginate</tt> call, so the same options
apply. Don't use the <tt>:id</tt> option; otherwise you'll finish with two
blocks of pagination links sharing the same ID (which is invalid HTML). | [
"Wrapper",
"for",
"rendering",
"pagination",
"links",
"at",
"both",
"top",
"and",
"bottom",
"of",
"a",
"block",
"of",
"content",
"."
] | 63e84fb7e7508231ca83d94c524bfab5fbe9a578 | https://github.com/mislav/will_paginate/blob/63e84fb7e7508231ca83d94c524bfab5fbe9a578/lib/will_paginate/view_helpers/action_view.rb#L65-L72 | train | Returns the page number for the page | [
30522,
13366,
6643,
20876,
3064,
1035,
2930,
1006,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
6643,
20876,
3508,
1027,
2097,
1035,
6643,
20876,
2618,
1006,
1008,
12098,
5620,
1007,
2065,
6643,
20876,
3508,
6643,
20876,
3508,
1009,
5425,
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... |
watir/watir | lib/watir/browser.rb | Watir.Browser.execute_script | def execute_script(script, *args)
args.map! do |e|
e.is_a?(Element) ? e.wait_until(&:exists?).wd : e
end
wrap_elements_in(self, @driver.execute_script(script, *args))
end | ruby | def execute_script(script, *args)
args.map! do |e|
e.is_a?(Element) ? e.wait_until(&:exists?).wd : e
end
wrap_elements_in(self, @driver.execute_script(script, *args))
end | [
"def",
"execute_script",
"(",
"script",
",",
"*",
"args",
")",
"args",
".",
"map!",
"do",
"|",
"e",
"|",
"e",
".",
"is_a?",
"(",
"Element",
")",
"?",
"e",
".",
"wait_until",
"(",
":exists?",
")",
".",
"wd",
":",
"e",
"end",
"wrap_elements_in",
"(",... | Executes JavaScript snippet.
If you are going to use the value snippet returns, make sure to use
`return` explicitly.
@example Check that Ajax requests are completed with jQuery
browser.execute_script("return jQuery.active") == 0
#=> true
@param [String] script JavaScript snippet to execute
@param args Arguments will be available in the given script in the 'arguments' pseudo-array | [
"Executes",
"JavaScript",
"snippet",
"."
] | 2d8db09811c6221ae401b85b2f61f5fa66e463a3 | https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/browser.rb#L216-L222 | train | Execute a script | [
30522,
13366,
15389,
1035,
5896,
1006,
5896,
1010,
1008,
12098,
5620,
1007,
12098,
5620,
1012,
4949,
999,
2079,
1064,
1041,
1064,
1041,
1012,
2003,
1035,
1037,
1029,
1006,
5783,
1007,
1029,
1041,
1012,
3524,
1035,
2127,
1006,
1004,
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... |
fastlane/fastlane | deliver/lib/deliver/runner.rb | Deliver.Runner.upload_metadata | def upload_metadata
upload_metadata = UploadMetadata.new
upload_screenshots = UploadScreenshots.new
# First, collect all the things for the HTML Report
screenshots = upload_screenshots.collect_screenshots(options)
upload_metadata.load_from_filesystem(options)
# Assign "default" values to all languages
upload_metadata.assign_defaults(options)
# Handle app icon / watch icon
prepare_app_icons(options)
# Validate
validate_html(screenshots)
# Commit
upload_metadata.upload(options)
upload_screenshots.upload(options, screenshots)
UploadPriceTier.new.upload(options)
UploadAssets.new.upload(options) # e.g. app icon
end | ruby | def upload_metadata
upload_metadata = UploadMetadata.new
upload_screenshots = UploadScreenshots.new
# First, collect all the things for the HTML Report
screenshots = upload_screenshots.collect_screenshots(options)
upload_metadata.load_from_filesystem(options)
# Assign "default" values to all languages
upload_metadata.assign_defaults(options)
# Handle app icon / watch icon
prepare_app_icons(options)
# Validate
validate_html(screenshots)
# Commit
upload_metadata.upload(options)
upload_screenshots.upload(options, screenshots)
UploadPriceTier.new.upload(options)
UploadAssets.new.upload(options) # e.g. app icon
end | [
"def",
"upload_metadata",
"upload_metadata",
"=",
"UploadMetadata",
".",
"new",
"upload_screenshots",
"=",
"UploadScreenshots",
".",
"new",
"# First, collect all the things for the HTML Report",
"screenshots",
"=",
"upload_screenshots",
".",
"collect_screenshots",
"(",
"options... | Upload all metadata, screenshots, pricing information, etc. to App Store Connect | [
"Upload",
"all",
"metadata",
"screenshots",
"pricing",
"information",
"etc",
".",
"to",
"App",
"Store",
"Connect"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/deliver/lib/deliver/runner.rb#L102-L124 | train | Upload the metadata and screenshots | [
30522,
13366,
2039,
11066,
1035,
27425,
2039,
30524,
1010,
8145,
2035,
1996,
2477,
2005,
1996,
16129,
3189,
12117,
12326,
2015,
1027,
2039,
11066,
1035,
12117,
12326,
2015,
1012,
8145,
1035,
12117,
12326,
2015,
1006,
7047,
1007,
2039,
11066,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_tde_certificates.rb | Azure::SQL::Mgmt::V2017_10_01_preview.ManagedInstanceTdeCertificates.create | def create(resource_group_name, managed_instance_name, parameters, custom_headers:nil)
response = create_async(resource_group_name, managed_instance_name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def create(resource_group_name, managed_instance_name, parameters, custom_headers:nil)
response = create_async(resource_group_name, managed_instance_name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"create",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_async",
"(",
"resource_group_name",
",",
"managed_instance_name",
",",
"parameters",
",",
"custom_headers",
"... | Creates a TDE certificate for a given server.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param managed_instance_name [String] The name of the managed instance.
@param parameters [TdeCertificate] The requested TDE certificate to be
created or updated.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Creates",
"a",
"TDE",
"certificate",
"for",
"a",
"given",
"server",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-10-01-preview/generated/azure_mgmt_sql/managed_instance_tde_certificates.rb#L39-L42 | train | Creates a managed instance. | [
30522,
13366,
3443,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
6013,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.Draw.push | def push(*what)
if what.length.zero?
primitive 'push graphic-context'
else
# to_s allows a Symbol to be used instead of a String
primitive 'push ' + what.map(&:to_s).join(' ')
end
end | ruby | def push(*what)
if what.length.zero?
primitive 'push graphic-context'
else
# to_s allows a Symbol to be used instead of a String
primitive 'push ' + what.map(&:to_s).join(' ')
end
end | [
"def",
"push",
"(",
"*",
"what",
")",
"if",
"what",
".",
"length",
".",
"zero?",
"primitive",
"'push graphic-context'",
"else",
"# to_s allows a Symbol to be used instead of a String",
"primitive",
"'push '",
"+",
"what",
".",
"map",
"(",
":to_s",
")",
".",
"join"... | Push the current set of drawing options. Also you can use
push('graphic-context') (the default if no arguments)
push('defs')
push('gradient')
push('pattern') | [
"Push",
"the",
"current",
"set",
"of",
"drawing",
"options",
".",
"Also",
"you",
"can",
"use",
"push",
"(",
"graphic",
"-",
"context",
")",
"(",
"the",
"default",
"if",
"no",
"arguments",
")",
"push",
"(",
"defs",
")",
"push",
"(",
"gradient",
")",
"... | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L498-L505 | train | Push a set of graphic - contexts to the graph. | [
30522,
13366,
5245,
1006,
1008,
2054,
1007,
2065,
2054,
1012,
3091,
1012,
5717,
1029,
10968,
1005,
5245,
8425,
1011,
6123,
1005,
2842,
1001,
2000,
1035,
1055,
4473,
1037,
6454,
2000,
2022,
2109,
2612,
1997,
1037,
5164,
10968,
1005,
5245,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.added? | def added?(attribute, type = :invalid, options = {})
attribute, type, options = normalize_arguments(attribute, type, options)
if type.is_a? Symbol
@errors.any? { |error|
error.strict_match?(attribute, type, options)
}
else
messages_for(attribute).include?(type)
end
end | ruby | def added?(attribute, type = :invalid, options = {})
attribute, type, options = normalize_arguments(attribute, type, options)
if type.is_a? Symbol
@errors.any? { |error|
error.strict_match?(attribute, type, options)
}
else
messages_for(attribute).include?(type)
end
end | [
"def",
"added?",
"(",
"attribute",
",",
"type",
"=",
":invalid",
",",
"options",
"=",
"{",
"}",
")",
"attribute",
",",
"type",
",",
"options",
"=",
"normalize_arguments",
"(",
"attribute",
",",
"type",
",",
"options",
")",
"if",
"type",
".",
"is_a?",
"... | Returns +true+ if an error on the attribute with the given message is
present, or +false+ otherwise. +message+ is treated the same as for +add+.
person.errors.add :name, :blank
person.errors.added? :name, :blank # => true
person.errors.added? :name, "can't be blank" # => true
If the error message requires options, then it returns +true+ with
the correct options, or +false+ with incorrect or missing options.
person.errors.add :name, :too_long, { count: 25 }
person.errors.added? :name, :too_long, count: 25 # => true
person.errors.added? :name, "is too long (maximum is 25 characters)" # => true
person.errors.added? :name, :too_long, count: 24 # => false
person.errors.added? :name, :too_long # => false
person.errors.added? :name, "is too long" # => false | [
"Returns",
"+",
"true",
"+",
"if",
"an",
"error",
"on",
"the",
"attribute",
"with",
"the",
"given",
"message",
"is",
"present",
"or",
"+",
"false",
"+",
"otherwise",
".",
"+",
"message",
"+",
"is",
"treated",
"the",
"same",
"as",
"for",
"+",
"add",
"... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activemodel/lib/active_model/errors.rb#L401-L411 | train | Returns true if the given attribute has been added to the list of errors. | [
30522,
13366,
2794,
1029,
1006,
17961,
1010,
2828,
1027,
1024,
19528,
1010,
7047,
1027,
1063,
1065,
1007,
17961,
1010,
2828,
1010,
7047,
1027,
3671,
4697,
1035,
9918,
1006,
17961,
1010,
2828,
1010,
7047,
1007,
2065,
2828,
1012,
2003,
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... |
jekyll/jekyll | lib/jekyll/cache.rb | Jekyll.Cache.delete | def delete(key)
@cache.delete(key)
File.delete(path_to(hash(key))) if disk_cache_enabled?
end | ruby | def delete(key)
@cache.delete(key)
File.delete(path_to(hash(key))) if disk_cache_enabled?
end | [
"def",
"delete",
"(",
"key",
")",
"@cache",
".",
"delete",
"(",
"key",
")",
"File",
".",
"delete",
"(",
"path_to",
"(",
"hash",
"(",
"key",
")",
")",
")",
"if",
"disk_cache_enabled?",
"end"
] | Remove one particular item from the cache
Returns nothing. | [
"Remove",
"one",
"particular",
"item",
"from",
"the",
"cache"
] | fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b | https://github.com/jekyll/jekyll/blob/fd74fe3e93a1fb506fa6621a2e271d7b9c5c3e3b/lib/jekyll/cache.rb#L119-L122 | train | Delete the entry from the cache. | [
30522,
13366,
3972,
12870,
1006,
3145,
1007,
1030,
17053,
1012,
3972,
12870,
1006,
3145,
1007,
5371,
1012,
3972,
12870,
1006,
4130,
1035,
2000,
1006,
23325,
1006,
3145,
1007,
1007,
1007,
2065,
9785,
1035,
17053,
1035,
9124,
1029,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cucumber/aruba | lib/aruba/platforms/command_monitor.rb | Aruba.CommandMonitor.find | def find(cmd)
cmd = cmd.commandline if cmd.respond_to? :commandline
command = registered_commands.reverse.find { |c| c.commandline == cmd }
fail CommandNotFoundError, "No command named '#{cmd}' has been started" if command.nil?
command
end | ruby | def find(cmd)
cmd = cmd.commandline if cmd.respond_to? :commandline
command = registered_commands.reverse.find { |c| c.commandline == cmd }
fail CommandNotFoundError, "No command named '#{cmd}' has been started" if command.nil?
command
end | [
"def",
"find",
"(",
"cmd",
")",
"cmd",
"=",
"cmd",
".",
"commandline",
"if",
"cmd",
".",
"respond_to?",
":commandline",
"command",
"=",
"registered_commands",
".",
"reverse",
".",
"find",
"{",
"|",
"c",
"|",
"c",
".",
"commandline",
"==",
"cmd",
"}",
"... | Find command
@yield [Command]
This yields the found command | [
"Find",
"command"
] | add17615322f575588aef1fccce875396cdf36e9 | https://github.com/cucumber/aruba/blob/add17615322f575588aef1fccce875396cdf36e9/lib/aruba/platforms/command_monitor.rb#L70-L77 | train | Find a command by its commandline | [
30522,
13366,
2424,
1006,
4642,
2094,
1007,
4642,
2094,
1027,
4642,
2094,
1012,
3094,
4179,
2065,
4642,
2094,
1012,
6869,
1035,
2000,
1029,
1024,
3094,
4179,
3094,
1027,
5068,
1035,
10954,
1012,
7901,
1012,
2424,
1063,
1064,
1039,
1064,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/workbook/worksheet/worksheet.rb | Axlsx.Worksheet.col_style | def col_style(index, style, options={})
offset = options.delete(:row_offset) || 0
cells = @rows[(offset..-1)].map { |row| row[index] }.flatten.compact
cells.each { |cell| cell.style = style }
end | ruby | def col_style(index, style, options={})
offset = options.delete(:row_offset) || 0
cells = @rows[(offset..-1)].map { |row| row[index] }.flatten.compact
cells.each { |cell| cell.style = style }
end | [
"def",
"col_style",
"(",
"index",
",",
"style",
",",
"options",
"=",
"{",
"}",
")",
"offset",
"=",
"options",
".",
"delete",
"(",
":row_offset",
")",
"||",
"0",
"cells",
"=",
"@rows",
"[",
"(",
"offset",
"..",
"-",
"1",
")",
"]",
".",
"map",
"{",... | Set the style for cells in a specific column
@param [Integer] index the index of the column
@param [Integer] style the cellXfs index
@param [Hash] options
@option [Integer] :row_offset only cells after this column will be updated.
@note You can also specify the style for specific columns in the call to add_row by using an array for the :styles option
@see Worksheet#add_row
@see README.md for an example | [
"Set",
"the",
"style",
"for",
"cells",
"in",
"a",
"specific",
"column"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/worksheet.rb#L531-L535 | train | Set the style of a column | [
30522,
13366,
8902,
1035,
2806,
1006,
5950,
1010,
2806,
1010,
7047,
1027,
1063,
1065,
1007,
16396,
1027,
7047,
1012,
3972,
12870,
1006,
1024,
5216,
1035,
16396,
1007,
1064,
1064,
1014,
4442,
1027,
1030,
10281,
1031,
1006,
16396,
1012,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb | Azure::MediaServices::Mgmt::V2018_07_01.LiveEvents.start_async | def start_async(resource_group_name, account_name, live_event_name, custom_headers:nil)
# Send request
promise = begin_start_async(resource_group_name, account_name, live_event_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | ruby | def start_async(resource_group_name, account_name, live_event_name, custom_headers:nil)
# Send request
promise = begin_start_async(resource_group_name, account_name, live_event_name, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
end
# Waiting for response.
@client.get_long_running_operation_result(response, deserialize_method)
end
promise
end | [
"def",
"start_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"live_event_name",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_start_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"live_event_name",
",",
... | @param resource_group_name [String] The name of the resource group within the
Azure subscription.
@param account_name [String] The Media Services account name.
@param live_event_name [String] The name of the Live Event.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Concurrent::Promise] promise which provides async access to http
response. | [
"@param",
"resource_group_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"resource",
"group",
"within",
"the",
"Azure",
"subscription",
".",
"@param",
"account_name",
"[",
"String",
"]",
"The",
"Media",
"Services",
"account",
"name",
".",
"@param",
"li... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/live_events.rb#L407-L421 | train | Starts a live event. | [
30522,
13366,
2707,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
2444,
1035,
2724,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
1027,
4088,
1035,
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... |
david942j/one_gadget | lib/one_gadget/helper.rb | OneGadget.Helper.comments_of_file | def comments_of_file(file)
File.readlines(file).map { |s| s[2..-1].rstrip if s.start_with?('# ') }.compact
end | ruby | def comments_of_file(file)
File.readlines(file).map { |s| s[2..-1].rstrip if s.start_with?('# ') }.compact
end | [
"def",
"comments_of_file",
"(",
"file",
")",
"File",
".",
"readlines",
"(",
"file",
")",
".",
"map",
"{",
"|",
"s",
"|",
"s",
"[",
"2",
"..",
"-",
"1",
"]",
".",
"rstrip",
"if",
"s",
".",
"start_with?",
"(",
"'# '",
")",
"}",
".",
"compact",
"e... | Fetch lines start with '#'.
@param [String] file
Filename.
@return [Array<String>]
Lines of comments. | [
"Fetch",
"lines",
"start",
"with",
"#",
"."
] | ff6ef04541e83441bfe3c2664a6febd1640f4263 | https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/helper.rb#L37-L39 | train | Returns the comments of the file | [
30522,
13366,
7928,
1035,
1997,
1035,
5371,
1006,
5371,
1007,
5371,
1012,
3191,
12735,
1006,
5371,
1007,
1012,
4949,
1063,
1064,
1055,
1064,
1055,
1031,
1016,
1012,
1012,
1011,
1015,
1033,
1012,
12667,
24901,
2065,
1055,
1012,
2707,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/xml_mini/libxml.rb | ActiveSupport.XmlMini_LibXML.parse | def parse(data)
if !data.respond_to?(:read)
data = StringIO.new(data || "")
end
if data.eof?
{}
else
LibXML::XML::Parser.io(data).parse.to_hash
end
end | ruby | def parse(data)
if !data.respond_to?(:read)
data = StringIO.new(data || "")
end
if data.eof?
{}
else
LibXML::XML::Parser.io(data).parse.to_hash
end
end | [
"def",
"parse",
"(",
"data",
")",
"if",
"!",
"data",
".",
"respond_to?",
"(",
":read",
")",
"data",
"=",
"StringIO",
".",
"new",
"(",
"data",
"||",
"\"\"",
")",
"end",
"if",
"data",
".",
"eof?",
"{",
"}",
"else",
"LibXML",
"::",
"XML",
"::",
"Par... | Parse an XML Document string or IO into a simple hash using libxml.
data::
XML Document string or IO to parse | [
"Parse",
"an",
"XML",
"Document",
"string",
"or",
"IO",
"into",
"a",
"simple",
"hash",
"using",
"libxml",
".",
"data",
"::",
"XML",
"Document",
"string",
"or",
"IO",
"to",
"parse"
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/xml_mini/libxml.rb#L14-L24 | train | Parse the XML file | [
30522,
13366,
11968,
3366,
1006,
2951,
1007,
2065,
999,
2951,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
3191,
1007,
2951,
1027,
5164,
3695,
1012,
2047,
1006,
2951,
1064,
1064,
1000,
1000,
1007,
2203,
2065,
2951,
1012,
1041,
11253,
1029,
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 | 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_service_event_list | def get_service_event_list(service_id, start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
response = get_service_event_list_async(service_id, start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_service_event_list(service_id, start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil)
response = get_service_event_list_async(service_id, start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_service_event_list",
"(",
"service_id",
",",
"start_time_utc",
",",
"end_time_utc",
",",
"timeout",
":",
"60",
",",
"events_types_filter",
":",
"nil",
",",
"exclude_analysis_events",
":",
"nil",
",",
"skip_correlation_lookup",
":",
"nil",
",",
"custom_he... | Gets a Service-related events.
The response is list of ServiceEvent objects.
@param service_id [String] The identity of the service. This is typically the
full name of the service without the 'fabric:' URI scheme.
Starting from version 6.0, hierarchical names are delimited with the "~"
character.
For example, if the service name is "fabric:/myapp/app1/svc1", the service
identity would be "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous
versions.
@param start_time_utc [String] The start time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param end_time_utc [String] The end time of a lookup query in ISO UTC
yyyy-MM-ddTHH:mm:ssZ.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param events_types_filter [String] This is a comma separated string
specifying the types of FabricEvents that should only be included in the
response.
@param exclude_analysis_events [Boolean] This param disables the retrieval of
AnalysisEvents if true is passed.
@param skip_correlation_lookup [Boolean] This param disables the search of
CorrelatedEvents information if true is passed. otherwise the
CorrelationEvents get processed and HasCorrelatedEvents field in every
FabricEvent gets populated.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Gets",
"a",
"Service",
"-",
"related",
"events",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L28197-L28200 | train | Gets the list of events for a service. | [
30522,
13366,
2131,
1035,
2326,
1035,
2724,
1035,
2862,
1006,
2326,
1035,
8909,
1010,
2707,
1035,
2051,
1035,
11396,
1010,
2203,
1035,
2051,
1035,
11396,
1010,
2051,
5833,
1024,
3438,
1010,
2824,
1035,
4127,
1035,
11307,
1024,
9152,
2140,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/v1_item.rb | SquareConnect.V1Item.visibility= | def visibility=(visibility)
validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"])
unless validator.valid?(visibility)
fail ArgumentError, "invalid value for 'visibility', must be one of #{validator.allowable_values}."
end
@visibility = visibility
end | ruby | def visibility=(visibility)
validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"])
unless validator.valid?(visibility)
fail ArgumentError, "invalid value for 'visibility', must be one of #{validator.allowable_values}."
end
@visibility = visibility
end | [
"def",
"visibility",
"=",
"(",
"visibility",
")",
"validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"PUBLIC\"",
",",
"\"PRIVATE\"",
"]",
")",
"unless",
"validator",
".",
"valid?",
"(",
"visibility",
")",
"fail",
"ArgumentErro... | Custom attribute writer method checking allowed values (enum).
@param [Object] visibility 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/v1_item.rb#L259-L265 | train | Set the visibility of the resource. | [
30522,
13366,
16476,
1027,
1006,
16476,
1007,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
2270,
1000,
1010,
1000,
2797,
1000,
1033,
1007,
4983,
9398,
8844,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.h3 | def h3(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h3_for', &block)
define_method(name) do
return platform.h3_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | ruby | def h3(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'h3_for', &block)
define_method(name) do
return platform.h3_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | [
"def",
"h3",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'h3_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
"return",
"platfor... | adds three methods - one to retrieve the text of a h3 element,
another to return a h3 element, and another to check for it's existence.
@example
h3(:title, :id => 'title')
# will generate 'title', 'title_element', and 'title?' methods
@param [Symbol] the name used for the generated methods
@param [Hash] identifier how we find a H3.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"text",
"of",
"a",
"h3",
"element",
"another",
"to",
"return",
"a",
"h3",
"element",
"and",
"another",
"to",
"check",
"for",
"it",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L702-L708 | train | Creates a new H3 object. | [
30522,
13366,
1044,
2509,
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,
1044,
2509,
1035,
2005,
1005,
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-dynamodb/lib/aws-sdk-dynamodb/resource.rb | Aws::DynamoDB.Resource.tables | def tables(options = {})
batches = Enumerator.new do |y|
resp = @client.list_tables(options)
resp.each_page do |page|
batch = []
page.data.table_names.each do |t|
batch << Table.new(
name: t,
client: @client
)
end
y.yield(batch)
end
end
Table::Collection.new(batches)
end | ruby | def tables(options = {})
batches = Enumerator.new do |y|
resp = @client.list_tables(options)
resp.each_page do |page|
batch = []
page.data.table_names.each do |t|
batch << Table.new(
name: t,
client: @client
)
end
y.yield(batch)
end
end
Table::Collection.new(batches)
end | [
"def",
"tables",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"resp",
"=",
"@client",
".",
"list_tables",
"(",
"options",
")",
"resp",
".",
"each_page",
"do",
"|",
"page",
"|",
"batch",
"=",
"["... | @example Request syntax with placeholder values
dynamo_db.tables()
@param [Hash] options ({})
@return [Table::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/resource.rb#L514-L529 | train | Returns a collection of all the tables in the cluster. | [
30522,
13366,
7251,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
24501,
2361,
1027,
1030,
7396,
1012,
2862,
1035,
7251,
1006,
7047,
1007,
24501,
2361,
1012,
2169,
1035,
3931,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/connectors.rb | Azure::CustomerInsights::Mgmt::V2017_01_01.Connectors.begin_delete_with_http_info | def begin_delete_with_http_info(resource_group_name, hub_name, connector_name, custom_headers:nil)
begin_delete_async(resource_group_name, hub_name, connector_name, custom_headers:custom_headers).value!
end | ruby | def begin_delete_with_http_info(resource_group_name, hub_name, connector_name, custom_headers:nil)
begin_delete_async(resource_group_name, hub_name, connector_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_with_http_info",
"(",
"resource_group_name",
",",
"hub_name",
",",
"connector_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_async",
"(",
"resource_group_name",
",",
"hub_name",
",",
"connector_name",
",",
"custom_headers",
":custom_head... | Deletes a connector in the hub.
@param resource_group_name [String] The name of the resource group.
@param hub_name [String] The name of the hub.
@param connector_name [String] The name of the connector.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"a",
"connector",
"in",
"the",
"hub",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/connectors.rb#L442-L444 | train | Deletes a connector from the hub. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9594,
1035,
2171,
1010,
19400,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
4088,
1035,
3972,
12870,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
square/connect-ruby-sdk | lib/square_connect/api/v1_items_api.rb | SquareConnect.V1ItemsApi.update_discount | def update_discount(location_id, discount_id, body, opts = {})
data, _status_code, _headers = update_discount_with_http_info(location_id, discount_id, body, opts)
return data
end | ruby | def update_discount(location_id, discount_id, body, opts = {})
data, _status_code, _headers = update_discount_with_http_info(location_id, discount_id, body, opts)
return data
end | [
"def",
"update_discount",
"(",
"location_id",
",",
"discount_id",
",",
"body",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"update_discount_with_http_info",
"(",
"location_id",
",",
"discount_id",
",",
"body",
",",
"opts... | UpdateDiscount
Modifies the details of an existing discount.
@param location_id The ID of the category's associated location.
@param discount_id The ID of the discount to edit.
@param body An object containing the fields to POST for the request. See the corresponding object definition for field details.
@param [Hash] opts the optional parameters
@return [V1Discount] | [
"UpdateDiscount",
"Modifies",
"the",
"details",
"of",
"an",
"existing",
"discount",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L1942-L1945 | train | Update a discount | [
30522,
13366,
10651,
1035,
19575,
1006,
3295,
1035,
8909,
1010,
19575,
1035,
8909,
1010,
2303,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
10651,
1035,
19575,
1035,
2007,
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... |
mhenrixon/sidekiq-unique-jobs | lib/sidekiq_unique_jobs/locksmith.rb | SidekiqUniqueJobs.Locksmith.lock | def lock(timeout = nil, &block)
Scripts.call(:lock, redis_pool,
keys: [exists_key, grabbed_key, available_key, UNIQUE_SET, unique_digest],
argv: [jid, ttl, lock_type])
grab_token(timeout) do |token|
touch_grabbed_token(token)
return_token_or_block_value(token, &block)
end
end | ruby | def lock(timeout = nil, &block)
Scripts.call(:lock, redis_pool,
keys: [exists_key, grabbed_key, available_key, UNIQUE_SET, unique_digest],
argv: [jid, ttl, lock_type])
grab_token(timeout) do |token|
touch_grabbed_token(token)
return_token_or_block_value(token, &block)
end
end | [
"def",
"lock",
"(",
"timeout",
"=",
"nil",
",",
"&",
"block",
")",
"Scripts",
".",
"call",
"(",
":lock",
",",
"redis_pool",
",",
"keys",
":",
"[",
"exists_key",
",",
"grabbed_key",
",",
"available_key",
",",
"UNIQUE_SET",
",",
"unique_digest",
"]",
",",
... | Create a lock for the item
@param [Integer] timeout the number of seconds to wait for a lock.
@return [String] the Sidekiq job_id (jid) | [
"Create",
"a",
"lock",
"for",
"the",
"item"
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/locksmith.rb#L58-L67 | train | Lock the connection to the server. | [
30522,
13366,
5843,
1006,
2051,
5833,
1027,
9152,
2140,
1010,
1004,
3796,
1007,
14546,
1012,
2655,
1006,
1024,
5843,
1010,
2417,
2483,
1035,
4770,
1010,
6309,
1024,
1031,
6526,
1035,
3145,
1010,
4046,
1035,
3145,
1010,
2800,
1035,
3145,
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 | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_explicit_list_item_with_http_info | def delete_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, custom_headers:nil)
delete_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:custom_headers).value!
end | ruby | def delete_explicit_list_item_with_http_info(app_id, version_id, entity_id, item_id, custom_headers:nil)
delete_explicit_list_item_async(app_id, version_id, entity_id, item_id, custom_headers:custom_headers).value!
end | [
"def",
"delete_explicit_list_item_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"item_id",
",",
"custom_headers",
":",
"nil",
")",
"delete_explicit_list_item_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"item_id",
",",
... | Delete an item from the explicit (exception) list for a Pattern.any entity in
a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The pattern.any entity id.
@param item_id [Integer] The explicit list item which will be deleted.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Delete",
"an",
"item",
"from",
"the",
"explicit",
"(",
"exception",
")",
"list",
"for",
"a",
"Pattern",
".",
"any",
"entity",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L11512-L11514 | train | Deletes an explicit list item. | [
30522,
13366,
3972,
12870,
1035,
13216,
1035,
2862,
1035,
8875,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
8875,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_event_hub/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb | Azure::EventHub::Mgmt::V2018_01_01_preview.Namespaces.list_virtual_network_rules | def list_virtual_network_rules(resource_group_name, namespace_name, custom_headers:nil)
first_page = list_virtual_network_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_virtual_network_rules(resource_group_name, namespace_name, custom_headers:nil)
first_page = list_virtual_network_rules_as_lazy(resource_group_name, namespace_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_virtual_network_rules",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_virtual_network_rules_as_lazy",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"custom_headers",
":custom_headers"... | Gets a list of VirtualNetwork rules for a Namespace.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param namespace_name [String] The Namespace name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<VirtualNetworkRule>] operation results. | [
"Gets",
"a",
"list",
"of",
"VirtualNetwork",
"rules",
"for",
"a",
"Namespace",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_hub/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb#L947-L950 | train | Gets all virtual network rules in a namespace. | [
30522,
13366,
2862,
1035,
7484,
1035,
2897,
1035,
3513,
1006,
7692,
1035,
2177,
1035,
30524,
1035,
3931,
1027,
2862,
1035,
7484,
1035,
2897,
1035,
3513,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
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_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachineScaleSets.begin_deallocate | def begin_deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
response = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_deallocate(resource_group_name, vm_scale_set_name, vm_instance_ids:nil, custom_headers:nil)
response = begin_deallocate_async(resource_group_name, vm_scale_set_name, vm_instance_ids:vm_instance_ids, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_deallocate",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_deallocate_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instanc... | Deallocates specific virtual machines in a VM scale set. Shuts down the
virtual machines and releases the compute resources. You are not billed for
the compute resources that this virtual machine scale set deallocates.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceIDs] A list of
virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusResponse] operation results. | [
"Deallocates",
"specific",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"Shuts",
"down",
"the",
"virtual",
"machines",
"and",
"releases",
"the",
"compute",
"resources",
".",
"You",
"are",
"not",
"billed",
"for",
"the",
"compute",
"resources",
... | 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_machine_scale_sets.rb#L1156-L1159 | train | Deallocate virtual machines from a virtual machine scale set. | [
30522,
13366,
4088,
1035,
3066,
4135,
16280,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
1024,
9152,
2140,
1010,
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... |
palkan/logidze | lib/logidze/model.rb | Logidze.Model.undo! | def undo!(append: Logidze.append_on_undo)
version = log_data.previous_version
return false if version.nil?
switch_to!(version.version, append: append)
end | ruby | def undo!(append: Logidze.append_on_undo)
version = log_data.previous_version
return false if version.nil?
switch_to!(version.version, append: append)
end | [
"def",
"undo!",
"(",
"append",
":",
"Logidze",
".",
"append_on_undo",
")",
"version",
"=",
"log_data",
".",
"previous_version",
"return",
"false",
"if",
"version",
".",
"nil?",
"switch_to!",
"(",
"version",
".",
"version",
",",
"append",
":",
"append",
")",
... | Restore record to the previous version.
Return false if no previous version found, otherwise return updated record. | [
"Restore",
"record",
"to",
"the",
"previous",
"version",
".",
"Return",
"false",
"if",
"no",
"previous",
"version",
"found",
"otherwise",
"return",
"updated",
"record",
"."
] | ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8 | https://github.com/palkan/logidze/blob/ffa0f793cb9c6fab96fa67a285341ca9aaa7ded8/lib/logidze/model.rb#L149-L154 | train | undo the current version of the current version | [
30522,
13366,
25672,
999,
1006,
10439,
10497,
1024,
8833,
3593,
4371,
1012,
10439,
10497,
1035,
2006,
1035,
25672,
1007,
2544,
1027,
8833,
1035,
2951,
1012,
3025,
1035,
2544,
2709,
6270,
2065,
2544,
1012,
9152,
2140,
1029,
6942,
1035,
2000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_policy/lib/2017-06-01-preview/generated/azure_mgmt_policy/policy_set_definitions.rb | Azure::Policy::Mgmt::V2017_06_01_preview.PolicySetDefinitions.list_by_management_group_as_lazy | def list_by_management_group_as_lazy(management_group_id, custom_headers:nil)
response = list_by_management_group_async(management_group_id, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_management_group_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_management_group_as_lazy(management_group_id, custom_headers:nil)
response = list_by_management_group_async(management_group_id, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_management_group_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_management_group_as_lazy",
"(",
"management_group_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_management_group_async",
"(",
"management_group_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"unless",
"response",
... | Gets all the policy set definitions for a subscription at management group.
@param management_group_id [String] The ID of the management group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [PolicySetDefinitionListResult] which provide lazy access to pages of
the response. | [
"Gets",
"all",
"the",
"policy",
"set",
"definitions",
"for",
"a",
"subscription",
"at",
"management",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy/lib/2017-06-01-preview/generated/azure_mgmt_policy/policy_set_definitions.rb#L1257-L1266 | train | Gets the list of all the policies in a management group. | [
30522,
13366,
2862,
1035,
2011,
1035,
2968,
1035,
2177,
1035,
2004,
1035,
13971,
1006,
2968,
1035,
2177,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
2968,
1035,
2177,
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... |
github-changelog-generator/github-changelog-generator | lib/github_changelog_generator/generator/generator_processor.rb | GitHubChangelogGenerator.Generator.find_issues_to_add | def find_issues_to_add(all_issues, tag_name)
all_issues.select do |issue|
if issue["milestone"].nil?
false
else
# check, that this milestone in tag list:
milestone_is_tag = @filtered_tags.find do |tag|
tag["name"] == issue["milestone"]["title"]
end
if milestone_is_tag.nil?
false
else
issue["milestone"]["title"] == tag_name
end
end
end
end | ruby | def find_issues_to_add(all_issues, tag_name)
all_issues.select do |issue|
if issue["milestone"].nil?
false
else
# check, that this milestone in tag list:
milestone_is_tag = @filtered_tags.find do |tag|
tag["name"] == issue["milestone"]["title"]
end
if milestone_is_tag.nil?
false
else
issue["milestone"]["title"] == tag_name
end
end
end
end | [
"def",
"find_issues_to_add",
"(",
"all_issues",
",",
"tag_name",
")",
"all_issues",
".",
"select",
"do",
"|",
"issue",
"|",
"if",
"issue",
"[",
"\"milestone\"",
"]",
".",
"nil?",
"false",
"else",
"# check, that this milestone in tag list:",
"milestone_is_tag",
"=",
... | Add all issues, that should be in that tag, according milestone
@param [Array] all_issues
@param [String] tag_name
@return [Array] issues with milestone #tag_name | [
"Add",
"all",
"issues",
"that",
"should",
"be",
"in",
"that",
"tag",
"according",
"milestone"
] | f18c64b5cc0d7473b059275b88385ac11ca8b564 | https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/generator/generator_processor.rb#L47-L64 | train | find issues to add | [
30522,
13366,
2424,
1035,
3314,
1035,
2000,
1035,
5587,
1006,
2035,
1035,
3314,
1010,
6415,
1035,
2171,
1007,
2035,
1035,
3314,
1012,
7276,
2079,
1064,
3277,
1064,
2065,
3277,
1031,
1000,
19199,
1000,
1033,
1012,
9152,
2140,
1029,
6270,
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... |
kpumuk/meta-tags | lib/meta_tags/renderer.rb | MetaTags.Renderer.render_alternate | def render_alternate(tags)
alternate = meta_tags.extract(:alternate)
return unless alternate
if alternate.kind_of?(Hash)
alternate.each do |hreflang, href|
tags << Tag.new(:link, rel: 'alternate', href: href, hreflang: hreflang) if href.present?
end
elsif alternate.kind_of?(Array)
alternate.each do |link_params|
tags << Tag.new(:link, { rel: 'alternate' }.with_indifferent_access.merge(link_params))
end
end
end | ruby | def render_alternate(tags)
alternate = meta_tags.extract(:alternate)
return unless alternate
if alternate.kind_of?(Hash)
alternate.each do |hreflang, href|
tags << Tag.new(:link, rel: 'alternate', href: href, hreflang: hreflang) if href.present?
end
elsif alternate.kind_of?(Array)
alternate.each do |link_params|
tags << Tag.new(:link, { rel: 'alternate' }.with_indifferent_access.merge(link_params))
end
end
end | [
"def",
"render_alternate",
"(",
"tags",
")",
"alternate",
"=",
"meta_tags",
".",
"extract",
"(",
":alternate",
")",
"return",
"unless",
"alternate",
"if",
"alternate",
".",
"kind_of?",
"(",
"Hash",
")",
"alternate",
".",
"each",
"do",
"|",
"hreflang",
",",
... | Renders alternate link tags.
@param [Array<Tag>] tags a buffer object to store tag in. | [
"Renders",
"alternate",
"link",
"tags",
"."
] | 03585f95edf96cd17024c5c155ce46ec8bc47232 | https://github.com/kpumuk/meta-tags/blob/03585f95edf96cd17024c5c155ce46ec8bc47232/lib/meta_tags/renderer.rb#L118-L131 | train | render alternate link | [
30522,
13366,
17552,
1035,
6585,
1006,
22073,
1007,
6585,
1027,
18804,
1035,
22073,
1012,
14817,
1006,
1024,
6585,
1007,
2709,
4983,
6585,
2065,
6585,
1012,
2785,
1035,
1997,
1029,
1006,
23325,
1007,
6585,
1012,
2169,
2079,
1064,
17850,
128... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/api_map.rb | Solargraph.ApiMap.get_constants | def get_constants namespace, context = ''
namespace ||= ''
cached = cache.get_constants(namespace, context)
return cached.clone unless cached.nil?
skip = []
result = []
bases = context.split('::')
while bases.length > 0
built = bases.join('::')
fqns = qualify(namespace, built)
visibility = [:public]
visibility.push :private if fqns == context
result.concat inner_get_constants(fqns, visibility, skip)
bases.pop
end
fqns = qualify(namespace, '')
visibility = [:public]
visibility.push :private if fqns == context
result.concat inner_get_constants(fqns, visibility, skip)
cache.set_constants(namespace, context, result)
result
end | ruby | def get_constants namespace, context = ''
namespace ||= ''
cached = cache.get_constants(namespace, context)
return cached.clone unless cached.nil?
skip = []
result = []
bases = context.split('::')
while bases.length > 0
built = bases.join('::')
fqns = qualify(namespace, built)
visibility = [:public]
visibility.push :private if fqns == context
result.concat inner_get_constants(fqns, visibility, skip)
bases.pop
end
fqns = qualify(namespace, '')
visibility = [:public]
visibility.push :private if fqns == context
result.concat inner_get_constants(fqns, visibility, skip)
cache.set_constants(namespace, context, result)
result
end | [
"def",
"get_constants",
"namespace",
",",
"context",
"=",
"''",
"namespace",
"||=",
"''",
"cached",
"=",
"cache",
".",
"get_constants",
"(",
"namespace",
",",
"context",
")",
"return",
"cached",
".",
"clone",
"unless",
"cached",
".",
"nil?",
"skip",
"=",
"... | Get suggestions for constants in the specified namespace. The result
may contain both constant and namespace pins.
@param namespace [String] The namespace
@param context [String] The context
@return [Array<Solargraph::Pin::Base>] | [
"Get",
"suggestions",
"for",
"constants",
"in",
"the",
"specified",
"namespace",
".",
"The",
"result",
"may",
"contain",
"both",
"constant",
"and",
"namespace",
"pins",
"."
] | 47badb5d151aca775ccbe6c470236089eae7839d | https://github.com/castwide/solargraph/blob/47badb5d151aca775ccbe6c470236089eae7839d/lib/solargraph/api_map.rb#L191-L212 | train | Get the constants for the given namespace and context. | [
30522,
13366,
2131,
1035,
5377,
2015,
3415,
15327,
1010,
6123,
1027,
1005,
1005,
3415,
15327,
1064,
1064,
1027,
1005,
1005,
17053,
2094,
1027,
17053,
1012,
2131,
1035,
5377,
2015,
1006,
3415,
15327,
1010,
6123,
1007,
2709,
17053,
2094,
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... |
rails/rails | actionpack/lib/action_dispatch/http/response.rb | ActionDispatch.Response.content_type= | def content_type=(content_type)
return unless content_type
new_header_info = parse_content_type(content_type.to_s)
prev_header_info = parsed_content_type_header
charset = new_header_info.charset || prev_header_info.charset
charset ||= self.class.default_charset unless prev_header_info.mime_type
set_content_type new_header_info.mime_type, charset
end | ruby | def content_type=(content_type)
return unless content_type
new_header_info = parse_content_type(content_type.to_s)
prev_header_info = parsed_content_type_header
charset = new_header_info.charset || prev_header_info.charset
charset ||= self.class.default_charset unless prev_header_info.mime_type
set_content_type new_header_info.mime_type, charset
end | [
"def",
"content_type",
"=",
"(",
"content_type",
")",
"return",
"unless",
"content_type",
"new_header_info",
"=",
"parse_content_type",
"(",
"content_type",
".",
"to_s",
")",
"prev_header_info",
"=",
"parsed_content_type_header",
"charset",
"=",
"new_header_info",
".",
... | Sets the HTTP response's content MIME type. For example, in the controller
you could write this:
response.content_type = "text/plain"
If a character set has been defined for this response (see charset=) then
the character set information will also be included in the content type
information. | [
"Sets",
"the",
"HTTP",
"response",
"s",
"content",
"MIME",
"type",
".",
"For",
"example",
"in",
"the",
"controller",
"you",
"could",
"write",
"this",
":"
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_dispatch/http/response.rb#L236-L243 | train | Set the content type based on the content_type parameter. | [
30522,
13366,
4180,
1035,
2828,
1027,
1006,
4180,
1035,
2828,
1007,
2709,
4983,
4180,
1035,
2828,
2047,
1035,
20346,
1035,
18558,
1027,
11968,
3366,
1035,
4180,
1035,
2828,
1006,
4180,
1035,
2828,
1012,
2000,
1035,
1055,
1007,
3653,
2615,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/vpn_gateways.rb | Azure::Network::Mgmt::V2018_07_01.VpnGateways.create_or_update | def create_or_update(resource_group_name, gateway_name, vpn_gateway_parameters, custom_headers:nil)
response = create_or_update_async(resource_group_name, gateway_name, vpn_gateway_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update(resource_group_name, gateway_name, vpn_gateway_parameters, custom_headers:nil)
response = create_or_update_async(resource_group_name, gateway_name, vpn_gateway_parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"vpn_gateway_parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_async",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"vpn_gateway_parameters",
",... | Creates a virtual wan vpn gateway if it doesn't exist else updates the
existing gateway.
@param resource_group_name [String] The resource group name of the
VpnGateway.
@param gateway_name [String] The name of the gateway.
@param vpn_gateway_parameters [VpnGateway] Parameters supplied to create or
Update a virtual wan vpn gateway.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VpnGateway] operation results. | [
"Creates",
"a",
"virtual",
"wan",
"vpn",
"gateway",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"gateway",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/vpn_gateways.rb#L133-L136 | train | Creates or updates a virtual wan vpn gateway. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11909,
1035,
2171,
1010,
21210,
2078,
1035,
11909,
1035,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
2030,
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_subscriptions/lib/2016-06-01/generated/azure_mgmt_subscriptions/subscriptions.rb | Azure::Subscriptions::Mgmt::V2016_06_01.Subscriptions.list_locations | def list_locations(subscription_id, custom_headers:nil)
response = list_locations_async(subscription_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_locations(subscription_id, custom_headers:nil)
response = list_locations_async(subscription_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_locations",
"(",
"subscription_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_locations_async",
"(",
"subscription_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
"."... | Gets all available geo-locations.
This operation provides all the locations that are available for resource
providers; however, each resource provider may support a subset of this list.
@param subscription_id [String] The ID of the target subscription.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [LocationListResult] operation results. | [
"Gets",
"all",
"available",
"geo",
"-",
"locations",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_subscriptions/lib/2016-06-01/generated/azure_mgmt_subscriptions/subscriptions.rb#L39-L42 | train | Gets the list of locations for the specified subscription. | [
30522,
13366,
2862,
1035,
5269,
1006,
15002,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
5269,
1035,
2004,
6038,
2278,
1006,
15002,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tongueroo/jets | lib/jets/router.rb | Jets.Router.check_collision! | def check_collision!
paths = self.routes.map(&:path)
collision = Jets::Resource::ApiGateway::RestApi::Routes::Collision.new
collide = collision.collision?(paths)
raise collision.exception if collide
end | ruby | def check_collision!
paths = self.routes.map(&:path)
collision = Jets::Resource::ApiGateway::RestApi::Routes::Collision.new
collide = collision.collision?(paths)
raise collision.exception if collide
end | [
"def",
"check_collision!",
"paths",
"=",
"self",
".",
"routes",
".",
"map",
"(",
":path",
")",
"collision",
"=",
"Jets",
"::",
"Resource",
"::",
"ApiGateway",
"::",
"RestApi",
"::",
"Routes",
"::",
"Collision",
".",
"new",
"collide",
"=",
"collision",
".",... | Validate routes that deployable | [
"Validate",
"routes",
"that",
"deployable"
] | 46943a519224067e58aa3e2d5656e3ca083150f9 | https://github.com/tongueroo/jets/blob/46943a519224067e58aa3e2d5656e3ca083150f9/lib/jets/router.rb#L18-L23 | train | Check if the routes are colliding with the routes | [
30522,
13366,
4638,
1035,
12365,
999,
10425,
1027,
2969,
1012,
5847,
1012,
4949,
1006,
1004,
1024,
4130,
1007,
30524,
1006,
10425,
1007,
5333,
12365,
1012,
6453,
2065,
8902,
24198,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_cdn/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb | Azure::CDN::Mgmt::V2016_10_02.Profiles.delete | def delete(resource_group_name, profile_name, custom_headers:nil)
response = delete_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, profile_name, custom_headers:nil)
response = delete_async(resource_group_name, profile_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"profile_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"profile_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Deletes an existing CDN profile with the specified parameters. Deleting a
profile will result in the deletion of all of the sub-resources including
endpoints, origins and custom domains.
@param resource_group_name [String] Name of the Resource group within the
Azure subscription.
@param profile_name [String] Name of the CDN profile which is unique within
the resource group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"an",
"existing",
"CDN",
"profile",
"with",
"the",
"specified",
"parameters",
".",
"Deleting",
"a",
"profile",
"will",
"result",
"in",
"the",
"deletion",
"of",
"all",
"of",
"the",
"sub",
"-",
"resources",
"including",
"endpoints",
"origins",
"and",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_cdn/lib/2016-10-02/generated/azure_mgmt_cdn/profiles.rb#L420-L423 | train | Deletes the specified elastic network profile. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6337,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6337,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/runner.rb | HamlLint.Runner.extract_applicable_files | def extract_applicable_files(config, options)
included_patterns = options[:files]
excluded_patterns = config['exclude']
excluded_patterns += options.fetch(:excluded_files, [])
HamlLint::FileFinder.new(config).find(included_patterns, excluded_patterns)
end | ruby | def extract_applicable_files(config, options)
included_patterns = options[:files]
excluded_patterns = config['exclude']
excluded_patterns += options.fetch(:excluded_files, [])
HamlLint::FileFinder.new(config).find(included_patterns, excluded_patterns)
end | [
"def",
"extract_applicable_files",
"(",
"config",
",",
"options",
")",
"included_patterns",
"=",
"options",
"[",
":files",
"]",
"excluded_patterns",
"=",
"config",
"[",
"'exclude'",
"]",
"excluded_patterns",
"+=",
"options",
".",
"fetch",
"(",
":excluded_files",
"... | Returns the list of files that should be linted given the specified
configuration and options.
@param config [HamlLint::Configuration]
@param options [Hash]
@return [Array<String>] | [
"Returns",
"the",
"list",
"of",
"files",
"that",
"should",
"be",
"linted",
"given",
"the",
"specified",
"configuration",
"and",
"options",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/runner.rb#L99-L105 | train | Extract the files that are applicable to the given config | [
30522,
13366,
14817,
1035,
12711,
1035,
6764,
1006,
9530,
8873,
2290,
1010,
7047,
1007,
2443,
1035,
7060,
1027,
7047,
1031,
1024,
6764,
1033,
12421,
1035,
7060,
1027,
9530,
8873,
2290,
1031,
1005,
23329,
1005,
1033,
12421,
1035,
7060,
1009,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.list_certificates_as_lazy | def list_certificates_as_lazy(resource_group_name, certificate_order_name, custom_headers:nil)
response = list_certificates_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_certificates_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_certificates_as_lazy(resource_group_name, certificate_order_name, custom_headers:nil)
response = list_certificates_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_certificates_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_certificates_as_lazy",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_certificates_async",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"custom_headers",
":custom_header... | List all certificates associated with a certificate order.
List all certificates associated with a certificate order.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param certificate_order_name [String] Name of the certificate order.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [AppServiceCertificateCollection] which provide lazy access to pages
of the response. | [
"List",
"all",
"certificates",
"associated",
"with",
"a",
"certificate",
"order",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L2639-L2648 | train | Gets the list of all the certificates in an order. | [
30522,
13366,
2862,
1035,
17987,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8196,
1035,
2344,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
17987,
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_recovery_services_backup/lib/2016-12-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb | Azure::RecoveryServicesBackup::Mgmt::V2016_12_01.ProtectionContainers.inquire_with_http_info | def inquire_with_http_info(vault_name, resource_group_name, fabric_name, container_name, filter:nil, custom_headers:nil)
inquire_async(vault_name, resource_group_name, fabric_name, container_name, filter:filter, custom_headers:custom_headers).value!
end | ruby | def inquire_with_http_info(vault_name, resource_group_name, fabric_name, container_name, filter:nil, custom_headers:nil)
inquire_async(vault_name, resource_group_name, fabric_name, container_name, filter:filter, custom_headers:custom_headers).value!
end | [
"def",
"inquire_with_http_info",
"(",
"vault_name",
",",
"resource_group_name",
",",
"fabric_name",
",",
"container_name",
",",
"filter",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"inquire_async",
"(",
"vault_name",
",",
"resource_group_name",
",",
"fabric... | Inquires all the protectable item in the given container that can be
protected.
Inquires all the protectable items that are protectable under the given
container.
@param vault_name [String] The name of the recovery services vault.
@param resource_group_name [String] The name of the resource group where the
recovery services vault is present.
@param fabric_name [String] Fabric Name associated with the container.
@param container_name [String] Name of the container in which inquiry needs
to be triggered.
@param filter [String] OData filter options.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Inquires",
"all",
"the",
"protectable",
"item",
"in",
"the",
"given",
"container",
"that",
"can",
"be",
"protected",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_backup/lib/2016-12-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb#L406-L408 | train | Inquire a container from the specified vault. | [
30522,
13366,
1999,
15549,
2890,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
8313,
1035,
2171,
1010,
11661,
1035,
2171,
1010,
11307,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb | Azure::IotHub::Mgmt::V2017_01_19.IotHubResource.get_quota_metrics_as_lazy | def get_quota_metrics_as_lazy(resource_group_name, resource_name, custom_headers:nil)
response = get_quota_metrics_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
get_quota_metrics_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def get_quota_metrics_as_lazy(resource_group_name, resource_name, custom_headers:nil)
response = get_quota_metrics_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
get_quota_metrics_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"get_quota_metrics_as_lazy",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_quota_metrics_async",
"(",
"resource_group_name",
",",
"resource_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Get the quota metrics for an IoT hub.
Get the quota metrics for an IoT hub.
@param resource_group_name [String] The name of the resource group that
contains the IoT hub.
@param resource_name [String] The name of the IoT hub.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [IotHubQuotaMetricInfoListResult] which provide lazy access to pages
of the response. | [
"Get",
"the",
"quota",
"metrics",
"for",
"an",
"IoT",
"hub",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_iot_hub/lib/2017-01-19/generated/azure_mgmt_iot_hub/iot_hub_resource.rb#L3028-L3037 | train | Gets the quota metrics for a resource. | [
30522,
13366,
2131,
1035,
20563,
1035,
12046,
2015,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7692,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
20563,
1035,
12046,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/v1_fee.rb | SquareConnect.V1Fee.inclusion_type= | def inclusion_type=(inclusion_type)
validator = EnumAttributeValidator.new('String', ["ADDITIVE", "INCLUSIVE"])
unless validator.valid?(inclusion_type)
fail ArgumentError, "invalid value for 'inclusion_type', must be one of #{validator.allowable_values}."
end
@inclusion_type = inclusion_type
end | ruby | def inclusion_type=(inclusion_type)
validator = EnumAttributeValidator.new('String', ["ADDITIVE", "INCLUSIVE"])
unless validator.valid?(inclusion_type)
fail ArgumentError, "invalid value for 'inclusion_type', must be one of #{validator.allowable_values}."
end
@inclusion_type = inclusion_type
end | [
"def",
"inclusion_type",
"=",
"(",
"inclusion_type",
")",
"validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"ADDITIVE\"",
",",
"\"INCLUSIVE\"",
"]",
")",
"unless",
"validator",
".",
"valid?",
"(",
"inclusion_type",
")",
"fail",... | Custom attribute writer method checking allowed values (enum).
@param [Object] inclusion_type 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/v1_fee.rb#L192-L198 | train | Set the inclusion type of the record. | [
30522,
13366,
10502,
1035,
2828,
1027,
1006,
10502,
1035,
2828,
1007,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
29167,
1000,
1010,
1000,
18678,
1000,
1033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_secrets_as_lazy_with_http_info | def get_secrets_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | ruby | def get_secrets_as_lazy_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_secrets_as_lazy_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | [
"def",
"get_secrets_as_lazy_with_http_info",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_secrets_as_lazy_async",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_headers",
":custom_headers",
... | List secrets in a specified key vault.
The Get Secrets operation is applicable to the entire vault. However, only
the base secret identifier and its attributes are provided in the response.
Individual secret versions are not listed in the response. This operation
requires the secrets/list permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param maxresults [Integer] Maximum number of results to return in a page. If
not specified, the service will return up to 25 results.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"List",
"secrets",
"in",
"a",
"specified",
"key",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L9822-L9824 | train | Gets the secrets for the specified vault. | [
30522,
13366,
2131,
1035,
7800,
1035,
2004,
1035,
13971,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
4098,
6072,
11314,
2015,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.