repo
stringclasses
235 values
path
stringlengths
11
168
func_name
stringlengths
12
143
original_string
stringlengths
83
6.91k
language
stringclasses
1 value
code
stringlengths
83
6.91k
code_tokens
listlengths
15
1.01k
docstring
stringlengths
5
25.7k
docstring_tokens
listlengths
1
427
sha
stringclasses
235 values
url
stringlengths
99
268
partition
stringclasses
1 value
summary
stringlengths
7
202
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
Azure/azure-sdk-for-ruby
data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb
Azure::ServiceFabric::V6_2_0_9.ServiceFabricClientAPIs.get_deployed_service_package_info_list_by_name_with_http_info
def get_deployed_service_package_info_list_by_name_with_http_info(node_name, application_id, service_package_name, timeout:60, custom_headers:nil) get_deployed_service_package_info_list_by_name_async(node_name, application_id, service_package_name, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def get_deployed_service_package_info_list_by_name_with_http_info(node_name, application_id, service_package_name, timeout:60, custom_headers:nil) get_deployed_service_package_info_list_by_name_async(node_name, application_id, service_package_name, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "get_deployed_service_package_info_list_by_name_with_http_info", "(", "node_name", ",", "application_id", ",", "service_package_name", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "get_deployed_service_package_info_list_by_name_async", "(", "node_na...
Gets the list of service packages deployed on a Service Fabric node matching exactly the specified name. Returns the information about the service packages deployed on a Service Fabric node for the given application. These results are of service packages whose name match exactly the service package name specified as the parameter. @param node_name [String] The name of the node. @param application_id [String] The identity of the application. This is typically the full name of the application without the 'fabric:' URI scheme. Starting from version 6.0, hierarchical names are delimited with the "~" character. For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" in 6.0+ and "myapp/app1" in previous versions. @param service_package_name [String] The name of the service package. @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", "service", "packages", "deployed", "on", "a", "Service", "Fabric", "node", "matching", "exactly", "the", "specified", "name", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L16163-L16165
train
Gets the list of service package information for a service package.
[ 30522, 13366, 2131, 1035, 7333, 1035, 2326, 1035, 7427, 1035, 18558, 1035, 2862, 1035, 2011, 1035, 2171, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 13045, 1035, 2171, 1010, 4646, 1035, 8909, 1010, 2326, 1035, 7427, 1035, 2171, 1010, 2051, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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-sns/lib/aws-sdk-sns/platform_application.rb
Aws::SNS.PlatformApplication.endpoints
def endpoints(options = {}) batches = Enumerator.new do |y| options = options.merge(platform_application_arn: @arn) resp = @client.list_endpoints_by_platform_application(options) resp.each_page do |page| batch = [] page.data.endpoints.each do |e| batch << PlatformEndpoint.new( arn: e.endpoint_arn, client: @client ) end y.yield(batch) end end PlatformEndpoint::Collection.new(batches) end
ruby
def endpoints(options = {}) batches = Enumerator.new do |y| options = options.merge(platform_application_arn: @arn) resp = @client.list_endpoints_by_platform_application(options) resp.each_page do |page| batch = [] page.data.endpoints.each do |e| batch << PlatformEndpoint.new( arn: e.endpoint_arn, client: @client ) end y.yield(batch) end end PlatformEndpoint::Collection.new(batches) end
[ "def", "endpoints", "(", "options", "=", "{", "}", ")", "batches", "=", "Enumerator", ".", "new", "do", "|", "y", "|", "options", "=", "options", ".", "merge", "(", "platform_application_arn", ":", "@arn", ")", "resp", "=", "@client", ".", "list_endpoint...
@!group Associations @example Request syntax with placeholder values platform_application.endpoints() @param [Hash] options ({}) @return [PlatformEndpoint::Collection]
[ "@!group", "Associations", "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-sns/lib/aws-sdk-sns/platform_application.rb#L193-L209
train
Returns an array of all the endpoints in the platform application.
[ 30522, 13366, 2203, 26521, 1006, 7047, 1027, 1063, 1065, 1007, 14108, 2229, 1027, 4372, 17897, 16259, 1012, 2047, 2079, 1064, 1061, 1064, 7047, 1027, 7047, 1012, 13590, 1006, 4132, 1035, 4646, 1035, 12098, 2078, 1024, 1030, 12098, 2078, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb
Azure::Compute::Mgmt::V2018_04_01.VirtualMachineScaleSets.delete_instances
def delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil) response = delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value! nil end
ruby
def delete_instances(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:nil) response = delete_instances_async(resource_group_name, vm_scale_set_name, vm_instance_ids, custom_headers:custom_headers).value! nil end
[ "def", "delete_instances", "(", "resource_group_name", ",", "vm_scale_set_name", ",", "vm_instance_ids", ",", "custom_headers", ":", "nil", ")", "response", "=", "delete_instances_async", "(", "resource_group_name", ",", "vm_scale_set_name", ",", "vm_instance_ids", ",", ...
Deletes virtual machines in a VM scale set. @param resource_group_name [String] The name of the resource group. @param vm_scale_set_name [String] The name of the VM scale set. @param vm_instance_ids [VirtualMachineScaleSetVMInstanceRequiredIDs] A list of virtual machine instance IDs from the VM scale set. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Deletes", "virtual", "machines", "in", "a", "VM", "scale", "set", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_compute/lib/2018-04-01/generated/azure_mgmt_compute/virtual_machine_scale_sets.rb#L300-L303
train
Deletes a set of virtual machines in a VM scale set.
[ 30522, 13366, 3972, 12870, 1035, 12107, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 1058, 2213, 1035, 4094, 1035, 2275, 1035, 2171, 1010, 1058, 2213, 1035, 6013, 1035, 8909, 2015, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 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...
rails/rails
actionpack/lib/action_controller/metal/request_forgery_protection.rb
ActionController.RequestForgeryProtection.valid_request_origin?
def valid_request_origin? # :doc: if forgery_protection_origin_check # We accept blank origin headers because some user agents don't send it. raise InvalidAuthenticityToken, NULL_ORIGIN_MESSAGE if request.origin == "null" request.origin.nil? || request.origin == request.base_url else true end end
ruby
def valid_request_origin? # :doc: if forgery_protection_origin_check # We accept blank origin headers because some user agents don't send it. raise InvalidAuthenticityToken, NULL_ORIGIN_MESSAGE if request.origin == "null" request.origin.nil? || request.origin == request.base_url else true end end
[ "def", "valid_request_origin?", "# :doc:", "if", "forgery_protection_origin_check", "# We accept blank origin headers because some user agents don't send it.", "raise", "InvalidAuthenticityToken", ",", "NULL_ORIGIN_MESSAGE", "if", "request", ".", "origin", "==", "\"null\"", "request"...
Checks if the request originated from the same origin by looking at the Origin header.
[ "Checks", "if", "the", "request", "originated", "from", "the", "same", "origin", "by", "looking", "at", "the", "Origin", "header", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_controller/metal/request_forgery_protection.rb#L441-L449
train
Check if the origin header is valid
[ 30522, 13366, 9398, 1035, 5227, 1035, 4761, 1029, 1001, 1024, 9986, 1024, 2065, 15681, 2854, 1035, 3860, 1035, 4761, 1035, 4638, 1001, 2057, 5138, 8744, 4761, 20346, 2015, 2138, 2070, 5310, 6074, 2123, 1005, 1056, 4604, 2009, 1012, 5333, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb
Aws::RDS.DBInstance.restore
def restore(options = {}) options = options.merge(source_db_instance_identifier: @id) resp = @client.restore_db_instance_to_point_in_time(options) DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end
ruby
def restore(options = {}) options = options.merge(source_db_instance_identifier: @id) resp = @client.restore_db_instance_to_point_in_time(options) DBInstance.new( id: resp.data.db_instance.db_instance_identifier, data: resp.data.db_instance, client: @client ) end
[ "def", "restore", "(", "options", "=", "{", "}", ")", "options", "=", "options", ".", "merge", "(", "source_db_instance_identifier", ":", "@id", ")", "resp", "=", "@client", ".", "restore_db_instance_to_point_in_time", "(", "options", ")", "DBInstance", ".", "...
@example Request syntax with placeholder values dbinstance = db_instance.restore({ target_db_instance_identifier: "String", # required restore_time: Time.now, use_latest_restorable_time: false, db_instance_class: "String", port: 1, availability_zone: "String", db_subnet_group_name: "String", multi_az: false, publicly_accessible: false, auto_minor_version_upgrade: false, license_model: "String", db_name: "String", engine: "String", iops: 1, option_group_name: "String", copy_tags_to_snapshot: false, tags: [ { key: "String", value: "String", }, ], storage_type: "String", tde_credential_arn: "String", tde_credential_password: "String", vpc_security_group_ids: ["String"], domain: "String", domain_iam_role_name: "String", enable_iam_database_authentication: false, enable_cloudwatch_logs_exports: ["String"], processor_features: [ { name: "String", value: "String", }, ], use_default_processor_features: false, db_parameter_group_name: "String", deletion_protection: false, source_dbi_resource_id: "String", }) @param [Hash] options ({}) @option options [required, String] :target_db_instance_identifier The name of the new DB instance to be created. Constraints: * Must contain from 1 to 63 letters, numbers, or hyphens * First character must be a letter * Can't end with a hyphen or contain two consecutive hyphens @option options [Time,DateTime,Date,Integer,String] :restore_time The date and time to restore from. Valid Values: Value must be a time in Universal Coordinated Time (UTC) format Constraints: * Must be before the latest restorable time for the DB instance * Can't be specified if UseLatestRestorableTime parameter is true Example: `2009-09-07T23:45:00Z` @option options [Boolean] :use_latest_restorable_time Specifies whether (`true`) or not (`false`) the DB instance is restored from the latest backup time. Default: `false` Constraints: Can't be specified if RestoreTime parameter is provided. @option options [String] :db_instance_class The compute and memory capacity of the Amazon RDS DB instance, for example, `db.m4.large`. Not all DB instance classes are available in all AWS Regions, or for all database engines. For the full list of DB instance classes, and availability for your engine, see [DB Instance Class][1] in the *Amazon RDS User Guide.* Default: The same DBInstanceClass as the original DB instance. [1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html @option options [Integer] :port The port number on which the database accepts connections. Constraints: Value must be `1150-65535` Default: The same port as the original DB instance. @option options [String] :availability_zone The EC2 Availability Zone that the DB instance is created in. Default: A random, system-chosen Availability Zone. Constraint: You can't specify the AvailabilityZone parameter if the MultiAZ parameter is set to true. Example: `us-east-1a` @option options [String] :db_subnet_group_name The DB subnet group name to use for the new instance. Constraints: If supplied, must match the name of an existing DBSubnetGroup. Example: `mySubnetgroup` @option options [Boolean] :multi_az Specifies if the DB instance is a Multi-AZ deployment. Constraint: You can't specify the AvailabilityZone parameter if the MultiAZ parameter is set to `true`. @option options [Boolean] :publicly_accessible Specifies the accessibility options for the DB instance. A value of true specifies an Internet-facing instance with a publicly resolvable DNS name, which resolves to a public IP address. A value of false specifies an internal instance with a DNS name that resolves to a private IP address. For more information, see CreateDBInstance. @option options [Boolean] :auto_minor_version_upgrade Indicates that minor version upgrades are applied automatically to the DB instance during the maintenance window. @option options [String] :license_model License model information for the restored DB instance. Default: Same as source. Valid values: `license-included` \| `bring-your-own-license` \| `general-public-license` @option options [String] :db_name The database name for the restored DB instance. <note markdown="1"> This parameter is not used for the MySQL or MariaDB engines. </note> @option options [String] :engine The database engine to use for the new instance. Default: The same as source Constraint: Must be compatible with the engine of the source Valid Values: * `mariadb` * `mysql` * `oracle-ee` * `oracle-se2` * `oracle-se1` * `oracle-se` * `postgres` * `sqlserver-ee` * `sqlserver-se` * `sqlserver-ex` * `sqlserver-web` @option options [Integer] :iops The amount of Provisioned IOPS (input/output operations per second) to be initially allocated for the DB instance. Constraints: Must be an integer greater than 1000. **SQL Server** Setting the IOPS value for the SQL Server database engine is not supported. @option options [String] :option_group_name The name of the option group to be used for the restored DB instance. Permanent options, such as the TDE option for Oracle Advanced Security TDE, can't be removed from an option group, and that option group can't be removed from a DB instance once it is associated with a DB instance @option options [Boolean] :copy_tags_to_snapshot True to copy all tags from the restored DB instance to snapshots of the restored DB instance, and otherwise false. The default is false. @option options [Array<Types::Tag>] :tags A list of tags. For more information, see [Tagging Amazon RDS Resources][1] in the *Amazon RDS User Guide.* [1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html @option options [String] :storage_type Specifies the storage type to be associated with the DB instance. Valid values: `standard | gp2 | io1` If you specify `io1`, you must also include a value for the `Iops` parameter. Default: `io1` if the `Iops` parameter is specified, otherwise `standard` @option options [String] :tde_credential_arn The ARN from the key store with which to associate the instance for TDE encryption. @option options [String] :tde_credential_password The password for the given ARN from the key store in order to access the device. @option options [Array<String>] :vpc_security_group_ids A list of EC2 VPC security groups to associate with this DB instance. Default: The default EC2 VPC security group for the DB subnet group's VPC. @option options [String] :domain Specify the Active Directory Domain to restore the instance in. @option options [String] :domain_iam_role_name Specify the name of the IAM role to be used when making API calls to the Directory Service. @option options [Boolean] :enable_iam_database_authentication True to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts, and otherwise false. You can enable IAM database authentication for the following database engines * For MySQL 5.6, minor version 5.6.34 or higher * For MySQL 5.7, minor version 5.7.16 or higher Default: `false` @option options [Array<String>] :enable_cloudwatch_logs_exports The list of logs that the restored DB instance is to export to CloudWatch Logs. The values in the list depend on the DB engine being used. For more information, see [Publishing Database Logs to Amazon CloudWatch Logs][1] in the *Amazon RDS User Guide*. [1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch @option options [Array<Types::ProcessorFeature>] :processor_features The number of CPU cores and the number of threads per core for the DB instance class of the DB instance. @option options [Boolean] :use_default_processor_features A value that specifies that the DB instance class of the DB instance uses its default processor features. @option options [String] :db_parameter_group_name The name of the DB parameter group to associate with this DB instance. If this argument is omitted, the default DBParameterGroup for the specified engine is used. Constraints: * If supplied, must match the name of an existing DBParameterGroup. * Must be 1 to 255 letters, numbers, or hyphens. * First character must be a letter. * Can't end with a hyphen or contain two consecutive hyphens. @option options [Boolean] :deletion_protection Indicates if the DB instance should have deletion protection enabled. The database can't be deleted when this value is set to true. The default is false. For more information, see [ Deleting a DB Instance][1]. [1]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html @option options [String] :source_dbi_resource_id The resource ID of the source DB instance from which to restore. @return [DBInstance]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/db_instance.rb#L2767-L2775
train
Restore the DB Instance to point in time
[ 30522, 13366, 9239, 1006, 7047, 1027, 1063, 1065, 1007, 7047, 1027, 7047, 1012, 13590, 1006, 3120, 1035, 16962, 1035, 6013, 1035, 8909, 4765, 18095, 1024, 1030, 8909, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 9239, 1035, 16962, 1035, 6013,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_child
def update_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:nil) response = update_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def update_hierarchical_entity_child(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:nil) response = update_hierarchical_entity_child_async(app_id, version_id, h_entity_id, h_child_id, hierarchical_child_model_update_object, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "update_hierarchical_entity_child", "(", "app_id", ",", "version_id", ",", "h_entity_id", ",", "h_child_id", ",", "hierarchical_child_model_update_object", ",", "custom_headers", ":", "nil", ")", "response", "=", "update_hierarchical_entity_child_async", "(", "app_id...
Renames a single child in an existing hierarchical entity model in a version of the application. @param app_id The application ID. @param version_id [String] The version ID. @param h_entity_id The hierarchical entity extractor ID. @param h_child_id The hierarchical entity extractor child ID. @param hierarchical_child_model_update_object [HierarchicalChildModelUpdateObject] Model object containing new name of the hierarchical entity child. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [OperationStatus] operation results.
[ "Renames", "a", "single", "child", "in", "an", "existing", "hierarchical", "entity", "model", "in", "a", "version", "of", "the", "application", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb#L5092-L5095
train
Updates a hierarchical entity child.
[ 30522, 13366, 10651, 1035, 25835, 1035, 9178, 1035, 2775, 1006, 10439, 1035, 8909, 1010, 2544, 1035, 8909, 1010, 1044, 1035, 9178, 1035, 8909, 1010, 1044, 1035, 2775, 1035, 8909, 1010, 25835, 1035, 2775, 1035, 2944, 1035, 10651, 1035, 4874,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_image.rb
Azure::CognitiveServices::ContentModerator::V1_0.ListManagementImage.add_image_file_input
def add_image_file_input(list_id, image_stream, tag:nil, label:nil, custom_headers:nil) response = add_image_file_input_async(list_id, image_stream, tag:tag, label:label, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def add_image_file_input(list_id, image_stream, tag:nil, label:nil, custom_headers:nil) response = add_image_file_input_async(list_id, image_stream, tag:tag, label:label, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "add_image_file_input", "(", "list_id", ",", "image_stream", ",", "tag", ":", "nil", ",", "label", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "add_image_file_input_async", "(", "list_id", ",", "image_stream", ",", "tag", ":", ...
Add an image to the list with list Id equal to list Id passed. @param list_id [String] List Id of the image list. @param image_stream The image file. @param tag [Integer] Tag for the image. @param label [String] The image label. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Image] operation results.
[ "Add", "an", "image", "to", "the", "list", "with", "list", "Id", "equal", "to", "list", "Id", "passed", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_contentmoderator/lib/1.0/generated/azure_cognitiveservices_contentmoderator/list_management_image.rb#L529-L532
train
Adds an image file input to a list.
[ 30522, 13366, 5587, 1035, 3746, 1035, 5371, 1035, 7953, 1006, 2862, 1035, 8909, 1010, 3746, 1035, 5460, 1010, 6415, 1024, 9152, 2140, 1010, 3830, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 5587, 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_batch/lib/2017-09-01/generated/azure_mgmt_batch/certificate_operations.rb
Azure::Batch::Mgmt::V2017_09_01.CertificateOperations.cancel_deletion
def cancel_deletion(resource_group_name, account_name, certificate_name, custom_headers:nil) response = cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def cancel_deletion(resource_group_name, account_name, certificate_name, custom_headers:nil) response = cancel_deletion_async(resource_group_name, account_name, certificate_name, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "cancel_deletion", "(", "resource_group_name", ",", "account_name", ",", "certificate_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "cancel_deletion_async", "(", "resource_group_name", ",", "account_name", ",", "certificate_name", ",", "custom_h...
Cancels a failed deletion of a certificate from the specified account. If you try to delete a certificate that is being used by a pool or compute node, the status of the certificate changes to deleteFailed. If you decide that you want to continue using the certificate, you can use this operation to set the status of the certificate back to active. If you intend to delete the certificate, you do not need to run this operation after the deletion failed. You must make sure that the certificate is not being used by any resources, and then you can try again to delete the certificate. @param resource_group_name [String] The name of the resource group that contains the Batch account. @param account_name [String] The name of the Batch account. @param certificate_name [String] The identifier for the certificate. This must be made up of algorithm and thumbprint separated by a dash, and must match the certificate data in the request. For example SHA1-a3d1c5. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Certificate] operation results.
[ "Cancels", "a", "failed", "deletion", "of", "a", "certificate", "from", "the", "specified", "account", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_batch/lib/2017-09-01/generated/azure_mgmt_batch/certificate_operations.rb#L528-L531
train
Cancels deletion of a certificate.
[ 30522, 13366, 17542, 1035, 3972, 20624, 2239, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4070, 1035, 2171, 1010, 8196, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 17542, 1035, 3972, 20624, 2239, 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/tag.rb
Aws::EC2.Tag.load
def load resp = @client.describe_tags(filters: [ { name: "key", values: [@key] }, { name: "value", values: [@value] } ]) @data = resp.tags[0] self end
ruby
def load resp = @client.describe_tags(filters: [ { name: "key", values: [@key] }, { name: "value", values: [@value] } ]) @data = resp.tags[0] self end
[ "def", "load", "resp", "=", "@client", ".", "describe_tags", "(", "filters", ":", "[", "{", "name", ":", "\"key\"", ",", "values", ":", "[", "@key", "]", "}", ",", "{", "name", ":", "\"value\"", ",", "values", ":", "[", "@value", "]", "}", "]", "...
Loads, or reloads {#data} for the current {Tag}. Returns `self` making it possible to chain methods. tag.reload.data @return [self]
[ "Loads", "or", "reloads", "{", "#data", "}", "for", "the", "current", "{", "Tag", "}", ".", "Returns", "self", "making", "it", "possible", "to", "chain", "methods", "." ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/tag.rb#L68-L81
train
Load the current object from the cluster.
[ 30522, 13366, 7170, 24501, 2361, 1027, 1030, 7396, 1012, 6235, 1035, 22073, 1006, 17736, 1024, 1031, 1063, 2171, 1024, 1000, 3145, 1000, 1010, 5300, 1024, 1031, 1030, 3145, 1033, 1065, 1010, 1063, 2171, 1024, 1000, 3643, 1000, 1010, 5300, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_consumption/lib/2018-03-31/generated/azure_mgmt_consumption/consumption_management_client.rb
Azure::Consumption::Mgmt::V2018_03_31.ConsumptionManagementClient.get_balances_by_billing_account
def get_balances_by_billing_account(billing_account_id, custom_headers:nil) response = get_balances_by_billing_account_async(billing_account_id, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_balances_by_billing_account(billing_account_id, custom_headers:nil) response = get_balances_by_billing_account_async(billing_account_id, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_balances_by_billing_account", "(", "billing_account_id", ",", "custom_headers", ":", "nil", ")", "response", "=", "get_balances_by_billing_account_async", "(", "billing_account_id", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", ...
Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or later. @param billing_account_id [String] BillingAccount ID @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Balance] operation results.
[ "Gets", "the", "balances", "for", "a", "scope", "by", "billingAccountId", ".", "Balances", "are", "available", "via", "this", "API", "only", "for", "May", "1", "2014", "or", "later", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_consumption/lib/2018-03-31/generated/azure_mgmt_consumption/consumption_management_client.rb#L198-L201
train
Gets the balances for the billing account.
[ 30522, 13366, 2131, 1035, 5703, 2015, 1035, 2011, 1035, 25640, 1035, 4070, 1006, 25640, 1035, 4070, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2131, 1035, 5703, 2015, 1035, 2011, 1035, 25640, 1035, 4070, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/config_parser.rb
Frameit.ConfigParser.fetch_value
def fetch_value(path) specifics = @data['data'].select { |a| path.include?(a['filter']) } default = @data['default'] values = default.clone specifics.each do |specific| values = values.fastlane_deep_merge(specific) end change_paths_to_absolutes!(values) validate_values(values) values end
ruby
def fetch_value(path) specifics = @data['data'].select { |a| path.include?(a['filter']) } default = @data['default'] values = default.clone specifics.each do |specific| values = values.fastlane_deep_merge(specific) end change_paths_to_absolutes!(values) validate_values(values) values end
[ "def", "fetch_value", "(", "path", ")", "specifics", "=", "@data", "[", "'data'", "]", ".", "select", "{", "|", "a", "|", "path", ".", "include?", "(", "a", "[", "'filter'", "]", ")", "}", "default", "=", "@data", "[", "'default'", "]", "values", "...
Fetches the finished configuration for a given path. This will try to look for a specific value and fallback to a default value if nothing was found
[ "Fetches", "the", "finished", "configuration", "for", "a", "given", "path", ".", "This", "will", "try", "to", "look", "for", "a", "specific", "value", "and", "fallback", "to", "a", "default", "value", "if", "nothing", "was", "found" ]
457c5d647c77f0e078dafa5129da616914e002c5
https://github.com/fastlane/fastlane/blob/457c5d647c77f0e078dafa5129da616914e002c5/frameit/lib/frameit/config_parser.rb#L28-L42
train
Fetch the value for a specific path
[ 30522, 13366, 18584, 1035, 3643, 1006, 4130, 1007, 3563, 2015, 1027, 1030, 2951, 1031, 1005, 2951, 1005, 1033, 1012, 7276, 1063, 1064, 1037, 1064, 4130, 1012, 2421, 1029, 1006, 1037, 1031, 1005, 11307, 1005, 1033, 1007, 1065, 12398, 1027, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb
Azure::Web::Mgmt::V2018_02_01.Diagnostics.get_site_diagnostic_category_slot_with_http_info
def get_site_diagnostic_category_slot_with_http_info(resource_group_name, site_name, diagnostic_category, slot, custom_headers:nil) get_site_diagnostic_category_slot_async(resource_group_name, site_name, diagnostic_category, slot, custom_headers:custom_headers).value! end
ruby
def get_site_diagnostic_category_slot_with_http_info(resource_group_name, site_name, diagnostic_category, slot, custom_headers:nil) get_site_diagnostic_category_slot_async(resource_group_name, site_name, diagnostic_category, slot, custom_headers:custom_headers).value! end
[ "def", "get_site_diagnostic_category_slot_with_http_info", "(", "resource_group_name", ",", "site_name", ",", "diagnostic_category", ",", "slot", ",", "custom_headers", ":", "nil", ")", "get_site_diagnostic_category_slot_async", "(", "resource_group_name", ",", "site_name", "...
Get Diagnostics Category Get Diagnostics Category @param resource_group_name [String] Name of the resource group to which the resource belongs. @param site_name [String] Site Name @param diagnostic_category [String] Diagnostic Category @param slot [String] Slot 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.
[ "Get", "Diagnostics", "Category" ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb#L1737-L1739
train
Gets the diagnostic specification for a site.
[ 30522, 13366, 2131, 1035, 2609, 1035, 16474, 1035, 4696, 1035, 10453, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2609, 1035, 2171, 1010, 16474, 1035, 4696, 1010, 10453, 1010, 7661, 1035, 20346, 2015, 1024...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_redis/lib/2017-02-01/generated/azure_mgmt_redis/firewall_rules.rb
Azure::Redis::Mgmt::V2017_02_01.FirewallRules.list_by_redis_resource_as_lazy
def list_by_redis_resource_as_lazy(resource_group_name, cache_name, custom_headers:nil) response = list_by_redis_resource_async(resource_group_name, cache_name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_redis_resource_next_async(next_page_link, custom_headers:custom_headers) end page end end
ruby
def list_by_redis_resource_as_lazy(resource_group_name, cache_name, custom_headers:nil) response = list_by_redis_resource_async(resource_group_name, cache_name, custom_headers:custom_headers).value! unless response.nil? page = response.body page.next_method = Proc.new do |next_page_link| list_by_redis_resource_next_async(next_page_link, custom_headers:custom_headers) end page end end
[ "def", "list_by_redis_resource_as_lazy", "(", "resource_group_name", ",", "cache_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_by_redis_resource_async", "(", "resource_group_name", ",", "cache_name", ",", "custom_headers", ":custom_headers", ")", "...
Gets all firewall rules in the specified redis cache. @param resource_group_name [String] The name of the resource group. @param cache_name [String] The name of the Redis cache. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [RedisFirewallRuleListResult] which provide lazy access to pages of the response.
[ "Gets", "all", "firewall", "rules", "in", "the", "specified", "redis", "cache", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_redis/lib/2017-02-01/generated/azure_mgmt_redis/firewall_rules.rb#L516-L525
train
Gets the list of all the available cache entries in a redis cache.
[ 30522, 13366, 2862, 1035, 2011, 1035, 2417, 2483, 1035, 7692, 1035, 2004, 1035, 13971, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 17053, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 2011, 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...
stevegraham/slanger
lib/slanger/presence_channel.rb
Slanger.PresenceChannel.dispatch
def dispatch(message, channel) if channel =~ /\Aslanger:/ # Messages received from the Redis channel slanger:* carry info on # subscriptions. Update our subscribers accordingly. update_subscribers message else push Oj.dump(message, mode: :compat) end end
ruby
def dispatch(message, channel) if channel =~ /\Aslanger:/ # Messages received from the Redis channel slanger:* carry info on # subscriptions. Update our subscribers accordingly. update_subscribers message else push Oj.dump(message, mode: :compat) end end
[ "def", "dispatch", "(", "message", ",", "channel", ")", "if", "channel", "=~", "/", "\\A", "/", "# Messages received from the Redis channel slanger:* carry info on", "# subscriptions. Update our subscribers accordingly.", "update_subscribers", "message", "else", "push", "Oj", ...
Send an event received from Redis to the EventMachine channel
[ "Send", "an", "event", "received", "from", "Redis", "to", "the", "EventMachine", "channel" ]
f26f80c675dc4d853bce401743779a6959981af1
https://github.com/stevegraham/slanger/blob/f26f80c675dc4d853bce401743779a6959981af1/lib/slanger/presence_channel.rb#L18-L26
train
Dispatches a message to the specified channel.
[ 30522, 13366, 18365, 1006, 4471, 1010, 3149, 1007, 2065, 3149, 1027, 1066, 1013, 1032, 2004, 25023, 2121, 1024, 1013, 1001, 7696, 2363, 2013, 1996, 2417, 2483, 3149, 21435, 2121, 1024, 1008, 4287, 18558, 2006, 1001, 15002, 2015, 1012, 10651...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/express_route_circuit_peerings.rb
Azure::Network::Mgmt::V2018_07_01.ExpressRouteCircuitPeerings.begin_delete_with_http_info
def begin_delete_with_http_info(resource_group_name, circuit_name, peering_name, custom_headers:nil) begin_delete_async(resource_group_name, circuit_name, peering_name, custom_headers:custom_headers).value! end
ruby
def begin_delete_with_http_info(resource_group_name, circuit_name, peering_name, custom_headers:nil) begin_delete_async(resource_group_name, circuit_name, peering_name, custom_headers:custom_headers).value! end
[ "def", "begin_delete_with_http_info", "(", "resource_group_name", ",", "circuit_name", ",", "peering_name", ",", "custom_headers", ":", "nil", ")", "begin_delete_async", "(", "resource_group_name", ",", "circuit_name", ",", "peering_name", ",", "custom_headers", ":custom_...
Deletes the specified peering from the specified express route circuit. @param resource_group_name [String] The name of the resource group. @param circuit_name [String] The name of the express route circuit. @param peering_name [String] The name of the peering. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Deletes", "the", "specified", "peering", "from", "the", "specified", "express", "route", "circuit", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/express_route_circuit_peerings.rb#L326-L328
train
Deletes the express route circuit in the specified resource group.
[ 30522, 13366, 4088, 1035, 3972, 12870, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4984, 1035, 2171, 1010, 16740, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 4088, 1035, 3972, 12870,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_luisauthoring/lib/2.0/generated/azure_cognitiveservices_luisauthoring/model.rb
Azure::CognitiveServices::LuisAuthoring::V2_0.Model.delete_composite_entity_with_http_info
def delete_composite_entity_with_http_info(app_id, version_id, c_entity_id, custom_headers:nil) delete_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value! end
ruby
def delete_composite_entity_with_http_info(app_id, version_id, c_entity_id, custom_headers:nil) delete_composite_entity_async(app_id, version_id, c_entity_id, custom_headers:custom_headers).value! end
[ "def", "delete_composite_entity_with_http_info", "(", "app_id", ",", "version_id", ",", "c_entity_id", ",", "custom_headers", ":", "nil", ")", "delete_composite_entity_async", "(", "app_id", ",", "version_id", ",", "c_entity_id", ",", "custom_headers", ":custom_headers", ...
Deletes a composite entity from a version of the application. @param app_id The application ID. @param version_id [String] The version ID. @param c_entity_id The composite entity extractor ID. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Deletes", "a", "composite", "entity", "from", "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#L2953-L2955
train
Deletes a composite entity.
[ 30522, 13366, 3972, 12870, 1035, 12490, 1035, 9178, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 10439, 1035, 8909, 1010, 2544, 1035, 8909, 1010, 1039, 1035, 9178, 1035, 8909, 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...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb
Azure::Network::Mgmt::V2018_08_01.NetworkWatchers.begin_check_connectivity_with_http_info
def begin_check_connectivity_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
ruby
def begin_check_connectivity_with_http_info(resource_group_name, network_watcher_name, parameters, custom_headers:nil) begin_check_connectivity_async(resource_group_name, network_watcher_name, parameters, custom_headers:custom_headers).value! end
[ "def", "begin_check_connectivity_with_http_info", "(", "resource_group_name", ",", "network_watcher_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "begin_check_connectivity_async", "(", "resource_group_name", ",", "network_watcher_name", ",", "parameters", ...
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server. @param resource_group_name [String] The name of the network watcher resource group. @param network_watcher_name [String] The name of the network watcher resource. @param parameters [ConnectivityParameters] Parameters that determine how the connectivity check will be performed. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Verifies", "the", "possibility", "of", "establishing", "a", "direct", "TCP", "connection", "from", "a", "virtual", "machine", "to", "a", "given", "endpoint", "including", "another", "VM", "or", "an", "arbitrary", "remote", "server", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-08-01/generated/azure_mgmt_network/network_watchers.rb#L2147-L2149
train
Checks connectivity of the specified virtual network.
[ 30522, 13366, 4088, 1035, 4638, 1035, 20831, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2897, 1035, 3422, 2121, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 4088, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb
Azure::Storage::Mgmt::V2018_11_01.StorageAccounts.list_account_sas
def list_account_sas(resource_group_name, account_name, parameters, custom_headers:nil) response = list_account_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_account_sas(resource_group_name, account_name, parameters, custom_headers:nil) response = list_account_sas_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_account_sas", "(", "resource_group_name", ",", "account_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_account_sas_async", "(", "resource_group_name", ",", "account_name", ",", "parameters", ",", "custom_headers", ...
List SAS credentials of a storage account. @param resource_group_name [String] The name of the resource group within the user's subscription. The name is case insensitive. @param account_name [String] The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. @param parameters [AccountSasParameters] The parameters to provide to list SAS credentials for the storage account. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ListAccountSasResponse] operation results.
[ "List", "SAS", "credentials", "of", "a", "storage", "account", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storage/lib/2018-11-01/generated/azure_mgmt_storage/storage_accounts.rb#L988-L991
train
Gets the SAS of the specified HDInsight account.
[ 30522, 13366, 2862, 1035, 4070, 1035, 21871, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4070, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 4070, 1035, 21871, 1035, 2004, 6038, 2278, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb
Aws::RDS.Resource.db_security_groups
def db_security_groups(options = {}) batches = Enumerator.new do |y| resp = @client.describe_db_security_groups(options) resp.each_page do |page| batch = [] page.data.db_security_groups.each do |d| batch << DBSecurityGroup.new( name: d.db_security_group_name, data: d, client: @client ) end y.yield(batch) end end DBSecurityGroup::Collection.new(batches) end
ruby
def db_security_groups(options = {}) batches = Enumerator.new do |y| resp = @client.describe_db_security_groups(options) resp.each_page do |page| batch = [] page.data.db_security_groups.each do |d| batch << DBSecurityGroup.new( name: d.db_security_group_name, data: d, client: @client ) end y.yield(batch) end end DBSecurityGroup::Collection.new(batches) end
[ "def", "db_security_groups", "(", "options", "=", "{", "}", ")", "batches", "=", "Enumerator", ".", "new", "do", "|", "y", "|", "resp", "=", "@client", ".", "describe_db_security_groups", "(", "options", ")", "resp", ".", "each_page", "do", "|", "page", ...
@example Request syntax with placeholder values db_security_groups = rds.db_security_groups({ db_security_group_name: "String", filters: [ { name: "String", # required values: ["String"], # required }, ], }) @param [Hash] options ({}) @option options [String] :db_security_group_name The name of the DB security group to return details for. @option options [Array<Types::Filter>] :filters This parameter is not currently supported. @return [DBSecurityGroup::Collection]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-rds/lib/aws-sdk-rds/resource.rb#L1972-L1988
train
Returns a collection of DBSecurityGroup objects.
[ 30522, 13366, 16962, 1035, 3036, 1035, 2967, 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, 16962, 1035, 3036, 1035, 2967, 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...
seejohnrun/ice_cube
lib/ice_cube/validated_rule.rb
IceCube.ValidatedRule.next_time
def next_time(time, start_time, closing_time) @time = time unless @start_time @start_time = realign(time, start_time) @time = @start_time if @time < @start_time end return nil unless find_acceptable_time_before(closing_time) @uses += 1 if @time @time end
ruby
def next_time(time, start_time, closing_time) @time = time unless @start_time @start_time = realign(time, start_time) @time = @start_time if @time < @start_time end return nil unless find_acceptable_time_before(closing_time) @uses += 1 if @time @time end
[ "def", "next_time", "(", "time", ",", "start_time", ",", "closing_time", ")", "@time", "=", "time", "unless", "@start_time", "@start_time", "=", "realign", "(", "time", ",", "start_time", ")", "@time", "=", "@start_time", "if", "@time", "<", "@start_time", "...
Compute the next time after (or including) the specified time in respect to the given start time
[ "Compute", "the", "next", "time", "after", "(", "or", "including", ")", "the", "specified", "time", "in", "respect", "to", "the", "given", "start", "time" ]
fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd
https://github.com/seejohnrun/ice_cube/blob/fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd/lib/ice_cube/validated_rule.rb#L49-L60
train
Returns the next time in the sequence of time objects.
[ 30522, 13366, 2279, 1035, 2051, 1006, 2051, 1010, 2707, 1035, 2051, 1010, 5494, 1035, 2051, 1007, 1030, 2051, 1027, 2051, 4983, 1030, 2707, 1035, 2051, 1030, 2707, 1035, 2051, 1027, 2613, 23773, 1006, 2051, 1010, 2707, 1035, 2051, 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...
aws/aws-sdk-ruby
gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb
Aws::IAM.Policy.attached_roles
def attached_roles(options = {}) batches = Enumerator.new do |y| options = options.merge( policy_arn: @arn, entity_filter: "Role" ) resp = @client.list_entities_for_policy(options) resp.each_page do |page| batch = [] page.data.policy_roles.each do |p| batch << Role.new( name: p.role_name, data: p, client: @client ) end y.yield(batch) end end Role::Collection.new(batches) end
ruby
def attached_roles(options = {}) batches = Enumerator.new do |y| options = options.merge( policy_arn: @arn, entity_filter: "Role" ) resp = @client.list_entities_for_policy(options) resp.each_page do |page| batch = [] page.data.policy_roles.each do |p| batch << Role.new( name: p.role_name, data: p, client: @client ) end y.yield(batch) end end Role::Collection.new(batches) end
[ "def", "attached_roles", "(", "options", "=", "{", "}", ")", "batches", "=", "Enumerator", ".", "new", "do", "|", "y", "|", "options", "=", "options", ".", "merge", "(", "policy_arn", ":", "@arn", ",", "entity_filter", ":", "\"Role\"", ")", "resp", "="...
@example Request syntax with placeholder values attached_roles = policy.attached_roles({ path_prefix: "pathType", policy_usage_filter: "PermissionsPolicy", # accepts PermissionsPolicy, PermissionsBoundary }) @param [Hash] options ({}) @option options [String] :path_prefix The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities. This parameter allows (through its [regex pattern][1]) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\\u0021) through the DEL character (\\u007F), including most punctuation characters, digits, and upper and lowercased letters. [1]: http://wikipedia.org/wiki/regex @option options [String] :policy_usage_filter The policy usage method to use for filtering the results. To list only permissions policies, set `PolicyUsageFilter` to `PermissionsPolicy`. To list only the policies used to set permissions boundaries, set the value to `PermissionsBoundary`. This parameter is optional. If it is not included, all policies are returned. @return [Role::Collection]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb#L569-L589
train
Returns an array of all the roles attached to this policy
[ 30522, 13366, 4987, 1035, 4395, 1006, 7047, 1027, 1063, 1065, 1007, 14108, 2229, 1027, 4372, 17897, 16259, 1012, 2047, 2079, 1064, 1061, 1064, 7047, 1027, 7047, 1012, 13590, 1006, 3343, 1035, 12098, 2078, 1024, 1030, 12098, 2078, 1010, 9178...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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
spec/support/server_discovery_and_monitoring.rb
Mongo.SDAM.find_server
def find_server(client, address_str) client.cluster.servers_list.detect{ |s| s.address.to_s == address_str } end
ruby
def find_server(client, address_str) client.cluster.servers_list.detect{ |s| s.address.to_s == address_str } end
[ "def", "find_server", "(", "client", ",", "address_str", ")", "client", ".", "cluster", ".", "servers_list", ".", "detect", "{", "|", "s", "|", "s", ".", "address", ".", "to_s", "==", "address_str", "}", "end" ]
Convenience helper to find a server by it's URI. @since 2.0.0
[ "Convenience", "helper", "to", "find", "a", "server", "by", "it", "s", "URI", "." ]
dca26d0870cb3386fad9ccc1d17228097c1fe1c8
https://github.com/mongodb/mongo-ruby-driver/blob/dca26d0870cb3386fad9ccc1d17228097c1fe1c8/spec/support/server_discovery_and_monitoring.rb#L47-L49
train
Find the server with the given address
[ 30522, 13366, 2424, 1035, 8241, 1006, 7396, 1010, 4769, 1035, 2358, 2099, 1007, 7396, 1012, 9324, 1012, 14903, 1035, 2862, 1012, 11487, 1063, 1064, 1055, 1064, 1055, 1012, 4769, 1012, 2000, 1035, 1055, 1027, 1027, 4769, 1035, 2358, 2099, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/cache.rb
Discordrb.Cache.server
def server(id) id = id.resolve_id return @servers[id] if @servers[id] LOGGER.out("Resolving server #{id}") begin response = API::Server.resolve(token, id) rescue Discordrb::Errors::NoPermission return nil end server = Server.new(JSON.parse(response), self) @servers[id] = server end
ruby
def server(id) id = id.resolve_id return @servers[id] if @servers[id] LOGGER.out("Resolving server #{id}") begin response = API::Server.resolve(token, id) rescue Discordrb::Errors::NoPermission return nil end server = Server.new(JSON.parse(response), self) @servers[id] = server end
[ "def", "server", "(", "id", ")", "id", "=", "id", ".", "resolve_id", "return", "@servers", "[", "id", "]", "if", "@servers", "[", "id", "]", "LOGGER", ".", "out", "(", "\"Resolving server #{id}\"", ")", "begin", "response", "=", "API", "::", "Server", ...
Gets a server by its ID. @note This can only resolve servers the bot is currently in. @param id [Integer] The server ID that should be resolved. @return [Server, nil] The server identified by the ID, or `nil` if it couldn't be found.
[ "Gets", "a", "server", "by", "its", "ID", "." ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/cache.rb#L93-L105
train
Returns a server object for the given ID.
[ 30522, 13366, 8241, 1006, 8909, 1007, 8909, 1027, 8909, 1012, 10663, 1035, 8909, 2709, 1030, 14903, 1031, 8909, 1033, 2065, 1030, 14903, 1031, 8909, 1033, 8833, 4590, 1012, 2041, 1006, 1000, 29304, 8241, 1001, 1063, 8909, 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_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb
Azure::StorageSync::Mgmt::V2018_07_01.CloudEndpoints.post_backup
def post_backup(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:nil) response = post_backup_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def post_backup(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:nil) response = post_backup_async(resource_group_name, storage_sync_service_name, sync_group_name, cloud_endpoint_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "post_backup", "(", "resource_group_name", ",", "storage_sync_service_name", ",", "sync_group_name", ",", "cloud_endpoint_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "post_backup_async", "(", "resource_group_name", ",", "sto...
Post Backup a given CloudEndpoint. @param resource_group_name [String] The name of the resource group. The name is case insensitive. @param storage_sync_service_name [String] Name of Storage Sync Service resource. @param sync_group_name [String] Name of Sync Group resource. @param cloud_endpoint_name [String] Name of Cloud Endpoint object. @param parameters [BackupRequest] Body of Backup request. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [PostBackupResponse] operation results.
[ "Post", "Backup", "a", "given", "CloudEndpoint", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_storagesync/lib/2018-07-01/generated/azure_mgmt_storagesync/cloud_endpoints.rb#L405-L408
train
Post backup of a specified cloud endpoint.
[ 30522, 13366, 2695, 1035, 10200, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 5527, 1035, 26351, 1035, 2326, 1035, 2171, 1010, 26351, 1035, 2177, 1035, 2171, 1010, 6112, 1035, 2203, 8400, 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...
sds/overcommit
lib/overcommit/configuration_validator.rb
Overcommit.ConfigurationValidator.check_for_missing_enabled_option
def check_for_missing_enabled_option(hash) return unless @log any_warnings = false Overcommit::Utils.supported_hook_type_classes.each do |hook_type| hash.fetch(hook_type) { {} }.each do |hook_name, hook_config| next if hook_name == 'ALL' if hook_config['enabled'].nil? @log.warning "#{hook_type}::#{hook_name} hook does not explicitly " \ 'set `enabled` option in .overcommit.yml' any_warnings = true end end end @log.newline if any_warnings end
ruby
def check_for_missing_enabled_option(hash) return unless @log any_warnings = false Overcommit::Utils.supported_hook_type_classes.each do |hook_type| hash.fetch(hook_type) { {} }.each do |hook_name, hook_config| next if hook_name == 'ALL' if hook_config['enabled'].nil? @log.warning "#{hook_type}::#{hook_name} hook does not explicitly " \ 'set `enabled` option in .overcommit.yml' any_warnings = true end end end @log.newline if any_warnings end
[ "def", "check_for_missing_enabled_option", "(", "hash", ")", "return", "unless", "@log", "any_warnings", "=", "false", "Overcommit", "::", "Utils", ".", "supported_hook_type_classes", ".", "each", "do", "|", "hook_type", "|", "hash", ".", "fetch", "(", "hook_type"...
Prints a warning if there are any hooks listed in the configuration without `enabled` explicitly set.
[ "Prints", "a", "warning", "if", "there", "are", "any", "hooks", "listed", "in", "the", "configuration", "without", "enabled", "explicitly", "set", "." ]
35d60adb41da942178b789560968e3ad030b0ac7
https://github.com/sds/overcommit/blob/35d60adb41da942178b789560968e3ad030b0ac7/lib/overcommit/configuration_validator.rb#L125-L143
train
Check for missing enabled option in. overcommit. yml
[ 30522, 13366, 4638, 1035, 2005, 1035, 4394, 1035, 9124, 1035, 5724, 1006, 23325, 1007, 2709, 4983, 1030, 8833, 2151, 1035, 16234, 1027, 6270, 2058, 9006, 22930, 1024, 1024, 21183, 12146, 1012, 3569, 1035, 8103, 1035, 2828, 1035, 4280, 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...
roo-rb/roo
lib/roo/excelx.rb
Roo.Excelx.formulas
def formulas(sheet = nil) sheet_for(sheet).cells.select { |_, cell| cell.formula }.map do |(x, y), cell| [x, y, cell.formula] end end
ruby
def formulas(sheet = nil) sheet_for(sheet).cells.select { |_, cell| cell.formula }.map do |(x, y), cell| [x, y, cell.formula] end end
[ "def", "formulas", "(", "sheet", "=", "nil", ")", "sheet_for", "(", "sheet", ")", ".", "cells", ".", "select", "{", "|", "_", ",", "cell", "|", "cell", ".", "formula", "}", ".", "map", "do", "|", "(", "x", ",", "y", ")", ",", "cell", "|", "["...
returns each formula in the selected sheet as an array of tuples in following format [[row, col, formula], [row, col, formula],...]
[ "returns", "each", "formula", "in", "the", "selected", "sheet", "as", "an", "array", "of", "tuples", "in", "following", "format", "[[", "row", "col", "formula", "]", "[", "row", "col", "formula", "]", "...", "]" ]
4ec1104f0c3c2a29711c0c907371cd2be12bcc3c
https://github.com/roo-rb/roo/blob/4ec1104f0c3c2a29711c0c907371cd2be12bcc3c/lib/roo/excelx.rb#L176-L180
train
Returns a list of all the formulas in a given sheet.
[ 30522, 13366, 25814, 1006, 7123, 1027, 9152, 2140, 1007, 7123, 1035, 2005, 1006, 7123, 1007, 1012, 4442, 1012, 7276, 1063, 1064, 1035, 1010, 3526, 1064, 3526, 1012, 5675, 1065, 1012, 4949, 2079, 1064, 1006, 1060, 1010, 1061, 1007, 1010, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
randym/axlsx
lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb
Axlsx.WorksheetHyperlinks.to_xml_string
def to_xml_string(str='') return if empty? str << '<hyperlinks>' each { |hyperlink| hyperlink.to_xml_string(str) } str << '</hyperlinks>' end
ruby
def to_xml_string(str='') return if empty? str << '<hyperlinks>' each { |hyperlink| hyperlink.to_xml_string(str) } str << '</hyperlinks>' end
[ "def", "to_xml_string", "(", "str", "=", "''", ")", "return", "if", "empty?", "str", "<<", "'<hyperlinks>'", "each", "{", "|", "hyperlink", "|", "hyperlink", ".", "to_xml_string", "(", "str", ")", "}", "str", "<<", "'</hyperlinks>'", "end" ]
seralize the collection of hyperlinks @return [String]
[ "seralize", "the", "collection", "of", "hyperlinks" ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb#L31-L36
train
Convert the hyperlinks to XML string.
[ 30522, 13366, 2000, 1035, 20950, 1035, 5164, 1006, 2358, 2099, 1027, 1005, 1005, 1007, 2709, 2065, 4064, 1029, 2358, 2099, 1026, 1026, 1005, 1026, 23760, 13767, 2015, 1028, 1005, 2169, 1063, 1064, 23760, 13767, 30524, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
activeadmin/activeadmin
lib/active_admin/page_dsl.rb
ActiveAdmin.PageDSL.content
def content(options = {}, &block) config.set_page_presenter :index, ActiveAdmin::PagePresenter.new(options, &block) end
ruby
def content(options = {}, &block) config.set_page_presenter :index, ActiveAdmin::PagePresenter.new(options, &block) end
[ "def", "content", "(", "options", "=", "{", "}", ",", "&", "block", ")", "config", ".", "set_page_presenter", ":index", ",", "ActiveAdmin", "::", "PagePresenter", ".", "new", "(", "options", ",", "block", ")", "end" ]
Page content. The block should define the view using Arbre. Example: ActiveAdmin.register "My Page" do content do para "Sweet!" end end
[ "Page", "content", "." ]
0759c8dcf97865748c9344459162ac3c7e65a6cd
https://github.com/activeadmin/activeadmin/blob/0759c8dcf97865748c9344459162ac3c7e65a6cd/lib/active_admin/page_dsl.rb#L17-L19
train
Set the page presenter to be used for the content of the page.
[ 30522, 13366, 4180, 1006, 7047, 1027, 1063, 1065, 1010, 1004, 3796, 1007, 9530, 8873, 2290, 1012, 2275, 1035, 3931, 1035, 10044, 1024, 5950, 1010, 3161, 4215, 10020, 1024, 1024, 3931, 28994, 29110, 1012, 2047, 1006, 7047, 1010, 1004, 3796, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-04-01/generated/azure_mgmt_network/express_route_cross_connections.rb
Azure::Network::Mgmt::V2018_04_01.ExpressRouteCrossConnections.begin_list_routes_table
def begin_list_routes_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) response = begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_list_routes_table(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:nil) response = begin_list_routes_table_async(resource_group_name, cross_connection_name, peering_name, device_path, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_list_routes_table", "(", "resource_group_name", ",", "cross_connection_name", ",", "peering_name", ",", "device_path", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_list_routes_table_async", "(", "resource_group_name", ",", "cross_connection_...
Gets the currently advertised routes table associated with the express route cross connection in a resource group. @param resource_group_name [String] The name of the resource group. @param cross_connection_name [String] The name of the ExpressRouteCrossConnection. @param peering_name [String] The name of the peering. @param device_path [String] The path of the device. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ExpressRouteCircuitsRoutesTableListResult] operation results.
[ "Gets", "the", "currently", "advertised", "routes", "table", "associated", "with", "the", "express", "route", "cross", "connection", "in", "a", "resource", "group", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-04-01/generated/azure_mgmt_network/express_route_cross_connections.rb#L978-L981
train
Gets the route table for the specified ExpressRouteCrossConnection.
[ 30522, 13366, 4088, 1035, 2862, 1035, 5847, 1035, 2795, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2892, 1035, 4434, 1035, 2171, 1010, 16740, 1035, 2171, 1010, 5080, 1035, 4130, 1010, 7661, 1035, 20346, 2015, 1024, 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/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb
Azure::Web::Mgmt::V2018_02_01.AppServiceEnvironments.list_multi_role_usages
def list_multi_role_usages(resource_group_name, name, custom_headers:nil) first_page = list_multi_role_usages_as_lazy(resource_group_name, name, custom_headers:custom_headers) first_page.get_all_items end
ruby
def list_multi_role_usages(resource_group_name, name, custom_headers:nil) first_page = list_multi_role_usages_as_lazy(resource_group_name, name, custom_headers:custom_headers) first_page.get_all_items end
[ "def", "list_multi_role_usages", "(", "resource_group_name", ",", "name", ",", "custom_headers", ":", "nil", ")", "first_page", "=", "list_multi_role_usages_as_lazy", "(", "resource_group_name", ",", "name", ",", "custom_headers", ":custom_headers", ")", "first_page", "...
Get usage metrics for a multi-role pool of an App Service Environment. Get usage metrics for a multi-role pool of an App Service Environment. @param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the App Service Environment. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array<Usage>] operation results.
[ "Get", "usage", "metrics", "for", "a", "multi", "-", "role", "pool", "of", "an", "App", "Service", "Environment", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_web/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb#L2258-L2261
train
Gets all the multi - role usages for a resource group.
[ 30522, 13366, 2862, 1035, 4800, 1035, 2535, 1035, 8192, 2015, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2034, 1035, 3931, 1027, 2862, 1035, 4800, 1035, 2535, 1035, 8192, 2015, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/dsc_compilation_job_operations.rb
Azure::Automation::Mgmt::V2015_10_31.DscCompilationJobOperations.get_stream_with_http_info
def get_stream_with_http_info(resource_group_name, automation_account_name, job_id, job_stream_id, custom_headers:nil) get_stream_async(resource_group_name, automation_account_name, job_id, job_stream_id, custom_headers:custom_headers).value! end
ruby
def get_stream_with_http_info(resource_group_name, automation_account_name, job_id, job_stream_id, custom_headers:nil) get_stream_async(resource_group_name, automation_account_name, job_id, job_stream_id, custom_headers:custom_headers).value! end
[ "def", "get_stream_with_http_info", "(", "resource_group_name", ",", "automation_account_name", ",", "job_id", ",", "job_stream_id", ",", "custom_headers", ":", "nil", ")", "get_stream_async", "(", "resource_group_name", ",", "automation_account_name", ",", "job_id", ",",...
Retrieve the job stream identified by job stream id. @param resource_group_name [String] Name of an Azure Resource group. @param automation_account_name [String] The name of the automation account. @param job_id The job id. @param job_stream_id [String] The job stream id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Retrieve", "the", "job", "stream", "identified", "by", "job", "stream", "id", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/dsc_compilation_job_operations.rb#L363-L365
train
Gets the stream of the specified job.
[ 30522, 13366, 2131, 1035, 5460, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 19309, 1035, 4070, 1035, 2171, 1010, 3105, 1035, 8909, 1010, 3105, 1035, 5460, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
meew0/discordrb
lib/discordrb/commands/rate_limiter.rb
Discordrb::Commands.Bucket.rate_limited?
def rate_limited?(thing, rate_limit_time = nil, increment: 1) key = resolve_key thing limit_hash = @bucket[key] # First case: limit_hash doesn't exist yet unless limit_hash @bucket[key] = { last_time: Time.now, set_time: Time.now, count: increment } return false end # Define the time at which we're being rate limited once so it doesn't get inaccurate rate_limit_time ||= Time.now if @limit && (limit_hash[:count] + increment) > @limit # Second case: Count is over the limit and the time has not run out yet return (limit_hash[:set_time] + @time_span) - rate_limit_time if @time_span && rate_limit_time < (limit_hash[:set_time] + @time_span) # Third case: Count is over the limit but the time has run out # Don't return anything here because there may still be delay-based limiting limit_hash[:set_time] = rate_limit_time limit_hash[:count] = 0 end if @delay && rate_limit_time < (limit_hash[:last_time] + @delay) # Fourth case: we're being delayed (limit_hash[:last_time] + @delay) - rate_limit_time else # Fifth case: no rate limiting at all! Increment the count, set the last_time, and return false limit_hash[:last_time] = rate_limit_time limit_hash[:count] += increment false end end
ruby
def rate_limited?(thing, rate_limit_time = nil, increment: 1) key = resolve_key thing limit_hash = @bucket[key] # First case: limit_hash doesn't exist yet unless limit_hash @bucket[key] = { last_time: Time.now, set_time: Time.now, count: increment } return false end # Define the time at which we're being rate limited once so it doesn't get inaccurate rate_limit_time ||= Time.now if @limit && (limit_hash[:count] + increment) > @limit # Second case: Count is over the limit and the time has not run out yet return (limit_hash[:set_time] + @time_span) - rate_limit_time if @time_span && rate_limit_time < (limit_hash[:set_time] + @time_span) # Third case: Count is over the limit but the time has run out # Don't return anything here because there may still be delay-based limiting limit_hash[:set_time] = rate_limit_time limit_hash[:count] = 0 end if @delay && rate_limit_time < (limit_hash[:last_time] + @delay) # Fourth case: we're being delayed (limit_hash[:last_time] + @delay) - rate_limit_time else # Fifth case: no rate limiting at all! Increment the count, set the last_time, and return false limit_hash[:last_time] = rate_limit_time limit_hash[:count] += increment false end end
[ "def", "rate_limited?", "(", "thing", ",", "rate_limit_time", "=", "nil", ",", "increment", ":", "1", ")", "key", "=", "resolve_key", "thing", "limit_hash", "=", "@bucket", "[", "key", "]", "# First case: limit_hash doesn't exist yet", "unless", "limit_hash", "@bu...
Performs a rate limiting request @param thing [#resolve_id, Integer, Symbol] The particular thing that should be rate-limited (usually a user/channel, but you can also choose arbitrary integers or symbols) @param rate_limit_time [Time] The time to base the rate limiting on, only useful for testing. @param increment [Integer] How much to increment the rate-limit counter. Default is 1. @return [Integer, false] the waiting time until the next request, in seconds, or false if the request succeeded
[ "Performs", "a", "rate", "limiting", "request" ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/commands/rate_limiter.rb#L42-L79
train
Returns true if the given thing is rate limited.
[ 30522, 13366, 3446, 1035, 3132, 1029, 1006, 2518, 1010, 3446, 1035, 5787, 1035, 2051, 1027, 9152, 2140, 1010, 4297, 28578, 4765, 1024, 1015, 1007, 3145, 1027, 10663, 1035, 3145, 2518, 5787, 1035, 23325, 1027, 1030, 13610, 1031, 3145, 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...
mojombo/chronic
lib/chronic/handlers.rb
Chronic.Handlers.handle_s_r_p_a
def handle_s_r_p_a(tokens, options) anchor_span = get_anchor(tokens[3..tokens.size - 1], options) handle_srp(tokens, anchor_span, options) end
ruby
def handle_s_r_p_a(tokens, options) anchor_span = get_anchor(tokens[3..tokens.size - 1], options) handle_srp(tokens, anchor_span, options) end
[ "def", "handle_s_r_p_a", "(", "tokens", ",", "options", ")", "anchor_span", "=", "get_anchor", "(", "tokens", "[", "3", "..", "tokens", ".", "size", "-", "1", "]", ",", "options", ")", "handle_srp", "(", "tokens", ",", "anchor_span", ",", "options", ")",...
Handle scalar/repeater/pointer/anchor
[ "Handle", "scalar", "/", "repeater", "/", "pointer", "/", "anchor" ]
2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c
https://github.com/mojombo/chronic/blob/2b1eae7ec440d767c09e0b1a7f0e9bcf30ce1d6c/lib/chronic/handlers.rb#L468-L471
train
Handles the SRP and SRP tokens.
[ 30522, 13366, 5047, 1035, 1055, 1035, 1054, 1035, 1052, 1035, 1037, 1006, 19204, 2015, 1010, 7047, 1007, 8133, 1035, 8487, 1027, 2131, 1035, 8133, 1006, 19204, 2015, 1031, 1017, 1012, 1012, 19204, 2015, 1012, 2946, 1011, 1015, 1033, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_customvisionprediction/lib/2.0/generated/azure_cognitiveservices_customvisionprediction/customvisionprediction_client.rb
Azure::CognitiveServices::Customvisionprediction::V2_0.CustomvisionpredictionClient.predict_image
def predict_image(project_id, image_data, iteration_id:nil, application:nil, custom_headers:nil) response = predict_image_async(project_id, image_data, iteration_id:iteration_id, application:application, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def predict_image(project_id, image_data, iteration_id:nil, application:nil, custom_headers:nil) response = predict_image_async(project_id, image_data, iteration_id:iteration_id, application:application, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "predict_image", "(", "project_id", ",", "image_data", ",", "iteration_id", ":", "nil", ",", "application", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "predict_image_async", "(", "project_id", ",", "image_data", ",", "iteration_i...
Predict an image and saves the result @param project_id The project id @param image_data @param iteration_id Optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified @param application [String] Optional. Specifies the name of application using the endpoint @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ImagePrediction] operation results.
[ "Predict", "an", "image", "and", "saves", "the", "result" ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisionprediction/lib/2.0/generated/azure_cognitiveservices_customvisionprediction/customvisionprediction_client.rb#L248-L251
train
Predict a given image.
[ 30522, 13366, 16014, 1035, 3746, 1006, 2622, 1035, 8909, 1010, 3746, 1035, 2951, 1010, 27758, 1035, 8909, 1024, 9152, 2140, 1010, 4646, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 16014, 1035, 3746, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.metrics
def metrics(options = {}) batches = Enumerator.new do |y| resp = @client.list_metrics(options) resp.each_page do |page| batch = [] page.data.metrics.each do |m| batch << Metric.new( namespace: m.namespace, name: m.metric_name, data: m, client: @client ) end y.yield(batch) end end Metric::Collection.new(batches) end
ruby
def metrics(options = {}) batches = Enumerator.new do |y| resp = @client.list_metrics(options) resp.each_page do |page| batch = [] page.data.metrics.each do |m| batch << Metric.new( namespace: m.namespace, name: m.metric_name, data: m, client: @client ) end y.yield(batch) end end Metric::Collection.new(batches) end
[ "def", "metrics", "(", "options", "=", "{", "}", ")", "batches", "=", "Enumerator", ".", "new", "do", "|", "y", "|", "resp", "=", "@client", ".", "list_metrics", "(", "options", ")", "resp", ".", "each_page", "do", "|", "page", "|", "batch", "=", "...
@example Request syntax with placeholder values metrics = cloud_watch.metrics({ namespace: "Namespace", metric_name: "MetricName", dimensions: [ { name: "DimensionName", # required value: "DimensionValue", }, ], }) @param [Hash] options ({}) @option options [String] :namespace The namespace to filter against. @option options [String] :metric_name The name of the metric to filter against. @option options [Array<Types::DimensionFilter>] :dimensions The dimensions to filter against. @return [Metric::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#L101-L118
train
Returns a list of all metrics in the cluster
[ 30522, 13366, 12046, 2015, 1006, 7047, 1027, 1063, 1065, 1007, 14108, 2229, 1027, 4372, 17897, 16259, 1012, 2047, 2079, 1064, 1061, 1064, 24501, 2361, 1027, 1030, 7396, 1012, 2862, 1035, 12046, 2015, 1006, 7047, 1007, 24501, 2361, 1012, 216...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sunspot/sunspot
sunspot/lib/sunspot/setup.rb
Sunspot.Setup.add_dynamic_field_factory
def add_dynamic_field_factory(name, type, options = {}, &block) stored, more_like_this = options[:stored], options[:more_like_this] field_factory = FieldFactory::Dynamic.new(name, type, options, &block) @dynamic_field_factories[field_factory.signature] = field_factory @dynamic_field_factories_cache[field_factory.name] = field_factory if stored @stored_field_factories_cache[field_factory.name] << field_factory end if more_like_this @more_like_this_field_factories_cache[field_factory.name] << field_factory end end
ruby
def add_dynamic_field_factory(name, type, options = {}, &block) stored, more_like_this = options[:stored], options[:more_like_this] field_factory = FieldFactory::Dynamic.new(name, type, options, &block) @dynamic_field_factories[field_factory.signature] = field_factory @dynamic_field_factories_cache[field_factory.name] = field_factory if stored @stored_field_factories_cache[field_factory.name] << field_factory end if more_like_this @more_like_this_field_factories_cache[field_factory.name] << field_factory end end
[ "def", "add_dynamic_field_factory", "(", "name", ",", "type", ",", "options", "=", "{", "}", ",", "&", "block", ")", "stored", ",", "more_like_this", "=", "options", "[", ":stored", "]", ",", "options", "[", ":more_like_this", "]", "field_factory", "=", "F...
Add dynamic field_factories ==== Parameters field_factories<Array>:: Array of dynamic field objects
[ "Add", "dynamic", "field_factories" ]
31dd76cd7a14a4ef7bd541de97483d8cd72ff685
https://github.com/sunspot/sunspot/blob/31dd76cd7a14a4ef7bd541de97483d8cd72ff685/sunspot/lib/sunspot/setup.rb#L79-L90
train
Adds a dynamic field factory to the registry.
[ 30522, 13366, 5587, 1035, 8790, 1035, 2492, 1035, 4713, 1006, 2171, 1010, 2828, 1010, 7047, 1027, 1063, 1065, 1010, 1004, 3796, 1007, 8250, 1010, 2062, 1035, 2066, 1035, 2023, 1027, 7047, 1031, 1024, 8250, 1033, 1010, 7047, 1031, 1024, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
piotrmurach/github
lib/github_api/client/orgs/teams.rb
Github.Client::Orgs::Teams.team_repo?
def team_repo?(*args) arguments(args, required: [:id, :user, :repo]) response = get_request("/teams/#{arguments.id}/repos/#{arguments.user}/#{arguments.repo}", arguments.params) response.status == 204 rescue Github::Error::NotFound false end
ruby
def team_repo?(*args) arguments(args, required: [:id, :user, :repo]) response = get_request("/teams/#{arguments.id}/repos/#{arguments.user}/#{arguments.repo}", arguments.params) response.status == 204 rescue Github::Error::NotFound false end
[ "def", "team_repo?", "(", "*", "args", ")", "arguments", "(", "args", ",", "required", ":", "[", ":id", ",", ":user", ",", ":repo", "]", ")", "response", "=", "get_request", "(", "\"/teams/#{arguments.id}/repos/#{arguments.user}/#{arguments.repo}\"", ",", "argumen...
Check if a repository belongs to a team @see https://developer.github.com/v3/orgs/teams/#get-team-repo @example github = Github.new oauth_token: '...' github.orgs.teams.team_repo? 'team-id', 'user-name', 'repo-name' @api public
[ "Check", "if", "a", "repository", "belongs", "to", "a", "team" ]
8702452c66bea33c9388550aed9e9974f76aaef1
https://github.com/piotrmurach/github/blob/8702452c66bea33c9388550aed9e9974f76aaef1/lib/github_api/client/orgs/teams.rb#L356-L363
train
Check if a team has a repository on a team
[ 30522, 13366, 2136, 1035, 16360, 2080, 1029, 1006, 1008, 12098, 5620, 1007, 9918, 1006, 12098, 5620, 1010, 3223, 1024, 1031, 1024, 8909, 1010, 1024, 30524, 1063, 9918, 1012, 8909, 1065, 1013, 16360, 2891, 1013, 1001, 1063, 9918, 1012, 5310,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Katello/katello
app/controllers/katello/sync_management_controller.rb
Katello.SyncManagementController.sync_repos
def sync_repos(repo_ids) collected = [] repos = Repository.where(:id => repo_ids).syncable repos.each do |repo| if latest_task(repo).try(:state) != 'running' ForemanTasks.async_task(::Actions::Katello::Repository::Sync, repo) end collected << format_sync_progress(repo) end collected end
ruby
def sync_repos(repo_ids) collected = [] repos = Repository.where(:id => repo_ids).syncable repos.each do |repo| if latest_task(repo).try(:state) != 'running' ForemanTasks.async_task(::Actions::Katello::Repository::Sync, repo) end collected << format_sync_progress(repo) end collected end
[ "def", "sync_repos", "(", "repo_ids", ")", "collected", "=", "[", "]", "repos", "=", "Repository", ".", "where", "(", ":id", "=>", "repo_ids", ")", ".", "syncable", "repos", ".", "each", "do", "|", "repo", "|", "if", "latest_task", "(", "repo", ")", ...
loop through checkbox list of products and sync
[ "loop", "through", "checkbox", "list", "of", "products", "and", "sync" ]
a1c9280067607999cae43bab89b53ba870856b76
https://github.com/Katello/katello/blob/a1c9280067607999cae43bab89b53ba870856b76/app/controllers/katello/sync_management_controller.rb#L62-L72
train
Sync a list of repos
[ 30522, 13366, 26351, 1035, 16360, 2891, 1006, 16360, 2080, 1035, 8909, 2015, 1007, 5067, 1027, 1031, 1033, 16360, 2891, 1027, 22409, 1012, 2073, 1006, 1024, 8909, 1027, 1028, 16360, 2080, 1035, 8909, 2015, 1007, 1012, 26351, 3085, 16360, 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...
aws/aws-sdk-ruby
gems/aws-sdk-sqs/lib/aws-sdk-sqs/queue.rb
Aws::SQS.Queue.receive_messages
def receive_messages(options = {}) batch = [] options = options.merge(queue_url: @url) resp = @client.receive_message(options) resp.data.messages.each do |m| batch << Message.new( queue_url: @url, receipt_handle: m.receipt_handle, data: m, client: @client ) end Message::Collection.new([batch], size: batch.size) end
ruby
def receive_messages(options = {}) batch = [] options = options.merge(queue_url: @url) resp = @client.receive_message(options) resp.data.messages.each do |m| batch << Message.new( queue_url: @url, receipt_handle: m.receipt_handle, data: m, client: @client ) end Message::Collection.new([batch], size: batch.size) end
[ "def", "receive_messages", "(", "options", "=", "{", "}", ")", "batch", "=", "[", "]", "options", "=", "options", ".", "merge", "(", "queue_url", ":", "@url", ")", "resp", "=", "@client", ".", "receive_message", "(", "options", ")", "resp", ".", "data"...
@example Request syntax with placeholder values message = queue.receive_messages({ attribute_names: ["All"], # accepts All, Policy, VisibilityTimeout, MaximumMessageSize, MessageRetentionPeriod, ApproximateNumberOfMessages, ApproximateNumberOfMessagesNotVisible, CreatedTimestamp, LastModifiedTimestamp, QueueArn, ApproximateNumberOfMessagesDelayed, DelaySeconds, ReceiveMessageWaitTimeSeconds, RedrivePolicy, FifoQueue, ContentBasedDeduplication, KmsMasterKeyId, KmsDataKeyReusePeriodSeconds message_attribute_names: ["MessageAttributeName"], max_number_of_messages: 1, visibility_timeout: 1, wait_time_seconds: 1, receive_request_attempt_id: "String", }) @param [Hash] options ({}) @option options [Array<String>] :attribute_names A list of s that need to be returned along with each message. These attributes include: * `All` - Returns all values. * `ApproximateFirstReceiveTimestamp` - Returns the time the message was first received from the queue ([epoch time][1] in milliseconds). * `ApproximateReceiveCount` - Returns the number of times a message has been received from the queue but not deleted. * `SenderId` * For an IAM user, returns the IAM user ID, for example `ABCDEFGHI1JKLMNOPQ23R`. * For an IAM role, returns the IAM role ID, for example `ABCDE1F2GH3I4JK5LMNOP:i-a123b456`. * `SentTimestamp` - Returns the time the message was sent to the queue ([epoch time][1] in milliseconds). * `MessageDeduplicationId` - Returns the value provided by the producer that calls the ` SendMessage ` action. * `MessageGroupId` - Returns the value provided by the producer that calls the ` SendMessage ` action. Messages with the same `MessageGroupId` are returned in sequence. * `SequenceNumber` - Returns the value provided by Amazon SQS. [1]: http://en.wikipedia.org/wiki/Unix_time @option options [Array<String>] :message_attribute_names The name of the message attribute, where *N* is the index. * The name can contain alphanumeric characters and the underscore (`_`), hyphen (`-`), and period (`.`). * The name is case-sensitive and must be unique among all attribute names for the message. * The name must not start with AWS-reserved prefixes such as `AWS.` or `Amazon.` (or any casing variants). * The name must not start or end with a period (`.`), and it should not have periods in succession (`..`). * The name can be up to 256 characters long. When using `ReceiveMessage`, you can send a list of attribute names to receive, or you can return all of the attributes by specifying `All` or `.*` in your request. You can also use all message attributes starting with a prefix, for example `bar.*`. @option options [Integer] :max_number_of_messages The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1. @option options [Integer] :visibility_timeout The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a `ReceiveMessage` request. @option options [Integer] :wait_time_seconds The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than `WaitTimeSeconds`. If no messages are available and the wait time expires, the call returns successfully with an empty list of messages. @option options [String] :receive_request_attempt_id This parameter applies only to FIFO (first-in-first-out) queues. The token used for deduplication of `ReceiveMessage` calls. If a networking issue occurs after a `ReceiveMessage` action, and instead of a response you receive a generic error, you can retry the same action with an identical `ReceiveRequestAttemptId` to retrieve the same set of messages, even if their visibility timeout has not yet expired. * You can use `ReceiveRequestAttemptId` only for 5 minutes after a `ReceiveMessage` action. * When you set `FifoQueue`, a caller of the `ReceiveMessage` action can provide a `ReceiveRequestAttemptId` explicitly. * If a caller of the `ReceiveMessage` action doesn't provide a `ReceiveRequestAttemptId`, Amazon SQS generates a `ReceiveRequestAttemptId`. * You can retry the `ReceiveMessage` action with the same `ReceiveRequestAttemptId` if none of the messages have been modified (deleted or had their visibility changes). * During a visibility timeout, subsequent calls with the same `ReceiveRequestAttemptId` return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see [Visibility Timeout][1] in the *Amazon Simple Queue Service Developer Guide*. If a caller of the `ReceiveMessage` action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error. To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary. * While messages with a particular `MessageGroupId` are invisible, no more messages belonging to the same `MessageGroupId` are returned until the visibility timeout expires. You can still receive messages with another `MessageGroupId` as long as it is also visible. * If a caller of `ReceiveMessage` can't track the `ReceiveRequestAttemptId`, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order. The length of `ReceiveRequestAttemptId` is 128 characters. `ReceiveRequestAttemptId` can contain alphanumeric characters (`a-z`, `A-Z`, `0-9`) and punctuation (`` !"#$%&'()*+,-./:;<=>?@[\]^_`\{|\}~ ``). For best practices of using `ReceiveRequestAttemptId`, see [Using the ReceiveRequestAttemptId Request Parameter][2] in the *Amazon Simple Queue Service Developer Guide*. [1]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html [2]: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html @return [Message::Collection]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-sqs/lib/aws-sdk-sqs/queue.rb#L337-L350
train
Receive messages from the queue
[ 30522, 13366, 4374, 1035, 7696, 1006, 7047, 1027, 1063, 1065, 1007, 14108, 1027, 1031, 1033, 7047, 1027, 7047, 1012, 13590, 1006, 24240, 1035, 24471, 2140, 1024, 1030, 24471, 2140, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 4374, 1035, 4471...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/persistence.rb
ActiveRecord.Persistence._update_record
def _update_record(attribute_names = self.attribute_names) attribute_names = attributes_for_update(attribute_names) if attribute_names.empty? affected_rows = 0 @_trigger_update_callback = true else affected_rows = _update_row(attribute_names) @_trigger_update_callback = affected_rows == 1 end yield(self) if block_given? affected_rows end
ruby
def _update_record(attribute_names = self.attribute_names) attribute_names = attributes_for_update(attribute_names) if attribute_names.empty? affected_rows = 0 @_trigger_update_callback = true else affected_rows = _update_row(attribute_names) @_trigger_update_callback = affected_rows == 1 end yield(self) if block_given? affected_rows end
[ "def", "_update_record", "(", "attribute_names", "=", "self", ".", "attribute_names", ")", "attribute_names", "=", "attributes_for_update", "(", "attribute_names", ")", "if", "attribute_names", ".", "empty?", "affected_rows", "=", "0", "@_trigger_update_callback", "=", ...
Updates the associated record with values matching those of the instance attributes. Returns the number of affected rows.
[ "Updates", "the", "associated", "record", "with", "values", "matching", "those", "of", "the", "instance", "attributes", ".", "Returns", "the", "number", "of", "affected", "rows", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/persistence.rb#L907-L921
train
Update the record with the attributes specified.
[ 30522, 13366, 1035, 10651, 1035, 2501, 1006, 17961, 1035, 3415, 1027, 2969, 1012, 17961, 1035, 3415, 1007, 17961, 1035, 3415, 1027, 12332, 1035, 2005, 1035, 10651, 1006, 17961, 1035, 3415, 1007, 2065, 17961, 1035, 3415, 1012, 4064, 1029, 53...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.process_file
def process_file(file, report) lints = collect_lints(file, linter_selector, config) lints.each { |lint| report.add_lint(lint) } report.finish_file(file, lints) end
ruby
def process_file(file, report) lints = collect_lints(file, linter_selector, config) lints.each { |lint| report.add_lint(lint) } report.finish_file(file, lints) end
[ "def", "process_file", "(", "file", ",", "report", ")", "lints", "=", "collect_lints", "(", "file", ",", "linter_selector", ",", "config", ")", "lints", ".", "each", "{", "|", "lint", "|", "report", ".", "add_lint", "(", "lint", ")", "}", "report", "."...
Process a file and add it to the given report. @param file [String] the name of the file to process @param report [HamlLint::Report] @return [void]
[ "Process", "a", "file", "and", "add", "it", "to", "the", "given", "report", "." ]
024c773667e54cf88db938c2b368977005d70ee8
https://github.com/sds/haml-lint/blob/024c773667e54cf88db938c2b368977005d70ee8/lib/haml_lint/runner.rb#L123-L127
train
Process a single file
[ 30522, 13366, 2832, 1035, 5371, 1006, 5371, 1010, 3189, 1007, 11409, 3215, 1027, 8145, 1035, 11409, 3215, 1006, 5371, 1010, 11409, 3334, 1035, 27000, 1010, 9530, 8873, 2290, 1007, 11409, 3215, 1012, 2169, 1063, 1064, 11409, 2102, 1064, 3189...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_partition_health_with_http_info
def get_partition_health_with_http_info(partition_id, events_health_state_filter:0, replicas_health_state_filter:0, exclude_health_statistics:false, timeout:60, custom_headers:nil) get_partition_health_async(partition_id, events_health_state_filter:events_health_state_filter, replicas_health_state_filter:replicas_health_state_filter, exclude_health_statistics:exclude_health_statistics, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def get_partition_health_with_http_info(partition_id, events_health_state_filter:0, replicas_health_state_filter:0, exclude_health_statistics:false, timeout:60, custom_headers:nil) get_partition_health_async(partition_id, events_health_state_filter:events_health_state_filter, replicas_health_state_filter:replicas_health_state_filter, exclude_health_statistics:exclude_health_statistics, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "get_partition_health_with_http_info", "(", "partition_id", ",", "events_health_state_filter", ":", "0", ",", "replicas_health_state_filter", ":", "0", ",", "exclude_health_statistics", ":", "false", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ...
Gets the health of the specified Service Fabric partition. Gets the health information of the specified partition. Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health state. Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. If you specify a partition that does not exist in the health store, this request returns an error. @param partition_id The identity of the partition. @param events_health_state_filter [Integer] Allows filtering the collection of HealthEvent objects returned based on health state. The possible values for this parameter include integer value of one of the following health states. Only events that match the filter are returned. All events are used to evaluate the aggregated health state. If not specified, all entries are returned. The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param replicas_health_state_filter [Integer] Allows filtering the collection of ReplicaHealthState objects on the partition. The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas that match the filter will be returned. All replicas will be used to evaluate the aggregated health state. If not specified, all entries will be returned.The state values are flag based enumeration, so the value could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The possible values for this parameter include integer value of one of the following health states. - Default - Default value. Matches any HealthState. The value is zero. - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given collection of states. The value is 1. - Ok - Filter that matches input with HealthState value Ok. The value is 2. - Warning - Filter that matches input with HealthState value Warning. The value is 4. - Error - Filter that matches input with HealthState value Error. The value is 8. - All - Filter that matches input with any HealthState value. The value is 65535. @param exclude_health_statistics [Boolean] Indicates whether the health statistics should be returned as part of the query result. False by default. The statistics show the number of children entities in health state Ok, Warning, and Error. @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", "health", "of", "the", "specified", "Service", "Fabric", "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#L12325-L12327
train
Gets the health of the specified partition.
[ 30522, 13366, 2131, 1035, 13571, 1035, 2740, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 13571, 1035, 8909, 1010, 2824, 1035, 2740, 1035, 2110, 1035, 11307, 1024, 1014, 1010, 15059, 2015, 1035, 2740, 1035, 2110, 1035, 11307, 1024, 1014, 1010...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rails/rails
activerecord/lib/active_record/relation/query_methods.rb
ActiveRecord.QueryMethods.where
def where(opts = :chain, *rest) if :chain == opts WhereChain.new(spawn) elsif opts.blank? self else spawn.where!(opts, *rest) end end
ruby
def where(opts = :chain, *rest) if :chain == opts WhereChain.new(spawn) elsif opts.blank? self else spawn.where!(opts, *rest) end end
[ "def", "where", "(", "opts", "=", ":chain", ",", "*", "rest", ")", "if", ":chain", "==", "opts", "WhereChain", ".", "new", "(", "spawn", ")", "elsif", "opts", ".", "blank?", "self", "else", "spawn", ".", "where!", "(", "opts", ",", "rest", ")", "en...
Returns a new relation, which is the result of filtering the current relation according to the conditions in the arguments. #where accepts conditions in one of several formats. In the examples below, the resulting SQL is given as an illustration; the actual query generated may be different depending on the database adapter. === string A single string, without additional arguments, is passed to the query constructor as an SQL fragment, and used in the where clause of the query. Client.where("orders_count = '2'") # SELECT * from clients where orders_count = '2'; Note that building your own string from user input may expose your application to injection attacks if not done properly. As an alternative, it is recommended to use one of the following methods. === array If an array is passed, then the first element of the array is treated as a template, and the remaining elements are inserted into the template to generate the condition. Active Record takes care of building the query to avoid injection attacks, and will convert from the ruby type to the database type where needed. Elements are inserted into the string in the order in which they appear. User.where(["name = ? and email = ?", "Joe", "joe@example.com"]) # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'; Alternatively, you can use named placeholders in the template, and pass a hash as the second element of the array. The names in the template are replaced with the corresponding values from the hash. User.where(["name = :name and email = :email", { name: "Joe", email: "joe@example.com" }]) # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'; This can make for more readable code in complex queries. Lastly, you can use sprintf-style % escapes in the template. This works slightly differently than the previous methods; you are responsible for ensuring that the values in the template are properly quoted. The values are passed to the connector for quoting, but the caller is responsible for ensuring they are enclosed in quotes in the resulting SQL. After quoting, the values are inserted using the same escapes as the Ruby core method +Kernel::sprintf+. User.where(["name = '%s' and email = '%s'", "Joe", "joe@example.com"]) # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'; If #where is called with multiple arguments, these are treated as if they were passed as the elements of a single array. User.where("name = :name and email = :email", { name: "Joe", email: "joe@example.com" }) # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com'; When using strings to specify conditions, you can use any operator available from the database. While this provides the most flexibility, you can also unintentionally introduce dependencies on the underlying database. If your code is intended for general consumption, test with multiple database backends. === hash #where will also accept a hash condition, in which the keys are fields and the values are values to be searched for. Fields can be symbols or strings. Values can be single values, arrays, or ranges. User.where({ name: "Joe", email: "joe@example.com" }) # SELECT * FROM users WHERE name = 'Joe' AND email = 'joe@example.com' User.where({ name: ["Alice", "Bob"]}) # SELECT * FROM users WHERE name IN ('Alice', 'Bob') User.where({ created_at: (Time.now.midnight - 1.day)..Time.now.midnight }) # SELECT * FROM users WHERE (created_at BETWEEN '2012-06-09 07:00:00.000000' AND '2012-06-10 07:00:00.000000') In the case of a belongs_to relationship, an association key can be used to specify the model if an ActiveRecord object is used as the value. author = Author.find(1) # The following queries will be equivalent: Post.where(author: author) Post.where(author_id: author) This also works with polymorphic belongs_to relationships: treasure = Treasure.create(name: 'gold coins') treasure.price_estimates << PriceEstimate.create(price: 125) # The following queries will be equivalent: PriceEstimate.where(estimate_of: treasure) PriceEstimate.where(estimate_of_type: 'Treasure', estimate_of_id: treasure) === Joins If the relation is the result of a join, you may create a condition which uses any of the tables in the join. For string and array conditions, use the table name in the condition. User.joins(:posts).where("posts.created_at < ?", Time.now) For hash conditions, you can either use the table name in the key, or use a sub-hash. User.joins(:posts).where({ "posts.published" => true }) User.joins(:posts).where({ posts: { published: true } }) === no argument If no argument is passed, #where returns a new instance of WhereChain, that can be chained with #not to return a new relation that negates the where clause. User.where.not(name: "Jon") # SELECT * FROM users WHERE name != 'Jon' See WhereChain for more details on #not. === blank condition If the condition is any blank-ish object, then #where is a no-op and returns the current relation.
[ "Returns", "a", "new", "relation", "which", "is", "the", "result", "of", "filtering", "the", "current", "relation", "according", "to", "the", "conditions", "in", "the", "arguments", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/relation/query_methods.rb#L632-L640
train
Returns the where clause for this query.
[ 30522, 13366, 2073, 1006, 23569, 2015, 1027, 1024, 4677, 1010, 1008, 2717, 1007, 2065, 1024, 4677, 1027, 1027, 23569, 2015, 2073, 24925, 2078, 1012, 2047, 1006, 25645, 1007, 3449, 5332, 2546, 23569, 2015, 1012, 8744, 1029, 2969, 2842, 25645...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.backup_partition
def backup_partition(partition_id, backup_partition_description:nil, backup_timeout:10, timeout:60, custom_headers:nil) response = backup_partition_async(partition_id, backup_partition_description:backup_partition_description, backup_timeout:backup_timeout, timeout:timeout, custom_headers:custom_headers).value! nil end
ruby
def backup_partition(partition_id, backup_partition_description:nil, backup_timeout:10, timeout:60, custom_headers:nil) response = backup_partition_async(partition_id, backup_partition_description:backup_partition_description, backup_timeout:backup_timeout, timeout:timeout, custom_headers:custom_headers).value! nil end
[ "def", "backup_partition", "(", "partition_id", ",", "backup_partition_description", ":", "nil", ",", "backup_timeout", ":", "10", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "response", "=", "backup_partition_async", "(", "partition_id", ",...
Triggers backup of the partition's state. Creates a backup of the stateful persisted partition's state. In case the partition is already being periodically backed up, then by default the new backup is created at the same backup storage. One can also override the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its progress can be tracked using the GetBackupProgress operation. In case, the operation times out, specify a greater backup timeout value in the query parameter. @param partition_id The identity of the partition. @param backup_partition_description [BackupPartitionDescription] Describes the parameters to backup the partition now. If not present, backup operation uses default parameters from the backup policy current associated with this partition. @param backup_timeout [Integer] Specifies the maximum amount of time, in minutes, to wait for the backup operation to complete. Post that, the operation completes with timeout error. However, in certain corner cases it could be that though the operation returns back timeout, the backup actually goes through. In case of timeout error, its recommended to invoke this operation again with a greater timeout value. The default value for the same is 10 minutes. @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.
[ "Triggers", "backup", "of", "the", "partition", "s", "state", "." ]
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#L25433-L25436
train
Backup a partition.
[ 30522, 13366, 10200, 1035, 13571, 1006, 13571, 1035, 8909, 1010, 10200, 1035, 13571, 1035, 6412, 1024, 9152, 2140, 1010, 10200, 1035, 2051, 5833, 1024, 2184, 1010, 2051, 5833, 1024, 3438, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sunspot/sunspot
sunspot/lib/sunspot/session.rb
Sunspot.Session.remove_all
def remove_all(*classes) classes.flatten! if classes.empty? @deletes += 1 indexer.remove_all else @deletes += classes.length classes.each { |clazz| indexer.remove_all(clazz) } end end
ruby
def remove_all(*classes) classes.flatten! if classes.empty? @deletes += 1 indexer.remove_all else @deletes += classes.length classes.each { |clazz| indexer.remove_all(clazz) } end end
[ "def", "remove_all", "(", "*", "classes", ")", "classes", ".", "flatten!", "if", "classes", ".", "empty?", "@deletes", "+=", "1", "indexer", ".", "remove_all", "else", "@deletes", "+=", "classes", ".", "length", "classes", ".", "each", "{", "|", "clazz", ...
See Sunspot.remove_all
[ "See", "Sunspot", ".", "remove_all" ]
31dd76cd7a14a4ef7bd541de97483d8cd72ff685
https://github.com/sunspot/sunspot/blob/31dd76cd7a14a4ef7bd541de97483d8cd72ff685/sunspot/lib/sunspot/session.rb#L190-L199
train
Remove all the classes from the index
[ 30522, 13366, 6366, 1035, 2035, 1006, 1008, 4280, 1007, 4280, 1012, 4257, 6528, 999, 2065, 4280, 1012, 4064, 1029, 1030, 3972, 12870, 2015, 1009, 1027, 1015, 5950, 2121, 1012, 6366, 1035, 2035, 2842, 1030, 3972, 12870, 2015, 1009, 1027, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/streaming_endpoints.rb
Azure::MediaServices::Mgmt::V2018_07_01.StreamingEndpoints.begin_scale_with_http_info
def begin_scale_with_http_info(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:nil) begin_scale_async(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:custom_headers).value! end
ruby
def begin_scale_with_http_info(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:nil) begin_scale_async(resource_group_name, account_name, streaming_endpoint_name, parameters, custom_headers:custom_headers).value! end
[ "def", "begin_scale_with_http_info", "(", "resource_group_name", ",", "account_name", ",", "streaming_endpoint_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "begin_scale_async", "(", "resource_group_name", ",", "account_name", ",", "streaming_endpoint_na...
Scale StreamingEndpoint Scales an existing StreamingEndpoint. @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 streaming_endpoint_name [String] The name of the StreamingEndpoint. @param parameters [StreamingEntityScaleUnit] StreamingEndpoint scale parameters @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.
[ "Scale", "StreamingEndpoint" ]
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/streaming_endpoints.rb#L1118-L1120
train
Scale a streaming endpoint to a maximum size of a streaming endpoint.
[ 30522, 13366, 4088, 1035, 4094, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 4070, 1035, 2171, 1010, 11058, 1035, 2203, 8400, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rails/rails
actionpack/lib/action_controller/renderer.rb
ActionController.Renderer.render
def render(*args) raise "missing controller" unless controller request = ActionDispatch::Request.new @env request.routes = controller._routes instance = controller.new instance.set_request! request instance.set_response! controller.make_response!(request) instance.render_to_string(*args) end
ruby
def render(*args) raise "missing controller" unless controller request = ActionDispatch::Request.new @env request.routes = controller._routes instance = controller.new instance.set_request! request instance.set_response! controller.make_response!(request) instance.render_to_string(*args) end
[ "def", "render", "(", "*", "args", ")", "raise", "\"missing controller\"", "unless", "controller", "request", "=", "ActionDispatch", "::", "Request", ".", "new", "@env", "request", ".", "routes", "=", "controller", ".", "_routes", "instance", "=", "controller", ...
Accepts a custom Rack environment to render templates in. It will be merged with the default Rack environment defined by +ActionController::Renderer::DEFAULTS+. Render templates with any options from ActionController::Base#render_to_string. The primary options are: * <tt>:partial</tt> - See <tt>ActionView::PartialRenderer</tt> for details. * <tt>:file</tt> - Renders an explicit template file. Add <tt>:locals</tt> to pass in, if so desired. It shouldn’t be used directly with unsanitized user input due to lack of validation. * <tt>:inline</tt> - Renders an ERB template string. * <tt>:plain</tt> - Renders provided text and sets the content type as <tt>text/plain</tt>. * <tt>:html</tt> - Renders the provided HTML safe string, otherwise performs HTML escape on the string first. Sets the content type as <tt>text/html</tt>. * <tt>:json</tt> - Renders the provided hash or object in JSON. You don't need to call <tt>.to_json</tt> on the object you want to render. * <tt>:body</tt> - Renders provided text and sets content type of <tt>text/plain</tt>. If no <tt>options</tt> hash is passed or if <tt>:update</tt> is specified, the default is to render a partial and use the second parameter as the locals hash.
[ "Accepts", "a", "custom", "Rack", "environment", "to", "render", "templates", "in", ".", "It", "will", "be", "merged", "with", "the", "default", "Rack", "environment", "defined", "by", "+", "ActionController", "::", "Renderer", "::", "DEFAULTS", "+", ".", "R...
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/actionpack/lib/action_controller/renderer.rb#L87-L97
train
render to a string
[ 30522, 13366, 17552, 1006, 1008, 12098, 5620, 1007, 5333, 1000, 4394, 11486, 1000, 4983, 11486, 5227, 1027, 2895, 10521, 4502, 10649, 1024, 1024, 5227, 1012, 2047, 1030, 4372, 2615, 5227, 1012, 5847, 1027, 11486, 1012, 1035, 5847, 6013, 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...
sporkmonger/addressable
lib/addressable/uri.rb
Addressable.URI.password=
def password=(new_password) if new_password && !new_password.respond_to?(:to_str) raise TypeError, "Can't convert #{new_password.class} into String." end @password = new_password ? new_password.to_str : nil # You can't have a nil user with a non-nil password @password ||= nil @user ||= nil if @password != nil @user = EMPTY_STR if @user.nil? end # Reset dependent values remove_instance_variable(:@userinfo) if defined?(@userinfo) remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) remove_instance_variable(:@authority) if defined?(@authority) remove_instance_variable(:@normalized_password) if defined?(@normalized_password) remove_composite_values # Ensure we haven't created an invalid URI validate() end
ruby
def password=(new_password) if new_password && !new_password.respond_to?(:to_str) raise TypeError, "Can't convert #{new_password.class} into String." end @password = new_password ? new_password.to_str : nil # You can't have a nil user with a non-nil password @password ||= nil @user ||= nil if @password != nil @user = EMPTY_STR if @user.nil? end # Reset dependent values remove_instance_variable(:@userinfo) if defined?(@userinfo) remove_instance_variable(:@normalized_userinfo) if defined?(@normalized_userinfo) remove_instance_variable(:@authority) if defined?(@authority) remove_instance_variable(:@normalized_password) if defined?(@normalized_password) remove_composite_values # Ensure we haven't created an invalid URI validate() end
[ "def", "password", "=", "(", "new_password", ")", "if", "new_password", "&&", "!", "new_password", ".", "respond_to?", "(", ":to_str", ")", "raise", "TypeError", ",", "\"Can't convert #{new_password.class} into String.\"", "end", "@password", "=", "new_password", "?",...
Sets the password component for this URI. @param [String, #to_str] new_password The new password component.
[ "Sets", "the", "password", "component", "for", "this", "URI", "." ]
5894c95a7768435cb46d1355954611dbd194832e
https://github.com/sporkmonger/addressable/blob/5894c95a7768435cb46d1355954611dbd194832e/lib/addressable/uri.rb#L990-L1012
train
Set the password of the URI.
[ 30522, 13366, 20786, 1027, 1006, 2047, 1035, 20786, 1007, 2065, 2047, 1035, 20786, 1004, 1004, 999, 2047, 1035, 20786, 1012, 6869, 1035, 2000, 1029, 1006, 1024, 2000, 1035, 2358, 2099, 1007, 5333, 2828, 2121, 29165, 1010, 1000, 2064, 1005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aws/aws-sdk-ruby
gems/aws-sdk-ec2/lib/aws-sdk-ec2/snapshot.rb
Aws::EC2.Snapshot.copy
def copy(options = {}) options = options.merge(source_snapshot_id: @id) resp = @client.copy_snapshot(options) resp.data end
ruby
def copy(options = {}) options = options.merge(source_snapshot_id: @id) resp = @client.copy_snapshot(options) resp.data end
[ "def", "copy", "(", "options", "=", "{", "}", ")", "options", "=", "options", ".", "merge", "(", "source_snapshot_id", ":", "@id", ")", "resp", "=", "@client", ".", "copy_snapshot", "(", "options", ")", "resp", ".", "data", "end" ]
@!group Actions @example Request syntax with placeholder values snapshot.copy({ description: "String", destination_region: "String", encrypted: false, kms_key_id: "String", presigned_url: "String", source_region: "String", # required dry_run: false, }) @param [Hash] options ({}) @option options [String] :description A description for the EBS snapshot. @option options [String] :destination_region The destination Region to use in the `PresignedUrl` parameter of a snapshot copy operation. This parameter is only valid for specifying the destination Region in a `PresignedUrl` parameter, where it is required. The snapshot copy is sent to the regional endpoint that you sent the HTTP request to (for example, `ec2.us-east-1.amazonaws.com`). With the AWS CLI, this is specified using the `--region` parameter or the default Region in your AWS configuration file. @option options [Boolean] :encrypted Specifies whether the destination snapshot should be encrypted. You can encrypt a copy of an unencrypted snapshot, but you cannot use it to create an unencrypted copy of an encrypted snapshot. Your default CMK for EBS is used unless you specify a non-default AWS Key Management Service (AWS KMS) CMK using `KmsKeyId`. For more information, see [Amazon EBS Encryption][1] in the *Amazon Elastic Compute Cloud User Guide*. [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html @option options [String] :kms_key_id An identifier for the AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume. This parameter is only required if you want to use a non-default CMK; if this parameter is not specified, the default CMK for EBS is used. If a `KmsKeyId` is specified, the `Encrypted` flag must also be set. The CMK identifier may be provided in any of the following formats: * Key ID * Key alias. The alias ARN contains the `arn:aws:kms` namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the `alias` namespace, and then the CMK alias. For example, arn:aws:kms:*us-east-1*\:*012345678910*\:alias/*ExampleAlias*. * ARN using key ID. The ID ARN contains the `arn:aws:kms` namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the `key` namespace, and then the CMK ID. For example, arn:aws:kms:*us-east-1*\:*012345678910*\:key/*abcd1234-a123-456a-a12b-a123b4cd56ef*. * ARN using key alias. The alias ARN contains the `arn:aws:kms` namespace, followed by the region of the CMK, the AWS account ID of the CMK owner, the `alias` namespace, and then the CMK alias. For example, arn:aws:kms:*us-east-1*\:*012345678910*\:alias/*ExampleAlias*. AWS parses `KmsKeyId` asynchronously, meaning that the action you call may appear to complete even though you provided an invalid identifier. The action will eventually fail. @option options [String] :presigned_url When you copy an encrypted source snapshot using the Amazon EC2 Query API, you must supply a pre-signed URL. This parameter is optional for unencrypted snapshots. For more information, see [Query Requests][1]. The `PresignedUrl` should use the snapshot source endpoint, the `CopySnapshot` action, and include the `SourceRegion`, `SourceSnapshotId`, and `DestinationRegion` parameters. The `PresignedUrl` must be signed using AWS Signature Version 4. Because EBS snapshots are stored in Amazon S3, the signing algorithm for this parameter uses the same logic that is described in [Authenticating Requests by Using Query Parameters (AWS Signature Version 4)][2] in the *Amazon Simple Storage Service API Reference*. An invalid or improperly signed `PresignedUrl` will cause the copy operation to fail asynchronously, and the snapshot will move to an `error` state. [1]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html [2]: https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html @option options [required, String] :source_region The ID of the Region that contains the snapshot to be copied. @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 [Types::CopySnapshotResult]
[ "@!group", "Actions", "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/snapshot.rb#L374-L378
train
Copy the snapshot to the source snapshot
[ 30522, 13366, 6100, 1006, 7047, 1027, 1063, 1065, 1007, 7047, 1027, 7047, 1012, 13590, 1006, 3120, 1035, 20057, 12326, 1035, 8909, 1024, 1030, 8909, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 6100, 1035, 20057, 12326, 1006, 7047, 1007, 2450...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/user_interaction.rb
Commander.UI.progress
def progress(arr, options = {}) bar = ProgressBar.new arr.length, options bar.show arr.each { |v| bar.increment yield(v) } end
ruby
def progress(arr, options = {}) bar = ProgressBar.new arr.length, options bar.show arr.each { |v| bar.increment yield(v) } end
[ "def", "progress", "(", "arr", ",", "options", "=", "{", "}", ")", "bar", "=", "ProgressBar", ".", "new", "arr", ".", "length", ",", "options", "bar", ".", "show", "arr", ".", "each", "{", "|", "v", "|", "bar", ".", "increment", "yield", "(", "v"...
Output progress while iterating _arr_. === Examples uris = %w( http://vision-media.ca http://google.com ) progress uris, :format => "Remaining: :time_remaining" do |uri| res = open uri end
[ "Output", "progress", "while", "iterating", "_arr_", "." ]
332047c14948225462fe60042eed23adfb996d68
https://github.com/commander-rb/commander/blob/332047c14948225462fe60042eed23adfb996d68/lib/commander/user_interaction.rb#L317-L321
train
Generates a progress bar for the given array of values.
[ 30522, 13366, 5082, 1006, 12098, 2099, 1010, 7047, 1027, 1063, 1065, 1007, 3347, 1027, 5082, 8237, 1012, 2047, 12098, 2099, 1012, 3091, 1010, 7047, 3347, 1012, 2265, 12098, 2099, 1012, 2169, 1063, 1064, 1058, 1064, 3347, 1012, 4297, 28578, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/duplicate_property.rb
SCSSLint.Linter::DuplicateProperty.property_key
def property_key(prop) prop_key = prop.name.join prop_value = value_as_string(prop.value.first) # Differentiate between values for different vendor prefixes prop_value.to_s.scan(/^(-[^-]+-.+)/) do |vendor_keyword| prop_key << vendor_keyword.first end prop_key end
ruby
def property_key(prop) prop_key = prop.name.join prop_value = value_as_string(prop.value.first) # Differentiate between values for different vendor prefixes prop_value.to_s.scan(/^(-[^-]+-.+)/) do |vendor_keyword| prop_key << vendor_keyword.first end prop_key end
[ "def", "property_key", "(", "prop", ")", "prop_key", "=", "prop", ".", "name", ".", "join", "prop_value", "=", "value_as_string", "(", "prop", ".", "value", ".", "first", ")", "# Differentiate between values for different vendor prefixes", "prop_value", ".", "to_s",...
Returns a key identifying the bucket this property and value correspond to for purposes of uniqueness.
[ "Returns", "a", "key", "identifying", "the", "bucket", "this", "property", "and", "value", "correspond", "to", "for", "purposes", "of", "uniqueness", "." ]
e99afe4ede041a431a06e585c12ce82f6ad50116
https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/linter/duplicate_property.rb#L44-L54
train
Get the key for a property
[ 30522, 13366, 3200, 1035, 3145, 1006, 17678, 1007, 17678, 1035, 3145, 1027, 17678, 1012, 2171, 1012, 3693, 17678, 1035, 3643, 1027, 3643, 1035, 2004, 1035, 5164, 1006, 17678, 1012, 3643, 1012, 2034, 1007, 1001, 21032, 2090, 5300, 2005, 2367...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/sys/policy.rb
Vault.Sys.policy
def policy(name) json = client.get("/v1/sys/policy/#{encode_path(name)}") return Policy.decode(json) rescue HTTPError => e return nil if e.code == 404 raise end
ruby
def policy(name) json = client.get("/v1/sys/policy/#{encode_path(name)}") return Policy.decode(json) rescue HTTPError => e return nil if e.code == 404 raise end
[ "def", "policy", "(", "name", ")", "json", "=", "client", ".", "get", "(", "\"/v1/sys/policy/#{encode_path(name)}\"", ")", "return", "Policy", ".", "decode", "(", "json", ")", "rescue", "HTTPError", "=>", "e", "return", "nil", "if", "e", ".", "code", "==",...
Get the policy by the given name. If a policy does not exist by that name, +nil+ is returned. @example Vault.sys.policy("root") #=> #<Vault::Policy rules=""> @return [Policy, nil]
[ "Get", "the", "policy", "by", "the", "given", "name", ".", "If", "a", "policy", "does", "not", "exist", "by", "that", "name", "+", "nil", "+", "is", "returned", "." ]
02f0532a802ba1a2a0d8703a4585dab76eb9d864
https://github.com/hashicorp/vault-ruby/blob/02f0532a802ba1a2a0d8703a4585dab76eb9d864/lib/vault/api/sys/policy.rb#L42-L48
train
Get a policy by name
[ 30522, 13366, 3343, 1006, 2171, 1007, 1046, 3385, 1027, 7396, 1012, 2131, 1006, 1000, 1013, 1058, 2487, 1013, 25353, 2015, 1013, 3343, 1013, 1001, 1063, 4372, 16044, 1035, 4130, 1006, 2171, 1007, 1065, 1000, 1007, 2709, 3343, 1012, 21933, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/policy.rb
Aws::IAM.Policy.attached_groups
def attached_groups(options = {}) batches = Enumerator.new do |y| options = options.merge( policy_arn: @arn, entity_filter: "Group" ) resp = @client.list_entities_for_policy(options) resp.each_page do |page| batch = [] page.data.policy_groups.each do |p| batch << Group.new( name: p.group_name, data: p, client: @client ) end y.yield(batch) end end Group::Collection.new(batches) end
ruby
def attached_groups(options = {}) batches = Enumerator.new do |y| options = options.merge( policy_arn: @arn, entity_filter: "Group" ) resp = @client.list_entities_for_policy(options) resp.each_page do |page| batch = [] page.data.policy_groups.each do |p| batch << Group.new( name: p.group_name, data: p, client: @client ) end y.yield(batch) end end Group::Collection.new(batches) end
[ "def", "attached_groups", "(", "options", "=", "{", "}", ")", "batches", "=", "Enumerator", ".", "new", "do", "|", "y", "|", "options", "=", "options", ".", "merge", "(", "policy_arn", ":", "@arn", ",", "entity_filter", ":", "\"Group\"", ")", "resp", "...
@!group Associations @example Request syntax with placeholder values attached_groups = policy.attached_groups({ path_prefix: "pathType", policy_usage_filter: "PermissionsPolicy", # accepts PermissionsPolicy, PermissionsBoundary }) @param [Hash] options ({}) @option options [String] :path_prefix The path prefix for filtering the results. This parameter is optional. If it is not included, it defaults to a slash (/), listing all entities. This parameter allows (through its [regex pattern][1]) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (\\u0021) through the DEL character (\\u007F), including most punctuation characters, digits, and upper and lowercased letters. [1]: http://wikipedia.org/wiki/regex @option options [String] :policy_usage_filter The policy usage method to use for filtering the results. To list only permissions policies, set `PolicyUsageFilter` to `PermissionsPolicy`. To list only the policies used to set permissions boundaries, set the value to `PermissionsBoundary`. This parameter is optional. If it is not included, all policies are returned. @return [Group::Collection]
[ "@!group", "Associations", "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-iam/lib/aws-sdk-iam/policy.rb#L514-L534
train
Returns an array of all attached groups
[ 30522, 13366, 4987, 1035, 2967, 1006, 7047, 1027, 1063, 1065, 1007, 14108, 2229, 1027, 4372, 17897, 16259, 1012, 2047, 2079, 1064, 1061, 1064, 7047, 1027, 7047, 1012, 13590, 1006, 3343, 1035, 12098, 2078, 1024, 1030, 12098, 2078, 1010, 9178...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_customvisionprediction/lib/2.0/generated/azure_cognitiveservices_customvisionprediction/customvisionprediction_client.rb
Azure::CognitiveServices::Customvisionprediction::V2_0.CustomvisionpredictionClient.predict_image_with_no_store
def predict_image_with_no_store(project_id, image_data, iteration_id:nil, application:nil, custom_headers:nil) response = predict_image_with_no_store_async(project_id, image_data, iteration_id:iteration_id, application:application, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def predict_image_with_no_store(project_id, image_data, iteration_id:nil, application:nil, custom_headers:nil) response = predict_image_with_no_store_async(project_id, image_data, iteration_id:iteration_id, application:application, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "predict_image_with_no_store", "(", "project_id", ",", "image_data", ",", "iteration_id", ":", "nil", ",", "application", ":", "nil", ",", "custom_headers", ":", "nil", ")", "response", "=", "predict_image_with_no_store_async", "(", "project_id", ",", "image_...
Predict an image without saving the result @param project_id The project id @param image_data @param iteration_id Optional. Specifies the id of a particular iteration to evaluate against. The default iteration for the project will be used when not specified @param application [String] Optional. Specifies the name of application using the endpoint @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ImagePrediction] operation results.
[ "Predict", "an", "image", "without", "saving", "the", "result" ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_customvisionprediction/lib/2.0/generated/azure_cognitiveservices_customvisionprediction/customvisionprediction_client.rb#L482-L485
train
Predict an image using the binary representation.
[ 30522, 13366, 16014, 1035, 3746, 1035, 2007, 1035, 2053, 1035, 3573, 1006, 2622, 1035, 8909, 1010, 3746, 1035, 2951, 1010, 27758, 1035, 8909, 1024, 9152, 2140, 1010, 4646, 1024, 9152, 2140, 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...
aws/aws-sdk-ruby
gems/aws-sdk-ec2/lib/aws-sdk-ec2/network_interface.rb
Aws::EC2.NetworkInterface.unassign_private_ip_addresses
def unassign_private_ip_addresses(options = {}) options = options.merge(network_interface_id: @id) resp = @client.unassign_private_ip_addresses(options) resp.data end
ruby
def unassign_private_ip_addresses(options = {}) options = options.merge(network_interface_id: @id) resp = @client.unassign_private_ip_addresses(options) resp.data end
[ "def", "unassign_private_ip_addresses", "(", "options", "=", "{", "}", ")", "options", "=", "options", ".", "merge", "(", "network_interface_id", ":", "@id", ")", "resp", "=", "@client", ".", "unassign_private_ip_addresses", "(", "options", ")", "resp", ".", "...
@example Request syntax with placeholder values network_interface.unassign_private_ip_addresses({ private_ip_addresses: ["String"], # required }) @param [Hash] options ({}) @option options [required, Array<String>] :private_ip_addresses The secondary private IP addresses to unassign from the network interface. You can specify this option multiple times to unassign more than one IP address. @return [EmptyStructure]
[ "@example", "Request", "syntax", "with", "placeholder", "values" ]
e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d
https://github.com/aws/aws-sdk-ruby/blob/e28b8d320ddf7b6ee0161bdd9d00fb786d99b63d/gems/aws-sdk-ec2/lib/aws-sdk-ec2/network_interface.rb#L506-L510
train
Unassigns private IP addresses to this network interface
[ 30522, 13366, 14477, 18719, 16206, 1035, 2797, 1035, 12997, 1035, 11596, 1006, 7047, 1027, 1063, 1065, 1007, 7047, 1027, 7047, 1012, 13590, 1006, 2897, 1035, 8278, 1035, 8909, 1024, 1030, 8909, 1007, 24501, 2361, 1027, 1030, 7396, 1012, 144...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
square/connect-ruby-sdk
lib/square_connect/models/v1_item.rb
SquareConnect.V1Item.valid?
def valid? type_validator = EnumAttributeValidator.new('String', ["NORMAL", "GIFT_CARD", "OTHER"]) return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["9da2a6", "4ab200", "0b8000", "2952cc", "a82ee5", "e5457a", "b21212", "593c00", "e5BF00"]) return false unless color_validator.valid?(@color) visibility_validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"]) return false unless visibility_validator.valid?(@visibility) return true end
ruby
def valid? type_validator = EnumAttributeValidator.new('String', ["NORMAL", "GIFT_CARD", "OTHER"]) return false unless type_validator.valid?(@type) color_validator = EnumAttributeValidator.new('String', ["9da2a6", "4ab200", "0b8000", "2952cc", "a82ee5", "e5457a", "b21212", "593c00", "e5BF00"]) return false unless color_validator.valid?(@color) visibility_validator = EnumAttributeValidator.new('String', ["PUBLIC", "PRIVATE"]) return false unless visibility_validator.valid?(@visibility) return true end
[ "def", "valid?", "type_validator", "=", "EnumAttributeValidator", ".", "new", "(", "'String'", ",", "[", "\"NORMAL\"", ",", "\"GIFT_CARD\"", ",", "\"OTHER\"", "]", ")", "return", "false", "unless", "type_validator", ".", "valid?", "(", "@type", ")", "color_valid...
Check to see if the all the properties in the model are valid @return true if the model is valid
[ "Check", "to", "see", "if", "the", "all", "the", "properties", "in", "the", "model", "are", "valid" ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/v1_item.rb#L227-L235
train
Returns true if the object is valid for this object.
[ 30522, 13366, 9398, 1029, 2828, 1035, 9398, 8844, 1027, 4372, 12248, 4779, 3089, 8569, 2618, 10175, 8524, 4263, 1012, 2047, 1006, 1005, 5164, 1005, 1010, 1031, 1000, 3671, 1000, 1010, 1000, 5592, 1035, 4003, 1000, 1010, 1000, 2060, 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_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb
Azure::ApiManagement::Mgmt::V2016_10_10.ApiManagementServices.backup
def backup(resource_group_name, service_name, parameters, custom_headers:nil) response = backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def backup(resource_group_name, service_name, parameters, custom_headers:nil) response = backup_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "backup", "(", "resource_group_name", ",", "service_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "backup_async", "(", "resource_group_name", ",", "service_name", ",", "parameters", ",", "custom_headers", ":custom_headers", ...
Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation and could take several minutes to complete. @param resource_group_name [String] The name of the resource group. @param service_name [String] The name of the API Management service. @param parameters [ApiManagementServiceBackupRestoreParameters] Parameters supplied to the ApiManagementServices_Backup operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [ApiManagementServiceResource] operation results.
[ "Creates", "a", "backup", "of", "the", "API", "Management", "service", "to", "the", "given", "Azure", "Storage", "Account", ".", "This", "is", "long", "running", "operation", "and", "could", "take", "several", "minutes", "to", "complete", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_api_management/lib/2016-10-10/generated/azure_mgmt_api_management/api_management_services.rb#L135-L138
train
Backup a service instance.
[ 30522, 13366, 10200, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 10200, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb
Azure::CognitiveServices::ComputerVision::V2_0.ComputerVisionClient.recognize_printed_text_in_stream_with_http_info
def recognize_printed_text_in_stream_with_http_info(detect_orientation, image, language:nil, custom_headers:nil) recognize_printed_text_in_stream_async(detect_orientation, image, language:language, custom_headers:custom_headers).value! end
ruby
def recognize_printed_text_in_stream_with_http_info(detect_orientation, image, language:nil, custom_headers:nil) recognize_printed_text_in_stream_async(detect_orientation, image, language:language, custom_headers:custom_headers).value! end
[ "def", "recognize_printed_text_in_stream_with_http_info", "(", "detect_orientation", ",", "image", ",", "language", ":", "nil", ",", "custom_headers", ":", "nil", ")", "recognize_printed_text_in_stream_async", "(", "detect_orientation", ",", "image", ",", "language", ":",...
Optical Character Recognition (OCR) detects text in an image and extracts the recognized characters into a machine-usable character stream. Upon success, the OCR results will be returned. Upon failure, the error code together with an error message will be returned. The error code can be one of InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or InternalServerError. @param detect_orientation [Boolean] Whether detect the text orientation in the image. With detectOrientation=true the OCR service tries to detect the image orientation and correct it before further processing (e.g. if it's upside-down). @param image An image stream. @param language [OcrLanguages] The BCP-47 language code of the text to be detected in the image. The default value is 'unk'. Possible values include: 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', 'el', 'hu', 'it', 'ja', 'ko', 'nb', 'pl', 'pt', 'ru', 'es', 'sv', 'tr', 'ar', 'ro', 'sr-Cyrl', 'sr-Latn', 'sk' @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.
[ "Optical", "Character", "Recognition", "(", "OCR", ")", "detects", "text", "in", "an", "image", "and", "extracts", "the", "recognized", "characters", "into", "a", "machine", "-", "usable", "character", "stream", ".", "Upon", "success", "the", "OCR", "results",...
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_cognitiveservices_computervision/lib/2.0/generated/azure_cognitiveservices_computervision/computer_vision_client.rb#L2719-L2721
train
Recognizes the printed text in a given image.
[ 30522, 13366, 6807, 1035, 6267, 1035, 3793, 1035, 1999, 1035, 5460, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 11487, 1035, 10296, 1010, 3746, 1010, 2653, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 6807, 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...
decidim/decidim
decidim-core/app/presenters/decidim/home_stats_presenter.rb
Decidim.HomeStatsPresenter.not_highlighted
def not_highlighted not_highlighted_stats = global_stats(priority: StatsRegistry::MEDIUM_PRIORITY) not_highlighted_stats = not_highlighted_stats.concat(component_stats(priority: StatsRegistry::MEDIUM_PRIORITY)) not_highlighted_stats = not_highlighted_stats.reject(&:empty?) not_highlighted_stats = not_highlighted_stats.reject { |_name, data| data.zero? } safe_join( not_highlighted_stats.in_groups_of(3, [:empty]).map do |stats| content_tag :div, class: "home-pam__lowlight" do safe_join( stats.map do |name, data| render_stats_data(name, data) end ) end end ) end
ruby
def not_highlighted not_highlighted_stats = global_stats(priority: StatsRegistry::MEDIUM_PRIORITY) not_highlighted_stats = not_highlighted_stats.concat(component_stats(priority: StatsRegistry::MEDIUM_PRIORITY)) not_highlighted_stats = not_highlighted_stats.reject(&:empty?) not_highlighted_stats = not_highlighted_stats.reject { |_name, data| data.zero? } safe_join( not_highlighted_stats.in_groups_of(3, [:empty]).map do |stats| content_tag :div, class: "home-pam__lowlight" do safe_join( stats.map do |name, data| render_stats_data(name, data) end ) end end ) end
[ "def", "not_highlighted", "not_highlighted_stats", "=", "global_stats", "(", "priority", ":", "StatsRegistry", "::", "MEDIUM_PRIORITY", ")", "not_highlighted_stats", "=", "not_highlighted_stats", ".", "concat", "(", "component_stats", "(", "priority", ":", "StatsRegistry"...
Public: Render a collection of stats that are not primary.
[ "Public", ":", "Render", "a", "collection", "of", "stats", "that", "are", "not", "primary", "." ]
6e2b14e559a63088669904e3c5c49a5180700cf7
https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/presenters/decidim/home_stats_presenter.rb#L30-L47
train
Returns the formatted output for the not_highlighted_stats array.
[ 30522, 13366, 2025, 1035, 11548, 2025, 1035, 11548, 1035, 26319, 1027, 3795, 1035, 26319, 1006, 9470, 1024, 26319, 2890, 24063, 2854, 1024, 1024, 5396, 1035, 9470, 1007, 2025, 1035, 11548, 1035, 26319, 1027, 2025, 1035, 11548, 1035, 26319, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/script_actions.rb
Azure::Hdinsight::Mgmt::V2015_03_01_preview.ScriptActions.get_execution_detail_with_http_info
def get_execution_detail_with_http_info(resource_group_name, cluster_name, script_execution_id, custom_headers:nil) get_execution_detail_async(resource_group_name, cluster_name, script_execution_id, custom_headers:custom_headers).value! end
ruby
def get_execution_detail_with_http_info(resource_group_name, cluster_name, script_execution_id, custom_headers:nil) get_execution_detail_async(resource_group_name, cluster_name, script_execution_id, custom_headers:custom_headers).value! end
[ "def", "get_execution_detail_with_http_info", "(", "resource_group_name", ",", "cluster_name", ",", "script_execution_id", ",", "custom_headers", ":", "nil", ")", "get_execution_detail_async", "(", "resource_group_name", ",", "cluster_name", ",", "script_execution_id", ",", ...
Gets the script execution detail for the given script execution ID. @param resource_group_name [String] The name of the resource group. @param cluster_name [String] The name of the cluster. @param script_execution_id [String] The script execution Id @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Gets", "the", "script", "execution", "detail", "for", "the", "given", "script", "execution", "ID", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_hdinsight/lib/2015-03-01-preview/generated/azure_mgmt_hdinsight/script_actions.rb#L228-L230
train
Gets the details of the execution.
[ 30522, 13366, 2131, 1035, 7781, 1035, 6987, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 9324, 1035, 2171, 1010, 5896, 1035, 7781, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
chloerei/alipay
lib/alipay/client.rb
Alipay.Client.page_execute_form
def page_execute_form(params) params = prepare_params(params) html = %Q(<form id='alipaysubmit' name='alipaysubmit' action='#{@url}' method='POST'>) params.each do |key, value| html << %Q(<input type='hidden' name='#{key}' value='#{value.gsub("'", "&apos;")}'/>) end html << "<input type='submit' value='ok' style='display:none'></form>" html << "<script>document.forms['alipaysubmit'].submit();</script>" html end
ruby
def page_execute_form(params) params = prepare_params(params) html = %Q(<form id='alipaysubmit' name='alipaysubmit' action='#{@url}' method='POST'>) params.each do |key, value| html << %Q(<input type='hidden' name='#{key}' value='#{value.gsub("'", "&apos;")}'/>) end html << "<input type='submit' value='ok' style='display:none'></form>" html << "<script>document.forms['alipaysubmit'].submit();</script>" html end
[ "def", "page_execute_form", "(", "params", ")", "params", "=", "prepare_params", "(", "params", ")", "html", "=", "%Q(<form id='alipaysubmit' name='alipaysubmit' action='#{@url}' method='POST'>)", "params", ".", "each", "do", "|", "key", ",", "value", "|", "html", "<<...
Generate a form string that use to render in view and auto POST to Alipay server. Example: alipay_client.page_execute_form( method: 'alipay.trade.page.pay', biz_content: { out_trade_no: '20160401000000', product_code: 'FAST_INSTANT_TRADE_PAY', total_amount: '0.01', subject: 'test' }.to_json(ascii_only: true), timestamp: '2016-04-01 00:00:00' ) # => '<form id='alipaysubmit' name='alipaysubmit' action=...'
[ "Generate", "a", "form", "string", "that", "use", "to", "render", "in", "view", "and", "auto", "POST", "to", "Alipay", "server", "." ]
a525989b659da970e08bc8fcd1b004453bfed89f
https://github.com/chloerei/alipay/blob/a525989b659da970e08bc8fcd1b004453bfed89f/lib/alipay/client.rb#L102-L112
train
execute a form
[ 30522, 13366, 3931, 1035, 15389, 1035, 2433, 1006, 11498, 5244, 1007, 11498, 5244, 1027, 7374, 1035, 11498, 5244, 1006, 11498, 5244, 1007, 16129, 1027, 1003, 1053, 1006, 1026, 2433, 8909, 1027, 1005, 4862, 4502, 7274, 12083, 22930, 1005, 21...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
decidim/decidim
decidim-core/lib/decidim/stats_registry.rb
Decidim.StatsRegistry.with_context
def with_context(context, start_at = nil, end_at = nil) Enumerator.new do |yielder| @stats.each do |stat| yielder << [stat[:name], resolve(stat[:name], context, start_at, end_at)] end end end
ruby
def with_context(context, start_at = nil, end_at = nil) Enumerator.new do |yielder| @stats.each do |stat| yielder << [stat[:name], resolve(stat[:name], context, start_at, end_at)] end end end
[ "def", "with_context", "(", "context", ",", "start_at", "=", "nil", ",", "end_at", "=", "nil", ")", "Enumerator", ".", "new", "do", "|", "yielder", "|", "@stats", ".", "each", "do", "|", "stat", "|", "yielder", "<<", "[", "stat", "[", ":name", "]", ...
Public: Resolves every stat with the given context and return an enumerator context - An arbritrary context object to compute the result. start_at - A date to filter resources created after it end_at - A date to filter resources created before it Returns an Enumerator where each value is a tuple of name and resolved value
[ "Public", ":", "Resolves", "every", "stat", "with", "the", "given", "context", "and", "return", "an", "enumerator" ]
6e2b14e559a63088669904e3c5c49a5180700cf7
https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/lib/decidim/stats_registry.rb#L61-L67
train
Returns an Enumerator that yields the stats with the given context.
[ 30522, 13366, 2007, 1035, 6123, 1006, 6123, 1010, 2707, 1035, 2012, 1027, 9152, 2140, 1010, 2203, 1035, 2012, 1027, 9152, 2140, 1007, 4372, 17897, 16259, 1012, 2047, 2079, 1064, 10750, 2121, 1064, 1030, 26319, 1012, 2169, 2079, 1064, 28093,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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.import
def import(resource_group_name, server_name, parameters, custom_headers:nil) response = import_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def import(resource_group_name, server_name, parameters, custom_headers:nil) response = import_async(resource_group_name, server_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "import", "(", "resource_group_name", ",", "server_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "import_async", "(", "resource_group_name", ",", "server_name", ",", "parameters", ",", "custom_headers", ":custom_headers", ...
Imports a bacpac into a new database. @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 parameters [ImportRequest] The required parameters for importing a Bacpac into 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.
[ "Imports", "a", "bacpac", "into", "a", "new", "database", "." ]
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#L978-L981
train
Import a single or many - to - many data structures into a single resource.
[ 30522, 13366, 12324, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 8241, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 12324, 1035, 2004, 6038, 2278, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 8241, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/border_pr.rb
Axlsx.BorderPr.to_xml_string
def to_xml_string(str = '') str << ('<' << @name.to_s << ' style="' << @style.to_s << '">') @color.to_xml_string(str) if @color.is_a?(Color) str << ('</' << @name.to_s << '>') end
ruby
def to_xml_string(str = '') str << ('<' << @name.to_s << ' style="' << @style.to_s << '">') @color.to_xml_string(str) if @color.is_a?(Color) str << ('</' << @name.to_s << '>') end
[ "def", "to_xml_string", "(", "str", "=", "''", ")", "str", "<<", "(", "'<'", "<<", "@name", ".", "to_s", "<<", "' style=\"'", "<<", "@style", ".", "to_s", "<<", "'\">'", ")", "@color", ".", "to_xml_string", "(", "str", ")", "if", "@color", ".", "is_a...
Serializes the object @param [String] str @return [String]
[ "Serializes", "the", "object" ]
c593a08b2a929dac7aa8dc418b55e26b4c49dc34
https://github.com/randym/axlsx/blob/c593a08b2a929dac7aa8dc418b55e26b4c49dc34/lib/axlsx/stylesheet/border_pr.rb#L64-L68
train
Returns the XML string for this object.
[ 30522, 13366, 2000, 1035, 20950, 1035, 5164, 1006, 2358, 2099, 1027, 1005, 1005, 1007, 2358, 2099, 1026, 1026, 1006, 1005, 1026, 1005, 1026, 1026, 1030, 2171, 1012, 2000, 1035, 1055, 1026, 1026, 1005, 2806, 1027, 1000, 1005, 1026, 1026, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/service_endpoint_policies.rb
Azure::Network::Mgmt::V2018_07_01.ServiceEndpointPolicies.get_with_http_info
def get_with_http_info(resource_group_name, service_endpoint_policy_name, expand:nil, custom_headers:nil) get_async(resource_group_name, service_endpoint_policy_name, expand:expand, custom_headers:custom_headers).value! end
ruby
def get_with_http_info(resource_group_name, service_endpoint_policy_name, expand:nil, custom_headers:nil) get_async(resource_group_name, service_endpoint_policy_name, expand:expand, custom_headers:custom_headers).value! end
[ "def", "get_with_http_info", "(", "resource_group_name", ",", "service_endpoint_policy_name", ",", "expand", ":", "nil", ",", "custom_headers", ":", "nil", ")", "get_async", "(", "resource_group_name", ",", "service_endpoint_policy_name", ",", "expand", ":", "expand", ...
Gets the specified service Endpoint Policies in a specified resource group. @param resource_group_name [String] The name of the resource group. @param service_endpoint_policy_name [String] The name of the service endpoint policy. @param expand [String] Expands referenced resources. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Gets", "the", "specified", "service", "Endpoint", "Policies", "in", "a", "specified", "resource", "group", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_network/lib/2018-07-01/generated/azure_mgmt_network/service_endpoint_policies.rb#L93-L95
train
Gets the specified service endpoint policy.
[ 30522, 13366, 2131, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 2326, 1035, 2203, 8400, 1035, 3343, 1035, 2171, 1010, 7818, 1024, 9152, 2140, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 2131, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
puppetlabs/pdk
lib/pdk/answer_file.rb
PDK.AnswerFile.read_from_disk
def read_from_disk return {} if !File.file?(answer_file_path) || File.zero?(answer_file_path) unless File.readable?(answer_file_path) raise PDK::CLI::FatalError, _("Unable to open '%{file}' for reading") % { file: answer_file_path, } end answers = JSON.parse(File.read(answer_file_path)) if answers.is_a?(Hash) answers else PDK.logger.warn _("Answer file '%{path}' did not contain a valid set of answers, recreating it") % { path: answer_file_path, } {} end rescue JSON::JSONError PDK.logger.warn _("Answer file '%{path}' did not contain valid JSON, recreating it") % { path: answer_file_path, } {} end
ruby
def read_from_disk return {} if !File.file?(answer_file_path) || File.zero?(answer_file_path) unless File.readable?(answer_file_path) raise PDK::CLI::FatalError, _("Unable to open '%{file}' for reading") % { file: answer_file_path, } end answers = JSON.parse(File.read(answer_file_path)) if answers.is_a?(Hash) answers else PDK.logger.warn _("Answer file '%{path}' did not contain a valid set of answers, recreating it") % { path: answer_file_path, } {} end rescue JSON::JSONError PDK.logger.warn _("Answer file '%{path}' did not contain valid JSON, recreating it") % { path: answer_file_path, } {} end
[ "def", "read_from_disk", "return", "{", "}", "if", "!", "File", ".", "file?", "(", "answer_file_path", ")", "||", "File", ".", "zero?", "(", "answer_file_path", ")", "unless", "File", ".", "readable?", "(", "answer_file_path", ")", "raise", "PDK", "::", "C...
Read existing answers into memory from the answer file on disk. @raise [PDK::CLI::FatalError] If the answer file exists but can not be read. @return [Hash{String => Object}] The existing questions and answers.
[ "Read", "existing", "answers", "into", "memory", "from", "the", "answer", "file", "on", "disk", "." ]
0d864aff62ffef04b5104addf399d0476afd71e7
https://github.com/puppetlabs/pdk/blob/0d864aff62ffef04b5104addf399d0476afd71e7/lib/pdk/answer_file.rb#L82-L105
train
Reads the answers from the given file and returns the resulting array.
[ 30522, 13366, 3191, 1035, 2013, 1035, 9785, 2709, 1063, 1065, 2065, 999, 5371, 1012, 5371, 1029, 1006, 3437, 1035, 5371, 1035, 4130, 1007, 1064, 1064, 5371, 1012, 5717, 1029, 1006, 3437, 1035, 5371, 1035, 4130, 1007, 4983, 5371, 1012, 319...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/work_show_presenter.rb
Hyrax.WorkShowPresenter.sequence_rendering
def sequence_rendering renderings = [] if solr_document.rendering_ids.present? solr_document.rendering_ids.each do |file_set_id| renderings << manifest_helper.build_rendering(file_set_id) end end renderings.flatten end
ruby
def sequence_rendering renderings = [] if solr_document.rendering_ids.present? solr_document.rendering_ids.each do |file_set_id| renderings << manifest_helper.build_rendering(file_set_id) end end renderings.flatten end
[ "def", "sequence_rendering", "renderings", "=", "[", "]", "if", "solr_document", ".", "rendering_ids", ".", "present?", "solr_document", ".", "rendering_ids", ".", "each", "do", "|", "file_set_id", "|", "renderings", "<<", "manifest_helper", ".", "build_rendering", ...
IIIF rendering linking property for inclusion in the manifest Called by the `iiif_manifest` gem to add a 'rendering' (eg. a link a download for the resource) @return [Array] array of rendering hashes
[ "IIIF", "rendering", "linking", "property", "for", "inclusion", "in", "the", "manifest", "Called", "by", "the", "iiif_manifest", "gem", "to", "add", "a", "rendering", "(", "eg", ".", "a", "link", "a", "download", "for", "the", "resource", ")" ]
e2b4f56e829a53b1f11296324736e9d5b8c9ee5f
https://github.com/samvera/hyrax/blob/e2b4f56e829a53b1f11296324736e9d5b8c9ee5f/app/presenters/hyrax/work_show_presenter.rb#L202-L210
train
Returns a sequence of renderings for the current document
[ 30522, 13366, 5537, 1035, 14259, 14259, 2015, 1027, 1031, 1033, 2065, 14017, 2099, 1035, 6254, 1012, 14259, 1035, 8909, 2015, 1012, 2556, 1029, 14017, 2099, 1035, 6254, 1012, 14259, 1035, 8909, 2015, 1012, 2169, 2079, 1064, 5371, 1035, 2275...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
watir/watir
lib/watir/cookies.rb
Watir.Cookies.add
def add(name, value, opts = {}) cookie = { name: name, value: value } cookie[:secure] = opts[:secure] if opts.key?(:secure) cookie[:path] = opts[:path] if opts.key?(:path) expires = opts[:expires] if expires cookie[:expires] = expires.is_a?(String) ? ::Time.parse(expires) : expires end cookie[:domain] = opts[:domain] if opts.key?(:domain) @control.add_cookie cookie end
ruby
def add(name, value, opts = {}) cookie = { name: name, value: value } cookie[:secure] = opts[:secure] if opts.key?(:secure) cookie[:path] = opts[:path] if opts.key?(:path) expires = opts[:expires] if expires cookie[:expires] = expires.is_a?(String) ? ::Time.parse(expires) : expires end cookie[:domain] = opts[:domain] if opts.key?(:domain) @control.add_cookie cookie end
[ "def", "add", "(", "name", ",", "value", ",", "opts", "=", "{", "}", ")", "cookie", "=", "{", "name", ":", "name", ",", "value", ":", "value", "}", "cookie", "[", ":secure", "]", "=", "opts", "[", ":secure", "]", "if", "opts", ".", "key?", "(",...
Adds new cookie. @example browser.cookies.add 'my_session', 'BAh7B0kiD3Nlc3Npb25faWQGOgZFRkk', secure: true @param [String] name @param [String] value @param [Hash] opts @option opts [Boolean] :secure @option opts [String] :path @option opts [Time, DateTime, NilClass] :expires @option opts [String] :domain
[ "Adds", "new", "cookie", "." ]
2d8db09811c6221ae401b85b2f61f5fa66e463a3
https://github.com/watir/watir/blob/2d8db09811c6221ae401b85b2f61f5fa66e463a3/lib/watir/cookies.rb#L55-L69
train
Add a cookie to the cookie list
[ 30522, 13366, 5587, 1006, 2171, 1010, 3643, 1010, 23569, 2015, 1027, 1063, 1065, 1007, 17387, 1027, 1063, 2171, 1024, 2171, 1010, 3643, 1024, 3643, 1065, 17387, 1031, 1024, 5851, 1033, 1027, 23569, 2015, 1031, 1024, 5851, 1033, 2065, 23569,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/events/message.rb
Discordrb::Events.MessageEvent.attach_file
def attach_file(file, filename: nil, spoiler: nil) raise ArgumentError, 'Argument is not a file!' unless file.is_a?(File) @file = file @filename = filename @file_spoiler = spoiler nil end
ruby
def attach_file(file, filename: nil, spoiler: nil) raise ArgumentError, 'Argument is not a file!' unless file.is_a?(File) @file = file @filename = filename @file_spoiler = spoiler nil end
[ "def", "attach_file", "(", "file", ",", "filename", ":", "nil", ",", "spoiler", ":", "nil", ")", "raise", "ArgumentError", ",", "'Argument is not a file!'", "unless", "file", ".", "is_a?", "(", "File", ")", "@file", "=", "file", "@filename", "=", "filename",...
Attaches a file to the message event and converts the message into a caption. @param file [File] The file to be attached @param filename [String] Overrides the filename of the uploaded file @param spoiler [true, false] Whether or not this file should appear as a spoiler.
[ "Attaches", "a", "file", "to", "the", "message", "event", "and", "converts", "the", "message", "into", "a", "caption", "." ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/events/message.rb#L142-L149
train
Attach a file to the file_list
[ 30522, 13366, 22476, 1035, 5371, 1006, 5371, 1010, 5371, 18442, 1024, 9152, 2140, 1010, 27594, 2121, 1024, 9152, 2140, 1007, 5333, 6685, 2121, 29165, 1010, 1005, 6685, 2003, 2025, 1037, 5371, 999, 1005, 4983, 5371, 1012, 2003, 1035, 1037, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
sds/scss-lint
lib/scss_lint/file_finder.rb
SCSSLint.FileFinder.find
def find(patterns) if patterns.empty? raise SCSSLint::Exceptions::NoFilesError, 'No files, paths, or patterns were specified' end matched_files = extract_files_from(patterns) if matched_files.empty? raise SCSSLint::Exceptions::NoFilesError, "No SCSS files matched by the patterns: #{patterns.join(' ')}" end matched_files.reject { |file| @config.excluded_file?(file) } end
ruby
def find(patterns) if patterns.empty? raise SCSSLint::Exceptions::NoFilesError, 'No files, paths, or patterns were specified' end matched_files = extract_files_from(patterns) if matched_files.empty? raise SCSSLint::Exceptions::NoFilesError, "No SCSS files matched by the patterns: #{patterns.join(' ')}" end matched_files.reject { |file| @config.excluded_file?(file) } end
[ "def", "find", "(", "patterns", ")", "if", "patterns", ".", "empty?", "raise", "SCSSLint", "::", "Exceptions", "::", "NoFilesError", ",", "'No files, paths, or patterns were specified'", "end", "matched_files", "=", "extract_files_from", "(", "patterns", ")", "if", ...
Create a {FileFinder}. @param config [SCSSLint::Config] Find all files that match given the specified options. @param patterns [Array<String>] a list of file paths and glob patterns
[ "Create", "a", "{", "FileFinder", "}", "." ]
e99afe4ede041a431a06e585c12ce82f6ad50116
https://github.com/sds/scss-lint/blob/e99afe4ede041a431a06e585c12ce82f6ad50116/lib/scss_lint/file_finder.rb#L21-L34
train
Find the SCSS files that match the given patterns.
[ 30522, 13366, 2424, 1006, 7060, 1007, 2065, 7060, 1012, 4064, 1029, 5333, 8040, 4757, 4115, 2102, 1024, 1024, 11790, 1024, 1024, 2053, 8873, 24527, 18933, 2099, 1010, 1005, 2053, 6764, 1010, 10425, 1010, 2030, 7060, 2020, 9675, 1005, 2203, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
rails/rails
activerecord/lib/active_record/relation/query_methods.rb
ActiveRecord.QueryMethods.select
def select(*fields) if block_given? if fields.any? raise ArgumentError, "`select' with block doesn't take arguments." end return super() end raise ArgumentError, "Call `select' with at least one field" if fields.empty? spawn._select!(*fields) end
ruby
def select(*fields) if block_given? if fields.any? raise ArgumentError, "`select' with block doesn't take arguments." end return super() end raise ArgumentError, "Call `select' with at least one field" if fields.empty? spawn._select!(*fields) end
[ "def", "select", "(", "*", "fields", ")", "if", "block_given?", "if", "fields", ".", "any?", "raise", "ArgumentError", ",", "\"`select' with block doesn't take arguments.\"", "end", "return", "super", "(", ")", "end", "raise", "ArgumentError", ",", "\"Call `select' ...
Works in two unique ways. First: takes a block so it can be used just like <tt>Array#select</tt>. Model.all.select { |m| m.field == value } This will build an array of objects from the database for the scope, converting them into an array and iterating through them using <tt>Array#select</tt>. Second: Modifies the SELECT statement for the query so that only certain fields are retrieved: Model.select(:field) # => [#<Model id: nil, field: "value">] Although in the above example it looks as though this method returns an array, it actually returns a relation object and can have other query methods appended to it, such as the other methods in ActiveRecord::QueryMethods. The argument to the method can also be an array of fields. Model.select(:field, :other_field, :and_one_more) # => [#<Model id: nil, field: "value", other_field: "value", and_one_more: "value">] You can also use one or more strings, which will be used unchanged as SELECT fields. Model.select('field AS field_one', 'other_field AS field_two') # => [#<Model id: nil, field: "value", other_field: "value">] If an alias was specified, it will be accessible from the resulting objects: Model.select('field AS field_one').first.field_one # => "value" Accessing attributes of an object that do not have fields retrieved by a select except +id+ will throw ActiveModel::MissingAttributeError: Model.select(:field).first.other_field # => ActiveModel::MissingAttributeError: missing attribute: other_field
[ "Works", "in", "two", "unique", "ways", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activerecord/lib/active_record/relation/query_methods.rb#L254-L265
train
Select the fields in the collection.
[ 30522, 13366, 7276, 1006, 1008, 4249, 1007, 2065, 3796, 1035, 2445, 1029, 2065, 4249, 1012, 2151, 1029, 5333, 6685, 2121, 29165, 1010, 1000, 1036, 7276, 1005, 2007, 3796, 2987, 1005, 1056, 2202, 9918, 1012, 1000, 2203, 2709, 3565, 1006, 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...
Sorcery/sorcery
lib/sorcery/model.rb
Sorcery.Model.include_required_submodules!
def include_required_submodules! class_eval do @sorcery_config.submodules = ::Sorcery::Controller::Config.submodules @sorcery_config.submodules.each do |mod| # TODO: Is there a cleaner way to handle missing submodules? # rubocop:disable Lint/HandleExceptions begin include Submodules.const_get(mod.to_s.split('_').map(&:capitalize).join) rescue NameError # don't stop on a missing submodule. Needed because some submodules are only defined # in the controller side. end # rubocop:enable Lint/HandleExceptions end end end
ruby
def include_required_submodules! class_eval do @sorcery_config.submodules = ::Sorcery::Controller::Config.submodules @sorcery_config.submodules.each do |mod| # TODO: Is there a cleaner way to handle missing submodules? # rubocop:disable Lint/HandleExceptions begin include Submodules.const_get(mod.to_s.split('_').map(&:capitalize).join) rescue NameError # don't stop on a missing submodule. Needed because some submodules are only defined # in the controller side. end # rubocop:enable Lint/HandleExceptions end end end
[ "def", "include_required_submodules!", "class_eval", "do", "@sorcery_config", ".", "submodules", "=", "::", "Sorcery", "::", "Controller", "::", "Config", ".", "submodules", "@sorcery_config", ".", "submodules", ".", "each", "do", "|", "mod", "|", "# TODO: Is there ...
includes required submodules into the model class, which usually is called User.
[ "includes", "required", "submodules", "into", "the", "model", "class", "which", "usually", "is", "called", "User", "." ]
ae4141e7059fa5c79d4135e81efb839a016d39ac
https://github.com/Sorcery/sorcery/blob/ae4141e7059fa5c79d4135e81efb839a016d39ac/lib/sorcery/model.rb#L46-L61
train
Include required submodules in the controller.
[ 30522, 13366, 2421, 1035, 3223, 1035, 4942, 5302, 8566, 4244, 999, 2465, 1035, 9345, 2140, 2079, 1030, 2061, 19170, 2854, 1035, 9530, 8873, 2290, 1012, 4942, 5302, 8566, 4244, 1027, 1024, 1024, 2061, 19170, 2854, 1024, 1024, 11486, 1024, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/object_data_types.rb
Azure::Automation::Mgmt::V2015_10_31.ObjectDataTypes.list_fields_by_type_with_http_info
def list_fields_by_type_with_http_info(resource_group_name, automation_account_name, type_name, custom_headers:nil) list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers:custom_headers).value! end
ruby
def list_fields_by_type_with_http_info(resource_group_name, automation_account_name, type_name, custom_headers:nil) list_fields_by_type_async(resource_group_name, automation_account_name, type_name, custom_headers:custom_headers).value! end
[ "def", "list_fields_by_type_with_http_info", "(", "resource_group_name", ",", "automation_account_name", ",", "type_name", ",", "custom_headers", ":", "nil", ")", "list_fields_by_type_async", "(", "resource_group_name", ",", "automation_account_name", ",", "type_name", ",", ...
Retrieve a list of fields of a given type across all accessible modules. @param resource_group_name [String] Name of an Azure Resource group. @param automation_account_name [String] The name of the automation account. @param type_name [String] The name of type. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Retrieve", "a", "list", "of", "fields", "of", "a", "given", "type", "across", "all", "accessible", "modules", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_automation/lib/2015-10-31/generated/azure_mgmt_automation/object_data_types.rb#L154-L156
train
Gets the list of fields of the specified type.
[ 30522, 13366, 2862, 1035, 4249, 1035, 2011, 1035, 2828, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 19309, 1035, 4070, 1035, 2171, 1010, 2828, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb
Azure::Resources::Mgmt::V2016_02_01.Resources.create_or_update_with_http_info
def create_or_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value! end
ruby
def create_or_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:nil) create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers:custom_headers).value! end
[ "def", "create_or_update_with_http_info", "(", "resource_group_name", ",", "resource_provider_namespace", ",", "parent_resource_path", ",", "resource_type", ",", "resource_name", ",", "api_version", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "create_or_updat...
Create a resource. @param resource_group_name [String] The name of the resource group. The name is case insensitive. @param resource_provider_namespace [String] Resource identity. @param parent_resource_path [String] Resource identity. @param resource_type [String] Resource identity. @param resource_name [String] Resource identity. @param api_version [String] @param parameters [GenericResource] Create or update resource parameters. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Create", "a", "resource", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_resources/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb#L404-L406
train
Creates or updates a resource.
[ 30522, 13366, 3443, 1035, 2030, 1035, 10651, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 7692, 1035, 10802, 1035, 3415, 15327, 1010, 6687, 1035, 7692, 1035, 4130, 1010, 7692, 1035, 2828, 1010, 7692, 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...
david942j/one_gadget
lib/one_gadget/helper.rb
OneGadget.Helper.url_request
def url_request(url) uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = ::OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) raise ArgumentError, "Fail to get response of #{url}" unless %w[200 302].include?(response.code) response.code == '302' ? response['location'] : response.body rescue NoMethodError, SocketError, ArgumentError => e OneGadget::Logger.error(e.message) nil end
ruby
def url_request(url) uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = ::OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) raise ArgumentError, "Fail to get response of #{url}" unless %w[200 302].include?(response.code) response.code == '302' ? response['location'] : response.body rescue NoMethodError, SocketError, ArgumentError => e OneGadget::Logger.error(e.message) nil end
[ "def", "url_request", "(", "url", ")", "uri", "=", "URI", ".", "parse", "(", "url", ")", "http", "=", "Net", "::", "HTTP", ".", "new", "(", "uri", ".", "host", ",", "uri", ".", "port", ")", "http", ".", "use_ssl", "=", "true", "http", ".", "ver...
Get request. @param [String] url The url. @return [String] The request response body. If the response is +302 Found+, returns the location in header.
[ "Get", "request", "." ]
ff6ef04541e83441bfe3c2664a6febd1640f4263
https://github.com/david942j/one_gadget/blob/ff6ef04541e83441bfe3c2664a6febd1640f4263/lib/one_gadget/helper.rb#L173-L188
train
Get the response of a URL
[ 30522, 13366, 24471, 2140, 1035, 5227, 1006, 24471, 2140, 1007, 24471, 2072, 1027, 24471, 2072, 1012, 11968, 3366, 1006, 24471, 2140, 1007, 8299, 1027, 5658, 1024, 1024, 8299, 1012, 2047, 1006, 24471, 2072, 1012, 3677, 1010, 24471, 2072, 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...
ruby/rake
lib/rake/task_arguments.rb
Rake.TaskArguments.new_scope
def new_scope(names) values = names.map { |n| self[n] } self.class.new(names, values + extras, self) end
ruby
def new_scope(names) values = names.map { |n| self[n] } self.class.new(names, values + extras, self) end
[ "def", "new_scope", "(", "names", ")", "values", "=", "names", ".", "map", "{", "|", "n", "|", "self", "[", "n", "]", "}", "self", ".", "class", ".", "new", "(", "names", ",", "values", "+", "extras", ",", "self", ")", "end" ]
Create a new argument scope using the prerequisite argument names.
[ "Create", "a", "new", "argument", "scope", "using", "the", "prerequisite", "argument", "names", "." ]
1c22b490ee6cb8bd614fa8d0d6145f671466206b
https://github.com/ruby/rake/blob/1c22b490ee6cb8bd614fa8d0d6145f671466206b/lib/rake/task_arguments.rb#L38-L41
train
Creates a new scope with the given names.
[ 30522, 13366, 2047, 1035, 9531, 1006, 3415, 1007, 5300, 1027, 3415, 1012, 4949, 1063, 1064, 1050, 1064, 2969, 1031, 1050, 1033, 1065, 2969, 1012, 2465, 1012, 2047, 1006, 3415, 1010, 5300, 1009, 26279, 1010, 2969, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_generate_vpn_profile
def begin_generate_vpn_profile(resource_group_name, gateway_name, parameters, custom_headers:nil) response = begin_generate_vpn_profile_async(resource_group_name, gateway_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def begin_generate_vpn_profile(resource_group_name, gateway_name, parameters, custom_headers:nil) response = begin_generate_vpn_profile_async(resource_group_name, gateway_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "begin_generate_vpn_profile", "(", "resource_group_name", ",", "gateway_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_generate_vpn_profile_async", "(", "resource_group_name", ",", "gateway_name", ",", "parameters", ",", ...
Generates VPN profile for P2S client of the P2SVpnGateway in the specified resource group. @param resource_group_name [String] The name of the resource group. @param gateway_name [String] The name of the P2SVpnGateway. @param parameters [P2SVpnProfileParameters] Parameters supplied to the generate P2SVpnGateway VPN client package operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [VpnProfileResponse] operation results.
[ "Generates", "VPN", "profile", "for", "P2S", "client", "of", "the", "P2SVpnGateway", "in", "the", "specified", "resource", "group", "." ]
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#L816-L819
train
Generates a vpn profile for the specified virtual wan gateway.
[ 30522, 13366, 4088, 1035, 9699, 1035, 21210, 2078, 1035, 6337, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 11909, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 9699, 1035, 30524, 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
management/azure_mgmt_key_vault/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb
Azure::KeyVault::Mgmt::V2018_02_14.Vaults.update_access_policy_with_http_info
def update_access_policy_with_http_info(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil) update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:custom_headers).value! end
ruby
def update_access_policy_with_http_info(resource_group_name, vault_name, operation_kind, parameters, custom_headers:nil) update_access_policy_async(resource_group_name, vault_name, operation_kind, parameters, custom_headers:custom_headers).value! end
[ "def", "update_access_policy_with_http_info", "(", "resource_group_name", ",", "vault_name", ",", "operation_kind", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "update_access_policy_async", "(", "resource_group_name", ",", "vault_name", ",", "operation_kind",...
Update access policies in a key vault in the specified subscription. @param resource_group_name [String] The name of the Resource Group to which the vault belongs. @param vault_name [String] Name of the vault @param operation_kind [AccessPolicyUpdateKind] Name of the operation. Possible values include: 'add', 'replace', 'remove' @param parameters [VaultAccessPolicyParameters] Access policy to merge into the vault @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", "access", "policies", "in", "a", "key", "vault", "in", "the", "specified", "subscription", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_key_vault/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb#L404-L406
train
Updates the access policy of the specified vault.
[ 30522, 13366, 10651, 1035, 3229, 1035, 3343, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 11632, 1035, 2171, 1010, 3169, 1035, 2785, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 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...
square/connect-ruby-sdk
lib/square_connect/models/shift.rb
SquareConnect.Shift.start_at=
def start_at=(start_at) if start_at.nil? fail ArgumentError, "start_at cannot be nil" end if start_at.to_s.length < 1 fail ArgumentError, "invalid value for 'start_at', the character length must be great than or equal to 1." end @start_at = start_at end
ruby
def start_at=(start_at) if start_at.nil? fail ArgumentError, "start_at cannot be nil" end if start_at.to_s.length < 1 fail ArgumentError, "invalid value for 'start_at', the character length must be great than or equal to 1." end @start_at = start_at end
[ "def", "start_at", "=", "(", "start_at", ")", "if", "start_at", ".", "nil?", "fail", "ArgumentError", ",", "\"start_at cannot be nil\"", "end", "if", "start_at", ".", "to_s", ".", "length", "<", "1", "fail", "ArgumentError", ",", "\"invalid value for 'start_at', t...
Custom attribute writer method with validation @param [Object] start_at Value to be assigned
[ "Custom", "attribute", "writer", "method", "with", "validation" ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/models/shift.rb#L236-L246
train
Set the start_at attribute of the record.
[ 30522, 13366, 2707, 1035, 2012, 1027, 1006, 2707, 1035, 2012, 1007, 2065, 2707, 1035, 2012, 1012, 9152, 2140, 1029, 8246, 30524, 1055, 1012, 3091, 1026, 1015, 8246, 6685, 2121, 29165, 1010, 1000, 19528, 3643, 2005, 1005, 2707, 1035, 2012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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_provisioned_fabric_code_version_info_list_with_http_info
def get_provisioned_fabric_code_version_info_list_with_http_info(code_version:nil, timeout:60, custom_headers:nil) get_provisioned_fabric_code_version_info_list_async(code_version:code_version, timeout:timeout, custom_headers:custom_headers).value! end
ruby
def get_provisioned_fabric_code_version_info_list_with_http_info(code_version:nil, timeout:60, custom_headers:nil) get_provisioned_fabric_code_version_info_list_async(code_version:code_version, timeout:timeout, custom_headers:custom_headers).value! end
[ "def", "get_provisioned_fabric_code_version_info_list_with_http_info", "(", "code_version", ":", "nil", ",", "timeout", ":", "60", ",", "custom_headers", ":", "nil", ")", "get_provisioned_fabric_code_version_info_list_async", "(", "code_version", ":code_version", ",", "timeou...
Gets a list of fabric code versions that are provisioned in a Service Fabric cluster. Gets a list of information about fabric code versions that are provisioned in the cluster. The parameter CodeVersion can be used to optionally filter the output to only that particular version. @param code_version [String] The product version of Service Fabric. @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", "a", "list", "of", "fabric", "code", "versions", "that", "are", "provisioned", "in", "a", "Service", "Fabric", "cluster", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L1568-L1570
train
Gets the list of fabric code version info.
[ 30522, 13366, 2131, 1035, 9347, 2098, 1035, 8313, 1035, 3642, 1035, 2544, 1035, 18558, 1035, 2862, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 3642, 1035, 2544, 1024, 9152, 2140, 1010, 2051, 5833, 1024, 3438, 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
data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/service_principals.rb
Azure::GraphRbac::V1_6.ServicePrincipals.list_key_credentials
def list_key_credentials(object_id, custom_headers:nil) response = list_key_credentials_async(object_id, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_key_credentials(object_id, custom_headers:nil) response = list_key_credentials_async(object_id, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_key_credentials", "(", "object_id", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_key_credentials_async", "(", "object_id", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "body", "unless", "response", "."...
Get the keyCredentials associated with the specified service principal. @param object_id [String] The object ID of the service principal for which to get keyCredentials. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [KeyCredentialListResult] operation results.
[ "Get", "the", "keyCredentials", "associated", "with", "the", "specified", "service", "principal", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_graph_rbac/lib/1.6/generated/azure_graph_rbac/service_principals.rb#L484-L487
train
Gets the key credentials for the specified object.
[ 30522, 13366, 2862, 1035, 3145, 1035, 22496, 1006, 4874, 1035, 8909, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 2862, 1035, 3145, 1035, 22496, 1035, 2004, 6038, 2278, 1006, 4874, 1035, 8909, 1010, 7661, 1035, 20346, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
CocoaPods/Xcodeproj
lib/xcodeproj/project.rb
Xcodeproj.Project.new_target
def new_target(type, name, platform, deployment_target = nil, product_group = nil, language = nil) product_group ||= products_group ProjectHelper.new_target(self, type, name, platform, deployment_target, product_group, language) end
ruby
def new_target(type, name, platform, deployment_target = nil, product_group = nil, language = nil) product_group ||= products_group ProjectHelper.new_target(self, type, name, platform, deployment_target, product_group, language) end
[ "def", "new_target", "(", "type", ",", "name", ",", "platform", ",", "deployment_target", "=", "nil", ",", "product_group", "=", "nil", ",", "language", "=", "nil", ")", "product_group", "||=", "products_group", "ProjectHelper", ".", "new_target", "(", "self",...
Creates a new target and adds it to the project. The target is configured for the given platform and its file reference it is added to the {products_group}. The target is pre-populated with common build settings, and the appropriate Framework according to the platform is added to to its Frameworks phase. @param [Symbol] type the type of target. Can be `:application`, `:framework`, `:dynamic_library` or `:static_library`. @param [String] name the name of the target product. @param [Symbol] platform the platform of the target. Can be `:ios` or `:osx`. @param [String] deployment_target the deployment target for the platform. @param [PBXGroup] product_group the product group, where to add to a file reference of the created target. @param [Symbol] language the primary language of the target, can be `:objc` or `:swift`. @return [PBXNativeTarget] the target.
[ "Creates", "a", "new", "target", "and", "adds", "it", "to", "the", "project", "." ]
3be1684437a6f8e69c7836ad4c85a2b78663272f
https://github.com/CocoaPods/Xcodeproj/blob/3be1684437a6f8e69c7836ad4c85a2b78663272f/lib/xcodeproj/project.rb#L714-L717
train
Creates a new target
[ 30522, 13366, 2047, 1035, 4539, 1006, 2828, 1010, 2171, 1010, 4132, 1010, 10813, 1035, 4539, 1027, 9152, 2140, 1010, 4031, 1035, 2177, 1027, 9152, 2140, 1010, 2653, 1027, 9152, 2140, 1007, 4031, 1035, 2177, 1064, 1064, 1027, 3688, 1035, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb
Azure::Locks::Mgmt::V2015_01_01.ManagementLocks.delete_at_resource_level_with_http_info
def delete_at_resource_level_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, custom_headers:nil) delete_at_resource_level_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, custom_headers:custom_headers).value! end
ruby
def delete_at_resource_level_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, custom_headers:nil) delete_at_resource_level_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, lock_name, custom_headers:custom_headers).value! end
[ "def", "delete_at_resource_level_with_http_info", "(", "resource_group_name", ",", "resource_provider_namespace", ",", "parent_resource_path", ",", "resource_type", ",", "resource_name", ",", "lock_name", ",", "custom_headers", ":", "nil", ")", "delete_at_resource_level_async",...
Deletes the management lock of a resource or any level below resource. @param resource_group_name [String] The name of the resource group. @param resource_provider_namespace [String] Resource identity. @param parent_resource_path [String] Resource identity. @param resource_type [String] Resource identity. @param resource_name [String] Resource identity. @param lock_name [String] The name of lock. @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", "the", "management", "lock", "of", "a", "resource", "or", "any", "level", "below", "resource", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_locks/lib/2015-01-01/generated/azure_mgmt_locks/management_locks.rb#L490-L492
train
Deletes a resource at resource level.
[ 30522, 13366, 3972, 12870, 1035, 2012, 1035, 7692, 1035, 2504, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 7692, 1035, 2177, 1035, 2171, 1010, 7692, 1035, 10802, 1035, 3415, 15327, 1010, 6687, 1035, 7692, 1035, 4130, 1010, 7692, 1035, 2828, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_states.rb
Azure::PolicyInsights::Mgmt::V2018_04_04.PolicyStates.summarize_for_resource_group_level_policy_assignment_with_http_info
def summarize_for_resource_group_level_policy_assignment_with_http_info(subscription_id, resource_group_name, policy_assignment_name, query_options:nil, custom_headers:nil) summarize_for_resource_group_level_policy_assignment_async(subscription_id, resource_group_name, policy_assignment_name, query_options:query_options, custom_headers:custom_headers).value! end
ruby
def summarize_for_resource_group_level_policy_assignment_with_http_info(subscription_id, resource_group_name, policy_assignment_name, query_options:nil, custom_headers:nil) summarize_for_resource_group_level_policy_assignment_async(subscription_id, resource_group_name, policy_assignment_name, query_options:query_options, custom_headers:custom_headers).value! end
[ "def", "summarize_for_resource_group_level_policy_assignment_with_http_info", "(", "subscription_id", ",", "resource_group_name", ",", "policy_assignment_name", ",", "query_options", ":", "nil", ",", "custom_headers", ":", "nil", ")", "summarize_for_resource_group_level_policy_assi...
Summarizes policy states for the resource group level policy assignment. @param subscription_id [String] Microsoft Azure subscription ID. @param resource_group_name [String] Resource group name. @param policy_assignment_name [String] Policy assignment name. @param query_options [QueryOptions] Additional parameters for the operation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [MsRestAzure::AzureOperationResponse] HTTP response information.
[ "Summarizes", "policy", "states", "for", "the", "resource", "group", "level", "policy", "assignment", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-04-04/generated/azure_mgmt_policy_insights/policy_states.rb#L1901-L1903
train
Gets the policy specification for the subscription level policy assignment.
[ 30522, 13366, 7680, 7849, 4697, 1035, 2005, 1035, 7692, 1035, 2177, 1035, 2504, 1035, 3343, 1035, 8775, 1035, 2007, 1035, 8299, 1035, 18558, 1006, 15002, 1035, 8909, 1010, 7692, 1035, 2177, 1035, 2171, 1010, 3343, 1035, 8775, 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...
octokit/octokit.rb
lib/octokit/client.rb
Octokit.Client.as_app
def as_app(key = client_id, secret = client_secret, &block) if key.to_s.empty? || secret.to_s.empty? raise ApplicationCredentialsRequired, "client_id and client_secret required" end app_client = self.dup app_client.client_id = app_client.client_secret = nil app_client.login = key app_client.password = secret yield app_client if block_given? end
ruby
def as_app(key = client_id, secret = client_secret, &block) if key.to_s.empty? || secret.to_s.empty? raise ApplicationCredentialsRequired, "client_id and client_secret required" end app_client = self.dup app_client.client_id = app_client.client_secret = nil app_client.login = key app_client.password = secret yield app_client if block_given? end
[ "def", "as_app", "(", "key", "=", "client_id", ",", "secret", "=", "client_secret", ",", "&", "block", ")", "if", "key", ".", "to_s", ".", "empty?", "||", "secret", ".", "to_s", ".", "empty?", "raise", "ApplicationCredentialsRequired", ",", "\"client_id and ...
Duplicate client using client_id and client_secret as Basic Authentication credentials. @example Octokit.client_id = "foo" Octokit.client_secret = "bar" # GET https://api.github.com/?client_id=foo&client_secret=bar Octokit.get "/" Octokit.client.as_app do |client| # GET https://foo:bar@api.github.com/ client.get "/" end
[ "Duplicate", "client", "using", "client_id", "and", "client_secret", "as", "Basic", "Authentication", "credentials", ".", "@example", "Octokit", ".", "client_id", "=", "foo", "Octokit", ".", "client_secret", "=", "bar" ]
ddf750601529a6a7da5fe5293d10031709b8605d
https://github.com/octokit/octokit.rb/blob/ddf750601529a6a7da5fe5293d10031709b8605d/lib/octokit/client.rb#L161-L171
train
Creates an ApplicationClient object.
[ 30522, 13366, 2004, 1035, 10439, 1006, 3145, 1027, 7396, 1035, 8909, 1010, 3595, 1027, 7396, 1035, 3595, 1010, 1004, 3796, 1007, 2065, 3145, 1012, 2000, 1035, 1055, 1012, 4064, 1029, 1064, 1064, 3595, 1012, 2000, 1035, 1055, 1012, 4064, 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...
decidim/decidim
decidim-core/app/helpers/decidim/scopes_helper.rb
Decidim.ScopesHelper.scopes_picker_filter
def scopes_picker_filter(form, name, checkboxes_on_top = true) options = { multiple: true, legend_title: I18n.t("decidim.scopes.scopes"), label: false, checkboxes_on_top: checkboxes_on_top } form.scopes_picker name, options do |scope| { url: decidim.scopes_picker_path( root: try(:current_participatory_space)&.scope, current: scope&.id, title: I18n.t("decidim.scopes.prompt"), global_value: "global" ), text: scope_name_for_picker(scope, I18n.t("decidim.scopes.prompt")) } end end
ruby
def scopes_picker_filter(form, name, checkboxes_on_top = true) options = { multiple: true, legend_title: I18n.t("decidim.scopes.scopes"), label: false, checkboxes_on_top: checkboxes_on_top } form.scopes_picker name, options do |scope| { url: decidim.scopes_picker_path( root: try(:current_participatory_space)&.scope, current: scope&.id, title: I18n.t("decidim.scopes.prompt"), global_value: "global" ), text: scope_name_for_picker(scope, I18n.t("decidim.scopes.prompt")) } end end
[ "def", "scopes_picker_filter", "(", "form", ",", "name", ",", "checkboxes_on_top", "=", "true", ")", "options", "=", "{", "multiple", ":", "true", ",", "legend_title", ":", "I18n", ".", "t", "(", "\"decidim.scopes.scopes\"", ")", ",", "label", ":", "false", ...
Renders a scopes picker field in a filter form. form - FilterFormBuilder object name - attribute name checkboxes_on_top - Show picker values on top (default) or below the picker prompt Returns nothing.
[ "Renders", "a", "scopes", "picker", "field", "in", "a", "filter", "form", ".", "form", "-", "FilterFormBuilder", "object", "name", "-", "attribute", "name", "checkboxes_on_top", "-", "Show", "picker", "values", "on", "top", "(", "default", ")", "or", "below"...
6e2b14e559a63088669904e3c5c49a5180700cf7
https://github.com/decidim/decidim/blob/6e2b14e559a63088669904e3c5c49a5180700cf7/decidim-core/app/helpers/decidim/scopes_helper.rb#L70-L89
train
Returns a scope picker filter
[ 30522, 13366, 9531, 2015, 1035, 4060, 2121, 1035, 11307, 1006, 2433, 1010, 2171, 1010, 4638, 8758, 2229, 1035, 2006, 1035, 2327, 1027, 2995, 1007, 7047, 1027, 1063, 3674, 1024, 2995, 1010, 5722, 1035, 2516, 1024, 1045, 15136, 2078, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
square/connect-ruby-sdk
lib/square_connect/api/v1_items_api.rb
SquareConnect.V1ItemsApi.remove_fee
def remove_fee(location_id, item_id, fee_id, opts = {}) data, _status_code, _headers = remove_fee_with_http_info(location_id, item_id, fee_id, opts) return data end
ruby
def remove_fee(location_id, item_id, fee_id, opts = {}) data, _status_code, _headers = remove_fee_with_http_info(location_id, item_id, fee_id, opts) return data end
[ "def", "remove_fee", "(", "location_id", ",", "item_id", ",", "fee_id", ",", "opts", "=", "{", "}", ")", "data", ",", "_status_code", ",", "_headers", "=", "remove_fee_with_http_info", "(", "location_id", ",", "item_id", ",", "fee_id", ",", "opts", ")", "r...
RemoveFee Removes a fee assocation from an item, meaning the fee is no longer automatically applied to the item in Square Register. @param location_id The ID of the fee&#39;s associated location. @param item_id The ID of the item to add the fee to. @param fee_id The ID of the fee to apply. @param [Hash] opts the optional parameters @return [V1Item]
[ "RemoveFee", "Removes", "a", "fee", "assocation", "from", "an", "item", "meaning", "the", "fee", "is", "no", "longer", "automatically", "applied", "to", "the", "item", "in", "Square", "Register", "." ]
798eb9ded716f23b9f1518386f1c311a34bca8bf
https://github.com/square/connect-ruby-sdk/blob/798eb9ded716f23b9f1518386f1c311a34bca8bf/lib/square_connect/api/v1_items_api.rb#L1635-L1638
train
Remove a fee from a item
[ 30522, 13366, 6366, 1035, 7408, 1006, 3295, 1035, 8909, 1010, 8875, 1035, 8909, 1010, 7408, 1035, 8909, 1010, 23569, 2015, 1027, 1063, 1065, 1007, 2951, 1010, 1035, 3570, 1035, 3642, 1010, 1035, 20346, 2015, 1027, 6366, 1035, 7408, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
kaminari/kaminari
kaminari-core/lib/kaminari/models/page_scope_methods.rb
Kaminari.PageScopeMethods.total_pages
def total_pages count_without_padding = total_count count_without_padding -= @_padding if defined?(@_padding) && @_padding count_without_padding = 0 if count_without_padding < 0 total_pages_count = (count_without_padding.to_f / limit_value).ceil max_pages && (max_pages < total_pages_count) ? max_pages : total_pages_count rescue FloatDomainError raise ZeroPerPageOperation, "The number of total pages was incalculable. Perhaps you called .per(0)?" end
ruby
def total_pages count_without_padding = total_count count_without_padding -= @_padding if defined?(@_padding) && @_padding count_without_padding = 0 if count_without_padding < 0 total_pages_count = (count_without_padding.to_f / limit_value).ceil max_pages && (max_pages < total_pages_count) ? max_pages : total_pages_count rescue FloatDomainError raise ZeroPerPageOperation, "The number of total pages was incalculable. Perhaps you called .per(0)?" end
[ "def", "total_pages", "count_without_padding", "=", "total_count", "count_without_padding", "-=", "@_padding", "if", "defined?", "(", "@_padding", ")", "&&", "@_padding", "count_without_padding", "=", "0", "if", "count_without_padding", "<", "0", "total_pages_count", "=...
Total number of pages
[ "Total", "number", "of", "pages" ]
e2078ce46b145b811423dc8b5993e4bc87dc88b8
https://github.com/kaminari/kaminari/blob/e2078ce46b145b811423dc8b5993e4bc87dc88b8/kaminari-core/lib/kaminari/models/page_scope_methods.rb#L35-L44
train
Returns the number of pages in the current page.
[ 30522, 13366, 2561, 1035, 5530, 4175, 1035, 2302, 1035, 11687, 4667, 1027, 2561, 1035, 4175, 4175, 1035, 2302, 1035, 11687, 4667, 1011, 1027, 1030, 1035, 11687, 4667, 2065, 4225, 1029, 1006, 1030, 1035, 11687, 4667, 1007, 1004, 1004, 1030, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_key_vault/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb
Azure::KeyVault::Mgmt::V2018_02_14.Vaults.begin_purge_deleted
def begin_purge_deleted(vault_name, location, custom_headers:nil) response = begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers).value! nil end
ruby
def begin_purge_deleted(vault_name, location, custom_headers:nil) response = begin_purge_deleted_async(vault_name, location, custom_headers:custom_headers).value! nil end
[ "def", "begin_purge_deleted", "(", "vault_name", ",", "location", ",", "custom_headers", ":", "nil", ")", "response", "=", "begin_purge_deleted_async", "(", "vault_name", ",", "location", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "nil", "end" ]
Permanently deletes the specified vault. aka Purges the deleted Azure key vault. @param vault_name [String] The name of the soft-deleted vault. @param location [String] The location of the soft-deleted vault. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Permanently", "deletes", "the", "specified", "vault", ".", "aka", "Purges", "the", "deleted", "Azure", "key", "vault", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_key_vault/lib/2018-02-14/generated/azure_mgmt_key_vault/vaults.rb#L1217-L1220
train
Purges deleted vaults.
[ 30522, 13366, 4088, 1035, 24694, 1035, 17159, 1006, 11632, 1035, 2171, 1010, 3295, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 4088, 1035, 24694, 1035, 17159, 1035, 2004, 6038, 2278, 1006, 11632, 1035, 2171, 1010, 329...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/api.rb
Azure::ApiManagement::Mgmt::V2018_01_01.Api.list_by_tags_next
def list_by_tags_next(next_page_link, custom_headers:nil) response = list_by_tags_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def list_by_tags_next(next_page_link, custom_headers:nil) response = list_by_tags_next_async(next_page_link, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "list_by_tags_next", "(", "next_page_link", ",", "custom_headers", ":", "nil", ")", "response", "=", "list_by_tags_next_async", "(", "next_page_link", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "response", ".", "body", "unless", "response", ...
Lists a collection of apis associated with tags. @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 [TagResourceCollection] operation results.
[ "Lists", "a", "collection", "of", "apis", "associated", "with", "tags", "." ]
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/api.rb#L989-L992
train
Gets the list of a collection of image objects by tag.
[ 30522, 13366, 2862, 1035, 30524, 20346, 2015, 1007, 1012, 3643, 999, 3433, 1012, 2303, 4983, 3433, 1012, 9152, 2140, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
haml/haml
lib/haml/util.rb
Haml.Util.balance
def balance(scanner, start, finish, count = 0) str = ''.dup scanner = StringScanner.new(scanner) unless scanner.is_a? StringScanner regexp = Regexp.new("(.*?)[\\#{start.chr}\\#{finish.chr}]", Regexp::MULTILINE) while scanner.scan(regexp) str << scanner.matched count += 1 if scanner.matched[-1] == start count -= 1 if scanner.matched[-1] == finish return [str.strip, scanner.rest] if count == 0 end end
ruby
def balance(scanner, start, finish, count = 0) str = ''.dup scanner = StringScanner.new(scanner) unless scanner.is_a? StringScanner regexp = Regexp.new("(.*?)[\\#{start.chr}\\#{finish.chr}]", Regexp::MULTILINE) while scanner.scan(regexp) str << scanner.matched count += 1 if scanner.matched[-1] == start count -= 1 if scanner.matched[-1] == finish return [str.strip, scanner.rest] if count == 0 end end
[ "def", "balance", "(", "scanner", ",", "start", ",", "finish", ",", "count", "=", "0", ")", "str", "=", "''", ".", "dup", "scanner", "=", "StringScanner", ".", "new", "(", "scanner", ")", "unless", "scanner", ".", "is_a?", "StringScanner", "regexp", "=...
Moves a scanner through a balanced pair of characters. For example: Foo (Bar (Baz bang) bop) (Bang (bop bip)) ^ ^ from to @param scanner [StringScanner] The string scanner to move @param start [String] The character opening the balanced pair. @param finish [String] The character closing the balanced pair. @param count [Fixnum] The number of opening characters matched before calling this method @return [(String, String)] The string matched within the balanced pair and the rest of the string. `["Foo (Bar (Baz bang) bop)", " (Bang (bop bip))"]` in the example above.
[ "Moves", "a", "scanner", "through", "a", "balanced", "pair", "of", "characters", ".", "For", "example", ":" ]
9aa0fbe4a91b999978927be569d2ad0cd39076f1
https://github.com/haml/haml/blob/9aa0fbe4a91b999978927be569d2ad0cd39076f1/lib/haml/util.rb#L168-L178
train
balance a string with the given start and finish
[ 30522, 13366, 5703, 1006, 26221, 1010, 2707, 1010, 3926, 1010, 4175, 1027, 1014, 1007, 2358, 2099, 1027, 1005, 1005, 1012, 4241, 2361, 26221, 1027, 7817, 9336, 3678, 1012, 2047, 1006, 26221, 1007, 4983, 26221, 1012, 2003, 1035, 1037, 1029, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
github/linguist
samples/Ruby/sinatra.rb
Sinatra.Base.forward
def forward fail "downstream app not set" unless @app.respond_to? :call status, headers, body = @app.call env @response.status = status @response.body = body @response.headers.merge! headers nil end
ruby
def forward fail "downstream app not set" unless @app.respond_to? :call status, headers, body = @app.call env @response.status = status @response.body = body @response.headers.merge! headers nil end
[ "def", "forward", "fail", "\"downstream app not set\"", "unless", "@app", ".", "respond_to?", ":call", "status", ",", "headers", ",", "body", "=", "@app", ".", "call", "env", "@response", ".", "status", "=", "status", "@response", ".", "body", "=", "body", "...
Forward the request to the downstream app -- middleware only.
[ "Forward", "the", "request", "to", "the", "downstream", "app", "--", "middleware", "only", "." ]
9116c90fcbb82ac03b4b33c58cfbde1fcf745e99
https://github.com/github/linguist/blob/9116c90fcbb82ac03b4b33c58cfbde1fcf745e99/samples/Ruby/sinatra.rb#L820-L827
train
forward the response to the downstream app
[ 30522, 13366, 2830, 8246, 1000, 13248, 10439, 2025, 2275, 1000, 4983, 1030, 10439, 1012, 6869, 1035, 2000, 1029, 1024, 2655, 3570, 1010, 20346, 2015, 1010, 2303, 1027, 1030, 10439, 1012, 2655, 4372, 2615, 1030, 3433, 1012, 3570, 1027, 3570,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replicationv_centers.rb
Azure::RecoveryServicesSiteRecovery::Mgmt::V2018_01_10.ReplicationvCenters.delete
def delete(fabric_name, v_center_name, custom_headers:nil) response = delete_async(fabric_name, v_center_name, custom_headers:custom_headers).value! nil end
ruby
def delete(fabric_name, v_center_name, custom_headers:nil) response = delete_async(fabric_name, v_center_name, custom_headers:custom_headers).value! nil end
[ "def", "delete", "(", "fabric_name", ",", "v_center_name", ",", "custom_headers", ":", "nil", ")", "response", "=", "delete_async", "(", "fabric_name", ",", "v_center_name", ",", "custom_headers", ":custom_headers", ")", ".", "value!", "nil", "end" ]
Remove vCenter operation. The operation to remove(unregister) a registered vCenter server from the vault. @param fabric_name [String] Fabric name. @param v_center_name [String] vCenter name. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
[ "Remove", "vCenter", "operation", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_recovery_services_site_recovery/lib/2018-01-10/generated/azure_mgmt_recovery_services_site_recovery/replicationv_centers.rb#L279-L282
train
Deletes a virtual network in a fabric.
[ 30522, 13366, 3972, 12870, 1006, 8313, 1035, 2171, 1010, 1058, 1035, 2415, 1035, 2171, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 3972, 12870, 1035, 2004, 6038, 2278, 1006, 8313, 1035, 2171, 1010, 1058, 1035, 2415, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb
Azure::PolicyInsights::Mgmt::V2018_07_01_preview.Remediations.create_or_update_at_resource
def create_or_update_at_resource(resource_id, remediation_name, parameters, custom_headers:nil) response = create_or_update_at_resource_async(resource_id, remediation_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def create_or_update_at_resource(resource_id, remediation_name, parameters, custom_headers:nil) response = create_or_update_at_resource_async(resource_id, remediation_name, parameters, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "create_or_update_at_resource", "(", "resource_id", ",", "remediation_name", ",", "parameters", ",", "custom_headers", ":", "nil", ")", "response", "=", "create_or_update_at_resource_async", "(", "resource_id", ",", "remediation_name", ",", "parameters", ",", "cu...
Creates or updates a remediation at resource scope. @param resource_id [String] Resource ID. @param remediation_name [String] The name of the remediation. @param parameters [Remediation] The remediation parameters. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Remediation] operation results.
[ "Creates", "or", "updates", "a", "remediation", "at", "resource", "scope", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/management/azure_mgmt_policy_insights/lib/2018-07-01-preview/generated/azure_mgmt_policy_insights/remediations.rb#L2061-L2064
train
Creates or updates a remediation at resource scope.
[ 30522, 13366, 3443, 1035, 2030, 1035, 10651, 1035, 2012, 1035, 7692, 1006, 7692, 1035, 8909, 1010, 2128, 16969, 3508, 1035, 2171, 1010, 11709, 1010, 7661, 1035, 20346, 2015, 1024, 9152, 2140, 1007, 3433, 1027, 3443, 1035, 2030, 1035, 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/rails
activesupport/lib/active_support/inflector/methods.rb
ActiveSupport.Inflector.demodulize
def demodulize(path) path = path.to_s if i = path.rindex("::") path[(i + 2)..-1] else path end end
ruby
def demodulize(path) path = path.to_s if i = path.rindex("::") path[(i + 2)..-1] else path end end
[ "def", "demodulize", "(", "path", ")", "path", "=", "path", ".", "to_s", "if", "i", "=", "path", ".", "rindex", "(", "\"::\"", ")", "path", "[", "(", "i", "+", "2", ")", "..", "-", "1", "]", "else", "path", "end", "end" ]
Removes the module part from the expression in the string. demodulize('ActiveSupport::Inflector::Inflections') # => "Inflections" demodulize('Inflections') # => "Inflections" demodulize('::Inflections') # => "Inflections" demodulize('') # => "" See also #deconstantize.
[ "Removes", "the", "module", "part", "from", "the", "expression", "in", "the", "string", "." ]
85a8bc644be69908f05740a5886ec19cd3679df5
https://github.com/rails/rails/blob/85a8bc644be69908f05740a5886ec19cd3679df5/activesupport/lib/active_support/inflector/methods.rb#L220-L227
train
demodulize a path
[ 30522, 13366, 9703, 8566, 3669, 4371, 1006, 4130, 1007, 4130, 1027, 4130, 1012, 2000, 1035, 1055, 2065, 1045, 1027, 4130, 1012, 15544, 13629, 2595, 1006, 1000, 1024, 1024, 1000, 1007, 4130, 1031, 1006, 1045, 1009, 1016, 1007, 1012, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Azure/azure-sdk-for-ruby
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_containers_event_list
def get_containers_event_list(start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil) response = get_containers_event_list_async(start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value! response.body unless response.nil? end
ruby
def get_containers_event_list(start_time_utc, end_time_utc, timeout:60, events_types_filter:nil, exclude_analysis_events:nil, skip_correlation_lookup:nil, custom_headers:nil) response = get_containers_event_list_async(start_time_utc, end_time_utc, timeout:timeout, events_types_filter:events_types_filter, exclude_analysis_events:exclude_analysis_events, skip_correlation_lookup:skip_correlation_lookup, custom_headers:custom_headers).value! response.body unless response.nil? end
[ "def", "get_containers_event_list", "(", "start_time_utc", ",", "end_time_utc", ",", "timeout", ":", "60", ",", "events_types_filter", ":", "nil", ",", "exclude_analysis_events", ":", "nil", ",", "skip_correlation_lookup", ":", "nil", ",", "custom_headers", ":", "ni...
Gets all Containers-related events. The response is list of ContainerInstanceEvent objects. @param start_time_utc [String] The start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. @param end_time_utc [String] The end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. @param timeout [Integer] The server timeout for performing the operation in seconds. This timeout specifies the time duration that the client is willing to wait for the requested operation to complete. The default value for this parameter is 60 seconds. @param events_types_filter [String] This is a comma separated string specifying the types of FabricEvents that should only be included in the response. @param exclude_analysis_events [Boolean] This param disables the retrieval of AnalysisEvents if true is passed. @param skip_correlation_lookup [Boolean] This param disables the search of CorrelatedEvents information if true is passed. otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets populated. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request. @return [Array] operation results.
[ "Gets", "all", "Containers", "-", "related", "events", "." ]
78eedacf8f8cbd65c2d8a2af421405eaa4373d8e
https://github.com/Azure/azure-sdk-for-ruby/blob/78eedacf8f8cbd65c2d8a2af421405eaa4373d8e/data/azure_service_fabric/lib/6.2.0.9/generated/azure_service_fabric/service_fabric_client_apis.rb#L27370-L27373
train
Gets the list of containers events.
[ 30522, 13366, 2131, 1035, 16143, 1035, 2724, 1035, 2862, 1006, 2707, 1035, 2051, 1035, 11396, 1010, 2203, 1035, 2051, 1035, 11396, 1010, 2051, 5833, 1024, 3438, 1010, 2824, 1035, 4127, 1035, 11307, 1024, 9152, 2140, 1010, 23329, 1035, 4106,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
meew0/discordrb
lib/discordrb/data/role.rb
Discordrb.Role.update_from
def update_from(other) @permissions = other.permissions @name = other.name @hoist = other.hoist @colour = other.colour @position = other.position @managed = other.managed end
ruby
def update_from(other) @permissions = other.permissions @name = other.name @hoist = other.hoist @colour = other.colour @position = other.position @managed = other.managed end
[ "def", "update_from", "(", "other", ")", "@permissions", "=", "other", ".", "permissions", "@name", "=", "other", ".", "name", "@hoist", "=", "other", ".", "hoist", "@colour", "=", "other", ".", "colour", "@position", "=", "other", ".", "position", "@manag...
Updates the data cache from another Role object @note For internal use only @!visibility private
[ "Updates", "the", "data", "cache", "from", "another", "Role", "object" ]
764298a1ff0be69a1853b510d736f21c2b91a2fe
https://github.com/meew0/discordrb/blob/764298a1ff0be69a1853b510d736f21c2b91a2fe/lib/discordrb/data/role.rb#L88-L95
train
Update the object from another object
[ 30522, 13366, 10651, 1035, 2013, 1006, 2060, 1007, 1030, 6656, 2015, 1027, 2060, 1012, 6656, 2015, 1030, 2171, 1027, 2060, 1012, 2171, 1030, 7570, 2923, 1027, 2060, 1012, 7570, 2923, 1030, 6120, 1027, 2060, 1012, 6120, 1030, 2597, 1027, 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...
seejohnrun/ice_cube
lib/ice_cube/occurrence.rb
IceCube.Occurrence.to_s
def to_s(format=nil) if format && to_time.public_method(:to_s).arity != 0 t0, t1 = start_time.to_s(format), end_time.to_s(format) else t0, t1 = start_time.to_s, end_time.to_s end duration > 0 ? "#{t0} - #{t1}" : t0 end
ruby
def to_s(format=nil) if format && to_time.public_method(:to_s).arity != 0 t0, t1 = start_time.to_s(format), end_time.to_s(format) else t0, t1 = start_time.to_s, end_time.to_s end duration > 0 ? "#{t0} - #{t1}" : t0 end
[ "def", "to_s", "(", "format", "=", "nil", ")", "if", "format", "&&", "to_time", ".", "public_method", "(", ":to_s", ")", ".", "arity", "!=", "0", "t0", ",", "t1", "=", "start_time", ".", "to_s", "(", "format", ")", ",", "end_time", ".", "to_s", "("...
Shows both the start and end time if there is a duration. Optional format argument (e.g. :long, :short) supports Rails time formats and is only used when ActiveSupport is available.
[ "Shows", "both", "the", "start", "and", "end", "time", "if", "there", "is", "a", "duration", ".", "Optional", "format", "argument", "(", "e", ".", "g", ".", ":", "long", ":", "short", ")", "supports", "Rails", "time", "formats", "and", "is", "only", ...
fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd
https://github.com/seejohnrun/ice_cube/blob/fb6c657bdc4f87dfda2bf83f15c5f487b78ccabd/lib/ice_cube/occurrence.rb#L88-L95
train
Returns the string representation of the time.
[ 30522, 13366, 2000, 1035, 1055, 1006, 4289, 1027, 9152, 2140, 1007, 2065, 4289, 1004, 1004, 2000, 1035, 2051, 1012, 2270, 1035, 4118, 1006, 1024, 2000, 1035, 1055, 1007, 1012, 10488, 3723, 999, 1027, 1014, 1056, 2692, 1010, 1056, 2487, 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...
puppetlabs/puppet
lib/puppet/type.rb
Puppet.Type.finish
def finish # Call post_compile hook on every parameter that implements it. This includes all subclasses # of parameter including, but not limited to, regular parameters, metaparameters, relationship # parameters, and properties. eachparameter do |parameter| parameter.post_compile if parameter.respond_to? :post_compile end # Make sure all of our relationships are valid. Again, must be done # when the entire catalog is instantiated. self.class.relationship_params.collect do |klass| if param = @parameters[klass.name] param.validate_relationship end end.flatten.reject { |r| r.nil? } end
ruby
def finish # Call post_compile hook on every parameter that implements it. This includes all subclasses # of parameter including, but not limited to, regular parameters, metaparameters, relationship # parameters, and properties. eachparameter do |parameter| parameter.post_compile if parameter.respond_to? :post_compile end # Make sure all of our relationships are valid. Again, must be done # when the entire catalog is instantiated. self.class.relationship_params.collect do |klass| if param = @parameters[klass.name] param.validate_relationship end end.flatten.reject { |r| r.nil? } end
[ "def", "finish", "# Call post_compile hook on every parameter that implements it. This includes all subclasses", "# of parameter including, but not limited to, regular parameters, metaparameters, relationship", "# parameters, and properties.", "eachparameter", "do", "|", "parameter", "|", "param...
Finishes any outstanding processing. This method should be called as a final step in setup, to allow the parameters that have associated auto-require needs to be processed. @todo what is the expected sequence here - who is responsible for calling this? When? Is the returned type correct? @return [Array<Puppet::Parameter>] the validated list/set of attributes
[ "Finishes", "any", "outstanding", "processing", ".", "This", "method", "should", "be", "called", "as", "a", "final", "step", "in", "setup", "to", "allow", "the", "parameters", "that", "have", "associated", "auto", "-", "require", "needs", "to", "be", "proces...
4baeed97cbb7571ddc6635f0a24debe2e8b22cd3
https://github.com/puppetlabs/puppet/blob/4baeed97cbb7571ddc6635f0a24debe2e8b22cd3/lib/puppet/type.rb#L2528-L2543
train
Finish the sequence of all the necessary parameters.
[ 30522, 13366, 3926, 1001, 2655, 2695, 1035, 4012, 22090, 8103, 2006, 2296, 16381, 2008, 22164, 2009, 1012, 2023, 2950, 2035, 4942, 26266, 2229, 1001, 1997, 16381, 2164, 1010, 2021, 2025, 3132, 2000, 1010, 3180, 11709, 1010, 18804, 28689, 22...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -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/workweek_config.rb
SquareConnect.WorkweekConfig.start_of_week=
def start_of_week=(start_of_week) validator = EnumAttributeValidator.new('String', ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]) unless validator.valid?(start_of_week) fail ArgumentError, "invalid value for 'start_of_week', must be one of #{validator.allowable_values}." end @start_of_week = start_of_week end
ruby
def start_of_week=(start_of_week) validator = EnumAttributeValidator.new('String', ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]) unless validator.valid?(start_of_week) fail ArgumentError, "invalid value for 'start_of_week', must be one of #{validator.allowable_values}." end @start_of_week = start_of_week end
[ "def", "start_of_week", "=", "(", "start_of_week", ")", "validator", "=", "EnumAttributeValidator", ".", "new", "(", "'String'", ",", "[", "\"MON\"", ",", "\"TUE\"", ",", "\"WED\"", ",", "\"THU\"", ",", "\"FRI\"", ",", "\"SAT\"", ",", "\"SUN\"", "]", ")", ...
Custom attribute writer method checking allowed values (enum). @param [Object] start_of_week 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/workweek_config.rb#L145-L151
train
Set the start of week of the calendar.
[ 30522, 13366, 2707, 1035, 1997, 1035, 2733, 1027, 1006, 2707, 1035, 1997, 1035, 2733, 1007, 9398, 8844, 1027, 4372, 12248, 4779, 3089, 8569, 2618, 10175, 8524, 4263, 1012, 2047, 1006, 1005, 5164, 1005, 1010, 1031, 1000, 12256, 1000, 1010, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...