query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
Sets the requiredResourceAccess property value. Specifies the resources that the application needs to access. This property also specifies the set of delegated permissions and application roles that it needs for each of those resources. This configuration of access to the required resources drives the consent experience. No more than 50 resource services (APIs) can be configured. Beginning midOctober 2021, the total number of required permissions must not exceed 400. For more information, see Limits on requested permissions per app. Not nullable. Supports $filter (eq, not, ge, le). | def required_resource_access=(value)
@required_resource_access = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resource_access=(value)\n @resource_access = value\n end",
"def resource_access=(value)\n @resource_access = value\n end",
"def required_resource_access\n return @required_resource_access\n end",
"def allowed_resource_actions=(... | [
"0.6596939",
"0.6596939",
"0.6355991",
"0.5554773",
"0.5357362",
"0.5313956",
"0.52175397",
"0.52175397",
"0.51960015",
"0.51475227",
"0.51391524",
"0.511961",
"0.5076016",
"0.5035926",
"0.5021054",
"0.49745542",
"0.4968509",
"0.49488378",
"0.49470198",
"0.49083832",
"0.49060... | 0.8004473 | 0 |
Gets the samlMetadataUrl property value. The URL where the service exposes SAML metadata for federation. This property is valid only for singletenant applications. Nullable. | def saml_metadata_url
return @saml_metadata_url
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def saml_metadata_url=(value)\n @saml_metadata_url = value\n end",
"def saml_provider_metadata_url\n @attributes[:saml_provider_metadata_url]\n end",
"def saml_provider_sso_target_url\n @attributes[:saml_provider_sso_target_url]\n end",
"def saml_provider_slo_target_... | [
"0.78090054",
"0.76745623",
"0.6710798",
"0.6479363",
"0.59456694",
"0.5932607",
"0.57739663",
"0.57739663",
"0.55283344",
"0.5523419",
"0.53016025",
"0.51514137",
"0.50956404",
"0.5084086",
"0.4931067",
"0.49233738",
"0.48870504",
"0.48845437",
"0.47900614",
"0.47900614",
"0... | 0.84347904 | 0 |
Sets the samlMetadataUrl property value. The URL where the service exposes SAML metadata for federation. This property is valid only for singletenant applications. Nullable. | def saml_metadata_url=(value)
@saml_metadata_url = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def saml_metadata_url\n return @saml_metadata_url\n end",
"def saml_provider_metadata_url\n @attributes[:saml_provider_metadata_url]\n end",
"def saml_provider_sso_target_url\n @attributes[:saml_provider_sso_target_url]\n end",
"def saml_provider_slo_target_url\n ... | [
"0.68723184",
"0.6211676",
"0.54967153",
"0.53565323",
"0.514694",
"0.514694",
"0.5007568",
"0.48922774",
"0.48922774",
"0.48286548",
"0.48286548",
"0.48286548",
"0.48286548",
"0.47466567",
"0.4605662",
"0.45475265",
"0.45199558",
"0.44898373",
"0.44772848",
"0.44593483",
"0.... | 0.8115865 | 0 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_collection_of_object_values("addIns", @add_ins)
writer.write_object_value("api", @api)
writer.write_string_value("appId", @app_id)
writer.write_collection_of_object_values("appManagementPolicies", @app_management_policies)
writer.write_collection_of_object_values("appRoles", @app_roles)
writer.write_string_value("applicationTemplateId", @application_template_id)
writer.write_object_value("certification", @certification)
writer.write_date_time_value("createdDateTime", @created_date_time)
writer.write_object_value("createdOnBehalfOf", @created_on_behalf_of)
writer.write_string_value("defaultRedirectUri", @default_redirect_uri)
writer.write_string_value("description", @description)
writer.write_string_value("disabledByMicrosoftStatus", @disabled_by_microsoft_status)
writer.write_string_value("displayName", @display_name)
writer.write_collection_of_object_values("extensionProperties", @extension_properties)
writer.write_collection_of_object_values("federatedIdentityCredentials", @federated_identity_credentials)
writer.write_string_value("groupMembershipClaims", @group_membership_claims)
writer.write_collection_of_object_values("homeRealmDiscoveryPolicies", @home_realm_discovery_policies)
writer.write_collection_of_primitive_values("identifierUris", @identifier_uris)
writer.write_object_value("info", @info)
writer.write_boolean_value("isDeviceOnlyAuthSupported", @is_device_only_auth_supported)
writer.write_boolean_value("isFallbackPublicClient", @is_fallback_public_client)
writer.write_collection_of_object_values("keyCredentials", @key_credentials)
writer.write_object_value("logo", @logo)
writer.write_string_value("notes", @notes)
writer.write_boolean_value("oauth2RequirePostResponse", @oauth2_require_post_response)
writer.write_object_value("optionalClaims", @optional_claims)
writer.write_collection_of_object_values("owners", @owners)
writer.write_object_value("parentalControlSettings", @parental_control_settings)
writer.write_collection_of_object_values("passwordCredentials", @password_credentials)
writer.write_object_value("publicClient", @public_client)
writer.write_string_value("publisherDomain", @publisher_domain)
writer.write_object_value("requestSignatureVerification", @request_signature_verification)
writer.write_collection_of_object_values("requiredResourceAccess", @required_resource_access)
writer.write_string_value("samlMetadataUrl", @saml_metadata_url)
writer.write_string_value("serviceManagementReference", @service_management_reference)
writer.write_string_value("signInAudience", @sign_in_audience)
writer.write_object_value("spa", @spa)
writer.write_object_value("synchronization", @synchronization)
writer.write_collection_of_primitive_values("tags", @tags)
writer.write_guid_value("tokenEncryptionKeyId", @token_encryption_key_id)
writer.write_collection_of_object_values("tokenIssuancePolicies", @token_issuance_policies)
writer.write_collection_of_object_values("tokenLifetimePolicies", @token_lifetime_policies)
writer.write_object_value("verifiedPublisher", @verified_publisher)
writer.write_object_value("web", @web)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
... | [
"0.7951372",
"0.7645999",
"0.7579812",
"0.7579812",
"0.7440032",
"0.720861",
"0.720861",
"0.7207583",
"0.7016516",
"0.70007193",
"0.6992252",
"0.69838214",
"0.69723576",
"0.69666415",
"0.69666415",
"0.6942002",
"0.69417155",
"0.6933786",
"0.6913977",
"0.6891677",
"0.68810964"... | 0.0 | -1 |
Gets the serviceManagementReference property value. References application or service contact information from a Service or Asset Management database. Nullable. | def service_management_reference
return @service_management_reference
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_management_reference=(value)\n @service_management_reference = value\n end",
"def service_management_url\n return @service_management_url\n end",
"def cloud_service_management(options = {})\n Azure::CloudServiceManagement::CloudServiceManagem... | [
"0.7204387",
"0.5686265",
"0.5103519",
"0.5025822",
"0.5007907",
"0.49675417",
"0.4890502",
"0.48817918",
"0.4854919",
"0.47961468",
"0.4769057",
"0.47688484",
"0.47457162",
"0.4715931",
"0.4693028",
"0.46914056",
"0.4660478",
"0.45944092",
"0.4582326",
"0.45754018",
"0.45537... | 0.7867816 | 0 |
Sets the serviceManagementReference property value. References application or service contact information from a Service or Asset Management database. Nullable. | def service_management_reference=(value)
@service_management_reference = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_management_reference\n return @service_management_reference\n end",
"def service_management_url=(value)\n @service_management_url = value\n end",
"def cloud_service_management(options = {})\n Azure::CloudServiceManagement::CloudServiceManagem... | [
"0.637827",
"0.54707825",
"0.5396368",
"0.5028023",
"0.49350053",
"0.49207026",
"0.49000823",
"0.4807381",
"0.48064858",
"0.48064858",
"0.47952816",
"0.4744465",
"0.470535",
"0.46906224",
"0.4642008",
"0.4592612",
"0.45859787",
"0.45762724",
"0.45591646",
"0.4538194",
"0.4518... | 0.7795603 | 0 |
Gets the signInAudience property value. Specifies the Microsoft accounts that are supported for the current application. The possible values are: AzureADMyOrg, AzureADMultipleOrgs, AzureADandPersonalMicrosoftAccount (default), and PersonalMicrosoftAccount. See more in the table. The value of this object also limits the number of permissions an app can request. For more information, see Limits on requested permissions per app. The value for this property has implications on other app object properties. As a result, if you change this property, you may need to change other properties first. For more information, see Validation differences for signInAudience.Supports $filter (eq, ne, not). | def sign_in_audience
return @sign_in_audience
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sign_in_audience=(value)\n @sign_in_audience = value\n end",
"def audience\n @audience\n end",
"def audience\n @grpc.audience\n end",
"def fetch_aud\n Settings.oidc.isolated_audience.claims\n end",
"def fetch_aud\n Setting... | [
"0.66773254",
"0.53994596",
"0.52634376",
"0.5098446",
"0.5098446",
"0.4512611",
"0.4480541",
"0.44076794",
"0.44075477",
"0.438257",
"0.438257",
"0.42678478",
"0.42678478",
"0.42678478",
"0.42299217",
"0.42268968",
"0.4212942",
"0.4209724",
"0.41964656",
"0.41947728",
"0.418... | 0.70853376 | 0 |
Sets the signInAudience property value. Specifies the Microsoft accounts that are supported for the current application. The possible values are: AzureADMyOrg, AzureADMultipleOrgs, AzureADandPersonalMicrosoftAccount (default), and PersonalMicrosoftAccount. See more in the table. The value of this object also limits the number of permissions an app can request. For more information, see Limits on requested permissions per app. The value for this property has implications on other app object properties. As a result, if you change this property, you may need to change other properties first. For more information, see Validation differences for signInAudience.Supports $filter (eq, ne, not). | def sign_in_audience=(value)
@sign_in_audience = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sign_in_audience\n return @sign_in_audience\n end",
"def audience= new_audience\n @audience = new_audience\n end",
"def audience=(audience)\n self.to = audience if self.respond_to?(:to=)\n end",
"def audience= new_audience\n @grpc.audience = ... | [
"0.54753804",
"0.54474807",
"0.54278564",
"0.5259395",
"0.46961635",
"0.46553728",
"0.4595113",
"0.4434218",
"0.44269216",
"0.44050542",
"0.43663096",
"0.434013",
"0.43375903",
"0.43068126",
"0.42865458",
"0.4219092",
"0.42098325",
"0.42030323",
"0.4146522",
"0.41220498",
"0.... | 0.7368519 | 0 |
Gets the spa property value. Specifies settings for a singlepage application, including sign out URLs and redirect URIs for authorization codes and access tokens. | def spa
return @spa
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_settings\n settings.get\n end",
"def setting\n return @setting\n end",
"def spa=(value)\n @spa = value\n end",
"def appl_settings\n @appl_settings\n end",
"def settings\n @settings ||= get('/settings')['settings']\n end... | [
"0.5921343",
"0.59077984",
"0.58852",
"0.5763956",
"0.5691002",
"0.5599317",
"0.55513316",
"0.5427233",
"0.54270005",
"0.53937095",
"0.5382936",
"0.5351722",
"0.5322982",
"0.53055406",
"0.5303136",
"0.53030145",
"0.52876216",
"0.5245059",
"0.5245059",
"0.5242669",
"0.52287143... | 0.63674164 | 0 |
Sets the spa property value. Specifies settings for a singlepage application, including sign out URLs and redirect URIs for authorization codes and access tokens. | def spa=(value)
@spa = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def redirect_uri_settings=(value)\n @redirect_uri_settings = value\n end",
"def set_app_setting\n @app_setting = AppSetting.settings\n end",
"def set_config\n redirect\n end",
"def set_setting\n ap @setting = Setting.first\n end",
"def set_user_page_setti... | [
"0.60505795",
"0.5789335",
"0.574907",
"0.5546631",
"0.5495912",
"0.54479164",
"0.5424899",
"0.53792125",
"0.53792125",
"0.53726184",
"0.536914",
"0.5319",
"0.52725166",
"0.52725166",
"0.52655566",
"0.51737934",
"0.51331186",
"0.5090533",
"0.5056888",
"0.5056888",
"0.5054236"... | 0.66852075 | 0 |
Gets the synchronization property value. Represents the capability for Azure Active Directory (Azure AD) identity synchronization through the Microsoft Graph API. | def synchronization
return @synchronization
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def synchronization\n attributes.fetch(:synchronization)\n end",
"def synchronization=(value)\n @synchronization = value\n end",
"def last_synchronization\n HasRemote::Synchronization.for(self.name).last\n end",
"def sync_token\n if @carddav_backend.is... | [
"0.7542722",
"0.62939674",
"0.5924117",
"0.5718314",
"0.5345825",
"0.5344675",
"0.52751666",
"0.5245117",
"0.5124715",
"0.50521386",
"0.50521386",
"0.50375307",
"0.50056034",
"0.49452323",
"0.49285868",
"0.49093217",
"0.49088615",
"0.49029997",
"0.48447",
"0.47811636",
"0.477... | 0.64549464 | 1 |
Sets the synchronization property value. Represents the capability for Azure Active Directory (Azure AD) identity synchronization through the Microsoft Graph API. | def synchronization=(value)
@synchronization = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def synchronization\n attributes.fetch(:synchronization)\n end",
"def set_sync_status\n sync_status = ActiveModel::Type::Boolean.new.cast(directory_listing_params[:sync_status])\n if sync_status.nil?\n @directory_listing.update(sync_status: true)\n else\n @d... | [
"0.6427624",
"0.6031918",
"0.60266083",
"0.56633145",
"0.5512804",
"0.5512557",
"0.5496163",
"0.5496112",
"0.54396945",
"0.5433727",
"0.5398089",
"0.5316536",
"0.5260434",
"0.5241888",
"0.5177468",
"0.5157971",
"0.5122583",
"0.50537753",
"0.50537753",
"0.50092834",
"0.4988251... | 0.76964325 | 0 |
Gets the tags property value. Custom strings that can be used to categorize and identify the application. Not nullable. Strings added here will also appear in the tags property of any associated service principals.Supports $filter (eq, not, ge, le, startsWith) and $search. | def tags
return @tags
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags\n attributes.fetch(:tags)\n end",
"def tags\n attributes.fetch(:tags)\n end",
"def tags\n attributes[:tags] || []\n end",
"def tags\n\t\tt = read_attribute(:tags)\n\t\tt.nil? ? \"\" : t.join(', ')\n\tend",
"def tags\n data[:tags]\n end",
"def tags\... | [
"0.6982453",
"0.6982453",
"0.6944779",
"0.69132215",
"0.67882276",
"0.67882276",
"0.67882276",
"0.67882276",
"0.67882276",
"0.67822677",
"0.6767291",
"0.6767291",
"0.6767291",
"0.66563827",
"0.66306293",
"0.66230714",
"0.6610666",
"0.65514666",
"0.65514666",
"0.6550959",
"0.6... | 0.6643961 | 16 |
Sets the tags property value. Custom strings that can be used to categorize and identify the application. Not nullable. Strings added here will also appear in the tags property of any associated service principals.Supports $filter (eq, not, ge, le, startsWith) and $search. | def tags=(value)
@tags = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tags=(value)\n if value == @defaults['tags']\n @values.delete 'tags' if @values.key? 'tags'\n else\n @values['tags'] = value\n end\n end",
"def tags=(tags)\n @tags = \n case tags\n when String\n tags\n when Array\n tags.m... | [
"0.7618521",
"0.7394186",
"0.7276187",
"0.727412",
"0.7270079",
"0.72397435",
"0.72397435",
"0.71779656",
"0.71516395",
"0.7101047",
"0.7090982",
"0.6997965",
"0.69918466",
"0.69885087",
"0.69885087",
"0.69885087",
"0.69885087",
"0.69885087",
"0.69885087",
"0.6983422",
"0.695... | 0.80212224 | 2 |
Gets the tokenEncryptionKeyId property value. Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD encrypts all the tokens it emits by using the key this property points to. The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signedin user. | def token_encryption_key_id
return @token_encryption_key_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_encryption_key_id=(value)\n @token_encryption_key_id = value\n end",
"def encryption_key\n @encryption_key ||= @keys.last.tap do |key|\n key.public_tags.encrypted_data_key_id = key.id if ActiveRecord::Encryption.config.store_key_references\n end\n\n ... | [
"0.69160014",
"0.628274",
"0.6117712",
"0.6117712",
"0.5919309",
"0.5919309",
"0.5809701",
"0.5809701",
"0.5809701",
"0.5752905",
"0.5752905",
"0.5665416",
"0.5615933",
"0.5589209",
"0.55610096",
"0.5545068",
"0.5497334",
"0.5326138",
"0.5326138",
"0.5218951",
"0.52065885",
... | 0.73587084 | 0 |
Sets the tokenEncryptionKeyId property value. Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD encrypts all the tokens it emits by using the key this property points to. The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signedin user. | def token_encryption_key_id=(value)
@token_encryption_key_id = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_encryption_key_id\n return @token_encryption_key_id\n end",
"def encryptionKey=(value)\n\t\t\t@encryptionKey = value\n\t\tend",
"def key_id=(value)\n @key_id = value\n end",
"def key_id=(value)\n @key_id = value\n end",
... | [
"0.57803404",
"0.56525654",
"0.5405496",
"0.5405496",
"0.5405496",
"0.50403214",
"0.5019115",
"0.48666698",
"0.47782272",
"0.4771776",
"0.474613",
"0.4719223",
"0.4628568",
"0.4628568",
"0.46146616",
"0.4559016",
"0.45460495",
"0.45460495",
"0.45437294",
"0.4535135",
"0.45351... | 0.7000462 | 0 |
Gets the tokenIssuancePolicies property value. The tokenIssuancePolicies property | def token_issuance_policies
return @token_issuance_policies
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_issuance_policies=(value)\n @token_issuance_policies = value\n end",
"def token_lifetime_policies\n return @token_lifetime_policies\n end",
"def applied_policies\n return @applied_policies\n end",
"def list_policies\n ... | [
"0.7457317",
"0.6220168",
"0.61147636",
"0.59649783",
"0.5935576",
"0.5850785",
"0.58183944",
"0.57681656",
"0.57269746",
"0.5700887",
"0.5642988",
"0.56251615",
"0.5601081",
"0.53504634",
"0.52698547",
"0.52008104",
"0.51822466",
"0.51446414",
"0.51336974",
"0.5111897",
"0.5... | 0.8028733 | 0 |
Sets the tokenIssuancePolicies property value. The tokenIssuancePolicies property | def token_issuance_policies=(value)
@token_issuance_policies = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_issuance_policies\n return @token_issuance_policies\n end",
"def applied_policies=(value)\n @applied_policies = value\n end",
"def assignment_policies=(value)\n @assignment_policies = value\n end",
"def intended_policies=... | [
"0.6097537",
"0.56941724",
"0.56843114",
"0.55532855",
"0.5534543",
"0.50635594",
"0.49666488",
"0.46933973",
"0.4623201",
"0.45732978",
"0.45486927",
"0.44743288",
"0.44402224",
"0.44347432",
"0.44234434",
"0.44121087",
"0.43740857",
"0.43623433",
"0.4352911",
"0.43524063",
... | 0.7794396 | 0 |
Gets the tokenLifetimePolicies property value. The tokenLifetimePolicies property | def token_lifetime_policies
return @token_lifetime_policies
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_lifetime_policies=(value)\n @token_lifetime_policies = value\n end",
"def token_issuance_policies\n return @token_issuance_policies\n end",
"def get_token_lifetime(key)\n get_option(key, :token_lifetime)\n end",
"def token_issuance_policie... | [
"0.7786238",
"0.66641134",
"0.5829801",
"0.5734849",
"0.5449247",
"0.5344709",
"0.5301566",
"0.5174814",
"0.5174026",
"0.51546216",
"0.51288104",
"0.5083235",
"0.50620943",
"0.50186986",
"0.4898852",
"0.4886999",
"0.48863584",
"0.48815978",
"0.4868273",
"0.48422164",
"0.48416... | 0.85305226 | 0 |
Sets the tokenLifetimePolicies property value. The tokenLifetimePolicies property | def token_lifetime_policies=(value)
@token_lifetime_policies = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_lifetime_policies\n return @token_lifetime_policies\n end",
"def token_issuance_policies=(value)\n @token_issuance_policies = value\n end",
"def expire_tokens!\n update_tokens(nil)\n end",
"def set_token_expires_at\n self.token_expi... | [
"0.6781242",
"0.61642754",
"0.57528365",
"0.5146086",
"0.50833166",
"0.48748255",
"0.4769637",
"0.4720709",
"0.4641739",
"0.4641101",
"0.46390903",
"0.46234116",
"0.46188337",
"0.46134773",
"0.45927358",
"0.4586908",
"0.45602116",
"0.45430267",
"0.4533689",
"0.4527906",
"0.45... | 0.79687697 | 0 |
Gets the verifiedPublisher property value. Specifies the verified publisher of the application. For more information about how publisher verification helps support application security, trustworthiness, and compliance, see Publisher verification. | def verified_publisher
return @verified_publisher
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verified_publisher=(value)\n @verified_publisher = value\n end",
"def app_publisher\n return @app_publisher\n end",
"def app_publisher\n return @app_publisher\n end",
"def publisher_domain\n return @publisher_dom... | [
"0.78886396",
"0.6305936",
"0.6305936",
"0.6283534",
"0.6259229",
"0.6259229",
"0.6259229",
"0.6259229",
"0.5982647",
"0.5982647",
"0.5968375",
"0.586162",
"0.586162",
"0.586162",
"0.586162",
"0.58319914",
"0.580758",
"0.57910645",
"0.5724376",
"0.5703699",
"0.56885004",
"0... | 0.81674194 | 0 |
Sets the verifiedPublisher property value. Specifies the verified publisher of the application. For more information about how publisher verification helps support application security, trustworthiness, and compliance, see Publisher verification. | def verified_publisher=(value)
@verified_publisher = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verified_publisher\n return @verified_publisher\n end",
"def client_applications_from_verified_publisher_only=(value)\n @client_applications_from_verified_publisher_only = value\n end",
"def publisher=(value)\n @publisher = value\n ... | [
"0.6743503",
"0.6213803",
"0.62110054",
"0.62110054",
"0.62110054",
"0.62110054",
"0.61345977",
"0.61345977",
"0.5934758",
"0.5897246",
"0.58186257",
"0.57070094",
"0.5681518",
"0.5576957",
"0.5576957",
"0.5561612",
"0.5517438",
"0.5495859",
"0.53869444",
"0.5337574",
"0.5331... | 0.83826 | 0 |
Gets the web property value. Specifies settings for a web application. | def web
return @web
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def property(name)\n get(\"/session/#{session_id}/element/#{element_id}/property/#{name}\").value\n end",
"def get_settings\n settings.get\n end",
"def setting\n return @setting\n end",
"def current_settings\n Weby::Settings\n end",
"def get_value(p... | [
"0.654594",
"0.65375763",
"0.63873774",
"0.6284174",
"0.6272824",
"0.62316173",
"0.6213888",
"0.60985637",
"0.609377",
"0.6091406",
"0.6022662",
"0.6022621",
"0.60094815",
"0.596386",
"0.5959522",
"0.5959522",
"0.5927171",
"0.5926296",
"0.5871784",
"0.58712274",
"0.5868387",
... | 0.5534486 | 45 |
Sets the web property value. Specifies settings for a web application. | def web=(value)
@web = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def app_settings=(value)\n @children['app-settings'][:value] = value\n end",
"def app_settings=(value)\n @children['app-settings'][:value] = value\n end",
"def set_Property(value)\n set_input(\"Property\", value)\n end",
"def setting=(value)\n @setti... | [
"0.7056061",
"0.7056061",
"0.6827579",
"0.6724153",
"0.6559661",
"0.64866793",
"0.64851004",
"0.6483225",
"0.6390282",
"0.6371379",
"0.6351027",
"0.6241218",
"0.61706096",
"0.6168252",
"0.6139298",
"0.61245406",
"0.60986036",
"0.60932636",
"0.60518104",
"0.60501003",
"0.60501... | 0.6653502 | 4 |
Calculate tax for a given price tag | def apply_tax(price, tax)
return (price * tax / BigDecimal.new(5)).ceil / BigDecimal.new(20) #rounding up to nearest 0.05
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calcuate_tax\n @price * 0.12\n end",
"def tax_calc\n tax = @quantity * @price * @taxe\n end",
"def compute_tax(item_price, tax_rate)\n item_price * tax_rate\n end",
"def tax\n price.to_f * 0.09\n end",
"def tax\n price_as_price.tax\n end",
"def tax\n rate = 0.09\n ... | [
"0.7979767",
"0.7882686",
"0.78707516",
"0.7869687",
"0.77694654",
"0.7633737",
"0.7632139",
"0.75849223",
"0.7516382",
"0.7507391",
"0.73583174",
"0.7323329",
"0.7312023",
"0.72739744",
"0.7180627",
"0.71625704",
"0.71436626",
"0.7033889",
"0.7027502",
"0.7022732",
"0.698924... | 0.74593616 | 10 |
Describes current tax rates and gives a list of exempt products | def to_s
"Tax authority: #{@authority}\n" +
"-Sales Taxes: #{@sales_tax.to_i}% rate on all goods except #{exempt_basic}.\n" +
"-Import Duty: #{@import_duty.to_i}% rate on all imported goods."
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supplies_with_default_tax\n self.supplies_including_tax + self.supplies_excluding_tax.select{|s| [\"CAD\",\"USD\"].include?(s[:currency])}\n end",
"def supplies_including_tax\n self.supplies.select{|p| p[:including_tax]}\n end",
"def tr_pq_taxes(pq)\n\t \tresponse = \"\"\n\t \titf = p... | [
"0.6339077",
"0.6321726",
"0.6303712",
"0.62579215",
"0.6252233",
"0.6224047",
"0.61949295",
"0.6156388",
"0.6155132",
"0.613356",
"0.611691",
"0.60694623",
"0.6038363",
"0.59926057",
"0.5949335",
"0.5947632",
"0.5922911",
"0.59226996",
"0.59218806",
"0.5885946",
"0.58793813"... | 0.57465607 | 33 |
Calculates corresponding tax total depending on properties and current rates set by tax authority | def apply_taxes(taxman)
@taxes = BigDecimal.new(0)
if @is_imported
@taxes += taxman.apply_tax(@price, taxman.import_duty)
end
unless taxman.exempt_basic.include?(@type)
@taxes += taxman.apply_tax(@price, taxman.sales_tax)
end
@price += @taxes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def tax_total\n self.tax_amount = line_items.inject(0.to_money) {|sum,l| sum + l.tax_amount }\n self.tax_rate # calculates average rate, leave for compatibility reasons\n self.tax_amount\n end",
"def tax_total\n self.tax_amount = line_items.inject(Money.new(0, self.currency || Money.default_currency... | [
"0.7897647",
"0.7840126",
"0.7765914",
"0.77385294",
"0.7629178",
"0.76075035",
"0.7587397",
"0.75153357",
"0.74809885",
"0.743706",
"0.7417386",
"0.74173814",
"0.73976254",
"0.73828447",
"0.7366826",
"0.73634917",
"0.7355434",
"0.73467314",
"0.73312217",
"0.73048484",
"0.728... | 0.6993848 | 39 |
Full description of the item's state, with price including taxes | def to_s
"#{@name} at #{MONEY_FORMAT % @price}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state_description(item)\n s = state_value(item) or return\n state_table.dig(s, :note) || s.to_s.humanize(capitalize: false)\n end",
"def description\n @state.description\n end",
"def state_description(item = nil)\n super(item || self[state_column])\n end",
"def description\n pricing... | [
"0.7411758",
"0.7154255",
"0.7126411",
"0.6540064",
"0.6465481",
"0.6421843",
"0.63522565",
"0.6299356",
"0.61912405",
"0.6186888",
"0.61864567",
"0.6184706",
"0.61353666",
"0.60822356",
"0.6080343",
"0.60749125",
"0.6052838",
"0.6028925",
"0.6015556",
"0.6014408",
"0.6007796... | 0.0 | -1 |
Total price of purchased items (with/out taxes) | def initialize
@list = {}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_with_tax\n total = 0\n @cart_items.each do |item|\n total += item.total_price\n end\n return total\n end",
"def total_before_tax\n total = 0\n @cart_items.each do |item|\n total += item.price\n end\n return total\n end",
"def calculate_price\n result = 0.0\n ... | [
"0.83898705",
"0.82394105",
"0.8155155",
"0.8119738",
"0.8112963",
"0.81068397",
"0.8088625",
"0.80422086",
"0.8034937",
"0.79057133",
"0.789007",
"0.78630185",
"0.7830885",
"0.78215414",
"0.7713045",
"0.7699325",
"0.7692754",
"0.7665392",
"0.7642579",
"0.76247543",
"0.760576... | 0.0 | -1 |
Lists the cart's items with their respective prices before taxes | def to_s
printed_list = ""
@list.each do |item, quantity|
printed_list += "#{quantity} #{item}\n"
end
return printed_list
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_taxes\n printed_list = \"\"\n @total = 0\n @list.each do |item, quantity|\n item_total = quantity * item.price\n @total += item_total\n printed_list += \"#{quantity} #{item.name}: #{MONEY_FORMAT % item.price}\\n\"\n end\n return printed_list\n end",
"def total_before_tax\... | [
"0.7231672",
"0.7039515",
"0.68051445",
"0.6766033",
"0.66715413",
"0.66485214",
"0.6602778",
"0.6597087",
"0.65553457",
"0.64899325",
"0.6434836",
"0.64116",
"0.6406786",
"0.6368743",
"0.6363944",
"0.6359519",
"0.6356791",
"0.6349201",
"0.6346062",
"0.63459617",
"0.6334564",... | 0.0 | -1 |
Prints out the list of purchased items along with their price including taxes | def after_taxes
printed_list = ""
@total = 0
@list.each do |item, quantity|
item_total = quantity * item.price
@total += item_total
printed_list += "#{quantity} #{item.name}: #{MONEY_FORMAT % item.price}\n"
end
return printed_list
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_items\n @items.each do |item|\n puts item.name + \" (#{item.price} gold)\"\n end\n print \"\\n\"\n end",
"def print\n puts <<~RECEIPT\n #{parsed_items.join(\"\\n\")}\n\n Sales Taxes: #{total_sales_tax}\n Total: #{total_price}\n RECEIPT\n end",
"def pri... | [
"0.77486473",
"0.76579475",
"0.74715567",
"0.7458602",
"0.7426162",
"0.72966766",
"0.72756946",
"0.71756107",
"0.70203245",
"0.7012923",
"0.7011954",
"0.69782466",
"0.69232494",
"0.69022673",
"0.68728924",
"0.6852633",
"0.6845356",
"0.68431",
"0.68340164",
"0.6808747",
"0.679... | 0.7491478 | 2 |
Calculates and prints out total amount of taxes for all listed items | def total_taxes
@total_taxes = 0
@list.each do |item, quantity|
@total_taxes += quantity * item.taxes
end
puts "Sales Taxes: #{MONEY_FORMAT % @total_taxes}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calc_all_tax(items)\n items_tax = items.collect { |item| calc_tax(item) }\n end",
"def total_tax\n line_items.reduce(Money.zero) { |a, e| a + e.total_tax }\n end",
"def after_taxes\n printed_list = \"\"\n @total = 0\n @list.each do |item, quantity|\n item_total = quantity * it... | [
"0.8032528",
"0.7993072",
"0.7990664",
"0.78866035",
"0.7871526",
"0.7848681",
"0.78205323",
"0.76909906",
"0.76633155",
"0.76433283",
"0.7558471",
"0.75224084",
"0.7467282",
"0.7399366",
"0.7339651",
"0.7320659",
"0.7289374",
"0.7239031",
"0.72362095",
"0.72107303",
"0.72084... | 0.8499987 | 0 |
Convenience method that prints out standard receipt, including subtotal of taxes | def checkout(receipt_name)
puts receipt_name
puts after_taxes
total_taxes
puts "Total: #{MONEY_FORMAT % @total}\n"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print\n puts <<~RECEIPT\n #{parsed_items.join(\"\\n\")}\n\n Sales Taxes: #{total_sales_tax}\n Total: #{total_price}\n RECEIPT\n end",
"def printTotal()\n\tdiscount = ($total * ($discountPercentage / 100.0)).round(2)\n\ttax = (TAX_PERCENTAGE * ($total - discount)).round(2)\n\... | [
"0.7870939",
"0.7563667",
"0.74841064",
"0.7356885",
"0.7351116",
"0.7048002",
"0.6943587",
"0.67912364",
"0.6623164",
"0.65846133",
"0.6542026",
"0.649616",
"0.6488499",
"0.64805835",
"0.64302003",
"0.63383734",
"0.6276925",
"0.6274041",
"0.6178592",
"0.61612684",
"0.6101983... | 0.7065686 | 5 |
this method is invoked, when `all_link` fields is being resolved | def all_links
Link.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_all_links_attributes\n # Interface method\n end",
"def resolve_all_links()\n @links.each_value { |lnk|\n set_link_target(lnk) if lnk.target.nil?\n }\n end",
"def resolve_all_links()\n @flows.each_value { |f|\n f.resolve_all_links()\n }\n end",
"def ... | [
"0.6749465",
"0.6597194",
"0.6500291",
"0.6248242",
"0.614917",
"0.59466434",
"0.5890828",
"0.5890828",
"0.58584404",
"0.5809817",
"0.58008504",
"0.575754",
"0.5689029",
"0.5662376",
"0.5653467",
"0.56521267",
"0.56231433",
"0.5621134",
"0.55996567",
"0.5583648",
"0.55276924"... | 0.59888256 | 7 |
def fact(n) if n <= 1 n else fact(n 1) n end end | def fact(n)
return 1 if n.zero?
(1..n).reduce(1, :*)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fact(n)\n if n == 0 return 0\n elsif n == 1 return 1\n else return fact (0, 1, n)\n end\nend",
"def fact(n)\n\tif n == 0\n\t\t1\n\telse\n\t\t(n * fact(n - 1))\n\tend\nend",
"def fact(n)\n\treturn 1 if n <= 1\n\treturn n * fact(n-1)\nend",
"def fact(n)\n if n<=1\n 1\n else\n n*fact... | [
"0.9327682",
"0.9201197",
"0.91695404",
"0.91559607",
"0.91497535",
"0.9108872",
"0.90803",
"0.90803",
"0.9067964",
"0.90357137",
"0.8983859",
"0.8922955",
"0.8911128",
"0.8862706",
"0.84694",
"0.84454393",
"0.8287611",
"0.82294744",
"0.8177232",
"0.8174114",
"0.81740856",
... | 0.83868355 | 16 |
Initialize the parser and adds the callback that will be called upon stanza completion | def initialize(callback)
@callback = callback
@buffer = ""
super()
reset
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_init\n @parser = XmppParser.new(method(:receive_stanza))\n end",
"def parser_init\n @http = Http::Parser.new\n @http.on_headers_complete = proc do\n p @http.headers\n end\n @http.on_body = proc do |chunk|\n # One chunk of the body\n p chunk\n end\n\n... | [
"0.7494713",
"0.6637759",
"0.65231305",
"0.63050914",
"0.62487847",
"0.6166404",
"0.6126945",
"0.60921043",
"0.596389",
"0.596389",
"0.57836163",
"0.5735514",
"0.5578383",
"0.5559262",
"0.55379206",
"0.55347496",
"0.55246526",
"0.54666394",
"0.54593784",
"0.5438904",
"0.54193... | 0.4855342 | 87 |
Resets the Pushed SAX Parser. | def reset
@parser = Nokogiri::XML::SAX::PushParser.new(self, "UTF-8")
@elem = @doc = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset\n @parser = Nokogiri::XML::SAX::PushParser.new(self)\n end",
"def reset\n @parsers = nil\n @transformer = nil\n @cache = nil\n end",
"def reset!\n @path_stack = []\n @stack = []\n @stacks = Hash.new { |hsh, k| hsh[k] = Stack.new }\n @text ... | [
"0.83507216",
"0.6598847",
"0.6285908",
"0.62609667",
"0.62215257",
"0.60990304",
"0.6034145",
"0.60305864",
"0.6018839",
"0.60098904",
"0.60098904",
"0.5997657",
"0.5992764",
"0.5972017",
"0.5934072",
"0.5931546",
"0.5917266",
"0.5916757",
"0.5903755",
"0.5902981",
"0.589087... | 0.82716626 | 1 |
Pushes the received data to the parser. The parser will then callback the document's methods (start_tag, end_tag... etc) | def push(data)
@parser << data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse\n @callbacks.on_start_document\n @parser.parse(@data) do |type, name, data|\n @position += @parser.byteCount\n @callbacks.on_start_element(name, data) if type == :START_ELEM\n @callbacks.on_end_element(name) if type == :END_ELEM\n end\n @callbacks.on... | [
"0.8032534",
"0.69366324",
"0.686857",
"0.6703675",
"0.6490557",
"0.63304013",
"0.63266534",
"0.63215995",
"0.6204941",
"0.6139274",
"0.61382896",
"0.6080106",
"0.6016244",
"0.6004609",
"0.6000373",
"0.59895855",
"0.5983916",
"0.59829366",
"0.59613585",
"0.59089863",
"0.58976... | 0.6498544 | 5 |
Adds characters to the current element (being parsed) | def characters(string)
@buffer ||= ""
@buffer += string
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parser(parser, foundCharacters:string)\n if @current_item && @current_item.respond_to?(@current_element)\n el = @current_item.send(@current_element)\n el << string\n end\n end",
"def add_character(char)\n @characters << char\n end",
"def characters(string)\n @elem.add_child(No... | [
"0.707553",
"0.6635222",
"0.6616516",
"0.6205433",
"0.60509676",
"0.60509676",
"0.59892976",
"0.59892976",
"0.5954188",
"0.5910093",
"0.58252835",
"0.58252835",
"0.57752824",
"0.574673",
"0.572862",
"0.5667856",
"0.5620692",
"0.560615",
"0.55919355",
"0.55826414",
"0.5576558"... | 0.49615842 | 92 |
Instantiate a new current Element, adds the corresponding attributes and namespaces. The new element is eventually added to a parent element (if present). If no element is being parsed, then, we create a new document, to which we add this new element as root. (we create one document per stanza to avoid memory problems) | def start_element(qname, attributes = [])
clear_characters_buffer
@doc ||= Nokogiri::XML::Document.new
@elem ||= @doc # If we have no current element, then, we take the doc
@elem = @elem.add_child(Nokogiri::XML::Element.new(qname, @doc))
add_namespaces_and_attributes_to_current_node(attributes)
if @elem.name == "stream:stream"
# We activate the callback since this element will never end.
@callback.call(@elem)
@doc = @elem = nil # Let's prepare for the next stanza
# And then, we start a new Sax Push Parser
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start_element(qname, attributes = [])\n e = Nokogiri::XML::Element.new(qname, @doc)\n add_namespaces_and_attributes_to_node(attributes, e)\n\n # Adding the newly created element to the @elem that is being parsed, or, if no element is being parsed, then we set the @root and the @elem to be this n... | [
"0.65296626",
"0.62123144",
"0.5921134",
"0.58608925",
"0.5729298",
"0.5713127",
"0.5630217",
"0.5627875",
"0.5576944",
"0.5528622",
"0.54829365",
"0.5453136",
"0.5453136",
"0.5451393",
"0.54502577",
"0.5445182",
"0.5433218",
"0.5398238",
"0.5394258",
"0.53925645",
"0.5381834... | 0.6551934 | 0 |
Clears the characters buffer | def clear_characters_buffer
if @buffer && @elem
@buffer.strip!
@elem.add_child(Nokogiri::XML::Text.new(@buffer, @doc)) unless @buffer.empty?
@buffer = nil # empty the buffer
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clearBuffer() \n @buffer = \"\" ;\n end",
"def reset_character_buffer\n @buffer_characters = false\n @characters = ''\n end",
"def clear_buffer\n buffer.clear\n end",
"def clear_buffer\n @buffer.clear\n end",
"def clear\n @buffe... | [
"0.841956",
"0.83710027",
"0.81852645",
"0.79017407",
"0.7879505",
"0.78773123",
"0.7528629",
"0.7338918",
"0.7071273",
"0.70546085",
"0.7048196",
"0.7038999",
"0.6996191",
"0.69135374",
"0.6875512",
"0.68103045",
"0.680195",
"0.6796196",
"0.6787073",
"0.6764853",
"0.66514295... | 0.73417497 | 7 |
Terminates the current element and calls the callback | def end_element(name)
clear_characters_buffer
if @elem
if @elem.parent == @doc
# If we're actually finishing the stanza (a stanza is always a document's root)
@callback.call(@elem)
# We delete the current element and the doc (1 doc per stanza policy)
@elem = @doc = nil
else
@elem = @elem.parent
end
else
# Not sure what to do since it seems we're not processing any element at this time, so how can one end?
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def end_element(name)\n if @elem\n if @elem.parent == @root\n @callback.call(@elem) \n # And we also need to remove @elem from its tree\n @elem.unlink \n # And the current elem is the next sibling or the root\n @elem = @root \n else\n @elem =... | [
"0.7087421",
"0.60376847",
"0.58250034",
"0.58250034",
"0.5787149",
"0.5766771",
"0.5736605",
"0.57225055",
"0.5675317",
"0.56606823",
"0.5636234",
"0.5515769",
"0.5509259",
"0.5430281",
"0.5406744",
"0.5390259",
"0.53895587",
"0.53862596",
"0.53801715",
"0.53567",
"0.5338179... | 0.6811315 | 1 |
Adds namespaces and attributes. Nokogiri passes them as a array of [[ns_name, ns_url], [ns_name, ns_url]..., key, value, key, value]... | def add_namespaces_and_attributes_to_current_node(attrs)
# Namespaces
attrs.select {|k| k.is_a? Array}.each do |pair|
set_namespace(pair[0], pair[1])
# set_normal_attribute(pair[0], pair[1])
end
# Attributes
attrs.select {|k| k.is_a? String}.in_groups_of(2) do |pair|
set_normal_attribute(pair[0], pair[1])
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_namespaces_and_attributes_to_node(attrs, node) \n (attrs.size / 2).times do |i|\n name, value = attrs[2 * i], attrs[2 * i + 1]\n if name =~ /xmlns/\n node.add_namespace(name, value)\n else\n node.set_attribute name, value\n end\n end\n end",
"def... | [
"0.7546422",
"0.7166083",
"0.6943499",
"0.67078906",
"0.6606577",
"0.6552891",
"0.6552891",
"0.6535118",
"0.6392071",
"0.6293695",
"0.62740844",
"0.6265993",
"0.6265993",
"0.62067163",
"0.6175167",
"0.6175167",
"0.6161771",
"0.61488795",
"0.6140472",
"0.6140472",
"0.60804564"... | 0.71356946 | 2 |
In production we limit calls to results posting/reading/processing endpoints. | def check_production_password(request)
if $production &&
(!request.env['HTTP_AUTHORIZATION'] ||
request.env['HTTP_AUTHORIZATION'] != ENV['ACCESS_CONTROL_PASSWORD'])
status 403
raise "Incorrect password"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maximum_requests\n super\n end",
"def throttled_response; end",
"def server_result_limit\n self.parameters[:result_limit]\n end",
"def throttled_responder; end",
"def consider_all_requests_local; end",
"def consider_all_requests_local; end",
"def validate_api_call_count\n if outbound... | [
"0.67054147",
"0.61752224",
"0.61362654",
"0.60483456",
"0.59340256",
"0.59340256",
"0.58743125",
"0.5870607",
"0.585522",
"0.5826036",
"0.57998216",
"0.576575",
"0.5758575",
"0.57272464",
"0.57147765",
"0.56974256",
"0.56974256",
"0.5696746",
"0.5687746",
"0.5676666",
"0.566... | 0.0 | -1 |
Only allow awarding of manually awarded achievements. | def authorize_achievement!
authorize!(:award, @achievement) if achievement_params.include?(:course_user_ids)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def authorize_admin_manage_achievements\n unless current_user.permission.manage_achievements\n redirect_back fallback_location: root_path\n end\n end",
"def award; end",
"def award\n\tend",
"def dean_approve_awards(user)\n for award in awards.valid\n award.update_attribute(:amount_awarded... | [
"0.657844",
"0.6570108",
"0.65216535",
"0.6470702",
"0.63609046",
"0.63316333",
"0.62955874",
"0.62314117",
"0.61716115",
"0.6152459",
"0.6116133",
"0.6068654",
"0.59023225",
"0.5891844",
"0.588764",
"0.5856144",
"0.57596177",
"0.5716753",
"0.570942",
"0.5677872",
"0.56643",
... | 0.6915091 | 0 |
Checks if a proposed achievement ordering is valid | def valid_ordering?(proposed_ordering)
achievements_hash.keys.sort == proposed_ordering.sort
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_ordering?(proposed_ordering)\n question_assessments_hash.keys.sort == proposed_ordering.sort\n end",
"def valid_ordering?(proposed_ordering)\n question_assessments_hash.keys.sort == proposed_ordering.sort\n end",
"def valid_ordering?(proposed_ordering)\n questions_hash.keys.sort == propose... | [
"0.75595075",
"0.75595075",
"0.71142715",
"0.6603639",
"0.639604",
"0.61943823",
"0.6177739",
"0.6028429",
"0.6017315",
"0.59035313",
"0.58922213",
"0.5844696",
"0.5844137",
"0.5754543",
"0.5732574",
"0.57145613",
"0.56725645",
"0.56583273",
"0.5610223",
"0.5556813",
"0.55140... | 0.8310939 | 0 |
A team gets two points for a won game, and 1 point for each drawn or abandoned game | def score
2 * won + drawn + noresult
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def points(team)\n first = 0\n res = self.result\n\n if res\n if team == 1\n first_team = res[0]\n sec_team = res[1]\n elsif team == 2\n first_team = res[1]\n sec_team = res[0]\n else \n raise \"Invalid Team chosen\"\n end\n\n p first_team <=> se... | [
"0.80077326",
"0.75322354",
"0.7514713",
"0.7442195",
"0.7394928",
"0.7331161",
"0.7277209",
"0.72668517",
"0.7235234",
"0.72152346",
"0.72013307",
"0.719529",
"0.7176918",
"0.7161972",
"0.70655936",
"0.7061958",
"0.7053167",
"0.70268846",
"0.702611",
"0.7018191",
"0.7002166"... | 0.0 | -1 |
Obviously, the total games played is the sum of all these fields | def played
won + drawn + lost + noresult
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_score\n @all_games.map do |games|\n games[\"home_goals\"].to_i + games[\"away_goals\"].to_i\n end\n end",
"def get_total_games_played\n\t\treturn games.size\n\tend",
"def get_total_games_played\n return games.size\n end",
"def total_score\n sum = self.games.sum{|game|game.poi... | [
"0.76981086",
"0.71927625",
"0.7177062",
"0.71528816",
"0.7102181",
"0.6993223",
"0.69243276",
"0.68603474",
"0.6849289",
"0.6842429",
"0.6825658",
"0.682369",
"0.6769944",
"0.675196",
"0.675196",
"0.6735985",
"0.67330164",
"0.67013216",
"0.6686416",
"0.6671171",
"0.66670597"... | 0.0 | -1 |
TODO: Dry this out? | def hashify_attributes(attrs)
Hash.new.tap{ |h| attrs.each{|a| h[a] = self.send(a)} }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def probers; end",
"def schubert; end",
"def formation; end",
"def from; end",
"def from; end",
"def from; end",
"def from; end",
"def terpene; end",
"def suivre; end",
"def refutal()\n en... | [
"0.73693305",
"0.6457921",
"0.6457921",
"0.6457921",
"0.6457921",
"0.6450268",
"0.6258655",
"0.5886513",
"0.58109814",
"0.58109814",
"0.58109814",
"0.58109814",
"0.5784649",
"0.5783519",
"0.5776211",
"0.57637244",
"0.5750126",
"0.5741367",
"0.57211703",
"0.5720632",
"0.572063... | 0.0 | -1 |
Thank you, Euclid of Alexandria. | def prime_factorization(min_div)
list = []
min_div.prime_division.each{|arr| arr[1].times {list << arr[0]}}
powers = list.reverse.map{|i| i - 1}
list = Prime.take(list.size)
list.map.with_index{|_, idx| list[idx] ** powers[idx]}.inject(:*)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def thankyou\n end",
"def thankyou\n end",
"def thank_you\n end",
"def thank_you\n end",
"def thank_you\n end",
"def thanks\n end",
"def congrats\n\t\tp \"Congrats on Guessing the Word\"\n\tend",
"def submission_confirmation(nominee_conf, client_conf, award_level_conf)\n puts \"You have succes... | [
"0.69027114",
"0.69027114",
"0.67912424",
"0.67912424",
"0.67912424",
"0.6444667",
"0.6115785",
"0.6092541",
"0.59275544",
"0.58772016",
"0.5840919",
"0.58395135",
"0.583705",
"0.5804676",
"0.57943267",
"0.57858056",
"0.5777517",
"0.57756627",
"0.5774105",
"0.5761893",
"0.572... | 0.0 | -1 |
PATCH/PUT /comments/1 PATCH/PUT /comments/1.json DELETE /comments/1 DELETE /comments/1.json | def destroy
@article = Article.find(params[:article_id])
@comment.destroy
redirect_to article_path(@article), notice: "Comment was successfully destroyed."
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_comments\n end",
"def destroy\n @comment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete_comment1\n params[:comment].each { |key, value|\n comment=Comment.find(key)\n if !comment.nil?\n k comment.destroy\n end\n ... | [
"0.6488037",
"0.6397911",
"0.63837653",
"0.63505924",
"0.6343776",
"0.6325114",
"0.6309881",
"0.63056713",
"0.62949854",
"0.62704",
"0.6251274",
"0.6248385",
"0.6245801",
"0.6245613",
"0.6227531",
"0.6170549",
"0.61679024",
"0.61625624",
"0.61625624",
"0.61625624",
"0.614001"... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_comment
@comment = Comment.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def comment_params
params.require(:comment).permit(:name, :article_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6978086",
"0.6780264",
"0.6742658",
"0.6738813",
"0.67338693",
"0.65908474",
"0.6501793",
"0.6495506",
"0.64796513",
"0.64755446",
"0.6454826",
"0.6437561",
"0.6377127",
"0.63722163",
"0.6364058",
"0.63178706",
"0.62979764",
"0.62968165",
"0.62913024",
"0.6289789",
"0.6289... | 0.0 | -1 |
a casino has a plyer and a wallet, so we could say casino.player.wallet.amount | def initialize
puts 'Welcome to the Casino'.colorize(:blue)
@player = Player.new #seeing new here so it means its going to the class listed and runs the initi method
puts "what game do you want to play #{player.name}?"
#show a casino game menu
#let the player choose a game
# initialize the new game, passing the player as a parameter
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pays_players\n self.players.inject(0) {|sum, player| sum += player.pay}\n end",
"def print_player(player)\n puts \"Player #{player.id}: Balance: #{player.money}. \"\n end",
"def current_wallet\n # currency_wallet\n @participant ? betting_pool_wallet : points_wallet\n end",
"def total (play... | [
"0.6480014",
"0.6388395",
"0.6231431",
"0.6095648",
"0.6069049",
"0.60579133",
"0.6052946",
"0.6052946",
"0.6052946",
"0.6052946",
"0.6052946",
"0.60171044",
"0.6008469",
"0.60076034",
"0.6006057",
"0.6004349",
"0.60010755",
"0.5940737",
"0.5935169",
"0.5916111",
"0.5904136",... | 0.0 | -1 |
this method will get called after all the other initialize methods get called | def menu # can do custom methods within a method/class
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post_init\n end",
"def after_initialize\n end",
"def post_initialize\n end",
"def after_initialize; end",
"def after_initialize; end",
"def after_initialize; end",
"def after_initialize; end",
"def post_init\n end",
"def after_initialize\n end",
"def after_initialize\n ... | [
"0.83384126",
"0.8261713",
"0.82423884",
"0.8072354",
"0.8072354",
"0.8072354",
"0.8072354",
"0.80179304",
"0.79773587",
"0.79773587",
"0.7905712",
"0.7879241",
"0.78096557",
"0.78069043",
"0.77414155",
"0.7729605",
"0.77178",
"0.7707891",
"0.7687366",
"0.76746684",
"0.766623... | 0.0 | -1 |
Edit Params: (str) id (str) extrablank | def edit
params[:extrablank].nil? ? @extrablank = 1 : @extrablank = params[:extrablank].to_i
@items = Item.all
@recipe = Recipe.find(params[:id])
@extrablank.times do
@recipe.quantities.build
end
# @ingredients ? @ingredients << Item.new : @ingredients = [Item.new]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def edit\n id = params[:id].presence || 0 \n @element = @@model.find(id)\n end",
"def replace_id(id)\n item = read\n item['id'] = id.to_s\n @aws.put_item(table_name: 'zold-wallets', item: item)\n end",
"def edit\n @menu = 'accueil'\n id = params[:id].nil? ? params[:cid][0] : params[:id]\... | [
"0.6216398",
"0.58073527",
"0.5750818",
"0.5735728",
"0.5724972",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
"0.5681335",
... | 0.5382889 | 31 |
Update Params: (str) id (hash) recipe (str) result_id (hash) quantities_attributes (hash) (str) result_id (str) amount (str) item_id Should update a recipe of given ID Should not update a quantity if the amount or item id is null | def update
@recipe = Recipe.find(params[:id])
db_quantities = @recipe.quantities.where("recipe_id = :this_id", {this_id: @recipe.id})
params[:recipe][:quantities_attributes].each do |quantity_raw|
quantity = quantity_raw.to_a.last
if quantity[:item_id].blank?
next
end
#Look to see if the item name is already there and if it is, replace the new amount
if db_quantities.map{|q| q.item_id}.include?(quantity[:item_id].to_i)
(db_quantities.detect{|q| q.item_id == quantity[:item_id].to_i})
.update(amount: quantity[:amount].to_i)
else
@recipe.add_item(quantity[:item_id], quantity[:amount])
end
end
@recipe.attributes = recipe_params
if @recipe.update_attributes(recipe_params)
redirect_to edit_recipe_url, id: @recipe.id
else
render edit
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n rid = params['id']\n name = params['name']\n description = params['description']\n instructions = params['instructions']\n cook_time = params['cook_time']\n quantity = params['quantity']\n serving_size = params['serving_size']\n uid = params['user_id']\n aws_params = Hash.ne... | [
"0.6818155",
"0.66183865",
"0.6592808",
"0.65405846",
"0.6403329",
"0.6285955",
"0.62290543",
"0.60977983",
"0.60847026",
"0.6070106",
"0.6063127",
"0.6044562",
"0.6005626",
"0.5904145",
"0.58868897",
"0.58843267",
"0.5871014",
"0.587027",
"0.58675855",
"0.5848192",
"0.584437... | 0.7561907 | 0 |
def game_over? return true if none of the cells are hidden false end | def render
@board_array.each_with_index do |row, row_index|
row.each_with_index do |cell, col_index|
if @position_hash[[row_index, col_index]].hidden
print '______'
else
print cell.to_s
end
end
print "\n"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def game_over \n # all the grid's cells are full and different numbers \n end",
"def game_over?\n @blocks.each do |row|\n return false if row.any? { |col| col != @tlc }\n end\n\n true\n end",
"def won?\n @grid.flatten.all? { |el| el.face_down == false }\n end",
"def won?\n ... | [
"0.790757",
"0.76968473",
"0.76484215",
"0.7528237",
"0.750408",
"0.74070966",
"0.73825234",
"0.7233384",
"0.72134936",
"0.7189672",
"0.7149495",
"0.7140157",
"0.71376646",
"0.7128106",
"0.7099697",
"0.7079078",
"0.70619905",
"0.70439714",
"0.7028678",
"0.7025278",
"0.7009254... | 0.0 | -1 |
GET /drgs/1 GET /drgs/1.json | def show
@drg = Drg.find(params[:id],:include => "aliases")
@icd10s = @drg.icd10s
@thetitle = "Compare Medical billing costs for "+@drg.uc_description+" in U.S. Hospitals"
@count = @drg.costs.count
@costs = @drg.costs.order('average_covered_charges desc').includes(:hospital).limit(10)
@average_covered_charges = @costs.average('average_covered_charges')
@average_total_payments = @costs.average('average_total_payments')
@states = State.find(:all,:order => "name")
@regions = Hospital.select('referral_region').group(:referral_region).count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end",
"def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.htm... | [
"0.64504427",
"0.63662064",
"0.6335274",
"0.6268852",
"0.6266955",
"0.6232734",
"0.6201866",
"0.6187148",
"0.61275005",
"0.60485977",
"0.60044855",
"0.5953754",
"0.5940064",
"0.58997643",
"0.58312327",
"0.58120894",
"0.5801566",
"0.5801566",
"0.5789624",
"0.5787138",
"0.57716... | 0.0 | -1 |
for layout use only maybe a separate obj? | def initialize(contents:)
@contents = contents
@_origin = [0,0]
@_dims = [0,0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def layout=(_arg0); end",
"def layouts=(_arg0); end",
"def layouts=(_arg0); end",
"def _layout(*_arg0); end",
"def layout; end",
"def place_in_layout?; end",
"def place_in_layout?; end",
"def object_nl()\n #This is a stub, used for indexing\n end",
"def layout_chil... | [
"0.6929844",
"0.6606015",
"0.6606015",
"0.63749236",
"0.63447165",
"0.6288331",
"0.6288331",
"0.61370885",
"0.60990417",
"0.6093272",
"0.5974332",
"0.5974332",
"0.5974332",
"0.5974332",
"0.5974332",
"0.5974332",
"0.5974332",
"0.5974332",
"0.5974332",
"0.5974332",
"0.5974332",... | 0.0 | -1 |
Initialize a Predication Partition | def initialize(predicate, left_header, right_header)
@left = @right = @remainder = TAUTOLOGY
@left_header = left_header
@right_header = right_header
partition(predicate)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partition\n PredicatePartition.new(predicate, operand.left.header, operand.right.header)\n end",
"def initialize(partition_data)\n @partition_data = partition_data\n end",
"def partition(predicate)\n each_operand(predicate) do |operand|\n case operand\n ... | [
"0.6743185",
"0.666282",
"0.5734743",
"0.5588928",
"0.5528576",
"0.54569924",
"0.54460746",
"0.53995633",
"0.5395927",
"0.537839",
"0.53401124",
"0.53322625",
"0.5287079",
"0.5219724",
"0.51885074",
"0.51552945",
"0.51430625",
"0.51233506",
"0.5063135",
"0.50583196",
"0.50577... | 0.62051183 | 2 |
Partition the predicate into a left, right and remainder predicates | def partition(predicate)
each_operand(predicate) do |operand|
case operand
when Axiom::Function::Binary then partition_binary(operand)
when Axiom::Function::Unary then partition_unary(operand)
when Axiom::Attribute::Boolean then partition_attribute(operand)
else
partition_proposition(operand)
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partition_binary(function)\n operands = [function.left, function.right].grep(Axiom::Attribute)\n left_operands = @left_header & operands\n right_operands = @right_header & operands\n\n if (left_operands - right_operands).empty? || (right_operands - left_operands).empty?\n ... | [
"0.6627197",
"0.64619684",
"0.61369145",
"0.604758",
"0.59564954",
"0.5624403",
"0.55235165",
"0.5490219",
"0.5412623",
"0.5379851",
"0.5365013",
"0.53573745",
"0.53485274",
"0.5328039",
"0.5322694",
"0.53205055",
"0.5297593",
"0.5287832",
"0.524956",
"0.52120787",
"0.5210271... | 0.7046975 | 0 |
Partition the binary function up into a left, right and remainder predicates | def partition_binary(function)
operands = [function.left, function.right].grep(Axiom::Attribute)
left_operands = @left_header & operands
right_operands = @right_header & operands
if (left_operands - right_operands).empty? || (right_operands - left_operands).empty?
@left &= function if left_operands.any?
@right &= function if right_operands.any?
else
@remainder &= function
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partition_unary(function)\n operand = function.operand\n @left &= function if @left_header.include?(operand)\n @right &= function if @right_header.include?(operand)\n end",
"def partition(predicate)\n each_operand(predicate) do |operand|\n case operand\n wh... | [
"0.6903475",
"0.61425763",
"0.5961565",
"0.5954488",
"0.5931534",
"0.5870276",
"0.5863014",
"0.58573604",
"0.57634336",
"0.570229",
"0.5677765",
"0.562439",
"0.5543262",
"0.5473078",
"0.5472757",
"0.5459017",
"0.5433321",
"0.54316014",
"0.5429458",
"0.53976506",
"0.53886014",... | 0.7962595 | 0 |
Partition the unary function up into the left and right predicates | def partition_unary(function)
operand = function.operand
@left &= function if @left_header.include?(operand)
@right &= function if @right_header.include?(operand)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partition_binary(function)\n operands = [function.left, function.right].grep(Axiom::Attribute)\n left_operands = @left_header & operands\n right_operands = @right_header & operands\n\n if (left_operands - right_operands).empty? || (right_operands - left_operands).empty?\n ... | [
"0.6483279",
"0.6085995",
"0.591588",
"0.5650922",
"0.5642326",
"0.5426558",
"0.5387498",
"0.538662",
"0.535344",
"0.5283616",
"0.5263046",
"0.52392644",
"0.5176646",
"0.51692957",
"0.50687015",
"0.505274",
"0.50509167",
"0.50322783",
"0.50206465",
"0.49924505",
"0.499143",
... | 0.7855663 | 0 |
Partition the attribute up into the left and right predicates | def partition_attribute(attribute)
@left &= attribute if @left_header.include?(attribute)
@right &= attribute if @right_header.include?(attribute)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partition_binary(function)\n operands = [function.left, function.right].grep(Axiom::Attribute)\n left_operands = @left_header & operands\n right_operands = @right_header & operands\n\n if (left_operands - right_operands).empty? || (right_operands - left_operands).empty?\n ... | [
"0.60609305",
"0.60413665",
"0.59011686",
"0.5671281",
"0.5655303",
"0.55238914",
"0.52749443",
"0.5191218",
"0.50731915",
"0.5024346",
"0.5024236",
"0.49520996",
"0.4930246",
"0.49284413",
"0.49147603",
"0.48967564",
"0.48872867",
"0.488236",
"0.48467207",
"0.48349288",
"0.4... | 0.69205546 | 0 |
Partition the proposition up into the left, right and remainder predicates | def partition_proposition(proposition)
@remainder &= proposition
@left &= proposition
@right &= proposition
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def partition(array, left, right)\n pivot = right\n right -= 1\n puts \"left: #{left}, right: #{right}\"\n while true do\n while array[left] <= array[pivot] && left < pivot do\n left += 1\n end\n\n while array[right] > array[pivot] do\n right -= 1\n end\n\n\n\n if left >= right\n ... | [
"0.61993235",
"0.6025713",
"0.5974142",
"0.5973679",
"0.59536797",
"0.5898489",
"0.5894226",
"0.58745766",
"0.57803893",
"0.5762215",
"0.5727054",
"0.5710884",
"0.56745017",
"0.5642036",
"0.5634182",
"0.5609777",
"0.5576813",
"0.55484533",
"0.5542833",
"0.55409503",
"0.553086... | 0.7598666 | 0 |
Yield each operand in the predicate recursively | def each_operand(predicate, &block)
case predicate
when Axiom::Function::Connective::Disjunction then each_operand(predicate.inverse.optimize, &block)
when Axiom::Function::Connective::Conjunction then each_conjunction(predicate, &block)
else
block.call(predicate)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each\n [@lval,@rval,@operator].each { |child| yield child }\n end",
"def generate_expressions(digits, allow_permutations, stats) \n digit_sets = allow_permutations ? digits.permutation : [digits]\n digit_sets_examined = 0\n stats.setProgressMax(digit_sets.count) if allow_permutations\n\n digit_se... | [
"0.7127529",
"0.6763849",
"0.6057096",
"0.59755015",
"0.59755015",
"0.5912075",
"0.5883678",
"0.5883678",
"0.58316636",
"0.58088714",
"0.57792723",
"0.5719382",
"0.5706993",
"0.5694236",
"0.5679496",
"0.5665631",
"0.5662554",
"0.56479764",
"0.5643484",
"0.56289405",
"0.562467... | 0.7069359 | 1 |
Yield each operand of the conjunction | def each_conjunction(conjunction, &block)
each_operand(conjunction.left, &block)
each_operand(conjunction.right, &block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_operand(predicate, &block)\n case predicate\n when Axiom::Function::Connective::Disjunction then each_operand(predicate.inverse.optimize, &block)\n when Axiom::Function::Connective::Conjunction then each_conjunction(predicate, &block)\n else\n block.call(predicate)\n ... | [
"0.7053886",
"0.6345452",
"0.6286704",
"0.6253428",
"0.6145475",
"0.609477",
"0.60279995",
"0.5990088",
"0.58613294",
"0.58076197",
"0.58061063",
"0.5782629",
"0.5774321",
"0.57726854",
"0.5758735",
"0.5650793",
"0.5649353",
"0.5649353",
"0.5634175",
"0.56339306",
"0.5628576"... | 0.65608495 | 1 |
Add a result for processing | def add(result)
@bucket.push(result.to_bool)
result.to_bool
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_result name, res\n \n end",
"def add_result(result)\n @results.push(result)\n end",
"def add_result(result)\n @results.push(result)\n end",
"def add_result(result)\n @results.push(result)\n end",
"def process_result\n end",
"def add_result(result)\n @resu... | [
"0.8087335",
"0.7838597",
"0.7838597",
"0.7838597",
"0.77973056",
"0.77938557",
"0.77938557",
"0.77938557",
"0.7487486",
"0.7298127",
"0.7263461",
"0.72043455",
"0.71207815",
"0.7044787",
"0.70181197",
"0.6959053",
"0.69038284",
"0.6863295",
"0.68358254",
"0.6824732",
"0.6817... | 0.6560476 | 27 |
POST /teams POST /teams.json | def create
@user = User.new(user_new_params)
respond_to do |format|
if @user.save_dependent params[:setting_id], user_params[:admin]
format.html { redirect_to users_manage_users_url, notice: 'User was successfully created.' }
format.json { render :show, status: :created, location: @user }
else
format.html { redirect_to users_manage_users_url, warn: 'An error prevented user creation.' }
format.json { render json: @user.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @response = HTTParty.get('http://laxapi.herokuapp.com/api/teams')\n CreateTeamService.new.create_team_objects(@response)\n render :json => {\n :message => \" #{Team.count} teams have been created\",\n status: 200\n }\n end",
"def create\n @team = Team.new(params[:team])\n... | [
"0.7407207",
"0.73531765",
"0.720625",
"0.71847314",
"0.7073526",
"0.7023654",
"0.7023654",
"0.7023654",
"0.69896674",
"0.69699323",
"0.6960711",
"0.69256973",
"0.6924587",
"0.6920893",
"0.6915711",
"0.6915711",
"0.6915711",
"0.6915711",
"0.6915711",
"0.6915711",
"0.6915711",... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def user_new_params
params.require(:user).permit(:email, :displayName, :oauth, :password, :setting_id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Returns true if OS is windows (copied from facter/util/config.rb) | def windows?
(defined?(RbConfig) ? RbConfig : Config)::CONFIG['host_os'] =~ /mswin|win32|dos|mingw|cygwin/i
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def windows?\n\tRbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\nend",
"def windows?\n return @windows if defined?(@windows)\n @windows = (RbConfig::CONFIG['host_os'] =~ /mswin|windows|mingw/i)\n end",
"def windows?\n # Is this a Windows based system\n @win ||= RbConfig::CONFIG['host_os'... | [
"0.8950443",
"0.891576",
"0.8913106",
"0.88760805",
"0.88760805",
"0.87613297",
"0.87284344",
"0.87029076",
"0.86806524",
"0.86690414",
"0.8663334",
"0.85244286",
"0.8514668",
"0.8481104",
"0.8462259",
"0.8440089",
"0.84059644",
"0.83960205",
"0.8368152",
"0.832635",
"0.83208... | 0.9045687 | 0 |
Prepare the file installation. | def prepare_installation
InstallOptions.configs = true
InstallOptions.batch_files = true
ARGV.options do |opts|
opts.banner = "Usage: #{File.basename($PROGRAM_NAME)} [options]"
opts.separator ''
opts.on('--[no-]configs', 'Prevents the installation of config files', 'Default off.') do |onconfigs|
InstallOptions.configs = onconfigs
end
opts.on('--destdir[=OPTIONAL]',
'Installation prefix for all targets',
'Default essentially /') do |destdir|
InstallOptions.destdir = destdir
end
# opts.on('--configdir[=OPTIONAL]', 'Installation directory for config files', 'Default /etc') do |configdir|
# InstallOptions.configdir = configdir
# end
opts.on('--bindir[=OPTIONAL]',
'Installation directory for binaries',
'overrides RbConfig::CONFIG["bindir"]') do |bindir|
InstallOptions.bindir = bindir
end
opts.on('--ruby[=OPTIONAL]',
'Ruby interpreter to use with installation',
'overrides ruby used to call install.rb') do |ruby|
InstallOptions.ruby = ruby
end
opts.on('--sitelibdir[=OPTIONAL]',
'Installation directory for libraries',
'overrides RbConfig::CONFIG["sitelibdir"]') do |sitelibdir|
InstallOptions.sitelibdir = sitelibdir
end
opts.on('--mandir[=OPTIONAL]',
'Installation directory for man pages',
'overrides RbConfig::CONFIG["mandir"]') do |mandir|
InstallOptions.mandir = mandir
end
opts.on('--full', 'Performs a full installation. All', 'optional installation steps are run.') do |_full|
InstallOptions.configs = true
end
opts.on('--no-batch-files', 'Prevents installation of batch files for windows', 'Default off') do |_batch_files|
InstallOptions.batch_files = false
end
opts.separator('')
opts.on_tail('--help', 'Shows this help text.') do
warn opts
exit
end
opts.parse!
end
version = [RbConfig::CONFIG['MAJOR'], RbConfig::CONFIG['MINOR']].join('.')
libdir = File.join(RbConfig::CONFIG['libdir'], 'ruby', version)
# Mac OS X 10.5 and higher declare bindir
# /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
# which is not generally where people expect executables to be installed
# These settings are appropriate defaults for all OS X versions.
RbConfig::CONFIG['bindir'] = '/usr/bin' if RUBY_PLATFORM =~ /^universal-darwin[\d\.]+$/
# if InstallOptions.configdir
# configdir = InstallOptions.configdir
# elsif windows?
# path = File.join(File.dirname(__FILE__), "lib", "custom_facts", "util", "config.rb")
# require_relative(path)
# configdir = File.join(LegacyFacter::Util::Config.windows_data_dir, "PuppetLabs", "facter", "etc")
# else
# configdir = File.join('/', 'etc', 'puppetlabs', 'facter')
# end
bindir = InstallOptions.bindir || RbConfig::CONFIG['bindir']
if InstallOptions.sitelibdir
sitelibdir = InstallOptions.sitelibdir
else
sitelibdir = RbConfig::CONFIG['sitelibdir']
if sitelibdir.nil?
sitelibdir = $LOAD_PATH.find { |x| x =~ /site_ruby/ }
if sitelibdir.nil?
sitelibdir = File.join(libdir, 'site_ruby')
elsif sitelibdir !~ Regexp.quote(version)
sitelibdir = File.join(sitelibdir, version)
end
end
end
mandir = InstallOptions.mandir || RbConfig::CONFIG['mandir']
# This is the new way forward
destdir = InstallOptions.destdir || ''
# configdir = join(destdir, configdir)
bindir = join(destdir, bindir)
mandir = join(destdir, mandir)
sitelibdir = join(destdir, sitelibdir)
# makedirs(configdir) if InstallOptions.configs
makedirs(bindir)
makedirs(mandir)
makedirs(sitelibdir)
InstallOptions.site_dir = sitelibdir
# InstallOptions.config_dir = configdir
InstallOptions.bin_dir = bindir
InstallOptions.lib_dir = libdir
InstallOptions.man_dir = mandir
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_for_installation; end",
"def prepare\n FileUtils.mkdir_p(veewee_autoyast_dir) unless veewee_autoyast_dir.directory?\n FileUtils.cp(sources_dir.join(\"postinstall.sh\"), veewee_autoyast_dir)\n end",
"def prepare_config_files\n #Create .config dir\n #Create tucotuco dir\n #Creat... | [
"0.73702633",
"0.68934363",
"0.6653475",
"0.660166",
"0.6587716",
"0.6555563",
"0.65277135",
"0.64865",
"0.64402",
"0.63029134",
"0.6293101",
"0.6291249",
"0.6290417",
"0.62669516",
"0.6244357",
"0.6234847",
"0.62029576",
"0.6201506",
"0.6194785",
"0.61641777",
"0.6161949",
... | 0.6584198 | 5 |
Join two paths. On Windows, dir must be converted to a relative path, by stripping the drive letter, but only if the basedir is not empty. | def join(basedir, dir)
return "#{basedir}#{dir[2..-1]}" if windows? && !basedir.empty? && (dir.length > 2)
"#{basedir}#{dir}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def path_join(base, path)\n return path if path_is_absolute(path)\n base.gsub(/[\\/]+$/, '') + '/' + path.gsub(/^[\\/]+/, '')\n end",
"def join_files(base_dir, path)\n if(Pathname.new(path).relative?)\n File.join(base_dir, path)\n else\n path\n end\n ... | [
"0.7850884",
"0.74524856",
"0.73209846",
"0.7192438",
"0.71310014",
"0.7095972",
"0.7014305",
"0.6994182",
"0.6990909",
"0.6990909",
"0.6944775",
"0.682914",
"0.6815405",
"0.66741234",
"0.6613223",
"0.6578078",
"0.6552504",
"0.6476609",
"0.63659006",
"0.6244955",
"0.62412465"... | 0.7886245 | 0 |
Install file(s) from ./bin to RbConfig::CONFIG['bindir']. Patch it on the way to insert a ! line; on a Unix install, the command is named as expected (e.g., bin/rdoc becomes rdoc); the shebang line handles running it. Under windows, we add an '.rb' extension and let file associations do their stuff. | def install_binfile(from, op_file, target)
tmp_file = Tempfile.new('facter-binfile')
ruby = if !InstallOptions.ruby.nil?
InstallOptions.ruby
else
File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
end
File.open(from) do |ip|
File.open(tmp_file.path, 'w') do |op|
op.puts "#!#{ruby}"
contents = ip.readlines
contents.shift if contents[0] =~ /^#!/
op.write contents.join
end
end
if windows? && InstallOptions.batch_files
installed_wrapper = false
if File.exist?("#{from}.bat")
install("#{from}.bat", File.join(target, "#{op_file}.bat"), mode: 0o755, preserve: true, verbose: true)
installed_wrapper = true
end
if File.exist?("#{from}.cmd")
install("#{from}.cmd", File.join(target, "#{op_file}.cmd"), mode: 0o755, preserve: true, verbose: true)
installed_wrapper = true
end
unless installed_wrapper
tmp_file2 = Tempfile.new('facter-wrapper')
cwv = <<-SCRIPT
@echo off
SETLOCAL
if exist "%~dp0environment.bat" (
call "%~dp0environment.bat" %0 %*
) else (
SET "PATH=%~dp0;%PATH%"
)
ruby.exe -S -- facter %*
SCRIPT
File.open(tmp_file2.path, 'w') { |cw| cw.puts cwv }
install(tmp_file2.path, File.join(target, "#{op_file}.bat"), mode: 0o755, preserve: true, verbose: true)
tmp_file2.unlink
end
end
install(tmp_file.path, File.join(target, op_file), mode: 0o755, preserve: true, verbose: true)
tmp_file.unlink
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def installBIN(from, opfile)\r\n\r\n tmp_dir = nil\r\n for t in [\".\", \"/tmp\", \"c:/temp\", $bindir]\r\n stat = File.stat(t) rescue next\r\n if stat.directory? and stat.writable?\r\n tmp_dir = t\r\n break\r\n end\r\n end\r\n\r\n fail \"Cannot find a temporary directory\" unless tmp_dir\r\... | [
"0.67985654",
"0.6465603",
"0.6465603",
"0.6465603",
"0.6356538",
"0.6227714",
"0.6089722",
"0.60171336",
"0.6011992",
"0.5956288",
"0.58188164",
"0.5812065",
"0.57681555",
"0.57576466",
"0.57524705",
"0.5722547",
"0.57196623",
"0.57008654",
"0.5665033",
"0.5632094",
"0.56261... | 0.6630315 | 1 |
Change directory into the facter root so we don't get the wrong files for install. | def run
cd File.dirname(__FILE__) do
# Set these values to what you want installed.
bins = glob(%w[bin/facter])
libs = glob(%w[lib/**/*.rb lib/facter/fixtures/* lib/facter/os_hierarchy.json
lib/facter/fact_groups.conf lib/facter/templates/*])
man = glob(%w{man/man[0-9]/*})
prepare_installation
do_bins(bins, InstallOptions.bin_dir)
do_libs(libs)
do_man(man) unless windows?
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def install_root\n self.class.install_root.join(name)\n end",
"def set_dir(new_dir)\n # checking for / at the end of the env variable\n new_dir = '' unless new_dir\n new_dir += '/' unless new_dir[-1, 1] == '/'\n @dir = new_dir\n end",
"def install_directory\n \"C:\\\\o... | [
"0.6859048",
"0.64444476",
"0.6411936",
"0.63491637",
"0.6321923",
"0.62551296",
"0.62340105",
"0.61548954",
"0.61532754",
"0.60671103",
"0.602973",
"0.6015278",
"0.60026175",
"0.5950696",
"0.5901396",
"0.58851194",
"0.5861252",
"0.5814387",
"0.5797751",
"0.5776985",
"0.57589... | 0.54873526 | 69 |
this is the original word we are trying to find an anagram for | def initialize(name)
@name = name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def detect_anagram(word, dictionary)\n letter_array = word.downcase.split(//)\n word_array = []\n letter_array.permutation(word.length){|word| word_array << word.join }\n word_array.select {|word| dictionary.include?(word)}\nend",
"def anagram(word)\n anagrams_array = %w(enlists google inlets banana)\n sea... | [
"0.80684036",
"0.8043097",
"0.7751775",
"0.7741899",
"0.76958025",
"0.76335484",
"0.7626589",
"0.7579514",
"0.75751394",
"0.7562663",
"0.7511891",
"0.74927235",
"0.74900067",
"0.74167097",
"0.7406935",
"0.73989326",
"0.73584545",
"0.73465425",
"0.73395884",
"0.7336822",
"0.73... | 0.0 | -1 |
Public: Deletes the Rule. Returns Boolean indicating success. | def delete(service=Azure::ServiceBus::Rules)
service.delete(self)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @rule.destroy\n\n respond_with(rule, location: rules_url, notice: 'RUle was successfully destroyed.')\n end",
"def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n ... | [
"0.7176578",
"0.6948633",
"0.6902315",
"0.6860611",
"0.6860611",
"0.68598527",
"0.6763058",
"0.6714959",
"0.6702585",
"0.6665095",
"0.6629522",
"0.66048187",
"0.6590658",
"0.65637",
"0.6509748",
"0.6498065",
"0.64931893",
"0.6483303",
"0.6481372",
"0.6448768",
"0.6448235",
... | 0.0 | -1 |
UNIT TEST FOR print_start(x) Equivalence classes: number = nil, raise number = string, raise number = float, raise number = int, puts This is test when argument is nil EDGE CASE | def test_print_start_nil
assert_raises(StandardError) { print_start(nil) } # pass
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_print_start_float\n assert_raises(StandardError) { print_start(1.2) } # pass\n end",
"def test_print_start_string\n assert_raises(StandardError) { print_start('1') } # pass\n end",
"def test_print_start_int\n assert_output(\"Rubyist #1 starting in Enumerable Canyon.\\n\") { @p.print_start(1... | [
"0.71186864",
"0.68293035",
"0.631714",
"0.6228734",
"0.6148202",
"0.5930467",
"0.59097457",
"0.5875946",
"0.5849329",
"0.5828582",
"0.5791807",
"0.57870793",
"0.57451963",
"0.5736707",
"0.5723348",
"0.57193047",
"0.5693964",
"0.5679269",
"0.56739587",
"0.5655085",
"0.5642526... | 0.7505627 | 0 |
This is test when argument is a string | def test_print_start_string
assert_raises(StandardError) { print_start('1') } # pass
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_string_argument\n\t\tc = Check.new\n\t\tassert c.check_arguments([1,'1',1])\n\tend",
"def test_string\n args = Arguments.new\n assert_equal false, args.check_args(\"puppy\")\n end",
"def test_arg_check_2string\n \t@args = ArgumentCheck.new\n \tassert_equal(false, @args.arg_check(['poop', 'poo... | [
"0.79019797",
"0.7803992",
"0.78000855",
"0.73190004",
"0.7282978",
"0.72626835",
"0.72085804",
"0.7157702",
"0.71222144",
"0.70948565",
"0.69643587",
"0.6953815",
"0.6880464",
"0.6835147",
"0.6759548",
"0.674851",
"0.6727656",
"0.6717465",
"0.6697668",
"0.66266453",
"0.65933... | 0.0 | -1 |
This is test when argument is a float | def test_print_start_float
assert_raises(StandardError) { print_start(1.2) } # pass
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_float?(input)\n input.to_f.to_s == input\nend",
"def expect_float(value, field, subfield)\n return true if value.blank?\n return true if value.is_a?(Float)\n errors.add(field, \"#{subfield} must be a float if present\")\n false\n end",
"def float?(object)\n return true if Float(object)\... | [
"0.7803217",
"0.7672317",
"0.74978817",
"0.7496122",
"0.7493937",
"0.74459857",
"0.7402145",
"0.73782814",
"0.7361746",
"0.7350024",
"0.73318166",
"0.73252285",
"0.7324091",
"0.73114324",
"0.7230167",
"0.7213706",
"0.71565896",
"0.7153273",
"0.7125753",
"0.7122772",
"0.710208... | 0.6670952 | 59 |
This is test when argument is a int | def test_print_start_int
assert_output("Rubyist #1 starting in Enumerable Canyon.\n") { @p.print_start(1) } # pass
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_one_ints\n args = Arguments.new\n assert_equal false, args.check_args([1])\n end",
"def is_valid? argument\n argument.to_s.to_i == argument\nend",
"def test_check_num_args_valid2\n args = CheckNumArgs.new\n args.check_args([1,1,1])\n assert_kind_of Integer, 1\n end",
"def require_i... | [
"0.71655023",
"0.7113545",
"0.69703054",
"0.69493824",
"0.69103307",
"0.6864587",
"0.68623227",
"0.68623227",
"0.68613374",
"0.6861294",
"0.68394995",
"0.68392366",
"0.6831147",
"0.6789303",
"0.6767887",
"0.67573863",
"0.6743626",
"0.67280775",
"0.67021215",
"0.6670196",
"0.6... | 0.0 | -1 |
UNIT TESTS FOR print_ruby_found_in_this_location(x, y) Equivalence classes: real = 0 > only print out fake fake = 0 > only print out real both not 0 > print results both 0 > print nothing found both nil > nil (EDGE CASE) This test when only found fake ruby | def test_print_ruby_found_fake_only
mock_location = Minitest::Mock.new('location')
def mock_location.name; 'a'; end
def plural?(x); 'ruby'; end
assert_output(" Found 1 fake ruby in a.\n") {
@p.print_ruby_found_in_this_location(mock_location, [0, 1])}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_print_ruby_found_nothing\n mock_location = Minitest::Mock.new('location')\n def mock_location.name; 'a'; end\n assert_output(\" Found no rubies or fake rubies in a.\\n\"){\n @p.print_ruby_found_in_this_location(mock_location, [0, 0])}\n end",
"def test_print_ruby_found_both\n mo... | [
"0.68066615",
"0.6743735",
"0.6675955",
"0.6527962",
"0.63503355",
"0.6237594",
"0.6149374",
"0.6140571",
"0.61387604",
"0.60822415",
"0.60778296",
"0.60734767",
"0.59985673",
"0.59881014",
"0.5963785",
"0.5959704",
"0.59458655",
"0.592704",
"0.5903186",
"0.5887848",
"0.58857... | 0.66138405 | 3 |
This test when only found real ruby | def test_print_ruby_found_real_only
mock_location = Minitest::Mock.new('location')
def mock_location.name; 'a'; end
def plural?(x); 'ruby'; end
assert_output(" Found 1 ruby in a.\n") {
@p.print_ruby_found_in_this_location(mock_location, [1, 0])}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def target_ruby; end",
"def testNonRubyFile\n assert_raise(LoadError) do\n requireFile('NonRubyFile.so')\n end\n end",
"def testget_leveled_file_contentNonRubyFile\n assert_raise(LoadError) do\n RCodeLeveler.get_leveled_file_content('RequiredFiles/NonRubyFile.so')\n end\n end",
"def t... | [
"0.6885015",
"0.6803522",
"0.66688156",
"0.6385414",
"0.63833076",
"0.6321077",
"0.63190633",
"0.624093",
"0.6205193",
"0.6192729",
"0.61738044",
"0.6164089",
"0.61210835",
"0.611904",
"0.61179286",
"0.6086698",
"0.6081133",
"0.6062916",
"0.6053631",
"0.6053631",
"0.6051775",... | 0.63802236 | 5 |
This test when found both real and fake | def test_print_ruby_found_both
mock_location = Minitest::Mock.new('location')
def mock_location.name; 'a'; end
def plural?(x); 'ruby'; end
assert_output(" Found 1 ruby and 1 fake ruby in a.\n"){
@p.print_ruby_found_in_this_location(mock_location, [1, 1])}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fake?\n @test_mode == :fake\n end",
"def __dummy_test__\n end",
"def spec; end",
"def spec; end",
"def testing\n # ...\n end",
"def real?\n true\n end",
"def mock_model_simple(model,expected=:all)\n mock_model model, :name, expected\n end",
"def fake!(&block... | [
"0.67413753",
"0.65053064",
"0.64594936",
"0.64594936",
"0.61468804",
"0.60906947",
"0.6087012",
"0.6079838",
"0.60143846",
"0.5928686",
"0.5917107",
"0.5916533",
"0.5913764",
"0.58741933",
"0.5872553",
"0.5860513",
"0.5859962",
"0.5855707",
"0.58170646",
"0.5805466",
"0.5786... | 0.0 | -1 |
This test when found nothing | def test_print_ruby_found_nothing
mock_location = Minitest::Mock.new('location')
def mock_location.name; 'a'; end
assert_output(" Found no rubies or fake rubies in a.\n"){
@p.print_ruby_found_in_this_location(mock_location, [0, 0])}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_for_empty_result\n assert_not_equal @you_tube.search.length, 0\n end",
"def results?() ! find(locator(:no_results_message)) end",
"def test_missing_search_value\n key = '_id'\n val = '8098765432'\n results = User.new(key, val).search\n assert_equal results, [], 'It must return an empty... | [
"0.6882303",
"0.68776333",
"0.68085444",
"0.68068045",
"0.67878693",
"0.6727451",
"0.66969925",
"0.6641532",
"0.66000116",
"0.65393806",
"0.6535918",
"0.64996576",
"0.64570075",
"0.6428928",
"0.6403459",
"0.64022905",
"0.6396129",
"0.6373394",
"0.6364813",
"0.63471556",
"0.63... | 0.0 | -1 |
This test when argument is nil EDGE CASE | def test_print_ruby_found_nil
mock_location = Minitest::Mock.new('location')
def mock_location.name; 'a'; end
def plural?(x); 'ruby'; end
assert_raises(StandardError){@p.print_ruby_found_in_this_location(mock_location, nil)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_has_edge_no_edge\n assert(@graph.has_edge('b', 'd') == false)\n end",
"def test_has_edge_no_vertices\n assert(@graph.has_edge('vertex1', 'vertex2') == false)\n end",
"def test_nil_args\n refute check_args(nil)\n end",
"def test_has_edges_when_empty\n graph = Graph.new\n\n assert(gr... | [
"0.71505594",
"0.70078087",
"0.6634852",
"0.662769",
"0.6485943",
"0.64254147",
"0.6422998",
"0.6360296",
"0.6326705",
"0.63161576",
"0.62704766",
"0.6255437",
"0.6251999",
"0.6228068",
"0.6221162",
"0.62035376",
"0.6185076",
"0.61512774",
"0.611913",
"0.6115905",
"0.6098258"... | 0.0 | -1 |
UNIT TESTS FOR print_heading(x, y) Equivalence classes: p_location & c_location is int p_location & c_location is float p_location & c_location is string p_location & c_location is nil (EDGE CASE) This test when p_location & c_location is int | def test_print_heading_int
assert_output("Heading from 1 to 2\n") {@p.print_heading(1, 2)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_print_heading_float\n assert_output(\"Heading from 1.1 to 1.2\\n\"){@p.print_heading(1.1, 1.2)}\n end",
"def print_heading(p_location, c_location)\n puts \"Heading from #{p_location} to #{c_location}\"\n end",
"def test_print_heading_string\n assert_output(\"Heading from a to b\\n\"){@p.pri... | [
"0.68202645",
"0.6547389",
"0.6141124",
"0.5978521",
"0.56970406",
"0.55034757",
"0.549947",
"0.54888195",
"0.5483786",
"0.54391265",
"0.5429799",
"0.542439",
"0.5386995",
"0.5320929",
"0.5316112",
"0.53054094",
"0.53051925",
"0.52602935",
"0.5222202",
"0.5188348",
"0.5155114... | 0.6503349 | 2 |
This test when plocation & c_location is float | def test_print_heading_float
assert_output("Heading from 1.1 to 1.2\n"){@p.print_heading(1.1, 1.2)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Float(p0) end",
"def test_set_y_as_float\n obj = Geom::Point3d.new\n obj.y = 1000.0\n result = obj.y\n expected = 1000.0\n assert_equal(expected, result, 'expected does not match result.')\n end",
"def test_that_px_return_is_accurate\n end",
"def test_set_x_as_float\n obj = Geom::Poin... | [
"0.63382536",
"0.5950707",
"0.5931596",
"0.59093416",
"0.58271664",
"0.577655",
"0.56678456",
"0.55483425",
"0.55479413",
"0.54888403",
"0.54647756",
"0.545712",
"0.53431904",
"0.5321244",
"0.5310455",
"0.5304073",
"0.5290183",
"0.5278883",
"0.52777004",
"0.5248554",
"0.52435... | 0.5132593 | 36 |
This test when plocation & c_location is string | def test_print_heading_string
assert_output("Heading from a to b\n"){@p.print_heading('a', 'b')}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_getLocation_string\n\t\td = Driver::new(\"Driver 1\",0);\n\t\tdef d.getLocation; d.location=\"string\",\"string\"; end\n\t\tassert_raises (\"Invalid location\") {d.getLocation}\n\tend",
"def test_new_location\n\t\t@new_driver.location 'Cathedral'\n\t\tassert_equal 'Hillman', @new_driver.location('Hillma... | [
"0.6807698",
"0.6642619",
"0.65418285",
"0.6290512",
"0.6233848",
"0.6146799",
"0.6135825",
"0.6095846",
"0.60549414",
"0.6047841",
"0.59614074",
"0.59530735",
"0.5932694",
"0.5925589",
"0.5862508",
"0.5859755",
"0.58303416",
"0.5815342",
"0.57628417",
"0.5755477",
"0.5755477... | 0.0 | -1 |
This test when plocation & c_location is string EDGE CASE | def test_print_heading_nil
assert_output("Heading from to \n"){@p.print_heading(nil, nil)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_locations_of_fourth_ave\n\t\tassert_equal \"Cathedral\", @road2.locations[0]\n\tend",
"def test_getLocation_string\n\t\td = Driver::new(\"Driver 1\",0);\n\t\tdef d.getLocation; d.location=\"string\",\"string\"; end\n\t\tassert_raises (\"Invalid location\") {d.getLocation}\n\tend",
"def test_nodes_of_m... | [
"0.64605343",
"0.6340142",
"0.6240623",
"0.61671096",
"0.5950059",
"0.58482087",
"0.5822723",
"0.5799633",
"0.57785743",
"0.57510465",
"0.5735888",
"0.57333225",
"0.5730655",
"0.56955725",
"0.5674328",
"0.5665815",
"0.56634897",
"0.5632169",
"0.5628813",
"0.5627095",
"0.56203... | 0.0 | -1 |
UNIT TEST FOR plural?(x) Equivalence classes: num = nil, raise num = string, raise num = float, output num = 0, nil (EDGE CASE) num = 1, ruby num = 2, rubies This is test when argument is nil | def test_plural_nil
assert_raises(StandardError) {@p.plural?(nil)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_plural_zero\n assert_nil @p.plural?(0) # pass\n end",
"def test_plural_float\n assert_raises(StandardError) {@p.plural?(nil)}\n end",
"def test_plural_int\n assert_equal @p.plural?(1), 'ruby'\n end",
"def test_plural_fake_ruby\n\t\tp = Print.new\n\t\tassert_equal('fake rubies',p.singular... | [
"0.7791284",
"0.7627199",
"0.76071376",
"0.7541795",
"0.7407258",
"0.7384064",
"0.7323171",
"0.72481453",
"0.7199416",
"0.7174054",
"0.7129958",
"0.7129958",
"0.69237715",
"0.6913732",
"0.69008666",
"0.6876962",
"0.6868373",
"0.6867691",
"0.68649095",
"0.68616617",
"0.6832607... | 0.72552925 | 7 |
This is test when argument is string | def test_plural_string
assert_raises(StandardError) {@p.plural?('1')}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_string_argument\n\t\tc = Check.new\n\t\tassert c.check_arguments([1,'1',1])\n\tend",
"def test_arg_check_2string\n \t@args = ArgumentCheck.new\n \tassert_equal(false, @args.arg_check(['poop', 'poopy']))\n end",
"def test_string\n args = Arguments.new\n assert_equal false, args.check_args(\"pu... | [
"0.79087615",
"0.7774432",
"0.7694724",
"0.7398407",
"0.73502505",
"0.723945",
"0.7170603",
"0.71640295",
"0.7157925",
"0.7156593",
"0.71093017",
"0.7016032",
"0.7002829",
"0.6866893",
"0.68579733",
"0.6769648",
"0.67623407",
"0.6730276",
"0.6684669",
"0.668405",
"0.6581949",... | 0.0 | -1 |
This is test when argument is float | def test_plural_float
assert_raises(StandardError) {@p.plural?(nil)}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_float?(input)\n input.to_f.to_s == input\nend",
"def expect_float(value, field, subfield)\n return true if value.blank?\n return true if value.is_a?(Float)\n errors.add(field, \"#{subfield} must be a float if present\")\n false\n end",
"def assert_floatable *args\n args.each do |var|\n ... | [
"0.7816875",
"0.7639962",
"0.75670135",
"0.7542371",
"0.7528992",
"0.7497348",
"0.7452879",
"0.7447892",
"0.7410901",
"0.74067193",
"0.7391274",
"0.73643905",
"0.7355525",
"0.73177963",
"0.72912925",
"0.7222796",
"0.72143734",
"0.7184208",
"0.7174543",
"0.7138671",
"0.7115527... | 0.0 | -1 |
This test when argument is 0 EDGE CASE | def test_plural_zero
assert_nil @p.plural?(0) # pass
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_has_edge_no_edge\n assert(@graph.has_edge('b', 'd') == false)\n end",
"def test_has_edge_no_vertices\n assert(@graph.has_edge('vertex1', 'vertex2') == false)\n end",
"def left_edge?\n x == 0\n end",
"def test_add_edge\n @dgraph.add_edge('a', 'b');\n\n # 0 and 1 are indexes of verte... | [
"0.7012968",
"0.69316167",
"0.6673757",
"0.6487532",
"0.6445666",
"0.63026214",
"0.62940925",
"0.6287029",
"0.6257546",
"0.62526953",
"0.62267804",
"0.62019813",
"0.61909556",
"0.6190218",
"0.6151867",
"0.61216295",
"0.6097385",
"0.60625404",
"0.60580665",
"0.6057023",
"0.603... | 0.0 | -1 |
This test when argument is 1 | def test_plural_int
assert_equal @p.plural?(1), 'ruby'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_one_ints\n args = Arguments.new\n assert_equal false, args.check_args([1])\n end",
"def test_arg_check_oneArg\n \t@args = ArgumentCheck.new\n \tassert_equal(true, @args.arg_check([1]))\n end",
"def test_zero_prospectors\n\t\tassert check_args([1, 0])\n\tend",
"def test_two_proper_args\n ... | [
"0.7622138",
"0.743615",
"0.7195343",
"0.70547104",
"0.7014577",
"0.6915063",
"0.68871063",
"0.6840762",
"0.6839033",
"0.68043566",
"0.67905796",
"0.679016",
"0.67880607",
"0.6786294",
"0.6784588",
"0.6754007",
"0.67511725",
"0.6744973",
"0.6741394",
"0.67299134",
"0.66457766... | 0.0 | -1 |
This test when argument is 2 | def test_plural_int2
assert_equal @p.plural?(2), 'rubies'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_two_proper_args\n assert check_args([1, 1])\n end",
"def test_two_ints\n args = Arguments.new\n assert_equal false, args.check_args([1, 2])\n end",
"def method (*args)\n\t\tif args.length > 2\n\t\t\tputs \"More than two\"\n\t\tend\n\tend",
"def test_two_valid_arguments\n\t\tc = Check.new... | [
"0.72483855",
"0.71668065",
"0.6878214",
"0.68528855",
"0.68295324",
"0.68191093",
"0.6785881",
"0.6750832",
"0.673654",
"0.66523933",
"0.66133225",
"0.65546674",
"0.6458871",
"0.6458053",
"0.64373255",
"0.6428041",
"0.6426829",
"0.6420906",
"0.6400976",
"0.6395065",
"0.63244... | 0.0 | -1 |
UNIT TESTS FOR mood?(x) Equvalent classes: total = nil (EDGE CASE) total = 0 total = 1 total = 5 total = 9 total = 10 total = 100 This test when found no ruby | def test_mood1
assert_equal @p.mood?([0, 0]), 'empty-handed.'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mood?(total_ruby_found)\n total_real = total_ruby_found[0]\n return 'victorious!' if total_real >= 10\n return 'sad.' if total_real >= 1 && total_real <= 9\n return 'empty-handed.' if total_real.zero?\n end",
"def test_mood6\n assert_equal @p.mood?([100, 0]), 'victorious!'\n end",
"def tes... | [
"0.7173911",
"0.685631",
"0.67086405",
"0.6661949",
"0.66006815",
"0.63181806",
"0.6314163",
"0.62224674",
"0.6221259",
"0.6200686",
"0.61864275",
"0.613763",
"0.6074936",
"0.6011024",
"0.598571",
"0.59780777",
"0.5968635",
"0.58969223",
"0.5896835",
"0.58573604",
"0.5835133"... | 0.6403735 | 5 |
This test when found 1 rubies | def test_mood2
assert_equal @p.mood?([1, 0]), 'sad.'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_rubies_found_positive\n prospector = Rubyist.new(1)\n prospector.rubies_found(2, 2)\n assert prospector.real_ruby_count == 2 && prospector.fake_ruby_count == 2\n end",
"def test_fake_rubies_found\n\t\ttest_main = Main.new(3, 4, 6)\n\t\ttest_graph = Graph.new(10)\n\t\ttest_main.fake_rubies_foun... | [
"0.68268263",
"0.6563489",
"0.64960057",
"0.63847125",
"0.63142204",
"0.63050383",
"0.6188883",
"0.6137769",
"0.60396993",
"0.60160804",
"0.59812915",
"0.5976445",
"0.5967973",
"0.59442544",
"0.59298074",
"0.58944863",
"0.5887532",
"0.57994473",
"0.5781634",
"0.5744973",
"0.5... | 0.0 | -1 |
This test when found 5 rubies | def test_mood3
assert_equal @p.mood?([5, 0]), 'sad.'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_rubies_found_positive\n prospector = Rubyist.new(1)\n prospector.rubies_found(2, 2)\n assert prospector.real_ruby_count == 2 && prospector.fake_ruby_count == 2\n end",
"def sample_rubies\n @sample_rubies ||= sample_mri_rubies + %w[ jruby-9.3 ]\n end",
"def sample_mri_rubies\n @sample_... | [
"0.65690386",
"0.64885926",
"0.64375806",
"0.62965983",
"0.6247658",
"0.6206247",
"0.6169475",
"0.61245495",
"0.60010076",
"0.5994164",
"0.5965378",
"0.5949765",
"0.59384394",
"0.592935",
"0.5929066",
"0.5915587",
"0.5893615",
"0.5855466",
"0.58351475",
"0.5807437",
"0.572614... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.