repo stringclasses 237 values | path stringlengths 11 168 | func_name stringlengths 10 147 | original_string stringlengths 79 124k | language stringclasses 1 value | code stringlengths 79 124k | code_tokens listlengths 16 45.3k | docstring stringlengths 4 23.5k | docstring_tokens listlengths 1 452 | sha stringclasses 237 values | url stringlengths 95 268 | partition stringclasses 1 value | summary stringlengths 8 229 | input_ids listlengths 502 502 | token_type_ids listlengths 502 502 | attention_mask listlengths 502 502 | labels listlengths 502 502 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisruntime/lib/2.0/generated/azure_cognitiveservices_luisruntime/prediction.rb | Azure::CognitiveServices::LuisRuntime::V2_0.Prediction.resolve_with_http_info | def resolve_with_http_info(app_id, query, timezone_offset:nil, verbose:nil, staging:nil, spell_check:nil, bing_spell_check_subscription_key:nil, log:nil, custom_headers:nil)
resolve_async(app_id, query, timezone_offset:timezone_offset, verbose:verbose, staging:staging, spell_check:spell_check, bing_spell_check_subscription_key:bing_spell_check_subscription_key, log:log, custom_headers:custom_headers).value!
end | ruby | def resolve_with_http_info(app_id, query, timezone_offset:nil, verbose:nil, staging:nil, spell_check:nil, bing_spell_check_subscription_key:nil, log:nil, custom_headers:nil)
resolve_async(app_id, query, timezone_offset:timezone_offset, verbose:verbose, staging:staging, spell_check:spell_check, bing_spell_check_subscription_key:bing_spell_check_subscription_key, log:log, custom_headers:custom_headers).value!
end | [
"def",
"resolve_with_http_info",
"(",
"app_id",
",",
"query",
",",
"timezone_offset",
":",
"nil",
",",
"verbose",
":",
"nil",
",",
"staging",
":",
"nil",
",",
"spell_check",
":",
"nil",
",",
"bing_spell_check_subscription_key",
":",
"nil",
",",
"log",
":",
"... | Gets predictions for a given utterance, in the form of intents and entities.
The current maximum query size is 500 characters.
@param app_id The LUIS application ID (Guid).
@param query [String] The utterance to predict.
@param timezone_offset [Float] The timezone offset for the location of the
request.
@param verbose [Boolean] If true, return all intents instead of just the top
scoring intent.
@param staging [Boolean] Use the staging endpoint slot.
@param spell_check [Boolean] Enable spell checking.
@param bing_spell_check_subscription_key [String] The subscription key to use
when enabling Bing spell check
@param log [Boolean] Log query (default is true)
@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",
"predictions",
"for",
"a",
"given",
"utterance",
"in",
"the",
"form",
"of",
"intents",
"and",
"entities",
".",
"The",
"current",
"maximum",
"query",
"size",
"is",
"500",
"characters",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisruntime/lib/2.0/generated/azure_cognitiveservices_luisruntime/prediction.rb#L69-L71 | train | Resolve an App Id Query to a list of documents. | [
30522,
13366,
10663,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
23032,
1010,
2051,
15975,
1035,
16396,
1024,
9152,
2140,
1010,
12034,
9232,
1024,
9152,
2140,
1010,
15308,
1024,
9152,
2140,
1010,
6297,
1035,
4638,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_definitions.rb | Azure::Authorization::Mgmt::V2015_07_01.RoleDefinitions.create_or_update_with_http_info | def create_or_update_with_http_info(scope, role_definition_id, role_definition, custom_headers:nil)
create_or_update_async(scope, role_definition_id, role_definition, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(scope, role_definition_id, role_definition, custom_headers:nil)
create_or_update_async(scope, role_definition_id, role_definition, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"scope",
",",
"role_definition_id",
",",
"role_definition",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"scope",
",",
"role_definition_id",
",",
"role_definition",
",",
"custom_headers",
":custom_he... | Creates or updates a role definition.
@param scope [String] The scope of the role definition.
@param role_definition_id [String] The ID of the role definition.
@param role_definition [RoleDefinition] The values for the role definition.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"a",
"role",
"definition",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_authorization/lib/2015-07-01/generated/azure_mgmt_authorization/role_definitions.rb#L239-L241 | train | Creates or updates a role definition. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
9531,
1010,
2535,
1035,
6210,
1035,
8909,
1010,
2535,
1035,
6210,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3443,
1035,
2030,
1035,
10651,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
petergoldstein/dalli | lib/dalli/client.rb | Dalli.Client.add | def add(key, value, ttl=nil, options=nil)
perform(:add, key, value, ttl_or_default(ttl), options)
end | ruby | def add(key, value, ttl=nil, options=nil)
perform(:add, key, value, ttl_or_default(ttl), options)
end | [
"def",
"add",
"(",
"key",
",",
"value",
",",
"ttl",
"=",
"nil",
",",
"options",
"=",
"nil",
")",
"perform",
"(",
":add",
",",
"key",
",",
"value",
",",
"ttl_or_default",
"(",
"ttl",
")",
",",
"options",
")",
"end"
] | Conditionally add a key/value pair, if the key does not already exist
on the server. Returns truthy if the operation succeeded. | [
"Conditionally",
"add",
"a",
"key",
"/",
"value",
"pair",
"if",
"the",
"key",
"does",
"not",
"already",
"exist",
"on",
"the",
"server",
".",
"Returns",
"truthy",
"if",
"the",
"operation",
"succeeded",
"."
] | 5755dbfd06e333a8239f976d4b10492b4555b726 | https://github.com/petergoldstein/dalli/blob/5755dbfd06e333a8239f976d4b10492b4555b726/lib/dalli/client.rb#L136-L138 | train | Add a value to the cache. | [
30522,
13366,
5587,
1006,
3145,
1010,
3643,
1010,
23746,
2140,
1027,
9152,
2140,
1010,
7047,
1027,
9152,
2140,
1007,
4685,
1006,
1024,
5587,
1010,
3145,
1010,
3643,
1010,
23746,
2140,
1035,
2030,
1035,
12398,
1006,
23746,
2140,
1007,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | runtime/ms_rest/lib/ms_rest/deserialization_error.rb | MsRest.DeserializationError.to_json | def to_json(*a)
{exception_message: exception_message, message: @msg, stacktrace: exception_stacktrace, result: result}.to_json(*a)
end | ruby | def to_json(*a)
{exception_message: exception_message, message: @msg, stacktrace: exception_stacktrace, result: result}.to_json(*a)
end | [
"def",
"to_json",
"(",
"*",
"a",
")",
"{",
"exception_message",
":",
"exception_message",
",",
"message",
":",
"@msg",
",",
"stacktrace",
":",
"exception_stacktrace",
",",
"result",
":",
"result",
"}",
".",
"to_json",
"(",
"a",
")",
"end"
] | Creates and initialize new instance of the DeserializationError class.
@param [String] message message the human readable description of error.
@param [String] exception_message the inner exception stacktrace.
@param [String] exception_stacktrace the inner exception stacktrace.
@param [MsRest::HttpOperationResponse] the request and response | [
"Creates",
"and",
"initialize",
"new",
"instance",
"of",
"the",
"DeserializationError",
"class",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/runtime/ms_rest/lib/ms_rest/deserialization_error.rb#L34-L36 | train | Returns a JSON representation of the exception. | [
30522,
13366,
2000,
1035,
1046,
3385,
1006,
1008,
1037,
1007,
1063,
6453,
1035,
4471,
1024,
6453,
1035,
4471,
1010,
4471,
1024,
1030,
5796,
2290,
1010,
9991,
6494,
3401,
1024,
6453,
1035,
9991,
6494,
3401,
1010,
2765,
1024,
2765,
1065,
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... |
ffaker/ffaker | lib/ffaker/name_gr.rb | FFaker.NameGR.full_name | def full_name(gender = :any)
case gender
when :any then rand(0..1) == 0 ? male_full_name : female_full_name
when :male then male_full_name
when :female then female_full_name
else raise ArgumentError, 'Invalid gender, must be one of :any, :male, :female'
end
end | ruby | def full_name(gender = :any)
case gender
when :any then rand(0..1) == 0 ? male_full_name : female_full_name
when :male then male_full_name
when :female then female_full_name
else raise ArgumentError, 'Invalid gender, must be one of :any, :male, :female'
end
end | [
"def",
"full_name",
"(",
"gender",
"=",
":any",
")",
"case",
"gender",
"when",
":any",
"then",
"rand",
"(",
"0",
"..",
"1",
")",
"==",
"0",
"?",
"male_full_name",
":",
"female_full_name",
"when",
":male",
"then",
"male_full_name",
"when",
":female",
"then"... | Random full name (male or female). Arguments :male, :female, :any | [
"Random",
"full",
"name",
"(",
"male",
"or",
"female",
")",
".",
"Arguments",
":",
"male",
":",
"female",
":",
"any"
] | 9570ac54874fec66a99b9c86401fb878f1e3e951 | https://github.com/ffaker/ffaker/blob/9570ac54874fec66a99b9c86401fb878f1e3e951/lib/ffaker/name_gr.rb#L10-L17 | train | Returns the full name of the given gender. | [
30522,
13366,
2440,
1035,
2171,
1006,
5907,
1027,
1024,
2151,
1007,
2553,
5907,
2043,
1024,
2151,
2059,
14566,
1006,
1014,
1012,
1012,
1015,
1007,
1027,
1027,
1014,
1029,
3287,
1035,
2440,
1035,
2171,
1024,
2931,
1035,
2440,
30524,
2028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.delete | def delete(scope, event_subscription_name, custom_headers:nil)
response = delete_async(scope, event_subscription_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(scope, event_subscription_name, custom_headers:nil)
response = delete_async(scope, event_subscription_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"scope",
",",
"event_subscription_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"scope",
",",
"event_subscription_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"end"
] | Delete an event subscription
Delete an existing event subscription
@param scope [String] The scope of the event subscription. The scope can be a
subscription, or a resource group, or a top level resource belonging to a
resource provider namespace, or an EventGrid topic. For example, use
'/subscriptions/{subscriptionId}/' for a subscription,
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for a
resource group, and
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}'
for a resource, and
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}'
for an EventGrid topic.
@param event_subscription_name [String] Name of the event subscription
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"an",
"event",
"subscription"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_grid/lib/2018-01-01/generated/azure_mgmt_event_grid/event_subscriptions.rb#L241-L244 | train | Deletes an event subscription. | [
30522,
13366,
3972,
12870,
1006,
9531,
1010,
2724,
1035,
15002,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
2278,
1006,
9531,
1010,
2724,
1035,
15002,
1035,
2171,
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... |
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.cancel_repair_task | def cancel_repair_task(repair_task_cancel_description, custom_headers:nil)
response = cancel_repair_task_async(repair_task_cancel_description, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def cancel_repair_task(repair_task_cancel_description, custom_headers:nil)
response = cancel_repair_task_async(repair_task_cancel_description, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"cancel_repair_task",
"(",
"repair_task_cancel_description",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"cancel_repair_task_async",
"(",
"repair_task_cancel_description",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"... | Requests the cancellation of the given repair task.
This API supports the Service Fabric platform; it is not meant to be used
directly from your code.
@param repair_task_cancel_description [RepairTaskCancelDescription] Describes
the repair task to be cancelled.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RepairTaskUpdateInfo] operation results. | [
"Requests",
"the",
"cancellation",
"of",
"the",
"given",
"repair",
"task",
"."
] | 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#L13776-L13779 | train | Cancels a repair task. | [
30522,
13366,
17542,
1035,
7192,
1035,
4708,
1006,
7192,
1035,
4708,
1035,
17542,
1035,
6412,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
17542,
1035,
7192,
1035,
4708,
1035,
2004,
6038,
2278,
1006,
7192,
1035,
4708,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vagrant | lib/vagrant/batch_action.rb | Vagrant.BatchAction.run | def run
par = false
if @allow_parallel
par = true
@logger.info("Enabling parallelization by default.")
end
if par
@actions.each do |machine, _, _|
if !machine.provider_options[:parallel]
@logger.info("Disabling parallelization because provider doesn't support it: #{machine.provider_name}")
par = false
break
end
end
end
if par && @actions.length <= 1
@logger.info("Disabling parallelization because only executing one action")
par = false
end
@logger.info("Batch action will parallelize: #{par.inspect}")
threads = []
@actions.each do |machine, action, options|
@logger.info("Starting action: #{machine} #{action} #{options}")
# Create the new thread to run our action. This is basically just
# calling the action but also contains some error handling in it
# as well.
thread = Thread.new do
Thread.current[:error] = nil
# Record our pid when we started in order to figure out if
# we've forked...
start_pid = Process.pid
begin
if action.is_a?(Proc)
action.call(machine)
else
machine.send(:action, action, options)
end
rescue Exception => e
# If we're not parallelizing, then raise the error. We also
# don't raise the error if we've forked, because it'll hang
# the process.
raise if !par && Process.pid == start_pid
# Store the exception that will be processed later
Thread.current[:error] = e
# We can only do the things below if we do not fork, otherwise
# it'll hang the process.
if Process.pid == start_pid
# Let the user know that this process had an error early
# so that they see it while other things are happening.
machine.ui.error(I18n.t("vagrant.general.batch_notify_error"))
end
end
# If we forked during the process run, we need to do a hard
# exit here. Ruby's fork only copies the running process (which
# would be us), so if we return from this thread, it results
# in a zombie Ruby process.
if Process.pid != start_pid
# We forked.
exit_status = true
if Thread.current[:error]
# We had an error, print the stack trace and exit immediately.
exit_status = false
error = Thread.current[:error]
@logger.error(error.inspect)
@logger.error(error.message)
@logger.error(error.backtrace.join("\n"))
end
Process.exit!(exit_status)
end
end
# Set some attributes on the thread for later
thread[:machine] = machine
if !par
thread.join(THREAD_MAX_JOIN_TIMEOUT) while thread.alive?
end
threads << thread
end
errors = []
threads.each do |thread|
# Wait for the thread to complete
thread.join(THREAD_MAX_JOIN_TIMEOUT) while thread.alive?
# If the thread had an error, then store the error to show later
if thread[:error]
e = thread[:error]
# If the error isn't a Vagrant error, then store the backtrace
# as well.
if !thread[:error].is_a?(Errors::VagrantError)
e = thread[:error]
message = e.message
message += "\n"
message += "\n#{e.backtrace.join("\n")}"
errors << I18n.t("vagrant.general.batch_unexpected_error",
machine: thread[:machine].name,
message: message)
else
errors << I18n.t("vagrant.general.batch_vagrant_error",
machine: thread[:machine].name,
message: thread[:error].message)
end
end
end
if !errors.empty?
raise Errors::BatchMultiError, message: errors.join("\n\n")
end
end | ruby | def run
par = false
if @allow_parallel
par = true
@logger.info("Enabling parallelization by default.")
end
if par
@actions.each do |machine, _, _|
if !machine.provider_options[:parallel]
@logger.info("Disabling parallelization because provider doesn't support it: #{machine.provider_name}")
par = false
break
end
end
end
if par && @actions.length <= 1
@logger.info("Disabling parallelization because only executing one action")
par = false
end
@logger.info("Batch action will parallelize: #{par.inspect}")
threads = []
@actions.each do |machine, action, options|
@logger.info("Starting action: #{machine} #{action} #{options}")
# Create the new thread to run our action. This is basically just
# calling the action but also contains some error handling in it
# as well.
thread = Thread.new do
Thread.current[:error] = nil
# Record our pid when we started in order to figure out if
# we've forked...
start_pid = Process.pid
begin
if action.is_a?(Proc)
action.call(machine)
else
machine.send(:action, action, options)
end
rescue Exception => e
# If we're not parallelizing, then raise the error. We also
# don't raise the error if we've forked, because it'll hang
# the process.
raise if !par && Process.pid == start_pid
# Store the exception that will be processed later
Thread.current[:error] = e
# We can only do the things below if we do not fork, otherwise
# it'll hang the process.
if Process.pid == start_pid
# Let the user know that this process had an error early
# so that they see it while other things are happening.
machine.ui.error(I18n.t("vagrant.general.batch_notify_error"))
end
end
# If we forked during the process run, we need to do a hard
# exit here. Ruby's fork only copies the running process (which
# would be us), so if we return from this thread, it results
# in a zombie Ruby process.
if Process.pid != start_pid
# We forked.
exit_status = true
if Thread.current[:error]
# We had an error, print the stack trace and exit immediately.
exit_status = false
error = Thread.current[:error]
@logger.error(error.inspect)
@logger.error(error.message)
@logger.error(error.backtrace.join("\n"))
end
Process.exit!(exit_status)
end
end
# Set some attributes on the thread for later
thread[:machine] = machine
if !par
thread.join(THREAD_MAX_JOIN_TIMEOUT) while thread.alive?
end
threads << thread
end
errors = []
threads.each do |thread|
# Wait for the thread to complete
thread.join(THREAD_MAX_JOIN_TIMEOUT) while thread.alive?
# If the thread had an error, then store the error to show later
if thread[:error]
e = thread[:error]
# If the error isn't a Vagrant error, then store the backtrace
# as well.
if !thread[:error].is_a?(Errors::VagrantError)
e = thread[:error]
message = e.message
message += "\n"
message += "\n#{e.backtrace.join("\n")}"
errors << I18n.t("vagrant.general.batch_unexpected_error",
machine: thread[:machine].name,
message: message)
else
errors << I18n.t("vagrant.general.batch_vagrant_error",
machine: thread[:machine].name,
message: thread[:error].message)
end
end
end
if !errors.empty?
raise Errors::BatchMultiError, message: errors.join("\n\n")
end
end | [
"def",
"run",
"par",
"=",
"false",
"if",
"@allow_parallel",
"par",
"=",
"true",
"@logger",
".",
"info",
"(",
"\"Enabling parallelization by default.\"",
")",
"end",
"if",
"par",
"@actions",
".",
"each",
"do",
"|",
"machine",
",",
"_",
",",
"_",
"|",
"if",
... | Run all the queued up actions, parallelizing if possible.
This will parallelize if and only if the provider of every machine
supports parallelization and parallelization is possible from
initialization of the class. | [
"Run",
"all",
"the",
"queued",
"up",
"actions",
"parallelizing",
"if",
"possible",
"."
] | c22a145c59790c098f95d50141d9afb48e1ef55f | https://github.com/hashicorp/vagrant/blob/c22a145c59790c098f95d50141d9afb48e1ef55f/lib/vagrant/batch_action.rb#L39-L163 | train | Run the batch action | [
30522,
13366,
2448,
11968,
1027,
6270,
2065,
1030,
3499,
1035,
5903,
11968,
1027,
2995,
1030,
8833,
4590,
1012,
18558,
1006,
1000,
12067,
5903,
3989,
2011,
12398,
1012,
1000,
1007,
2203,
2065,
11968,
1030,
4506,
1012,
2169,
2079,
1064,
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... |
square/connect-ruby-sdk | lib/square_connect/api/transactions_api.rb | SquareConnect.TransactionsApi.list_refunds | def list_refunds(location_id, opts = {})
data, _status_code, _headers = list_refunds_with_http_info(location_id, opts)
return data
end | ruby | def list_refunds(location_id, opts = {})
data, _status_code, _headers = list_refunds_with_http_info(location_id, opts)
return data
end | [
"def",
"list_refunds",
"(",
"location_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"list_refunds_with_http_info",
"(",
"location_id",
",",
"opts",
")",
"return",
"data",
"end"
] | ListRefunds
Lists refunds for one of a business's locations. In addition to full or partial tender refunds processed through Square APIs, refunds may result from itemized returns or exchanges through Square's Point of Sale applications. Refunds with a `status` of `PENDING` are not currently included in this endpoint's response. Max results per [page](#paginatingresults): 50
@param location_id The ID of the location to list refunds for.
@param [Hash] opts the optional parameters
@option opts [String] :begin_time The beginning of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time minus one year.
@option opts [String] :end_time The end of the requested reporting period, in RFC 3339 format. See [Date ranges](#dateranges) for details on date inclusivity/exclusivity. Default value: The current time.
@option opts [String] :sort_order The order in which results are listed in the response (`ASC` for oldest first, `DESC` for newest first). Default value: `DESC`
@option opts [String] :cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](/basics/api101/pagination) for more information.
@return [ListRefundsResponse] | [
"ListRefunds",
"Lists",
"refunds",
"for",
"one",
"of",
"a",
"business",
"s",
"locations",
".",
"In",
"addition",
"to",
"full",
"or",
"partial",
"tender",
"refunds",
"processed",
"through",
"Square",
"APIs",
"refunds",
"may",
"result",
"from",
"itemized",
"retu... | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/transactions_api.rb#L210-L213 | train | Returns a list of all refunds for a location | [
30522,
13366,
2862,
1035,
25416,
26698,
1006,
3295,
1035,
8909,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
2862,
1035,
25416,
26698,
1035,
2007,
1035,
8299,
1035,
18558,
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... |
rails/rails | actionview/lib/action_view/template/resolver.rb | ActionView.Resolver.find_all | def find_all(name, prefix = nil, partial = false, details = {}, key = nil, locals = [])
locals = locals.map(&:to_s).sort!.freeze
cached(key, [name, prefix, partial], details, locals) do
_find_all(name, prefix, partial, details, key, locals)
end
end | ruby | def find_all(name, prefix = nil, partial = false, details = {}, key = nil, locals = [])
locals = locals.map(&:to_s).sort!.freeze
cached(key, [name, prefix, partial], details, locals) do
_find_all(name, prefix, partial, details, key, locals)
end
end | [
"def",
"find_all",
"(",
"name",
",",
"prefix",
"=",
"nil",
",",
"partial",
"=",
"false",
",",
"details",
"=",
"{",
"}",
",",
"key",
"=",
"nil",
",",
"locals",
"=",
"[",
"]",
")",
"locals",
"=",
"locals",
".",
"map",
"(",
":to_s",
")",
".",
"sor... | Normalizes the arguments and passes it on to find_templates. | [
"Normalizes",
"the",
"arguments",
"and",
"passes",
"it",
"on",
"to",
"find_templates",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionview/lib/action_view/template/resolver.rb#L117-L123 | train | Find all resources | [
30522,
13366,
2424,
1035,
2035,
1006,
2171,
1010,
17576,
1027,
9152,
2140,
1010,
7704,
1027,
6270,
1010,
4751,
1027,
1063,
1065,
1010,
3145,
1027,
9152,
2140,
1010,
10575,
1027,
1031,
1033,
1007,
10575,
1027,
10575,
1012,
4949,
1006,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/data_criteria_helpers/dc_post_processing.rb | HQMF2.DataCriteriaPostProcessing.extract_code_list_path_and_result_value | def extract_code_list_path_and_result_value
if @template_ids.empty? && @specific_occurrence
template = @entry.document.at_xpath(
"//cda:id[@root='#{@source_data_criteria_root}' and @extension='#{@source_data_criteria_extension}']/../cda:templateId/cda:item/@root")
if template
mapping = ValueSetHelper.get_mapping_for_template(template.to_s)
handle_mapping_template(mapping)
end
end
@template_ids.each do |t|
mapping = ValueSetHelper.get_mapping_for_template(t)
handle_mapping_template(mapping)
break if mapping # quit if one template id with a mapping has set these values
end
end | ruby | def extract_code_list_path_and_result_value
if @template_ids.empty? && @specific_occurrence
template = @entry.document.at_xpath(
"//cda:id[@root='#{@source_data_criteria_root}' and @extension='#{@source_data_criteria_extension}']/../cda:templateId/cda:item/@root")
if template
mapping = ValueSetHelper.get_mapping_for_template(template.to_s)
handle_mapping_template(mapping)
end
end
@template_ids.each do |t|
mapping = ValueSetHelper.get_mapping_for_template(t)
handle_mapping_template(mapping)
break if mapping # quit if one template id with a mapping has set these values
end
end | [
"def",
"extract_code_list_path_and_result_value",
"if",
"@template_ids",
".",
"empty?",
"&&",
"@specific_occurrence",
"template",
"=",
"@entry",
".",
"document",
".",
"at_xpath",
"(",
"\"//cda:id[@root='#{@source_data_criteria_root}' and @extension='#{@source_data_criteria_extension}... | Extract the code_list_xpath and the criteria's value from either the location related to the specific occurrence,
or from any of the template ids (if multiple exist) | [
"Extract",
"the",
"code_list_xpath",
"and",
"the",
"criteria",
"s",
"value",
"from",
"either",
"the",
"location",
"related",
"to",
"the",
"specific",
"occurrence",
"or",
"from",
"any",
"of",
"the",
"template",
"ids",
"(",
"if",
"multiple",
"exist",
")"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/data_criteria_helpers/dc_post_processing.rb#L24-L38 | train | Extract the code list path and result value from the entry | [
30522,
13366,
14817,
1035,
3642,
1035,
2862,
1035,
4130,
1035,
1998,
1035,
2765,
1035,
3643,
2065,
1030,
23561,
1035,
8909,
2015,
1012,
4064,
1029,
1004,
1004,
1030,
3563,
1035,
14404,
23561,
1027,
1030,
4443,
1012,
6254,
1012,
2012,
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 | activerecord/lib/active_record/integration.rb | ActiveRecord.Integration.cache_version | def cache_version
return unless cache_versioning
if has_attribute?("updated_at")
timestamp = updated_at_before_type_cast
if can_use_fast_cache_version?(timestamp)
raw_timestamp_to_cache_version(timestamp)
elsif timestamp = updated_at
timestamp.utc.to_s(cache_timestamp_format)
end
else
if self.class.has_attribute?("updated_at")
raise ActiveModel::MissingAttributeError, "missing attribute: updated_at"
end
end
end | ruby | def cache_version
return unless cache_versioning
if has_attribute?("updated_at")
timestamp = updated_at_before_type_cast
if can_use_fast_cache_version?(timestamp)
raw_timestamp_to_cache_version(timestamp)
elsif timestamp = updated_at
timestamp.utc.to_s(cache_timestamp_format)
end
else
if self.class.has_attribute?("updated_at")
raise ActiveModel::MissingAttributeError, "missing attribute: updated_at"
end
end
end | [
"def",
"cache_version",
"return",
"unless",
"cache_versioning",
"if",
"has_attribute?",
"(",
"\"updated_at\"",
")",
"timestamp",
"=",
"updated_at_before_type_cast",
"if",
"can_use_fast_cache_version?",
"(",
"timestamp",
")",
"raw_timestamp_to_cache_version",
"(",
"timestamp",... | Returns a cache version that can be used together with the cache key to form
a recyclable caching scheme. By default, the #updated_at column is used for the
cache_version, but this method can be overwritten to return something else.
Note, this method will return nil if ActiveRecord::Base.cache_versioning is set to
+false+ (which it is by default until Rails 6.0). | [
"Returns",
"a",
"cache",
"version",
"that",
"can",
"be",
"used",
"together",
"with",
"the",
"cache",
"key",
"to",
"form",
"a",
"recyclable",
"caching",
"scheme",
".",
"By",
"default",
"the",
"#updated_at",
"column",
"is",
"used",
"for",
"the",
"cache_version... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/integration.rb#L97-L112 | train | Returns the cache version for this object. | [
30522,
13366,
17053,
1035,
2544,
2709,
4983,
17053,
1035,
2544,
2075,
2065,
2038,
1035,
17961,
1029,
1006,
1000,
7172,
1035,
2012,
1000,
1007,
2335,
15464,
2361,
1027,
7172,
1035,
2012,
1035,
2077,
1035,
2828,
1035,
3459,
2065,
2064,
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... |
lostisland/faraday | lib/faraday/options.rb | Faraday.Options.update | def update(obj)
obj.each do |key, value|
sub_options = self.class.options_for(key)
if sub_options
new_value = sub_options.from(value) if value
elsif value.is_a?(Hash)
new_value = value.dup
else
new_value = value
end
send("#{key}=", new_value) unless new_value.nil?
end
self
end | ruby | def update(obj)
obj.each do |key, value|
sub_options = self.class.options_for(key)
if sub_options
new_value = sub_options.from(value) if value
elsif value.is_a?(Hash)
new_value = value.dup
else
new_value = value
end
send("#{key}=", new_value) unless new_value.nil?
end
self
end | [
"def",
"update",
"(",
"obj",
")",
"obj",
".",
"each",
"do",
"|",
"key",
",",
"value",
"|",
"sub_options",
"=",
"self",
".",
"class",
".",
"options_for",
"(",
"key",
")",
"if",
"sub_options",
"new_value",
"=",
"sub_options",
".",
"from",
"(",
"value",
... | Public | [
"Public"
] | 3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70 | https://github.com/lostisland/faraday/blob/3abe9d1eea4bdf61cdf7b76ff9f1ae7e09482e70/lib/faraday/options.rb#L22-L36 | train | Update the object with the options from the given hash. | [
30522,
13366,
10651,
1006,
27885,
3501,
1007,
27885,
3501,
1012,
2169,
2079,
1064,
3145,
1010,
3643,
1064,
4942,
1035,
7047,
1027,
2969,
1012,
2465,
1012,
7047,
1035,
2005,
1006,
3145,
1007,
2065,
4942,
1035,
7047,
2047,
1035,
3643,
1027,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services/lib/2016-06-01/generated/azure_mgmt_recovery_services/registered_identities.rb | Azure::RecoveryServices::Mgmt::V2016_06_01.RegisteredIdentities.delete_with_http_info | def delete_with_http_info(resource_group_name, vault_name, identity_name, custom_headers:nil)
delete_async(resource_group_name, vault_name, identity_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, vault_name, identity_name, custom_headers:nil)
delete_async(resource_group_name, vault_name, identity_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"vault_name",
",",
"identity_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"vault_name",
",",
"identity_name",
",",
"custom_headers",
":custom_headers",
")... | Unregisters the given container from your Recovery Services vault.
@param resource_group_name [String] The name of the resource group where the
recovery services vault is present.
@param vault_name [String] The name of the recovery services vault.
@param identity_name [String] Name of the protection container to unregister.
@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. | [
"Unregisters",
"the",
"given",
"container",
"from",
"your",
"Recovery",
"Services",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services/lib/2016-06-01/generated/azure_mgmt_recovery_services/registered_identities.rb#L52-L54 | train | Deletes the specified index in the specified key vault. | [
30522,
13366,
3972,
12870,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11632,
1035,
2171,
1010,
4767,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3972,
12870,
1035,
2004,
6038,
2278,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb | Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.get_vmsecurity_rules | def get_vmsecurity_rules(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_vmsecurity_rules(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
response = get_vmsecurity_rules_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_vmsecurity_rules",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_vmsecurity_rules_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",... | Gets the configured and effective security group rules on the specified VM.
@param resource_group_name [String] The name of the resource group.
@param network_watcher_name [String] The name of the network watcher.
@param parameters [SecurityGroupViewParameters] Parameters that define the VM
to check security groups for.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SecurityGroupViewResult] operation results. | [
"Gets",
"the",
"configured",
"and",
"effective",
"security",
"group",
"rules",
"on",
"the",
"specified",
"VM",
"."
] | 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#L759-L762 | train | Gets the security rules for the specified virtual machine. | [
30522,
13366,
2131,
1035,
1058,
5244,
8586,
25137,
1035,
3513,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
1058,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.create_async | def create_async(resource_group_name, name, parameters, custom_headers:nil)
# Send request
promise = begin_create_async(resource_group_name, name, parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview::Models::DataLakeAnalyticsAccount.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_async(resource_group_name, name, parameters, custom_headers:nil)
# Send request
promise = begin_create_async(resource_group_name, name, parameters, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview::Models::DataLakeAnalyticsAccount.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_async",
"(",
"resource_group_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_create_async",
"(",
"resource_group_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":cu... | @param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Analytics account.the account will be associated with.
@param name [String] The name of the Data Lake Analytics account to create.
@param parameters [DataLakeAnalyticsAccount] Parameters supplied to the
create Data Lake Analytics account operation.
@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",
"Azure",
"resource",
"group",
"that",
"contains",
"the",
"Data",
"Lake",
"Analytics",
"account",
".",
"the",
"account",
"will",
"be",
"associated",
"with",
".",
"@param",
"name",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L1942-L1958 | train | Creates a Data Lake Analytics account. | [
30522,
13366,
3443,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
1001,
4604,
5227,
4872,
30524,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
phusion/passenger | src/ruby_supportlib/phusion_passenger/request_handler.rb | PhusionPassenger.RequestHandler.main_loop | def main_loop
debug("Entering request handler main loop")
reset_signal_handlers
begin
@graceful_termination_pipe = IO.pipe
@graceful_termination_pipe[0].close_on_exec!
@graceful_termination_pipe[1].close_on_exec!
@main_loop_thread_lock.synchronize do
@main_loop_generation += 1
@main_loop_running = true
@main_loop_thread_cond.broadcast
@select_timeout = nil
@selectable_sockets = []
@server_sockets.each_value do |value|
socket = value[2]
@selectable_sockets << socket if socket
end
@selectable_sockets << @owner_pipe
@selectable_sockets << @graceful_termination_pipe[0]
end
install_useful_signal_handlers
start_threads
wait_until_termination_requested
wait_until_all_threads_are_idle
terminate_threads
debug("Request handler main loop exited normally")
rescue EOFError
# Exit main loop.
trace(2, "Request handler main loop interrupted by EOFError exception")
rescue Interrupt
# Exit main loop.
trace(2, "Request handler main loop interrupted by Interrupt exception")
rescue SignalException => signal
trace(2, "Request handler main loop interrupted by SignalException")
if signal.message != HARD_TERMINATION_SIGNAL
raise
end
rescue Exception => e
trace(2, "Request handler main loop interrupted by #{e.class} exception")
raise
ensure
debug("Exiting request handler main loop")
revert_signal_handlers
@main_loop_thread_lock.synchronize do
@graceful_termination_pipe[1].close rescue nil
@graceful_termination_pipe[0].close rescue nil
@selectable_sockets = []
@main_loop_generation += 1
@main_loop_running = false
@main_loop_thread_cond.broadcast
end
end
end | ruby | def main_loop
debug("Entering request handler main loop")
reset_signal_handlers
begin
@graceful_termination_pipe = IO.pipe
@graceful_termination_pipe[0].close_on_exec!
@graceful_termination_pipe[1].close_on_exec!
@main_loop_thread_lock.synchronize do
@main_loop_generation += 1
@main_loop_running = true
@main_loop_thread_cond.broadcast
@select_timeout = nil
@selectable_sockets = []
@server_sockets.each_value do |value|
socket = value[2]
@selectable_sockets << socket if socket
end
@selectable_sockets << @owner_pipe
@selectable_sockets << @graceful_termination_pipe[0]
end
install_useful_signal_handlers
start_threads
wait_until_termination_requested
wait_until_all_threads_are_idle
terminate_threads
debug("Request handler main loop exited normally")
rescue EOFError
# Exit main loop.
trace(2, "Request handler main loop interrupted by EOFError exception")
rescue Interrupt
# Exit main loop.
trace(2, "Request handler main loop interrupted by Interrupt exception")
rescue SignalException => signal
trace(2, "Request handler main loop interrupted by SignalException")
if signal.message != HARD_TERMINATION_SIGNAL
raise
end
rescue Exception => e
trace(2, "Request handler main loop interrupted by #{e.class} exception")
raise
ensure
debug("Exiting request handler main loop")
revert_signal_handlers
@main_loop_thread_lock.synchronize do
@graceful_termination_pipe[1].close rescue nil
@graceful_termination_pipe[0].close rescue nil
@selectable_sockets = []
@main_loop_generation += 1
@main_loop_running = false
@main_loop_thread_cond.broadcast
end
end
end | [
"def",
"main_loop",
"debug",
"(",
"\"Entering request handler main loop\"",
")",
"reset_signal_handlers",
"begin",
"@graceful_termination_pipe",
"=",
"IO",
".",
"pipe",
"@graceful_termination_pipe",
"[",
"0",
"]",
".",
"close_on_exec!",
"@graceful_termination_pipe",
"[",
"1... | Enter the request handler's main loop. | [
"Enter",
"the",
"request",
"handler",
"s",
"main",
"loop",
"."
] | 970964b53e0ba86959acdf40f06c99b0c4a128ca | https://github.com/phusion/passenger/blob/970964b53e0ba86959acdf40f06c99b0c4a128ca/src/ruby_supportlib/phusion_passenger/request_handler.rb#L176-L233 | train | Main loop | [
30522,
13366,
2364,
1035,
7077,
2139,
8569,
2290,
1006,
1000,
5738,
5227,
28213,
2364,
7077,
1000,
1007,
25141,
1035,
4742,
1035,
28213,
2015,
4088,
1030,
19415,
1035,
18287,
1035,
8667,
1027,
22834,
1012,
8667,
1030,
19415,
1035,
18287,
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.get_deployed_application_info_with_http_info | def get_deployed_application_info_with_http_info(node_name, application_id, timeout:60, include_health_state:false, custom_headers:nil)
get_deployed_application_info_async(node_name, application_id, timeout:timeout, include_health_state:include_health_state, custom_headers:custom_headers).value!
end | ruby | def get_deployed_application_info_with_http_info(node_name, application_id, timeout:60, include_health_state:false, custom_headers:nil)
get_deployed_application_info_async(node_name, application_id, timeout:timeout, include_health_state:include_health_state, custom_headers:custom_headers).value!
end | [
"def",
"get_deployed_application_info_with_http_info",
"(",
"node_name",
",",
"application_id",
",",
"timeout",
":",
"60",
",",
"include_health_state",
":",
"false",
",",
"custom_headers",
":",
"nil",
")",
"get_deployed_application_info_async",
"(",
"node_name",
",",
"a... | Gets the information about an application deployed on a Service Fabric node.
Gets the information about an application deployed on a Service Fabric node.
This query returns system application information if the application ID
provided is for system application. Results encompass deployed applications
in active, activating, and downloading states. This query requires that the
node name corresponds to a node on the cluster. The query fails if the
provided node name does not point to any active Service Fabric nodes on the
cluster.
@param node_name [String] The name of the node.
@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 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 include_health_state [Boolean] Include the health state of an entity.
If this parameter is false or not specified, then the health state returned
is "Unknown".
When set to true, the query goes in parallel to the node and the health
system service before the results are merged.
As a result, the query is more expensive and may take a longer time.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"information",
"about",
"an",
"application",
"deployed",
"on",
"a",
"Service",
"Fabric",
"node",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L8616-L8618 | train | Gets the information about the deployment of the application. | [
30522,
13366,
2131,
1035,
7333,
1035,
4646,
1035,
18558,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13045,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
2421,
1035,
2740,
1035,
2110,
1024,
6270,
1010,
7661,
1035,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/2019-03-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2019_03_01.VirtualMachineScaleSets.convert_to_single_placement_group | def convert_to_single_placement_group(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
response = convert_to_single_placement_group_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
nil
end | ruby | def convert_to_single_placement_group(resource_group_name, vm_scale_set_name, parameters, custom_headers:nil)
response = convert_to_single_placement_group_async(resource_group_name, vm_scale_set_name, parameters, custom_headers:custom_headers).value!
nil
end | [
"def",
"convert_to_single_placement_group",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"convert_to_single_placement_group_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
... | Converts SinglePlacementGroup property to false for a existing virtual
machine scale set.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the virtual machine scale set
to create or update.
@param parameters [VMScaleSetConvertToSinglePlacementGroupInput] The input
object for ConvertToSinglePlacementGroup API.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Converts",
"SinglePlacementGroup",
"property",
"to",
"false",
"for",
"a",
"existing",
"virtual",
"machine",
"scale",
"set",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2019-03-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L1260-L1263 | train | Convert a virtual machine to a single placement group. | [
30522,
13366,
10463,
1035,
2000,
1035,
2309,
1035,
11073,
1035,
2177,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
11709,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb | Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_multi_role_metric_definitions_as_lazy | def list_multi_role_metric_definitions_as_lazy(resource_group_name, name, custom_headers:nil)
response = list_multi_role_metric_definitions_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_metric_definitions_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_multi_role_metric_definitions_as_lazy(resource_group_name, name, custom_headers:nil)
response = list_multi_role_metric_definitions_async(resource_group_name, name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_multi_role_metric_definitions_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_multi_role_metric_definitions_as_lazy",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_multi_role_metric_definitions_async",
"(",
"resource_group_name",
",",
"name",
",",
"custom_headers",
":custom_headers"... | Get metric definitions for a multi-role pool of an App Service Environment.
Get metric definitions for a multi-role pool of an App Service Environment.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param name [String] Name of the App Service Environment.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ResourceMetricDefinitionCollection] which provide lazy access to
pages of the response. | [
"Get",
"metric",
"definitions",
"for",
"a",
"multi",
"-",
"role",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L7637-L7646 | train | Gets a list of metric definitions for a resource group. | [
30522,
13366,
2862,
1035,
4800,
1035,
2535,
1035,
12046,
1035,
15182,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
4800,
1035,
2535,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/auto_filter/auto_filter.rb | Axlsx.AutoFilter.defined_name | def defined_name
return unless range
Axlsx.cell_range(range.split(':').collect { |name| worksheet.name_to_cell(name)})
end | ruby | def defined_name
return unless range
Axlsx.cell_range(range.split(':').collect { |name| worksheet.name_to_cell(name)})
end | [
"def",
"defined_name",
"return",
"unless",
"range",
"Axlsx",
".",
"cell_range",
"(",
"range",
".",
"split",
"(",
"':'",
")",
".",
"collect",
"{",
"|",
"name",
"|",
"worksheet",
".",
"name_to_cell",
"(",
"name",
")",
"}",
")",
"end"
] | the formula for the defined name required for this auto filter
This prepends the worksheet name to the absolute cell reference
e.g. A1:B2 -> 'Sheet1'!$A$1:$B$2
@return [String] | [
"the",
"formula",
"for",
"the",
"defined",
"name",
"required",
"for",
"this",
"auto",
"filter",
"This",
"prepends",
"the",
"worksheet",
"name",
"to",
"the",
"absolute",
"cell",
"reference",
"e",
".",
"g",
".",
"A1",
":",
"B2",
"-",
">",
"Sheet1",
"!$A$1"... | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb#L28-L31 | train | Returns the defined name of the cell in the worksheet. | [
30522,
13366,
4225,
1035,
2171,
2709,
4983,
2846,
22260,
4877,
2595,
1012,
3526,
1035,
2846,
1006,
2846,
1012,
3975,
1006,
1005,
1024,
1005,
1007,
1012,
8145,
1063,
1064,
2171,
1064,
2573,
21030,
2102,
1012,
2171,
1035,
2000,
1035,
3526,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
boazsegev/combine_pdf | lib/combine_pdf/page_methods.rb | CombinePDF.Page_Methods.reorder_rtl_content | def reorder_rtl_content(text)
rtl_characters = "\u05d0-\u05ea\u05f0-\u05f4\u0600-\u06ff\u0750-\u077f"
rtl_replaces = { '(' => ')', ')' => '(',
'[' => ']', ']' => '[',
'{' => '}', '}' => '{',
'<' => '>', '>' => '<' }
return text unless text =~ /[#{rtl_characters}]/
out = []
scanner = StringScanner.new text
until scanner.eos?
if scanner.scan(/[#{rtl_characters} ]/)
out.unshift scanner.matched
elsif scanner.scan(/[^#{rtl_characters}]+/)
if out.empty? && scanner.matched.match(/[\s]$/) && !scanner.eos?
white_space_to_move = scanner.matched.match(/[\s]+$/).to_s
out.unshift scanner.matched[0..-1 - white_space_to_move.length]
out.unshift white_space_to_move
elsif scanner.matched =~ /^[\(\)\[\]\{\}\<\>]$/
out.unshift rtl_replaces[scanner.matched]
else
out.unshift scanner.matched
end
end
end
out.join.strip
end | ruby | def reorder_rtl_content(text)
rtl_characters = "\u05d0-\u05ea\u05f0-\u05f4\u0600-\u06ff\u0750-\u077f"
rtl_replaces = { '(' => ')', ')' => '(',
'[' => ']', ']' => '[',
'{' => '}', '}' => '{',
'<' => '>', '>' => '<' }
return text unless text =~ /[#{rtl_characters}]/
out = []
scanner = StringScanner.new text
until scanner.eos?
if scanner.scan(/[#{rtl_characters} ]/)
out.unshift scanner.matched
elsif scanner.scan(/[^#{rtl_characters}]+/)
if out.empty? && scanner.matched.match(/[\s]$/) && !scanner.eos?
white_space_to_move = scanner.matched.match(/[\s]+$/).to_s
out.unshift scanner.matched[0..-1 - white_space_to_move.length]
out.unshift white_space_to_move
elsif scanner.matched =~ /^[\(\)\[\]\{\}\<\>]$/
out.unshift rtl_replaces[scanner.matched]
else
out.unshift scanner.matched
end
end
end
out.join.strip
end | [
"def",
"reorder_rtl_content",
"(",
"text",
")",
"rtl_characters",
"=",
"\"\\u05d0-\\u05ea\\u05f0-\\u05f4\\u0600-\\u06ff\\u0750-\\u077f\"",
"rtl_replaces",
"=",
"{",
"'('",
"=>",
"')'",
",",
"')'",
"=>",
"'('",
",",
"'['",
"=>",
"']'",
",",
"']'",
"=>",
"'['",
",",... | a very primitive text reordering algorithm... I was lazy...
...still, it works (I think). | [
"a",
"very",
"primitive",
"text",
"reordering",
"algorithm",
"...",
"I",
"was",
"lazy",
"...",
"...",
"still",
"it",
"works",
"(",
"I",
"think",
")",
"."
] | 09054051019c069f551f3e60be789577c0f93900 | https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/page_methods.rb#L807-L833 | train | Reorder RTL content | [
30522,
13366,
2128,
8551,
2121,
1035,
19387,
2140,
1035,
4180,
1006,
3793,
1007,
19387,
2140,
1035,
3494,
1027,
1000,
1032,
1057,
2692,
2629,
2094,
2692,
1011,
1032,
1057,
2692,
2629,
5243,
1032,
1057,
2692,
2629,
2546,
2692,
1011,
1032,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_next | def get_deleted_certificates_next(next_page_link, custom_headers:nil)
response = get_deleted_certificates_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_deleted_certificates_next(next_page_link, custom_headers:nil)
response = get_deleted_certificates_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_deleted_certificates_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_deleted_certificates_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"... | 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 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 [DeletedCertificateListResult] 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#L9177-L9180 | train | Gets the deleted certificates. | [
30522,
13366,
2131,
1035,
17159,
1035,
17987,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
17159,
1035,
17987,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
toptal/chewy | lib/chewy/query.rb | Chewy.Query.limit | def limit(value = nil, &block)
chain { criteria.update_request_options size: block || Integer(value) }
end | ruby | def limit(value = nil, &block)
chain { criteria.update_request_options size: block || Integer(value) }
end | [
"def",
"limit",
"(",
"value",
"=",
"nil",
",",
"&",
"block",
")",
"chain",
"{",
"criteria",
".",
"update_request_options",
"size",
":",
"block",
"||",
"Integer",
"(",
"value",
")",
"}",
"end"
] | Sets elasticsearch `size` search request param
Default value is set in the elasticsearch and is 10.
@example
UsersIndex.filter{ name == 'Johny' }.limit(100)
# => {body: {
query: {...},
size: 100
}} | [
"Sets",
"elasticsearch",
"size",
"search",
"request",
"param",
"Default",
"value",
"is",
"set",
"in",
"the",
"elasticsearch",
"and",
"is",
"10",
"."
] | cb1bb3efb1bd8a31e7e31add6072189cb1f4f01b | https://github.com/toptal/chewy/blob/cb1bb3efb1bd8a31e7e31add6072189cb1f4f01b/lib/chewy/query.rb#L303-L305 | train | Limit the number of documents to return. | [
30522,
13366,
5787,
1006,
3643,
1027,
9152,
2140,
1010,
1004,
3796,
1007,
4677,
1063,
9181,
1012,
10651,
1035,
5227,
1035,
7047,
2946,
1024,
3796,
1064,
1064,
16109,
1006,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/core_ext/numeric/conversions.rb | ActiveSupport.NumericWithFormat.to_s | def to_s(format = nil, options = nil)
case format
when nil
super()
when Integer, String
super(format)
when :phone
ActiveSupport::NumberHelper.number_to_phone(self, options || {})
when :currency
ActiveSupport::NumberHelper.number_to_currency(self, options || {})
when :percentage
ActiveSupport::NumberHelper.number_to_percentage(self, options || {})
when :delimited
ActiveSupport::NumberHelper.number_to_delimited(self, options || {})
when :rounded
ActiveSupport::NumberHelper.number_to_rounded(self, options || {})
when :human
ActiveSupport::NumberHelper.number_to_human(self, options || {})
when :human_size
ActiveSupport::NumberHelper.number_to_human_size(self, options || {})
when Symbol
super()
else
super(format)
end
end | ruby | def to_s(format = nil, options = nil)
case format
when nil
super()
when Integer, String
super(format)
when :phone
ActiveSupport::NumberHelper.number_to_phone(self, options || {})
when :currency
ActiveSupport::NumberHelper.number_to_currency(self, options || {})
when :percentage
ActiveSupport::NumberHelper.number_to_percentage(self, options || {})
when :delimited
ActiveSupport::NumberHelper.number_to_delimited(self, options || {})
when :rounded
ActiveSupport::NumberHelper.number_to_rounded(self, options || {})
when :human
ActiveSupport::NumberHelper.number_to_human(self, options || {})
when :human_size
ActiveSupport::NumberHelper.number_to_human_size(self, options || {})
when Symbol
super()
else
super(format)
end
end | [
"def",
"to_s",
"(",
"format",
"=",
"nil",
",",
"options",
"=",
"nil",
")",
"case",
"format",
"when",
"nil",
"super",
"(",
")",
"when",
"Integer",
",",
"String",
"super",
"(",
"format",
")",
"when",
":phone",
"ActiveSupport",
"::",
"NumberHelper",
".",
... | Provides options for converting numbers into formatted strings.
Options are provided for phone numbers, currency, percentage,
precision, positional notation, file size and pretty printing.
==== Options
For details on which formats use which options, see ActiveSupport::NumberHelper
==== Examples
Phone Numbers:
5551234.to_s(:phone) # => "555-1234"
1235551234.to_s(:phone) # => "123-555-1234"
1235551234.to_s(:phone, area_code: true) # => "(123) 555-1234"
1235551234.to_s(:phone, delimiter: ' ') # => "123 555 1234"
1235551234.to_s(:phone, area_code: true, extension: 555) # => "(123) 555-1234 x 555"
1235551234.to_s(:phone, country_code: 1) # => "+1-123-555-1234"
1235551234.to_s(:phone, country_code: 1, extension: 1343, delimiter: '.')
# => "+1.123.555.1234 x 1343"
Currency:
1234567890.50.to_s(:currency) # => "$1,234,567,890.50"
1234567890.506.to_s(:currency) # => "$1,234,567,890.51"
1234567890.506.to_s(:currency, precision: 3) # => "$1,234,567,890.506"
1234567890.506.to_s(:currency, locale: :fr) # => "1 234 567 890,51 €"
-1234567890.50.to_s(:currency, negative_format: '(%u%n)')
# => "($1,234,567,890.50)"
1234567890.50.to_s(:currency, unit: '£', separator: ',', delimiter: '')
# => "£1234567890,50"
1234567890.50.to_s(:currency, unit: '£', separator: ',', delimiter: '', format: '%n %u')
# => "1234567890,50 £"
Percentage:
100.to_s(:percentage) # => "100.000%"
100.to_s(:percentage, precision: 0) # => "100%"
1000.to_s(:percentage, delimiter: '.', separator: ',') # => "1.000,000%"
302.24398923423.to_s(:percentage, precision: 5) # => "302.24399%"
1000.to_s(:percentage, locale: :fr) # => "1 000,000%"
100.to_s(:percentage, format: '%n %') # => "100.000 %"
Delimited:
12345678.to_s(:delimited) # => "12,345,678"
12345678.05.to_s(:delimited) # => "12,345,678.05"
12345678.to_s(:delimited, delimiter: '.') # => "12.345.678"
12345678.to_s(:delimited, delimiter: ',') # => "12,345,678"
12345678.05.to_s(:delimited, separator: ' ') # => "12,345,678 05"
12345678.05.to_s(:delimited, locale: :fr) # => "12 345 678,05"
98765432.98.to_s(:delimited, delimiter: ' ', separator: ',')
# => "98 765 432,98"
Rounded:
111.2345.to_s(:rounded) # => "111.235"
111.2345.to_s(:rounded, precision: 2) # => "111.23"
13.to_s(:rounded, precision: 5) # => "13.00000"
389.32314.to_s(:rounded, precision: 0) # => "389"
111.2345.to_s(:rounded, significant: true) # => "111"
111.2345.to_s(:rounded, precision: 1, significant: true) # => "100"
13.to_s(:rounded, precision: 5, significant: true) # => "13.000"
111.234.to_s(:rounded, locale: :fr) # => "111,234"
13.to_s(:rounded, precision: 5, significant: true, strip_insignificant_zeros: true)
# => "13"
389.32314.to_s(:rounded, precision: 4, significant: true) # => "389.3"
1111.2345.to_s(:rounded, precision: 2, separator: ',', delimiter: '.')
# => "1.111,23"
Human-friendly size in Bytes:
123.to_s(:human_size) # => "123 Bytes"
1234.to_s(:human_size) # => "1.21 KB"
12345.to_s(:human_size) # => "12.1 KB"
1234567.to_s(:human_size) # => "1.18 MB"
1234567890.to_s(:human_size) # => "1.15 GB"
1234567890123.to_s(:human_size) # => "1.12 TB"
1234567890123456.to_s(:human_size) # => "1.1 PB"
1234567890123456789.to_s(:human_size) # => "1.07 EB"
1234567.to_s(:human_size, precision: 2) # => "1.2 MB"
483989.to_s(:human_size, precision: 2) # => "470 KB"
1234567.to_s(:human_size, precision: 2, separator: ',') # => "1,2 MB"
1234567890123.to_s(:human_size, precision: 5) # => "1.1228 TB"
524288000.to_s(:human_size, precision: 5) # => "500 MB"
Human-friendly format:
123.to_s(:human) # => "123"
1234.to_s(:human) # => "1.23 Thousand"
12345.to_s(:human) # => "12.3 Thousand"
1234567.to_s(:human) # => "1.23 Million"
1234567890.to_s(:human) # => "1.23 Billion"
1234567890123.to_s(:human) # => "1.23 Trillion"
1234567890123456.to_s(:human) # => "1.23 Quadrillion"
1234567890123456789.to_s(:human) # => "1230 Quadrillion"
489939.to_s(:human, precision: 2) # => "490 Thousand"
489939.to_s(:human, precision: 4) # => "489.9 Thousand"
1234567.to_s(:human, precision: 4,
significant: false) # => "1.2346 Million"
1234567.to_s(:human, precision: 1,
separator: ',',
significant: false) # => "1,2 Million" | [
"Provides",
"options",
"for",
"converting",
"numbers",
"into",
"formatted",
"strings",
".",
"Options",
"are",
"provided",
"for",
"phone",
"numbers",
"currency",
"percentage",
"precision",
"positional",
"notation",
"file",
"size",
"and",
"pretty",
"printing",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/core_ext/numeric/conversions.rb#L105-L130 | train | Convert the number to a string. | [
30522,
13366,
2000,
1035,
1055,
1006,
4289,
1027,
9152,
2140,
1010,
7047,
1027,
9152,
2140,
1007,
2553,
4289,
2043,
9152,
2140,
3565,
1006,
1007,
2043,
16109,
1010,
5164,
3565,
1006,
4289,
1007,
2043,
1024,
3042,
3161,
6342,
9397,
11589,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_next_hop_with_http_info | def begin_get_next_hop_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_get_next_hop_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil)
begin_get_next_hop_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_get_next_hop_with_http_info",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_get_next_hop_async",
"(",
"resource_group_name",
",",
"network_watcher_name",
",",
"parameters",
",",
"cust... | Gets the next hop from the specified VM.
@param resource_group_name [String] The name of the resource group.
@param network_watcher_name [String] The name of the network watcher.
@param parameters [NextHopParameters] Parameters that define the source and
destination 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. | [
"Gets",
"the",
"next",
"hop",
"from",
"the",
"specified",
"VM",
"."
] | 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#L1419-L1421 | train | Gets the next hop for a specified resource group. | [
30522,
13366,
4088,
1035,
2131,
1035,
2279,
1035,
6154,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2897,
1035,
3422,
2121,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb | Azure::SQL::Mgmt::V2017_03_01_preview.LongTermRetentionBackups.list_by_database_as_lazy | def list_by_database_as_lazy(location_name, long_term_retention_server_name, long_term_retention_database_name, only_latest_per_database:nil, database_state:nil, custom_headers:nil)
response = list_by_database_async(location_name, long_term_retention_server_name, long_term_retention_database_name, only_latest_per_database:only_latest_per_database, database_state:database_state, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_database_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_database_as_lazy(location_name, long_term_retention_server_name, long_term_retention_database_name, only_latest_per_database:nil, database_state:nil, custom_headers:nil)
response = list_by_database_async(location_name, long_term_retention_server_name, long_term_retention_database_name, only_latest_per_database:only_latest_per_database, database_state:database_state, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_database_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_database_as_lazy",
"(",
"location_name",
",",
"long_term_retention_server_name",
",",
"long_term_retention_database_name",
",",
"only_latest_per_database",
":",
"nil",
",",
"database_state",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"... | Lists all long term retention backups for a database.
@param location_name [String] The location of the database
@param long_term_retention_server_name [String] The name of the server
@param long_term_retention_database_name [String] The name of the database
@param only_latest_per_database [Boolean] Whether or not to only get the
latest backup for each database.
@param database_state [LongTermRetentionDatabaseState] Whether to query
against just live databases, just deleted databases, or all databases.
Possible values include: 'All', 'Live', 'Deleted'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [LongTermRetentionBackupListResult] which provide lazy access to
pages of the response. | [
"Lists",
"all",
"long",
"term",
"retention",
"backups",
"for",
"a",
"database",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2017-03-01-preview/generated/azure_mgmt_sql/long_term_retention_backups.rb#L860-L869 | train | Gets a list of all the documents in a database. | [
30522,
13366,
2862,
1035,
2011,
1035,
7809,
1035,
2004,
1035,
13971,
1006,
3295,
1035,
2171,
1010,
2146,
1035,
2744,
1035,
20125,
1035,
8241,
1035,
2171,
1010,
2146,
1035,
2744,
1035,
20125,
1035,
7809,
1035,
2171,
1010,
2069,
1035,
6745,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
kmuto/review | lib/review/latexbuilder.rb | ReVIEW.LATEXBuilder.inline_b | def inline_b(str)
if @book.config.check_version('2', exception: false)
macro('textbf', escape(str))
else
macro('reviewbold', escape(str))
end
end | ruby | def inline_b(str)
if @book.config.check_version('2', exception: false)
macro('textbf', escape(str))
else
macro('reviewbold', escape(str))
end
end | [
"def",
"inline_b",
"(",
"str",
")",
"if",
"@book",
".",
"config",
".",
"check_version",
"(",
"'2'",
",",
"exception",
":",
"false",
")",
"macro",
"(",
"'textbf'",
",",
"escape",
"(",
"str",
")",
")",
"else",
"macro",
"(",
"'reviewbold'",
",",
"escape",... | bold | [
"bold"
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/review/latexbuilder.rb#L1041-L1047 | train | inline_b | [
30522,
13366,
23881,
1035,
1038,
1006,
2358,
2099,
1007,
2065,
1030,
2338,
1012,
9530,
8873,
2290,
1012,
4638,
1035,
2544,
1006,
1005,
1016,
1005,
1010,
6453,
1024,
6270,
1007,
26632,
1006,
1005,
3793,
29292,
1005,
1010,
4019,
1006,
2358,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachines.begin_restart | def begin_restart(resource_group_name, vm_name, custom_headers:nil)
response = begin_restart_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_restart(resource_group_name, vm_name, custom_headers:nil)
response = begin_restart_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_restart",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_restart_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
... | The operation to restart a virtual machine.
@param resource_group_name [String] The name of the resource group.
@param vm_name [String] The name of the virtual machine.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatusResponse] operation results. | [
"The",
"operation",
"to",
"restart",
"a",
"virtual",
"machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machines.rb#L1594-L1597 | train | Restarts a virtual machine. | [
30522,
13366,
4088,
1035,
23818,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
23818,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
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... |
meew0/discordrb | lib/discordrb/data/channel.rb | Discordrb.Channel.users | def users
if text?
@server.online_members(include_idle: true).select { |u| u.can_read_messages? self }
elsif voice?
@server.voice_states.map { |id, voice_state| @server.member(id) if !voice_state.voice_channel.nil? && voice_state.voice_channel.id == @id }.compact
end
end | ruby | def users
if text?
@server.online_members(include_idle: true).select { |u| u.can_read_messages? self }
elsif voice?
@server.voice_states.map { |id, voice_state| @server.member(id) if !voice_state.voice_channel.nil? && voice_state.voice_channel.id == @id }.compact
end
end | [
"def",
"users",
"if",
"text?",
"@server",
".",
"online_members",
"(",
"include_idle",
":",
"true",
")",
".",
"select",
"{",
"|",
"u",
"|",
"u",
".",
"can_read_messages?",
"self",
"}",
"elsif",
"voice?",
"@server",
".",
"voice_states",
".",
"map",
"{",
"|... | The list of users currently in this channel. For a voice channel, it will return all the members currently
in that channel. For a text channel, it will return all online members that have permission to read it.
@return [Array<Member>] the users in this channel | [
"The",
"list",
"of",
"users",
"currently",
"in",
"this",
"channel",
".",
"For",
"a",
"voice",
"channel",
"it",
"will",
"return",
"all",
"the",
"members",
"currently",
"in",
"that",
"channel",
".",
"For",
"a",
"text",
"channel",
"it",
"will",
"return",
"a... | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/channel.rb#L508-L514 | train | Return the users array for this user. | [
30522,
13366,
5198,
2065,
3793,
1029,
1030,
8241,
1012,
3784,
1035,
2372,
1006,
2421,
1035,
18373,
1024,
2995,
1007,
1012,
7276,
1063,
1064,
1057,
1064,
1057,
1012,
2064,
1035,
3191,
1035,
7696,
1029,
2969,
1065,
3449,
5332,
2546,
2376,
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... |
rails/rails | activerecord/lib/active_record/schema_dumper.rb | ActiveRecord.SchemaDumper.formatted_version | def formatted_version
stringified = @version.to_s
return stringified unless stringified.length == 14
stringified.insert(4, "_").insert(7, "_").insert(10, "_")
end | ruby | def formatted_version
stringified = @version.to_s
return stringified unless stringified.length == 14
stringified.insert(4, "_").insert(7, "_").insert(10, "_")
end | [
"def",
"formatted_version",
"stringified",
"=",
"@version",
".",
"to_s",
"return",
"stringified",
"unless",
"stringified",
".",
"length",
"==",
"14",
"stringified",
".",
"insert",
"(",
"4",
",",
"\"_\"",
")",
".",
"insert",
"(",
"7",
",",
"\"_\"",
")",
"."... | turns 20170404131909 into "2017_04_04_131909" | [
"turns",
"20170404131909",
"into",
"2017_04_04_131909"
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/schema_dumper.rb#L59-L63 | train | Returns the version of the record | [
30522,
13366,
4289,
3064,
1035,
2544,
5164,
7810,
1027,
1030,
2544,
1012,
2000,
1035,
1055,
2709,
5164,
7810,
4983,
5164,
7810,
1012,
3091,
1027,
1027,
2403,
5164,
7810,
1012,
19274,
1006,
1018,
1010,
1000,
1035,
1000,
1007,
1012,
19274,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
SamSaffron/memory_profiler | lib/memory_profiler/reporter.rb | MemoryProfiler.Reporter.run | def run(&block)
start
begin
yield
rescue Exception
ObjectSpace.trace_object_allocations_stop
GC.enable
raise
else
stop
end
end | ruby | def run(&block)
start
begin
yield
rescue Exception
ObjectSpace.trace_object_allocations_stop
GC.enable
raise
else
stop
end
end | [
"def",
"run",
"(",
"&",
"block",
")",
"start",
"begin",
"yield",
"rescue",
"Exception",
"ObjectSpace",
".",
"trace_object_allocations_stop",
"GC",
".",
"enable",
"raise",
"else",
"stop",
"end",
"end"
] | Collects object allocation and memory of ruby code inside of passed block. | [
"Collects",
"object",
"allocation",
"and",
"memory",
"of",
"ruby",
"code",
"inside",
"of",
"passed",
"block",
"."
] | bd87ff68559623d12c827800ee795475db4d5b8b | https://github.com/SamSaffron/memory_profiler/blob/bd87ff68559623d12c827800ee795475db4d5b8b/lib/memory_profiler/reporter.rb#L71-L82 | train | Run the block in the object allocator. | [
30522,
13366,
2448,
1006,
1004,
3796,
1007,
2707,
4088,
10750,
5343,
6453,
5200,
15327,
1012,
7637,
1035,
4874,
1035,
16169,
2015,
1035,
2644,
1043,
2278,
1012,
9585,
5333,
2842,
2644,
2203,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/module_model_operations.rb | Azure::Automation::Mgmt::V2015_10_31.ModuleModelOperations.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, automation_account_name, module_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, automation_account_name, module_name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, automation_account_name, module_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, automation_account_name, module_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"module_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"m... | Create or Update the module identified by module name.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param module_name [String] The name of module.
@param parameters [ModuleCreateOrUpdateParameters] The create or update
parameters for module.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Create",
"or",
"Update",
"the",
"module",
"identified",
"by",
"module",
"name",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/module_model_operations.rb#L242-L244 | train | Creates or updates a module. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
11336,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
CocoaPods/Xcodeproj | lib/xcodeproj/scheme.rb | Xcodeproj.XCScheme.add_build_target | def add_build_target(build_target, build_for_running = true)
entry = BuildAction::Entry.new(build_target)
entry.build_for_testing = true
entry.build_for_running = build_for_running
entry.build_for_profiling = build_for_running
entry.build_for_archiving = build_for_running
entry.build_for_analyzing = build_for_running
build_action.add_entry(entry)
end | ruby | def add_build_target(build_target, build_for_running = true)
entry = BuildAction::Entry.new(build_target)
entry.build_for_testing = true
entry.build_for_running = build_for_running
entry.build_for_profiling = build_for_running
entry.build_for_archiving = build_for_running
entry.build_for_analyzing = build_for_running
build_action.add_entry(entry)
end | [
"def",
"add_build_target",
"(",
"build_target",
",",
"build_for_running",
"=",
"true",
")",
"entry",
"=",
"BuildAction",
"::",
"Entry",
".",
"new",
"(",
"build_target",
")",
"entry",
".",
"build_for_testing",
"=",
"true",
"entry",
".",
"build_for_running",
"=",
... | @!group Target methods
Add a target to the list of targets to build in the build action.
@param [Xcodeproj::Project::Object::AbstractTarget] build_target
A target used by scheme in the build step.
@param [Bool] build_for_running
Whether to build this target in the launch action. Often false for test targets. | [
"@!group",
"Target",
"methods",
"Add",
"a",
"target",
"to",
"the",
"list",
"of",
"targets",
"to",
"build",
"in",
"the",
"build",
"action",
"."
] | 3be1684437a6f8e69c7836ad4c85a2b78663272f | https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/lib/xcodeproj/scheme.rb#L193-L203 | train | Add a build target to the build action | [
30522,
13366,
5587,
1035,
3857,
1035,
4539,
1006,
3857,
1035,
4539,
1010,
3857,
1035,
2005,
1035,
2770,
1027,
2995,
1007,
4443,
1027,
3857,
18908,
3258,
1024,
1024,
4443,
1012,
2047,
1006,
3857,
1035,
4539,
1007,
4443,
1012,
3857,
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... |
rails/sprockets | lib/sprockets/loader.rb | Sprockets.Loader.store_asset | def store_asset(asset, unloaded)
# Save the asset in the cache under the new URI
cached_asset = asset.dup
cached_asset[:uri] = compress_from_root(asset[:uri])
cached_asset[:filename] = compress_from_root(asset[:filename])
cached_asset[:load_path] = compress_from_root(asset[:load_path])
if cached_asset[:metadata]
# Deep dup to avoid modifying `asset`
cached_asset[:metadata] = cached_asset[:metadata].dup
if cached_asset[:metadata][:included] && !cached_asset[:metadata][:included].empty?
cached_asset[:metadata][:included] = cached_asset[:metadata][:included].dup
cached_asset[:metadata][:included].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:links] && !cached_asset[:metadata][:links].empty?
cached_asset[:metadata][:links] = cached_asset[:metadata][:links].dup
cached_asset[:metadata][:links].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:stubbed] && !cached_asset[:metadata][:stubbed].empty?
cached_asset[:metadata][:stubbed] = cached_asset[:metadata][:stubbed].dup
cached_asset[:metadata][:stubbed].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:required] && !cached_asset[:metadata][:required].empty?
cached_asset[:metadata][:required] = cached_asset[:metadata][:required].dup
cached_asset[:metadata][:required].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:to_load] && !cached_asset[:metadata][:to_load].empty?
cached_asset[:metadata][:to_load] = cached_asset[:metadata][:to_load].dup
cached_asset[:metadata][:to_load].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:to_link] && !cached_asset[:metadata][:to_link].empty?
cached_asset[:metadata][:to_link] = cached_asset[:metadata][:to_link].dup
cached_asset[:metadata][:to_link].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:dependencies] && !cached_asset[:metadata][:dependencies].empty?
cached_asset[:metadata][:dependencies] = cached_asset[:metadata][:dependencies].dup
cached_asset[:metadata][:dependencies].map! do |uri|
uri.start_with?("file-digest://".freeze) ? compress_from_root(uri) : uri
end
end
# compress all _dependencies in metadata like `sass_dependencies`
cached_asset[:metadata].each do |key, value|
next unless key =~ /_dependencies\z/
cached_asset[:metadata][key] = value.dup
cached_asset[:metadata][key].map! {|uri| compress_from_root(uri) }
end
end
# Unloaded asset and stored_asset now have a different URI
stored_asset = UnloadedAsset.new(asset[:uri], self)
cache.set(stored_asset.asset_key, cached_asset, true)
# Save the new relative path for the digest key of the unloaded asset
cache.set(unloaded.digest_key(asset[:dependencies_digest]), stored_asset.compressed_path, true)
end | ruby | def store_asset(asset, unloaded)
# Save the asset in the cache under the new URI
cached_asset = asset.dup
cached_asset[:uri] = compress_from_root(asset[:uri])
cached_asset[:filename] = compress_from_root(asset[:filename])
cached_asset[:load_path] = compress_from_root(asset[:load_path])
if cached_asset[:metadata]
# Deep dup to avoid modifying `asset`
cached_asset[:metadata] = cached_asset[:metadata].dup
if cached_asset[:metadata][:included] && !cached_asset[:metadata][:included].empty?
cached_asset[:metadata][:included] = cached_asset[:metadata][:included].dup
cached_asset[:metadata][:included].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:links] && !cached_asset[:metadata][:links].empty?
cached_asset[:metadata][:links] = cached_asset[:metadata][:links].dup
cached_asset[:metadata][:links].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:stubbed] && !cached_asset[:metadata][:stubbed].empty?
cached_asset[:metadata][:stubbed] = cached_asset[:metadata][:stubbed].dup
cached_asset[:metadata][:stubbed].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:required] && !cached_asset[:metadata][:required].empty?
cached_asset[:metadata][:required] = cached_asset[:metadata][:required].dup
cached_asset[:metadata][:required].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:to_load] && !cached_asset[:metadata][:to_load].empty?
cached_asset[:metadata][:to_load] = cached_asset[:metadata][:to_load].dup
cached_asset[:metadata][:to_load].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:to_link] && !cached_asset[:metadata][:to_link].empty?
cached_asset[:metadata][:to_link] = cached_asset[:metadata][:to_link].dup
cached_asset[:metadata][:to_link].map! { |uri| compress_from_root(uri) }
end
if cached_asset[:metadata][:dependencies] && !cached_asset[:metadata][:dependencies].empty?
cached_asset[:metadata][:dependencies] = cached_asset[:metadata][:dependencies].dup
cached_asset[:metadata][:dependencies].map! do |uri|
uri.start_with?("file-digest://".freeze) ? compress_from_root(uri) : uri
end
end
# compress all _dependencies in metadata like `sass_dependencies`
cached_asset[:metadata].each do |key, value|
next unless key =~ /_dependencies\z/
cached_asset[:metadata][key] = value.dup
cached_asset[:metadata][key].map! {|uri| compress_from_root(uri) }
end
end
# Unloaded asset and stored_asset now have a different URI
stored_asset = UnloadedAsset.new(asset[:uri], self)
cache.set(stored_asset.asset_key, cached_asset, true)
# Save the new relative path for the digest key of the unloaded asset
cache.set(unloaded.digest_key(asset[:dependencies_digest]), stored_asset.compressed_path, true)
end | [
"def",
"store_asset",
"(",
"asset",
",",
"unloaded",
")",
"# Save the asset in the cache under the new URI",
"cached_asset",
"=",
"asset",
".",
"dup",
"cached_asset",
"[",
":uri",
"]",
"=",
"compress_from_root",
"(",
"asset",
"[",
":uri",
"]",
")",
"cached_asset",
... | Internal: Save a given asset to the cache
asset - A hash containing values of loaded asset
unloaded - The UnloadedAsset used to lookup the `asset`
This method converts all absolute paths to "compressed" paths
which are relative if they're in the root. | [
"Internal",
":",
"Save",
"a",
"given",
"asset",
"to",
"the",
"cache"
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/loader.rb#L198-L259 | train | Stores the asset in the cache | [
30522,
13366,
3573,
1035,
11412,
1006,
11412,
1010,
4895,
30524,
2072,
17053,
2094,
1035,
11412,
1027,
11412,
1012,
4241,
2361,
17053,
2094,
1035,
11412,
1031,
1024,
24471,
2072,
1033,
1027,
4012,
20110,
1035,
2013,
1035,
7117,
1006,
11412,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb | Azure::Labservices::Mgmt::V2018_10_15.Environments.reset_password | def reset_password(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
response = reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
nil
end | ruby | def reset_password(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:nil)
response = reset_password_async(resource_group_name, lab_account_name, lab_name, environment_setting_name, environment_name, reset_password_payload, custom_headers:custom_headers).value!
nil
end | [
"def",
"reset_password",
"(",
"resource_group_name",
",",
"lab_account_name",
",",
"lab_name",
",",
"environment_setting_name",
",",
"environment_name",
",",
"reset_password_payload",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"reset_password_async",
"(",
... | Resets the user password on an environment This operation can take a while to
complete
@param resource_group_name [String] The name of the resource group.
@param lab_account_name [String] The name of the lab Account.
@param lab_name [String] The name of the lab.
@param environment_setting_name [String] The name of the environment Setting.
@param environment_name [String] The name of the environment.
@param reset_password_payload [ResetPasswordPayload] Represents the payload
for resetting passwords.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Resets",
"the",
"user",
"password",
"on",
"an",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb#L646-L649 | train | Reset the password of the specified environment. | [
30522,
13366,
25141,
1035,
20786,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
6845,
1035,
4070,
1035,
2171,
1010,
6845,
1035,
2171,
1010,
4044,
1035,
4292,
1035,
2171,
1010,
4044,
1035,
2171,
1010,
25141,
1035,
20786,
1035,
18093,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_backup/lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb | Azure::RecoveryServicesBackup::Mgmt::V2016_06_01.ProtectionContainers.refresh_with_http_info | def refresh_with_http_info(vault_name, resource_group_name, fabric_name, custom_headers:nil)
refresh_async(vault_name, resource_group_name, fabric_name, custom_headers:custom_headers).value!
end | ruby | def refresh_with_http_info(vault_name, resource_group_name, fabric_name, custom_headers:nil)
refresh_async(vault_name, resource_group_name, fabric_name, custom_headers:custom_headers).value!
end | [
"def",
"refresh_with_http_info",
"(",
"vault_name",
",",
"resource_group_name",
",",
"fabric_name",
",",
"custom_headers",
":",
"nil",
")",
"refresh_async",
"(",
"vault_name",
",",
"resource_group_name",
",",
"fabric_name",
",",
"custom_headers",
":custom_headers",
")",... | Discovers the containers in the subscription that can be protected in a
Recovery Services vault. This is an asynchronous operation. To learn the
status of the operation, use the GetRefreshOperationResult API.
@param vault_name [String] The name of the Recovery Services vault.
@param resource_group_name [String] The name of the resource group associated
with the Recovery Services vault.
@param fabric_name [String] The fabric name associated with the container.
@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. | [
"Discovers",
"the",
"containers",
"in",
"the",
"subscription",
"that",
"can",
"be",
"protected",
"in",
"a",
"Recovery",
"Services",
"vault",
".",
"This",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"learn",
"the",
"status",
"of",
"the",
"operation",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_backup/lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb#L279-L281 | train | Refresh an existing index of the specified fabric. | [
30522,
13366,
25416,
21898,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
8313,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
25416,
21898,
1035,
2004,
6038,
227... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_money.rb | SquareConnect.V1Money.currency_code= | def currency_code=(currency_code)
validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
unless validator.valid?(currency_code)
fail ArgumentError, "invalid value for 'currency_code', must be one of #{validator.allowable_values}."
end
@currency_code = currency_code
end | ruby | def currency_code=(currency_code)
validator = EnumAttributeValidator.new('String', ["UNKNOWN_CURRENCY", "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LVL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "USS", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XTS", "XXX", "YER", "ZAR", "ZMK", "ZMW", "BTC"])
unless validator.valid?(currency_code)
fail ArgumentError, "invalid value for 'currency_code', must be one of #{validator.allowable_values}."
end
@currency_code = currency_code
end | [
"def",
"currency_code",
"=",
"(",
"currency_code",
")",
"validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"UNKNOWN_CURRENCY\"",
",",
"\"AED\"",
",",
"\"AFN\"",
",",
"\"ALL\"",
",",
"\"AMD\"",
",",
"\"ANG\"",
",",
"\"AOA\"",
"... | Custom attribute writer method checking allowed values (enum).
@param [Object] currency_code Object to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"checking",
"allowed",
"values",
"(",
"enum",
")",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/v1_money.rb#L94-L100 | train | Returns the index of the next valid currency code. | [
30522,
13366,
9598,
1035,
3642,
1027,
1006,
9598,
1035,
3642,
1007,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
4242,
1035,
9598,
1000,
1010,
1000,
29347,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_scheduler/lib/2016-03-01/generated/azure_mgmt_scheduler/jobs.rb | Azure::Scheduler::Mgmt::V2016_03_01.Jobs.delete | def delete(resource_group_name, job_collection_name, job_name, custom_headers:nil)
response = delete_async(resource_group_name, job_collection_name, job_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, job_collection_name, job_name, custom_headers:nil)
response = delete_async(resource_group_name, job_collection_name, job_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"job_collection_name",
",",
"job_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"job_collection_name",
",",
"job_name",
",",
"custom_headers",
":custom_... | Deletes a job.
@param resource_group_name [String] The resource group name.
@param job_collection_name [String] The job collection name.
@param job_name [String] The job name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"a",
"job",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_scheduler/lib/2016-03-01/generated/azure_mgmt_scheduler/jobs.rb#L354-L357 | train | Deletes a job from the job collection. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3105,
1035,
3074,
1035,
2171,
1010,
3105,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
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_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/connector_mappings.rb | Azure::CustomerInsights::Mgmt::V2017_01_01.ConnectorMappings.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, hub_name, connector_name, mapping_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, hub_name, connector_name, mapping_name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, hub_name, connector_name, mapping_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, hub_name, connector_name, mapping_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"hub_name",
",",
"connector_name",
",",
"mapping_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"hub_name",
",",
"con... | Creates a connector mapping or updates an existing connector mapping in the
connector.
@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 mapping_name [String] The name of the connector mapping.
@param parameters [ConnectorMappingResourceFormat] Parameters supplied to the
CreateOrUpdate Connector Mapping operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"a",
"connector",
"mapping",
"or",
"updates",
"an",
"existing",
"connector",
"mapping",
"in",
"the",
"connector",
"."
] | 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/connector_mappings.rb#L62-L64 | train | Creates or updates a connector mapping. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9594,
1035,
2171,
1010,
19400,
1035,
2171,
1010,
12375,
1035,
2171,
1010,
11709,
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... |
sds/overcommit | lib/overcommit/hook_context/pre_commit.rb | Overcommit::HookContext.PreCommit.setup_environment | def setup_environment
store_modified_times
Overcommit::GitRepo.store_merge_state
Overcommit::GitRepo.store_cherry_pick_state
if !initial_commit? && any_changes?
@stash_attempted = true
stash_message = "Overcommit: Stash of repo state before hook run at #{Time.now}"
result = Overcommit::Utils.execute(
%w[git -c commit.gpgsign=false stash save --keep-index --quiet] + [stash_message]
)
unless result.success?
# Failure to stash in this case is likely due to a configuration
# issue (e.g. author/email not set or GPG signing key incorrect)
raise Overcommit::Exceptions::HookSetupFailed,
"Unable to setup environment for #{hook_script_name} hook run:" \
"\nSTDOUT:#{result.stdout}\nSTDERR:#{result.stderr}"
end
@changes_stashed = `git stash list -1`.include?(stash_message)
end
# While running the hooks make it appear as if nothing changed
restore_modified_times
end | ruby | def setup_environment
store_modified_times
Overcommit::GitRepo.store_merge_state
Overcommit::GitRepo.store_cherry_pick_state
if !initial_commit? && any_changes?
@stash_attempted = true
stash_message = "Overcommit: Stash of repo state before hook run at #{Time.now}"
result = Overcommit::Utils.execute(
%w[git -c commit.gpgsign=false stash save --keep-index --quiet] + [stash_message]
)
unless result.success?
# Failure to stash in this case is likely due to a configuration
# issue (e.g. author/email not set or GPG signing key incorrect)
raise Overcommit::Exceptions::HookSetupFailed,
"Unable to setup environment for #{hook_script_name} hook run:" \
"\nSTDOUT:#{result.stdout}\nSTDERR:#{result.stderr}"
end
@changes_stashed = `git stash list -1`.include?(stash_message)
end
# While running the hooks make it appear as if nothing changed
restore_modified_times
end | [
"def",
"setup_environment",
"store_modified_times",
"Overcommit",
"::",
"GitRepo",
".",
"store_merge_state",
"Overcommit",
"::",
"GitRepo",
".",
"store_cherry_pick_state",
"if",
"!",
"initial_commit?",
"&&",
"any_changes?",
"@stash_attempted",
"=",
"true",
"stash_message",
... | Stash unstaged contents of files so hooks don't see changes that aren't
about to be committed. | [
"Stash",
"unstaged",
"contents",
"of",
"files",
"so",
"hooks",
"don",
"t",
"see",
"changes",
"that",
"aren",
"t",
"about",
"to",
"be",
"committed",
"."
] | 35d60adb41da942178b789560968e3ad030b0ac7 | https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/hook_context/pre_commit.rb#L46-L72 | train | Setup the environment for the hook. | [
30522,
13366,
16437,
1035,
4044,
3573,
1035,
6310,
1035,
2335,
2058,
9006,
22930,
1024,
1024,
21025,
7913,
6873,
1012,
3573,
1035,
13590,
1035,
2110,
2058,
9006,
22930,
1024,
1024,
21025,
7913,
6873,
1012,
3573,
1035,
9115,
1035,
4060,
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_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.update_prebuilt_entity_role | def update_prebuilt_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
response = update_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_prebuilt_entity_role(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:nil)
response = update_prebuilt_entity_role_async(app_id, version_id, entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_prebuilt_entity_role",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"role_id",
",",
"entity_role_update_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_prebuilt_entity_role_async",
"(",
"app_id",
",",
"version_id",
... | Update a role for a given prebuilt entity in a version of the application
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id The entity ID.
@param role_id The entity role ID.
@param entity_role_update_object [EntityRoleUpdateObject] The new entity
role.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatus] operation results. | [
"Update",
"a",
"role",
"for",
"a",
"given",
"prebuilt",
"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#L9193-L9196 | train | Updates a prebuilt entity role. | [
30522,
13366,
10651,
1035,
3653,
8569,
4014,
2102,
1035,
9178,
1035,
2535,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
9178,
1035,
2535,
1035,
10651,
1035,
4874,
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... |
Katello/katello | app/controllers/katello/api/registry/registry_proxies_controller.rb | Katello.Api::Registry::RegistryProxiesController.readable_repositories | def readable_repositories
table_name = Repository.table_name
in_products = Repository.in_product(Katello::Product.authorized(:view_products)).select(:id)
in_environments = Repository.where(:environment_id => Katello::KTEnvironment.authorized(:view_lifecycle_environments)).select(:id)
in_unauth_environments = Repository.joins(:environment).where("#{Katello::KTEnvironment.table_name}.registry_unauthenticated_pull" => true).select(:id)
in_content_views = Repository.joins(:content_view_repositories).where("#{ContentViewRepository.table_name}.content_view_id" => Katello::ContentView.readable).select(:id)
in_versions = Repository.joins(:content_view_version).where("#{Katello::ContentViewVersion.table_name}.content_view_id" => Katello::ContentView.readable).select(:id)
Repository.where("#{table_name}.id in (?) or #{table_name}.id in (?) or #{table_name}.id in (?) or #{table_name}.id in (?) or #{table_name}.id in (?)", in_products, in_content_views, in_versions, in_environments, in_unauth_environments)
end | ruby | def readable_repositories
table_name = Repository.table_name
in_products = Repository.in_product(Katello::Product.authorized(:view_products)).select(:id)
in_environments = Repository.where(:environment_id => Katello::KTEnvironment.authorized(:view_lifecycle_environments)).select(:id)
in_unauth_environments = Repository.joins(:environment).where("#{Katello::KTEnvironment.table_name}.registry_unauthenticated_pull" => true).select(:id)
in_content_views = Repository.joins(:content_view_repositories).where("#{ContentViewRepository.table_name}.content_view_id" => Katello::ContentView.readable).select(:id)
in_versions = Repository.joins(:content_view_version).where("#{Katello::ContentViewVersion.table_name}.content_view_id" => Katello::ContentView.readable).select(:id)
Repository.where("#{table_name}.id in (?) or #{table_name}.id in (?) or #{table_name}.id in (?) or #{table_name}.id in (?) or #{table_name}.id in (?)", in_products, in_content_views, in_versions, in_environments, in_unauth_environments)
end | [
"def",
"readable_repositories",
"table_name",
"=",
"Repository",
".",
"table_name",
"in_products",
"=",
"Repository",
".",
"in_product",
"(",
"Katello",
"::",
"Product",
".",
"authorized",
"(",
":view_products",
")",
")",
".",
"select",
"(",
":id",
")",
"in_envi... | Reduce visible repos to include lifecycle env permissions
http://projects.theforeman.org/issues/22914
Also include repositories in lifecycle environments with registry_unauthenticated_pull=true | [
"Reduce",
"visible",
"repos",
"to",
"include",
"lifecycle",
"env",
"permissions",
"http",
":",
"//",
"projects",
".",
"theforeman",
".",
"org",
"/",
"issues",
"/",
"22914",
"Also",
"include",
"repositories",
"in",
"lifecycle",
"environments",
"with",
"registry_u... | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/controllers/katello/api/registry/registry_proxies_controller.rb#L92-L100 | train | Returns an array of all the readable repositories that are readable for the current user. | [
30522,
13366,
3191,
3085,
1035,
16360,
20049,
29469,
2229,
2795,
1035,
2171,
1027,
22409,
1012,
2795,
1035,
2171,
1999,
1035,
3688,
1027,
22409,
1012,
1999,
1035,
4031,
1006,
5736,
7174,
1024,
1024,
4031,
1012,
9362,
1006,
1024,
3193,
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/generator/generator_fetcher.rb | GitHubChangelogGenerator.Generator.associate_tagged_prs | def associate_tagged_prs(tags, prs, total)
@fetcher.fetch_tag_shas_async(tags)
i = 0
prs.reject do |pr|
found = false
# XXX Wish I could use merge_commit_sha, but gcg doesn't currently
# fetch that. See
# https://developer.github.com/v3/pulls/#get-a-single-pull-request vs.
# https://developer.github.com/v3/pulls/#list-pull-requests
if pr["events"] && (event = pr["events"].find { |e| e["event"] == "merged" })
# Iterate tags.reverse (oldest to newest) to find first tag of each PR.
if (oldest_tag = tags.reverse.find { |tag| tag["shas_in_tag"].include?(event["commit_id"]) })
pr["first_occurring_tag"] = oldest_tag["name"]
found = true
i += 1
print("Associating PRs with tags: #{i}/#{total}\r") if @options[:verbose]
end
else
# Either there were no events or no merged event. Github's api can be
# weird like that apparently. Check for a rebased comment before erroring.
no_events_pr = associate_rebase_comment_prs(tags, [pr], total)
raise StandardError, "No merge sha found for PR #{pr['number']} via the GitHub API" unless no_events_pr.empty?
found = true
i += 1
print("Associating PRs with tags: #{i}/#{total}\r") if @options[:verbose]
end
found
end
end | ruby | def associate_tagged_prs(tags, prs, total)
@fetcher.fetch_tag_shas_async(tags)
i = 0
prs.reject do |pr|
found = false
# XXX Wish I could use merge_commit_sha, but gcg doesn't currently
# fetch that. See
# https://developer.github.com/v3/pulls/#get-a-single-pull-request vs.
# https://developer.github.com/v3/pulls/#list-pull-requests
if pr["events"] && (event = pr["events"].find { |e| e["event"] == "merged" })
# Iterate tags.reverse (oldest to newest) to find first tag of each PR.
if (oldest_tag = tags.reverse.find { |tag| tag["shas_in_tag"].include?(event["commit_id"]) })
pr["first_occurring_tag"] = oldest_tag["name"]
found = true
i += 1
print("Associating PRs with tags: #{i}/#{total}\r") if @options[:verbose]
end
else
# Either there were no events or no merged event. Github's api can be
# weird like that apparently. Check for a rebased comment before erroring.
no_events_pr = associate_rebase_comment_prs(tags, [pr], total)
raise StandardError, "No merge sha found for PR #{pr['number']} via the GitHub API" unless no_events_pr.empty?
found = true
i += 1
print("Associating PRs with tags: #{i}/#{total}\r") if @options[:verbose]
end
found
end
end | [
"def",
"associate_tagged_prs",
"(",
"tags",
",",
"prs",
",",
"total",
")",
"@fetcher",
".",
"fetch_tag_shas_async",
"(",
"tags",
")",
"i",
"=",
"0",
"prs",
".",
"reject",
"do",
"|",
"pr",
"|",
"found",
"=",
"false",
"# XXX Wish I could use merge_commit_sha, bu... | Associate merged PRs by the merge SHA contained in each tag. If the
merge_commit_sha is not found in any tag's history, skip association.
@param [Array] tags The tags sorted by time, newest to oldest.
@param [Array] prs The PRs to associate.
@return [Array] PRs without their merge_commit_sha in a tag. | [
"Associate",
"merged",
"PRs",
"by",
"the",
"merge",
"SHA",
"contained",
"in",
"each",
"tag",
".",
"If",
"the",
"merge_commit_sha",
"is",
"not",
"found",
"in",
"any",
"tag",
"s",
"history",
"skip",
"association",
"."
] | f18c64b5cc0d7473b059275b88385ac11ca8b564 | https://github.com/github-changelog-generator/github-changelog-generator/blob/f18c64b5cc0d7473b059275b88385ac11ca8b564/lib/github_changelog_generator/generator/generator_fetcher.rb#L66-L96 | train | Associate the tags with the PRs that have been tagged with the given tags. | [
30522,
13366,
5482,
1035,
26610,
1035,
10975,
2015,
1006,
22073,
1010,
10975,
2015,
1010,
2561,
1007,
1030,
18584,
2121,
1012,
18584,
1035,
6415,
1035,
21146,
2015,
1035,
2004,
6038,
2278,
1006,
22073,
1007,
1045,
1027,
1014,
10975,
2015,
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... |
rmagick/rmagick | lib/rmagick_internal.rb | Magick.Geometry.to_s | def to_s
str = ''
if @width > 0
fmt = @width.truncate == @width ? '%d' : '%.2f'
str << format(fmt, @width)
str << '%' if @flag == PercentGeometry
end
str << 'x' if (@width > 0 && @flag != PercentGeometry) || (@height > 0)
if @height > 0
fmt = @height.truncate == @height ? '%d' : '%.2f'
str << format(fmt, @height)
str << '%' if @flag == PercentGeometry
end
str << format('%+d%+d', @x, @y) if @x != 0 || @y != 0
str << FLAGS[@flag.to_i] if @flag != PercentGeometry
str
end | ruby | def to_s
str = ''
if @width > 0
fmt = @width.truncate == @width ? '%d' : '%.2f'
str << format(fmt, @width)
str << '%' if @flag == PercentGeometry
end
str << 'x' if (@width > 0 && @flag != PercentGeometry) || (@height > 0)
if @height > 0
fmt = @height.truncate == @height ? '%d' : '%.2f'
str << format(fmt, @height)
str << '%' if @flag == PercentGeometry
end
str << format('%+d%+d', @x, @y) if @x != 0 || @y != 0
str << FLAGS[@flag.to_i] if @flag != PercentGeometry
str
end | [
"def",
"to_s",
"str",
"=",
"''",
"if",
"@width",
">",
"0",
"fmt",
"=",
"@width",
".",
"truncate",
"==",
"@width",
"?",
"'%d'",
":",
"'%.2f'",
"str",
"<<",
"format",
"(",
"fmt",
",",
"@width",
")",
"str",
"<<",
"'%'",
"if",
"@flag",
"==",
"PercentGe... | Convert object to a geometry string | [
"Convert",
"object",
"to",
"a",
"geometry",
"string"
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/lib/rmagick_internal.rb#L130-L148 | train | Returns the string representation of the geometry. | [
30522,
13366,
2000,
1035,
1055,
2358,
2099,
1027,
1005,
1005,
2065,
1030,
9381,
1028,
1014,
4718,
2102,
1027,
1030,
9381,
1012,
19817,
4609,
16280,
1027,
1027,
1030,
9381,
1029,
1005,
1003,
1040,
1005,
1024,
1005,
1003,
1012,
1016,
2546,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jeremytregunna/ruby-trello | lib/trello/plugin_datum.rb | Trello.PluginDatum.update_fields | def update_fields(fields)
attributes[:id] = fields['id'] || attributes[:id]
attributes[:idPlugin] = fields['idPlugin'] || attributes[:idPlugin]
attributes[:scope] = fields['scope'] || attributes[:scope]
attributes[:value] = JSON.parse(fields['value']).presence if fields.has_key?('value')
attributes[:idModel] = fields['idModel'] || attributes[:idModel]
attributes[:access] = fields['access'] || attributes[:access]
self
end | ruby | def update_fields(fields)
attributes[:id] = fields['id'] || attributes[:id]
attributes[:idPlugin] = fields['idPlugin'] || attributes[:idPlugin]
attributes[:scope] = fields['scope'] || attributes[:scope]
attributes[:value] = JSON.parse(fields['value']).presence if fields.has_key?('value')
attributes[:idModel] = fields['idModel'] || attributes[:idModel]
attributes[:access] = fields['access'] || attributes[:access]
self
end | [
"def",
"update_fields",
"(",
"fields",
")",
"attributes",
"[",
":id",
"]",
"=",
"fields",
"[",
"'id'",
"]",
"||",
"attributes",
"[",
":id",
"]",
"attributes",
"[",
":idPlugin",
"]",
"=",
"fields",
"[",
"'idPlugin'",
"]",
"||",
"attributes",
"[",
":idPlug... | Supply a hash of stringkeyed data retrieved from the Trello API representing
an attachment. | [
"Supply",
"a",
"hash",
"of",
"stringkeyed",
"data",
"retrieved",
"from",
"the",
"Trello",
"API",
"representing",
"an",
"attachment",
"."
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/plugin_datum.rb#L23-L31 | train | Update the fields of the object | [
30522,
13366,
10651,
1035,
4249,
1006,
4249,
1007,
12332,
1031,
1024,
8909,
1033,
1027,
4249,
1031,
1005,
8909,
1005,
1033,
1064,
1064,
12332,
1031,
1024,
8909,
1033,
12332,
1031,
1024,
8909,
24759,
15916,
2378,
1033,
1027,
4249,
1031,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_trigger_histories.rb | Azure::Logic::Mgmt::V2016_06_01.WorkflowTriggerHistories.get_with_http_info | def get_with_http_info(resource_group_name, workflow_name, trigger_name, history_name, custom_headers:nil)
get_async(resource_group_name, workflow_name, trigger_name, history_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, workflow_name, trigger_name, history_name, custom_headers:nil)
get_async(resource_group_name, workflow_name, trigger_name, history_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"trigger_name",
",",
"history_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"workflow_name",
",",
"trigger_name",
",",
"history_name",
",... | Gets a workflow trigger history.
@param resource_group_name [String] The resource group name.
@param workflow_name [String] The workflow name.
@param trigger_name [String] The workflow trigger name.
@param history_name [String] The workflow trigger history name. Corresponds
to the run name for triggers that resulted in a run.
@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",
"a",
"workflow",
"trigger",
"history",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_logic/lib/2016-06-01/generated/azure_mgmt_logic/workflow_trigger_histories.rb#L160-L162 | train | Gets the specified history of a workflow trigger. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2147,
12314,
1035,
2171,
1010,
9495,
1035,
2171,
1010,
2381,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
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_recovery_services_backup/lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/protection_policies.rb | Azure::RecoveryServicesBackup::Mgmt::V2016_06_01.ProtectionPolicies.get_with_http_info | def get_with_http_info(vault_name, resource_group_name, policy_name, custom_headers:nil)
get_async(vault_name, resource_group_name, policy_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(vault_name, resource_group_name, policy_name, custom_headers:nil)
get_async(vault_name, resource_group_name, policy_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"vault_name",
",",
"resource_group_name",
",",
"policy_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"vault_name",
",",
"resource_group_name",
",",
"policy_name",
",",
"custom_headers",
":custom_headers",
")",
".",
... | Gets the details of the backup policy associated with the Recovery Services
vault. This is an asynchronous operation. Use the GetPolicyOperationResult
API to Get the operation status.
@param vault_name [String] The name of the Recovery Services vault.
@param resource_group_name [String] The name of the resource group associated
with the Recovery Services vault.
@param policy_name [String] The backup policy name used in this GET
operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"details",
"of",
"the",
"backup",
"policy",
"associated",
"with",
"the",
"Recovery",
"Services",
"vault",
".",
"This",
"is",
"an",
"asynchronous",
"operation",
".",
"Use",
"the",
"GetPolicyOperationResult",
"API",
"to",
"Get",
"the",
"operation",
... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_backup/lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/protection_policies.rb#L63-L65 | train | Gets the specified policy in a specified vault. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3343,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
6038,
2278,
1006,
11632,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb | Azure::CognitiveServices::Customvisiontraining::V3_0.CustomvisiontrainingClient.get_domain | def get_domain(domain_id, custom_headers:nil)
response = get_domain_async(domain_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_domain(domain_id, custom_headers:nil)
response = get_domain_async(domain_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_domain",
"(",
"domain_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_domain_async",
"(",
"domain_id",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"response",
".",
"nil?",
"end"
... | Get information about a specific domain.
@param domain_id The id of the domain to get information about.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Domain] operation results. | [
"Get",
"information",
"about",
"a",
"specific",
"domain",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisiontraining/lib/3.0/generated/azure_cognitiveservices_customvisiontraining/customvisiontraining_client.rb#L223-L226 | train | Gets the domain information for a domain. | [
30522,
13366,
2131,
1035,
5884,
1006,
5884,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
5884,
1035,
2004,
6038,
2278,
1006,
5884,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_customer_insights/lib/2017-01-01/generated/azure_mgmt_customer_insights/authorization_policies.rb | Azure::CustomerInsights::Mgmt::V2017_01_01.AuthorizationPolicies.get_with_http_info | def get_with_http_info(resource_group_name, hub_name, authorization_policy_name, custom_headers:nil)
get_async(resource_group_name, hub_name, authorization_policy_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, hub_name, authorization_policy_name, custom_headers:nil)
get_async(resource_group_name, hub_name, authorization_policy_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"hub_name",
",",
"authorization_policy_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"hub_name",
",",
"authorization_policy_name",
",",
"custom_headers",
":custom_... | Gets an authorization policy in the hub.
@param resource_group_name [String] The name of the resource group.
@param hub_name [String] The name of the hub.
@param authorization_policy_name [String] The name of the policy.
@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",
"an",
"authorization",
"policy",
"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/authorization_policies.rb#L177-L179 | train | Gets the specified authorization policy. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
9594,
1035,
2171,
1010,
20104,
1035,
3343,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/network_interface.rb | Aws::EC2.NetworkInterface.attach | def attach(options = {})
options = options.merge(network_interface_id: @id)
resp = @client.attach_network_interface(options)
resp.data
end | ruby | def attach(options = {})
options = options.merge(network_interface_id: @id)
resp = @client.attach_network_interface(options)
resp.data
end | [
"def",
"attach",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"network_interface_id",
":",
"@id",
")",
"resp",
"=",
"@client",
".",
"attach_network_interface",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
network_interface.attach({
device_index: 1, # required
dry_run: false,
instance_id: "String", # required
})
@param [Hash] options ({})
@option options [required, Integer] :device_index
The index of the device for the network interface attachment.
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@option options [required, String] :instance_id
The ID of the instance.
@return [Types::AttachNetworkInterfaceResult] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/network_interface.rb#L323-L327 | train | Attach this network interface to a network interface. | [
30522,
13366,
22476,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2897,
1035,
8278,
1035,
8909,
1024,
1030,
8909,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
22476,
1035,
2897,
1035,
8278,
1006,
7047,
1007,
24501,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/express_route_cross_connection_peerings.rb | Azure::Network::Mgmt::V2018_07_01.ExpressRouteCrossConnectionPeerings.get_with_http_info | def get_with_http_info(resource_group_name, cross_connection_name, peering_name, custom_headers:nil)
get_async(resource_group_name, cross_connection_name, peering_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(resource_group_name, cross_connection_name, peering_name, custom_headers:nil)
get_async(resource_group_name, cross_connection_name, peering_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"resource_group_name",
",",
"cross_connection_name",
",",
"peering_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"resource_group_name",
",",
"cross_connection_name",
",",
"peering_name",
",",
"custom_headers",
":custom_... | Gets the specified peering for the ExpressRouteCrossConnection.
@param resource_group_name [String] The name of the resource group.
@param cross_connection_name [String] The name of the
ExpressRouteCrossConnection.
@param peering_name [String] The name of the peering.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"specified",
"peering",
"for",
"the",
"ExpressRouteCrossConnection",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/express_route_cross_connection_peerings.rb#L190-L192 | train | Gets the specified ExpressRouteCrossConnectionExpressRoutePeering. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2892,
1035,
4434,
1035,
2171,
1010,
16740,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
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... |
appsignal/rdkafka-ruby | lib/rdkafka/consumer.rb | Rdkafka.Consumer.committed | def committed(list=nil, timeout_ms=1200)
if list.nil?
list = assignment
elsif !list.is_a?(TopicPartitionList)
raise TypeError.new("list has to be nil or a TopicPartitionList")
end
tpl = list.to_native_tpl
response = Rdkafka::Bindings.rd_kafka_committed(@native_kafka, tpl, timeout_ms)
if response != 0
raise Rdkafka::RdkafkaError.new(response)
end
TopicPartitionList.from_native_tpl(tpl)
end | ruby | def committed(list=nil, timeout_ms=1200)
if list.nil?
list = assignment
elsif !list.is_a?(TopicPartitionList)
raise TypeError.new("list has to be nil or a TopicPartitionList")
end
tpl = list.to_native_tpl
response = Rdkafka::Bindings.rd_kafka_committed(@native_kafka, tpl, timeout_ms)
if response != 0
raise Rdkafka::RdkafkaError.new(response)
end
TopicPartitionList.from_native_tpl(tpl)
end | [
"def",
"committed",
"(",
"list",
"=",
"nil",
",",
"timeout_ms",
"=",
"1200",
")",
"if",
"list",
".",
"nil?",
"list",
"=",
"assignment",
"elsif",
"!",
"list",
".",
"is_a?",
"(",
"TopicPartitionList",
")",
"raise",
"TypeError",
".",
"new",
"(",
"\"list has... | Return the current committed offset per partition for this consumer group.
The offset field of each requested partition will either be set to stored offset or to -1001 in case there was no stored offset for that partition.
@param list [TopicPartitionList, nil] The topic with partitions to get the offsets for or nil to use the current subscription.
@param timeout_ms [Integer] The timeout for fetching this information.
@raise [RdkafkaError] When getting the committed positions fails.
@return [TopicPartitionList] | [
"Return",
"the",
"current",
"committed",
"offset",
"per",
"partition",
"for",
"this",
"consumer",
"group",
".",
"The",
"offset",
"field",
"of",
"each",
"requested",
"partition",
"will",
"either",
"be",
"set",
"to",
"stored",
"offset",
"or",
"to",
"-",
"1001"... | 87b3e0ddae5ea576847cb67228fcea06ec2a24d6 | https://github.com/appsignal/rdkafka-ruby/blob/87b3e0ddae5ea576847cb67228fcea06ec2a24d6/lib/rdkafka/consumer.rb#L165-L177 | train | Commit the current assignment to the Kafka broker. | [
30522,
13366,
5462,
1006,
2862,
1027,
9152,
2140,
1010,
2051,
5833,
1035,
5796,
1027,
14840,
1007,
2065,
2862,
1012,
9152,
2140,
1029,
2862,
1027,
8775,
3449,
5332,
2546,
999,
2862,
1012,
2003,
1035,
1037,
1029,
1006,
8476,
19362,
3775,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/variable_operations.rb | Azure::Automation::Mgmt::V2015_10_31.VariableOperations.delete | def delete(resource_group_name, automation_account_name, variable_name, custom_headers:nil)
response = delete_async(resource_group_name, automation_account_name, variable_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, automation_account_name, variable_name, custom_headers:nil)
response = delete_async(resource_group_name, automation_account_name, variable_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"variable_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"variable_name",
",",
"custom_hea... | Delete the variable.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param variable_name [String] The name of variable.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"the",
"variable",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/variable_operations.rb#L270-L273 | train | Deletes a variable. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
8023,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
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... |
cloudfoundry/bosh | src/bosh-director/lib/bosh/director/orphan_network_manager.rb | Bosh::Director.OrphanNetworkManager.list_orphan_networks | def list_orphan_networks
Models::Network.where(orphaned: true).map do |network|
{
'name' => network.name,
'type' => network.type,
'created_at' => network.created_at.to_s,
'orphaned_at' => network.orphaned_at.to_s,
}
end
end | ruby | def list_orphan_networks
Models::Network.where(orphaned: true).map do |network|
{
'name' => network.name,
'type' => network.type,
'created_at' => network.created_at.to_s,
'orphaned_at' => network.orphaned_at.to_s,
}
end
end | [
"def",
"list_orphan_networks",
"Models",
"::",
"Network",
".",
"where",
"(",
"orphaned",
":",
"true",
")",
".",
"map",
"do",
"|",
"network",
"|",
"{",
"'name'",
"=>",
"network",
".",
"name",
",",
"'type'",
"=>",
"network",
".",
"type",
",",
"'created_at'... | returns a list of orphaned networks | [
"returns",
"a",
"list",
"of",
"orphaned",
"networks"
] | 2eaa7100879ddd20cd909cd698514746195e28b7 | https://github.com/cloudfoundry/bosh/blob/2eaa7100879ddd20cd909cd698514746195e28b7/src/bosh-director/lib/bosh/director/orphan_network_manager.rb#L38-L47 | train | Returns an array of the network objects that are not owned by the current user. | [
30522,
13366,
2862,
1035,
18211,
1035,
6125,
4275,
1024,
1024,
2897,
1012,
2073,
1006,
27093,
1024,
2995,
1007,
1012,
4949,
2079,
1064,
2897,
1064,
1063,
1005,
2171,
1005,
1027,
1028,
2897,
1012,
2171,
1010,
1005,
2828,
1005,
1027,
1028,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/ruby_parser.rb | HamlLint.RubyParser.parse | def parse(source)
buffer = ::Parser::Source::Buffer.new('(string)')
buffer.source = source
@parser.reset
@parser.parse(buffer)
end | ruby | def parse(source)
buffer = ::Parser::Source::Buffer.new('(string)')
buffer.source = source
@parser.reset
@parser.parse(buffer)
end | [
"def",
"parse",
"(",
"source",
")",
"buffer",
"=",
"::",
"Parser",
"::",
"Source",
"::",
"Buffer",
".",
"new",
"(",
"'(string)'",
")",
"buffer",
".",
"source",
"=",
"source",
"@parser",
".",
"reset",
"@parser",
".",
"parse",
"(",
"buffer",
")",
"end"
] | Creates a reusable parser.
Parse the given Ruby source into an abstract syntax tree.
@param source [String] Ruby source code
@return [Array] syntax tree in the form returned by Parser gem | [
"Creates",
"a",
"reusable",
"parser",
".",
"Parse",
"the",
"given",
"Ruby",
"source",
"into",
"an",
"abstract",
"syntax",
"tree",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/ruby_parser.rb#L25-L31 | train | Parse the given source | [
30522,
13366,
11968,
3366,
1006,
3120,
1007,
17698,
1027,
1024,
1024,
11968,
8043,
1024,
1024,
3120,
1024,
1024,
17698,
1012,
2047,
1006,
1005,
1006,
5164,
1007,
1005,
1007,
17698,
1012,
3120,
1027,
3120,
1030,
11968,
8043,
1012,
25141,
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... |
boazsegev/combine_pdf | lib/combine_pdf/page_methods.rb | CombinePDF.Page_Methods.copy | def copy(secure = false)
# since only the Content streams are modified (Resource hashes are created anew),
# it should be safe (and a lot faster) to create a deep copy only for the content hashes and streams.
delete :Parent
prep_content_array
page_copy = clone
page_copy[:Contents] = page_copy[:Contents].map do |obj|
obj = obj.dup
obj[:referenced_object] = obj[:referenced_object].dup if obj[:referenced_object]
obj[:referenced_object][:raw_stream_content] = obj[:referenced_object][:raw_stream_content].dup if obj[:referenced_object] && obj[:referenced_object][:raw_stream_content]
obj
end
if page_copy[:Resources]
page_res = page_copy[:Resources] = page_copy[:Resources].dup
page_res = page_copy[:Resources][:referenced_object] = page_copy[:Resources][:referenced_object].dup if page_copy[:Resources][:referenced_object]
page_res.each do |k, v|
v = page_res[k] = v.dup if v.is_a?(Array) || v.is_a?(Hash)
v = v[:referenced_object] = v[:referenced_object].dup if v.is_a?(Hash) && v[:referenced_object]
end
end
page_copy.instance_exec(secure || @secure_injection) { |s| secure_for_copy if s; init_contents; self }
end | ruby | def copy(secure = false)
# since only the Content streams are modified (Resource hashes are created anew),
# it should be safe (and a lot faster) to create a deep copy only for the content hashes and streams.
delete :Parent
prep_content_array
page_copy = clone
page_copy[:Contents] = page_copy[:Contents].map do |obj|
obj = obj.dup
obj[:referenced_object] = obj[:referenced_object].dup if obj[:referenced_object]
obj[:referenced_object][:raw_stream_content] = obj[:referenced_object][:raw_stream_content].dup if obj[:referenced_object] && obj[:referenced_object][:raw_stream_content]
obj
end
if page_copy[:Resources]
page_res = page_copy[:Resources] = page_copy[:Resources].dup
page_res = page_copy[:Resources][:referenced_object] = page_copy[:Resources][:referenced_object].dup if page_copy[:Resources][:referenced_object]
page_res.each do |k, v|
v = page_res[k] = v.dup if v.is_a?(Array) || v.is_a?(Hash)
v = v[:referenced_object] = v[:referenced_object].dup if v.is_a?(Hash) && v[:referenced_object]
end
end
page_copy.instance_exec(secure || @secure_injection) { |s| secure_for_copy if s; init_contents; self }
end | [
"def",
"copy",
"(",
"secure",
"=",
"false",
")",
"# since only the Content streams are modified (Resource hashes are created anew),",
"# it should be safe (and a lot faster) to create a deep copy only for the content hashes and streams.",
"delete",
":Parent",
"prep_content_array",
"page_copy... | creates a copy of the page. if the :secure flag is set to true, the resource indentifiers (fonts etc') will be renamed in order to secure their uniqueness. | [
"creates",
"a",
"copy",
"of",
"the",
"page",
".",
"if",
"the",
":",
"secure",
"flag",
"is",
"set",
"to",
"true",
"the",
"resource",
"indentifiers",
"(",
"fonts",
"etc",
")",
"will",
"be",
"renamed",
"in",
"order",
"to",
"secure",
"their",
"uniqueness",
... | 09054051019c069f551f3e60be789577c0f93900 | https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/page_methods.rb#L634-L655 | train | This method copies the contents of the page to the new location. | [
30522,
13366,
6100,
1006,
5851,
1027,
6270,
1007,
1001,
2144,
2069,
1996,
4180,
9199,
2024,
6310,
1006,
7692,
23325,
2229,
2024,
2580,
2019,
7974,
1007,
1010,
1001,
2009,
2323,
2022,
3647,
1006,
1998,
1037,
2843,
5514,
1007,
2000,
3443,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fastlane/fastlane | supply/lib/supply/client.rb | Supply.Client.listing_for_language | def listing_for_language(language)
ensure_active_edit!
begin
result = client.get_listing(
current_package_name,
current_edit.id,
language
)
return Listing.new(self, language, result)
rescue Google::Apis::ClientError => e
return Listing.new(self, language) if e.status_code == 404 # create a new empty listing
raise
end
end | ruby | def listing_for_language(language)
ensure_active_edit!
begin
result = client.get_listing(
current_package_name,
current_edit.id,
language
)
return Listing.new(self, language, result)
rescue Google::Apis::ClientError => e
return Listing.new(self, language) if e.status_code == 404 # create a new empty listing
raise
end
end | [
"def",
"listing_for_language",
"(",
"language",
")",
"ensure_active_edit!",
"begin",
"result",
"=",
"client",
".",
"get_listing",
"(",
"current_package_name",
",",
"current_edit",
".",
"id",
",",
"language",
")",
"return",
"Listing",
".",
"new",
"(",
"self",
","... | Returns the listing for the given language filled with the current values if it already exists | [
"Returns",
"the",
"listing",
"for",
"the",
"given",
"language",
"filled",
"with",
"the",
"current",
"values",
"if",
"it",
"already",
"exists"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/supply/lib/supply/client.rb#L187-L202 | train | Get the listing for a given language | [
30522,
13366,
10328,
1035,
2005,
1035,
2653,
1006,
2653,
1007,
5676,
1035,
3161,
1035,
10086,
999,
4088,
2765,
1027,
7396,
1012,
2131,
1035,
10328,
1006,
2783,
1035,
7427,
1035,
2171,
1010,
2783,
1035,
10086,
1012,
8909,
1010,
2653,
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/util/windows/sid.rb | Puppet::Util::Windows.SID.ads_to_principal | def ads_to_principal(ads_object)
if !ads_object || !ads_object.respond_to?(:ole_respond_to?) ||
!ads_object.ole_respond_to?(:objectSID) || !ads_object.ole_respond_to?(:Name)
raise Puppet::Error.new("ads_object must be an IAdsUser or IAdsGroup instance")
end
octet_string_to_principal(ads_object.objectSID)
rescue Puppet::Util::Windows::Error => e
# if the error is not a lookup / mapping problem, immediately re-raise
raise if e.code != ERROR_NONE_MAPPED
# if the Name property isn't formatted like a SID, OR
if !valid_sid?(ads_object.Name) ||
# if the objectSID doesn't match the Name property, also raise
((converted = octet_string_to_sid_string(ads_object.objectSID)) != ads_object.Name)
raise Puppet::Error.new("ads_object Name: #{ads_object.Name} invalid or does not match objectSID: #{ads_object.objectSID} (#{converted})", e)
end
unresolved_principal(ads_object.Name, ads_object.objectSID)
end | ruby | def ads_to_principal(ads_object)
if !ads_object || !ads_object.respond_to?(:ole_respond_to?) ||
!ads_object.ole_respond_to?(:objectSID) || !ads_object.ole_respond_to?(:Name)
raise Puppet::Error.new("ads_object must be an IAdsUser or IAdsGroup instance")
end
octet_string_to_principal(ads_object.objectSID)
rescue Puppet::Util::Windows::Error => e
# if the error is not a lookup / mapping problem, immediately re-raise
raise if e.code != ERROR_NONE_MAPPED
# if the Name property isn't formatted like a SID, OR
if !valid_sid?(ads_object.Name) ||
# if the objectSID doesn't match the Name property, also raise
((converted = octet_string_to_sid_string(ads_object.objectSID)) != ads_object.Name)
raise Puppet::Error.new("ads_object Name: #{ads_object.Name} invalid or does not match objectSID: #{ads_object.objectSID} (#{converted})", e)
end
unresolved_principal(ads_object.Name, ads_object.objectSID)
end | [
"def",
"ads_to_principal",
"(",
"ads_object",
")",
"if",
"!",
"ads_object",
"||",
"!",
"ads_object",
".",
"respond_to?",
"(",
":ole_respond_to?",
")",
"||",
"!",
"ads_object",
".",
"ole_respond_to?",
"(",
":objectSID",
")",
"||",
"!",
"ads_object",
".",
"ole_r... | Converts a COM instance of IAdsUser or IAdsGroup to a SID::Principal object,
Raises an Error for nil or an object without an objectSID / Name property.
This method returns a SID::Principal with the account, domain, SID, etc
This method will return instances even when the SID is unresolvable, as
may be the case when domain users have been added to local groups, but
removed from the domain | [
"Converts",
"a",
"COM",
"instance",
"of",
"IAdsUser",
"or",
"IAdsGroup",
"to",
"a",
"SID",
"::",
"Principal",
"object",
"Raises",
"an",
"Error",
"for",
"nil",
"or",
"an",
"object",
"without",
"an",
"objectSID",
"/",
"Name",
"property",
".",
"This",
"method... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/windows/sid.rb#L107-L125 | train | Convert an IAdsUser or IAdsGroup object to a principal | [
30522,
13366,
14997,
1035,
2000,
1035,
4054,
1006,
14997,
1035,
4874,
1007,
2065,
999,
14997,
1035,
4874,
1064,
1064,
999,
14997,
1035,
4874,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
15589,
1035,
6869,
1035,
2000,
1029,
1007,
1064,
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... |
cucumber/aruba | lib/aruba/event_bus.rb | Aruba.EventBus.notify | def notify(event)
fail NoEventError, 'Please pass an event object, not a class' if event.is_a?(Class)
@handlers[event.class.to_s].each { |handler| handler.call(event) }
end | ruby | def notify(event)
fail NoEventError, 'Please pass an event object, not a class' if event.is_a?(Class)
@handlers[event.class.to_s].each { |handler| handler.call(event) }
end | [
"def",
"notify",
"(",
"event",
")",
"fail",
"NoEventError",
",",
"'Please pass an event object, not a class'",
"if",
"event",
".",
"is_a?",
"(",
"Class",
")",
"@handlers",
"[",
"event",
".",
"class",
".",
"to_s",
"]",
".",
"each",
"{",
"|",
"handler",
"|",
... | Broadcast an event
@param [Object] event
An object of registered event class. This object is passed to the event
handler. | [
"Broadcast",
"an",
"event"
] | add17615322f575588aef1fccce875396cdf36e9 | https://github.com/cucumber/aruba/blob/add17615322f575588aef1fccce875396cdf36e9/lib/aruba/event_bus.rb#L53-L57 | train | Notify all registered handlers | [
30522,
13366,
2025,
8757,
1006,
2724,
1007,
8246,
2053,
18697,
10111,
18933,
2099,
1010,
1005,
3531,
3413,
2019,
2724,
4874,
1010,
2025,
1037,
2465,
1005,
2065,
2724,
1012,
2003,
1035,
1037,
1029,
1006,
2465,
1007,
1030,
28213,
2015,
1031,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_hierarchical_entity | def update_hierarchical_entity(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:nil)
response = update_hierarchical_entity_async(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_hierarchical_entity(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:nil)
response = update_hierarchical_entity_async(app_id, version_id, h_entity_id, hierarchical_model_update_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_hierarchical_entity",
"(",
"app_id",
",",
"version_id",
",",
"h_entity_id",
",",
"hierarchical_model_update_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_hierarchical_entity_async",
"(",
"app_id",
",",
"version_id",
",",
"h_ent... | Updates the name and children of a hierarchical entity model in a version of
the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param h_entity_id The hierarchical entity extractor ID.
@param hierarchical_model_update_object [HierarchicalEntityModel] Model
containing names of the children of the hierarchical entity.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [OperationStatus] operation results. | [
"Updates",
"the",
"name",
"and",
"children",
"of",
"a",
"hierarchical",
"entity",
"model",
"in",
"a",
"version",
"of",
"the",
"application",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L2529-L2532 | train | Updates a hierarchical entity. | [
30522,
13366,
10651,
1035,
25835,
1035,
9178,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
1044,
1035,
9178,
1035,
8909,
1010,
25835,
1035,
2944,
1035,
10651,
1035,
4874,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_deployed_service_type_info_list_with_http_info | def get_deployed_service_type_info_list_with_http_info(node_name, application_id, service_manifest_name:nil, timeout:60, custom_headers:nil)
get_deployed_service_type_info_list_async(node_name, application_id, service_manifest_name:service_manifest_name, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_deployed_service_type_info_list_with_http_info(node_name, application_id, service_manifest_name:nil, timeout:60, custom_headers:nil)
get_deployed_service_type_info_list_async(node_name, application_id, service_manifest_name:service_manifest_name, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_deployed_service_type_info_list_with_http_info",
"(",
"node_name",
",",
"application_id",
",",
"service_manifest_name",
":",
"nil",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"get_deployed_service_type_info_list_async",
"(",
"node_name",
... | Gets the list containing the information about service types from the
applications deployed on a node in a Service Fabric cluster.
Gets the list containing the information about service types from the
applications deployed on a node in a Service Fabric cluster. The response
includes the name of the service type, its registration status, the code
package that registered it and activation ID of the service package.
@param node_name [String] The name of the node.
@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 service_manifest_name [String] The name of the service manifest to
filter the list of deployed service type information. If specified, the
response will only contain the information about service types that are
defined in this service manifest.
@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",
"the",
"list",
"containing",
"the",
"information",
"about",
"service",
"types",
"from",
"the",
"applications",
"deployed",
"on",
"a",
"node",
"in",
"a",
"Service",
"Fabric",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L5764-L5766 | train | Gets the list of service type info for a node. | [
30522,
13366,
2131,
1035,
7333,
1035,
2326,
1035,
2828,
1035,
18558,
1035,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
13045,
1035,
2171,
1010,
4646,
1035,
8909,
1010,
2326,
1035,
19676,
1035,
2171,
1024,
9152,
2140,
1010,
2051,
5833,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_privatedns/lib/2018-09-01/generated/azure_mgmt_privatedns/private_zones.rb | Azure::PrivateDns::Mgmt::V2018_09_01.PrivateZones.delete | def delete(resource_group_name, private_zone_name, if_match:nil, custom_headers:nil)
response = delete_async(resource_group_name, private_zone_name, if_match:if_match, custom_headers:custom_headers).value!
nil
end | ruby | def delete(resource_group_name, private_zone_name, if_match:nil, custom_headers:nil)
response = delete_async(resource_group_name, private_zone_name, if_match:if_match, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"resource_group_name",
",",
"private_zone_name",
",",
"if_match",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"resource_group_name",
",",
"private_zone_name",
",",
"if_match",
":if_match",
",",
"c... | Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be
deleted. This operation cannot be undone. Private DNS zone cannot be deleted
unless all virtual network links to it are removed.
@param resource_group_name [String] The name of the resource group.
@param private_zone_name [String] The name of the Private DNS zone (without a
terminating dot).
@param if_match [String] The ETag of the Private DNS zone. Omit this value to
always delete the current zone. Specify the last-seen ETag value to prevent
accidentally deleting any concurrent changes.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"a",
"Private",
"DNS",
"zone",
".",
"WARNING",
":",
"All",
"DNS",
"records",
"in",
"the",
"zone",
"will",
"also",
"be",
"deleted",
".",
"This",
"operation",
"cannot",
"be",
"undone",
".",
"Private",
"DNS",
"zone",
"cannot",
"be",
"deleted",
"u... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_privatedns/lib/2018-09-01/generated/azure_mgmt_privatedns/private_zones.rb#L152-L155 | train | Deletes a private DNS zone. | [
30522,
13366,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2797,
1035,
4224,
1035,
2171,
1010,
2065,
1035,
2674,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3972,
12870,
1035,
2004,
6038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
CanCanCommunity/cancancan | lib/cancan/conditions_matcher.rb | CanCan.ConditionsMatcher.matches_conditions? | def matches_conditions?(action, subject, attribute = nil, *extra_args)
return call_block_with_all(action, subject, extra_args) if @match_all
return matches_block_conditions(subject, attribute, *extra_args) if @block
return matches_non_block_conditions(subject) unless conditions_empty?
true
end | ruby | def matches_conditions?(action, subject, attribute = nil, *extra_args)
return call_block_with_all(action, subject, extra_args) if @match_all
return matches_block_conditions(subject, attribute, *extra_args) if @block
return matches_non_block_conditions(subject) unless conditions_empty?
true
end | [
"def",
"matches_conditions?",
"(",
"action",
",",
"subject",
",",
"attribute",
"=",
"nil",
",",
"*",
"extra_args",
")",
"return",
"call_block_with_all",
"(",
"action",
",",
"subject",
",",
"extra_args",
")",
"if",
"@match_all",
"return",
"matches_block_conditions"... | Matches the block or conditions hash | [
"Matches",
"the",
"block",
"or",
"conditions",
"hash"
] | b2e5660c6b9b683fc45b8f425b90c4d06e2f24bf | https://github.com/CanCanCommunity/cancancan/blob/b2e5660c6b9b683fc45b8f425b90c4d06e2f24bf/lib/cancan/conditions_matcher.rb#L6-L12 | train | Returns true if the subject matches the conditions. | [
30522,
13366,
3503,
1035,
3785,
1029,
1006,
2895,
1010,
3395,
1010,
17961,
1027,
9152,
2140,
1010,
1008,
4469,
1035,
12098,
5620,
1007,
2709,
2655,
1035,
3796,
1035,
2007,
1035,
2035,
1006,
2895,
1010,
3395,
1010,
4469,
1035,
12098,
5620,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.list_with_http_info | def list_with_http_info(filter:nil, top:nil, skip:nil, expand:nil, select:nil, orderby:nil, count:nil, search:nil, format:nil, custom_headers:nil)
list_async(filter:filter, top:top, skip:skip, expand:expand, select:select, orderby:orderby, count:count, search:search, format:format, custom_headers:custom_headers).value!
end | ruby | def list_with_http_info(filter:nil, top:nil, skip:nil, expand:nil, select:nil, orderby:nil, count:nil, search:nil, format:nil, custom_headers:nil)
list_async(filter:filter, top:top, skip:skip, expand:expand, select:select, orderby:orderby, count:count, search:search, format:format, custom_headers:custom_headers).value!
end | [
"def",
"list_with_http_info",
"(",
"filter",
":",
"nil",
",",
"top",
":",
"nil",
",",
"skip",
":",
"nil",
",",
"expand",
":",
"nil",
",",
"select",
":",
"nil",
",",
"orderby",
":",
"nil",
",",
"count",
":",
"nil",
",",
"search",
":",
"nil",
",",
... | Gets the first page of Data Lake Analytics accounts, if any, within the
current subscription. This includes a link to the next page, if any.
@param filter [String] OData filter. Optional.
@param top [Integer] The number of items to return. Optional.
@param skip [Integer] The number of items to skip over before returning
elements. Optional.
@param expand [String] OData expansion. Expand related resources in line with
the retrieved resources, e.g. Categories/$expand=Products would expand
Product data in line with each Category entry. Optional.
@param select [String] OData Select statement. Limits the properties on each
entry to just those requested, e.g.
Categories?$select=CategoryName,Description. Optional.
@param orderby [String] OrderBy clause. One or more comma-separated
expressions with an optional "asc" (the default) or "desc" depending on the
order you'd like the values sorted, e.g. Categories?$orderby=CategoryName
desc. Optional.
@param count [Boolean] The Boolean value of true or false to request a count
of the matching resources included with the resources in the response, e.g.
Categories?$count=true. Optional.
@param search [String] A free form search. A free-text search expression to
match for whether a particular entry should be included in the feed, e.g.
Categories?$search=blue OR green. Optional.
@param format [String] The desired return format. Return the response in
particular formatxii without access to request headers for standard
content-type negotiation (e.g Orders?$format=json). Optional.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"first",
"page",
"of",
"Data",
"Lake",
"Analytics",
"accounts",
"if",
"any",
"within",
"the",
"current",
"subscription",
".",
"This",
"includes",
"a",
"link",
"to",
"the",
"next",
"page",
"if",
"any",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb#L1683-L1685 | train | Gets a list of all the image objects in a collection of image objects. | [
30522,
13366,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11307,
1024,
9152,
2140,
1010,
2327,
1024,
9152,
2140,
1010,
13558,
1024,
9152,
2140,
1010,
7818,
1024,
9152,
2140,
1010,
7276,
1024,
9152,
2140,
1010,
2344,
3762,
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... |
gjtorikian/html-proofer | lib/html-proofer/url_validator.rb | HTMLProofer.UrlValidator.external_link_checker | def external_link_checker(external_urls)
external_urls = Hash[external_urls.sort]
count = external_urls.length
check_text = pluralize(count, 'external link', 'external links')
@logger.log :info, "Checking #{check_text}..."
# Route log from Typhoeus/Ethon to our own logger
Ethon.logger = @logger
establish_queue(external_urls)
@hydra.run
end | ruby | def external_link_checker(external_urls)
external_urls = Hash[external_urls.sort]
count = external_urls.length
check_text = pluralize(count, 'external link', 'external links')
@logger.log :info, "Checking #{check_text}..."
# Route log from Typhoeus/Ethon to our own logger
Ethon.logger = @logger
establish_queue(external_urls)
@hydra.run
end | [
"def",
"external_link_checker",
"(",
"external_urls",
")",
"external_urls",
"=",
"Hash",
"[",
"external_urls",
".",
"sort",
"]",
"count",
"=",
"external_urls",
".",
"length",
"check_text",
"=",
"pluralize",
"(",
"count",
",",
"'external link'",
",",
"'external lin... | Proofer runs faster if we pull out all the external URLs and run the checks
at the end. Otherwise, we're halting the consuming process for every file during
`process_files`.
In addition, sorting the list lets libcurl keep connections to the same hosts alive.
Finally, we'll first make a HEAD request, rather than GETing all the contents.
If the HEAD fails, we'll fall back to GET, as some servers are not configured
for HEAD. If we've decided to check for hashes, we must do a GET--HEAD is
not available as an option. | [
"Proofer",
"runs",
"faster",
"if",
"we",
"pull",
"out",
"all",
"the",
"external",
"URLs",
"and",
"run",
"the",
"checks",
"at",
"the",
"end",
".",
"Otherwise",
"we",
"re",
"halting",
"the",
"consuming",
"process",
"for",
"every",
"file",
"during",
"process_... | d00955d3b125b9a1649d056bb347ec30e935d847 | https://github.com/gjtorikian/html-proofer/blob/d00955d3b125b9a1649d056bb347ec30e935d847/lib/html-proofer/url_validator.rb#L90-L103 | train | Check if external links are available | [
30522,
13366,
6327,
1035,
4957,
1035,
4638,
2121,
1006,
6327,
1035,
24471,
4877,
1007,
6327,
1035,
24471,
4877,
1027,
23325,
1031,
6327,
1035,
24471,
4877,
1012,
4066,
1033,
4175,
1027,
6327,
1035,
24471,
4877,
1012,
3091,
4638,
1035,
3793,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_keys_with_http_info | def get_keys_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_keys_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | ruby | def get_keys_with_http_info(vault_base_url, maxresults:nil, custom_headers:nil)
get_keys_async(vault_base_url, maxresults:maxresults, custom_headers:custom_headers).value!
end | [
"def",
"get_keys_with_http_info",
"(",
"vault_base_url",
",",
"maxresults",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_keys_async",
"(",
"vault_base_url",
",",
"maxresults",
":",
"maxresults",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!... | List keys in the specified vault.
Retrieves a list of the keys in the Key Vault as JSON Web Key structures that
contain the public part of a stored key. The LIST operation is applicable to
all key types, however only the base key identifier, attributes, and tags are
provided in the response. Individual versions of a key are not listed in the
response. This operation requires the keys/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",
"keys",
"in",
"the",
"specified",
"vault",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L946-L948 | train | Gets the keys of the specified vault. | [
30522,
13366,
2131,
1035,
6309,
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,
2131,
1035,
6309,
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-cloudformation/lib/aws-sdk-cloudformation/resource.rb | Aws::CloudFormation.Resource.stacks | def stacks(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_stacks(options)
resp.each_page do |page|
batch = []
page.data.stacks.each do |s|
batch << Stack.new(
name: s.stack_name,
data: s,
client: @client
)
end
y.yield(batch)
end
end
Stack::Collection.new(batches)
end | ruby | def stacks(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_stacks(options)
resp.each_page do |page|
batch = []
page.data.stacks.each do |s|
batch << Stack.new(
name: s.stack_name,
data: s,
client: @client
)
end
y.yield(batch)
end
end
Stack::Collection.new(batches)
end | [
"def",
"stacks",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"resp",
"=",
"@client",
".",
"describe_stacks",
"(",
"options",
")",
"resp",
".",
"each_page",
"do",
"|",
"page",
"|",
"batch",
"=",
... | @example Request syntax with placeholder values
stacks = cloud_formation.stacks({
stack_name: "StackName",
})
@param [Hash] options ({})
@option options [String] :stack_name
The name or the unique stack ID that is associated with the stack,
which are not always interchangeable:
* Running stacks: You can specify either the stack's name or its
unique stack ID.
* Deleted stacks: You must specify the unique stack ID.
Default: There is no default value.
@return [Stack::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-cloudformation/lib/aws-sdk-cloudformation/resource.rb#L351-L367 | train | Returns a collection of all stacks in the cluster | [
30522,
13366,
20829,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
24501,
2361,
1027,
1030,
7396,
1012,
6235,
1035,
20829,
1006,
7047,
1007,
24501,
2361,
1012,
2169,
1035,
393... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/service_endpoint_policies.rb | Azure::Network::Mgmt::V2018_07_01.ServiceEndpointPolicies.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(resource_group_name, service_endpoint_policy_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, service_endpoint_policy_name, parameters, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(resource_group_name, service_endpoint_policy_name, parameters, custom_headers:nil)
begin_create_or_update_async(resource_group_name, service_endpoint_policy_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"service_endpoint_policy_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"resource_group_name",
",",
"service_endpoint_policy_name",
",",
"par... | Creates or updates a service Endpoint Policies.
@param resource_group_name [String] The name of the resource group.
@param service_endpoint_policy_name [String] The name of the service endpoint
policy.
@param parameters [ServiceEndpointPolicy] Parameters supplied to the create
or update service endpoint policy operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"a",
"service",
"Endpoint",
"Policies",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/service_endpoint_policies.rb#L545-L547 | train | Creates or updates a service endpoint policy. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2203,
8400,
1035,
3343,
1035,
2171,
1010,
11709,
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_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/storage_account_credentials.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.StorageAccountCredentials.begin_create_or_update_with_http_info | def begin_create_or_update_with_http_info(storage_account_credential_name, parameters, resource_group_name, manager_name, custom_headers:nil)
begin_create_or_update_async(storage_account_credential_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def begin_create_or_update_with_http_info(storage_account_credential_name, parameters, resource_group_name, manager_name, custom_headers:nil)
begin_create_or_update_async(storage_account_credential_name, parameters, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"begin_create_or_update_with_http_info",
"(",
"storage_account_credential_name",
",",
"parameters",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"begin_create_or_update_async",
"(",
"storage_account_credential_name",
",",
"para... | Creates or updates the storage account credential.
@param storage_account_credential_name [String] The storage account
credential name.
@param parameters [StorageAccountCredential] The storage account credential
to be added or updated.
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Creates",
"or",
"updates",
"the",
"storage",
"account",
"credential",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/storage_account_credentials.rb#L344-L346 | train | Creates or updates a storage account credential. | [
30522,
13366,
4088,
1035,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5527,
1035,
4070,
1035,
13675,
14728,
19909,
1035,
2171,
1010,
11709,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-rds/lib/aws-sdk-rds/db_parameter_group.rb | Aws::RDS.DBParameterGroup.parameters | def parameters(options = {})
batches = Enumerator.new do |y|
options = options.merge(db_parameter_group_name: @name)
resp = @client.describe_db_parameters(options)
resp.each_page do |page|
batch = []
page.data.parameters.each do |p|
batch << Parameter.new(
name: p.parameter_name,
data: p,
client: @client
)
end
y.yield(batch)
end
end
Parameter::Collection.new(batches)
end | ruby | def parameters(options = {})
batches = Enumerator.new do |y|
options = options.merge(db_parameter_group_name: @name)
resp = @client.describe_db_parameters(options)
resp.each_page do |page|
batch = []
page.data.parameters.each do |p|
batch << Parameter.new(
name: p.parameter_name,
data: p,
client: @client
)
end
y.yield(batch)
end
end
Parameter::Collection.new(batches)
end | [
"def",
"parameters",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"options",
"=",
"options",
".",
"merge",
"(",
"db_parameter_group_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"describe_db_... | @example Request syntax with placeholder values
parameters = db_parameter_group.parameters({
source: "String",
filters: [
{
name: "String", # required
values: ["String"], # required
},
],
})
@param [Hash] options ({})
@option options [String] :source
The parameter types to return.
Default: All parameter types returned
Valid Values: `user | system | engine-default`
@option options [Array<Types::Filter>] :filters
This parameter is not currently supported.
@return [Parameter::Collection] | [
"@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_parameter_group.rb#L530-L547 | train | Returns a list of all parameters in the database. | [
30522,
13366,
11709,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
7047,
1027,
7047,
1012,
13590,
1006,
16962,
1035,
16381,
1035,
2177,
1035,
2171,
1024,
1030,
2171,
1007,
245... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_recovery_plans.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationRecoveryPlans.unplanned_failover | def unplanned_failover(recovery_plan_name, input, custom_headers:nil)
response = unplanned_failover_async(recovery_plan_name, input, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def unplanned_failover(recovery_plan_name, input, custom_headers:nil)
response = unplanned_failover_async(recovery_plan_name, input, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"unplanned_failover",
"(",
"recovery_plan_name",
",",
"input",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"unplanned_failover_async",
"(",
"recovery_plan_name",
",",
"input",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response"... | Execute unplanned failover of the recovery plan.
The operation to start the failover of a recovery plan.
@param recovery_plan_name [String] Recovery plan name.
@param input [RecoveryPlanUnplannedFailoverInput] Failover input.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RecoveryPlan] operation results. | [
"Execute",
"unplanned",
"failover",
"of",
"the",
"recovery",
"plan",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replication_recovery_plans.rb#L568-L571 | train | Unplanned failover for the specified Recovery Plan. | [
30522,
13366,
4895,
24759,
20147,
2094,
1035,
8246,
7840,
1006,
7233,
1035,
2933,
1035,
2171,
1010,
7953,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4895,
24759,
20147,
2094,
1035,
8246,
7840,
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... |
piotrmurach/tty-prompt | lib/tty/prompt.rb | TTY.Prompt.invoke_question | def invoke_question(object, message, *args, &block)
options = Utils.extract_options!(args)
options[:messages] = self.class.messages
question = object.new(self, options)
question.(message, &block)
end | ruby | def invoke_question(object, message, *args, &block)
options = Utils.extract_options!(args)
options[:messages] = self.class.messages
question = object.new(self, options)
question.(message, &block)
end | [
"def",
"invoke_question",
"(",
"object",
",",
"message",
",",
"*",
"args",
",",
"&",
"block",
")",
"options",
"=",
"Utils",
".",
"extract_options!",
"(",
"args",
")",
"options",
"[",
":messages",
"]",
"=",
"self",
".",
"class",
".",
"messages",
"question... | Initialize a Prompt
@param [Hash] options
@option options [IO] :input
the input stream
@option options [IO] :output
the output stream
@option options [Hash] :env
the environment variables
@option options [String] :prefix
the prompt prefix, by default empty
@option options [Boolean] :enable_color
enable color support, true by default
@option options [String] :active_color
the color used for selected option
@option options [String] :help_color
the color used for help text
@option options [String] :error_color
the color used for displaying error messages
@option options [Symbol] :interrupt
handling of Ctrl+C key out of :signal, :exit, :noop
@option options [Boolean] :track_history
disable line history tracking, true by default
@option options [Hash] :symbols
the symbols displayed in prompts such as :pointer, :cross
@api public
Invoke a question type of prompt
@example
prompt = TTY::Prompt.new
prompt.invoke_question(Question, "Your name? ")
@return [String]
@api public | [
"Initialize",
"a",
"Prompt"
] | b1ff627afff98fa6477e5ef3ac4a718c52eff05a | https://github.com/piotrmurach/tty-prompt/blob/b1ff627afff98fa6477e5ef3ac4a718c52eff05a/lib/tty/prompt.rb#L164-L169 | train | Invoke a question object | [
30522,
13366,
1999,
6767,
3489,
1035,
3160,
1006,
4874,
1010,
4471,
1010,
1008,
12098,
5620,
1010,
1004,
3796,
1007,
7047,
1027,
21183,
12146,
1012,
14817,
1035,
7047,
999,
1006,
12098,
5620,
1007,
7047,
1031,
1024,
7696,
1033,
1027,
2969,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_async | def list_async(custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::Web::Mgmt::V2015_08_01::Models::AppServiceCertificateOrderCollection.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end | ruby | def list_async(custom_headers:nil)
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'
request_url = @base_url || @client.base_url
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
path_params: {'subscriptionId' => @client.subscription_id},
query_params: {'api-version' => @client.api_version},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::Web::Mgmt::V2015_08_01::Models::AppServiceCertificateOrderCollection.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end | [
"def",
"list_async",
"(",
"custom_headers",
":",
"nil",
")",
"fail",
"ArgumentError",
",",
"'@client.subscription_id is nil'",
"if",
"@client",
".",
"subscription_id",
".",
"nil?",
"fail",
"ArgumentError",
",",
"'@client.api_version is nil'",
"if",
"@client",
".",
"ap... | List all certificate orders in a subscription.
List all certificate orders in a subscription.
@param [Hash{String => String}] A hash of custom headers that will be added
to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response. | [
"List",
"all",
"certificate",
"orders",
"in",
"a",
"subscription",
"."
] | 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#L63-L112 | train | Gets all the certificate orders for a subscription. | [
30522,
13366,
2862,
1035,
2004,
6038,
2278,
1006,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
8246,
6685,
2121,
29165,
1010,
1005,
1030,
7396,
1012,
15002,
1035,
8909,
2003,
9152,
2140,
1005,
2065,
1030,
7396,
1012,
15002,
1035,
8909,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
CocoaPods/Xcodeproj | spec/spec_helper/project_helper.rb | SpecHelper.ProjectHelper.load_settings | def load_settings(path, type)
# Load fixture
base_path = Pathname(fixture_path("CommonBuildSettings/configs/#{path}"))
config_fixture = base_path + "#{path}_#{type}.xcconfig"
config = Xcodeproj::Config.new(config_fixture)
settings = config.to_hash
# Filter exclusions
settings = apply_exclusions(settings, EXCLUDED_KEYS)
project_defaults_by_config = Xcodeproj::Constants::PROJECT_DEFAULT_BUILD_SETTINGS
project_defaults = project_defaults_by_config[:all]
project_defaults.merge(project_defaults_by_config[type]) unless type == :base
settings = apply_exclusions(settings, project_defaults)
settings
end | ruby | def load_settings(path, type)
# Load fixture
base_path = Pathname(fixture_path("CommonBuildSettings/configs/#{path}"))
config_fixture = base_path + "#{path}_#{type}.xcconfig"
config = Xcodeproj::Config.new(config_fixture)
settings = config.to_hash
# Filter exclusions
settings = apply_exclusions(settings, EXCLUDED_KEYS)
project_defaults_by_config = Xcodeproj::Constants::PROJECT_DEFAULT_BUILD_SETTINGS
project_defaults = project_defaults_by_config[:all]
project_defaults.merge(project_defaults_by_config[type]) unless type == :base
settings = apply_exclusions(settings, project_defaults)
settings
end | [
"def",
"load_settings",
"(",
"path",
",",
"type",
")",
"# Load fixture",
"base_path",
"=",
"Pathname",
"(",
"fixture_path",
"(",
"\"CommonBuildSettings/configs/#{path}\"",
")",
")",
"config_fixture",
"=",
"base_path",
"+",
"\"#{path}_#{type}.xcconfig\"",
"config",
"=",
... | Load settings from fixtures
@param [String] path
the directory, where the fixture set is located.
@param [Symbol] type
the type, where the specific
@param [Hash{String => String}]
the build settings | [
"Load",
"settings",
"from",
"fixtures"
] | 3be1684437a6f8e69c7836ad4c85a2b78663272f | https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/spec/spec_helper/project_helper.rb#L81-L96 | train | Load the settings from a file | [
30522,
13366,
7170,
1035,
10906,
1006,
4130,
1010,
2828,
1007,
1001,
7170,
15083,
2918,
1035,
4130,
1027,
4130,
18442,
1006,
15083,
1035,
4130,
1006,
1000,
2691,
8569,
4014,
5104,
18319,
3070,
2015,
1013,
9530,
8873,
5620,
1013,
1001,
1063,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/unique_args.rb | SidekiqUniqueJobs.UniqueArgs.filter_by_symbol | def filter_by_symbol(args)
return args unless worker_method_defined?(unique_args_method)
worker_class.send(unique_args_method, args)
rescue ArgumentError => ex
log_fatal(ex)
args
end | ruby | def filter_by_symbol(args)
return args unless worker_method_defined?(unique_args_method)
worker_class.send(unique_args_method, args)
rescue ArgumentError => ex
log_fatal(ex)
args
end | [
"def",
"filter_by_symbol",
"(",
"args",
")",
"return",
"args",
"unless",
"worker_method_defined?",
"(",
"unique_args_method",
")",
"worker_class",
".",
"send",
"(",
"unique_args_method",
",",
"args",
")",
"rescue",
"ArgumentError",
"=>",
"ex",
"log_fatal",
"(",
"e... | Filters unique arguments by method configured in the sidekiq worker
@param [Array] args the arguments passed to the sidekiq worker
@return [Array] unfiltered unless {#worker_method_defined?}
@return [Array] with the filtered arguments | [
"Filters",
"unique",
"arguments",
"by",
"method",
"configured",
"in",
"the",
"sidekiq",
"worker"
] | 2944b97c720528f53962ccfd17d43ac939a77f46 | https://github.com/mhenrixon/sidekiq-unique-jobs/blob/2944b97c720528f53962ccfd17d43ac939a77f46/lib/sidekiq_unique_jobs/unique_args.rb#L128-L135 | train | Filter by symbol | [
30522,
13366,
11307,
1035,
2011,
1035,
6454,
1006,
12098,
5620,
1007,
2709,
12098,
5620,
4983,
7309,
1035,
4118,
1035,
4225,
1029,
1006,
4310,
1035,
12098,
5620,
1035,
4118,
1007,
7309,
1035,
2465,
1012,
4604,
1006,
4310,
1035,
12098,
5620,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_operational_insights/lib/2015-03-20/generated/azure_mgmt_operational_insights/workspaces.rb | Azure::OperationalInsights::Mgmt::V2015_03_20.Workspaces.get_search_results | def get_search_results(resource_group_name, workspace_name, parameters, custom_headers:nil)
response = get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_search_results(resource_group_name, workspace_name, parameters, custom_headers:nil)
response = get_search_results_async(resource_group_name, workspace_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_search_results",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_search_results_async",
"(",
"resource_group_name",
",",
"workspace_name",
",",
"parameters",
",",
"custom_hea... | Submit a search for a given workspace. The response will contain an id to
track the search. User can use the id to poll the search status and get the
full search result later if the search takes long time to finish.
@param resource_group_name [String] The name of the resource group to get.
The name is case insensitive.
@param workspace_name [String] Log Analytics workspace name
@param parameters [SearchParameters] The parameters required to execute a
search query.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [SearchResultsResponse] operation results. | [
"Submit",
"a",
"search",
"for",
"a",
"given",
"workspace",
".",
"The",
"response",
"will",
"contain",
"an",
"id",
"to",
"track",
"the",
"search",
".",
"User",
"can",
"use",
"the",
"id",
"to",
"poll",
"the",
"search",
"status",
"and",
"get",
"the",
"ful... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_operational_insights/lib/2015-03-20/generated/azure_mgmt_operational_insights/workspaces.rb#L243-L246 | train | Gets the search results for a given workspace. | [
30522,
13366,
2131,
1035,
3945,
1035,
3463,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2573,
15327,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
3945,
1035,
3463,
1035,
2004,
6038,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/express_route_circuits.rb | Azure::Network::Mgmt::V2019_02_01.ExpressRouteCircuits.get_peering_stats | def get_peering_stats(resource_group_name, circuit_name, peering_name, custom_headers:nil)
response = get_peering_stats_async(resource_group_name, circuit_name, peering_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_peering_stats(resource_group_name, circuit_name, peering_name, custom_headers:nil)
response = get_peering_stats_async(resource_group_name, circuit_name, peering_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_peering_stats",
"(",
"resource_group_name",
",",
"circuit_name",
",",
"peering_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_peering_stats_async",
"(",
"resource_group_name",
",",
"circuit_name",
",",
"peering_name",
",",
"custom_heade... | Gets all stats from an express route circuit in a resource group.
@param resource_group_name [String] The name of the resource group.
@param circuit_name [String] The name of the express route circuit.
@param peering_name [String] The name of the peering.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ExpressRouteCircuitStats] operation results. | [
"Gets",
"all",
"stats",
"from",
"an",
"express",
"route",
"circuit",
"in",
"a",
"resource",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/express_route_circuits.rb#L490-L493 | train | Gets the stats for the specified express route circuit. | [
30522,
13366,
2131,
1035,
16740,
1035,
26319,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4984,
1035,
2171,
1010,
16740,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
16740,
1035,
26319,
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... |
ruby/rake | lib/rake/application.rb | Rake.Application.invoke_task | def invoke_task(task_string) # :nodoc:
name, args = parse_task_string(task_string)
t = self[name]
t.invoke(*args)
end | ruby | def invoke_task(task_string) # :nodoc:
name, args = parse_task_string(task_string)
t = self[name]
t.invoke(*args)
end | [
"def",
"invoke_task",
"(",
"task_string",
")",
"# :nodoc:",
"name",
",",
"args",
"=",
"parse_task_string",
"(",
"task_string",
")",
"t",
"=",
"self",
"[",
"name",
"]",
"t",
".",
"invoke",
"(",
"args",
")",
"end"
] | internal ----------------------------------------------------------------
Invokes a task with arguments that are extracted from +task_string+ | [
"internal",
"----------------------------------------------------------------",
"Invokes",
"a",
"task",
"with",
"arguments",
"that",
"are",
"extracted",
"from",
"+",
"task_string",
"+"
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/application.rb#L157-L161 | train | Invoke a task | [
30522,
13366,
1999,
6767,
3489,
1035,
4708,
1006,
4708,
1035,
5164,
1007,
1001,
1024,
7293,
10085,
1024,
2171,
1010,
12098,
5620,
1027,
11968,
3366,
1035,
4708,
1035,
5164,
1006,
4708,
1035,
5164,
1007,
1056,
1027,
2969,
1031,
2171,
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 | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/express_route_cross_connections.rb | Azure::Network::Mgmt::V2018_07_01.ExpressRouteCrossConnections.list_routes_table_summary_async | def list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
# Send request
promise = begin_list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Network::Mgmt::V2018_07_01::Models::ExpressRouteCrossConnectionsRoutesTableSummaryListResult.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 list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil)
# Send request
promise = begin_list_routes_table_summary_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers)
promise = promise.then do |response|
# Defining deserialization method.
deserialize_method = lambda do |parsed_response|
result_mapper = Azure::Network::Mgmt::V2018_07_01::Models::ExpressRouteCrossConnectionsRoutesTableSummaryListResult.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",
"list_routes_table_summary_async",
"(",
"resource_group_name",
",",
"cross_connection_name",
",",
"peering_name",
",",
"device_path",
",",
"custom_headers",
":",
"nil",
")",
"# Send request",
"promise",
"=",
"begin_list_routes_table_summary_async",
"(",
"resource_group... | @param resource_group_name [String] The name of the resource group.
@param cross_connection_name [String] The name of the
ExpressRouteCrossConnection.
@param peering_name [String] The name of the peering.
@param device_path [String] The path of the device.
@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",
"cross_connection_name",
"[",
"String",
"]",
"The",
"name",
"of",
"the",
"ExpressRouteCrossConnection",
".",
"@param",
"peering_name",
"[",
"String... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/express_route_cross_connections.rb#L469-L485 | train | Gets the routes table summary for the specified ExpressRouteCrossConnections. | [
30522,
13366,
2862,
1035,
5847,
1035,
2795,
1035,
12654,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2892,
1035,
4434,
1035,
2171,
1010,
16740,
1035,
2171,
1010,
5080,
1035,
4130,
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... |
jekyll/jekyll-admin | lib/jekyll-admin/urlable.rb | JekyllAdmin.URLable.http_url | def http_url
return if is_a?(Jekyll::Collection) || is_a?(JekyllAdmin::DataFile)
return if is_a?(Jekyll::Document) && !collection.write?
@http_url ||= Addressable::URI.new(
:scheme => scheme, :host => host, :port => port,
:path => path_with_base(JekyllAdmin.site.config["baseurl"], url)
).normalize.to_s
end | ruby | def http_url
return if is_a?(Jekyll::Collection) || is_a?(JekyllAdmin::DataFile)
return if is_a?(Jekyll::Document) && !collection.write?
@http_url ||= Addressable::URI.new(
:scheme => scheme, :host => host, :port => port,
:path => path_with_base(JekyllAdmin.site.config["baseurl"], url)
).normalize.to_s
end | [
"def",
"http_url",
"return",
"if",
"is_a?",
"(",
"Jekyll",
"::",
"Collection",
")",
"||",
"is_a?",
"(",
"JekyllAdmin",
"::",
"DataFile",
")",
"return",
"if",
"is_a?",
"(",
"Jekyll",
"::",
"Document",
")",
"&&",
"!",
"collection",
".",
"write?",
"@http_url"... | Absolute URL to the HTTP(S) rendered/served representation of this resource | [
"Absolute",
"URL",
"to",
"the",
"HTTP",
"(",
"S",
")",
"rendered",
"/",
"served",
"representation",
"of",
"this",
"resource"
] | bc053b3b93faba679e8666091c42c47970e3bb5e | https://github.com/jekyll/jekyll-admin/blob/bc053b3b93faba679e8666091c42c47970e3bb5e/lib/jekyll-admin/urlable.rb#L7-L14 | train | Returns the HTTP URL for the current request. | [
30522,
13366,
8299,
1035,
24471,
2140,
2709,
2065,
2003,
1035,
1037,
1029,
1006,
15333,
4801,
3363,
1024,
1024,
3074,
1007,
1064,
1064,
2003,
1035,
1037,
1029,
1006,
15333,
4801,
4571,
22117,
2378,
1024,
1024,
2951,
8873,
2571,
1007,
2709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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_entity_roles | def list_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
response = list_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_entity_roles(app_id, version_id, entity_id, custom_headers:nil)
response = list_entity_roles_async(app_id, version_id, entity_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_entity_roles",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_entity_roles_async",
"(",
"app_id",
",",
"version_id",
",",
"entity_id",
",",
"custom_headers",
":custom_headers",
")",
"... | Get all roles for an entity in a version of the application
@param app_id The application ID.
@param version_id [String] The version ID.
@param entity_id entity Id
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Get",
"all",
"roles",
"for",
"an",
"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#L6124-L6127 | train | Gets the roles of the entity in a version of the application. | [
30522,
13366,
2862,
1035,
9178,
1035,
4395,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
9178,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
9178,
1035,
4395,
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... |
activeadmin/activeadmin | lib/active_admin/helpers/scope_chain.rb | ActiveAdmin.ScopeChain.scope_chain | def scope_chain(scope, chain)
if scope.scope_method
chain.public_send scope.scope_method
elsif scope.scope_block
instance_exec chain, &scope.scope_block
else
chain
end
end | ruby | def scope_chain(scope, chain)
if scope.scope_method
chain.public_send scope.scope_method
elsif scope.scope_block
instance_exec chain, &scope.scope_block
else
chain
end
end | [
"def",
"scope_chain",
"(",
"scope",
",",
"chain",
")",
"if",
"scope",
".",
"scope_method",
"chain",
".",
"public_send",
"scope",
".",
"scope_method",
"elsif",
"scope",
".",
"scope_block",
"instance_exec",
"chain",
",",
"scope",
".",
"scope_block",
"else",
"cha... | Scope an ActiveRecord::Relation chain
Example:
scope_chain(Scope.new(:published), Article)
# => Article.published
@param scope The <ActiveAdmin::Scope> we want to scope on
@param chain The ActiveRecord::Relation chain or ActiveRecord::Base class to scope
@return <ActiveRecord::Relation or ActiveRecord::Base> The scoped relation chain | [
"Scope",
"an",
"ActiveRecord",
"::",
"Relation",
"chain"
] | 0759c8dcf97865748c9344459162ac3c7e65a6cd | https://github.com/activeadmin/activeadmin/blob/0759c8dcf97865748c9344459162ac3c7e65a6cd/lib/active_admin/helpers/scope_chain.rb#L14-L22 | train | scope_chain is used to chain the method and block of methods | [
30522,
13366,
9531,
1035,
4677,
1006,
9531,
1010,
4677,
1007,
2065,
9531,
1012,
9531,
1035,
4118,
4677,
1012,
2270,
1035,
4604,
9531,
1012,
9531,
1035,
4118,
3449,
5332,
2546,
9531,
1012,
9531,
1035,
3796,
6013,
1035,
4654,
8586,
4677,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_compute/lib/2016-04-30-preview/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb | Azure::Compute::Mgmt::V2016_04_30_preview.VirtualMachineScaleSets.begin_delete_instances_with_http_info | def begin_delete_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
end | ruby | def begin_delete_instances_with_http_info(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil)
begin_delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value!
end | [
"def",
"begin_delete_instances_with_http_info",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
",",
"custom_headers",
":",
"nil",
")",
"begin_delete_instances_async",
"(",
"resource_group_name",
",",
"vm_scale_set_name",
",",
"vm_instance_ids",
... | Deletes virtual machines in a VM scale set.
@param resource_group_name [String] The name of the resource group.
@param vm_scale_set_name [String] The name of the VM scale set.
@param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list
of virtual machine instance IDs from the VM scale set.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | 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#L1282-L1284 | train | Deletes a set of virtual machines in a VM scale set. | [
30522,
13366,
4088,
1035,
3972,
12870,
1035,
12107,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
4094,
1035,
2275,
1035,
2171,
1010,
1058,
2213,
1035,
6013,
1035,
8909,
2015,
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... |
cheezy/page-object | lib/page-object/accessors.rb | PageObject.Accessors.list_item | def list_item(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'list_item_for', &block)
define_method(name) do
return platform.list_item_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | ruby | def list_item(name, identifier={:index => 0}, &block)
standard_methods(name, identifier, 'list_item_for', &block)
define_method(name) do
return platform.list_item_text_for identifier.clone unless block_given?
self.send("#{name}_element").text
end
end | [
"def",
"list_item",
"(",
"name",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"standard_methods",
"(",
"name",
",",
"identifier",
",",
"'list_item_for'",
",",
"block",
")",
"define_method",
"(",
"name",
")",
"do",
"retur... | adds three methods - one to retrieve the text from a list item,
another to return the list item element, and another to check the list item's
existence.
@example
list_item(:item_one, :id => 'one')
# will generate 'item_one', 'item_one_element', and 'item_one?' methods
@param [Symbol] the name used for the generated methods
@param [Hash] identifier how we find a list item.
@param optional block to be invoked when element method is called | [
"adds",
"three",
"methods",
"-",
"one",
"to",
"retrieve",
"the",
"text",
"from",
"a",
"list",
"item",
"another",
"to",
"return",
"the",
"list",
"item",
"element",
"and",
"another",
"to",
"check",
"the",
"list",
"item",
"s",
"existence",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L596-L602 | train | Creates a list item method | [
30522,
13366,
2862,
1035,
8875,
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,
2862,
1035,
8875,
1035,
2005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | supply/lib/supply/client.rb | Supply.Client.begin_edit | def begin_edit(package_name: nil)
UI.user_error!("You currently have an active edit") if @current_edit
self.current_edit = call_google_api { client.insert_edit(package_name) }
self.current_package_name = package_name
end | ruby | def begin_edit(package_name: nil)
UI.user_error!("You currently have an active edit") if @current_edit
self.current_edit = call_google_api { client.insert_edit(package_name) }
self.current_package_name = package_name
end | [
"def",
"begin_edit",
"(",
"package_name",
":",
"nil",
")",
"UI",
".",
"user_error!",
"(",
"\"You currently have an active edit\"",
")",
"if",
"@current_edit",
"self",
".",
"current_edit",
"=",
"call_google_api",
"{",
"client",
".",
"insert_edit",
"(",
"package_name"... | @!group Handling the edit lifecycle
Begin modifying a certain package | [
"@!group",
"Handling",
"the",
"edit",
"lifecycle"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/supply/lib/supply/client.rb#L135-L141 | train | Creates an edit for the current package | [
30522,
13366,
4088,
1035,
10086,
1006,
7427,
1035,
2171,
1024,
9152,
2140,
1007,
21318,
1012,
5310,
1035,
7561,
999,
1006,
1000,
2017,
2747,
2031,
2019,
3161,
10086,
1000,
1007,
2065,
1030,
2783,
1035,
10086,
2969,
1012,
2783,
1035,
10086,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/variable_operations.rb | Azure::Automation::Mgmt::V2015_10_31.VariableOperations.create_or_update_with_http_info | def create_or_update_with_http_info(resource_group_name, automation_account_name, variable_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, automation_account_name, variable_name, parameters, custom_headers:custom_headers).value!
end | ruby | def create_or_update_with_http_info(resource_group_name, automation_account_name, variable_name, parameters, custom_headers:nil)
create_or_update_async(resource_group_name, automation_account_name, variable_name, parameters, custom_headers:custom_headers).value!
end | [
"def",
"create_or_update_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"variable_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"create_or_update_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
... | Create a variable.
@param resource_group_name [String] Name of an Azure Resource group.
@param automation_account_name [String] The name of the automation account.
@param variable_name [String] The variable name.
@param parameters [VariableCreateOrUpdateParameters] The parameters supplied
to the create or update variable operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Create",
"a",
"variable",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/variable_operations.rb#L55-L57 | train | Creates or updates a variable in the specified automation account. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
19309,
1035,
4070,
1035,
2171,
1010,
8023,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/face_list_operations.rb | Azure::CognitiveServices::Face::V1_0.FaceListOperations.add_face_from_stream_with_http_info | def add_face_from_stream_with_http_info(face_list_id, image, user_data:nil, target_face:nil, custom_headers:nil)
add_face_from_stream_async(face_list_id, image, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
end | ruby | def add_face_from_stream_with_http_info(face_list_id, image, user_data:nil, target_face:nil, custom_headers:nil)
add_face_from_stream_async(face_list_id, image, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
end | [
"def",
"add_face_from_stream_with_http_info",
"(",
"face_list_id",
",",
"image",
",",
"user_data",
":",
"nil",
",",
"target_face",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"add_face_from_stream_async",
"(",
"face_list_id",
",",
"image",
",",
"user_data",
... | Add a face to a face list. The input face is specified as an image with a
targetFace rectangle. It returns a persistedFaceId representing the added
face, and persistedFaceId will not expire.
@param face_list_id [String] Id referencing a particular face list.
@param image An image stream.
@param user_data [String] User-specified data about the face for any purpose.
The maximum length is 1KB.
@param target_face [Array<Integer>] A face rectangle to specify the target
face to be added to a person in the format of
"targetFace=left,top,width,height". E.g. "targetFace=10,10,100,100". If there
is more than one face in the image, targetFace is required to specify which
face to add. No targetFace means there is only one face detected in the
entire image.
@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",
"a",
"face",
"to",
"a",
"face",
"list",
".",
"The",
"input",
"face",
"is",
"specified",
"as",
"an",
"image",
"with",
"a",
"targetFace",
"rectangle",
".",
"It",
"returns",
"a",
"persistedFaceId",
"representing",
"the",
"added",
"face",
"and",
"persis... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_face/lib/1.0/generated/azure_cognitiveservices_face/face_list_operations.rb#L880-L882 | train | Adds a face to a face list. | [
30522,
13366,
5587,
1035,
2227,
1035,
2013,
1035,
5460,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2227,
1035,
2862,
1035,
8909,
1010,
3746,
1010,
5310,
1035,
2951,
1024,
9152,
2140,
1010,
4539,
1035,
2227,
1024,
9152,
2140,
1010,
7661,
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_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb | Azure::MachineLearning::Mgmt::V2017_01_01.WebServices.begin_patch | def begin_patch(resource_group_name, web_service_name, patch_payload, custom_headers:nil)
response = begin_patch_async(resource_group_name, web_service_name, patch_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_patch(resource_group_name, web_service_name, patch_payload, custom_headers:nil)
response = begin_patch_async(resource_group_name, web_service_name, patch_payload, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_patch",
"(",
"resource_group_name",
",",
"web_service_name",
",",
"patch_payload",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_patch_async",
"(",
"resource_group_name",
",",
"web_service_name",
",",
"patch_payload",
",",
"custom_headers... | Modifies an existing web service resource. The PATCH API call is an
asynchronous operation. To determine whether it has completed successfully,
you must perform a Get operation.
@param resource_group_name [String] Name of the resource group in which the
web service is located.
@param web_service_name [String] The name of the web service.
@param patch_payload [WebService] The payload to use to patch the web
service.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [WebService] operation results. | [
"Modifies",
"an",
"existing",
"web",
"service",
"resource",
".",
"The",
"PATCH",
"API",
"call",
"is",
"an",
"asynchronous",
"operation",
".",
"To",
"determine",
"whether",
"it",
"has",
"completed",
"successfully",
"you",
"must",
"perform",
"a",
"Get",
"operati... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb#L752-L755 | train | Patch a specified Web Service. | [
30522,
13366,
4088,
1035,
8983,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4773,
1035,
2326,
1035,
2171,
1010,
8983,
1035,
18093,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
8983,
1035,
2004,
6038,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.resume_with_http_info | def resume_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers:nil)
resume_async(resource_group_name, automation_account_name, job_id, custom_headers:custom_headers).value!
end | ruby | def resume_with_http_info(resource_group_name, automation_account_name, job_id, custom_headers:nil)
resume_async(resource_group_name, automation_account_name, job_id, custom_headers:custom_headers).value!
end | [
"def",
"resume_with_http_info",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"job_id",
",",
"custom_headers",
":",
"nil",
")",
"resume_async",
"(",
"resource_group_name",
",",
"automation_account_name",
",",
"job_id",
",",
"custom_headers",
":custom_he... | Resume the job identified by jobId.
@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 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. | [
"Resume",
"the",
"job",
"identified",
"by",
"jobId",
"."
] | 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#L748-L750 | train | Resumes a specified job. | [
30522,
13366,
13746,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
30524,
1010,
7661,
1035,
20346,
2015,
1024,
7661,
1035,
20346,
2015,
1007,
1012,
3643,
999,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/vpn_connections.rb | Azure::Network::Mgmt::V2019_02_01.VpnConnections.list_by_vpn_gateway_next | def list_by_vpn_gateway_next(next_page_link, custom_headers:nil)
response = list_by_vpn_gateway_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_vpn_gateway_next(next_page_link, custom_headers:nil)
response = list_by_vpn_gateway_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_vpn_gateway_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_vpn_gateway_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
... | Retrieves all vpn connections for a particular virtual wan vpn gateway.
@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 [ListVpnConnectionsResult] operation results. | [
"Retrieves",
"all",
"vpn",
"connections",
"for",
"a",
"particular",
"virtual",
"wan",
"vpn",
"gateway",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2019-02-01/generated/azure_mgmt_network/vpn_connections.rb#L535-L538 | train | Gets the virtual network gateway s virtual network interfaces. | [
30522,
13366,
2862,
1035,
2011,
1035,
21210,
2078,
1035,
11909,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
21210,
2078,
1035,
11909,
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 | data/azure_service_fabric/lib/6.3.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_3_0_9.ServiceFabricClientAPIs.create_volume_resource | def create_volume_resource(volume_resource_name, volume_resource_description, custom_headers:nil)
response = create_volume_resource_async(volume_resource_name, volume_resource_description, custom_headers:custom_headers).value!
nil
end | ruby | def create_volume_resource(volume_resource_name, volume_resource_description, custom_headers:nil)
response = create_volume_resource_async(volume_resource_name, volume_resource_description, custom_headers:custom_headers).value!
nil
end | [
"def",
"create_volume_resource",
"(",
"volume_resource_name",
",",
"volume_resource_description",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_volume_resource_async",
"(",
"volume_resource_name",
",",
"volume_resource_description",
",",
"custom_headers",
"... | Creates or updates a volume resource.
Creates a volume resource with the specified name and description. If a
volume with the same name already exists, then its description is updated to
the one indicated in this request.
@param volume_resource_name [String] Service Fabric volume resource name.
@param volume_resource_description [VolumeResourceDescription] Description
for creating a volume resource.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Creates",
"or",
"updates",
"a",
"volume",
"resource",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.3.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L30043-L30046 | train | Creates a volume resource. | [
30522,
13366,
3443,
1035,
3872,
1035,
7692,
1006,
3872,
1035,
7692,
1035,
2171,
1010,
3872,
1035,
7692,
1035,
6412,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
1035,
3872,
1035,
7692,
1035,
2004,
6038,
2278,
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... |
mojombo/chronic | lib/chronic/handlers.rb | Chronic.Handlers.handle_sy_sm_sd | def handle_sy_sm_sd(tokens, options)
new_tokens = [tokens[1], tokens[2], tokens[0]]
time_tokens = tokens.last(tokens.size - 3)
handle_sm_sd_sy(new_tokens + time_tokens, options)
end | ruby | def handle_sy_sm_sd(tokens, options)
new_tokens = [tokens[1], tokens[2], tokens[0]]
time_tokens = tokens.last(tokens.size - 3)
handle_sm_sd_sy(new_tokens + time_tokens, options)
end | [
"def",
"handle_sy_sm_sd",
"(",
"tokens",
",",
"options",
")",
"new_tokens",
"=",
"[",
"tokens",
"[",
"1",
"]",
",",
"tokens",
"[",
"2",
"]",
",",
"tokens",
"[",
"0",
"]",
"]",
"time_tokens",
"=",
"tokens",
".",
"last",
"(",
"tokens",
".",
"size",
"... | Handle scalar-year/scalar-month/scalar-day | [
"Handle",
"scalar",
"-",
"year",
"/",
"scalar",
"-",
"month",
"/",
"scalar",
"-",
"day"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L238-L242 | train | Handle the S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - S - | [
30522,
13366,
5047,
1035,
25353,
1035,
15488,
1035,
17371,
1006,
19204,
2015,
1010,
7047,
1007,
2047,
1035,
19204,
2015,
1027,
1031,
19204,
2015,
1031,
1015,
1033,
1010,
19204,
2015,
1031,
1016,
1033,
1010,
19204,
2015,
1031,
1014,
1033,
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_cognitiveservices_videosearch/lib/1.0/generated/azure_cognitiveservices_videosearch/videos_operations.rb | Azure::CognitiveServices::VideoSearch::V1_0.VideosOperations.search_async | def search_async(query, accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, count:nil, freshness:nil, id:nil, length:nil, market:nil, offset:nil, pricing:nil, resolution:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
x_bing_apis_sdk = 'true'
fail ArgumentError, 'query is nil' if query.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['X-BingApis-SDK'] = x_bing_apis_sdk unless x_bing_apis_sdk.nil?
request_headers['Accept-Language'] = accept_language unless accept_language.nil?
request_headers['User-Agent'] = user_agent unless user_agent.nil?
request_headers['X-MSEdge-ClientID'] = client_id unless client_id.nil?
request_headers['X-MSEdge-ClientIP'] = client_ip unless client_ip.nil?
request_headers['X-Search-Location'] = location unless location.nil?
path_template = 'videos/search'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
query_params: {'cc' => country_code,'count' => count,'freshness' => freshness,'id' => id,'length' => length,'mkt' => market,'offset' => offset,'pricing' => pricing,'q' => query,'resolution' => resolution,'safeSearch' => safe_search,'setLang' => set_lang,'textDecorations' => text_decorations,'textFormat' => text_format},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::VideoSearch::V1_0::Models::Videos.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end | ruby | def search_async(query, accept_language:nil, user_agent:nil, client_id:nil, client_ip:nil, location:nil, country_code:nil, count:nil, freshness:nil, id:nil, length:nil, market:nil, offset:nil, pricing:nil, resolution:nil, safe_search:nil, set_lang:nil, text_decorations:nil, text_format:nil, custom_headers:nil)
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
x_bing_apis_sdk = 'true'
fail ArgumentError, 'query is nil' if query.nil?
request_headers = {}
request_headers['Content-Type'] = 'application/json; charset=utf-8'
# Set Headers
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
request_headers['X-BingApis-SDK'] = x_bing_apis_sdk unless x_bing_apis_sdk.nil?
request_headers['Accept-Language'] = accept_language unless accept_language.nil?
request_headers['User-Agent'] = user_agent unless user_agent.nil?
request_headers['X-MSEdge-ClientID'] = client_id unless client_id.nil?
request_headers['X-MSEdge-ClientIP'] = client_ip unless client_ip.nil?
request_headers['X-Search-Location'] = location unless location.nil?
path_template = 'videos/search'
request_url = @base_url || @client.base_url
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
options = {
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
query_params: {'cc' => country_code,'count' => count,'freshness' => freshness,'id' => id,'length' => length,'mkt' => market,'offset' => offset,'pricing' => pricing,'q' => query,'resolution' => resolution,'safeSearch' => safe_search,'setLang' => set_lang,'textDecorations' => text_decorations,'textFormat' => text_format},
headers: request_headers.merge(custom_headers || {}),
base_url: request_url
}
promise = @client.make_request_async(:get, path_template, options)
promise = promise.then do |result|
http_response = result.response
status_code = http_response.status
response_content = http_response.body
unless status_code == 200
error_model = JSON.load(response_content)
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
end
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
# Deserialize Response
if status_code == 200
begin
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
result_mapper = Azure::CognitiveServices::VideoSearch::V1_0::Models::Videos.mapper()
result.body = @client.deserialize(result_mapper, parsed_response)
rescue Exception => e
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
end
end
result
end
promise.execute
end | [
"def",
"search_async",
"(",
"query",
",",
"accept_language",
":",
"nil",
",",
"user_agent",
":",
"nil",
",",
"client_id",
":",
"nil",
",",
"client_ip",
":",
"nil",
",",
"location",
":",
"nil",
",",
"country_code",
":",
"nil",
",",
"count",
":",
"nil",
... | The Video Search API lets you send a search query to Bing and get back a list
of videos that are relevant to the search query. This section provides
technical details about the query parameters and headers that you use to
request videos and the JSON response objects that contain them. For examples
that show how to make requests, see [Searching the Web for
Videos](https://docs.microsoft.com/azure/cognitive-services/bing-video-search/search-the-web).
@param query [String] The user's search query string. The query string cannot
be empty. The query string may contain [Bing Advanced
Operators](http://msdn.microsoft.com/library/ff795620.aspx). For example, to
limit videos to a specific domain, use the
[site:](http://msdn.microsoft.com/library/ff795613.aspx) operator. Use this
parameter only with the Video Search API. Do not specify this parameter when
calling the Trending Videos API.
@param accept_language [String] A comma-delimited list of one or more
languages to use for user interface strings. The list is in decreasing order
of preference. For additional information, including expected format, see
[RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This
header and the
[setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlang)
query parameter are mutually exclusive; do not specify both. If you set this
header, you must also specify the
[cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc)
query parameter. To determine the market to return results for, Bing uses the
first supported language it finds from the list and combines it with the cc
parameter value. If the list does not include a supported language, Bing
finds the closest language and market that supports the request or it uses an
aggregated or default market for the results. To determine the market that
Bing used, see the BingAPIs-Market header. Use this header and the cc query
parameter only if you specify multiple languages. Otherwise, use the
[mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#mkt)
and
[setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#setlang)
query parameters. A user interface string is a string that's used as a label
in a user interface. There are few user interface strings in the JSON
response objects. Any links to Bing.com properties in the response objects
apply the specified language.
@param user_agent [String] The user agent originating the request. Bing uses
the user agent to provide mobile users with an optimized experience. Although
optional, you are encouraged to always specify this header. The user-agent
should be the same string that any commonly used browser sends. For
information about user agents, see [RFC
2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The following
are examples of user-agent strings. Windows Phone: Mozilla/5.0 (compatible;
MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA;
Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; en - us; SCH -
I500 Build / GINGERBREAD) AppleWebKit / 533.1 (KHTML; like Gecko) Version /
4.0 Mobile Safari / 533.1. iPhone: Mozilla / 5.0 (iPhone; CPU iPhone OS 6_1
like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142
iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3;
WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: Mozilla / 5.0 (iPad;
CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, like Gecko) Version
/ 7.0 Mobile / 11A465 Safari / 9537.53
@param client_id [String] Bing uses this header to provide users with
consistent behavior across Bing API calls. Bing often flights new features
and improvements, and it uses the client ID as a key for assigning traffic on
different flights. If you do not use the same client ID for a user across
multiple requests, then Bing may assign the user to multiple conflicting
flights. Being assigned to multiple conflicting flights can lead to an
inconsistent user experience. For example, if the second request has a
different flight assignment than the first, the experience may be unexpected.
Also, Bing can use the client ID to tailor web results to that client ID’s
search history, providing a richer experience for the user. Bing also uses
this header to help improve result rankings by analyzing the activity
generated by a client ID. The relevance improvements help with better quality
of results delivered by Bing APIs and in turn enables higher click-through
rates for the API consumer. IMPORTANT: Although optional, you should consider
this header required. Persisting the client ID across multiple requests for
the same end user and device combination enables 1) the API consumer to
receive a consistent user experience, and 2) higher click-through rates via
better quality of results from the Bing APIs. Each user that uses your
application on the device must have a unique, Bing generated client ID. If
you do not include this header in the request, Bing generates an ID and
returns it in the X-MSEdge-ClientID response header. The only time that you
should NOT include this header in a request is the first time the user uses
your app on that device. Use the client ID for each Bing API request that
your app makes for this user on the device. Persist the client ID. To persist
the ID in a browser app, use a persistent HTTP cookie to ensure the ID is
used across all sessions. Do not use a session cookie. For other apps such as
mobile apps, use the device's persistent storage to persist the ID. The next
time the user uses your app on that device, get the client ID that you
persisted. Bing responses may or may not include this header. If the response
includes this header, capture the client ID and use it for all subsequent
Bing requests for the user on that device. If you include the
X-MSEdge-ClientID, you must not include cookies in the request.
@param client_ip [String] The IPv4 or IPv6 address of the client device. The
IP address is used to discover the user's location. Bing uses the location
information to determine safe search behavior. Although optional, you are
encouraged to always specify this header and the X-Search-Location header. Do
not obfuscate the address (for example, by changing the last octet to 0).
Obfuscating the address results in the location not being anywhere near the
device's actual location, which may result in Bing serving erroneous results.
@param location [String] A semicolon-delimited list of key/value pairs that
describe the client's geographical location. Bing uses the location
information to determine safe search behavior and to return relevant local
content. Specify the key/value pair as <key>:<value>. The following are the
keys that you use to specify the user's location. lat (required): The
latitude of the client's location, in degrees. The latitude must be greater
than or equal to -90.0 and less than or equal to +90.0. Negative values
indicate southern latitudes and positive values indicate northern latitudes.
long (required): The longitude of the client's location, in degrees. The
longitude must be greater than or equal to -180.0 and less than or equal to
+180.0. Negative values indicate western longitudes and positive values
indicate eastern longitudes. re (required): The radius, in meters, which
specifies the horizontal accuracy of the coordinates. Pass the value returned
by the device's location service. Typical values might be 22m for GPS/Wi-Fi,
380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts
(optional): The UTC UNIX timestamp of when the client was at the location.
(The UNIX timestamp is the number of seconds since January 1, 1970.) head
(optional): The client's relative heading or direction of travel. Specify the
direction of travel as degrees from 0 through 360, counting clockwise
relative to true north. Specify this key only if the sp key is nonzero. sp
(optional): The horizontal velocity (speed), in meters per second, that the
client device is traveling. alt (optional): The altitude of the client
device, in meters. are (optional): The radius, in meters, that specifies the
vertical accuracy of the coordinates. Specify this key only if you specify
the alt key. Although many of the keys are optional, the more information
that you provide, the more accurate the location results are. Although
optional, you are encouraged to always specify the user's geographical
location. Providing the location is especially important if the client's IP
address does not accurately reflect the user's physical location (for
example, if the client uses VPN). For optimal results, you should include
this header and the X-MSEdge-ClientIP header, but at a minimum, you should
include this header.
@param country_code [String] A 2-character country code of the country where
the results come from. This API supports only the United States market. If
you specify this query parameter, it must be set to us. If you set this
parameter, you must also specify the Accept-Language header. Bing uses the
first supported language it finds from the languages list, and combine that
language with the country code that you specify to determine the market to
return results for. If the languages list does not include a supported
language, Bing finds the closest language and market that supports the
request, or it may use an aggregated or default market for the results
instead of a specified one. You should use this query parameter and the
Accept-Language query parameter only if you specify multiple languages;
otherwise, you should use the mkt and setLang query parameters. This
parameter and the mkt query parameter are mutually exclusive—do not specify
both.
@param count [Integer] The number of videos to return in the response. The
actual number delivered may be less than requested. The default is 35. The
maximum is 105. You may use this parameter along with the offset parameter to
page results. For example, if your user interface presents 20 videos per
page, set count to 20 and offset to 0 to get the first page of results. For
each subsequent page, increment offset by 20 (for example, 0, 20, 40). Use
this parameter only with the Video Search API. Do not specify this parameter
when calling the Trending Videos API or the Web Search API.
@param freshness [Freshness] Filter videos by the date and time that Bing
discovered the video. The following are the possible filter values. Day:
Return videos discovered within the last 24 hours. Week: Return videos
discovered within the last 7 days. Month: Return videos discovered within the
last 30 days. Possible values include: 'Day', 'Week', 'Month'
@param id [String] An ID that uniquely identifies a video. The
[Video](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#video)
object's videoId field contains the ID that you set this parameter to. You
use this parameter to ensure that the specified video is the first video in
the list of videos that Bing returns.
@param length [VideoLength] Filter videos by the following lengths: Short:
Return videos that are less than 5 minutes. Medium: Return videos that are
between 5 and 20 minutes, inclusive. Long: Return videos that are longer than
20 minutes. All: Do not filter by length.Specifying this value is the same as
not specifying the videoLength parameter. Possible values include: 'All',
'Short', 'Medium', 'Long'
@param market [String] The market where the results come from. Typically, mkt
is the country where the user is making the request from. However, it could
be a different country if the user is not located in a country where Bing
delivers results. The market must be in the form <language code>-<country
code>. For example, en-US. The string is case insensitive. For a list of
possible market values, see [Market
Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-codes).
NOTE: If known, you are encouraged to always specify the market. Specifying
the market helps Bing route the request and return an appropriate and optimal
response. If you specify a market that is not listed in [Market
Codes](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#market-codes),
Bing uses a best fit market code based on an internal mapping that is subject
to change. This parameter and the
[cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#cc)
query parameter are mutually exclusive—do not specify both.
@param offset [Integer] The zero-based offset that indicates the number of
videos to skip before returning videos. The default is 0. The offset should
be less than
([totalEstimatedMatches](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#videos-totalmatches)
- count). Use this parameter along with the count parameter to page results.
For example, if your user interface displays 20 videos per page, set count to
20 and offset to 0 to get the first page of results. For each subsequent
page, increment offset by 20 (for example, 0, 20, 40). It is possible for
multiple pages to include some overlap in results. To prevent duplicates, see
[nextOffset](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#videos-nextoffset).
Use this parameter only with the Video Search API.
@param pricing [VideoPricing] Filter videos by the following pricing options:
Free: Return videos that are free to view. Paid: Return videos that require a
subscription or payment to view. All: Do not filter by pricing.Specifying
this value is the same as not specifying the pricing parameter. Possible
values include: 'All', 'Free', 'Paid'
@param resolution [VideoResolution] Filter videos by the following
resolutions: SD480p: Return videos with a 480p or higher resolution. HD720p:
Return videos with a 720p or higher resolution. HD1080p: Return videos with a
1080p or higher resolution. All: Do not filter by resolution.Specifying this
value is the same as not specifying the resolution parameter. Possible values
include: 'All', 'SD480p', 'HD720p', 'HD1080p'
@param safe_search [SafeSearch] Filter videos for adult content. The
following are the possible filter values. Off: If the request is through the
Video Search API, the response includes adult videos and the thumbnail images
of the videos are clear (non-fuzzy). If the request is through the Web Search
API, the response includes adult videos but the thumbnail images of the
videos are pixelated (fuzzy). Moderate: If the request is through the Video
Search API, the response does not include videos with adult content. If the
request is through the Web Search API, the response may include videos with
adult content but the thumbnail images of the videos are pixelated (fuzzy).
Strict: Does not return videos with adult content. The default is Moderate.
If the request comes from a market that Bing's adult policy requires that
safeSearch is set to Strict, Bing ignores the safeSearch value and uses
Strict. If you use the site: query operator, there is the chance that the
response may contain adult content regardless of what the safeSearch query
parameter is set to. Use site: only if you are aware of the content on the
site and your scenario supports the possibility of adult content. Possible
values include: 'Off', 'Moderate', 'Strict'
@param set_lang [String] The language to use for user interface strings.
Specify the language using the ISO 639-1 2-letter language code. For example,
the language code for English is EN. The default is EN (English). Although
optional, you should always specify the language. Typically, you set setLang
to the same language specified by mkt unless the user wants the user
interface strings displayed in a different language. This parameter and the
[Accept-Language](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#acceptlanguage)
header are mutually exclusive; do not specify both. A user interface string
is a string that's used as a label in a user interface. There are few user
interface strings in the JSON response objects. Also, any links to Bing.com
properties in the response objects apply the specified language.
@param text_decorations [Boolean] A Boolean value that determines whether
display strings contain decoration markers such as hit highlighting
characters. If true, the strings may include markers. The default is false.
To specify whether to use Unicode characters or HTML tags as the markers, see
the
[textFormat](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-video-api-v7-reference#textformat)
query parameter. For information about hit highlighting, see [Hit
Highlighting](https://docs.microsoft.com/azure/cognitive-services/bing-news-search/hit-highlighting).
@param text_format [TextFormat] The type of markers to use for text
decorations (see the textDecorations query parameter). Possible values are
Raw—Use Unicode characters to mark content that needs special formatting. The
Unicode characters are in the range E000 through E019. For example, Bing uses
E000 and E001 to mark the beginning and end of query terms for hit
highlighting. HTML—Use HTML tags to mark content that needs special
formatting. For example, use <b> tags to highlight query terms in display
strings. The default is Raw. For display strings that contain escapable HTML
characters such as <, >, and &, if textFormat is set to HTML, Bing escapes
the characters as appropriate (for example, < is escaped to <). Possible
values include: 'Raw', 'Html'
@param [Hash{String => String}] A hash of custom headers that will be added
to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response. | [
"The",
"Video",
"Search",
"API",
"lets",
"you",
"send",
"a",
"search",
"query",
"to",
"Bing",
"and",
"get",
"back",
"a",
"list",
"of",
"videos",
"that",
"are",
"relevant",
"to",
"the",
"search",
"query",
".",
"This",
"section",
"provides",
"technical",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_videosearch/lib/1.0/generated/azure_cognitiveservices_videosearch/videos_operations.rb#L795-L850 | train | Search for videos | [
30522,
13366,
3945,
1035,
2004,
6038,
2278,
1006,
23032,
1010,
5138,
1035,
2653,
1024,
9152,
2140,
1010,
5310,
1035,
4005,
1024,
9152,
2140,
1010,
7396,
1035,
8909,
1024,
9152,
2140,
1010,
7396,
1035,
12997,
1024,
9152,
2140,
1010,
3295,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_signalr/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb | Azure::Signalr::Mgmt::V2018_03_01_preview.SignalR.check_name_availability | def check_name_availability(location, parameters:nil, custom_headers:nil)
response = check_name_availability_async(location, parameters:parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def check_name_availability(location, parameters:nil, custom_headers:nil)
response = check_name_availability_async(location, parameters:parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"check_name_availability",
"(",
"location",
",",
"parameters",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"check_name_availability_async",
"(",
"location",
",",
"parameters",
":",
"parameters",
",",
"custom_headers",
":custom_headers",... | Checks that the SignalR name is valid and is not already in use.
@param location [String] the region
@param parameters [NameAvailabilityParameters] Parameters supplied to the
operation.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [NameAvailability] operation results. | [
"Checks",
"that",
"the",
"SignalR",
"name",
"is",
"valid",
"and",
"is",
"not",
"already",
"in",
"use",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_signalr/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb#L35-L38 | train | Checks whether the name of a given resource group is available for use. | [
30522,
13366,
4638,
1035,
2171,
1035,
11343,
1006,
3295,
1010,
11709,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4638,
1035,
2171,
1035,
11343,
1035,
2004,
6038,
2278,
1006,
3295,
1010,
11709,
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_sql/lib/2014-04-01/generated/azure_mgmt_sql/query_statistics.rb | Azure::SQL::Mgmt::V2014_04_01.QueryStatistics.list_by_query | def list_by_query(resource_group_name, server_name, database_name, query_id, custom_headers:nil)
response = list_by_query_async(resource_group_name, server_name, database_name, query_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_query(resource_group_name, server_name, database_name, query_id, custom_headers:nil)
response = list_by_query_async(resource_group_name, server_name, database_name, query_id, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_query",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"query_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_query_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
... | Lists a query's statistics.
@param resource_group_name [String] The name of the resource group that
contains the resource. You can obtain this value from the Azure Resource
Manager API or the portal.
@param server_name [String] The name of the server.
@param database_name [String] The name of the database.
@param query_id [String] The id of the query
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [QueryStatisticListResult] operation results. | [
"Lists",
"a",
"query",
"s",
"statistics",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/query_statistics.rb#L41-L44 | train | Gets the list of documents in a database. | [
30522,
13366,
2862,
1035,
2011,
1035,
23032,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
23032,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
samvera/hyrax | app/builders/hyrax/manifest_helper.rb | Hyrax.ManifestHelper.build_rendering | def build_rendering(file_set_id)
file_set_document = query_for_rendering(file_set_id)
label = file_set_document.label.present? ? ": #{file_set_document.label}" : ''
mime = file_set_document.mime_type.present? ? file_set_document.mime_type : I18n.t("hyrax.manifest.unknown_mime_text")
{
'@id' => Hyrax::Engine.routes.url_helpers.download_url(file_set_document.id, host: @hostname),
'format' => mime,
'label' => I18n.t("hyrax.manifest.download_text") + label
}
end | ruby | def build_rendering(file_set_id)
file_set_document = query_for_rendering(file_set_id)
label = file_set_document.label.present? ? ": #{file_set_document.label}" : ''
mime = file_set_document.mime_type.present? ? file_set_document.mime_type : I18n.t("hyrax.manifest.unknown_mime_text")
{
'@id' => Hyrax::Engine.routes.url_helpers.download_url(file_set_document.id, host: @hostname),
'format' => mime,
'label' => I18n.t("hyrax.manifest.download_text") + label
}
end | [
"def",
"build_rendering",
"(",
"file_set_id",
")",
"file_set_document",
"=",
"query_for_rendering",
"(",
"file_set_id",
")",
"label",
"=",
"file_set_document",
".",
"label",
".",
"present?",
"?",
"\": #{file_set_document.label}\"",
":",
"''",
"mime",
"=",
"file_set_do... | Build a rendering hash
@return [Hash] rendering | [
"Build",
"a",
"rendering",
"hash"
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/builders/hyrax/manifest_helper.rb#L18-L27 | train | Build the rendering object for a given file set | [
30522,
13366,
3857,
1035,
14259,
1006,
5371,
1035,
2275,
1035,
8909,
1007,
5371,
1035,
2275,
1035,
6254,
1027,
23032,
1035,
2005,
1035,
14259,
1006,
5371,
1035,
2275,
1035,
8909,
1007,
3830,
1027,
5371,
1035,
2275,
1035,
6254,
1012,
3830,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
intridea/hashie | lib/hashie/mash.rb | Hashie.Mash.custom_writer | def custom_writer(key, value, convert = true) #:nodoc:
key_as_symbol = (key = convert_key(key)).to_sym
log_built_in_message(key_as_symbol) if log_collision?(key_as_symbol)
regular_writer(key, convert ? convert_value(value) : value)
end | ruby | def custom_writer(key, value, convert = true) #:nodoc:
key_as_symbol = (key = convert_key(key)).to_sym
log_built_in_message(key_as_symbol) if log_collision?(key_as_symbol)
regular_writer(key, convert ? convert_value(value) : value)
end | [
"def",
"custom_writer",
"(",
"key",
",",
"value",
",",
"convert",
"=",
"true",
")",
"#:nodoc:",
"key_as_symbol",
"=",
"(",
"key",
"=",
"convert_key",
"(",
"key",
")",
")",
".",
"to_sym",
"log_built_in_message",
"(",
"key_as_symbol",
")",
"if",
"log_collision... | Sets an attribute in the Mash. Key will be converted to
a string before it is set, and Hashes will be converted
into Mashes for nesting purposes. | [
"Sets",
"an",
"attribute",
"in",
"the",
"Mash",
".",
"Key",
"will",
"be",
"converted",
"to",
"a",
"string",
"before",
"it",
"is",
"set",
"and",
"Hashes",
"will",
"be",
"converted",
"into",
"Mashes",
"for",
"nesting",
"purposes",
"."
] | da9fd39a0e551e09c1441cb7453c969a4afbfd7f | https://github.com/intridea/hashie/blob/da9fd39a0e551e09c1441cb7453c969a4afbfd7f/lib/hashie/mash.rb#L154-L159 | train | Creates a new writer for a custom key. | [
30522,
13366,
7661,
1035,
3213,
1006,
3145,
1010,
3643,
1010,
10463,
1027,
2995,
1007,
1001,
1024,
7293,
10085,
1024,
3145,
1035,
2004,
1035,
6454,
1027,
1006,
3145,
1027,
10463,
1035,
3145,
1006,
3145,
1007,
1007,
1012,
2000,
1035,
25353,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/gateway.rb | Discordrb.Gateway.send_request_members | def send_request_members(server_id, query, limit)
data = {
guild_id: server_id,
query: query,
limit: limit
}
send_packet(Opcodes::REQUEST_MEMBERS, data)
end | ruby | def send_request_members(server_id, query, limit)
data = {
guild_id: server_id,
query: query,
limit: limit
}
send_packet(Opcodes::REQUEST_MEMBERS, data)
end | [
"def",
"send_request_members",
"(",
"server_id",
",",
"query",
",",
"limit",
")",
"data",
"=",
"{",
"guild_id",
":",
"server_id",
",",
"query",
":",
"query",
",",
"limit",
":",
"limit",
"}",
"send_packet",
"(",
"Opcodes",
"::",
"REQUEST_MEMBERS",
",",
"dat... | Sends a request members packet (op 8). This will order Discord to gradually sent all requested members as dispatch
events with type `GUILD_MEMBERS_CHUNK`. It is necessary to use this method in order to get all members of a large
server (see `large_threshold` in {#send_identify}), however it can also be used for other purposes.
@param server_id [Integer] The ID of the server whose members to query.
@param query [String] If this string is not empty, only members whose username starts with this string will be
returned.
@param limit [Integer] How many members to send at maximum, or `0` to send all members. | [
"Sends",
"a",
"request",
"members",
"packet",
"(",
"op",
"8",
")",
".",
"This",
"will",
"order",
"Discord",
"to",
"gradually",
"sent",
"all",
"requested",
"members",
"as",
"dispatch",
"events",
"with",
"type",
"GUILD_MEMBERS_CHUNK",
".",
"It",
"is",
"necessa... | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/gateway.rb#L391-L399 | train | Send a request members packet to a server | [
30522,
13366,
4604,
1035,
5227,
1035,
2372,
1006,
8241,
1035,
8909,
1010,
23032,
1010,
5787,
1007,
2951,
1027,
1063,
9054,
1035,
8909,
1024,
8241,
1035,
8909,
1010,
23032,
1024,
23032,
1010,
5787,
1024,
5787,
1065,
4604,
1035,
14771,
1006,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
meew0/discordrb | lib/discordrb/commands/container.rb | Discordrb::Commands.CommandContainer.command | def command(name, attributes = {}, &block)
@commands ||= {}
if name.is_a? Array
new_command = nil
name.each do |e|
new_command = Command.new(e, attributes, &block)
@commands[e] = new_command
end
new_command
else
new_command = Command.new(name, attributes, &block)
new_command.attributes[:aliases].each do |aliased_name|
@commands[aliased_name] = CommandAlias.new(aliased_name, new_command)
end
@commands[name] = new_command
end
end | ruby | def command(name, attributes = {}, &block)
@commands ||= {}
if name.is_a? Array
new_command = nil
name.each do |e|
new_command = Command.new(e, attributes, &block)
@commands[e] = new_command
end
new_command
else
new_command = Command.new(name, attributes, &block)
new_command.attributes[:aliases].each do |aliased_name|
@commands[aliased_name] = CommandAlias.new(aliased_name, new_command)
end
@commands[name] = new_command
end
end | [
"def",
"command",
"(",
"name",
",",
"attributes",
"=",
"{",
"}",
",",
"&",
"block",
")",
"@commands",
"||=",
"{",
"}",
"if",
"name",
".",
"is_a?",
"Array",
"new_command",
"=",
"nil",
"name",
".",
"each",
"do",
"|",
"e",
"|",
"new_command",
"=",
"Co... | Adds a new command to the container.
@param name [Symbol, Array<Symbol>] The name of the command to add, or an array of multiple names for the command
@param attributes [Hash] The attributes to initialize the command with.
@option attributes [Integer] :permission_level The minimum permission level that can use this command, inclusive.
See {CommandBot#set_user_permission} and {CommandBot#set_role_permission}.
@option attributes [String, false] :permission_message Message to display when a user does not have sufficient
permissions to execute a command. %name% in the message will be replaced with the name of the command. Disable
the message by setting this option to false.
@option attributes [Array<Symbol>] :required_permissions Discord action permissions (e.g. `:kick_members`) that
should be required to use this command. See {Discordrb::Permissions::FLAGS} for a list.
@option attributes [Array<Role>, Array<#resolve_id>] :required_roles Roles that user must have to use this command
(user must have all of them).
@option attributes [Array<Role>, Array<#resolve_id>] :allowed_roles Roles that user should have to use this command
(user should have at least one of them).
@option attributes [Array<String, Integer, Channel>] :channels The channels that this command can be used on. An
empty array indicates it can be used on any channel. Supersedes the command bot attribute.
@option attributes [true, false] :chain_usable Whether this command is able to be used inside of a command chain
or sub-chain. Typically used for administrative commands that shouldn't be done carelessly.
@option attributes [true, false] :help_available Whether this command is visible in the help command. See the
:help_command attribute of {CommandBot#initialize}.
@option attributes [String] :description A short description of what this command does. Will be shown in the help
command if the user asks for it.
@option attributes [String] :usage A short description of how this command should be used. Will be displayed in
the help command or if the user uses it wrong.
@option attributes [Array<Class>] :arg_types An array of argument classes which will be used for type-checking.
Hard-coded for some native classes, but can be used with any class that implements static
method `from_argument`.
@option attributes [Integer] :min_args The minimum number of arguments this command should have. If a user
attempts to call the command with fewer arguments, the usage information will be displayed, if it exists.
@option attributes [Integer] :max_args The maximum number of arguments the command should have.
@option attributes [String] :rate_limit_message The message that should be displayed if the command hits a rate
limit. None if unspecified or nil. %time% in the message will be replaced with the time in seconds when the
command will be available again.
@option attributes [Symbol] :bucket The rate limit bucket that should be used for rate limiting. No rate limiting
will be done if unspecified or nil.
@option attributes [String, #call] :rescue A string to respond with, or a block to be called in the event an exception
is raised internally. If given a String, `%exception%` will be substituted with the exception's `#message`. If given
a `Proc`, it will be passed the `CommandEvent` along with the `Exception`.
@yield The block is executed when the command is executed.
@yieldparam event [CommandEvent] The event of the message that contained the command.
@note `LocalJumpError`s are rescued from internally, giving bots the opportunity to use `return` or `break` in
their blocks without propagating an exception.
@return [Command] The command that was added.
@deprecated The command name argument will no longer support arrays in the next release.
Use the `aliases` attribute instead. | [
"Adds",
"a",
"new",
"command",
"to",
"the",
"container",
"."
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/commands/container.rb#L60-L78 | train | Create a new command object | [
30522,
13366,
3094,
1006,
2171,
1010,
12332,
1027,
1063,
1065,
1010,
1004,
3796,
1007,
1030,
10954,
1064,
1064,
1027,
1063,
1065,
2065,
2171,
1012,
2003,
1035,
1037,
1029,
9140,
2047,
1035,
3094,
1027,
9152,
2140,
2171,
1012,
2169,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.