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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
piotrmurach/github | lib/github_api/client/repos/releases/assets.rb | Github.Client::Repos::Releases::Assets.edit | def edit(*args)
arguments(args, required: [:owner, :repo, :id]) do
permit VALID_ASSET_PARAM_NAMES
end
patch_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/assets/#{arguments.id}", arguments.params)
end | ruby | def edit(*args)
arguments(args, required: [:owner, :repo, :id]) do
permit VALID_ASSET_PARAM_NAMES
end
patch_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/assets/#{arguments.id}", arguments.params)
end | [
"def",
"edit",
"(",
"*",
"args",
")",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":owner",
",",
":repo",
",",
":id",
"]",
")",
"do",
"permit",
"VALID_ASSET_PARAM_NAMES",
"end",
"patch_request",
"(",
"\"/repos/#{arguments.owner}/#{arguments.repo}/releases... | Edit a release asset
Users with push access to the repository can edit a release asset.
@param [Hash] params
@input params [String] :name
Required. The file name of the asset.
@input params [String] :label
An alternate short description of the asset.
Used in place of the filename.
@example
github = Github.new
github.repos.releases.assets.edit 'owner', 'repo', 'id',
name: "foo-1.0.0-osx.zip",
label: "Mac binary"
@api public | [
"Edit",
"a",
"release",
"asset"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/repos/releases/assets.rb#L114-L120 | train | Edit an asset | [
30522,
13366,
10086,
1006,
1008,
12098,
5620,
1007,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
3954,
1010,
1024,
16360,
2080,
1010,
1024,
8909,
1033,
1007,
2079,
9146,
9398,
1035,
11412,
1035,
11498,
2213,
1035,
3415,
2203,
8983... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby/rake | lib/rake/task.rb | Rake.Task.invoke_prerequisites_concurrently | def invoke_prerequisites_concurrently(task_args, invocation_chain)# :nodoc:
futures = prerequisite_tasks.map do |p|
prereq_args = task_args.new_scope(p.arg_names)
application.thread_pool.future(p) do |r|
r.invoke_with_call_chain(prereq_args, invocation_chain)
end
end
# Iterate in reverse to improve performance related to thread waiting and switching
futures.reverse_each(&:value)
end | ruby | def invoke_prerequisites_concurrently(task_args, invocation_chain)# :nodoc:
futures = prerequisite_tasks.map do |p|
prereq_args = task_args.new_scope(p.arg_names)
application.thread_pool.future(p) do |r|
r.invoke_with_call_chain(prereq_args, invocation_chain)
end
end
# Iterate in reverse to improve performance related to thread waiting and switching
futures.reverse_each(&:value)
end | [
"def",
"invoke_prerequisites_concurrently",
"(",
"task_args",
",",
"invocation_chain",
")",
"# :nodoc:",
"futures",
"=",
"prerequisite_tasks",
".",
"map",
"do",
"|",
"p",
"|",
"prereq_args",
"=",
"task_args",
".",
"new_scope",
"(",
"p",
".",
"arg_names",
")",
"a... | Invoke all the prerequisites of a task in parallel. | [
"Invoke",
"all",
"the",
"prerequisites",
"of",
"a",
"task",
"in",
"parallel",
"."
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/task.rb#L244-L253 | train | Invoke prerequisites in a thread pool | [
30522,
13366,
1999,
6767,
3489,
1035,
3653,
2890,
24871,
2015,
1035,
15442,
1006,
4708,
1035,
12098,
5620,
1010,
1999,
19152,
1035,
4677,
1007,
1001,
1024,
7293,
10085,
1024,
17795,
1027,
3653,
2890,
24871,
1035,
8518,
1012,
4949,
2079,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.upload_file_chunk_with_http_info | def upload_file_chunk_with_http_info(content_path, session_id, content_range, timeout:60, custom_headers:nil)
upload_file_chunk_async(content_path, session_id, content_range, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def upload_file_chunk_with_http_info(content_path, session_id, content_range, timeout:60, custom_headers:nil)
upload_file_chunk_async(content_path, session_id, content_range, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"upload_file_chunk_with_http_info",
"(",
"content_path",
",",
"session_id",
",",
"content_range",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"upload_file_chunk_async",
"(",
"content_path",
",",
"session_id",
",",
"content_range",
",",
... | Uploads a file chunk to the image store relative path.
Uploads a file chunk to the image store with the specified upload session ID
and image store relative path. This API allows user to resume the file upload
operation. user doesn't have to restart the file upload from scratch whenever
there is a network interruption. Use this option if the file size is large.
To perform a resumable file upload, user need to break the file into multiple
chunks and upload these chunks to the image store one-by-one. Chunks don't
have to be uploaded in order. If the file represented by the image store
relative path already exists, it will be overwritten when the upload session
commits.
@param content_path [String] Relative path to file or folder in the image
store from its root.
@param session_id A GUID generated by the user for a file uploading. It
identifies an image store upload session which keeps track of all file chunks
until it is committed.
@param content_range [String] When uploading file chunks to the image store,
the Content-Range header field need to be configured and sent with a request.
The format should looks like "bytes
{First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example,
Content-Range:bytes 300-5000/20000 indicates that user is sending bytes 300
through 5,000 and the total file length is 20,000 bytes.
@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. | [
"Uploads",
"a",
"file",
"chunk",
"to",
"the",
"image",
"store",
"relative",
"path",
"."
] | 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#L20231-L20233 | train | Uploads a file chunk to a container. | [
30522,
13366,
2039,
11066,
1035,
5371,
1035,
20000,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
4180,
1035,
4130,
1010,
5219,
1035,
8909,
1010,
4180,
1035,
2846,
1010,
2051,
5833,
1024,
3438,
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... |
Dynamoid/dynamoid | lib/dynamoid/document.rb | Dynamoid.Document.evaluate_default_value | def evaluate_default_value(val)
if val.respond_to?(:call)
val.call
elsif val.duplicable?
val.dup
else
val
end
end | ruby | def evaluate_default_value(val)
if val.respond_to?(:call)
val.call
elsif val.duplicable?
val.dup
else
val
end
end | [
"def",
"evaluate_default_value",
"(",
"val",
")",
"if",
"val",
".",
"respond_to?",
"(",
":call",
")",
"val",
".",
"call",
"elsif",
"val",
".",
"duplicable?",
"val",
".",
"dup",
"else",
"val",
"end",
"end"
] | Evaluates the default value given, this is used by undump
when determining the value of the default given for a field options.
@param [Object] :value the attribute's default value | [
"Evaluates",
"the",
"default",
"value",
"given",
"this",
"is",
"used",
"by",
"undump",
"when",
"determining",
"the",
"value",
"of",
"the",
"default",
"given",
"for",
"a",
"field",
"options",
"."
] | 9e3d006b039e45877b003564ded65509b10b6354 | https://github.com/Dynamoid/dynamoid/blob/9e3d006b039e45877b003564ded65509b10b6354/lib/dynamoid/document.rb#L420-L428 | train | Evaluate the default value for the object | [
30522,
13366,
16157,
1035,
12398,
1035,
3643,
1006,
11748,
1007,
2065,
11748,
1012,
6869,
1035,
2000,
1029,
1006,
1024,
2655,
1007,
11748,
1012,
2655,
3449,
5332,
2546,
11748,
1012,
4241,
24759,
5555,
3468,
1029,
11748,
1012,
4241,
2361,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activesupport/lib/active_support/time_with_zone.rb | ActiveSupport.TimeWithZone.advance | def advance(options)
# If we're advancing a value of variable length (i.e., years, weeks, months, days), advance from #time,
# otherwise advance from #utc, for accuracy when moving across DST boundaries
if options.values_at(:years, :weeks, :months, :days).any?
method_missing(:advance, options)
else
utc.advance(options).in_time_zone(time_zone)
end
end | ruby | def advance(options)
# If we're advancing a value of variable length (i.e., years, weeks, months, days), advance from #time,
# otherwise advance from #utc, for accuracy when moving across DST boundaries
if options.values_at(:years, :weeks, :months, :days).any?
method_missing(:advance, options)
else
utc.advance(options).in_time_zone(time_zone)
end
end | [
"def",
"advance",
"(",
"options",
")",
"# If we're advancing a value of variable length (i.e., years, weeks, months, days), advance from #time,",
"# otherwise advance from #utc, for accuracy when moving across DST boundaries",
"if",
"options",
".",
"values_at",
"(",
":years",
",",
":week... | Uses Date to provide precise Time calculations for years, months, and days
according to the proleptic Gregorian calendar. The result is returned as a
new TimeWithZone object.
The +options+ parameter takes a hash with any of these keys:
<tt>:years</tt>, <tt>:months</tt>, <tt>:weeks</tt>, <tt>:days</tt>,
<tt>:hours</tt>, <tt>:minutes</tt>, <tt>:seconds</tt>.
If advancing by a value of variable length (i.e., years, weeks, months,
days), move forward from #time, otherwise move forward from #utc, for
accuracy when moving across DST boundaries.
Time.zone = 'Eastern Time (US & Canada)' # => 'Eastern Time (US & Canada)'
now = Time.zone.now # => Sun, 02 Nov 2014 01:26:28 EDT -04:00
now.advance(seconds: 1) # => Sun, 02 Nov 2014 01:26:29 EDT -04:00
now.advance(minutes: 1) # => Sun, 02 Nov 2014 01:27:28 EDT -04:00
now.advance(hours: 1) # => Sun, 02 Nov 2014 01:26:28 EST -05:00
now.advance(days: 1) # => Mon, 03 Nov 2014 01:26:28 EST -05:00
now.advance(weeks: 1) # => Sun, 09 Nov 2014 01:26:28 EST -05:00
now.advance(months: 1) # => Tue, 02 Dec 2014 01:26:28 EST -05:00
now.advance(years: 1) # => Mon, 02 Nov 2015 01:26:28 EST -05:00 | [
"Uses",
"Date",
"to",
"provide",
"precise",
"Time",
"calculations",
"for",
"years",
"months",
"and",
"days",
"according",
"to",
"the",
"proleptic",
"Gregorian",
"calendar",
".",
"The",
"result",
"is",
"returned",
"as",
"a",
"new",
"TimeWithZone",
"object",
"."... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/time_with_zone.rb#L402-L410 | train | Advance the current time | [
30522,
13366,
5083,
1006,
7047,
1007,
1001,
2065,
2057,
1005,
2128,
10787,
1037,
3643,
1997,
8023,
3091,
1006,
1045,
1012,
1041,
1012,
1010,
2086,
1010,
3134,
1010,
2706,
1010,
2420,
1007,
1010,
5083,
2013,
1001,
2051,
1010,
1001,
4728,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/replication_storage_classification_mappings.rb | Azure::RecoveryServicesSiteRecovery::Mgmt::V2016_08_10.ReplicationStorageClassificationMappings.delete | def delete(fabric_name, storage_classification_name, storage_classification_mapping_name, custom_headers:nil)
response = delete_async(fabric_name, storage_classification_name, storage_classification_mapping_name, custom_headers:custom_headers).value!
nil
end | ruby | def delete(fabric_name, storage_classification_name, storage_classification_mapping_name, custom_headers:nil)
response = delete_async(fabric_name, storage_classification_name, storage_classification_mapping_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"delete",
"(",
"fabric_name",
",",
"storage_classification_name",
",",
"storage_classification_mapping_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"delete_async",
"(",
"fabric_name",
",",
"storage_classification_name",
",",
"storage_classification... | Delete a storage classification mapping.
The operation to delete a storage classification mapping.
@param fabric_name [String] Fabric name.
@param storage_classification_name [String] Storage classification name.
@param storage_classification_mapping_name [String] Storage classification
mapping name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Delete",
"a",
"storage",
"classification",
"mapping",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2016-08-10/generated/azure_mgmt_recovery_services_site_recovery/replication_storage_classification_mappings.rb#L193-L196 | train | Deletes a storage classification mapping. | [
30522,
13366,
3972,
12870,
1006,
8313,
1035,
2171,
1010,
5527,
1035,
5579,
1035,
2171,
1010,
5527,
1035,
5579,
1035,
12375,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
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... |
teamcapybara/capybara | lib/capybara/session/matchers.rb | Capybara.SessionMatchers.assert_current_path | def assert_current_path(path, **options)
_verify_current_path(path, options) do |query|
raise Capybara::ExpectationNotMet, query.failure_message unless query.resolves_for?(self)
end
end | ruby | def assert_current_path(path, **options)
_verify_current_path(path, options) do |query|
raise Capybara::ExpectationNotMet, query.failure_message unless query.resolves_for?(self)
end
end | [
"def",
"assert_current_path",
"(",
"path",
",",
"**",
"options",
")",
"_verify_current_path",
"(",
"path",
",",
"options",
")",
"do",
"|",
"query",
"|",
"raise",
"Capybara",
"::",
"ExpectationNotMet",
",",
"query",
".",
"failure_message",
"unless",
"query",
".... | Asserts that the page has the given path.
By default, if passed a full url this will compare against the full url,
if passed a path only the path+query portion will be compared, if passed a regexp
the comparison will depend on the :url option (path+query by default)
@!macro current_path_query_params
@overload $0(string, **options)
@param string [String] The string that the current 'path' should equal
@overload $0(regexp, **options)
@param regexp [Regexp] The regexp that the current 'path' should match to
@option options [Boolean] :url (true if `string` ia a full url, otherwise false) Whether the compare should be done against the full current url or just the path
@option options [Boolean] :ignore_query (false) Whether the query portion of the current url/path should be ignored
@option options [Numeric] :wait (Capybara.default_max_wait_time) Maximum time that Capybara will wait for the current url/path to eq/match given string/regexp argument
@raise [Capybara::ExpectationNotMet] if the assertion hasn't succeeded during wait time
@return [true] | [
"Asserts",
"that",
"the",
"page",
"has",
"the",
"given",
"path",
".",
"By",
"default",
"if",
"passed",
"a",
"full",
"url",
"this",
"will",
"compare",
"against",
"the",
"full",
"url",
"if",
"passed",
"a",
"path",
"only",
"the",
"path",
"+",
"query",
"po... | 3819078c820c5cd3be6f0bc9e8b1b0cc1190bc41 | https://github.com/teamcapybara/capybara/blob/3819078c820c5cd3be6f0bc9e8b1b0cc1190bc41/lib/capybara/session/matchers.rb#L22-L26 | train | Assert that the current path is valid for the current resource. | [
30522,
13366,
20865,
1035,
2783,
1035,
4130,
1006,
4130,
1010,
1008,
1008,
7047,
1007,
1035,
20410,
1035,
2783,
1035,
4130,
1006,
4130,
1010,
7047,
1007,
2079,
1064,
23032,
1064,
5333,
6178,
2100,
20709,
1024,
1024,
17626,
17048,
11368,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/content_key_policies.rb | Azure::MediaServices::Mgmt::V2018_07_01.ContentKeyPolicies.get_policy_properties_with_secrets | def get_policy_properties_with_secrets(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
response = get_policy_properties_with_secrets_async(resource_group_name, account_name, content_key_policy_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_policy_properties_with_secrets(resource_group_name, account_name, content_key_policy_name, custom_headers:nil)
response = get_policy_properties_with_secrets_async(resource_group_name, account_name, content_key_policy_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_policy_properties_with_secrets",
"(",
"resource_group_name",
",",
"account_name",
",",
"content_key_policy_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_policy_properties_with_secrets_async",
"(",
"resource_group_name",
",",
"account_name",
... | Get a Content Key Policy with secrets
Get a Content Key Policy including secret values
@param resource_group_name [String] The name of the resource group within the
Azure subscription.
@param account_name [String] The Media Services account name.
@param content_key_policy_name [String] The Content Key Policy name.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ContentKeyPolicyProperties] operation results. | [
"Get",
"a",
"Content",
"Key",
"Policy",
"with",
"secrets"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_media_services/lib/2018-07-01/generated/azure_mgmt_media_services/content_key_policies.rb#L598-L601 | train | Gets the policy properties with secrets. | [
30522,
13366,
2131,
1035,
3343,
1035,
5144,
1035,
2007,
1035,
7800,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
4180,
1035,
3145,
1035,
3343,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
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 | examples/histogram.rb | Magick.Image.alpha_hist | def alpha_hist(freqs, scale, fg, bg)
histogram = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do
self.background_color = bg
self.border_color = fg
end
gc = Draw.new
gc.affine(1, 0, 0, -scale, 0, HISTOGRAM_ROWS)
gc.fill('white')
HISTOGRAM_COLS.times do |x|
gc.point(x, freqs[x])
end
gc.draw(histogram)
histogram['Label'] = 'Alpha'
histogram
end | ruby | def alpha_hist(freqs, scale, fg, bg)
histogram = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do
self.background_color = bg
self.border_color = fg
end
gc = Draw.new
gc.affine(1, 0, 0, -scale, 0, HISTOGRAM_ROWS)
gc.fill('white')
HISTOGRAM_COLS.times do |x|
gc.point(x, freqs[x])
end
gc.draw(histogram)
histogram['Label'] = 'Alpha'
histogram
end | [
"def",
"alpha_hist",
"(",
"freqs",
",",
"scale",
",",
"fg",
",",
"bg",
")",
"histogram",
"=",
"Image",
".",
"new",
"(",
"HISTOGRAM_COLS",
",",
"HISTOGRAM_ROWS",
")",
"do",
"self",
".",
"background_color",
"=",
"bg",
"self",
".",
"border_color",
"=",
"fg"... | The alpha frequencies are shown as white dots. | [
"The",
"alpha",
"frequencies",
"are",
"shown",
"as",
"white",
"dots",
"."
] | ef6688ed9d76bf123c2ea1a483eff8635051adb7 | https://github.com/rmagick/rmagick/blob/ef6688ed9d76bf123c2ea1a483eff8635051adb7/examples/histogram.rb#L37-L55 | train | draw alpha histogram | [
30522,
13366,
6541,
1035,
2010,
2102,
1006,
10424,
2063,
4160,
2015,
1010,
4094,
1010,
1042,
2290,
1010,
1038,
2290,
1007,
2010,
3406,
13113,
1027,
3746,
1012,
2047,
1006,
2010,
3406,
13113,
1035,
8902,
2015,
1010,
2010,
3406,
13113,
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... |
square/connect-ruby-sdk | lib/square_connect/api/v1_items_api.rb | SquareConnect.V1ItemsApi.list_inventory | def list_inventory(location_id, opts = {})
data, _status_code, _headers = list_inventory_with_http_info(location_id, opts)
return data
end | ruby | def list_inventory(location_id, opts = {})
data, _status_code, _headers = list_inventory_with_http_info(location_id, opts)
return data
end | [
"def",
"list_inventory",
"(",
"location_id",
",",
"opts",
"=",
"{",
"}",
")",
"data",
",",
"_status_code",
",",
"_headers",
"=",
"list_inventory_with_http_info",
"(",
"location_id",
",",
"opts",
")",
"return",
"data",
"end"
] | ListInventory
Provides inventory information for all of a merchant's inventory-enabled item variations.
@param location_id The ID of the item's associated location.
@param [Hash] opts the optional parameters
@option opts [Integer] :limit The maximum number of inventory entries to return in a single response. This value cannot exceed 1000.
@option opts [String] :batch_token A pagination cursor to retrieve the next set of results for your original query to the endpoint.
@return [Array<V1InventoryEntry>] | [
"ListInventory",
"Provides",
"inventory",
"information",
"for",
"all",
"of",
"a",
"merchant",
"s",
"inventory",
"-",
"enabled",
"item",
"variations",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L1406-L1409 | train | Returns the list of inventory for a location | [
30522,
13366,
2862,
1035,
12612,
1006,
3295,
1035,
8909,
1010,
23569,
2015,
1027,
1063,
1065,
1007,
2951,
1010,
1035,
3570,
1035,
3642,
1010,
1035,
20346,
2015,
1027,
2862,
1035,
12612,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
3295,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/haml-lint | lib/haml_lint/runner.rb | HamlLint.Runner.report | def report(options)
report = HamlLint::Report.new(reporter: options[:reporter], fail_level: options[:fail_level])
report.start(@files)
process_files(report)
report
end | ruby | def report(options)
report = HamlLint::Report.new(reporter: options[:reporter], fail_level: options[:fail_level])
report.start(@files)
process_files(report)
report
end | [
"def",
"report",
"(",
"options",
")",
"report",
"=",
"HamlLint",
"::",
"Report",
".",
"new",
"(",
"reporter",
":",
"options",
"[",
":reporter",
"]",
",",
"fail_level",
":",
"options",
"[",
":fail_level",
"]",
")",
"report",
".",
"start",
"(",
"@files",
... | Generates a report based on the given options.
@param options [Hash]
@option options :reporter [HamlLint::Reporter] the reporter to report with
@return [HamlLint::Report] | [
"Generates",
"a",
"report",
"based",
"on",
"the",
"given",
"options",
"."
] | 024c773667e54cf88db938c2b368977005d70ee8 | https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/runner.rb#L134-L139 | train | Report the files and the . | [
30522,
13366,
3189,
1006,
7047,
1007,
3189,
1027,
10654,
21202,
2102,
1024,
1024,
3189,
1012,
2047,
1006,
6398,
1024,
7047,
1031,
1024,
6398,
1033,
1010,
8246,
1035,
2504,
1024,
7047,
1031,
1024,
8246,
1035,
2504,
1033,
1007,
3189,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
elastic/elasticsearch-ruby | profile/benchmarking.rb | Elasticsearch.Benchmarking.each_run | def each_run(file)
if file
file = File.new(file)
matrix = YAML.load(ERB.new(file.read).result)
file.close
matrix.each_with_index do |run, i|
DEFAULT_RUN.merge(run)
yield(run, i)
end
else
yield(DEFAULT_RUN)
end
end | ruby | def each_run(file)
if file
file = File.new(file)
matrix = YAML.load(ERB.new(file.read).result)
file.close
matrix.each_with_index do |run, i|
DEFAULT_RUN.merge(run)
yield(run, i)
end
else
yield(DEFAULT_RUN)
end
end | [
"def",
"each_run",
"(",
"file",
")",
"if",
"file",
"file",
"=",
"File",
".",
"new",
"(",
"file",
")",
"matrix",
"=",
"YAML",
".",
"load",
"(",
"ERB",
".",
"new",
"(",
"file",
".",
"read",
")",
".",
"result",
")",
"file",
".",
"close",
"matrix",
... | Parse a file of run definitions and yield each run.
@params [ String ] file The YAML file containing the matrix of test run definitions.
@yieldparam [ Hash ] A test run definition.
@since 7.0.0 | [
"Parse",
"a",
"file",
"of",
"run",
"definitions",
"and",
"yield",
"each",
"run",
"."
] | c0dd04834e5c7cf13792b4ced8e894c44d1f6f35 | https://github.com/elastic/elasticsearch-ruby/blob/c0dd04834e5c7cf13792b4ced8e894c44d1f6f35/profile/benchmarking.rb#L70-L83 | train | Yields each run in the run matrix | [
30522,
13366,
2169,
1035,
2448,
1006,
5371,
1007,
2065,
5371,
5371,
1027,
5371,
1012,
2047,
1006,
5371,
1007,
8185,
1027,
8038,
19968,
1012,
7170,
1006,
9413,
2497,
1012,
2047,
1006,
5371,
1012,
3191,
1007,
1012,
2765,
1007,
5371,
1012,
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... |
phusion/passenger | src/ruby_supportlib/phusion_passenger/utils.rb | PhusionPassenger.Utils.print_exception | def print_exception(current_location, exception, destination = nil)
if !exception.is_a?(SystemExit)
data = exception.backtrace_string(current_location)
if defined?(DebugLogging) && self.is_a?(DebugLogging)
error(data)
else
destination ||= STDERR
destination.puts(data)
destination.flush if destination.respond_to?(:flush)
end
end
end | ruby | def print_exception(current_location, exception, destination = nil)
if !exception.is_a?(SystemExit)
data = exception.backtrace_string(current_location)
if defined?(DebugLogging) && self.is_a?(DebugLogging)
error(data)
else
destination ||= STDERR
destination.puts(data)
destination.flush if destination.respond_to?(:flush)
end
end
end | [
"def",
"print_exception",
"(",
"current_location",
",",
"exception",
",",
"destination",
"=",
"nil",
")",
"if",
"!",
"exception",
".",
"is_a?",
"(",
"SystemExit",
")",
"data",
"=",
"exception",
".",
"backtrace_string",
"(",
"current_location",
")",
"if",
"defi... | Print the given exception, including the stack trace, to STDERR.
+current_location+ is a string which describes where the code is
currently at. Usually the current class name will be enough.
It may be nil.
This method requires 'ruby_core_enhancements'. If 'debug_logging'
is loaded and included in the current module, it will use that for
logging. | [
"Print",
"the",
"given",
"exception",
"including",
"the",
"stack",
"trace",
"to",
"STDERR",
"."
] | 970964b53e0ba86959acdf40f06c99b0c4a128ca | https://github.com/phusion/passenger/blob/970964b53e0ba86959acdf40f06c99b0c4a128ca/src/ruby_supportlib/phusion_passenger/utils.rb#L83-L94 | train | Print the exception to the given destination | [
30522,
13366,
6140,
1035,
6453,
30524,
9152,
2140,
1007,
2065,
999,
6453,
1012,
2003,
1035,
1037,
1029,
1006,
2291,
10288,
4183,
1007,
2951,
1027,
6453,
1012,
2067,
6494,
3401,
1035,
5164,
1006,
2783,
1035,
3295,
1007,
2065,
4225,
1029,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_application_type_info_list_with_http_info | def get_application_type_info_list_with_http_info(application_type_definition_kind_filter:0, exclude_application_parameters:false, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
get_application_type_info_list_async(application_type_definition_kind_filter:application_type_definition_kind_filter, exclude_application_parameters:exclude_application_parameters, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
end | ruby | def get_application_type_info_list_with_http_info(application_type_definition_kind_filter:0, exclude_application_parameters:false, continuation_token:nil, max_results:0, timeout:60, custom_headers:nil)
get_application_type_info_list_async(application_type_definition_kind_filter:application_type_definition_kind_filter, exclude_application_parameters:exclude_application_parameters, continuation_token:continuation_token, max_results:max_results, timeout:timeout, custom_headers:custom_headers).value!
end | [
"def",
"get_application_type_info_list_with_http_info",
"(",
"application_type_definition_kind_filter",
":",
"0",
",",
"exclude_application_parameters",
":",
"false",
",",
"continuation_token",
":",
"nil",
",",
"max_results",
":",
"0",
",",
"timeout",
":",
"60",
",",
"c... | Gets the list of application types in the Service Fabric cluster.
Returns the information about the application types that are provisioned or
in the process of being provisioned in the Service Fabric cluster. Each
version of an application type is returned as one application type. The
response includes the name, version, status and other details about the
application type. This is a paged query, meaning that if not all of the
application types fit in a page, one page of results is returned as well as a
continuation token which can be used to get the next page. For example, if
there are 10 application types but a page only fits the first 3 application
types, or if max results is set to 3, then 3 is returned. To access the rest
of the results, retrieve subsequent pages by using the returned continuation
token in the next query. An empty continuation token is returned if there are
no subsequent pages.
@param application_type_definition_kind_filter [Integer] Used to filter on
ApplicationTypeDefinitionKind which is the mechanism used to define a Service
Fabric application type.
- Default - Default value, which performs the same function as selecting
"All". The value is 0.
- All - Filter that matches input with any ApplicationTypeDefinitionKind
value. The value is 65535.
- ServiceFabricApplicationPackage - Filter that matches input with
ApplicationTypeDefinitionKind value ServiceFabricApplicationPackage. The
value is 1.
- Compose - Filter that matches input with ApplicationTypeDefinitionKind
value Compose. The value is 2.
@param exclude_application_parameters [Boolean] The flag that specifies
whether application parameters will be excluded from the result.
@param continuation_token [String] The continuation token parameter is used
to obtain next set of results. A continuation token with a non empty value is
included in the response of the API when the results from the system do not
fit in a single response. When this value is passed to the next API call, the
API returns next set of results. If there are no further results then the
continuation token does not contain a value. The value of this parameter
should not be URL encoded.
@param max_results [Integer] The maximum number of results to be returned as
part of the paged queries. This parameter defines the upper bound on the
number of results returned. The results returned can be less than the
specified maximum results if they do not fit in the message as per the max
message size restrictions defined in the configuration. If this parameter is
zero or not specified, the paged queries includes as many results as possible
that fit in the return message.
@param timeout [Integer] The server timeout for performing the operation in
seconds. This timeout specifies the time duration that the client is willing
to wait for the requested operation to complete. The default value for this
parameter is 60 seconds.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"list",
"of",
"application",
"types",
"in",
"the",
"Service",
"Fabric",
"cluster",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L4738-L4740 | train | Gets the list of all the applications of the specified type. | [
30522,
13366,
2131,
1035,
4646,
1035,
2828,
1035,
18558,
1035,
2862,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
4646,
1035,
2828,
1035,
6210,
1035,
2785,
1035,
11307,
1024,
1014,
1010,
23329,
1035,
4646,
1035,
11709,
1024,
6270,
1010,
13633... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
david942j/one_gadget | lib/one_gadget/abi.rb | OneGadget.ABI.stack_register? | def stack_register?(reg)
%w[esp ebp rsp rbp sp x29].include?(reg)
end | ruby | def stack_register?(reg)
%w[esp ebp rsp rbp sp x29].include?(reg)
end | [
"def",
"stack_register?",
"(",
"reg",
")",
"%w[",
"esp",
"ebp",
"rsp",
"rbp",
"sp",
"x29",
"]",
".",
"include?",
"(",
"reg",
")",
"end"
] | Checks if the register is a stack-related pointer.
@param [String] reg
Register's name.
@return [Boolean] | [
"Checks",
"if",
"the",
"register",
"is",
"a",
"stack",
"-",
"related",
"pointer",
"."
] | ff6ef04541e83441bfe3c2664a6febd1640f4263 | https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/abi.rb#L47-L49 | train | Returns true if the stack register is in the stack. | [
30522,
13366,
9991,
1035,
4236,
1029,
1006,
19723,
1007,
1003,
1059,
1031,
9686,
2361,
1041,
2497,
2361,
12667,
2361,
21144,
2361,
11867,
1060,
24594,
1033,
1012,
2421,
1029,
1006,
19723,
1007,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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-12-01/generated/azure_mgmt_network/p2s_vpn_gateways.rb | Azure::Network::Mgmt::V2018_12_01.P2sVpnGateways.begin_update_tags_with_http_info | def begin_update_tags_with_http_info(resource_group_name, gateway_name, p2svpn_gateway_parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, gateway_name, p2svpn_gateway_parameters, custom_headers:custom_headers).value!
end | ruby | def begin_update_tags_with_http_info(resource_group_name, gateway_name, p2svpn_gateway_parameters, custom_headers:nil)
begin_update_tags_async(resource_group_name, gateway_name, p2svpn_gateway_parameters, custom_headers:custom_headers).value!
end | [
"def",
"begin_update_tags_with_http_info",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"p2svpn_gateway_parameters",
",",
"custom_headers",
":",
"nil",
")",
"begin_update_tags_async",
"(",
"resource_group_name",
",",
"gateway_name",
",",
"p2svpn_gateway_parameters",
... | Updates virtual wan p2s vpn gateway tags.
@param resource_group_name [String] The resource group name of the
P2SVpnGateway.
@param gateway_name [String] The name of the gateway.
@param p2svpn_gateway_parameters [TagsObject] Parameters supplied to update a
virtual wan p2s vpn gateway tags.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Updates",
"virtual",
"wan",
"p2s",
"vpn",
"gateway",
"tags",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-12-01/generated/azure_mgmt_network/p2s_vpn_gateways.rb#L631-L633 | train | Updates a P2SVpnGateway tags. | [
30522,
13366,
4088,
1035,
10651,
1035,
22073,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
11909,
1035,
2171,
1010,
1052,
2475,
2015,
2615,
2361,
2078,
1035,
11909,
1035,
11709,
1010,
7661,
1035,
20346,
201... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/monitoring.rb | Mongo.Monitoring.succeeded | def succeeded(topic, event)
subscribers_for(topic).each{ |subscriber| subscriber.succeeded(event) }
end | ruby | def succeeded(topic, event)
subscribers_for(topic).each{ |subscriber| subscriber.succeeded(event) }
end | [
"def",
"succeeded",
"(",
"topic",
",",
"event",
")",
"subscribers_for",
"(",
"topic",
")",
".",
"each",
"{",
"|",
"subscriber",
"|",
"subscriber",
".",
"succeeded",
"(",
"event",
")",
"}",
"end"
] | Publish a succeeded event.
@example Publish a succeeded event.
monitoring.succeeded(COMMAND, event)
@param [ String ] topic The event topic.
@param [ Event ] event The event to publish.
@since 2.1.0 | [
"Publish",
"a",
"succeeded",
"event",
"."
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/monitoring.rb#L265-L267 | train | Called when a topic has been successfully subscribed to the event. | [
30522,
13366,
4594,
1006,
8476,
1010,
2724,
1007,
17073,
1035,
2005,
1006,
8476,
1007,
1012,
2169,
1063,
1064,
4942,
29234,
2099,
1064,
4942,
29234,
2099,
1012,
4594,
1006,
2724,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_monitor/lib/2017-11-01-preview/generated/azure_mgmt_monitor/metric_baseline.rb | Azure::Monitor::Mgmt::V2017_11_01_preview.MetricBaseline.get | def get(resource_uri, metric_name, timespan:nil, interval:nil, aggregation:nil, sensitivities:nil, result_type:nil, custom_headers:nil)
response = get_async(resource_uri, metric_name, timespan:timespan, interval:interval, aggregation:aggregation, sensitivities:sensitivities, result_type:result_type, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get(resource_uri, metric_name, timespan:nil, interval:nil, aggregation:nil, sensitivities:nil, result_type:nil, custom_headers:nil)
response = get_async(resource_uri, metric_name, timespan:timespan, interval:interval, aggregation:aggregation, sensitivities:sensitivities, result_type:result_type, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get",
"(",
"resource_uri",
",",
"metric_name",
",",
"timespan",
":",
"nil",
",",
"interval",
":",
"nil",
",",
"aggregation",
":",
"nil",
",",
"sensitivities",
":",
"nil",
",",
"result_type",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"re... | **Gets the baseline values for a specific metric**.
@param resource_uri [String] The identifier of the resource. It has the
following structure:
subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/{providerName}/{resourceName}.
For example:
subscriptions/b368ca2f-e298-46b7-b0ab-012281956afa/resourceGroups/vms/providers/Microsoft.Compute/virtualMachines/vm1
@param metric_name [String] The name of the metric to retrieve the baseline
for.
@param timespan [String] The timespan of the query. It is a string with the
following format 'startDateTime_ISO/endDateTime_ISO'.
@param interval [Duration] The interval (i.e. timegrain) of the query.
@param aggregation [String] The aggregation type of the metric to retrieve
the baseline for.
@param sensitivities [String] The list of sensitivities (comma separated) to
retrieve.
@param result_type [ResultType] Allows retrieving only metadata of the
baseline. On data request all information is retrieved. Possible values
include: 'Data', 'Metadata'
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [BaselineResponse] operation results. | [
"**",
"Gets",
"the",
"baseline",
"values",
"for",
"a",
"specific",
"metric",
"**",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_monitor/lib/2017-11-01-preview/generated/azure_mgmt_monitor/metric_baseline.rb#L49-L52 | train | Gets the specified metric. | [
30522,
13366,
2131,
1006,
7692,
1035,
24471,
2072,
1010,
12046,
1035,
2171,
1010,
2335,
9739,
1024,
9152,
2140,
1010,
13483,
1024,
9152,
2140,
1010,
28041,
1024,
9152,
2140,
1010,
12411,
28032,
12848,
6447,
1024,
9152,
2140,
1010,
2765,
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... |
troessner/reek | samples/smelly_source/inline.rb | Inline.C.c | def c src, options = {}
options = {
:expand_types => true,
}.merge options
self.generate src, options
end | ruby | def c src, options = {}
options = {
:expand_types => true,
}.merge options
self.generate src, options
end | [
"def",
"c",
"src",
",",
"options",
"=",
"{",
"}",
"options",
"=",
"{",
":expand_types",
"=>",
"true",
",",
"}",
".",
"merge",
"options",
"self",
".",
"generate",
"src",
",",
"options",
"end"
] | Adds a C function to the source, including performing automatic
type conversion to arguments and the return value. The Ruby
method name can be overridden by providing method_name. Unknown
type conversions can be extended by using +add_type_converter+. | [
"Adds",
"a",
"C",
"function",
"to",
"the",
"source",
"including",
"performing",
"automatic",
"type",
"conversion",
"to",
"arguments",
"and",
"the",
"return",
"value",
".",
"The",
"Ruby",
"method",
"name",
"can",
"be",
"overridden",
"by",
"providing",
"method_n... | 8c6b5c0c6228a6981ab48543457889f9ea984054 | https://github.com/troessner/reek/blob/8c6b5c0c6228a6981ab48543457889f9ea984054/samples/smelly_source/inline.rb#L575-L580 | train | Generate a file from a source file. | [
30522,
13366,
1039,
5034,
2278,
1010,
7047,
1027,
1063,
1065,
7047,
1027,
1063,
1024,
7818,
1035,
4127,
1027,
1028,
2995,
1010,
1065,
1012,
13590,
7047,
2969,
1012,
9699,
5034,
2278,
1010,
7047,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_luisruntime/lib/3.0-preview/generated/azure_cognitiveservices_luisruntime/prediction_operations.rb | Azure::CognitiveServices::LuisRuntime::V3_0_preview.PredictionOperations.get_slot_prediction_with_http_info | def get_slot_prediction_with_http_info(app_id, slot_name, prediction_request, verbose:nil, show_all_intents:nil, log:nil, custom_headers:nil)
get_slot_prediction_async(app_id, slot_name, prediction_request, verbose:verbose, show_all_intents:show_all_intents, log:log, custom_headers:custom_headers).value!
end | ruby | def get_slot_prediction_with_http_info(app_id, slot_name, prediction_request, verbose:nil, show_all_intents:nil, log:nil, custom_headers:nil)
get_slot_prediction_async(app_id, slot_name, prediction_request, verbose:verbose, show_all_intents:show_all_intents, log:log, custom_headers:custom_headers).value!
end | [
"def",
"get_slot_prediction_with_http_info",
"(",
"app_id",
",",
"slot_name",
",",
"prediction_request",
",",
"verbose",
":",
"nil",
",",
"show_all_intents",
":",
"nil",
",",
"log",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"get_slot_prediction_async",
"... | Gets the predictions for an application slot.
@param app_id The application ID.
@param slot_name [String] The application slot name.
@param prediction_request [PredictionRequest] The prediction request
parameters.
@param verbose [Boolean] Indicates whether to get extra metadata for the
entities predictions or not.
@param show_all_intents [Boolean] Indicates whether to return all the intents
in the response or just the top intent.
@param log [Boolean] Indicates whether to log the endpoint query or not.
@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",
"predictions",
"for",
"an",
"application",
"slot",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisruntime/lib/3.0-preview/generated/azure_cognitiveservices_luisruntime/prediction_operations.rb#L184-L186 | train | Get the prediction of a given slot. | [
30522,
13366,
2131,
1035,
10453,
1035,
17547,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
10453,
1035,
2171,
1010,
17547,
1035,
5227,
1010,
12034,
9232,
1024,
9152,
2140,
1010,
2265,
1035,
2035,
1035,
7848,
2015,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.suspend_application_backup | def suspend_application_backup(application_id, timeout:60, custom_headers:nil)
response = suspend_application_backup_async(application_id, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def suspend_application_backup(application_id, timeout:60, custom_headers:nil)
response = suspend_application_backup_async(application_id, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"suspend_application_backup",
"(",
"application_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"suspend_application_backup_async",
"(",
"application_id",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_h... | Suspends periodic backup for the specified Service Fabric application.
The application which is configured to take periodic backups, is suspended
for taking further backups till it is resumed again. This operation applies
to the entire application's hierarchy. It means all the services and
partitions under this application are now suspended for backup.
@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 custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Suspends",
"periodic",
"backup",
"for",
"the",
"specified",
"Service",
"Fabric",
"application",
"."
] | 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#L23586-L23589 | train | Suspend the backup of the application. | [
30522,
13366,
28324,
1035,
4646,
1035,
10200,
1006,
4646,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
28324,
1035,
4646,
1035,
10200,
1035,
2004,
6038,
2278,
1006,
4646,
1035,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Katello/katello | app/models/katello/repository.rb | Katello.Repository.target_repository | def target_repository
fail _("This is not a linked repository") if master?
return nil if self.archived_instance.nil?
#this is an environment repo, and the archived_instance is a master (not always true with composite)
if self.environment_id? && self.archived_instance.master?
self.archived_instance
elsif self.environment_id #this is an environment repo, but a composite who's archived_instance isn't a master
self.archived_instance.target_repository || self.archived_instance #to archived_instance if nil
else #must be a composite archive repo, with only one component repo
self.component_source_repositories.first
end
end | ruby | def target_repository
fail _("This is not a linked repository") if master?
return nil if self.archived_instance.nil?
#this is an environment repo, and the archived_instance is a master (not always true with composite)
if self.environment_id? && self.archived_instance.master?
self.archived_instance
elsif self.environment_id #this is an environment repo, but a composite who's archived_instance isn't a master
self.archived_instance.target_repository || self.archived_instance #to archived_instance if nil
else #must be a composite archive repo, with only one component repo
self.component_source_repositories.first
end
end | [
"def",
"target_repository",
"fail",
"_",
"(",
"\"This is not a linked repository\"",
")",
"if",
"master?",
"return",
"nil",
"if",
"self",
".",
"archived_instance",
".",
"nil?",
"#this is an environment repo, and the archived_instance is a master (not always true with composite)",
... | A link (empty repo) points to a target (a repository that actually has units in pulp). Target repos are always archive repos of a content view version (a repo with no environment)
But for composite view versions, an archive repo, usually won't be a master (but might be if multple components contain the same repo) | [
"A",
"link",
"(",
"empty",
"repo",
")",
"points",
"to",
"a",
"target",
"(",
"a",
"repository",
"that",
"actually",
"has",
"units",
"in",
"pulp",
")",
".",
"Target",
"repos",
"are",
"always",
"archive",
"repos",
"of",
"a",
"content",
"view",
"version",
... | a1c9280067607999cae43bab89b53ba870856b76 | https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/models/katello/repository.rb#L634-L646 | train | Returns the target repository object for this repository. | [
30522,
13366,
4539,
1035,
22409,
8246,
1035,
1006,
1000,
2023,
2003,
2025,
1037,
5799,
22409,
1000,
1007,
2065,
3040,
1029,
2709,
9152,
2140,
2065,
2969,
1012,
9749,
1035,
6013,
1012,
9152,
2140,
1029,
1001,
2023,
2003,
2019,
4044,
16360,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mongodb/mongo-ruby-driver | lib/mongo/client.rb | Mongo.Client.watch | def watch(pipeline = [], options = {})
return use(Database::ADMIN).watch(pipeline, options) unless database.name == Database::ADMIN
Mongo::Collection::View::ChangeStream.new(
Mongo::Collection::View.new(self["#{Database::COMMAND}.aggregate"]),
pipeline,
Mongo::Collection::View::ChangeStream::CLUSTER,
options)
end | ruby | def watch(pipeline = [], options = {})
return use(Database::ADMIN).watch(pipeline, options) unless database.name == Database::ADMIN
Mongo::Collection::View::ChangeStream.new(
Mongo::Collection::View.new(self["#{Database::COMMAND}.aggregate"]),
pipeline,
Mongo::Collection::View::ChangeStream::CLUSTER,
options)
end | [
"def",
"watch",
"(",
"pipeline",
"=",
"[",
"]",
",",
"options",
"=",
"{",
"}",
")",
"return",
"use",
"(",
"Database",
"::",
"ADMIN",
")",
".",
"watch",
"(",
"pipeline",
",",
"options",
")",
"unless",
"database",
".",
"name",
"==",
"Database",
"::",
... | As of version 3.6 of the MongoDB server, a ``$changeStream`` pipeline stage is supported
in the aggregation framework. As of version 4.0, this stage allows users to request that
notifications are sent for all changes that occur in the client's cluster.
@example Get change notifications for the client's cluster.
client.watch([{ '$match' => { operationType: { '$in' => ['insert', 'replace'] } } }])
@param [ Array<Hash> ] pipeline Optional additional filter operators.
@param [ Hash ] options The change stream options.
@option options [ String ] :full_document Allowed values: 'default', 'updateLookup'.
Defaults to 'default'. When set to 'updateLookup', the change notification for partial
updates will include both a delta describing the changes to the document, as well as a copy
of the entire document that was changed from some time after the change occurred.
@option options [ BSON::Document, Hash ] :resume_after Specifies the logical starting point
for the new change stream.
@option options [ Integer ] :max_await_time_ms The maximum amount of time for the server to
wait on new documents to satisfy a change stream query.
@option options [ Integer ] :batch_size The number of documents to return per batch.
@option options [ BSON::Document, Hash ] :collation The collation to use.
@option options [ Session ] :session The session to use.
@option options [ BSON::Timestamp ] :start_at_operation_time Only return
changes that occurred at or after the specified timestamp. Any command run
against the server will return a cluster time that can be used here.
Only recognized by server versions 4.0+.
@note A change stream only allows 'majority' read concern.
@note This helper method is preferable to running a raw aggregation with a $changeStream
stage, for the purpose of supporting resumability.
@return [ ChangeStream ] The change stream object.
@since 2.6.0 | [
"As",
"of",
"version",
"3",
".",
"6",
"of",
"the",
"MongoDB",
"server",
"a",
"$changeStream",
"pipeline",
"stage",
"is",
"supported",
"in",
"the",
"aggregation",
"framework",
".",
"As",
"of",
"version",
"4",
".",
"0",
"this",
"stage",
"allows",
"users",
... | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/client.rb#L692-L700 | train | watches the database for changes | [
30522,
13366,
3422,
1006,
13117,
1027,
1031,
1033,
1010,
7047,
1027,
1063,
1065,
1007,
2709,
2224,
1006,
7809,
1024,
1024,
4748,
10020,
1007,
1012,
3422,
1006,
13117,
1010,
7047,
1007,
4983,
7809,
1012,
2171,
1027,
1027,
7809,
1024,
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... |
mojombo/chronic | lib/chronic/handlers.rb | Chronic.Handlers.handle_sd_rmn | def handle_sd_rmn(tokens, options)
month = tokens[1].get_tag(RepeaterMonthName)
day = tokens[0].get_tag(ScalarDay).type
return if month_overflow?(self.now.year, month.index, day)
handle_m_d(month, day, tokens[2..tokens.size], options)
end | ruby | def handle_sd_rmn(tokens, options)
month = tokens[1].get_tag(RepeaterMonthName)
day = tokens[0].get_tag(ScalarDay).type
return if month_overflow?(self.now.year, month.index, day)
handle_m_d(month, day, tokens[2..tokens.size], options)
end | [
"def",
"handle_sd_rmn",
"(",
"tokens",
",",
"options",
")",
"month",
"=",
"tokens",
"[",
"1",
"]",
".",
"get_tag",
"(",
"RepeaterMonthName",
")",
"day",
"=",
"tokens",
"[",
"0",
"]",
".",
"get_tag",
"(",
"ScalarDay",
")",
".",
"type",
"return",
"if",
... | Handle scalar-day/repeater-month-name | [
"Handle",
"scalar",
"-",
"day",
"/",
"repeater",
"-",
"month",
"-",
"name"
] | 2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c | https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L87-L94 | train | Handle the SD RMN token | [
30522,
13366,
5047,
1035,
17371,
1035,
28549,
2078,
1006,
19204,
2015,
1010,
7047,
1007,
3204,
1027,
19204,
2015,
1031,
1015,
1033,
1012,
2131,
1035,
6415,
1006,
9377,
2121,
9629,
7295,
14074,
1007,
2154,
1027,
19204,
2015,
1031,
1014,
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... |
samvera/hyrax | app/presenters/hyrax/characterization_behavior.rb | Hyrax.CharacterizationBehavior.secondary_characterization_values | def secondary_characterization_values(term)
values = values_for(term)
additional_values = values.slice(Hyrax.config.fits_message_length, values.length - Hyrax.config.fits_message_length)
return [] unless additional_values
truncate_all(additional_values)
end | ruby | def secondary_characterization_values(term)
values = values_for(term)
additional_values = values.slice(Hyrax.config.fits_message_length, values.length - Hyrax.config.fits_message_length)
return [] unless additional_values
truncate_all(additional_values)
end | [
"def",
"secondary_characterization_values",
"(",
"term",
")",
"values",
"=",
"values_for",
"(",
"term",
")",
"additional_values",
"=",
"values",
".",
"slice",
"(",
"Hyrax",
".",
"config",
".",
"fits_message_length",
",",
"values",
".",
"length",
"-",
"Hyrax",
... | Returns an array of characterization values truncated to 250 characters that are in
excess of the maximum number of configured values.
@param [Symbol] term found in the characterization_metadata hash
@return [Array] of truncated values | [
"Returns",
"an",
"array",
"of",
"characterization",
"values",
"truncated",
"to",
"250",
"characters",
"that",
"are",
"in",
"excess",
"of",
"the",
"maximum",
"number",
"of",
"configured",
"values",
"."
] | e2b4f56e829a53b1f11296324736e9d5b8c9ee5f | https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/presenters/hyrax/characterization_behavior.rb#L59-L64 | train | Returns the secondary characterization values for the given term. | [
30522,
13366,
3905,
1035,
23191,
1035,
5300,
1006,
2744,
1007,
5300,
1027,
5300,
1035,
2005,
1006,
2744,
1007,
3176,
1035,
5300,
1027,
5300,
1012,
14704,
1006,
1044,
19563,
2595,
1012,
9530,
8873,
2290,
1012,
16142,
1035,
4471,
1035,
3091,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/volume_containers.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.VolumeContainers.list_by_device | def list_by_device(device_name, resource_group_name, manager_name, custom_headers:nil)
response = list_by_device_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_by_device(device_name, resource_group_name, manager_name, custom_headers:nil)
response = list_by_device_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_by_device",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_device_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
"... | Gets all the volume containers in a device.
@param device_name [String] The device name
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VolumeContainerList] operation results. | [
"Gets",
"all",
"the",
"volume",
"containers",
"in",
"a",
"device",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/volume_containers.rb#L35-L38 | train | Gets the list of all the available advisors. | [
30522,
13366,
2862,
1035,
2011,
1035,
5080,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
5080,
1035,
2004,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
piotrmurach/github | lib/github_api/client/repos/pub_sub_hubbub.rb | Github.Client::Repos::PubSubHubbub.subscribe_service | def subscribe_service(*args)
params = arguments(args, required: [:user, :repo, :service]).params
event = params.delete('event') || 'push'
topic = "#{site}/#{arguments.user}/#{arguments.repo}/events/#{event}"
callback = "github://#{arguments.service}?#{params.serialize}"
subscribe(topic, callback)
end | ruby | def subscribe_service(*args)
params = arguments(args, required: [:user, :repo, :service]).params
event = params.delete('event') || 'push'
topic = "#{site}/#{arguments.user}/#{arguments.repo}/events/#{event}"
callback = "github://#{arguments.service}?#{params.serialize}"
subscribe(topic, callback)
end | [
"def",
"subscribe_service",
"(",
"*",
"args",
")",
"params",
"=",
"arguments",
"(",
"args",
",",
"required",
":",
"[",
":user",
",",
":repo",
",",
":service",
"]",
")",
".",
"params",
"event",
"=",
"params",
".",
"delete",
"(",
"'event'",
")",
"||",
... | Subscribe repository to service hook through pubsubhubbub
@param [Hash] params
@input params [String] :event
Required hash key for the type of event. The default event is push.
@example
github = Github.new oauth_token: '...'
github.repos.pubsubhubbub.subscribe_service 'user-name', 'repo-name',
'campfire',
subdomain: 'github',
room: 'Commits',
token: 'abc123',
event: 'watch'
@api public | [
"Subscribe",
"repository",
"to",
"service",
"hook",
"through",
"pubsubhubbub"
] | 8702452c66bea33c9388550aed9e9974f76aaef1 | https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/repos/pub_sub_hubbub.rb#L80-L87 | train | Subscribe to a service | [
30522,
13366,
4942,
29234,
1035,
2326,
1006,
1008,
12098,
5620,
1007,
11498,
5244,
1027,
9918,
1006,
12098,
5620,
1010,
3223,
1024,
1031,
1024,
5310,
1010,
1024,
16360,
2080,
1010,
1024,
2326,
1033,
1007,
1012,
11498,
5244,
2724,
1027,
1149... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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_prebuilts | def list_prebuilts(app_id, version_id, skip:0, take:100, custom_headers:nil)
response = list_prebuilts_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_prebuilts(app_id, version_id, skip:0, take:100, custom_headers:nil)
response = list_prebuilts_async(app_id, version_id, skip:skip, take:take, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_prebuilts",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"0",
",",
"take",
":",
"100",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_prebuilts_async",
"(",
"app_id",
",",
"version_id",
",",
"skip",
":",
"skip",
",",
"... | Gets information about all the prebuilt entities in a version of the
application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param skip [Integer] The number of entries to skip. Default value is 0.
@param take [Integer] The number of entries to return. Maximum page size is
500. Default is 100.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array] operation results. | [
"Gets",
"information",
"about",
"all",
"the",
"prebuilt",
"entities",
"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#L1346-L1349 | train | Gets the list of prebuilts for a version of the application. | [
30522,
13366,
2862,
1035,
3653,
8569,
4014,
3215,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
13558,
1024,
1014,
1010,
2202,
1024,
2531,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
3653,
8569,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb | Azure::CognitiveServices::ContentModerator::V1_0.Reviews.add_video_frame_url | def add_video_frame_url(content_type, team_name, review_id, video_frame_body, timescale:nil, custom_headers:nil)
response = add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale:timescale, custom_headers:custom_headers).value!
nil
end | ruby | def add_video_frame_url(content_type, team_name, review_id, video_frame_body, timescale:nil, custom_headers:nil)
response = add_video_frame_url_async(content_type, team_name, review_id, video_frame_body, timescale:timescale, custom_headers:custom_headers).value!
nil
end | [
"def",
"add_video_frame_url",
"(",
"content_type",
",",
"team_name",
",",
"review_id",
",",
"video_frame_body",
",",
"timescale",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"add_video_frame_url_async",
"(",
"content_type",
",",
"team_name",... | Use this method to add frames for a video review.Timescale: This parameter is
a factor which is used to convert the timestamp on a frame into milliseconds.
Timescale is provided in the output of the Content Moderator video media
processor on the Azure Media Services platform.Timescale in the Video
Moderation output is Ticks/Second.
@param content_type [String] The content type.
@param team_name [String] Your team name.
@param review_id [String] Id of the review.
@param video_frame_body [Array<VideoFrameBodyItem>] Body for add video frames
API
@param timescale [Integer] Timescale of the video.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Use",
"this",
"method",
"to",
"add",
"frames",
"for",
"a",
"video",
"review",
".",
"Timescale",
":",
"This",
"parameter",
"is",
"a",
"factor",
"which",
"is",
"used",
"to",
"convert",
"the",
"timestamp",
"on",
"a",
"frame",
"into",
"milliseconds",
".",
"... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/reviews.rb#L1590-L1593 | train | Adds a video frame to a review. | [
30522,
13366,
5587,
1035,
2678,
1035,
4853,
1035,
24471,
2140,
1006,
4180,
1035,
2828,
1010,
2136,
1035,
2171,
1010,
3319,
1035,
8909,
1010,
2678,
1035,
4853,
1035,
2303,
1010,
2335,
9289,
2063,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
middleman/middleman | middleman-core/lib/middleman-core/dns_resolver.rb | Middleman.DnsResolver.names_for | def names_for(ip)
resolvers.each do |r|
names = r.getnames(ip)
return names unless names.nil? || names.empty?
end
[]
end | ruby | def names_for(ip)
resolvers.each do |r|
names = r.getnames(ip)
return names unless names.nil? || names.empty?
end
[]
end | [
"def",
"names_for",
"(",
"ip",
")",
"resolvers",
".",
"each",
"do",
"|",
"r",
"|",
"names",
"=",
"r",
".",
"getnames",
"(",
"ip",
")",
"return",
"names",
"unless",
"names",
".",
"nil?",
"||",
"names",
".",
"empty?",
"end",
"[",
"]",
"end"
] | Create resolver
First the local resolver is used. If environment variable HOSTSRC is
given this file is used for local name lookup.
@param [#getnames, #getaddresses] network_resolver
The resolver which uses a network name server to resolve ip addresses
and names.
@param [#getnames, #getaddresses] local_resolver
The resolver uses /etc/hosts on POSIX-systems and
C:\Windows\System32\drivers\etc\hosts on Windows-operating systems to
resolve ip addresses and names.
First the local resolver is queried. If this raises an error or returns
nil or [] the network resolver is queried.
Get names for given ip
@param [String] ip
The ip which should be resolved. | [
"Create",
"resolver"
] | a0dd9f78094813162895511e8516e0c5507cee50 | https://github.com/middleman/middleman/blob/a0dd9f78094813162895511e8516e0c5507cee50/middleman-core/lib/middleman-core/dns_resolver.rb#L46-L54 | train | Returns the names of the resolvers for the given IP. | [
30522,
13366,
3415,
1035,
2005,
1006,
12997,
1007,
10663,
2869,
1012,
2169,
2079,
1064,
1054,
1064,
3415,
1027,
1054,
1012,
2131,
18442,
2015,
1006,
12997,
1007,
2709,
3415,
4983,
3415,
1012,
9152,
2140,
1029,
1064,
1064,
3415,
1012,
4064,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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 | frameit/lib/frameit/editor.rb | Frameit.Editor.put_into_frame | def put_into_frame
# We have to rotate the screenshot, since the offset information is for portrait
# only. Instead of doing the calculations ourselves, it's much easier to let
# imagemagick do the hard lifting for landscape screenshots
rotation = self.rotation_for_device_orientation
frame.rotate(-rotation)
@image.rotate(-rotation)
# Debug Mode: Add filename to frame
if self.debug_mode
filename = File.basename(@frame_path, ".*")
filename.sub!('Apple', '') # remove 'Apple'
width = screenshot.size[0]
font_size = width / 20 # magic number that works well
offset_top = offset['offset'].split("+")[2].to_f
annotate_offset = "+0+#{offset_top}" # magic number that works semi well
frame.combine_options do |c|
c.gravity('North')
c.undercolor('#00000080')
c.fill('white')
c.pointsize(font_size)
c.annotate(annotate_offset.to_s, filename.to_s)
end
end
@image = frame.composite(image, "png") do |c|
c.compose("DstOver")
c.geometry(offset['offset'])
end
# Revert the rotation from above
frame.rotate(rotation)
@image.rotate(rotation)
end | ruby | def put_into_frame
# We have to rotate the screenshot, since the offset information is for portrait
# only. Instead of doing the calculations ourselves, it's much easier to let
# imagemagick do the hard lifting for landscape screenshots
rotation = self.rotation_for_device_orientation
frame.rotate(-rotation)
@image.rotate(-rotation)
# Debug Mode: Add filename to frame
if self.debug_mode
filename = File.basename(@frame_path, ".*")
filename.sub!('Apple', '') # remove 'Apple'
width = screenshot.size[0]
font_size = width / 20 # magic number that works well
offset_top = offset['offset'].split("+")[2].to_f
annotate_offset = "+0+#{offset_top}" # magic number that works semi well
frame.combine_options do |c|
c.gravity('North')
c.undercolor('#00000080')
c.fill('white')
c.pointsize(font_size)
c.annotate(annotate_offset.to_s, filename.to_s)
end
end
@image = frame.composite(image, "png") do |c|
c.compose("DstOver")
c.geometry(offset['offset'])
end
# Revert the rotation from above
frame.rotate(rotation)
@image.rotate(rotation)
end | [
"def",
"put_into_frame",
"# We have to rotate the screenshot, since the offset information is for portrait",
"# only. Instead of doing the calculations ourselves, it's much easier to let",
"# imagemagick do the hard lifting for landscape screenshots",
"rotation",
"=",
"self",
".",
"rotation_for_de... | puts the screenshot into the frame | [
"puts",
"the",
"screenshot",
"into",
"the",
"frame"
] | 457c5d647c77f0e078dafa5129da616914e002c5 | https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/frameit/lib/frameit/editor.rb#L83-L119 | train | This method is used to put the image into the frame | [
30522,
13366,
2404,
1035,
2046,
1035,
4853,
1001,
2057,
2031,
2000,
24357,
1996,
12117,
12326,
1010,
2144,
1996,
16396,
2592,
2003,
2005,
6533,
1001,
2069,
1012,
2612,
1997,
2725,
1996,
16268,
9731,
1010,
2009,
1005,
1055,
2172,
6082,
2000,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activerecord/lib/active_record/autosave_association.rb | ActiveRecord.AutosaveAssociation.association_valid? | def association_valid?(reflection, record, index = nil)
return true if record.destroyed? || (reflection.options[:autosave] && record.marked_for_destruction?)
context = validation_context unless [:create, :update].include?(validation_context)
unless valid = record.valid?(context)
if reflection.options[:autosave]
indexed_attribute = !index.nil? && (reflection.options[:index_errors] || ActiveRecord::Base.index_nested_attribute_errors)
record.errors.group_by_attribute.each { |attribute, errors|
attribute = normalize_reflection_attribute(indexed_attribute, reflection, index, attribute)
errors.each { |error|
self.errors.import(
error,
attribute: attribute
)
}
}
else
errors.add(reflection.name)
end
end
valid
end | ruby | def association_valid?(reflection, record, index = nil)
return true if record.destroyed? || (reflection.options[:autosave] && record.marked_for_destruction?)
context = validation_context unless [:create, :update].include?(validation_context)
unless valid = record.valid?(context)
if reflection.options[:autosave]
indexed_attribute = !index.nil? && (reflection.options[:index_errors] || ActiveRecord::Base.index_nested_attribute_errors)
record.errors.group_by_attribute.each { |attribute, errors|
attribute = normalize_reflection_attribute(indexed_attribute, reflection, index, attribute)
errors.each { |error|
self.errors.import(
error,
attribute: attribute
)
}
}
else
errors.add(reflection.name)
end
end
valid
end | [
"def",
"association_valid?",
"(",
"reflection",
",",
"record",
",",
"index",
"=",
"nil",
")",
"return",
"true",
"if",
"record",
".",
"destroyed?",
"||",
"(",
"reflection",
".",
"options",
"[",
":autosave",
"]",
"&&",
"record",
".",
"marked_for_destruction?",
... | Returns whether or not the association is valid and applies any errors to
the parent, <tt>self</tt>, if it wasn't. Skips any <tt>:autosave</tt>
enabled records if they're marked_for_destruction? or destroyed. | [
"Returns",
"whether",
"or",
"not",
"the",
"association",
"is",
"valid",
"and",
"applies",
"any",
"errors",
"to",
"the",
"parent",
"<tt",
">",
"self<",
"/",
"tt",
">",
"if",
"it",
"wasn",
"t",
".",
"Skips",
"any",
"<tt",
">",
":",
"autosave<",
"/",
"t... | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/autosave_association.rb#L324-L348 | train | Returns true if the record is valid for the given reflection. | [
30522,
13366,
2523,
1035,
9398,
1029,
1006,
9185,
1010,
2501,
1010,
5950,
1027,
9152,
2140,
1007,
2709,
2995,
2065,
2501,
1012,
3908,
1029,
1064,
1064,
1006,
9185,
1012,
7047,
1031,
1024,
8285,
3736,
3726,
1033,
1004,
1004,
2501,
1012,
44... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
randym/axlsx | lib/axlsx/drawing/d_lbls.rb | Axlsx.DLbls.to_xml_string | def to_xml_string(str = '')
validate_attributes_for_chart_type
str << '<c:dLbls>'
%w(d_lbl_pos show_legend_key show_val show_cat_name show_ser_name show_percent show_bubble_size show_leader_lines).each do |key|
next unless instance_values.keys.include?(key) && instance_values[key] != nil
str << "<c:#{Axlsx::camel(key, false)} val='#{instance_values[key]}' />"
end
str << '</c:dLbls>'
end | ruby | def to_xml_string(str = '')
validate_attributes_for_chart_type
str << '<c:dLbls>'
%w(d_lbl_pos show_legend_key show_val show_cat_name show_ser_name show_percent show_bubble_size show_leader_lines).each do |key|
next unless instance_values.keys.include?(key) && instance_values[key] != nil
str << "<c:#{Axlsx::camel(key, false)} val='#{instance_values[key]}' />"
end
str << '</c:dLbls>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"validate_attributes_for_chart_type",
"str",
"<<",
"'<c:dLbls>'",
"%w(",
"d_lbl_pos",
"show_legend_key",
"show_val",
"show_cat_name",
"show_ser_name",
"show_percent",
"show_bubble_size",
"show_leader_lines",
")",
".",
"e... | serializes the data labels
@return [String] | [
"serializes",
"the",
"data",
"labels"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/drawing/d_lbls.rb#L71-L79 | train | Convert the chart to XML string. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
9398,
3686,
1035,
12332,
1035,
2005,
1035,
3673,
1035,
2828,
2358,
2099,
1026,
1026,
1005,
1026,
1039,
1024,
21469,
16558,
2015,
1028,
1005,
1003,
1059,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/rdoc/code_objects.rb | RDoc.PuppetClass.find_symbol | def find_symbol(symbol, method=nil)
result = super(symbol)
if not result and symbol =~ /::/
modules = symbol.split(/::/)
unless modules.empty?
module_name = modules.shift
result = find_module_named(module_name)
if result
last_name = ""
previous = nil
modules.each do |mod|
previous = result
last_name = mod
result = result.find_module_named(mod)
break unless result
end
unless result
result = previous
method = last_name
end
end
end
if result && method
if !result.respond_to?(:find_local_symbol)
p result.name
p method
fail
end
result = result.find_local_symbol(method)
end
end
result
end | ruby | def find_symbol(symbol, method=nil)
result = super(symbol)
if not result and symbol =~ /::/
modules = symbol.split(/::/)
unless modules.empty?
module_name = modules.shift
result = find_module_named(module_name)
if result
last_name = ""
previous = nil
modules.each do |mod|
previous = result
last_name = mod
result = result.find_module_named(mod)
break unless result
end
unless result
result = previous
method = last_name
end
end
end
if result && method
if !result.respond_to?(:find_local_symbol)
p result.name
p method
fail
end
result = result.find_local_symbol(method)
end
end
result
end | [
"def",
"find_symbol",
"(",
"symbol",
",",
"method",
"=",
"nil",
")",
"result",
"=",
"super",
"(",
"symbol",
")",
"if",
"not",
"result",
"and",
"symbol",
"=~",
"/",
"/",
"modules",
"=",
"symbol",
".",
"split",
"(",
"/",
"/",
")",
"unless",
"modules",
... | Look up the given symbol. RDoc only looks for class1::class2.method
or class1::class2#method. Since our definitions are mapped to RDoc methods
but are written class1::class2::define we need to perform the lookup by
ourselves. | [
"Look",
"up",
"the",
"given",
"symbol",
".",
"RDoc",
"only",
"looks",
"for",
"class1",
"::",
"class2",
".",
"method",
"or",
"class1",
"::",
"class2#method",
".",
"Since",
"our",
"definitions",
"are",
"mapped",
"to",
"RDoc",
"methods",
"but",
"are",
"writte... | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/rdoc/code_objects.rb#L144-L176 | train | Find a symbol in the current module | [
30522,
13366,
2424,
1035,
6454,
1006,
6454,
1010,
4118,
1027,
9152,
2140,
1007,
2765,
1027,
3565,
1006,
6454,
1007,
2065,
2025,
2765,
1998,
6454,
1027,
1066,
1013,
1024,
1024,
1013,
14184,
1027,
6454,
1012,
3975,
1006,
1013,
1024,
1024,
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... |
hashicorp/vault-ruby | lib/vault/persistent.rb | Vault.PersistentHTTP.start | def start http
http.set_debug_output @debug_output if @debug_output
http.open_timeout = @open_timeout if @open_timeout
http.start
socket = http.instance_variable_get :@socket
if socket then # for fakeweb
@socket_options.each do |option|
socket.io.setsockopt(*option)
end
end
end | ruby | def start http
http.set_debug_output @debug_output if @debug_output
http.open_timeout = @open_timeout if @open_timeout
http.start
socket = http.instance_variable_get :@socket
if socket then # for fakeweb
@socket_options.each do |option|
socket.io.setsockopt(*option)
end
end
end | [
"def",
"start",
"http",
"http",
".",
"set_debug_output",
"@debug_output",
"if",
"@debug_output",
"http",
".",
"open_timeout",
"=",
"@open_timeout",
"if",
"@open_timeout",
"http",
".",
"start",
"socket",
"=",
"http",
".",
"instance_variable_get",
":@socket",
"if",
... | Starts the Net::HTTP +connection+ | [
"Starts",
"the",
"Net",
"::",
"HTTP",
"+",
"connection",
"+"
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/persistent.rb#L694-L707 | train | Start the HTTP connection. | [
30522,
13366,
2707,
8299,
8299,
1012,
2275,
1035,
2139,
8569,
2290,
1035,
6434,
1030,
2139,
8569,
2290,
1035,
6434,
2065,
1030,
2139,
8569,
2290,
1035,
6434,
8299,
1012,
2330,
1035,
2051,
5833,
1027,
1030,
2330,
1035,
2051,
5833,
2065,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.update_repair_task_health_policy | def update_repair_task_health_policy(repair_task_update_health_policy_description, custom_headers:nil)
response = update_repair_task_health_policy_async(repair_task_update_health_policy_description, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def update_repair_task_health_policy(repair_task_update_health_policy_description, custom_headers:nil)
response = update_repair_task_health_policy_async(repair_task_update_health_policy_description, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"update_repair_task_health_policy",
"(",
"repair_task_update_health_policy_description",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"update_repair_task_health_policy_async",
"(",
"repair_task_update_health_policy_description",
",",
"custom_headers",
":custom_head... | Updates the health policy 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_update_health_policy_description
[RepairTaskUpdateHealthPolicyDescription] Describes the repair task healthy
policy to be updated.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RepairTaskUpdateInfo] operation results. | [
"Updates",
"the",
"health",
"policy",
"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#L14224-L14227 | train | Updates the health policy of a managed task. | [
30522,
13366,
10651,
1035,
7192,
1035,
4708,
1035,
2740,
1035,
3343,
1006,
7192,
1035,
4708,
1035,
10651,
1035,
2740,
1035,
3343,
1035,
6412,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
10651,
1035,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_container_service/lib/2019-02-01/generated/azure_mgmt_container_service/agent_pools.rb | Azure::ContainerService::Mgmt::V2019_02_01.AgentPools.begin_delete | def begin_delete(resource_group_name, managed_cluster_name, agent_pool_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, managed_cluster_name, agent_pool_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, managed_cluster_name, agent_pool_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, managed_cluster_name, agent_pool_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"managed_cluster_name",
",",
"agent_pool_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"managed_cluster_name",
",",
"agent_pool_name",
",",
"... | Deletes an agent pool.
Deletes the agent pool in the specified managed cluster.
@param resource_group_name [String] The name of the resource group.
@param managed_cluster_name [String] The name of the managed cluster
resource.
@param agent_pool_name [String] The name of the agent pool.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"an",
"agent",
"pool",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_container_service/lib/2019-02-01/generated/azure_mgmt_container_service/agent_pools.rb#L474-L477 | train | Deletes the managed cluster agent pool. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3266,
1035,
9324,
1035,
2171,
1010,
4005,
1035,
4770,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
3972,
12870,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.reissue_with_http_info | def reissue_with_http_info(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil)
reissue_async(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:custom_headers).value!
end | ruby | def reissue_with_http_info(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil)
reissue_async(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:custom_headers).value!
end | [
"def",
"reissue_with_http_info",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"reissue_certificate_order_request",
",",
"custom_headers",
":",
"nil",
")",
"reissue_async",
"(",
"resource_group_name",
",",
"certificate_order_name",
",",
"reissue_certificate_or... | Reissue an existing certificate order.
Reissue an existing certificate order.
@param resource_group_name [String] Name of the resource group to which the
resource belongs.
@param certificate_order_name [String] Name of the certificate order.
@param reissue_certificate_order_request [ReissueCertificateOrderRequest]
Parameters for the reissue.
@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. | [
"Reissue",
"an",
"existing",
"certificate",
"order",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L1212-L1214 | train | Reissues a certificate order. | [
30522,
13366,
17173,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8196,
1035,
2344,
1035,
2171,
1010,
17173,
1035,
8196,
1035,
2344,
1035,
5227,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
17173,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.delete_with_http_info | def delete_with_http_info(resource_group_name, hub_name, connector_name, mapping_name, custom_headers:nil)
delete_async(resource_group_name, hub_name, connector_name, mapping_name, custom_headers:custom_headers).value!
end | ruby | def delete_with_http_info(resource_group_name, hub_name, connector_name, mapping_name, custom_headers:nil)
delete_async(resource_group_name, hub_name, connector_name, mapping_name, custom_headers:custom_headers).value!
end | [
"def",
"delete_with_http_info",
"(",
"resource_group_name",
",",
"hub_name",
",",
"connector_name",
",",
"mapping_name",
",",
"custom_headers",
":",
"nil",
")",
"delete_async",
"(",
"resource_group_name",
",",
"hub_name",
",",
"connector_name",
",",
"mapping_name",
",... | Deletes a 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 custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Deletes",
"a",
"connector",
"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#L285-L287 | train | Deletes a connector mapping. | [
30522,
13366,
3972,
12870,
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,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3972,
12870... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
xcpretty/xcode-install | lib/xcode/install.rb | XcodeInstall.Installer.install_version | def install_version(version, switch = true, clean = true, install = true, progress = true, url = nil, show_release_notes = true, progress_block = nil)
dmg_path = get_dmg(version, progress, url, progress_block)
fail Informative, "Failed to download Xcode #{version}." if dmg_path.nil?
if install
install_dmg(dmg_path, "-#{version.to_s.split(' ').join('.')}", switch, clean)
else
puts "Downloaded Xcode #{version} to '#{dmg_path}'"
end
open_release_notes_url(version) if show_release_notes && !url
end | ruby | def install_version(version, switch = true, clean = true, install = true, progress = true, url = nil, show_release_notes = true, progress_block = nil)
dmg_path = get_dmg(version, progress, url, progress_block)
fail Informative, "Failed to download Xcode #{version}." if dmg_path.nil?
if install
install_dmg(dmg_path, "-#{version.to_s.split(' ').join('.')}", switch, clean)
else
puts "Downloaded Xcode #{version} to '#{dmg_path}'"
end
open_release_notes_url(version) if show_release_notes && !url
end | [
"def",
"install_version",
"(",
"version",
",",
"switch",
"=",
"true",
",",
"clean",
"=",
"true",
",",
"install",
"=",
"true",
",",
"progress",
"=",
"true",
",",
"url",
"=",
"nil",
",",
"show_release_notes",
"=",
"true",
",",
"progress_block",
"=",
"nil",... | rubocop:disable Metrics/ParameterLists | [
"rubocop",
":",
"disable",
"Metrics",
"/",
"ParameterLists"
] | 054d80ac84f6e2b666b862d3b5fa936dda0f8722 | https://github.com/xcpretty/xcode-install/blob/054d80ac84f6e2b666b862d3b5fa936dda0f8722/lib/xcode/install.rb#L277-L288 | train | Install a version of Xcode | [
30522,
13366,
16500,
1035,
2544,
1006,
2544,
1010,
6942,
1027,
2995,
1010,
4550,
1027,
2995,
1010,
16500,
1027,
2995,
1010,
5082,
1027,
2995,
1010,
24471,
2140,
1027,
9152,
2140,
1010,
2265,
1035,
2713,
1035,
3964,
1027,
2995,
1010,
5082,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/inifile.rb | Puppet::Util::IniConfig.PhysicalFile.read | def read
text = @filetype.read
if text.nil?
raise IniParseError, _("Cannot read nonexistent file %{file}") % { file: @file.inspect }
end
parse(text)
end | ruby | def read
text = @filetype.read
if text.nil?
raise IniParseError, _("Cannot read nonexistent file %{file}") % { file: @file.inspect }
end
parse(text)
end | [
"def",
"read",
"text",
"=",
"@filetype",
".",
"read",
"if",
"text",
".",
"nil?",
"raise",
"IniParseError",
",",
"_",
"(",
"\"Cannot read nonexistent file %{file}\"",
")",
"%",
"{",
"file",
":",
"@file",
".",
"inspect",
"}",
"end",
"parse",
"(",
"text",
")"... | Read and parse the on-disk file associated with this object | [
"Read",
"and",
"parse",
"the",
"on",
"-",
"disk",
"file",
"associated",
"with",
"this",
"object"
] | 4baeed97cbb7571ddc6635f0a24debe2e8b22cd3 | https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/util/inifile.rb#L136-L142 | train | Reads the file and parses the data into an array of objects. | [
30522,
13366,
3191,
3793,
1027,
1030,
5371,
13874,
1012,
3191,
2065,
3793,
1012,
9152,
2140,
1029,
5333,
1999,
11514,
11650,
11510,
29165,
1010,
1035,
1006,
1000,
3685,
3191,
3904,
9048,
16173,
2102,
5371,
1003,
1063,
5371,
1065,
1000,
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_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/firewall_rules.rb | Azure::DataLakeAnalytics::Mgmt::V2016_11_01.FirewallRules.list_by_account_as_lazy | def list_by_account_as_lazy(resource_group_name, account_name, custom_headers:nil)
response = list_by_account_async(resource_group_name, account_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_account_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | ruby | def list_by_account_as_lazy(resource_group_name, account_name, custom_headers:nil)
response = list_by_account_async(resource_group_name, account_name, custom_headers:custom_headers).value!
unless response.nil?
page = response.body
page.next_method = Proc.new do |next_page_link|
list_by_account_next_async(next_page_link, custom_headers:custom_headers)
end
page
end
end | [
"def",
"list_by_account_as_lazy",
"(",
"resource_group_name",
",",
"account_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_by_account_async",
"(",
"resource_group_name",
",",
"account_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"val... | Lists the Data Lake Analytics firewall rules within the specified Data Lake
Analytics account.
@param resource_group_name [String] The name of the Azure resource group.
@param account_name [String] The name of the Data Lake Analytics account.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [FirewallRuleListResult] which provide lazy access to pages of the
response. | [
"Lists",
"the",
"Data",
"Lake",
"Analytics",
"firewall",
"rules",
"within",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_datalake_analytics/lib/2016-11-01/generated/azure_mgmt_datalake_analytics/firewall_rules.rb#L631-L640 | train | Gets the list of all the available Central App Service Environment. | [
30522,
13366,
2862,
1035,
2011,
1035,
4070,
1035,
2004,
1035,
13971,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2011,
1035,
4070,
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... |
aws/aws-sdk-ruby | gems/aws-sdk-ec2/lib/aws-sdk-ec2/resource.rb | Aws::EC2.Resource.classic_addresses | def classic_addresses(options = {})
batches = Enumerator.new do |y|
batch = []
options = Aws::Util.deep_merge(options, filters: [{
name: "domain",
values: ["standard"]
}])
resp = @client.describe_addresses(options)
resp.data.addresses.each do |a|
batch << ClassicAddress.new(
public_ip: a.public_ip,
data: a,
client: @client
)
end
y.yield(batch)
end
ClassicAddress::Collection.new(batches)
end | ruby | def classic_addresses(options = {})
batches = Enumerator.new do |y|
batch = []
options = Aws::Util.deep_merge(options, filters: [{
name: "domain",
values: ["standard"]
}])
resp = @client.describe_addresses(options)
resp.data.addresses.each do |a|
batch << ClassicAddress.new(
public_ip: a.public_ip,
data: a,
client: @client
)
end
y.yield(batch)
end
ClassicAddress::Collection.new(batches)
end | [
"def",
"classic_addresses",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"batch",
"=",
"[",
"]",
"options",
"=",
"Aws",
"::",
"Util",
".",
"deep_merge",
"(",
"options",
",",
"filters",
":",
"[",
... | @!group Associations
@example Request syntax with placeholder values
classic_addresses = ec2.classic_addresses({
filters: [
{
name: "String",
values: ["String"],
},
],
public_ips: ["String"],
allocation_ids: ["String"],
dry_run: false,
})
@param [Hash] options ({})
@option options [Array<Types::Filter>] :filters
One or more filters. Filter names and values are case-sensitive.
* `allocation-id` - \[EC2-VPC\] The allocation ID for the address.
* `association-id` - \[EC2-VPC\] The association ID for the address.
* `domain` - Indicates whether the address is for use in EC2-Classic
(`standard`) or in a VPC (`vpc`).
* `instance-id` - The ID of the instance the address is associated
with, if any.
* `network-interface-id` - \[EC2-VPC\] The ID of the network interface
that the address is associated with, if any.
* `network-interface-owner-id` - The AWS account ID of the owner.
* `private-ip-address` - \[EC2-VPC\] The private IP address associated
with the Elastic IP address.
* `public-ip` - The Elastic IP address.
* `tag`\:<key> - The key/value combination of a tag assigned to
the resource. Use the tag key in the filter name and the tag value
as the filter value. For example, to find all resources that have a
tag with the key `Owner` and the value `TeamA`, specify `tag:Owner`
for the filter name and `TeamA` for the filter value.
* `tag-key` - The key of a tag assigned to the resource. Use this
filter to find all resources assigned a tag with a specific key,
regardless of the tag value.
@option options [Array<String>] :public_ips
One or more Elastic IP addresses.
Default: Describes all your Elastic IP addresses.
@option options [Array<String>] :allocation_ids
\[EC2-VPC\] Information about the allocation IDs.
@option options [Boolean] :dry_run
Checks whether you have the required permissions for the action,
without actually making the request, and provides an error response.
If you have the required permissions, the error response is
`DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
@return [ClassicAddress::Collection] | [
"@!group",
"Associations",
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/resource.rb#L1254-L1272 | train | Returns a collection of all the classic addresses | [
30522,
13366,
4438,
1035,
11596,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
2229,
1027,
4372,
17897,
16259,
1012,
2047,
2079,
1064,
1061,
1064,
14108,
1027,
1031,
1033,
7047,
1027,
22091,
2015,
1024,
1024,
21183,
4014,
1012,
2784,
1035,
135... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/runner.rb | HTMLProofer.Runner.process_files | def process_files
if @options[:parallel].empty?
files.map { |path| check_path(path) }
else
Parallel.map(files, @options[:parallel]) { |path| check_path(path) }
end
end | ruby | def process_files
if @options[:parallel].empty?
files.map { |path| check_path(path) }
else
Parallel.map(files, @options[:parallel]) { |path| check_path(path) }
end
end | [
"def",
"process_files",
"if",
"@options",
"[",
":parallel",
"]",
".",
"empty?",
"files",
".",
"map",
"{",
"|",
"path",
"|",
"check_path",
"(",
"path",
")",
"}",
"else",
"Parallel",
".",
"map",
"(",
"files",
",",
"@options",
"[",
":parallel",
"]",
")",
... | Walks over each implemented check and runs them on the files, in parallel. | [
"Walks",
"over",
"each",
"implemented",
"check",
"and",
"runs",
"them",
"on",
"the",
"files",
"in",
"parallel",
"."
] | d00955d3b125b9a1649d056bb347ec30e935d847 | https://github.com/gjtorikian/html-proofer/blob/d00955d3b125b9a1649d056bb347ec30e935d847/lib/html-proofer/runner.rb#L85-L91 | train | Process the files in the current directory | [
30522,
13366,
2832,
1035,
6764,
2065,
1030,
7047,
1031,
1024,
5903,
1033,
1012,
4064,
1029,
6764,
1012,
4949,
1063,
1064,
4130,
1064,
4638,
1035,
4130,
1006,
4130,
1007,
1065,
2842,
5903,
1012,
4949,
1006,
6764,
1010,
1030,
7047,
1031,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb | Azure::ApiManagement::Mgmt::V2018_01_01.Tag.get_entity_state_by_api | def get_entity_state_by_api(resource_group_name, service_name, api_id, tag_id, custom_headers:nil)
response = get_entity_state_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers:custom_headers).value!
nil
end | ruby | def get_entity_state_by_api(resource_group_name, service_name, api_id, tag_id, custom_headers:nil)
response = get_entity_state_by_api_async(resource_group_name, service_name, api_id, tag_id, custom_headers:custom_headers).value!
nil
end | [
"def",
"get_entity_state_by_api",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
",",
"tag_id",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_entity_state_by_api_async",
"(",
"resource_group_name",
",",
"service_name",
",",
"api_id",
"... | Gets the entity state version of the tag specified by its identifier.
@param resource_group_name [String] The name of the resource group.
@param service_name [String] The name of the API Management service.
@param api_id [String] API revision identifier. Must be unique in the current
API Management service instance. Non-current revision has ;rev=n as a suffix
where n is the revision number.
@param tag_id [String] Tag identifier. Must be unique in the current API
Management service instance.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Gets",
"the",
"entity",
"state",
"version",
"of",
"the",
"tag",
"specified",
"by",
"its",
"identifier",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2018-01-01/generated/azure_mgmt_api_management/tag.rb#L845-L848 | train | Gets the entity state of the specified API. | [
30522,
13366,
2131,
1035,
9178,
1035,
2110,
1035,
2011,
1035,
17928,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
17928,
1035,
8909,
1010,
6415,
1035,
8909,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb | Azure::Web::Mgmt::V2015_08_01.AppServiceCertificateOrders.list_certificates_next | def list_certificates_next(next_page_link, custom_headers:nil)
response = list_certificates_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_certificates_next(next_page_link, custom_headers:nil)
response = list_certificates_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_certificates_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_certificates_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"unless",
"re... | List all certificates associated with a certificate order.
List all certificates associated with a certificate order.
@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 [AppServiceCertificateCollection] operation results. | [
"List",
"all",
"certificates",
"associated",
"with",
"a",
"certificate",
"order",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb#L2497-L2500 | train | Gets the list of certificates for the specified App Service Environment. | [
30522,
13366,
2862,
1035,
17987,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
17987,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
1035,
3931,
1035,
4957,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/epubmaker/epubcommon.rb | EPUBMaker.EPUBCommon.colophon | def colophon
@title = CGI.escapeHTML(@producer.res.v('colophontitle'))
@body = <<EOT
<div class="colophon">
EOT
if @producer.config['subtitle'].nil?
@body << <<EOT
<p class="title">#{CGI.escapeHTML(@producer.config.name_of('title'))}</p>
EOT
else
@body << <<EOT
<p class="title">#{CGI.escapeHTML(@producer.config.name_of('title'))}<br /><span class="subtitle">#{CGI.escapeHTML(@producer.config.name_of('subtitle'))}</span></p>
EOT
end
@body << colophon_history if @producer.config['date'] || @producer.config['history']
@body << %Q( <table class="colophon">\n)
@body << @producer.config['colophon_order'].map do |role|
if @producer.config[role]
%Q( <tr><th>#{CGI.escapeHTML(@producer.res.v(role))}</th><td>#{CGI.escapeHTML(join_with_separator(@producer.config.names_of(role), ReVIEW::I18n.t('names_splitter')))}</td></tr>\n)
else
''
end
end.join
@body << %Q( <tr><th>ISBN</th><td>#{@producer.isbn_hyphen}</td></tr>\n) if @producer.isbn_hyphen
@body << %Q( </table>\n)
if @producer.config['rights'] && !@producer.config['rights'].empty?
@body << %Q( <p class="copyright">#{join_with_separator(@producer.config.names_of('rights').map { |m| CGI.escapeHTML(m) }, '<br />')}</p>\n)
end
@body << %Q( </div>\n)
@language = @producer.config['language']
@stylesheets = @producer.config['stylesheet']
tmplfile = if @producer.config['htmlversion'].to_i == 5
File.expand_path('./html/layout-html5.html.erb', ReVIEW::Template::TEMPLATE_DIR)
else
File.expand_path('./html/layout-xhtml1.html.erb', ReVIEW::Template::TEMPLATE_DIR)
end
tmpl = ReVIEW::Template.load(tmplfile)
tmpl.result(binding)
end | ruby | def colophon
@title = CGI.escapeHTML(@producer.res.v('colophontitle'))
@body = <<EOT
<div class="colophon">
EOT
if @producer.config['subtitle'].nil?
@body << <<EOT
<p class="title">#{CGI.escapeHTML(@producer.config.name_of('title'))}</p>
EOT
else
@body << <<EOT
<p class="title">#{CGI.escapeHTML(@producer.config.name_of('title'))}<br /><span class="subtitle">#{CGI.escapeHTML(@producer.config.name_of('subtitle'))}</span></p>
EOT
end
@body << colophon_history if @producer.config['date'] || @producer.config['history']
@body << %Q( <table class="colophon">\n)
@body << @producer.config['colophon_order'].map do |role|
if @producer.config[role]
%Q( <tr><th>#{CGI.escapeHTML(@producer.res.v(role))}</th><td>#{CGI.escapeHTML(join_with_separator(@producer.config.names_of(role), ReVIEW::I18n.t('names_splitter')))}</td></tr>\n)
else
''
end
end.join
@body << %Q( <tr><th>ISBN</th><td>#{@producer.isbn_hyphen}</td></tr>\n) if @producer.isbn_hyphen
@body << %Q( </table>\n)
if @producer.config['rights'] && !@producer.config['rights'].empty?
@body << %Q( <p class="copyright">#{join_with_separator(@producer.config.names_of('rights').map { |m| CGI.escapeHTML(m) }, '<br />')}</p>\n)
end
@body << %Q( </div>\n)
@language = @producer.config['language']
@stylesheets = @producer.config['stylesheet']
tmplfile = if @producer.config['htmlversion'].to_i == 5
File.expand_path('./html/layout-html5.html.erb', ReVIEW::Template::TEMPLATE_DIR)
else
File.expand_path('./html/layout-xhtml1.html.erb', ReVIEW::Template::TEMPLATE_DIR)
end
tmpl = ReVIEW::Template.load(tmplfile)
tmpl.result(binding)
end | [
"def",
"colophon",
"@title",
"=",
"CGI",
".",
"escapeHTML",
"(",
"@producer",
".",
"res",
".",
"v",
"(",
"'colophontitle'",
")",
")",
"@body",
"=",
"<<EOT",
"EOT",
"if",
"@producer",
".",
"config",
"[",
"'subtitle'",
"]",
".",
"nil?",
"@body",
"<<",
"<... | Return colophon content. | [
"Return",
"colophon",
"content",
"."
] | 77d1273e671663f05db2992281fd891b776badf0 | https://github.com/kmuto/review/blob/77d1273e671663f05db2992281fd891b776badf0/lib/epubmaker/epubcommon.rb#L211-L254 | train | Creates a new Colophon object. | [
30522,
13366,
8902,
7361,
8747,
1030,
2516,
1027,
1039,
5856,
1012,
4019,
11039,
19968,
1006,
1030,
3135,
1012,
24501,
1012,
1058,
1006,
1005,
8902,
7361,
8747,
3775,
9286,
1005,
1007,
1007,
1030,
2303,
1027,
1026,
1026,
1041,
4140,
1026,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.unregister_with_http_info | def unregister_with_http_info(resource_group_name, vault_name, identity_name, custom_headers:nil)
unregister_async(resource_group_name, vault_name, identity_name, custom_headers:custom_headers).value!
end | ruby | def unregister_with_http_info(resource_group_name, vault_name, identity_name, custom_headers:nil)
unregister_async(resource_group_name, vault_name, identity_name, custom_headers:custom_headers).value!
end | [
"def",
"unregister_with_http_info",
"(",
"resource_group_name",
",",
"vault_name",
",",
"identity_name",
",",
"custom_headers",
":",
"nil",
")",
"unregister_async",
"(",
"resource_group_name",
",",
"vault_name",
",",
"identity_name",
",",
"custom_headers",
":custom_header... | Unregisters the given container from your Recovery Services vault.
@param resource_group_name [String] The name of the resource group associated
with the Recovery Services vault.
@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_backup/lib/2016-06-01/generated/azure_mgmt_recovery_services_backup/protection_containers.rb#L369-L371 | train | Unregisters the specified resource group from the specified key vault. | [
30522,
13366,
4895,
2890,
24063,
2121,
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,
4895,
2890,
24063,
2121,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
github/linguist | lib/linguist/repository.rb | Linguist.Repository.breakdown_by_file | def breakdown_by_file
@file_breakdown ||= begin
breakdown = Hash.new { |h,k| h[k] = Array.new }
cache.each do |filename, (language, _)|
breakdown[language] << filename.dup.force_encoding("UTF-8").scrub
end
breakdown
end
end | ruby | def breakdown_by_file
@file_breakdown ||= begin
breakdown = Hash.new { |h,k| h[k] = Array.new }
cache.each do |filename, (language, _)|
breakdown[language] << filename.dup.force_encoding("UTF-8").scrub
end
breakdown
end
end | [
"def",
"breakdown_by_file",
"@file_breakdown",
"||=",
"begin",
"breakdown",
"=",
"Hash",
".",
"new",
"{",
"|",
"h",
",",
"k",
"|",
"h",
"[",
"k",
"]",
"=",
"Array",
".",
"new",
"}",
"cache",
".",
"each",
"do",
"|",
"filename",
",",
"(",
"language",
... | Public: Return the language breakdown of this repository by file
Returns a map of language names => [filenames...] | [
"Public",
":",
"Return",
"the",
"language",
"breakdown",
"of",
"this",
"repository",
"by",
"file"
] | 9116c90fcbb82ac03b4b33c58cfbde1fcf745e99 | https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/lib/linguist/repository.rb#L95-L103 | train | Returns a hash of the file breakdowns by the language | [
30522,
13366,
12554,
1035,
2011,
1035,
5371,
1030,
5371,
1035,
12554,
1064,
1064,
1027,
4088,
12554,
1027,
23325,
1012,
2047,
1063,
1064,
1044,
1010,
1047,
1064,
1044,
1031,
1047,
1033,
1027,
9140,
1012,
2047,
1065,
17053,
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... |
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.begin_list_routes_table_summary_with_http_info | def begin_list_routes_table_summary_with_http_info(resource_group_name, circuit_name, peering_name, device_path, custom_headers:nil)
begin_list_routes_table_summary_async(resource_group_name, circuit_name, peering_name, device_path, custom_headers:custom_headers).value!
end | ruby | def begin_list_routes_table_summary_with_http_info(resource_group_name, circuit_name, peering_name, device_path, custom_headers:nil)
begin_list_routes_table_summary_async(resource_group_name, circuit_name, peering_name, device_path, custom_headers:custom_headers).value!
end | [
"def",
"begin_list_routes_table_summary_with_http_info",
"(",
"resource_group_name",
",",
"circuit_name",
",",
"peering_name",
",",
"device_path",
",",
"custom_headers",
":",
"nil",
")",
"begin_list_routes_table_summary_async",
"(",
"resource_group_name",
",",
"circuit_name",
... | Gets the currently advertised routes table summary associated with the
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 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 [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"currently",
"advertised",
"routes",
"table",
"summary",
"associated",
"with",
"the",
"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#L1287-L1289 | train | Gets the route table summary for the express route circuit. | [
30522,
13366,
4088,
1035,
2862,
1035,
5847,
1035,
2795,
1035,
12654,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4984,
1035,
2171,
1010,
16740,
1035,
2171,
1010,
5080,
1035,
4130,
1010,
7661,
1035,
20346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
minimagick/minimagick | lib/mini_magick/tool.rb | MiniMagick.Tool.call | def call(*args)
options = args[-1].is_a?(Hash) ? args.pop : {}
warn "Passing whiny to MiniMagick::Tool#call is deprecated and will be removed in MiniMagick 5, use MiniMagick::Tool.new(whiny: false) instead." if args.any?
whiny = args.fetch(0, @whiny)
options[:whiny] = whiny
options[:stderr] = false if block_given?
shell = MiniMagick::Shell.new
stdout, stderr, status = shell.run(command, options)
yield stdout, stderr, status if block_given?
stdout.chomp("\n")
end | ruby | def call(*args)
options = args[-1].is_a?(Hash) ? args.pop : {}
warn "Passing whiny to MiniMagick::Tool#call is deprecated and will be removed in MiniMagick 5, use MiniMagick::Tool.new(whiny: false) instead." if args.any?
whiny = args.fetch(0, @whiny)
options[:whiny] = whiny
options[:stderr] = false if block_given?
shell = MiniMagick::Shell.new
stdout, stderr, status = shell.run(command, options)
yield stdout, stderr, status if block_given?
stdout.chomp("\n")
end | [
"def",
"call",
"(",
"*",
"args",
")",
"options",
"=",
"args",
"[",
"-",
"1",
"]",
".",
"is_a?",
"(",
"Hash",
")",
"?",
"args",
".",
"pop",
":",
"{",
"}",
"warn",
"\"Passing whiny to MiniMagick::Tool#call is deprecated and will be removed in MiniMagick 5, use MiniM... | @param whiny [Boolean] Whether to raise errors on exit codes different
than 0.
@example
MiniMagick::Tool::Identify.new(whiny: false) do |identify|
identify.help # returns exit status 1, which would otherwise throw an error
end
Executes the command that has been built up.
@example
mogrify = MiniMagick::Tool::Mogrify.new
mogrify.resize("500x500")
mogrify << "path/to/image.jpg"
mogrify.call # executes `mogrify -resize 500x500 path/to/image.jpg`
@example
mogrify = MiniMagick::Tool::Mogrify.new
# build the command
mogrify.call do |stdout, stderr, status|
# ...
end
@yield [Array] Optionally yields stdout, stderr, and exit status
@return [String] Returns the output of the command | [
"@param",
"whiny",
"[",
"Boolean",
"]",
"Whether",
"to",
"raise",
"errors",
"on",
"exit",
"codes",
"different",
"than",
"0",
".",
"@example",
"MiniMagick",
"::",
"Tool",
"::",
"Identify",
".",
"new",
"(",
"whiny",
":",
"false",
")",
"do",
"|identify|",
"... | d484786f35e91f107836d3c86aca61d50a35820b | https://github.com/minimagick/minimagick/blob/d484786f35e91f107836d3c86aca61d50a35820b/lib/mini_magick/tool.rb#L81-L94 | train | Run the command | [
30522,
13366,
2655,
1006,
1008,
12098,
5620,
1007,
7047,
1027,
12098,
5620,
1031,
1011,
1015,
1033,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
1029,
12098,
5620,
1012,
3769,
1024,
1063,
1065,
11582,
1000,
4458,
1059,
10606,
2100,
2000... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
ruby2d/ruby2d | lib/ruby2d/window.rb | Ruby2D.Window.screenshot | def screenshot(path)
if path
ext_screenshot(path)
else
if RUBY_ENGINE == 'ruby'
time = Time.now.utc.strftime '%Y-%m-%d--%H-%M-%S'
else
time = Time.now.utc.to_i
end
ext_screenshot("./screenshot-#{time}.png")
end
end | ruby | def screenshot(path)
if path
ext_screenshot(path)
else
if RUBY_ENGINE == 'ruby'
time = Time.now.utc.strftime '%Y-%m-%d--%H-%M-%S'
else
time = Time.now.utc.to_i
end
ext_screenshot("./screenshot-#{time}.png")
end
end | [
"def",
"screenshot",
"(",
"path",
")",
"if",
"path",
"ext_screenshot",
"(",
"path",
")",
"else",
"if",
"RUBY_ENGINE",
"==",
"'ruby'",
"time",
"=",
"Time",
".",
"now",
".",
"utc",
".",
"strftime",
"'%Y-%m-%d--%H-%M-%S'",
"else",
"time",
"=",
"Time",
".",
... | Take screenshot | [
"Take",
"screenshot"
] | 43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4 | https://github.com/ruby2d/ruby2d/blob/43ce9805a7ae8b82b7ab8c50bf6d4c845d395dc4/lib/ruby2d/window.rb#L396-L407 | train | screenshots the image | [
30522,
13366,
12117,
12326,
1006,
4130,
1007,
2065,
4130,
4654,
2102,
1035,
12117,
12326,
1006,
4130,
1007,
2842,
2065,
10090,
1035,
3194,
1027,
1027,
1005,
10090,
1005,
2051,
1027,
2051,
1012,
2085,
1012,
11396,
1012,
2358,
12881,
7292,
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_machine_learning/lib/2017-01-01/generated/azure_mgmt_machine_learning/web_services.rb | Azure::MachineLearning::Mgmt::V2017_01_01.WebServices.remove | def remove(resource_group_name, web_service_name, custom_headers:nil)
response = remove_async(resource_group_name, web_service_name, custom_headers:custom_headers).value!
nil
end | ruby | def remove(resource_group_name, web_service_name, custom_headers:nil)
response = remove_async(resource_group_name, web_service_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"remove",
"(",
"resource_group_name",
",",
"web_service_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"remove_async",
"(",
"resource_group_name",
",",
"web_service_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"nil",
"... | Deletes the specified web service.
@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 custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"the",
"specified",
"web",
"service",
"."
] | 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#L249-L252 | train | Remove a specified Web Service. | [
30522,
13366,
6366,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4773,
1035,
2326,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
6366,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4773,
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... |
cypriss/mutations | lib/mutations/errors.rb | Mutations.ErrorHash.symbolic | def symbolic
HashWithIndifferentAccess.new.tap do |hash|
each do |k, v|
hash[k] = v.symbolic
end
end
end | ruby | def symbolic
HashWithIndifferentAccess.new.tap do |hash|
each do |k, v|
hash[k] = v.symbolic
end
end
end | [
"def",
"symbolic",
"HashWithIndifferentAccess",
".",
"new",
".",
"tap",
"do",
"|",
"hash",
"|",
"each",
"do",
"|",
"k",
",",
"v",
"|",
"hash",
"[",
"k",
"]",
"=",
"v",
".",
"symbolic",
"end",
"end",
"end"
] | Returns a nested HashWithIndifferentAccess where the values are symbols. Eg:
{
email: :matches,
name: :too_weird,
adddress: {
city: :not_found,
state: :in
}
} | [
"Returns",
"a",
"nested",
"HashWithIndifferentAccess",
"where",
"the",
"values",
"are",
"symbols",
".",
"Eg",
":",
"{",
"email",
":",
":",
"matches",
"name",
":",
":",
"too_weird",
"adddress",
":",
"{",
"city",
":",
":",
"not_found",
"state",
":",
":",
"... | c9948325648d0ea85420963829d1a4d6b4f17bd9 | https://github.com/cypriss/mutations/blob/c9948325648d0ea85420963829d1a4d6b4f17bd9/lib/mutations/errors.rb#L116-L122 | train | Return the symbolic version of the object. | [
30522,
13366,
12613,
23325,
24415,
22254,
13355,
7869,
12380,
9468,
7971,
1012,
2047,
1012,
11112,
2079,
1064,
23325,
1064,
2169,
2079,
1064,
1047,
1010,
1058,
1064,
23325,
1031,
1047,
1033,
1027,
1058,
1012,
12613,
2203,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vault-ruby | lib/vault/client.rb | Vault.Client.with_retries | def with_retries(*rescued, &block)
options = rescued.last.is_a?(Hash) ? rescued.pop : {}
exception = nil
retries = 0
rescued = Defaults::RETRIED_EXCEPTIONS if rescued.empty?
max_attempts = options[:attempts] || Defaults::RETRY_ATTEMPTS
backoff_base = options[:base] || Defaults::RETRY_BASE
backoff_max = options[:max_wait] || Defaults::RETRY_MAX_WAIT
begin
return yield retries, exception
rescue *rescued => e
exception = e
retries += 1
raise if retries > max_attempts
# Calculate the exponential backoff combined with an element of
# randomness.
backoff = [backoff_base * (2 ** (retries - 1)), backoff_max].min
backoff = backoff * (0.5 * (1 + Kernel.rand))
# Ensure we are sleeping at least the minimum interval.
backoff = [backoff_base, backoff].max
# Exponential backoff.
Kernel.sleep(backoff)
# Now retry
retry
end
end | ruby | def with_retries(*rescued, &block)
options = rescued.last.is_a?(Hash) ? rescued.pop : {}
exception = nil
retries = 0
rescued = Defaults::RETRIED_EXCEPTIONS if rescued.empty?
max_attempts = options[:attempts] || Defaults::RETRY_ATTEMPTS
backoff_base = options[:base] || Defaults::RETRY_BASE
backoff_max = options[:max_wait] || Defaults::RETRY_MAX_WAIT
begin
return yield retries, exception
rescue *rescued => e
exception = e
retries += 1
raise if retries > max_attempts
# Calculate the exponential backoff combined with an element of
# randomness.
backoff = [backoff_base * (2 ** (retries - 1)), backoff_max].min
backoff = backoff * (0.5 * (1 + Kernel.rand))
# Ensure we are sleeping at least the minimum interval.
backoff = [backoff_base, backoff].max
# Exponential backoff.
Kernel.sleep(backoff)
# Now retry
retry
end
end | [
"def",
"with_retries",
"(",
"*",
"rescued",
",",
"&",
"block",
")",
"options",
"=",
"rescued",
".",
"last",
".",
"is_a?",
"(",
"Hash",
")",
"?",
"rescued",
".",
"pop",
":",
"{",
"}",
"exception",
"=",
"nil",
"retries",
"=",
"0",
"rescued",
"=",
"De... | Execute the given block with retries and exponential backoff.
@param [Array<Exception>] rescued
the list of exceptions to rescue | [
"Execute",
"the",
"given",
"block",
"with",
"retries",
"and",
"exponential",
"backoff",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/client.rb#L412-L445 | train | Returns a new instance of the Retryer with retries. | [
30522,
13366,
2007,
1035,
2128,
21011,
1006,
1008,
10148,
1010,
1004,
3796,
1007,
7047,
1027,
10148,
1012,
2197,
1012,
2003,
1035,
1037,
1029,
1006,
23325,
1007,
1029,
10148,
1012,
3769,
1024,
1063,
1065,
6453,
1027,
9152,
2140,
2128,
21011... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.elements | def elements(name, tag=:element, identifier={:index => 0}, &block)
#
# sets tag as element if not defined
#
if tag.is_a?(Hash)
identifier = tag
tag = :element
end
define_method("#{name}_elements") do
return call_block(&block) if block_given?
platform.elements_for(tag, identifier.clone)
end
end | ruby | def elements(name, tag=:element, identifier={:index => 0}, &block)
#
# sets tag as element if not defined
#
if tag.is_a?(Hash)
identifier = tag
tag = :element
end
define_method("#{name}_elements") do
return call_block(&block) if block_given?
platform.elements_for(tag, identifier.clone)
end
end | [
"def",
"elements",
"(",
"name",
",",
"tag",
"=",
":element",
",",
"identifier",
"=",
"{",
":index",
"=>",
"0",
"}",
",",
"&",
"block",
")",
"#",
"# sets tag as element if not defined",
"#",
"if",
"tag",
".",
"is_a?",
"(",
"Hash",
")",
"identifier",
"=",
... | adds a method to return a collection of generic Element objects
for a specific tag.
@example
elements(:title, :header, :id => 'title')
# will generate ''title_elements'
@param [Symbol] the name used for the generated methods
@param [Symbol] the name of the tag for the element
@param [Hash] identifier how we find an element.
@param optional block to be invoked when element method is called | [
"adds",
"a",
"method",
"to",
"return",
"a",
"collection",
"of",
"generic",
"Element",
"objects",
"for",
"a",
"specific",
"tag",
"."
] | 850d775bf63768fbb1551a34480195785fe8e193 | https://github.com/cheezy/page-object/blob/850d775bf63768fbb1551a34480195785fe8e193/lib/page-object/accessors.rb#L1031-L1044 | train | Returns an array of elements for the given tag. | [
30522,
13366,
3787,
1006,
2171,
1010,
6415,
1027,
1024,
5783,
1010,
8909,
4765,
18095,
1027,
1063,
1024,
5950,
1027,
1028,
1014,
1065,
1010,
1004,
3796,
1007,
1001,
1001,
4520,
6415,
2004,
5783,
2065,
2025,
4225,
1001,
2065,
6415,
1012,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_datalake_analytics/lib/2015-10-01-preview/generated/azure_mgmt_datalake_analytics/account.rb | Azure::DataLakeAnalytics::Mgmt::V2015_10_01_preview.Account.list_sas_tokens | def list_sas_tokens(resource_group_name, account_name, storage_account_name, container_name, custom_headers:nil)
first_page = list_sas_tokens_as_lazy(resource_group_name, account_name, storage_account_name, container_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_sas_tokens(resource_group_name, account_name, storage_account_name, container_name, custom_headers:nil)
first_page = list_sas_tokens_as_lazy(resource_group_name, account_name, storage_account_name, container_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_sas_tokens",
"(",
"resource_group_name",
",",
"account_name",
",",
"storage_account_name",
",",
"container_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_sas_tokens_as_lazy",
"(",
"resource_group_name",
",",
"account_name",
",",
"st... | Gets the SAS token associated with the specified Data Lake Analytics and
Azure Storage account and container combination.
@param resource_group_name [String] The name of the Azure resource group that
contains the Data Lake Analytics account.
@param account_name [String] The name of the Data Lake Analytics account from
which an Azure Storage account's SAS token is being requested.
@param storage_account_name [String] The name of the Azure storage account
for which the SAS token is being requested.
@param container_name [String] The name of the Azure storage container for
which the SAS token is being requested.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<SasTokenInfo>] operation results. | [
"Gets",
"the",
"SAS",
"token",
"associated",
"with",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"and",
"Azure",
"Storage",
"account",
"and",
"container",
"combination",
"."
] | 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#L691-L694 | train | Gets the SAS tokens for the specified container. | [
30522,
13366,
2862,
1035,
21871,
1035,
19204,
2015,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
4070,
1035,
2171,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
11661,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
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_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb | Azure::StorSimple8000Series::Mgmt::V2017_06_01.DeviceSettings.get_alert_settings_with_http_info | def get_alert_settings_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
get_alert_settings_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | ruby | def get_alert_settings_with_http_info(device_name, resource_group_name, manager_name, custom_headers:nil)
get_alert_settings_async(device_name, resource_group_name, manager_name, custom_headers:custom_headers).value!
end | [
"def",
"get_alert_settings_with_http_info",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
":",
"nil",
")",
"get_alert_settings_async",
"(",
"device_name",
",",
"resource_group_name",
",",
"manager_name",
",",
"custom_headers",
... | Gets the alert settings of the specified device.
@param device_name [String] The device name
@param resource_group_name [String] The resource group name
@param manager_name [String] The manager name
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Gets",
"the",
"alert",
"settings",
"of",
"the",
"specified",
"device",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_stor_simple8000_series/lib/2017-06-01/generated/azure_mgmt_stor_simple8000_series/device_settings.rb#L51-L53 | train | Gets alert settings for the specified device. | [
30522,
13366,
2131,
1035,
9499,
1035,
10906,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
5080,
1035,
2171,
1010,
7692,
1035,
2177,
1035,
2171,
1010,
3208,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
9499,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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.list_available_sizes | def list_available_sizes(resource_group_name, vm_name, custom_headers:nil)
response = list_available_sizes_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def list_available_sizes(resource_group_name, vm_name, custom_headers:nil)
response = list_available_sizes_async(resource_group_name, vm_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"list_available_sizes",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"list_available_sizes_async",
"(",
"resource_group_name",
",",
"vm_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Lists all available virtual machine sizes to which the specified virtual
machine can be resized.
@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 [VirtualMachineSizeListResult] operation results. | [
"Lists",
"all",
"available",
"virtual",
"machine",
"sizes",
"to",
"which",
"the",
"specified",
"virtual",
"machine",
"can",
"be",
"resized",
"."
] | 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#L725-L728 | train | Gets the number of available virtual machine sizes. | [
30522,
13366,
2862,
1035,
2800,
1035,
10826,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
1058,
2213,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2862,
1035,
2800,
1035,
10826,
1035,
2004,
6038,
2278,
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... |
mongodb/mongo-ruby-driver | lib/mongo/dbref.rb | Mongo.DBRef.as_json | def as_json(*args)
document = { COLLECTION => collection, ID => id }
document.merge!(DATABASE => database) if database
document
end | ruby | def as_json(*args)
document = { COLLECTION => collection, ID => id }
document.merge!(DATABASE => database) if database
document
end | [
"def",
"as_json",
"(",
"*",
"args",
")",
"document",
"=",
"{",
"COLLECTION",
"=>",
"collection",
",",
"ID",
"=>",
"id",
"}",
"document",
".",
"merge!",
"(",
"DATABASE",
"=>",
"database",
")",
"if",
"database",
"document",
"end"
] | Get the DBRef as a JSON document
@example Get the DBRef as a JSON hash.
dbref.as_json
@return [ Hash ] The max key as a JSON hash.
@since 2.1.0 | [
"Get",
"the",
"DBRef",
"as",
"a",
"JSON",
"document"
] | dca26d0870cb3386fad9ccc1d17228097c1fe1c8 | https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/lib/mongo/dbref.rb#L55-L59 | train | Returns the document as JSON | [
30522,
13366,
2004,
1035,
1046,
3385,
1006,
1008,
12098,
5620,
1007,
6254,
1027,
1063,
3074,
1027,
1028,
3074,
1010,
8909,
1027,
1028,
8909,
1065,
6254,
1012,
13590,
999,
1006,
7809,
1027,
1028,
7809,
1007,
2065,
7809,
6254,
2203,
102,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_network_gateways.rb | Azure::Network::Mgmt::V2018_07_01.VirtualNetworkGateways.begin_get_vpn_profile_package_url | def begin_get_vpn_profile_package_url(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
response = begin_get_vpn_profile_package_url_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def begin_get_vpn_profile_package_url(resource_group_name, virtual_network_gateway_name, custom_headers:nil)
response = begin_get_vpn_profile_package_url_async(resource_group_name, virtual_network_gateway_name, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"begin_get_vpn_profile_package_url",
"(",
"resource_group_name",
",",
"virtual_network_gateway_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_get_vpn_profile_package_url_async",
"(",
"resource_group_name",
",",
"virtual_network_gateway_name",
",",
... | Gets pre-generated VPN profile for P2S client of the virtual network gateway
in the specified resource group. The profile needs to be generated first
using generateVpnProfile.
@param resource_group_name [String] The name of the resource group.
@param virtual_network_gateway_name [String] The name of the virtual network
gateway.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [String] operation results. | [
"Gets",
"pre",
"-",
"generated",
"VPN",
"profile",
"for",
"P2S",
"client",
"of",
"the",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
".",
"The",
"profile",
"needs",
"to",
"be",
"generated",
"first",
"using",
"generateVpnProfi... | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/virtual_network_gateways.rb#L1720-L1723 | train | Gets the VPN profile package URL for P2S client. | [
30522,
13366,
4088,
1035,
2131,
1035,
21210,
2078,
1035,
6337,
1035,
7427,
1035,
24471,
2140,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
7484,
1035,
2897,
1035,
11909,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
boazsegev/combine_pdf | lib/combine_pdf/page_methods.rb | CombinePDF.Page_Methods.fix_rotation | def fix_rotation
return self if self[:Rotate].to_f == 0.0 || mediabox.nil?
# calculate the rotation
r = (360.0 - self[:Rotate].to_f) * Math::PI / 180
s = Math.sin(r).round 6
c = Math.cos(r).round 6
ctm = [c, s, -s, c]
# calculate the translation (move the origin of x,y to the new origin).
x = mediabox[2] - mediabox[0]
y = mediabox[3] - mediabox[1]
ctm.push(((x * c).abs - x * c + (y * s).abs + y * s) / 2, ((x * s).abs - x * s + (y * c).abs - y * c) / 2)
# insert the rotation stream into the current content stream
insert_content "q\n#{ctm.join ' '} cm\n", 0
# close the rotation stream
insert_content CONTENT_CONTAINER_END
# reset the mediabox and cropbox values - THIS IS ONLY FOR ORIENTATION CHANGE...
if (self[:Rotate].to_f / 90).to_i.odd?
self[:MediaBox] = self[:MediaBox].values_at(1, 0, 3, 2)
self[:CropBox] = self[:CropBox].values_at(1, 0, 3, 2) if self[:CropBox]
end
# reset the Rotate property
delete :Rotate
# disconnect the content stream, so that future inserts aren't rotated
@contents = false # init_contents
# always return self, for chaining.
self
end | ruby | def fix_rotation
return self if self[:Rotate].to_f == 0.0 || mediabox.nil?
# calculate the rotation
r = (360.0 - self[:Rotate].to_f) * Math::PI / 180
s = Math.sin(r).round 6
c = Math.cos(r).round 6
ctm = [c, s, -s, c]
# calculate the translation (move the origin of x,y to the new origin).
x = mediabox[2] - mediabox[0]
y = mediabox[3] - mediabox[1]
ctm.push(((x * c).abs - x * c + (y * s).abs + y * s) / 2, ((x * s).abs - x * s + (y * c).abs - y * c) / 2)
# insert the rotation stream into the current content stream
insert_content "q\n#{ctm.join ' '} cm\n", 0
# close the rotation stream
insert_content CONTENT_CONTAINER_END
# reset the mediabox and cropbox values - THIS IS ONLY FOR ORIENTATION CHANGE...
if (self[:Rotate].to_f / 90).to_i.odd?
self[:MediaBox] = self[:MediaBox].values_at(1, 0, 3, 2)
self[:CropBox] = self[:CropBox].values_at(1, 0, 3, 2) if self[:CropBox]
end
# reset the Rotate property
delete :Rotate
# disconnect the content stream, so that future inserts aren't rotated
@contents = false # init_contents
# always return self, for chaining.
self
end | [
"def",
"fix_rotation",
"return",
"self",
"if",
"self",
"[",
":Rotate",
"]",
".",
"to_f",
"==",
"0.0",
"||",
"mediabox",
".",
"nil?",
"# calculate the rotation",
"r",
"=",
"(",
"360.0",
"-",
"self",
"[",
":Rotate",
"]",
".",
"to_f",
")",
"*",
"Math",
":... | This method moves the Page[:Rotate] property into the page's data stream, so that
"what you see is what you get".
After using thie method, {#orientation} should return the absolute orientation rather than only the data's orientation (unless `:Rotate` is changed).
This is usful in cases where there might be less control over the source PDF files,
and the user assums that the PDF page's data is the same as the PDF's pages
on screen display (Rotate rotates a page but leaves the data in the original orientation).
The method returns the page object, thus allowing method chaining (i.e. `page[:Rotate] = 90; page.textbox('hello!').fix_rotation.textbox('hello!')`) | [
"This",
"method",
"moves",
"the",
"Page",
"[",
":",
"Rotate",
"]",
"property",
"into",
"the",
"page",
"s",
"data",
"stream",
"so",
"that",
"what",
"you",
"see",
"is",
"what",
"you",
"get",
"."
] | 09054051019c069f551f3e60be789577c0f93900 | https://github.com/boazsegev/combine_pdf/blob/09054051019c069f551f3e60be789577c0f93900/lib/combine_pdf/page_methods.rb#L403-L431 | train | fix the rotation of the image | [
30522,
13366,
8081,
1035,
9963,
2709,
2969,
2065,
2969,
1031,
1024,
24357,
1033,
1012,
2000,
1035,
1042,
1027,
1027,
1014,
1012,
1014,
1064,
1064,
2865,
8758,
1012,
9152,
2140,
1029,
1001,
18422,
1996,
9963,
1054,
1027,
1006,
9475,
1012,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
commander-rb/commander | lib/commander/runner.rb | Commander.Runner.require_program | def require_program(*keys)
keys.each do |key|
fail CommandError, "program #{key} required" if program(key).nil? || program(key).empty?
end
end | ruby | def require_program(*keys)
keys.each do |key|
fail CommandError, "program #{key} required" if program(key).nil? || program(key).empty?
end
end | [
"def",
"require_program",
"(",
"*",
"keys",
")",
"keys",
".",
"each",
"do",
"|",
"key",
"|",
"fail",
"CommandError",
",",
"\"program #{key} required\"",
"if",
"program",
"(",
"key",
")",
".",
"nil?",
"||",
"program",
"(",
"key",
")",
".",
"empty?",
"end"... | Raises a CommandError when the program any of the _keys_ are not present, or empty. | [
"Raises",
"a",
"CommandError",
"when",
"the",
"program",
"any",
"of",
"the",
"_keys_",
"are",
"not",
"present",
"or",
"empty",
"."
] | 332047c14948225462fe60042eed23adfb996d68 | https://github.com/commander-rb/commander/blob/332047c14948225462fe60042eed23adfb996d68/lib/commander/runner.rb#L407-L411 | train | Require the program | [
30522,
13366,
5478,
1035,
2565,
1006,
1008,
6309,
1007,
6309,
1012,
2169,
2079,
1064,
3145,
1064,
8246,
3474,
29165,
1010,
1000,
2565,
1001,
1063,
3145,
1065,
3223,
1000,
2065,
2565,
1006,
3145,
1007,
1012,
9152,
2140,
1029,
1064,
1064,
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... |
zendesk/ruby-kafka | lib/kafka/consumer.rb | Kafka.Consumer.paused? | def paused?(topic, partition)
pause = pause_for(topic, partition)
pause.paused? && !pause.expired?
end | ruby | def paused?(topic, partition)
pause = pause_for(topic, partition)
pause.paused? && !pause.expired?
end | [
"def",
"paused?",
"(",
"topic",
",",
"partition",
")",
"pause",
"=",
"pause_for",
"(",
"topic",
",",
"partition",
")",
"pause",
".",
"paused?",
"&&",
"!",
"pause",
".",
"expired?",
"end"
] | Whether the topic partition is currently paused.
@see #pause
@param topic [String]
@param partition [Integer]
@return [Boolean] true if the partition is paused, false otherwise. | [
"Whether",
"the",
"topic",
"partition",
"is",
"currently",
"paused",
"."
] | 2a73471b6a607a52dc85c79301ba522acb4566b5 | https://github.com/zendesk/ruby-kafka/blob/2a73471b6a607a52dc85c79301ba522acb4566b5/lib/kafka/consumer.rb#L172-L175 | train | Returns whether a topic is paused or not | [
30522,
13366,
5864,
1029,
1006,
8476,
1010,
13571,
1007,
8724,
1027,
8724,
1035,
2005,
1006,
8476,
1010,
13571,
1007,
8724,
1012,
5864,
1029,
1004,
1004,
999,
8724,
1012,
13735,
1029,
2203,
102,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sinatra/sinatra | lib/sinatra/base.rb | Sinatra.Helpers.attachment | def attachment(filename = nil, disposition = :attachment)
response['Content-Disposition'] = disposition.to_s.dup
if filename
params = '; filename="%s"' % File.basename(filename)
response['Content-Disposition'] << params
ext = File.extname(filename)
content_type(ext) unless response['Content-Type'] or ext.empty?
end
end | ruby | def attachment(filename = nil, disposition = :attachment)
response['Content-Disposition'] = disposition.to_s.dup
if filename
params = '; filename="%s"' % File.basename(filename)
response['Content-Disposition'] << params
ext = File.extname(filename)
content_type(ext) unless response['Content-Type'] or ext.empty?
end
end | [
"def",
"attachment",
"(",
"filename",
"=",
"nil",
",",
"disposition",
"=",
":attachment",
")",
"response",
"[",
"'Content-Disposition'",
"]",
"=",
"disposition",
".",
"to_s",
".",
"dup",
"if",
"filename",
"params",
"=",
"'; filename=\"%s\"'",
"%",
"File",
".",... | Set the Content-Disposition to "attachment" with the specified filename,
instructing the user agents to prompt to save. | [
"Set",
"the",
"Content",
"-",
"Disposition",
"to",
"attachment",
"with",
"the",
"specified",
"filename",
"instructing",
"the",
"user",
"agents",
"to",
"prompt",
"to",
"save",
"."
] | 1aa64f9858edc3f93cc8d46e26f724c1ae103b1c | https://github.com/sinatra/sinatra/blob/1aa64f9858edc3f93cc8d46e26f724c1ae103b1c/lib/sinatra/base.rb#L362-L370 | train | Attaches an attachment to the response. | [
30522,
13366,
14449,
1006,
5371,
18442,
1027,
9152,
2140,
1010,
22137,
1027,
1024,
14449,
1007,
3433,
1031,
1005,
4180,
1011,
22137,
1005,
1033,
1027,
22137,
1012,
2000,
1035,
1055,
1012,
4241,
2361,
2065,
5371,
18442,
11498,
5244,
1027,
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... |
tongueroo/ufo | lib/ufo/info.rb | Ufo.Info.load_balancer | def load_balancer(service)
load_balancer = service.load_balancers.first
return unless load_balancer
resp = elb.describe_target_groups(
target_group_arns: [load_balancer.target_group_arn]
)
target_group = resp.target_groups.first
load_balancer_arn = target_group.load_balancer_arns.first # assume first only
resp = elb.describe_load_balancers(load_balancer_arns: [load_balancer_arn])
resp.load_balancers.first
end | ruby | def load_balancer(service)
load_balancer = service.load_balancers.first
return unless load_balancer
resp = elb.describe_target_groups(
target_group_arns: [load_balancer.target_group_arn]
)
target_group = resp.target_groups.first
load_balancer_arn = target_group.load_balancer_arns.first # assume first only
resp = elb.describe_load_balancers(load_balancer_arns: [load_balancer_arn])
resp.load_balancers.first
end | [
"def",
"load_balancer",
"(",
"service",
")",
"load_balancer",
"=",
"service",
".",
"load_balancers",
".",
"first",
"return",
"unless",
"load_balancer",
"resp",
"=",
"elb",
".",
"describe_target_groups",
"(",
"target_group_arns",
":",
"[",
"load_balancer",
".",
"ta... | Passing in service so method can be used else where. | [
"Passing",
"in",
"service",
"so",
"method",
"can",
"be",
"used",
"else",
"where",
"."
] | 16ac3dad28edcab2693c0e7d89a1971aca65b8f9 | https://github.com/tongueroo/ufo/blob/16ac3dad28edcab2693c0e7d89a1971aca65b8f9/lib/ufo/info.rb#L17-L29 | train | Returns the load balancer that is associated with the service | [
30522,
13366,
7170,
1035,
5703,
2099,
1006,
2326,
1007,
7170,
1035,
5703,
2099,
1027,
2326,
1012,
7170,
1035,
5703,
2869,
1012,
2034,
2709,
4983,
7170,
1035,
5703,
2099,
24501,
2361,
1027,
3449,
2497,
1012,
6235,
1035,
4539,
1035,
2967,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.get_certificate_versions_next | def get_certificate_versions_next(next_page_link, custom_headers:nil)
response = get_certificate_versions_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def get_certificate_versions_next(next_page_link, custom_headers:nil)
response = get_certificate_versions_next_async(next_page_link, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"get_certificate_versions_next",
"(",
"next_page_link",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"get_certificate_versions_next_async",
"(",
"next_page_link",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
"response",
".",
"body",
"... | List the versions of a certificate.
The GetCertificateVersions operation returns the versions of a certificate in
the specified key vault. This operation requires the certificates/list
permission.
@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 [CertificateListResult] operation results. | [
"List",
"the",
"versions",
"of",
"a",
"certificate",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L9074-L9077 | train | Gets the certificate versions of the specified CDN service certificate. | [
30522,
13366,
2131,
1035,
8196,
1035,
4617,
1035,
2279,
1006,
2279,
1035,
3931,
1035,
4957,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2131,
1035,
8196,
1035,
4617,
1035,
2279,
1035,
2004,
6038,
2278,
1006,
2279,
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_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb | Azure::SQL::Mgmt::V2014_04_01.Databases.export | def export(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
response = export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def export(resource_group_name, server_name, database_name, parameters, custom_headers:nil)
response = export_async(resource_group_name, server_name, database_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"export",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"export_async",
"(",
"resource_group_name",
",",
"server_name",
",",
"database_name",
",",
"parameters"... | Exports a database to a bacpac.
@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 to be exported.
@param parameters [ExportRequest] The required parameters for exporting a
database.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [ImportExportResponse] operation results. | [
"Exports",
"a",
"database",
"to",
"a",
"bacpac",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sql/lib/2014-04-01/generated/azure_mgmt_sql/databases.rb#L1082-L1085 | train | Export a database to a HDInsight database. | [
30522,
13366,
9167,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
8241,
1035,
2171,
1010,
7809,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
9167,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb | Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.suspend_partition_backup | def suspend_partition_backup(partition_id, timeout:60, custom_headers:nil)
response = suspend_partition_backup_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
nil
end | ruby | def suspend_partition_backup(partition_id, timeout:60, custom_headers:nil)
response = suspend_partition_backup_async(partition_id, timeout:timeout, custom_headers:custom_headers).value!
nil
end | [
"def",
"suspend_partition_backup",
"(",
"partition_id",
",",
"timeout",
":",
"60",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"suspend_partition_backup_async",
"(",
"partition_id",
",",
"timeout",
":",
"timeout",
",",
"custom_headers",
":custom_headers",... | Suspends periodic backup for the specified partition.
The partition which is configured to take periodic backups, is suspended for
taking further backups till it is resumed again.
@param partition_id The identity of the partition.
@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. | [
"Suspends",
"periodic",
"backup",
"for",
"the",
"specified",
"partition",
"."
] | 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#L25218-L25221 | train | Suspend backup of the specified partition. | [
30522,
13366,
28324,
1035,
13571,
1035,
10200,
1006,
13571,
1035,
8909,
1010,
2051,
5833,
1024,
3438,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
28324,
1035,
13571,
1035,
10200,
1035,
2004,
6038,
2278,
1006,
13571,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb | Azure::KeyVault::V2016_10_01.KeyVaultClient.regenerate_storage_account_key_with_http_info | def regenerate_storage_account_key_with_http_info(vault_base_url, storage_account_name, key_name, custom_headers:nil)
regenerate_storage_account_key_async(vault_base_url, storage_account_name, key_name, custom_headers:custom_headers).value!
end | ruby | def regenerate_storage_account_key_with_http_info(vault_base_url, storage_account_name, key_name, custom_headers:nil)
regenerate_storage_account_key_async(vault_base_url, storage_account_name, key_name, custom_headers:custom_headers).value!
end | [
"def",
"regenerate_storage_account_key_with_http_info",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"key_name",
",",
"custom_headers",
":",
"nil",
")",
"regenerate_storage_account_key_async",
"(",
"vault_base_url",
",",
"storage_account_name",
",",
"key_name",
",... | Regenerates the specified key value for the given storage account. This
operation requires the storage/regeneratekey permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param storage_account_name [String] The name of the storage account.
@param key_name [String] The storage account key 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. | [
"Regenerates",
"the",
"specified",
"key",
"value",
"for",
"the",
"given",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"regeneratekey",
"permission",
"."
] | 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#L7576-L7578 | train | Regenerate the specified storage account key. | [
30522,
13366,
19723,
24454,
3686,
1035,
5527,
1035,
4070,
1035,
3145,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
5527,
1035,
4070,
1035,
2171,
1010,
3145,
1035,
2171,
1010,
7661,
1035,
20346,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sqlvirtualmachine/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machines.rb | Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview.SqlVirtualMachines.begin_delete | def begin_delete(resource_group_name, sql_virtual_machine_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, sql_virtual_machine_name, custom_headers:custom_headers).value!
nil
end | ruby | def begin_delete(resource_group_name, sql_virtual_machine_name, custom_headers:nil)
response = begin_delete_async(resource_group_name, sql_virtual_machine_name, custom_headers:custom_headers).value!
nil
end | [
"def",
"begin_delete",
"(",
"resource_group_name",
",",
"sql_virtual_machine_name",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"begin_delete_async",
"(",
"resource_group_name",
",",
"sql_virtual_machine_name",
",",
"custom_headers",
":custom_headers",
")",
"... | Deletes a SQL virtual machine.
@param resource_group_name [String] Name of the resource group that contains
the resource. You can obtain this value from the Azure Resource Manager API
or the portal.
@param sql_virtual_machine_name [String] Name of the SQL virtual machine.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request. | [
"Deletes",
"a",
"SQL",
"virtual",
"machine",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sqlvirtualmachine/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/sql_virtual_machines.rb#L575-L578 | train | Deletes a SQL virtual machine. | [
30522,
13366,
4088,
1035,
3972,
12870,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
29296,
1035,
7484,
1035,
3698,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
4088,
1035,
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... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/document_helpers/doc_utilities.rb | HQMF2.DocumentUtilities.handle_variable | def handle_variable(data_criteria, collapsed_source_data_criteria)
if data_criteria.is_derived_specific_occurrence_variable
data_criteria.handle_derived_specific_occurrence_variable
extract_source_data_criteria(data_criteria)
return
end
tmp_id = data_criteria.id
grouper_data_criteria = data_criteria.extract_variable_grouper
return unless grouper_data_criteria
@data_criteria_references[data_criteria.id] = data_criteria
@data_criteria_references[grouper_data_criteria.id] = grouper_data_criteria
# create a source data criteria for the grouping data critera we just created
sdc = SourceDataCriteriaHelper.strip_non_sc_elements(grouper_data_criteria)
@source_data_criteria << sdc
# check if the original source has been collapsed when generating the SDC list (we need to reference the collapsed version in the sdc list)
if collapsed_source_data_criteria[tmp_id]
data_criteria.instance_variable_set(:@source_data_criteria, collapsed_source_data_criteria[tmp_id])
else
# check if we need to add _source suffix (most source data criteria are segmented with '_source' suffixes)
data_criteria_sdc = find(@source_data_criteria, :id, "#{tmp_id}_source")
if data_criteria_sdc
data_criteria.instance_variable_set(:@source_data_criteria, data_criteria_sdc.id)
data_criteria_sdc.instance_variable_set(:@variable, false)
# if it's not a derived data criteria then we may need to strip off temporal references, fields, etc as a new source data criteria
elsif !['derived', 'satisfies_any', 'satisfies_all'].include?(data_criteria.definition)
extract_source_data_criteria(data_criteria)
end
end
@data_criteria << grouper_data_criteria
end | ruby | def handle_variable(data_criteria, collapsed_source_data_criteria)
if data_criteria.is_derived_specific_occurrence_variable
data_criteria.handle_derived_specific_occurrence_variable
extract_source_data_criteria(data_criteria)
return
end
tmp_id = data_criteria.id
grouper_data_criteria = data_criteria.extract_variable_grouper
return unless grouper_data_criteria
@data_criteria_references[data_criteria.id] = data_criteria
@data_criteria_references[grouper_data_criteria.id] = grouper_data_criteria
# create a source data criteria for the grouping data critera we just created
sdc = SourceDataCriteriaHelper.strip_non_sc_elements(grouper_data_criteria)
@source_data_criteria << sdc
# check if the original source has been collapsed when generating the SDC list (we need to reference the collapsed version in the sdc list)
if collapsed_source_data_criteria[tmp_id]
data_criteria.instance_variable_set(:@source_data_criteria, collapsed_source_data_criteria[tmp_id])
else
# check if we need to add _source suffix (most source data criteria are segmented with '_source' suffixes)
data_criteria_sdc = find(@source_data_criteria, :id, "#{tmp_id}_source")
if data_criteria_sdc
data_criteria.instance_variable_set(:@source_data_criteria, data_criteria_sdc.id)
data_criteria_sdc.instance_variable_set(:@variable, false)
# if it's not a derived data criteria then we may need to strip off temporal references, fields, etc as a new source data criteria
elsif !['derived', 'satisfies_any', 'satisfies_all'].include?(data_criteria.definition)
extract_source_data_criteria(data_criteria)
end
end
@data_criteria << grouper_data_criteria
end | [
"def",
"handle_variable",
"(",
"data_criteria",
",",
"collapsed_source_data_criteria",
")",
"if",
"data_criteria",
".",
"is_derived_specific_occurrence_variable",
"data_criteria",
".",
"handle_derived_specific_occurrence_variable",
"extract_source_data_criteria",
"(",
"data_criteria"... | Create grouper data criteria for encapsulating variable data criteria
and update document data criteria list and references map | [
"Create",
"grouper",
"data",
"criteria",
"for",
"encapsulating",
"variable",
"data",
"criteria",
"and",
"update",
"document",
"data",
"criteria",
"list",
"and",
"references",
"map"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/document_helpers/doc_utilities.rb#L6-L41 | train | handle the variable | [
30522,
13366,
5047,
1035,
8023,
1006,
2951,
1035,
9181,
1010,
7798,
1035,
3120,
1035,
2951,
1035,
9181,
1007,
2065,
2951,
1035,
9181,
1012,
2003,
1035,
5173,
1035,
3563,
1035,
14404,
1035,
8023,
2951,
1035,
9181,
1012,
5047,
1035,
5173,
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... |
meew0/discordrb | lib/discordrb/permissions.rb | Discordrb.PermissionCalculator.defined_permission? | def defined_permission?(action, channel = nil)
# Get the permission the user's roles have
role_permission = defined_role_permission?(action, channel)
# Once we have checked the role permission, we have to check the channel overrides for the
# specific user
user_specific_override = permission_overwrite(action, channel, id) # Use the ID reader as members have no ID instance variable
# Merge the two permissions - if an override is defined, it has to be allow, otherwise we only care about the role
return role_permission unless user_specific_override
user_specific_override == :allow
end | ruby | def defined_permission?(action, channel = nil)
# Get the permission the user's roles have
role_permission = defined_role_permission?(action, channel)
# Once we have checked the role permission, we have to check the channel overrides for the
# specific user
user_specific_override = permission_overwrite(action, channel, id) # Use the ID reader as members have no ID instance variable
# Merge the two permissions - if an override is defined, it has to be allow, otherwise we only care about the role
return role_permission unless user_specific_override
user_specific_override == :allow
end | [
"def",
"defined_permission?",
"(",
"action",
",",
"channel",
"=",
"nil",
")",
"# Get the permission the user's roles have",
"role_permission",
"=",
"defined_role_permission?",
"(",
"action",
",",
"channel",
")",
"# Once we have checked the role permission, we have to check the ch... | Checks whether this user has a particular permission defined (i.e. not implicit, through for example
Manage Roles)
@param action [Symbol] The permission that should be checked. See also {Permissions::FLAGS} for a list.
@param channel [Channel, nil] If channel overrides should be checked too, this channel specifies where the overrides should be checked.
@example Check if a member has the Manage Channels permission defined in the server.
has_manage_channels = member.defined_permission?(:manage_channels)
@return [true, false] whether or not this user has the permission defined. | [
"Checks",
"whether",
"this",
"user",
"has",
"a",
"particular",
"permission",
"defined",
"(",
"i",
".",
"e",
".",
"not",
"implicit",
"through",
"for",
"example",
"Manage",
"Roles",
")"
] | 764298a1ff0be69a1853b510d736f21c2b91a2fe | https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/permissions.rb#L156-L168 | train | Check if the user has defined the permission | [
30522,
13366,
4225,
1035,
6656,
1029,
1006,
2895,
1010,
3149,
1027,
9152,
2140,
1007,
1001,
2131,
1996,
6656,
1996,
5310,
1005,
1055,
4395,
2031,
2535,
1035,
6656,
1027,
4225,
1035,
2535,
1035,
6656,
1029,
1006,
2895,
1010,
3149,
1007,
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... |
square/connect-ruby-sdk | lib/square_connect/models/catalog_item.rb | SquareConnect.CatalogItem.product_type= | def product_type=(product_type)
validator = EnumAttributeValidator.new('String', ["REGULAR", "GIFT_CARD", "APPOINTMENTS_SERVICE", "RETAIL_ITEM", "RESTAURANT_ITEM"])
unless validator.valid?(product_type)
fail ArgumentError, "invalid value for 'product_type', must be one of #{validator.allowable_values}."
end
@product_type = product_type
end | ruby | def product_type=(product_type)
validator = EnumAttributeValidator.new('String', ["REGULAR", "GIFT_CARD", "APPOINTMENTS_SERVICE", "RETAIL_ITEM", "RESTAURANT_ITEM"])
unless validator.valid?(product_type)
fail ArgumentError, "invalid value for 'product_type', must be one of #{validator.allowable_values}."
end
@product_type = product_type
end | [
"def",
"product_type",
"=",
"(",
"product_type",
")",
"validator",
"=",
"EnumAttributeValidator",
".",
"new",
"(",
"'String'",
",",
"[",
"\"REGULAR\"",
",",
"\"GIFT_CARD\"",
",",
"\"APPOINTMENTS_SERVICE\"",
",",
"\"RETAIL_ITEM\"",
",",
"\"RESTAURANT_ITEM\"",
"]",
")... | Custom attribute writer method checking allowed values (enum).
@param [Object] product_type Object to be assigned | [
"Custom",
"attribute",
"writer",
"method",
"checking",
"allowed",
"values",
"(",
"enum",
")",
"."
] | 798eb9ded716f23b9f1518386f1c311a34bca8bf | https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/catalog_item.rb#L208-L214 | train | Set the product type of the resource. | [
30522,
13366,
4031,
1035,
2828,
1027,
1006,
4031,
1035,
2828,
1007,
9398,
8844,
1027,
4372,
12248,
4779,
3089,
8569,
2618,
10175,
8524,
4263,
1012,
2047,
1006,
1005,
5164,
1005,
1010,
1031,
1000,
3180,
1000,
1010,
1000,
5592,
1035,
4003,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/has_actions.rb | Trello.HasActions.actions | def actions(options = {})
actions = Action.from_response client.get("#{request_prefix}/actions", { filter: :all }.merge(options))
MultiAssociation.new(self, actions).proxy
end | ruby | def actions(options = {})
actions = Action.from_response client.get("#{request_prefix}/actions", { filter: :all }.merge(options))
MultiAssociation.new(self, actions).proxy
end | [
"def",
"actions",
"(",
"options",
"=",
"{",
"}",
")",
"actions",
"=",
"Action",
".",
"from_response",
"client",
".",
"get",
"(",
"\"#{request_prefix}/actions\"",
",",
"{",
"filter",
":",
":all",
"}",
".",
"merge",
"(",
"options",
")",
")",
"MultiAssociatio... | Returns a list of the actions associated with this object. | [
"Returns",
"a",
"list",
"of",
"the",
"actions",
"associated",
"with",
"this",
"object",
"."
] | ad79c9d8152ad5395b3b61c43170908f1912bfb2 | https://github.com/jeremytregunna/ruby-trello/blob/ad79c9d8152ad5395b3b61c43170908f1912bfb2/lib/trello/has_actions.rb#L4-L7 | train | Get the actions for this object | [
30522,
13366,
4506,
1006,
7047,
1027,
1063,
1065,
1007,
4506,
1027,
2895,
1012,
2013,
1035,
3433,
7396,
1012,
2131,
1006,
1000,
1001,
1063,
5227,
1035,
17576,
1065,
1013,
4506,
1000,
1010,
1063,
11307,
1024,
1024,
2035,
1065,
1012,
13590,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/subnet.rb | Aws::EC2.Subnet.create_tags | def create_tags(options = {})
batch = []
options = Aws::Util.deep_merge(options, resources: [@id])
resp = @client.create_tags(options)
options[:tags].each do |t|
batch << Tag.new(
resource_id: @id,
key: t[:key],
value: t[:value],
client: @client
)
end
Tag::Collection.new([batch], size: batch.size)
end | ruby | def create_tags(options = {})
batch = []
options = Aws::Util.deep_merge(options, resources: [@id])
resp = @client.create_tags(options)
options[:tags].each do |t|
batch << Tag.new(
resource_id: @id,
key: t[:key],
value: t[:value],
client: @client
)
end
Tag::Collection.new([batch], size: batch.size)
end | [
"def",
"create_tags",
"(",
"options",
"=",
"{",
"}",
")",
"batch",
"=",
"[",
"]",
"options",
"=",
"Aws",
"::",
"Util",
".",
"deep_merge",
"(",
"options",
",",
"resources",
":",
"[",
"@id",
"]",
")",
"resp",
"=",
"@client",
".",
"create_tags",
"(",
... | @example Request syntax with placeholder values
tag = subnet.create_tags({
dry_run: false,
tags: [ # required
{
key: "String",
value: "String",
},
],
})
@param [Hash] options ({})
@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, Array<Types::Tag>] :tags
The tags. The `value` parameter is required, but if you don't want
the tag to have a value, specify the parameter with no value, and we
set the value to an empty string.
@return [Tag::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/subnet.rb#L763-L776 | train | Creates tags on the resource. | [
30522,
13366,
3443,
1035,
22073,
1006,
7047,
1027,
1063,
1065,
1007,
14108,
1027,
1031,
1033,
7047,
1027,
22091,
2015,
1024,
1024,
21183,
4014,
1012,
2784,
1035,
13590,
1006,
7047,
1010,
4219,
1024,
1031,
1030,
8909,
1033,
1007,
24501,
2361... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
sds/scss-lint | lib/scss_lint/linter/space_after_comma.rb | SCSSLint.Linter::SpaceAfterComma.check_definition | def check_definition(node, type)
# Use the default value's source range if one is defined, since that will
# be the item with the comma after it
args = node.args.map { |name, default_value| default_value || name }
args << node.splat if node.splat
check_commas_after_args(args, "#{type} parameters")
end | ruby | def check_definition(node, type)
# Use the default value's source range if one is defined, since that will
# be the item with the comma after it
args = node.args.map { |name, default_value| default_value || name }
args << node.splat if node.splat
check_commas_after_args(args, "#{type} parameters")
end | [
"def",
"check_definition",
"(",
"node",
",",
"type",
")",
"# Use the default value's source range if one is defined, since that will",
"# be the item with the comma after it",
"args",
"=",
"node",
".",
"args",
".",
"map",
"{",
"|",
"name",
",",
"default_value",
"|",
"defa... | Check parameters of a function/mixin definition | [
"Check",
"parameters",
"of",
"a",
"function",
"/",
"mixin",
"definition"
] | e99afe4ede041a431a06e585c12ce82f6ad50116 | https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/linter/space_after_comma.rb#L34-L41 | train | Check the definition of a node | [
30522,
13366,
4638,
1035,
6210,
1006,
13045,
1010,
2828,
1007,
1001,
2224,
1996,
12398,
3643,
1005,
1055,
3120,
2846,
2065,
2028,
2003,
4225,
1010,
2144,
2008,
2097,
1001,
2022,
1996,
8875,
2007,
1996,
4012,
2863,
2044,
2009,
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... |
ruby/rake | lib/rake/file_list.rb | Rake.FileList.gsub | def gsub(pat, rep)
inject(self.class.new) { |res, fn| res << fn.gsub(pat, rep) }
end | ruby | def gsub(pat, rep)
inject(self.class.new) { |res, fn| res << fn.gsub(pat, rep) }
end | [
"def",
"gsub",
"(",
"pat",
",",
"rep",
")",
"inject",
"(",
"self",
".",
"class",
".",
"new",
")",
"{",
"|",
"res",
",",
"fn",
"|",
"res",
"<<",
"fn",
".",
"gsub",
"(",
"pat",
",",
"rep",
")",
"}",
"end"
] | Return a new FileList with the results of running +gsub+ against each
element of the original list.
Example:
FileList['lib/test/file', 'x/y'].gsub(/\//, "\\")
=> ['lib\\test\\file', 'x\\y'] | [
"Return",
"a",
"new",
"FileList",
"with",
"the",
"results",
"of",
"running",
"+",
"gsub",
"+",
"against",
"each",
"element",
"of",
"the",
"original",
"list",
"."
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/file_list.rb#L253-L255 | train | Replace all occurrences of a pattern with a replacement. | [
30522,
13366,
28177,
12083,
1006,
6986,
1010,
16360,
1007,
1999,
20614,
1006,
2969,
1012,
2465,
1012,
2047,
1007,
1063,
1064,
24501,
1010,
1042,
2078,
1064,
24501,
1026,
1026,
1042,
2078,
1012,
28177,
12083,
1006,
6986,
1010,
16360,
1007,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
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.create_certificate | def create_certificate(vault_base_url, certificate_name, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
response = create_certificate_async(vault_base_url, certificate_name, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_certificate(vault_base_url, certificate_name, certificate_policy:nil, certificate_attributes:nil, tags:nil, custom_headers:nil)
response = create_certificate_async(vault_base_url, certificate_name, certificate_policy:certificate_policy, certificate_attributes:certificate_attributes, tags:tags, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_certificate",
"(",
"vault_base_url",
",",
"certificate_name",
",",
"certificate_policy",
":",
"nil",
",",
"certificate_attributes",
":",
"nil",
",",
"tags",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_certificate_async... | Creates a new certificate.
If this is the first version, the certificate resource is created. This
operation requires the certificates/create permission.
@param vault_base_url [String] The vault name, for example
https://myvault.vault.azure.net.
@param certificate_name [String] The name of the certificate.
@param certificate_policy [CertificatePolicy] The management policy for the
certificate.
@param certificate_attributes [CertificateAttributes] The attributes of the
certificate (optional).
@param tags [Hash{String => String}] Application specific metadata in the
form of key-value pairs.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [CertificateOperation] operation results. | [
"Creates",
"a",
"new",
"certificate",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_key_vault/lib/2016-10-01/generated/azure_key_vault/key_vault_client.rb#L5160-L5163 | train | Creates a new certificate in the specified vault. | [
30522,
13366,
3443,
1035,
8196,
1006,
11632,
1035,
2918,
1035,
24471,
2140,
1010,
8196,
1035,
2171,
1010,
8196,
1035,
3343,
1024,
9152,
2140,
1010,
8196,
1035,
12332,
1024,
9152,
2140,
1010,
22073,
1024,
9152,
2140,
1010,
7661,
1035,
20346,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb | Azure::Labservices::Mgmt::V2018_10_15.LabAccounts.list_by_subscription_with_http_info | def list_by_subscription_with_http_info(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
end | ruby | def list_by_subscription_with_http_info(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
end | [
"def",
"list_by_subscription_with_http_info",
"(",
"expand",
":",
"nil",
",",
"filter",
":",
"nil",
",",
"top",
":",
"nil",
",",
"orderby",
":",
"nil",
",",
"custom_headers",
":",
"nil",
")",
"list_by_subscription_async",
"(",
"expand",
":",
"expand",
",",
"... | List lab accounts in a subscription.
@param expand [String] Specify the $expand query. Example:
'properties($expand=sizeConfiguration)'
@param filter [String] The filter to apply to the operation.
@param top [Integer] The maximum number of resources to return from the
operation.
@param orderby [String] The ordering expression for the results, using OData
notation.
@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",
"lab",
"accounts",
"in",
"a",
"subscription",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_labservices/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb#L59-L61 | train | Gets a list of all the segmentation elements in a subscription. | [
30522,
13366,
2862,
1035,
2011,
1035,
15002,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
7818,
1024,
30524,
2140,
1010,
2344,
3762,
1024,
9152,
2140,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2862,
1035,
2011,
1035,
15002,
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-cloudwatch/lib/aws-sdk-cloudwatch/resource.rb | Aws::CloudWatch.Resource.alarms | def alarms(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_alarms(options)
resp.each_page do |page|
batch = []
page.data.metric_alarms.each do |m|
batch << Alarm.new(
name: m.alarm_name,
data: m,
client: @client
)
end
y.yield(batch)
end
end
Alarm::Collection.new(batches)
end | ruby | def alarms(options = {})
batches = Enumerator.new do |y|
resp = @client.describe_alarms(options)
resp.each_page do |page|
batch = []
page.data.metric_alarms.each do |m|
batch << Alarm.new(
name: m.alarm_name,
data: m,
client: @client
)
end
y.yield(batch)
end
end
Alarm::Collection.new(batches)
end | [
"def",
"alarms",
"(",
"options",
"=",
"{",
"}",
")",
"batches",
"=",
"Enumerator",
".",
"new",
"do",
"|",
"y",
"|",
"resp",
"=",
"@client",
".",
"describe_alarms",
"(",
"options",
")",
"resp",
".",
"each_page",
"do",
"|",
"page",
"|",
"batch",
"=",
... | @example Request syntax with placeholder values
alarms = cloud_watch.alarms({
alarm_names: ["AlarmName"],
alarm_name_prefix: "AlarmNamePrefix",
state_value: "OK", # accepts OK, ALARM, INSUFFICIENT_DATA
action_prefix: "ActionPrefix",
})
@param [Hash] options ({})
@option options [Array<String>] :alarm_names
The names of the alarms.
@option options [String] :alarm_name_prefix
The alarm name prefix. If this parameter is specified, you cannot
specify `AlarmNames`.
@option options [String] :state_value
The state value to be used in matching alarms.
@option options [String] :action_prefix
The action name prefix.
@return [Alarm::Collection] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-cloudwatch/lib/aws-sdk-cloudwatch/resource.rb#L52-L68 | train | Returns an array of Alarms | [
30522,
13366,
29034,
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,
29034,
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... |
randym/axlsx | lib/axlsx/stylesheet/styles.rb | Axlsx.Styles.to_xml_string | def to_xml_string(str = '')
str << ('<styleSheet xmlns="' << XML_NS << '">')
[:numFmts, :fonts, :fills, :borders, :cellStyleXfs, :cellXfs, :cellStyles, :dxfs, :tableStyles].each do |key|
self.instance_values[key.to_s].to_xml_string(str) unless self.instance_values[key.to_s].nil?
end
str << '</styleSheet>'
end | ruby | def to_xml_string(str = '')
str << ('<styleSheet xmlns="' << XML_NS << '">')
[:numFmts, :fonts, :fills, :borders, :cellStyleXfs, :cellXfs, :cellStyles, :dxfs, :tableStyles].each do |key|
self.instance_values[key.to_s].to_xml_string(str) unless self.instance_values[key.to_s].nil?
end
str << '</styleSheet>'
end | [
"def",
"to_xml_string",
"(",
"str",
"=",
"''",
")",
"str",
"<<",
"(",
"'<styleSheet xmlns=\"'",
"<<",
"XML_NS",
"<<",
"'\">'",
")",
"[",
":numFmts",
",",
":fonts",
",",
":fills",
",",
":borders",
",",
":cellStyleXfs",
",",
":cellXfs",
",",
":cellStyles",
"... | Serializes the object
@param [String] str
@return [String] | [
"Serializes",
"the",
"object"
] | c593a08b2a929dac7aa8dc418b55e26b4c49dc34 | https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/stylesheet/styles.rb#L364-L370 | train | Returns the XML string for this stylesheet. | [
30522,
13366,
2000,
1035,
20950,
1035,
5164,
1006,
2358,
2099,
1027,
1005,
1005,
1007,
2358,
2099,
1026,
1026,
1006,
30524,
2595,
10343,
1010,
1024,
3526,
2595,
10343,
1010,
1024,
4442,
27983,
2015,
1010,
1024,
1040,
2595,
10343,
1010,
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 | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.create_pattern_any_entity_model | def create_pattern_any_entity_model(app_id, version_id, extractor_create_object, custom_headers:nil)
response = create_pattern_any_entity_model_async(app_id, version_id, extractor_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_pattern_any_entity_model(app_id, version_id, extractor_create_object, custom_headers:nil)
response = create_pattern_any_entity_model_async(app_id, version_id, extractor_create_object, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_pattern_any_entity_model",
"(",
"app_id",
",",
"version_id",
",",
"extractor_create_object",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_pattern_any_entity_model_async",
"(",
"app_id",
",",
"version_id",
",",
"extractor_create_object",
... | Adds a pattern.any entity extractor to a version of the application.
@param app_id The application ID.
@param version_id [String] The version ID.
@param extractor_create_object [PatternAnyModelCreateObject] A model object
containing the name and explicit list for the new Pattern.Any entity
extractor.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Uuid] operation results. | [
"Adds",
"a",
"pattern",
".",
"any",
"entity",
"extractor",
"to",
"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#L6011-L6014 | train | Creates an entity model in a version of the application. | [
30522,
13366,
3443,
1035,
5418,
1035,
2151,
1035,
9178,
1035,
2944,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
14817,
2953,
1035,
3443,
1035,
4874,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
3443,
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/sprockets | lib/sprockets/path_utils.rb | Sprockets.PathUtils.stat_directory | def stat_directory(dir)
return to_enum(__method__, dir) unless block_given?
self.entries(dir).each do |entry|
path = File.join(dir, entry)
if stat = self.stat(path)
yield path, stat
end
end
nil
end | ruby | def stat_directory(dir)
return to_enum(__method__, dir) unless block_given?
self.entries(dir).each do |entry|
path = File.join(dir, entry)
if stat = self.stat(path)
yield path, stat
end
end
nil
end | [
"def",
"stat_directory",
"(",
"dir",
")",
"return",
"to_enum",
"(",
"__method__",
",",
"dir",
")",
"unless",
"block_given?",
"self",
".",
"entries",
"(",
"dir",
")",
".",
"each",
"do",
"|",
"entry",
"|",
"path",
"=",
"File",
".",
"join",
"(",
"dir",
... | Public: Stat all the files under a directory.
dir - A String directory
Returns an Enumerator of [path, stat]. | [
"Public",
":",
"Stat",
"all",
"the",
"files",
"under",
"a",
"directory",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/path_utils.rb#L286-L297 | train | Returns an enumerator of stat objects for the given directory. | [
30522,
13366,
28093,
1035,
14176,
1006,
16101,
1007,
2709,
2000,
1035,
4372,
2819,
1006,
1035,
1035,
4118,
1035,
1035,
1010,
16101,
1007,
4983,
3796,
1035,
2445,
1029,
2969,
1012,
10445,
1006,
16101,
1007,
1012,
2169,
2079,
1064,
4443,
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... |
plataformatec/simple_form | lib/simple_form/form_builder.rb | SimpleForm.FormBuilder.find_wrapper_mapping | def find_wrapper_mapping(input_type)
if options[:wrapper_mappings] && options[:wrapper_mappings][input_type]
options[:wrapper_mappings][input_type]
else
SimpleForm.wrapper_mappings && SimpleForm.wrapper_mappings[input_type]
end
end | ruby | def find_wrapper_mapping(input_type)
if options[:wrapper_mappings] && options[:wrapper_mappings][input_type]
options[:wrapper_mappings][input_type]
else
SimpleForm.wrapper_mappings && SimpleForm.wrapper_mappings[input_type]
end
end | [
"def",
"find_wrapper_mapping",
"(",
"input_type",
")",
"if",
"options",
"[",
":wrapper_mappings",
"]",
"&&",
"options",
"[",
":wrapper_mappings",
"]",
"[",
"input_type",
"]",
"options",
"[",
":wrapper_mappings",
"]",
"[",
"input_type",
"]",
"else",
"SimpleForm",
... | Attempts to find a wrapper mapping. It follows the following rules:
1) It tries to find a wrapper for the current form
2) If not, it tries to find a config | [
"Attempts",
"to",
"find",
"a",
"wrapper",
"mapping",
".",
"It",
"follows",
"the",
"following",
"rules",
":"
] | 4dd9261ebb392e46a9beeefe8d83081e7c6e56b5 | https://github.com/plataformatec/simple_form/blob/4dd9261ebb392e46a9beeefe8d83081e7c6e56b5/lib/simple_form/form_builder.rb#L618-L624 | train | Find the wrapper mapping for the given input type | [
30522,
13366,
2424,
1035,
10236,
4842,
1035,
12375,
1006,
7953,
1035,
2828,
1007,
2065,
7047,
1031,
1024,
10236,
4842,
1035,
12375,
2015,
1033,
1004,
1004,
7047,
1031,
1024,
10236,
4842,
1035,
12375,
2015,
1033,
1031,
7953,
1035,
2828,
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... |
ruby/rake | lib/rake/task_manager.rb | Rake.TaskManager.in_namespace | def in_namespace(name)
name ||= generate_name
@scope = Scope.new(name, @scope)
ns = NameSpace.new(self, @scope)
yield(ns)
ns
ensure
@scope = @scope.tail
end | ruby | def in_namespace(name)
name ||= generate_name
@scope = Scope.new(name, @scope)
ns = NameSpace.new(self, @scope)
yield(ns)
ns
ensure
@scope = @scope.tail
end | [
"def",
"in_namespace",
"(",
"name",
")",
"name",
"||=",
"generate_name",
"@scope",
"=",
"Scope",
".",
"new",
"(",
"name",
",",
"@scope",
")",
"ns",
"=",
"NameSpace",
".",
"new",
"(",
"self",
",",
"@scope",
")",
"yield",
"(",
"ns",
")",
"ns",
"ensure"... | Evaluate the block in a nested namespace named +name+. Create
an anonymous namespace if +name+ is nil. | [
"Evaluate",
"the",
"block",
"in",
"a",
"nested",
"namespace",
"named",
"+",
"name",
"+",
".",
"Create",
"an",
"anonymous",
"namespace",
"if",
"+",
"name",
"+",
"is",
"nil",
"."
] | 1c22b490ee6cb8bd614fa8d0d6145f671466206b | https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/task_manager.rb#L221-L229 | train | Generate a new namespace | [
30522,
13366,
1999,
1035,
3415,
15327,
1006,
2171,
1007,
2171,
1064,
1064,
1027,
9699,
1035,
2171,
1030,
9531,
1027,
9531,
1012,
2047,
1006,
2171,
1010,
1030,
30524,
9531,
1027,
1030,
9531,
1012,
5725,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
aws/aws-sdk-ruby | gems/aws-sdk-iam/lib/aws-sdk-iam/group.rb | Aws::IAM.Group.delete | def delete(options = {})
options = options.merge(group_name: @name)
resp = @client.delete_group(options)
resp.data
end | ruby | def delete(options = {})
options = options.merge(group_name: @name)
resp = @client.delete_group(options)
resp.data
end | [
"def",
"delete",
"(",
"options",
"=",
"{",
"}",
")",
"options",
"=",
"options",
".",
"merge",
"(",
"group_name",
":",
"@name",
")",
"resp",
"=",
"@client",
".",
"delete_group",
"(",
"options",
")",
"resp",
".",
"data",
"end"
] | @example Request syntax with placeholder values
group.delete()
@param [Hash] options ({})
@return [EmptyStructure] | [
"@example",
"Request",
"syntax",
"with",
"placeholder",
"values"
] | e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d | https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/group.rb#L345-L349 | train | Delete a group | [
30522,
13366,
3972,
12870,
1006,
7047,
1027,
1063,
1065,
1007,
7047,
1027,
7047,
1012,
13590,
1006,
2177,
1035,
2171,
1024,
1030,
2171,
1007,
24501,
2361,
1027,
1030,
7396,
1012,
3972,
12870,
1035,
2177,
1006,
7047,
1007,
24501,
2361,
1012,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_sqlvirtualmachine/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/availability_group_listeners.rb | Azure::Sqlvirtualmachine::Mgmt::V2017_03_01_preview.AvailabilityGroupListeners.list_by_group | def list_by_group(resource_group_name, sql_virtual_machine_group_name, custom_headers:nil)
first_page = list_by_group_as_lazy(resource_group_name, sql_virtual_machine_group_name, custom_headers:custom_headers)
first_page.get_all_items
end | ruby | def list_by_group(resource_group_name, sql_virtual_machine_group_name, custom_headers:nil)
first_page = list_by_group_as_lazy(resource_group_name, sql_virtual_machine_group_name, custom_headers:custom_headers)
first_page.get_all_items
end | [
"def",
"list_by_group",
"(",
"resource_group_name",
",",
"sql_virtual_machine_group_name",
",",
"custom_headers",
":",
"nil",
")",
"first_page",
"=",
"list_by_group_as_lazy",
"(",
"resource_group_name",
",",
"sql_virtual_machine_group_name",
",",
"custom_headers",
":custom_he... | Lists all availability group listeners in a SQL virtual machine group.
@param resource_group_name [String] Name of the resource group that contains
the resource. You can obtain this value from the Azure Resource Manager API
or the portal.
@param sql_virtual_machine_group_name [String] Name of the SQL virtual
machine group.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [Array<AvailabilityGroupListener>] operation results. | [
"Lists",
"all",
"availability",
"group",
"listeners",
"in",
"a",
"SQL",
"virtual",
"machine",
"group",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_sqlvirtualmachine/lib/2017-03-01-preview/generated/azure_mgmt_sqlvirtualmachine/availability_group_listeners.rb#L253-L256 | train | Gets all the SQL virtual machine groups in a SQL virtual machine group. | [
30522,
13366,
2862,
1035,
2011,
1035,
2177,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
29296,
1035,
7484,
1035,
3698,
1035,
2177,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2034,
1035,
3931,
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... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_event_hub/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb | Azure::EventHub::Mgmt::V2018_01_01_preview.Namespaces.create_or_update_virtual_network_rule | def create_or_update_virtual_network_rule(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:nil)
response = create_or_update_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def create_or_update_virtual_network_rule(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:nil)
response = create_or_update_virtual_network_rule_async(resource_group_name, namespace_name, virtual_network_rule_name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"create_or_update_virtual_network_rule",
"(",
"resource_group_name",
",",
"namespace_name",
",",
"virtual_network_rule_name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"create_or_update_virtual_network_rule_async",
"(",
"resource_group_n... | Creates or updates an VirtualNetworkRule for a Namespace.
@param resource_group_name [String] Name of the resource group within the
Azure subscription.
@param namespace_name [String] The Namespace name
@param virtual_network_rule_name [String] The Virtual Network Rule name.
@param parameters [VirtualNetworkRule] The Namespace VirtualNetworkRule.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [VirtualNetworkRule] operation results. | [
"Creates",
"or",
"updates",
"an",
"VirtualNetworkRule",
"for",
"a",
"Namespace",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_event_hub/lib/2018-01-01-preview/generated/azure_mgmt_event_hub/namespaces.rb#L1048-L1051 | train | Creates or updates a virtual network rule. | [
30522,
13366,
3443,
1035,
2030,
1035,
10651,
1035,
7484,
1035,
2897,
1035,
3627,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
3415,
15327,
1035,
2171,
1010,
7484,
1035,
2897,
1035,
3627,
1035,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
rails/rails | activemodel/lib/active_model/errors.rb | ActiveModel.Errors.full_message | def full_message(attribute, message)
return message if attribute == :base
attribute = attribute.to_s
if self.class.i18n_customize_full_message && @base.class.respond_to?(:i18n_scope)
attribute = attribute.remove(/\[\d\]/)
parts = attribute.split(".")
attribute_name = parts.pop
namespace = parts.join("/") unless parts.empty?
attributes_scope = "#{@base.class.i18n_scope}.errors.models"
if namespace
defaults = @base.class.lookup_ancestors.map do |klass|
[
:"#{attributes_scope}.#{klass.model_name.i18n_key}/#{namespace}.attributes.#{attribute_name}.format",
:"#{attributes_scope}.#{klass.model_name.i18n_key}/#{namespace}.format",
]
end
else
defaults = @base.class.lookup_ancestors.map do |klass|
[
:"#{attributes_scope}.#{klass.model_name.i18n_key}.attributes.#{attribute_name}.format",
:"#{attributes_scope}.#{klass.model_name.i18n_key}.format",
]
end
end
defaults.flatten!
else
defaults = []
end
defaults << :"errors.format"
defaults << "%{attribute} %{message}"
attr_name = attribute.tr(".", "_").humanize
attr_name = @base.class.human_attribute_name(attribute, default: attr_name)
I18n.t(defaults.shift,
default: defaults,
attribute: attr_name,
message: message)
end | ruby | def full_message(attribute, message)
return message if attribute == :base
attribute = attribute.to_s
if self.class.i18n_customize_full_message && @base.class.respond_to?(:i18n_scope)
attribute = attribute.remove(/\[\d\]/)
parts = attribute.split(".")
attribute_name = parts.pop
namespace = parts.join("/") unless parts.empty?
attributes_scope = "#{@base.class.i18n_scope}.errors.models"
if namespace
defaults = @base.class.lookup_ancestors.map do |klass|
[
:"#{attributes_scope}.#{klass.model_name.i18n_key}/#{namespace}.attributes.#{attribute_name}.format",
:"#{attributes_scope}.#{klass.model_name.i18n_key}/#{namespace}.format",
]
end
else
defaults = @base.class.lookup_ancestors.map do |klass|
[
:"#{attributes_scope}.#{klass.model_name.i18n_key}.attributes.#{attribute_name}.format",
:"#{attributes_scope}.#{klass.model_name.i18n_key}.format",
]
end
end
defaults.flatten!
else
defaults = []
end
defaults << :"errors.format"
defaults << "%{attribute} %{message}"
attr_name = attribute.tr(".", "_").humanize
attr_name = @base.class.human_attribute_name(attribute, default: attr_name)
I18n.t(defaults.shift,
default: defaults,
attribute: attr_name,
message: message)
end | [
"def",
"full_message",
"(",
"attribute",
",",
"message",
")",
"return",
"message",
"if",
"attribute",
"==",
":base",
"attribute",
"=",
"attribute",
".",
"to_s",
"if",
"self",
".",
"class",
".",
"i18n_customize_full_message",
"&&",
"@base",
".",
"class",
".",
... | Returns a full message for a given attribute.
person.errors.full_message(:name, 'is invalid') # => "Name is invalid" | [
"Returns",
"a",
"full",
"message",
"for",
"a",
"given",
"attribute",
"."
] | 85a8bc644be69908f05740a5886ec19cd3679df5 | https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activemodel/lib/active_model/errors.rb#L470-L512 | train | Returns the full message for the given attribute. | [
30522,
13366,
2440,
1035,
4471,
1006,
17961,
1010,
4471,
1007,
2709,
4471,
2065,
17961,
1027,
1027,
1024,
2918,
17961,
1027,
17961,
1012,
2000,
1035,
30524,
1045,
15136,
2078,
1035,
7661,
4697,
1035,
2440,
1035,
4471,
1004,
1004,
1030,
2918... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
jnunemaker/flipper | lib/flipper/feature.rb | Flipper.Feature.enabled? | def enabled?(thing = nil)
instrument(:enabled?) do |payload|
values = gate_values
thing = gate(:actor).wrap(thing) unless thing.nil?
payload[:thing] = thing
context = FeatureCheckContext.new(
feature_name: @name,
values: values,
thing: thing
)
if open_gate = gates.detect { |gate| gate.open?(context) }
payload[:gate_name] = open_gate.name
true
else
false
end
end
end | ruby | def enabled?(thing = nil)
instrument(:enabled?) do |payload|
values = gate_values
thing = gate(:actor).wrap(thing) unless thing.nil?
payload[:thing] = thing
context = FeatureCheckContext.new(
feature_name: @name,
values: values,
thing: thing
)
if open_gate = gates.detect { |gate| gate.open?(context) }
payload[:gate_name] = open_gate.name
true
else
false
end
end
end | [
"def",
"enabled?",
"(",
"thing",
"=",
"nil",
")",
"instrument",
"(",
":enabled?",
")",
"do",
"|",
"payload",
"|",
"values",
"=",
"gate_values",
"thing",
"=",
"gate",
"(",
":actor",
")",
".",
"wrap",
"(",
"thing",
")",
"unless",
"thing",
".",
"nil?",
... | Public: Check if a feature is enabled for a thing.
Returns true if enabled, false if not. | [
"Public",
":",
"Check",
"if",
"a",
"feature",
"is",
"enabled",
"for",
"a",
"thing",
"."
] | df0352b663ad3ed45d68710f10a8170249ff9d78 | https://github.com/jnunemaker/flipper/blob/df0352b663ad3ed45d68710f10a8170249ff9d78/lib/flipper/feature.rb#L103-L121 | train | Returns whether the feature is enabled or not. | [
30522,
13366,
9124,
1029,
1006,
2518,
1027,
9152,
2140,
1007,
6602,
1006,
1024,
9124,
1029,
1007,
2079,
1064,
18093,
1064,
5300,
1027,
4796,
1035,
5300,
2518,
1027,
4796,
1006,
1024,
3364,
1007,
1012,
10236,
1006,
2518,
1007,
4983,
2518,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
hashicorp/vault-ruby | lib/vault/api/auth_token.rb | Vault.AuthToken.revoke_accessor | def revoke_accessor(accessor, options = {})
headers = extract_headers!(options)
client.put("/v1/auth/token/revoke-accessor", JSON.fast_generate(
accessor: accessor,
), headers)
return true
end | ruby | def revoke_accessor(accessor, options = {})
headers = extract_headers!(options)
client.put("/v1/auth/token/revoke-accessor", JSON.fast_generate(
accessor: accessor,
), headers)
return true
end | [
"def",
"revoke_accessor",
"(",
"accessor",
",",
"options",
"=",
"{",
"}",
")",
"headers",
"=",
"extract_headers!",
"(",
"options",
")",
"client",
".",
"put",
"(",
"\"/v1/auth/token/revoke-accessor\"",
",",
"JSON",
".",
"fast_generate",
"(",
"accessor",
":",
"a... | Revoke exactly the orphans at the id.
@example
Vault.auth_token.revoke_accessor("abcd-1234") #=> true
@param [String] accessor
the accessor to revoke
@return [true] | [
"Revoke",
"exactly",
"the",
"orphans",
"at",
"the",
"id",
"."
] | 02f0532a802ba1a2a0d8703a4585dab76eb9d864 | https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/auth_token.rb#L216-L222 | train | Revoke an accessor | [
30522,
13366,
7065,
11045,
1035,
3229,
2953,
1006,
3229,
2953,
1010,
7047,
1027,
1063,
1065,
1007,
20346,
2015,
1027,
14817,
1035,
20346,
2015,
999,
1006,
7047,
1007,
7396,
1012,
2404,
1006,
1000,
1013,
1058,
2487,
1013,
8740,
2705,
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... |
rails/sprockets | lib/sprockets/encoding_utils.rb | Sprockets.EncodingUtils.gzip | def gzip(str)
io = StringIO.new
gz = Zlib::GzipWriter.new(io, Zlib::BEST_COMPRESSION)
gz.mtime = 1
gz << str
gz.finish
io.string
end | ruby | def gzip(str)
io = StringIO.new
gz = Zlib::GzipWriter.new(io, Zlib::BEST_COMPRESSION)
gz.mtime = 1
gz << str
gz.finish
io.string
end | [
"def",
"gzip",
"(",
"str",
")",
"io",
"=",
"StringIO",
".",
"new",
"gz",
"=",
"Zlib",
"::",
"GzipWriter",
".",
"new",
"(",
"io",
",",
"Zlib",
"::",
"BEST_COMPRESSION",
")",
"gz",
".",
"mtime",
"=",
"1",
"gz",
"<<",
"str",
"gz",
".",
"finish",
"io... | Public: Use gzip to compress data.
str - String data
Returns a compressed String | [
"Public",
":",
"Use",
"gzip",
"to",
"compress",
"data",
"."
] | 9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd | https://github.com/rails/sprockets/blob/9e3f0d8e98c44f57e67bc138db87bb8469bf5ddd/lib/sprockets/encoding_utils.rb#L59-L66 | train | Gzip a string | [
30522,
13366,
1043,
5831,
2361,
1006,
2358,
2099,
1007,
22834,
1027,
5164,
3695,
1012,
2047,
1043,
2480,
1027,
1062,
29521,
1024,
1024,
1043,
5831,
28400,
17625,
2099,
1012,
2047,
1006,
22834,
1010,
1062,
29521,
1024,
1024,
2190,
1035,
1337... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-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/loader_shared_helpers.rb | PhusionPassenger.LoaderSharedHelpers.maybe_make_path_relative_to_app_root | def maybe_make_path_relative_to_app_root(app_root, abs_path)
if Dir.logical_pwd == app_root && File.dirname(abs_path) == app_root
File.basename(abs_path)
else
abs_path
end
end | ruby | def maybe_make_path_relative_to_app_root(app_root, abs_path)
if Dir.logical_pwd == app_root && File.dirname(abs_path) == app_root
File.basename(abs_path)
else
abs_path
end
end | [
"def",
"maybe_make_path_relative_to_app_root",
"(",
"app_root",
",",
"abs_path",
")",
"if",
"Dir",
".",
"logical_pwd",
"==",
"app_root",
"&&",
"File",
".",
"dirname",
"(",
"abs_path",
")",
"==",
"app_root",
"File",
".",
"basename",
"(",
"abs_path",
")",
"else"... | If the current working directory equals `app_root`, and `abs_path` is a
file inside `app_root`, then returns its basename. Otherwise, returns
`abs_path`.
The main use case for this method is to ensure that we load config.ru
with a relative path (only its base name) in most circumstances,
instead of with an absolute path. This is necessary in order to retain
compatibility with apps that expect config.ru's __FILE__ to be relative.
See https://github.com/phusion/passenger/issues/1596 | [
"If",
"the",
"current",
"working",
"directory",
"equals",
"app_root",
"and",
"abs_path",
"is",
"a",
"file",
"inside",
"app_root",
"then",
"returns",
"its",
"basename",
".",
"Otherwise",
"returns",
"abs_path",
"."
] | 970964b53e0ba86959acdf40f06c99b0c4a128ca | https://github.com/phusion/passenger/blob/970964b53e0ba86959acdf40f06c99b0c4a128ca/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb#L251-L257 | train | Make the absolute path relative to the app root | [
30522,
13366,
2672,
1035,
2191,
1035,
4130,
1035,
5816,
1035,
2000,
1035,
10439,
1035,
7117,
1006,
10439,
1035,
7117,
1010,
14689,
1035,
4130,
1007,
2065,
16101,
1012,
11177,
1035,
1052,
21724,
1027,
1027,
10439,
1035,
7117,
1004,
1004,
537... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
RailsEventStore/rails_event_store | ruby_event_store/lib/ruby_event_store/specification.rb | RubyEventStore.Specification.each_batch | def each_batch
return to_enum(:each_batch) unless block_given?
reader.each(in_batches(result.batch_size).result) do |batch|
yield batch
end
end | ruby | def each_batch
return to_enum(:each_batch) unless block_given?
reader.each(in_batches(result.batch_size).result) do |batch|
yield batch
end
end | [
"def",
"each_batch",
"return",
"to_enum",
"(",
":each_batch",
")",
"unless",
"block_given?",
"reader",
".",
"each",
"(",
"in_batches",
"(",
"result",
".",
"batch_size",
")",
".",
"result",
")",
"do",
"|",
"batch",
"|",
"yield",
"batch",
"end",
"end"
] | Executes the query based on the specification built up to this point.
Yields each batch of records that was retrieved from the store.
{http://railseventstore.org/docs/read/ Find out more}.
@yield [Array<Event, Proto>] batch of events
@return [Enumerator, nil] Enumerator is returned when block not given | [
"Executes",
"the",
"query",
"based",
"on",
"the",
"specification",
"built",
"up",
"to",
"this",
"point",
".",
"Yields",
"each",
"batch",
"of",
"records",
"that",
"was",
"retrieved",
"from",
"the",
"store",
".",
"{",
"http",
":",
"//",
"railseventstore",
".... | 3ee4f3148499794154ee6fec74ccf6d4670d85ac | https://github.com/RailsEventStore/rails_event_store/blob/3ee4f3148499794154ee6fec74ccf6d4670d85ac/ruby_event_store/lib/ruby_event_store/specification.rb#L76-L82 | train | Yields the result of the batch | [
30522,
13366,
2169,
1035,
14108,
2709,
2000,
1035,
4372,
2819,
1006,
1024,
2169,
1035,
14108,
1007,
4983,
3796,
1035,
2445,
1029,
8068,
1012,
2169,
1006,
1999,
1035,
14108,
2229,
1006,
2765,
1012,
14108,
1035,
2946,
1007,
1012,
2765,
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 | data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb | Azure::CognitiveServices::LuisAuthoring::V2_0.Model.update_hierarchical_entity_role_with_http_info | def update_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:nil)
update_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end | ruby | def update_hierarchical_entity_role_with_http_info(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:nil)
update_hierarchical_entity_role_async(app_id, version_id, h_entity_id, role_id, entity_role_update_object, custom_headers:custom_headers).value!
end | [
"def",
"update_hierarchical_entity_role_with_http_info",
"(",
"app_id",
",",
"version_id",
",",
"h_entity_id",
",",
"role_id",
",",
"entity_role_update_object",
",",
"custom_headers",
":",
"nil",
")",
"update_hierarchical_entity_role_async",
"(",
"app_id",
",",
"version_id"... | Update a role for a given hierarchical entity 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 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 [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Update",
"a",
"role",
"for",
"a",
"given",
"hierarchical",
"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#L10775-L10777 | train | Updates a hierarchical entity role. | [
30522,
13366,
10651,
1035,
25835,
1035,
9178,
1035,
2535,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
10439,
1035,
8909,
1010,
2544,
1035,
8909,
1010,
1044,
1035,
9178,
1035,
8909,
1010,
2535,
1035,
8909,
1010,
9178,
1035,
2535,
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... |
projectcypress/health-data-standards | lib/hqmf-parser/2.0/data_criteria_helpers/dc_specific_occurrences_and_source_data_criteria_extract.rb | HQMF2.SpecificOccurrenceAndSource.extract_specific_occurrences_and_source_data_criteria | def extract_specific_occurrences_and_source_data_criteria
specific_def = @entry.at_xpath('./*/cda:outboundRelationship[@typeCode="OCCR"]', HQMF2::Document::NAMESPACES)
source_def = @entry.at_xpath('./*/cda:outboundRelationship[cda:subsetCode/@code="SOURCE"]',
HQMF2::Document::NAMESPACES)
if specific_def
source_data_criteria_extension = HQMF2::Utilities.attr_val(specific_def,
'./cda:criteriaReference/cda:id/@extension')
source_data_criteria_root = HQMF2::Utilities.attr_val(specific_def, './cda:criteriaReference/cda:id/@root')
occurrence_criteria = @data_criteria_references[strip_tokens("#{source_data_criteria_extension}_#{source_data_criteria_root}")]
return if occurrence_criteria.nil?
specific_occurrence_const = HQMF2::Utilities.attr_val(specific_def,
'./cda:localVariableName/@controlInformationRoot')
specific_occurrence = HQMF2::Utilities.attr_val(specific_def,
'./cda:localVariableName/@controlInformationExtension')
# FIXME: Remove debug statements after cleaning up occurrence handling
# build regex for extracting alpha-index of specific occurrences
occurrence_identifier = obtain_occurrence_identifier(strip_tokens(@id),
strip_tokens(@local_variable_name) || '',
strip_tokens(source_data_criteria_extension),
@is_variable)
handle_specific_and_source(occurrence_identifier, source_data_criteria_extension, source_data_criteria_root,
specific_occurrence_const, specific_occurrence)
elsif source_def
extension = HQMF2::Utilities.attr_val(source_def, './cda:criteriaReference/cda:id/@extension')
root = HQMF2::Utilities.attr_val(source_def, './cda:criteriaReference/cda:id/@root')
["#{extension}_#{root}_source", root, extension] # return the soruce data criteria itself, the rest will be blank
end
end | ruby | def extract_specific_occurrences_and_source_data_criteria
specific_def = @entry.at_xpath('./*/cda:outboundRelationship[@typeCode="OCCR"]', HQMF2::Document::NAMESPACES)
source_def = @entry.at_xpath('./*/cda:outboundRelationship[cda:subsetCode/@code="SOURCE"]',
HQMF2::Document::NAMESPACES)
if specific_def
source_data_criteria_extension = HQMF2::Utilities.attr_val(specific_def,
'./cda:criteriaReference/cda:id/@extension')
source_data_criteria_root = HQMF2::Utilities.attr_val(specific_def, './cda:criteriaReference/cda:id/@root')
occurrence_criteria = @data_criteria_references[strip_tokens("#{source_data_criteria_extension}_#{source_data_criteria_root}")]
return if occurrence_criteria.nil?
specific_occurrence_const = HQMF2::Utilities.attr_val(specific_def,
'./cda:localVariableName/@controlInformationRoot')
specific_occurrence = HQMF2::Utilities.attr_val(specific_def,
'./cda:localVariableName/@controlInformationExtension')
# FIXME: Remove debug statements after cleaning up occurrence handling
# build regex for extracting alpha-index of specific occurrences
occurrence_identifier = obtain_occurrence_identifier(strip_tokens(@id),
strip_tokens(@local_variable_name) || '',
strip_tokens(source_data_criteria_extension),
@is_variable)
handle_specific_and_source(occurrence_identifier, source_data_criteria_extension, source_data_criteria_root,
specific_occurrence_const, specific_occurrence)
elsif source_def
extension = HQMF2::Utilities.attr_val(source_def, './cda:criteriaReference/cda:id/@extension')
root = HQMF2::Utilities.attr_val(source_def, './cda:criteriaReference/cda:id/@root')
["#{extension}_#{root}_source", root, extension] # return the soruce data criteria itself, the rest will be blank
end
end | [
"def",
"extract_specific_occurrences_and_source_data_criteria",
"specific_def",
"=",
"@entry",
".",
"at_xpath",
"(",
"'./*/cda:outboundRelationship[@typeCode=\"OCCR\"]'",
",",
"HQMF2",
"::",
"Document",
"::",
"NAMESPACES",
")",
"source_def",
"=",
"@entry",
".",
"at_xpath",
... | Retrieve the specific occurrence and source data criteria information (or just source if there is no specific) | [
"Retrieve",
"the",
"specific",
"occurrence",
"and",
"source",
"data",
"criteria",
"information",
"(",
"or",
"just",
"source",
"if",
"there",
"is",
"no",
"specific",
")"
] | 252d4f0927c513eacde6b9ea41b76faa1423c34b | https://github.com/projectcypress/health-data-standards/blob/252d4f0927c513eacde6b9ea41b76faa1423c34b/lib/hqmf-parser/2.0/data_criteria_helpers/dc_specific_occurrences_and_source_data_criteria_extract.rb#L17-L49 | train | Extract specific and source data criteria | [
30522,
13366,
14817,
1035,
3563,
1035,
27247,
1035,
1998,
1035,
3120,
1035,
2951,
1035,
9181,
3563,
1035,
13366,
1027,
1030,
4443,
1012,
2012,
1035,
26726,
8988,
1006,
1005,
1012,
1013,
1008,
1013,
3729,
2050,
1024,
2041,
15494,
16570,
1070... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_redis/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb | Azure::Redis::Mgmt::V2017_02_01.Redis.force_reboot | def force_reboot(resource_group_name, name, parameters, custom_headers:nil)
response = force_reboot_async(resource_group_name, name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | ruby | def force_reboot(resource_group_name, name, parameters, custom_headers:nil)
response = force_reboot_async(resource_group_name, name, parameters, custom_headers:custom_headers).value!
response.body unless response.nil?
end | [
"def",
"force_reboot",
"(",
"resource_group_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":",
"nil",
")",
"response",
"=",
"force_reboot_async",
"(",
"resource_group_name",
",",
"name",
",",
"parameters",
",",
"custom_headers",
":custom_headers",
")... | Reboot specified Redis node(s). This operation requires write permission to
the cache resource. There can be potential data loss.
@param resource_group_name [String] The name of the resource group.
@param name [String] The name of the Redis cache.
@param parameters [RedisRebootParameters] Specifies which Redis node(s) to
reboot.
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [RedisForceRebootResponse] operation results. | [
"Reboot",
"specified",
"Redis",
"node",
"(",
"s",
")",
".",
"This",
"operation",
"requires",
"write",
"permission",
"to",
"the",
"cache",
"resource",
".",
"There",
"can",
"be",
"potential",
"data",
"loss",
"."
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_redis/lib/2017-02-01/generated/azure_mgmt_redis/redis.rb#L696-L699 | train | Force reboot the specified managed database. | [
30522,
13366,
2486,
1035,
2128,
27927,
1006,
7692,
1035,
2177,
1035,
2171,
1010,
2171,
1010,
11709,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
3433,
1027,
2486,
1035,
2128,
27927,
1035,
2004,
6038,
2278,
1006,
7692,
1035,
2177,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
alexreisner/geocoder | lib/geocoder/lookups/maxmind.rb | Geocoder::Lookup.Maxmind.configured_service! | def configured_service!
if s = configuration[:service] and services.keys.include?(s)
return s
else
raise(
Geocoder::ConfigurationError,
"When using MaxMind you MUST specify a service name: " +
"Geocoder.configure(:maxmind => {:service => ...}), " +
"where '...' is one of: #{services.keys.inspect}"
)
end
end | ruby | def configured_service!
if s = configuration[:service] and services.keys.include?(s)
return s
else
raise(
Geocoder::ConfigurationError,
"When using MaxMind you MUST specify a service name: " +
"Geocoder.configure(:maxmind => {:service => ...}), " +
"where '...' is one of: #{services.keys.inspect}"
)
end
end | [
"def",
"configured_service!",
"if",
"s",
"=",
"configuration",
"[",
":service",
"]",
"and",
"services",
".",
"keys",
".",
"include?",
"(",
"s",
")",
"return",
"s",
"else",
"raise",
"(",
"Geocoder",
"::",
"ConfigurationError",
",",
"\"When using MaxMind you MUST ... | Return the name of the configured service, or raise an exception. | [
"Return",
"the",
"name",
"of",
"the",
"configured",
"service",
"or",
"raise",
"an",
"exception",
"."
] | e087dc2759264ee6f307b926bb2de4ec2406859e | https://github.com/alexreisner/geocoder/blob/e087dc2759264ee6f307b926bb2de4ec2406859e/lib/geocoder/lookups/maxmind.rb#L21-L32 | train | Returns the service name for the current service | [
30522,
13366,
26928,
1035,
2326,
999,
2065,
1055,
1027,
9563,
1031,
1024,
2326,
1033,
1998,
2578,
1012,
6309,
1012,
2421,
1029,
1006,
1055,
1007,
2709,
1055,
2842,
5333,
1006,
20248,
16044,
2099,
1024,
1024,
9563,
2121,
29165,
1010,
1000,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Azure/azure-sdk-for-ruby | management/azure_mgmt_data_migration/lib/2018-04-19/generated/azure_mgmt_data_migration/projects.rb | Azure::DataMigration::Mgmt::V2018_04_19.Projects.get_with_http_info | def get_with_http_info(group_name, service_name, project_name, custom_headers:nil)
get_async(group_name, service_name, project_name, custom_headers:custom_headers).value!
end | ruby | def get_with_http_info(group_name, service_name, project_name, custom_headers:nil)
get_async(group_name, service_name, project_name, custom_headers:custom_headers).value!
end | [
"def",
"get_with_http_info",
"(",
"group_name",
",",
"service_name",
",",
"project_name",
",",
"custom_headers",
":",
"nil",
")",
"get_async",
"(",
"group_name",
",",
"service_name",
",",
"project_name",
",",
"custom_headers",
":custom_headers",
")",
".",
"value!",
... | Get project information
The project resource is a nested resource representing a stored migration
project. The GET method retrieves information about a project.
@param group_name [String] Name of the resource group
@param service_name [String] Name of the service
@param project_name [String] Name of the project
@param custom_headers [Hash{String => String}] A hash of custom headers that
will be added to the HTTP request.
@return [MsRestAzure::AzureOperationResponse] HTTP response information. | [
"Get",
"project",
"information"
] | 78eedacf8f8cbd65c2d8a2af421405eaa4373d8e | https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_data_migration/lib/2018-04-19/generated/azure_mgmt_data_migration/projects.rb#L284-L286 | train | Gets the specified HDInsight project s index. | [
30522,
13366,
2131,
1035,
2007,
1035,
8299,
1035,
18558,
1006,
2177,
1035,
2171,
1010,
2326,
1035,
2171,
1010,
2622,
1035,
2171,
1010,
7661,
1035,
20346,
2015,
1024,
9152,
2140,
1007,
2131,
1035,
2004,
6038,
2278,
1006,
2177,
1035,
2171,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.