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 |
|---|---|---|---|---|---|---|
Check if this is strategy is valid for token authentication by: Validating if the model allows http token authentication; If the http auth token exists; If all authentication keys are present; | def valid_for_token_auth?
token_authenticatable? && auth_token.present? && with_authentication_hash(:token_auth, token_auth_hash)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def valid_for_http_auth?; end",
"def valid_for_http_auth?\n http_authenticatable? && request.authorization && with_authentication_hash(:http_auth, http_auth_hash)\n end",
"def valid_for_http_auth?\n http_authenticatable? && request.authorization && with_authentication_hash(:http_auth, http_a... | [
"0.7041878",
"0.7001891",
"0.7001891",
"0.6886253",
"0.68516296",
"0.67922866",
"0.6767933",
"0.67651653",
"0.67651653",
"0.6761605",
"0.67333245",
"0.6726585",
"0.6720727",
"0.67186624",
"0.66590667",
"0.66368943",
"0.6631767",
"0.6630824",
"0.65950865",
"0.6548694",
"0.6547... | 0.769772 | 0 |
Extract the auth token from the request | def auth_token
@auth_token ||= ActionController::HttpAuthentication::Token.token_and_options(request)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_token\n request.headers[\"Authorization\"]\n end",
"def auth_token\n @auth_token ||= request.headers.fetch('Authorization', '').split(' ').last\n end",
"def auth_token\n\t\trequest.headers['X-AUTH-TOKEN']\n\tend",
"def token\n request.headers['Authorization']\n end",
"def token\n req... | [
"0.81619734",
"0.8092049",
"0.80811375",
"0.8016876",
"0.8015023",
"0.7934743",
"0.79344875",
"0.7931357",
"0.77916306",
"0.77791977",
"0.7749467",
"0.77203435",
"0.76937854",
"0.7681799",
"0.76540864",
"0.7651886",
"0.75861794",
"0.75100935",
"0.7492931",
"0.7478362",
"0.741... | 0.7512946 | 17 |
Extract a hash with attributes:values from the auth_token | def token_auth_hash
request.env['devise.token_options'] = auth_token.last
{ authentication_keys.first => auth_token.first }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def token_auth\n Hash['type' => 'token',\n 'token' => @token,]\n end",
"def decoded_auth_token\r\n result = Token::Decode.call(token: auth_token)\r\n add_error!(result.errors) if result.failure?\r\n result.decoded.first.deep_symbolize_keys\r\n end",
"def token_metadata()\n re... | [
"0.7102526",
"0.6746768",
"0.66460097",
"0.6618754",
"0.66126317",
"0.659825",
"0.65188795",
"0.6508586",
"0.6508586",
"0.6508586",
"0.6508586",
"0.6508586",
"0.6508586",
"0.648483",
"0.6441241",
"0.6418696",
"0.6337404",
"0.6331957",
"0.6305045",
"0.6304375",
"0.6304226",
... | 0.6742437 | 2 |
Try both scoped and non scoped keys | def params_auth_hash
if params[scope].kind_of?(Hash) && params[scope].has_key?(authentication_keys.first)
params[scope]
else
params
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_key?(p0) end",
"def safe_obj_by_key!(obj_key)\n safe_obj_by_key(obj_key) or raise ActiveRecord::RecordNotFound\n end",
"def nil_in_scope?(scope, key)\n if scope.is_a?(Hash)\n scope.include?(key)\n else\n scope.exist?(key)\n end\n end",
"def key?(key); end",
"def key?(key); e... | [
"0.57348037",
"0.57246786",
"0.56883854",
"0.5585642",
"0.5585642",
"0.5585642",
"0.5585642",
"0.5585642",
"0.5585642",
"0.5583226",
"0.55722284",
"0.5567963",
"0.5522396",
"0.5500341",
"0.5500341",
"0.548573",
"0.548573",
"0.548573",
"0.548573",
"0.5444577",
"0.5394912",
"... | 0.0 | -1 |
Overwrite authentication keys to use token_authentication_key. | def authentication_keys
@authentication_keys ||= [mapping.to.token_authentication_key]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_authentication_token!\n self.authentication_token = generate_authentication_token\n end",
"def assign_authentication_token\n self.authentication_token = generate_authentication_token\n end",
"def reset_authentication_token\n self.authentication_token = self.class.authentication_token\n... | [
"0.7216031",
"0.7142283",
"0.71310216",
"0.71310216",
"0.71310216",
"0.69755006",
"0.6915958",
"0.6893033",
"0.67329884",
"0.67137694",
"0.671262",
"0.671262",
"0.671262",
"0.6679886",
"0.6656209",
"0.6630596",
"0.6615204",
"0.65492517",
"0.654586",
"0.65195876",
"0.6515546",... | 0.663985 | 15 |
syntax used to override the existing characteristic def name=(name) | def add_planet_object(new_planet_object)
@solar_system.push(new_planet_object)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def name=(name)\n end",
"def name=(name)\n attributes[:name] = name\n end",
"def name=(name)\n @name = name.to_sym\n end",
"def name=(name)\n @name = name.to_sym\n end",
"def name=(value)\n @name = attributes[:name] = value\n end",
"def name=(value); end",
"def name... | [
"0.74644125",
"0.74427956",
"0.7385349",
"0.7385349",
"0.7377687",
"0.7332945",
"0.7312952",
"0.7312952",
"0.7292983",
"0.7292983",
"0.72893715",
"0.72867167",
"0.72845715",
"0.7268483",
"0.7268483",
"0.7268483",
"0.7252629",
"0.7227303",
"0.7219876",
"0.72183424",
"0.7215254... | 0.0 | -1 |
Outputs all planet's details | def return_solar_system_info
solar_system_output = ""
@solar_system.each do |planet_object| # planet_object represents a new planet instance
#add to planet_output string
solar_system_output += planet_object.planet_output
end
return solar_system_output
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def display_planet_details\n puts \"Name: #{@name}, Primary Export: #{@primary_export}, Year-Length: #{@year_length}\"\n end",
"def display_planet_list\n puts \"Here are the current planets in our solar system:\"\n @all_planets.each do |planet_info|\n puts planet_info.name\n end\n end",
"d... | [
"0.8306481",
"0.8136911",
"0.80716044",
"0.8038207",
"0.7982642",
"0.7883343",
"0.7865117",
"0.77571726",
"0.7530564",
"0.7459014",
"0.73770374",
"0.73762095",
"0.7315038",
"0.7277095",
"0.72429883",
"0.7241746",
"0.71814317",
"0.7120037",
"0.7113403",
"0.7113081",
"0.7095952... | 0.65108037 | 48 |
makes list of planet names for user | def return_planet_names
planet_names = ""
@solar_system.each do |planet_name|
planet_names += planet_name.planets_name
end
return planet_names
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_planet_names\n list_planet_names = []\n planets_collection.each do |planet_name|\n list_planet_names << planet_name.name\n end\n return list_planet_names\n end",
"def names\n planet_names = []\n @planets.each do |planet|\n planet_names << planet.name\n end\n return pla... | [
"0.7407218",
"0.71585333",
"0.6812985",
"0.67156285",
"0.6709552",
"0.6674635",
"0.6647837",
"0.6593706",
"0.6565374",
"0.65113515",
"0.6445186",
"0.63663155",
"0.63534296",
"0.6338749",
"0.63104767",
"0.6250445",
"0.62383366",
"0.62136966",
"0.61254036",
"0.6119616",
"0.6114... | 0.71249974 | 2 |
This method previously used an if/else statement, but not necessary Comparison will inherently return a true/false value | def correct?
@card.answer == @guess
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_decision\n return (@index == 89)\n end",
"def equal?(p0) end",
"def complex_condition?(condition); end",
"def comparable?\n comparison.possible?\n end",
"def matches? actual\n super\n\n true === actual || false === actual\n end",
"def active?\n return true if condit... | [
"0.6401421",
"0.6288651",
"0.62848186",
"0.62493205",
"0.62223715",
"0.6176551",
"0.61542106",
"0.61527586",
"0.61260927",
"0.61127234",
"0.6094867",
"0.6061598",
"0.6057496",
"0.6039006",
"0.601699",
"0.60078686",
"0.598529",
"0.59757304",
"0.59544384",
"0.5945235",
"0.59413... | 0.0 | -1 |
Replace references (like `!123` for merge requests) in text with links to the referenced object's details page. text String text to replace references in. pattern Reference pattern to match against. link_text Original content of the link being replaced. Returns a String with references replaced with links. All links ha... | def object_link_filter(text, pattern, link_text: nil)
references_in(text, pattern) do |match, id, project_ref, matches|
project = project_from_ref(project_ref)
if project && object = find_object(project, id)
title = object_link_title(object)
klass = reference_class(o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def object_link_filter(text, pattern, link_content: nil, link_reference: false)\n references_in(text, pattern) do |match, id, project_ref, namespace_ref, matches|\n parent_path = if parent_type == :group\n reference_cache.full_group_path(namespace_ref)\n ... | [
"0.7418532",
"0.6392054",
"0.61665416",
"0.60948056",
"0.6020745",
"0.5958812",
"0.59488475",
"0.57216203",
"0.57102185",
"0.5662027",
"0.5616426",
"0.55904794",
"0.55877477",
"0.55626297",
"0.5554634",
"0.5533021",
"0.5516004",
"0.54766965",
"0.54433966",
"0.53974056",
"0.53... | 0.7566092 | 0 |
names and ids of employees related to current customer through ratings | def related_employees
ratings.employees
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def related_customers\n ratings.customers\n end",
"def index\n @employee_reviewers = EmployeeReviewer.all\n end",
"def show\n @employee = current_owner.employees.find(params[:id])\n @rating = 0.0\n if @employee.category == 'Server'\n @rating = (@employee.rating/@employee.rating_count)\n ... | [
"0.664599",
"0.6121532",
"0.59949106",
"0.5828474",
"0.580655",
"0.5717194",
"0.5701225",
"0.5683392",
"0.56656146",
"0.56596404",
"0.56583965",
"0.5652547",
"0.5618458",
"0.56177235",
"0.5598029",
"0.5589971",
"0.55847096",
"0.5523275",
"0.55099225",
"0.5498536",
"0.548302",... | 0.75763 | 0 |
def delete_member member = User.find(params[:member_id]) | def get_partner_by_identifier
@partner = Partner.find_by!(partner_id: params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @member = Member.find_by_url_or_id(params[:id])\n @member.destroy\n\n redirect_to(members_url)\n end",
"def destroy\n member = Member.find_by(user_id: @user)\n\n member.delete\n redirect_to users_teachers_path\n end",
"def \n \n\n # ADMIN ONLY:\n # Deleting a Member\n # de... | [
"0.8455267",
"0.82600856",
"0.8243535",
"0.82045",
"0.8100266",
"0.8100266",
"0.80710566",
"0.80618745",
"0.80606204",
"0.8060171",
"0.80444735",
"0.79599345",
"0.79275393",
"0.7911124",
"0.7911124",
"0.79048854",
"0.79048854",
"0.79048854",
"0.79048854",
"0.79048854",
"0.790... | 0.0 | -1 |
Output a metatag for use in your site header. The key you supply is looked up in the configuration under 'meta_data'. You can override it on a peritem basis. Usage: This will output: | def meta_tag(key)
value = @item[key] || @config[:meta_data][key]
if key == :author && value[0] == "@" && author_full_name = item[:author_full_name]
value = %Q{#{author_full_name} (#{value})}
end
return '<meta name="%s" content="%s">' % [key, value] if value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def site_meta\n end",
"def site_meta\n end",
"def print_meta_head\n puts \"\\nDataset: #{@meta_data.name}\"\n end",
"def metatags(**options)\n itemprop = options.dig(:config, :itemprop)\n safe_join(\n options.fetch(:value, []).map { |v| content_tag(:meta, nil, itemprop: itemprop, c... | [
"0.6775672",
"0.6775672",
"0.6740291",
"0.6675125",
"0.6618802",
"0.64936906",
"0.64429647",
"0.63823634",
"0.63566035",
"0.63070077",
"0.6298019",
"0.6256457",
"0.625618",
"0.6244859",
"0.61157477",
"0.61153454",
"0.6087819",
"0.6083769",
"0.60744756",
"0.6067409",
"0.606733... | 0.7623807 | 0 |
Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. | def additional_data
return @additional_data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [] | [] | 0.0 | -1 |
Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. | def additional_data=(value)
@additional_data = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [] | [] | 0.0 | -1 |
Instantiates a new vppLicensingType and sets the default values. | def initialize()
@additional_data = Hash.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def license_type=(value)\n @license_type = value\n end",
"def new\n @license = License.new\n end",
"def set_defaults\n super\n self.organization_type ||= OrganizationType.find_by_class_name(self.name).first\n self.license_holder = self.license_holder.nil? ? false : self.l... | [
"0.6091393",
"0.5869694",
"0.5799844",
"0.5764062",
"0.5699143",
"0.5460641",
"0.5454361",
"0.54423815",
"0.537995",
"0.52822274",
"0.52452385",
"0.52094513",
"0.52094513",
"0.519091",
"0.5187534",
"0.5174488",
"0.51735103",
"0.5131364",
"0.5094562",
"0.50888777",
"0.50698096... | 0.0 | -1 |
The deserialization information for the current model | def get_field_deserializers()
return {
"@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
"supportsDeviceLicensing" => lambda {|n| @supports_device_licensing = n.get_boolean_value() },
"supportsUserLicensing" => lambda {|n| @sup... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },... | [
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.612005... | 0.0 | -1 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
writer.write_string_value("@odata.type", @odata_type)
writer.write_boolean_value("supportsDeviceLicensing", @supports_device_licensing)
writer.write_boolean_value("supportsUs... | {
"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 supportsDeviceLicensing property value. Whether the program supports the device licensing type. | def supports_device_licensing
return @supports_device_licensing
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supports_device_licensing=(value)\n @supports_device_licensing = value\n end",
"def supports_user_licensing\n return @supports_user_licensing\n end",
"def use_device_licensing\n return @use_device_licensing\n end",
"def support... | [
"0.7758416",
"0.71112776",
"0.7030706",
"0.66035527",
"0.6564491",
"0.6317054",
"0.5717584",
"0.5691429",
"0.56347615",
"0.5599674",
"0.55289376",
"0.5523878",
"0.5471138",
"0.5444822",
"0.5423648",
"0.5422119",
"0.5388015",
"0.53696954",
"0.5327952",
"0.53098255",
"0.5297871... | 0.81610507 | 0 |
Sets the supportsDeviceLicensing property value. Whether the program supports the device licensing type. | def supports_device_licensing=(value)
@supports_device_licensing = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def use_device_licensing=(value)\n @use_device_licensing = value\n end",
"def supports_user_licensing=(value)\n @supports_user_licensing = value\n end",
"def supports_device_licensing\n return @supports_device_licensing\n end",
"de... | [
"0.7145748",
"0.7064893",
"0.6922027",
"0.6313035",
"0.59870464",
"0.56298995",
"0.5600582",
"0.5229929",
"0.52038616",
"0.51187027",
"0.51061213",
"0.4984789",
"0.4944469",
"0.49356318",
"0.4935616",
"0.48836693",
"0.48761922",
"0.48729065",
"0.48701426",
"0.48276457",
"0.48... | 0.8162439 | 0 |
Gets the supportsUserLicensing property value. Whether the program supports the user licensing type. | def supports_user_licensing
return @supports_user_licensing
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supports_user_licensing=(value)\n @supports_user_licensing = value\n end",
"def supports_device_licensing\n return @supports_device_licensing\n end",
"def supports_device_licensing=(value)\n @supports_device_licensing = value\n e... | [
"0.79660887",
"0.6939377",
"0.6737575",
"0.6297614",
"0.60830945",
"0.60619533",
"0.6038484",
"0.6008308",
"0.57362694",
"0.5717164",
"0.57149285",
"0.57056206",
"0.5553614",
"0.5542174",
"0.5496004",
"0.5481123",
"0.5479789",
"0.5479503",
"0.5455847",
"0.54142326",
"0.540850... | 0.82693636 | 0 |
Sets the supportsUserLicensing property value. Whether the program supports the user licensing type. | def supports_user_licensing=(value)
@supports_user_licensing = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def supports_user_licensing\n return @supports_user_licensing\n end",
"def supports_device_licensing=(value)\n @supports_device_licensing = value\n end",
"def use_device_licensing=(value)\n @use_device_licensing = value\n end",
"de... | [
"0.715114",
"0.69857126",
"0.6176663",
"0.58985436",
"0.56527054",
"0.5454525",
"0.5403231",
"0.53311175",
"0.53096974",
"0.52989715",
"0.5231524",
"0.51050246",
"0.50451785",
"0.49851236",
"0.49382547",
"0.4931299",
"0.49258137",
"0.49191695",
"0.49121922",
"0.4851979",
"0.4... | 0.8389503 | 0 |
Returns a hash with AT LEAST 'error_description'. When an error is raised manually there will be no response! This is handled by using the specified message as the error_description. | def parsed_error
default = %({"error_description": "#{message}"})
value = response_value(:body, fallback: default)
JSON.parse(value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def error_message\n @response.reason_phrase\n end",
"def error_message(response)\n \"#{response.body['error']}: #{response.body['error_description']}\"\n end",
"def message # :nodoc:\n @properties['errorMessage'].dup\n end",
"def error_message\n error.message\n end",
... | [
"0.75772595",
"0.7091678",
"0.7032348",
"0.7016525",
"0.6947076",
"0.69442844",
"0.6879689",
"0.68669486",
"0.685439",
"0.6837227",
"0.68224543",
"0.6816594",
"0.6810615",
"0.6746407",
"0.6730641",
"0.67079693",
"0.66595906",
"0.6644507",
"0.6626498",
"0.6625445",
"0.6620263"... | 0.6349787 | 39 |
Returns the status code of the response, or :none if there is no response. | def status_code
response_value(:code)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status_code\n @response.status\n end",
"def http_response_code(status = nil)\n if status\n @status = status\n else\n @status\n end\n end",
"def response_status\n @response[:status]\n end",
"def status\n @response && @response.status\n en... | [
"0.791286",
"0.784575",
"0.7833584",
"0.75452954",
"0.75026375",
"0.7446368",
"0.7436242",
"0.7435529",
"0.73919356",
"0.73919356",
"0.7358877",
"0.73302007",
"0.72838515",
"0.7279889",
"0.72613215",
"0.7190243",
"0.7183274",
"0.71645373",
"0.71473044",
"0.7093248",
"0.707728... | 0.761336 | 3 |
Performs the background migration. See Gitlab::BackgroundMigration.perform for more information. class_name The class name of the background migration to run. arguments The arguments to pass to the migration class. | def perform(class_name, arguments = [])
should_perform, ttl = perform_and_ttl(class_name)
if should_perform
Gitlab::BackgroundMigration.perform(class_name, arguments)
else
# If the lease could not be obtained this means either another process is
# running a migration of this class or we r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def perform(class_name, arguments = [])\n Gitlab::BackgroundMigration.perform(class_name, arguments)\n end",
"def perform(class_name, arguments = [])\n should_perform, ttl = perform_and_ttl(class_name)\n\n if should_perform\n Gitlab::BackgroundMigration.perform(class_name, arguments)\n else\n ... | [
"0.86792785",
"0.764512",
"0.60963833",
"0.57848877",
"0.5520075",
"0.5465419",
"0.5380392",
"0.5306774",
"0.52860546",
"0.5257437",
"0.5252014",
"0.5234083",
"0.5193906",
"0.5109588",
"0.5081656",
"0.5051195",
"0.50469244",
"0.5046168",
"0.50429577",
"0.50428015",
"0.503439"... | 0.76291615 | 2 |
Returns true if the database is healthy enough to allow the migration to be performed. class_name The name of the background migration that we might want to run. | def healthy_database?
return true unless Gitlab::Database.postgresql?
!Postgresql::ReplicationSlot.lag_too_great?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def healthy?\n return true\n end",
"def undergrad?\n sdb.class_standing <= 5\n end",
"def healthy?\n !unhealthy?\n end",
"def is_upgraded # rubocop:disable Naming/PredicateName\n read_bool('is_upgraded')\n end",
"def perform(class_name, arguments = [])\n should_perfor... | [
"0.6009965",
"0.5817389",
"0.57966673",
"0.5787658",
"0.5754511",
"0.57348126",
"0.57142085",
"0.5710745",
"0.571063",
"0.5693515",
"0.55381936",
"0.5477138",
"0.5472138",
"0.5439017",
"0.54278344",
"0.54183227",
"0.5401769",
"0.5401769",
"0.53893465",
"0.5383304",
"0.5378653... | 0.630057 | 0 |
Never trust parameters from the scary internet, only allow the white list through. | def user_params
params.require(:user).permit(:first_name, :last_name, :email,
:password, :password_confirmation, :bio,
:profile_pic, :phone, :website, :sex,
:goal, :ideal_session, :ideal_body_type,
... | {
"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.6980629",
"0.67819995",
"0.67467666",
"0.67419875",
"0.67347664",
"0.65928614",
"0.6504013",
"0.6498014",
"0.64819515",
"0.64797956",
"0.64562726",
"0.64400834",
"0.6380117",
"0.6377456",
"0.63656694",
"0.6320543",
"0.63002014",
"0.62997127",
"0.629425",
"0.6293866",
"0.62... | 0.0 | -1 |
I believe because of the return statement in the middle. | def scream(words)
words = words + "!!!!"
return
puts words
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def returns; end",
"def return_value; end",
"def return(&block); end",
"def probers; end",
"def private; end",
"def original_result; end",
"def returns=(_arg0); end",
"def return!(&block); end",
"def result; end",
"def result; end",
"def result; end",
"def result; end",
"def result; end",
... | [
"0.70783865",
"0.6416686",
"0.6345312",
"0.63239646",
"0.6321914",
"0.63185143",
"0.6219942",
"0.5994727",
"0.598929",
"0.598929",
"0.598929",
"0.598929",
"0.598929",
"0.598929",
"0.598929",
"0.598929",
"0.5988111",
"0.5930673",
"0.5907133",
"0.59018654",
"0.5900572",
"0.59... | 0.0 | -1 |
Enqueues a notification to be sent in the background via the persistent TCP socket, assuming apn_sender is running (or will be soon) | def notify_async(token, opts = {})
token = token.to_s.gsub(/\W/, '')
if defined?(Resque)
Resque.enqueue(APN::NotificationJob, token, opts)
else
Thread.new do
APN.notify_sync(token, opts)
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def send_notification2(msg)\n raise \"please start server first before notify !!\" unless @x_notify\n puts \"[AmqpServer] notify: message=#{msg}\" if $DEBUG\n MQ.fanout(@x_notify).publish(Blix.to_binary_data(msg))\n end",
"def send_notification(msg)\n $BLIX_NOTIFY.push(msg)\n ... | [
"0.60025316",
"0.59866893",
"0.59660804",
"0.5922265",
"0.5906764",
"0.5896566",
"0.58515537",
"0.5791127",
"0.56681436",
"0.5640998",
"0.5633598",
"0.5580561",
"0.5543419",
"0.5539295",
"0.5496902",
"0.5487071",
"0.54816353",
"0.5480877",
"0.5442305",
"0.5440789",
"0.5432988... | 0.5286508 | 33 |
Log message to any logger provided by the user (e.g. the Rails logger). Accepts +log_level+, +message+, since that seems to make the most sense, and just +message+, to be compatible with Resque's log method and to enable sending verbose and very_verbose worker messages to e.g. the rails logger. Perhaps a method definit... | def log(level, message = nil)
level, message = 'info', level if message.nil? # Handle only one argument if called from Resque, which expects only message
return false unless logger && logger.respond_to?(level)
logger.send(level, "#{Time.now}: #{message}")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log(message)\n logger.send(log_level, message) if log?\n end",
"def log(message)\n logger.send(log_level, message) if log?\n end",
"def log(message)\n logger.send log_level, message if log?\n end",
"def log(level, message = nil)\n level, message = :info, level if message.nil?... | [
"0.7931514",
"0.7931514",
"0.7892237",
"0.76543194",
"0.7523317",
"0.7523317",
"0.73713255",
"0.73713255",
"0.71590805",
"0.7106197",
"0.71029454",
"0.7035029",
"0.70288676",
"0.6947142",
"0.67888457",
"0.6693763",
"0.66708535",
"0.66707116",
"0.6661906",
"0.6661906",
"0.6661... | 0.7486131 | 6 |
Log the message first, to ensure it reports what went wrong if in daemon mode. Then die, because something went horribly wrong. | def log_and_die(msg)
logger.fatal(msg)
raise msg
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fatal!(message)\n fatal(message)\n exit 1\n end",
"def fatal!(message)\n # Not using safe_each in case that caused an error.\n safely { $stdout.reopen(@stdout, 'a+'); $stdout.puts message }\n safely { $stderr.reopen(@stderr, 'a+'); $stderr.puts message }\n exit 1\n end",
"de... | [
"0.65115887",
"0.6410398",
"0.6358074",
"0.6319914",
"0.626562",
"0.61930645",
"0.6123369",
"0.6101501",
"0.60806197",
"0.60743386",
"0.60346764",
"0.602871",
"0.599274",
"0.599274",
"0.5906581",
"0.5901394",
"0.5878756",
"0.5878739",
"0.58775455",
"0.58692634",
"0.5863937",
... | 0.6033315 | 11 |
Prepare the data to be consumed, calculating total number of scope | def prepare!
prepare_once
@total_rows_number = postgres.execute("SELECT COUNT('id') FROM #{data_table_name} WHERE #{data_where_scope}")[0][0].to_i
@iteration_number = 0
@finished = false
@prepared = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare_data\n initial_data_eval \n initial_sorting if self.data_grid.sorting?\n filter\n global_summary_array\n pagination\n summary_array\n self.data_grid.row_styler\n prepare_data_for_filters\n end",
"def calc_stats\n #puts \"bad_biz = #{@bad_business_recor... | [
"0.62766397",
"0.5691923",
"0.5393254",
"0.5376909",
"0.52879477",
"0.5272601",
"0.52602106",
"0.52551997",
"0.5231902",
"0.52255064",
"0.5224414",
"0.52049613",
"0.5181719",
"0.51760465",
"0.51528215",
"0.51411486",
"0.5126298",
"0.51252866",
"0.5123852",
"0.511472",
"0.5108... | 0.5484227 | 2 |
Returns is the any data or not | def any?
raise "#{self.class}: instance not prepared before doing any move" unless @prepared
@total_rows_number > 0
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def data?\n dis_data.any?\n end",
"def empty?\n data.empty?\n end",
"def empty?\n data.empty?\n end",
"def empty?\n @data.empty?\n end",
"def empty?\n @data.empty?\n end",
"def empty?\n @data.empty?\n end",
"def empty?\n @data.empty?\n end",
"def given?... | [
"0.81710225",
"0.7659534",
"0.7659534",
"0.7591133",
"0.7591133",
"0.757667",
"0.757667",
"0.7506342",
"0.7307526",
"0.73058265",
"0.7274469",
"0.7267947",
"0.72631747",
"0.7261934",
"0.72170717",
"0.7169594",
"0.71683633",
"0.7146941",
"0.71234304",
"0.70046973",
"0.69847405... | 0.0 | -1 |
Fetch the data and process it row by row | def each_row_for_next_chunk
return nil if finished?
raise "#{self.class}: instance not prepared before running the iteration" unless @prepared
select_sql = @select_sql.present? ? @select_sql : '*'
sql = "SELECT #{select_sql} FROM #{data_table_name} WHERE #{data_where_scope} ORDER BY id ASC LIMIT #{Impo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_row\n if @row_buffer.empty?\n if @done\n return nil\n else\n fetch_more\n end\n end\n\n @row_buffer.shift\n end",
"def fetch_rows(sql)\n execute(sql) do |r|\n i = -1\n cps = db.conversion_procs\n cols = r.fetch_f... | [
"0.69687647",
"0.6736022",
"0.6685678",
"0.6615976",
"0.66062164",
"0.65593773",
"0.6465518",
"0.64551115",
"0.64189",
"0.6413859",
"0.64097327",
"0.6382233",
"0.6344621",
"0.6311108",
"0.62327427",
"0.62223107",
"0.62095535",
"0.6195531",
"0.61926556",
"0.61894345",
"0.61752... | 0.64374137 | 8 |
Cleanup: droping temporary tables (DATA LOSS!) | def cleanup!
check_if_finished
raise "#{self.class}: instance not prepared before doing any move" unless @prepared
raise "#{self.class}: not all data was iterated over" unless @finished
case @strategy
when 'incremental'
# notinh we need to do
when 'rotate'
postgres.execute(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def teardown\n cleanup_tables\n cleanup_caches\n end",
"def cleanup!; end",
"def cleanup!; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup\n end",
"... | [
"0.7184937",
"0.7164797",
"0.7164797",
"0.71161836",
"0.71161836",
"0.71161836",
"0.71161836",
"0.6999556",
"0.6999556",
"0.6999556",
"0.6999556",
"0.6933532",
"0.69197285",
"0.69197285",
"0.69197285",
"0.6835769",
"0.67852104",
"0.67852104",
"0.6779964",
"0.67392737",
"0.673... | 0.7047723 | 7 |
Keeps a connection to PG | def postgres
@postgres ||= Connections::Postgres.new(options: @postgres_options)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def postgres_keep_alive\n stat = @connection.status()\n rescue PGError => e\n @logger.info(\"Postgresql connection lost: #{e}\")\n @connection = postgres_connect\n if (stat = PGconn.CONNECTION_BAD) then\n @logger.info(\"Postgresql connection lost. Reconnect.\")\n @connection = postgres_connect\n ... | [
"0.750478",
"0.7045201",
"0.69846004",
"0.6841422",
"0.6840919",
"0.6794665",
"0.67799383",
"0.67024565",
"0.67013884",
"0.6672115",
"0.66553205",
"0.6624869",
"0.6608488",
"0.6608488",
"0.6608488",
"0.6608488",
"0.6608488",
"0.6608488",
"0.6608488",
"0.6584261",
"0.65830624"... | 0.6595961 | 19 |
Examples: got_three? [1, 2, 2, 2, 3] => true got_three? ['a', 'a', 'b'] => false got_three? ['a', 'a', 'a'] => true got_three? [1, 2, 1, 1] => false | def got_three?(array_list)
a=nil
for i in array_list
if array_list.join.include?("#{i.to_s*3}")
a=true
break
else
a=false
end
end
a
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def got_three?(array)\n\tarray.each_with_index do |item, i|\n\t\tnext_item = array[i+1]\n\t\tnext_next_item = array[i+2]\n\t\treturn true if item == next_item && item == next_next_item\n\tend\n\tfalse\nend",
"def got_three?(array)\n\tarray.each_cons 3 do |x, y, z|\n\t\treturn true if x == y && y == z\n\tend\n\tr... | [
"0.7673041",
"0.7554113",
"0.74403715",
"0.74335974",
"0.7359609",
"0.73331326",
"0.73071384",
"0.7296551",
"0.7251156",
"0.70662725",
"0.70601976",
"0.7051146",
"0.7031135",
"0.70277977",
"0.7020516",
"0.7002054",
"0.690794",
"0.6896588",
"0.6866014",
"0.68637806",
"0.683612... | 0.74215096 | 4 |
initialize should require an email and a password. use self.class.post to retrieve the auth_token. | def initialize(email, password)
# This gets the response object. We only want the auth_token from it. So we will have to
# query the response for it.
response = self.class.post("https://www.bloc.io/api/v1/sessions", body: { email: email, password: password })
# query the response object for the auth_t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(email, password)\n @email = email\n @password = password\n\n @auth_token = get_auth_token(@email, @password)\n end",
"def initialize(email, password)\n response = self.class.post(api_url(\"sessions\"), body: { email: email, password: password })\n @auth_token = resp... | [
"0.84268403",
"0.81346405",
"0.8065167",
"0.80543715",
"0.78756857",
"0.7827061",
"0.7806677",
"0.7806677",
"0.7806677",
"0.7806677",
"0.7806677",
"0.77804625",
"0.77804625",
"0.7753711",
"0.7534102",
"0.7510724",
"0.74762857",
"0.74302185",
"0.7267261",
"0.72146666",
"0.7123... | 0.75422764 | 14 |
GET /posts GET /posts.json | def index
@posts = Post.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def index\n @posts = Post.all\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n @posts = Post.all\n\n render json: @posts\n end",
"def index\n ... | [
"0.7866291",
"0.74953306",
"0.7494917",
"0.7494917",
"0.7489136",
"0.7431804",
"0.7286642",
"0.7286642",
"0.7286642",
"0.725636",
"0.7252535",
"0.7247708",
"0.7246376",
"0.72223",
"0.7204546",
"0.7204476",
"0.7170577",
"0.7169457",
"0.71660894",
"0.7123361",
"0.711584",
"0.... | 0.0 | -1 |
after_create :create_log_data after_update :update_log_data | def create_log_data
UpdateLog.create(over_tag_id: self.id, table_name: "over_tag", log_type: "create")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def touch_when_logging\n self.log_updated_at = Time.zone.now\n save\n end",
"def after_update(record)\n contents = to_sql_update(record)\n to_logfile(contents)\n end",
"def after_create(record)\n create_event_log(record, 'created')\n end",
"def after_update_save(record); end",
"def after_... | [
"0.7185067",
"0.7134646",
"0.6983778",
"0.6975429",
"0.6889452",
"0.68234056",
"0.68113583",
"0.67667896",
"0.6702481",
"0.6702481",
"0.6701684",
"0.6701684",
"0.666639",
"0.66335464",
"0.6468256",
"0.64418435",
"0.642006",
"0.641327",
"0.63818485",
"0.63642967",
"0.6350366",... | 0.70031166 | 2 |
Use callbacks to share common setup or constraints between actions. | def set_category
@category = Category.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 |
Only allow a list of trusted parameters through. | def category_params
params.require(:category).permit(:name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def param_whitelist\n [:role, :title]\... | [
"0.69497335",
"0.6812623",
"0.6803639",
"0.6795365",
"0.67448795",
"0.67399913",
"0.6526815",
"0.6518771",
"0.64931697",
"0.6430388",
"0.6430388",
"0.6430388",
"0.63983387",
"0.6356042",
"0.63535863",
"0.63464934",
"0.63444513",
"0.6337208",
"0.6326454",
"0.6326454",
"0.63264... | 0.0 | -1 |
Must be protected as an ability can merge with other abilities. This means that an ability must expose their rules with another ability. | def rules
@rules ||= []
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowable\n return @allowable if @allowable\n\n @allowable = parent_allowables\n end",
"def ability\n @ability ||= Ability.new(self)\n end",
"def ability\n @ability ||= Ability.new(self)\n end",
"def ability\n @ability ||= Ability.new(self)\n end",
"def ability\n @abil... | [
"0.6693449",
"0.6551121",
"0.6551121",
"0.6551121",
"0.6551121",
"0.6551121",
"0.64769036",
"0.6423278",
"0.6349941",
"0.6253847",
"0.6234829",
"0.62295425",
"0.6212816",
"0.6187886",
"0.6149685",
"0.61462826",
"0.6107317",
"0.6087824",
"0.6084883",
"0.60422736",
"0.603778",
... | 0.0 | -1 |
Returns an array of Rule instances which match the action and subject This does not take into consideration any hash conditions or block statements | def relevant_rules(action, subject)
return [] unless @rules
relevant = possible_relevant_rules(subject).select do |rule|
rule.expanded_actions = expand_actions(rule.actions)
rule.relevant? action, subject
end
relevant.reverse!.uniq!
optimize_order! relevant
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def relevant_rules(action, subject)\n rules.reverse.select do |rule|\n rule.expanded_actions = expand_actions(rule.actions)\n rule.relevant? action, subject\n end\n end",
"def to_list\n rules.map do |rule|\n object = { actions: rule.actions, subject: rule.subjects.map{ |s| s.is... | [
"0.7262366",
"0.66475624",
"0.60147196",
"0.60147196",
"0.5979285",
"0.59765446",
"0.5924119",
"0.58521086",
"0.578935",
"0.5747649",
"0.5709011",
"0.5707644",
"0.5707565",
"0.56593597",
"0.5655084",
"0.56531286",
"0.56514645",
"0.5627588",
"0.56142384",
"0.56142384",
"0.5614... | 0.73462313 | 0 |
Optimizes the order of the rules, so that rules with the :all subject are evaluated first. | def optimize_order!(rules)
first_can_in_group = -1
rules.each_with_index do |rule, i|
(first_can_in_group = -1) && next unless rule.base_behavior
(first_can_in_group = i) && next if first_can_in_group == -1
next unless rule.subjects == [:all]
rules[i] = rules[fir... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort_if_needed\n @rules.sort! unless @sorted\n @sorted = true\n end",
"def process_rules(state)\n raise(\"No rules have been loaded into engine %s\" % self) if empty?\n\n rules_by_priority do |rule|\n state.mutable = !rule.concurrent?\n result = rule.process_state(s... | [
"0.67247164",
"0.6462294",
"0.6439764",
"0.62293166",
"0.6059909",
"0.60592234",
"0.5938815",
"0.5938815",
"0.5815799",
"0.5551172",
"0.5507124",
"0.5482669",
"0.5444616",
"0.5443429",
"0.544107",
"0.5373807",
"0.5367316",
"0.53113294",
"0.5306146",
"0.53051794",
"0.53023803"... | 0.80064714 | 0 |
Carmichael = (6k+1)(12k+1)(18k+1) puts Carmichael puts 71319 def largest_prime_factor(n) sqrt = n(1/2)+1 current = sqrt while sqrt.reverse puts largest_prime_factor(13195) | def greatest_prime_factor(n)
return false if n < 1
divisor = Math.sqrt(n).floor
while divisor>=2
return divisor if prime?(divisor) && n%divisor==0
divisor-=1
end
return false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def largest_prime_factor(n)\n recursive_prime_factors(n)\n PRIMES.keys.sort().last\nend",
"def largest_prime_factor(n)\n i = 2\n largest = 0\n while i <= n\n if n % i == 0\n while n % i == 0\n n = n / i\n largest = i\n i += 1\n end\n end\n i += 1\n end\n return larg... | [
"0.808824",
"0.7818227",
"0.7804629",
"0.78011316",
"0.77684784",
"0.77548754",
"0.77469814",
"0.77350765",
"0.7698105",
"0.7693048",
"0.7679569",
"0.7679569",
"0.7648712",
"0.76377934",
"0.76121885",
"0.7605036",
"0.7604255",
"0.7598473",
"0.759408",
"0.7594053",
"0.75851274... | 0.7457346 | 31 |
GET /posts/1 GET /posts/1.json | def show
@post = Post.find(params[:id])
@comments = Comment.where(:post_id => params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @posts = Post.find(params[:id])\n render json: @posts\n end",
"def show\n render json: Post.find(params[\"id\"])\n end",
"def show\r\n post = Post.find(params[:id])\r\n render json: post\r\n end",
"def show\n @post = Post.find(params[:id])\n\n render json: @post\n end",
... | [
"0.7711948",
"0.7354794",
"0.7344257",
"0.7338857",
"0.7324135",
"0.72940344",
"0.7277004",
"0.7257037",
"0.7162784",
"0.71600854",
"0.71564883",
"0.71564883",
"0.7120693",
"0.7095693",
"0.7095693",
"0.7095693",
"0.70951295",
"0.70724344",
"0.7061728",
"0.704619",
"0.70333374... | 0.0 | -1 |
POST /posts POST /posts.json | def create
@post = Post.create(post_params)
redirect_to post_path(@post)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n render json: Post.create(params[\"post\"])\n end",
"def create\n respond_with Post.create(params[:posts])\n end",
"def create\n @post = Post.create(post_params)\n render json: @post, serializer: PostSerializer\n end",
"def create\n @post = Post.new(post_params)\n @po... | [
"0.74463975",
"0.73221767",
"0.73072433",
"0.7123966",
"0.7015686",
"0.701327",
"0.69841874",
"0.6939327",
"0.69313824",
"0.69053805",
"0.68196476",
"0.6812792",
"0.6793222",
"0.6792862",
"0.6779654",
"0.6779654",
"0.67625546",
"0.67602354",
"0.67515427",
"0.6735786",
"0.6698... | 0.0 | -1 |
PATCH/PUT /posts/1 PATCH/PUT /posts/1.json | def update
@post = Post.find(params[:id])
@post.update(post_params)
redirect_to post_path(@post)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end",
"def update\n respond_with Post.update(params[:id], params[:posts])\n end",
"def update\n @post = Post.find(params[:id])\n respond_to do |format|\n if @post.update_attributes(params[:post])\n forma... | [
"0.71863747",
"0.7041976",
"0.67735577",
"0.67668164",
"0.6669752",
"0.6648918",
"0.65785664",
"0.65562683",
"0.65507084",
"0.6548935",
"0.6534891",
"0.65306884",
"0.649767",
"0.6496564",
"0.64679456",
"0.64313143",
"0.6428435",
"0.64265287",
"0.64264816",
"0.641942",
"0.6418... | 0.0 | -1 |
DELETE /posts/1 DELETE /posts/1.json | def destroy
@post.destroy
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete\n render json: Post.delete(params[\"id\"])\n end",
"def destroy\n @post.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n post = Post.find(params[:id])\n if post.destroy\n render json: {status: \"success\", data: {id: param... | [
"0.8046884",
"0.76902676",
"0.7583626",
"0.75803024",
"0.7568048",
"0.75047046",
"0.75031126",
"0.74750155",
"0.74671036",
"0.74650854",
"0.746482",
"0.74589694",
"0.74589694",
"0.74589694",
"0.74589694",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"0.74579465",
"... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. Never trust parameters from the scary internet, only allow the white list through. | def post_params
params.require(:post).permit(:author, :img_url, :title, :content)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action_hook; end",
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def before_action \n end",
"def before_setup; end",
"def my_action_params\n params.require(:my_action).permit(:name, :url, :active, :provider_id)\n end",
"def define_a... | [
"0.6086675",
"0.60794854",
"0.60090303",
"0.5876293",
"0.5795839",
"0.5751235",
"0.5595783",
"0.5511657",
"0.5511657",
"0.5511657",
"0.5405994",
"0.5398218",
"0.538365",
"0.536369",
"0.5348965",
"0.5346867",
"0.5343193",
"0.53384614",
"0.5331758",
"0.5317586",
"0.53052807",
... | 0.0 | -1 |
Returns the string representation of RDS::DBInstance | def to_s
"RDS DBInstance: #{@dbi_name}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n \"#{name}\\t#{dns_name}\\t#{instance_id}\"\n end",
"def db_instance_arn\n data[:db_instance_arn]\n end",
"def getRdsInfo(dbInstId)\n #puts \"Getting RDS info for #{dbInstId}\"\n info = Hash.new\n begin\n raise if dbInstId.nil?\n resp = @rds.describe_db_instances(db... | [
"0.64652514",
"0.6165774",
"0.60356975",
"0.5841876",
"0.5803104",
"0.5774733",
"0.5719816",
"0.5688201",
"0.5539529",
"0.55176395",
"0.5506175",
"0.54668075",
"0.5425348",
"0.5421832",
"0.54107475",
"0.53999627",
"0.53824687",
"0.53679186",
"0.536135",
"0.53570384",
"0.53535... | 0.8381365 | 1 |
Indicates whether instance status is available | def available?
@dbi.db_instance_status == 'available'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def available?\n status == :available\n end",
"def is_available?\n return @status == :AVAILABLE\n end",
"def ec2_instance_ready?(instance)\n instance.exists? && instance.status.eql?(:running) && systems_ok(instance)\n end",
"def ready?\n status == \"RUNNING\"\n end",
"de... | [
"0.7753748",
"0.7606751",
"0.7568976",
"0.75664294",
"0.7390626",
"0.7302371",
"0.72182614",
"0.7216173",
"0.720086",
"0.7065461",
"0.7059471",
"0.70066285",
"0.70061225",
"0.6970412",
"0.69360214",
"0.69172823",
"0.69150746",
"0.69126666",
"0.69126666",
"0.69121146",
"0.6906... | 0.74347544 | 5 |
Specifies if the DB instance is a MultiAZ deployment | def multi_az?
@dbi.multi_az
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_tenancy?\n @vpc.instance_tenancy == 'default'\n end",
"def production?\n if DeployGroup.enabled?\n deploy_groups.empty? ? super : environments.any?(&:production?)\n else\n super\n end\n end",
"def single_connection?\n staging_connection_name == productio... | [
"0.640829",
"0.5846891",
"0.57567143",
"0.57459307",
"0.5719757",
"0.56798315",
"0.56296366",
"0.56296366",
"0.56293285",
"0.55659",
"0.5563271",
"0.5535606",
"0.5514622",
"0.551401",
"0.5503097",
"0.5503097",
"0.55017513",
"0.54923546",
"0.54799074",
"0.54341507",
"0.5419539... | 0.63983834 | 2 |
Indicates that minor version patches are applied automatically | def auto_minor_version_upgradeable?
@dbi.auto_minor_version_upgrade
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def bump_minor_version; end",
"def bump_patch_version; end",
"def auto_minor_version_upgrade\n data[:auto_minor_version_upgrade]\n end",
"def auto_minor_version_upgrade\n data[:auto_minor_version_upgrade]\n end",
"def minor_version_one!\n self.minor_version = 1\n end",
"def bump... | [
"0.76745623",
"0.73888046",
"0.73717",
"0.73717",
"0.7332229",
"0.73274744",
"0.72954535",
"0.725842",
"0.72090894",
"0.71762425",
"0.71575826",
"0.7075753",
"0.7051977",
"0.69693434",
"0.69693434",
"0.69693434",
"0.696102",
"0.69259244",
"0.68750113",
"0.68507767",
"0.684625... | 0.6647338 | 32 |
Specifies the accessibility options for the DB instance. A value of true specifies an Internetfacing instance with a publicly resolvable DNS name, which resolves to a public IP address. A value of false specifies an internal instance with a DNS name that resolves to a private IP address | def publicly_accessible?
@dbi.publicly_accessible
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dhcp\n @attributes.fetch('dhcp', false)\n end",
"def network_options(type, ip, dhcp_enable)\n options = {}\n options[:ip] = ip\n options[:type] = type\n options[:libvirt__dhcp_enabled] = dhcp_enable\n\n options\nend",
"def private_dns_name_options\n data[:private_dns_nam... | [
"0.5798521",
"0.5698778",
"0.5448285",
"0.5270813",
"0.5247478",
"0.5163093",
"0.51592165",
"0.5139157",
"0.5130208",
"0.5088497",
"0.5044388",
"0.50384474",
"0.5034407",
"0.5020769",
"0.49749532",
"0.49742824",
"0.49678364",
"0.4962755",
"0.4946406",
"0.49460414",
"0.4933455... | 0.50279087 | 14 |
Specifies whether the DB instance is encrypted | def with_encrypted_storage?
@dbi.storage_encrypted
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encrypted?\n @encrypted ||= false\n end",
"def is_encrypted=(value)\n @is_encrypted = value\n end",
"def encrypted?\r\n if @encrypted\r\n return true\r\n else\r\n return false\r\n end\r\n end",
"def encryption_required?\n supe... | [
"0.7441773",
"0.7180296",
"0.71359736",
"0.7071319",
"0.7017596",
"0.69411933",
"0.68211263",
"0.68211263",
"0.6736516",
"0.67195946",
"0.6663765",
"0.6471857",
"0.6376362",
"0.6347589",
"0.6315973",
"0.63102186",
"0.6248358",
"0.6248358",
"0.614884",
"0.6137296",
"0.61265594... | 0.72538257 | 2 |
Contains the name of the compute and memory capacity class of the DB instance | def instance_class
@dbi.db_instance_class
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instance_type_capacity(name)\n return 0, 0 if @instance_types[name].nil?\n return @instance_types[name]['cpu'].to_i * 100 ,\n @instance_types[name]['memory'].to_i * 1024\n end",
"def instance_type_capacity(name)\n return 0, 0 if @instance_types[name].nil?\n return... | [
"0.73613983",
"0.72244704",
"0.67956024",
"0.6717499",
"0.6502569",
"0.6443381",
"0.6327703",
"0.6327703",
"0.6308723",
"0.6307747",
"0.62971944",
"0.62971944",
"0.6291618",
"0.6285998",
"0.6211018",
"0.6195862",
"0.6195862",
"0.6188202",
"0.6182735",
"0.61812377",
"0.6146058... | 0.60563666 | 24 |
Provides the name of the database engine to be used for this DB instance | def engine
@dbi.engine
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def engine_name\n @engine_name\n end",
"def engine_name\n data.engine_name\n end",
"def resolve_engine(name)\n if name && !name.empty? && !name.include?('.')\n ENGINE_ALIASES[name] || \"django.db.backends.#{name}\"\n else\n name\n end\n end",
... | [
"0.756863",
"0.7279875",
"0.7181926",
"0.71771735",
"0.7120462",
"0.70626557",
"0.7026705",
"0.6970552",
"0.686884",
"0.68606484",
"0.68504095",
"0.6830719",
"0.6814284",
"0.6814284",
"0.68126553",
"0.67438877",
"0.67307854",
"0.67198443",
"0.6648131",
"0.6648131",
"0.6640155... | 0.72730106 | 3 |
Contains the master username for the DB instance | def master_username
@dbi.master_username
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def master_username\n data[:master_username]\n end",
"def master_username\n data[:master_username]\n end",
"def master_hostname\n @master_hostname ||= (user_configuration_from_key('master_solr', 'hostname') || hostname)\n end",
"def username\n ENV['USER']\n end",
"def userna... | [
"0.8530593",
"0.8530593",
"0.74540865",
"0.71231633",
"0.69902104",
"0.6980851",
"0.6881276",
"0.68244004",
"0.6823002",
"0.6808487",
"0.68033487",
"0.67715335",
"0.6771192",
"0.6728062",
"0.66970456",
"0.66636807",
"0.66622835",
"0.66605145",
"0.661203",
"0.65951246",
"0.659... | 0.89923584 | 1 |
The meaning of this parameter differs according to the database engine you use | def database_name
@dbi.db_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sql_modes; end",
"def target_sql_mode=(_arg0); end",
"def target_sql_mode; end",
"def sql_state; end",
"def max_sql_param_length; end",
"def max_sql_param_length=(_arg0); end",
"def sql_string\n self\n end",
"def sql_type\n self['sql_type']\n end",
"def real_column; end",
"... | [
"0.69731843",
"0.6893297",
"0.6694939",
"0.64821404",
"0.64085907",
"0.62521094",
"0.6249999",
"0.62153983",
"0.618791",
"0.6153899",
"0.60708684",
"0.60071766",
"0.60071766",
"0.59932435",
"0.5989733",
"0.5945041",
"0.59368724",
"0.5928566",
"0.59058636",
"0.59003204",
"0.58... | 0.0 | -1 |
Specifies the connection endpoint DNS address of the DB instance | def endpoint
@dbi.endpoint.address
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def address\n @address ||= \"#{@options[:host]}:#{@options[:port]}\"\n end",
"def calculate_dbhost\n owncloud_cookbook_config['dbhost'] =\n [\n owncloud_cookbook_config['dbhost'], owncloud_cookbook_config['dbport']\n ].join(':')\n end",
"def drb_host\n instance.opt... | [
"0.68183225",
"0.66390806",
"0.65434444",
"0.65434444",
"0.6511978",
"0.62276405",
"0.61475635",
"0.6107081",
"0.6103895",
"0.60637325",
"0.6054633",
"0.5933876",
"0.5887587",
"0.5774257",
"0.5707157",
"0.5699417",
"0.5694703",
"0.5669667",
"0.5669667",
"0.56527424",
"0.56463... | 0.6893148 | 1 |
Specifies the port that the database engine is listening on | def listening_port
@dbi.endpoint.port
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_port port\n @port = port\n end",
"def port\n @port || 5439\n end",
"def port\n @port || 5432\n end",
"def port(port)\n @options[:port] = port\n end",
"def port=(port)\n set_default :port, port\n end",
"def port(p)\n @config[:port] = p\n end",
... | [
"0.7448076",
"0.7341815",
"0.73399466",
"0.73138",
"0.727713",
"0.7210475",
"0.719875",
"0.7035092",
"0.7007691",
"0.7007691",
"0.69895464",
"0.6932902",
"0.69274133",
"0.6912302",
"0.6908065",
"0.6908065",
"0.68929154",
"0.68762976",
"0.68525445",
"0.68525445",
"0.68406796",... | 0.7775109 | 1 |
Specifies the allocated storage size specified in gigabytes | def allocated_storage
@dbi.allocated_storage
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def storage_pool_size\n @storage_pool_size ||= 20\n end",
"def storage_pool_size\n @storage_pool_size ||= 20\n end",
"def max_size_bytes=(value)\n @children['max-size-bytes'][:value] = value\n end",
"def set_4Gb(vm_name, vm_config)\n require_string(vm_name)\n req... | [
"0.6705284",
"0.6705284",
"0.6660518",
"0.6619973",
"0.6599322",
"0.65936303",
"0.65402555",
"0.65400004",
"0.65400004",
"0.6477492",
"0.6453116",
"0.64477307",
"0.64477307",
"0.64477307",
"0.64477307",
"0.64477307",
"0.64477307",
"0.64477307",
"0.64477307",
"0.64477307",
"0.... | 0.0 | -1 |
Specifies the daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod | def preferred_backup_window
@dbi.preferred_backup_window
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def backup_retention_period\n @dbi.backup_retention_period\n end",
"def backup_retention_period\n @dbi.backup_retention_period\n end",
"def backup_retention_period\n data[:backup_retention_period]\n end",
"def backup_retention_period\n data[:backup_retenti... | [
"0.61350775",
"0.61350775",
"0.595765",
"0.595765",
"0.59285986",
"0.5609425",
"0.5600707",
"0.55011046",
"0.5422675",
"0.5375749",
"0.53505737",
"0.53377926",
"0.53262144",
"0.5315383",
"0.52675974",
"0.52675974",
"0.5247157",
"0.52404356",
"0.52246994",
"0.5219956",
"0.5147... | 0.0 | -1 |
Specifies the number of days for which automatic DB snapshots are retained | def backup_retention_period
@dbi.backup_retention_period
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retention_days\n @retention_days.nil? ? 0 : @retention_days.to_i\n end",
"def deleted_user_personal_site_retention_period_in_days=(value)\n @deleted_user_personal_site_retention_period_in_days = value\n end",
"def backups_to_keep\n @backups_to_keep ||= 2\n end",
... | [
"0.617513",
"0.60362715",
"0.5933784",
"0.59077764",
"0.58618027",
"0.58618027",
"0.5737718",
"0.56869847",
"0.5685596",
"0.5685427",
"0.5685427",
"0.5685427",
"0.5685427",
"0.56842583",
"0.56572556",
"0.56058383",
"0.5584267",
"0.5538059",
"0.54675555",
"0.5452521",
"0.54452... | 0.6320599 | 1 |
Provides List of active DB security group names | def security_groups
sgs = []
@dbi.db_security_groups.each do |sg|
sgs << sg.db_security_group_name if sg.status == 'active'
end
sgs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def db_security_groups\n data[:db_security_groups]\n end",
"def list_seg\n raise \"no openstack instance\" if @openstack.nil?\n response = @openstack.list_security_groups\n keys = parse_hash_response(response.body, 'security_groups')\n keys.map { |k| k.fetch('name') }\n e... | [
"0.811968",
"0.7755311",
"0.7685111",
"0.7595971",
"0.7376065",
"0.7376065",
"0.7318436",
"0.7135941",
"0.7115335",
"0.7086815",
"0.69818246",
"0.6976353",
"0.6976353",
"0.6967344",
"0.68843055",
"0.686761",
"0.6839145",
"0.6793234",
"0.67800206",
"0.6681787",
"0.6636952",
... | 0.873882 | 1 |
Provides List of VPC security group elements that the DB instance belongs to | def vpc_security_groups
vsgs = []
@dbi.vpc_security_groups.each do |vsg|
vsgs << vsg.vpc_security_group_id if vsg.status == 'active'
end
vsgs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def vpc_security_groups\n data[:vpc_security_groups]\n end",
"def vpc_security_groups\n data[:vpc_security_groups]\n end",
"def security_groups\n sgs = []\n @dbi.db_security_groups.each do |sg|\n sgs << sg.db_security_group_name if sg.status == 'active'\n ... | [
"0.8138303",
"0.8138303",
"0.7704705",
"0.7704705",
"0.76848036",
"0.7674543",
"0.7464791",
"0.73386395",
"0.72618854",
"0.7248682",
"0.72337836",
"0.7150392",
"0.6961474",
"0.6938204",
"0.6806283",
"0.67424744",
"0.6652792",
"0.6627193",
"0.66237694",
"0.6581553",
"0.653376"... | 0.8240463 | 1 |
Provides the list of DB parameter groups applied to this DB instance | def parameter_groups
@dbi.db_parameter_groups
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def db_parameter_groups\n data[:db_parameter_groups]\n end",
"def describe_db_parameter_groups( options = {} )\n params = {}\n params['DBParameterGroupName'] = options[:db_parameter_group_name] if options.has?(:db_parameter_group_name)\n params['MaxRecords'] = options[:max_records].t... | [
"0.8878133",
"0.77891576",
"0.7133539",
"0.6817301",
"0.6595599",
"0.6435619",
"0.6219231",
"0.6219231",
"0.60725194",
"0.60598415",
"0.59505093",
"0.58842105",
"0.5879552",
"0.58327776",
"0.5811442",
"0.5776254",
"0.5775549",
"0.57645375",
"0.57577336",
"0.5730341",
"0.57173... | 0.87981856 | 2 |
Specifies the name of the Availability Zone the DB instance is located in | def availability_zone
@dbi.availability_zone
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_availability_zone\n logger.debug { \"#{self.class}##{__method__}\" }\n return unless self.zone.blank? && self.project.master_slave_mode?\n ec2.availability_zones.each do |z|\n if z.state == :available\n self.zone = z.name\n break\n end\n end\n end",
"def availability_... | [
"0.64770174",
"0.64486456",
"0.63847065",
"0.62270755",
"0.6189398",
"0.6189398",
"0.61402524",
"0.60166615",
"0.5940373",
"0.58120865",
"0.5801081",
"0.57855207",
"0.57019454",
"0.5685954",
"0.56673163",
"0.5583855",
"0.5583855",
"0.5566768",
"0.5566768",
"0.5496541",
"0.548... | 0.6817666 | 1 |
Specifies information on the subnet group associated with the DB instance, including the name, description, and subnets in the subnet group | def subnet_group
@dbi.db_subnet_group
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def db_subnet_group\n data[:db_subnet_group]\n end",
"def db_subnet_group\n data[:db_subnet_group]\n end",
"def db_subnet_group_description\n data.db_subnet_group_description\n end",
"def db_subnet_group_arn\n data.db_subnet_group_arn\n end",
"def describe_db_subnet_groups(n... | [
"0.7927069",
"0.7927069",
"0.761012",
"0.6974376",
"0.692557",
"0.6555684",
"0.6319959",
"0.5897684",
"0.579561",
"0.5703416",
"0.56842744",
"0.56608415",
"0.56372654",
"0.5630519",
"0.5615166",
"0.5516235",
"0.5492615",
"0.5478228",
"0.5474197",
"0.5465686",
"0.5448036",
"... | 0.7910427 | 3 |
Specifies the weekly time range (in UTC) during which system maintenance can occur | def preferred_maintenance_window
@dbi.preferred_maintenance_window
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hours_per_week= (hours_per_week)\n # fill in later\n end",
"def set_week\n self.week = time_out.nil? ? time_in.beginning_of_week : time_out.beginning_of_week\n end",
"def quality_driven_software_export\n @from = Time.zone.now - 1.week\n @to = Time.zone.now\n end",
"def set_admin_week... | [
"0.62958485",
"0.62469184",
"0.624456",
"0.621232",
"0.61619204",
"0.61619204",
"0.6155768",
"0.6135718",
"0.60554117",
"0.6038615",
"0.60216576",
"0.6018196",
"0.6018196",
"0.60169816",
"0.60165554",
"0.5901586",
"0.58553046",
"0.5824128",
"0.58183724",
"0.5799966",
"0.57986... | 0.0 | -1 |
Specifies that changes to the DB instance are pending. This element is only included when changes are pending. Specific changes are identified by subelements | def pending_modified_values
@dbi.pending_modified_values
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pending!\n self.update_attribute(:status, PENDING)\n end",
"def changes_pending!\n self.lifecycle.changes_pending! nil\n end",
"def only_update_status_from_pending\n\t if changed.length > 1\n\t\t errors[:base] << 'You cannot modify this invitation.'\n\t\t return\n\t\t end\n\t\t\told_statu... | [
"0.68876904",
"0.6712034",
"0.6706089",
"0.66546917",
"0.66536856",
"0.66488516",
"0.65548855",
"0.6433065",
"0.63678753",
"0.6347074",
"0.6314702",
"0.62856025",
"0.62836254",
"0.62385464",
"0.62114495",
"0.6160612",
"0.6157481",
"0.6139432",
"0.6122765",
"0.611906",
"0.6092... | 0.6274899 | 14 |
Indicates the database engine version | def engine_version
@dbi.engine_version
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def engine_version\n data[:engine_version]\n end",
"def engine_version\n data[:engine_version]\n end",
"def database_version\n raise NoMethodError, \"Not implemented for this raw driver\"\n end",
"def engine_version\n stats.version\n end",
"def engine_version\n ... | [
"0.7939718",
"0.7939718",
"0.7852824",
"0.779242",
"0.76865584",
"0.7634057",
"0.7612168",
"0.7465544",
"0.7361395",
"0.73237795",
"0.71444446",
"0.695502",
"0.6954467",
"0.6896467",
"0.6780956",
"0.6741077",
"0.66943467",
"0.66466963",
"0.6635538",
"0.6635183",
"0.66331315",... | 0.8787202 | 1 |
Contains the identifier of the source DB instance if this DB instance is a Read Replica | def read_replica_source_db_instance_identifier
@dbi.read_replica_source_db_instance_identifier
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_replica_source_db_instance_identifier\n data[:read_replica_source_db_instance_identifier]\n end",
"def read_replica_source_db_cluster_identifier\n data[:read_replica_source_db_cluster_identifier]\n end",
"def replication_source_identifier\n data[:replication_source_identifier]\n ... | [
"0.8335936",
"0.75309795",
"0.72606343",
"0.69879127",
"0.69233286",
"0.69233286",
"0.6476275",
"0.62707794",
"0.62045383",
"0.60403055",
"0.59753716",
"0.5802901",
"0.5802901",
"0.5802901",
"0.5802901",
"0.5796845",
"0.57767045",
"0.57767045",
"0.574033",
"0.5739486",
"0.571... | 0.8389478 | 1 |
Contains one or more identifiers of the Read Replicas associated with this DB instance | def read_replica_db_instance_identifiers
@dbi.read_replica_db_instance_identifiers
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_replica_identifiers\n data[:read_replica_identifiers]\n end",
"def read_replica_db_instance_identifiers\n data[:read_replica_db_instance_identifiers]\n end",
"def read_replica_db_cluster_identifiers\n data[:read_replica_db_cluster_identifiers]\n end",
"def get_all_replicas(id... | [
"0.763854",
"0.71754885",
"0.6785033",
"0.6261454",
"0.591085",
"0.56516105",
"0.5421764",
"0.5391",
"0.53211266",
"0.53211266",
"0.5317139",
"0.52779865",
"0.52276087",
"0.5162364",
"0.5157564",
"0.5145451",
"0.51344746",
"0.5093626",
"0.5090406",
"0.508701",
"0.5055961",
... | 0.69928956 | 3 |
License model information for this DB instance | def license_model
@dbi.license_model
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def license_model\n data[:license_model]\n end",
"def license_info\n self.dig_for_array(\"licenseInfo\")\n end",
"def license\n read_property 'License'\n end",
"def licenses\n data[:licenses]\n end",
"def license\n return @license\n end",
"def get_lic... | [
"0.7865541",
"0.69360286",
"0.6615663",
"0.64668185",
"0.6395654",
"0.6323196",
"0.6289028",
"0.62813294",
"0.62204766",
"0.6132543",
"0.61201143",
"0.60442144",
"0.60346335",
"0.60342383",
"0.58699816",
"0.58699816",
"0.58699816",
"0.58665586",
"0.5846428",
"0.58319354",
"0.... | 0.8250544 | 1 |
Specifies the Provisioned IOPS (I/O operations per second) value | def iops
@dbi.iops
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cpus(arg=nil)\n set_or_return(:cpus, arg, :kind_of => Integer)\n end",
"def intune_device_count=(value)\n @intune_device_count = value\n end",
"def storage_throughput\n data[:storage_throughput]\n end",
"def ncpus\n case os\n when 'darwin'... | [
"0.5902665",
"0.58256745",
"0.574725",
"0.5677615",
"0.56742513",
"0.5668739",
"0.5624238",
"0.5621174",
"0.558263",
"0.558263",
"0.5513049",
"0.55025184",
"0.55025184",
"0.548509",
"0.54435426",
"0.5437352",
"0.5437352",
"0.5437329",
"0.53920335",
"0.53920335",
"0.5381908",
... | 0.0 | -1 |
Provides the list of option group memberships for this DB instance | def option_group_memberships
@dbi.option_group_memberships
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def option_group_memberships\n data[:option_group_memberships]\n end",
"def db_cluster_option_group_memberships\n data[:db_cluster_option_group_memberships]\n end",
"def group_members\n members(\"Group\")\n end",
"def groups\n\t\t\t@groups ||= Group.find(:all, :distinguishedname => @e... | [
"0.8379176",
"0.794359",
"0.68431664",
"0.65154433",
"0.6445181",
"0.64417315",
"0.638162",
"0.63500595",
"0.6337412",
"0.63085437",
"0.6301916",
"0.62959707",
"0.62946403",
"0.62826717",
"0.62652266",
"0.6246785",
"0.6242242",
"0.6237269",
"0.6229751",
"0.6219734",
"0.620595... | 0.8670995 | 1 |
If present, specifies the name of the character set that this instance is associated with | def character_set_name
@dbi.character_set_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def character_set_name\n data[:character_set_name]\n end",
"def character_set_name\n data[:character_set_name]\n end",
"def character_set_name\n @charset.name\n end",
"def nchar_character_set_name\n data[:nchar_character_set_name]\n end",
"def character_set\n @character... | [
"0.80928975",
"0.80928975",
"0.78661776",
"0.7410174",
"0.70188993",
"0.6699219",
"0.64698786",
"0.6375436",
"0.60716975",
"0.6044846",
"0.6042314",
"0.5982587",
"0.5962324",
"0.5945983",
"0.58496535",
"0.57978976",
"0.57978976",
"0.57978976",
"0.5793608",
"0.57911265",
"0.57... | 0.74241203 | 4 |
If present, specifies the name of the secondary Availability Zone for a DB instance with multiAZ support | def secondary_availability_zone
@dbi.secondary_availability_zone
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def secondary_availability_zone\n data[:secondary_availability_zone]\n end",
"def set_availability_zone\n logger.debug { \"#{self.class}##{__method__}\" }\n return unless self.zone.blank? && self.project.master_slave_mode?\n ec2.availability_zones.each do |z|\n if z.state == :available\n ... | [
"0.76974034",
"0.653766",
"0.64444435",
"0.6410897",
"0.62937784",
"0.61271423",
"0.59790206",
"0.59790206",
"0.5849885",
"0.5810339",
"0.5742386",
"0.5700962",
"0.55563533",
"0.54974097",
"0.54601175",
"0.545593",
"0.545593",
"0.54546",
"0.54171216",
"0.53193474",
"0.5312173... | 0.7774505 | 1 |
The status of a Read Replica. If the instance is not a Read Replica, this will be blank | def status_infos
@dbi.status_infos
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status\n instance_get(:status)\n end",
"def getStatus\n @status\n end",
"def getStatus\r\n\t\t\t\t\treturn @status\r\n\t\t\t\tend",
"def status\n @status\n end",
"def status\n @status\n end",
"def status\n return @status\n end",
"def sta... | [
"0.6533027",
"0.64630574",
"0.6383723",
"0.63630897",
"0.63630897",
"0.6360098",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
"0.6359688",
... | 0.0 | -1 |
Specifies the storage type associated with DB instance | def storage_type
@dbi.storage_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def simpledb_type\n model.storage_name(DataMapper.repository.name)\n end",
"def storage_type\n data[:storage_type]\n end",
"def storage_type\n data[:storage_type]\n end",
"def set_storage_type\n @storage_type = StorageType.find(params[:id])\n end",
"def simpledb_type(model)\... | [
"0.73987263",
"0.7283824",
"0.7283824",
"0.7244806",
"0.712618",
"0.71252334",
"0.70565146",
"0.69340646",
"0.69340646",
"0.6822909",
"0.68064636",
"0.64942265",
"0.63586795",
"0.6349102",
"0.6312781",
"0.63031554",
"0.6270881",
"0.6254365",
"0.6231267",
"0.62009776",
"0.6148... | 0.77781105 | 1 |
The ARN from the Key Store with which the instance is associated for TDE encryption | def tde_credential_arn
@dbi.tde_credential_arn
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aws_backup_recovery_point_arn\n data[:aws_backup_recovery_point_arn]\n end",
"def arn\n \"arn:\"+(MU::Cloud::AWS.isGovCloud?(@region) ? \"aws-us-gov\" : \"aws\")+\":elasticache:\"+@region+\":\"+MU::Cloud::AWS.credToAcct(@credentials)+\":cluster/\"+@cloud_id\n end",
"def arn\n ... | [
"0.6419472",
"0.6296094",
"0.61062336",
"0.60801035",
"0.6066302",
"0.603389",
"0.60065156",
"0.5996161",
"0.59737027",
"0.59737027",
"0.59639496",
"0.592862",
"0.5901399",
"0.58959436",
"0.5865901",
"0.57655615",
"0.5748342",
"0.5733348",
"0.56911194",
"0.56911194",
"0.56765... | 0.5688499 | 21 |
If StorageEncrypted is true, the KMS key identifier for the encrypted DB instance | def kms_key_id
@dbi.kms_key_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 @encryption_key\n end",
"def encryption_key\n\tself.data_encrypting_key ||= DataEncryptingKey.prim... | [
"0.7700822",
"0.7596409",
"0.7011113",
"0.7011113",
"0.68458426",
"0.68458426",
"0.66566855",
"0.6640497",
"0.6637513",
"0.6622459",
"0.66217357",
"0.6579761",
"0.6579761",
"0.6579761",
"0.6534742",
"0.6525411",
"0.6525411",
"0.65052074",
"0.64856285",
"0.6467922",
"0.639502"... | 0.74748087 | 3 |
If StorageEncrypted is true, the regionunique, immutable identifier for the encrypted DB instance. This identifier is found in AWS CloudTrail log entries whenever the KMS key for the DB instance is accessed | def dbi_resource_id
@dbi.dbi_resource_id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 @encryption_key\n end",
"def encryption_key\n\tself.data_encrypting_key ||= DataEncryptingKey.prim... | [
"0.62065935",
"0.5853884",
"0.5822146",
"0.57453364",
"0.57453364",
"0.56448185",
"0.56448185",
"0.56116366",
"0.56092614",
"0.5558062",
"0.5523645",
"0.5505958",
"0.5496609",
"0.5459592",
"0.5456188",
"0.5416697",
"0.54090816",
"0.5374784",
"0.5374784",
"0.537349",
"0.531528... | 0.0 | -1 |
The identifier of the CA certificate for this DB instance | def ca_certificate_identifier
@dbi.ca_certificate_identifier
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ca_certificate_identifier\n data[:ca_certificate_identifier]\n end",
"def encryption_certificate_id\n return @encryption_certificate_id\n end",
"def encryption_certificate_id=(value)\n @encryption_certificate_id = value\n end",
"def ca_cert_stri... | [
"0.8411503",
"0.71668994",
"0.67308104",
"0.67147803",
"0.6667641",
"0.6633707",
"0.6630795",
"0.65891147",
"0.6475579",
"0.6457387",
"0.6439558",
"0.6402483",
"0.6374842",
"0.6371527",
"0.6325235",
"0.63132304",
"0.62857985",
"0.62441987",
"0.61846066",
"0.61288345",
"0.6125... | 0.8994436 | 1 |
show on public page | def list
@events = Event.coming_events
respond_to do |format|
format.html do
render layout: 'events'
end
format.json do
events = @events.map {|event| {event: event, users: event.users, applied: event.users.include?(current_user) }}
render json: events
end
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n\t\tnot_found\tunless for_public?\n\tend",
"def show() end",
"def show() end",
"def show() end",
"def show\n\t\t\n\tend",
"def show\n\t\t\n\tend",
"def show\n\t\t\n\tend",
"def show\n \t\n end",
"def show\n \t\n end",
"def show\n\t end",
"def show\n\t\t end",
"def show\n ... | [
"0.8072254",
"0.73603463",
"0.73603463",
"0.73603463",
"0.7327991",
"0.7327991",
"0.7327991",
"0.7317396",
"0.7317396",
"0.7313192",
"0.72927946",
"0.7247026",
"0.7247026",
"0.72446936",
"0.72446936",
"0.72446936",
"0.72275245",
"0.72120816",
"0.7206889",
"0.71975714",
"0.719... | 0.0 | -1 |
def show brand = Brand.find_by(id: params[:id]) render json: BrandSerializer.new(brand, options).serialized_json end | def show
brand = Brand.find_by(name: params[:name])
render json: BrandSerializer.new(brand, options).serialized_json
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @brand = Brand.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brand }\n end\n end",
"def show\r\n @brand = Brand.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.jso... | [
"0.91454196",
"0.9064402",
"0.8754203",
"0.86105967",
"0.8525344",
"0.84355676",
"0.84270567",
"0.8384062",
"0.812299",
"0.80792314",
"0.79425615",
"0.78049946",
"0.77812135",
"0.7718225",
"0.76525563",
"0.76413393",
"0.7619754",
"0.75891936",
"0.75783044",
"0.75502527",
"0.7... | 0.9263512 | 0 |
adds member variable to struct | def add_field(var_name, type, xml_tag, value=nil)
@fields[var_name] = Field.new(var_name, type, xml_tag, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_member(member_name, klass, options = T.unsafe(nil)); end",
"def pfadd(key, member); end",
"def add_member_data(lb, member)\n begin\n obj = JSON.parse(lb.member_data_for(member[:handle]))\n obj.each { |key, value| member[key] = value }\n rescue\n # fail silently if no data exists\n end\n me... | [
"0.6814776",
"0.63808525",
"0.63754493",
"0.6181941",
"0.6136196",
"0.61079997",
"0.60647035",
"0.60647035",
"0.60378015",
"0.6015303",
"0.5996488",
"0.5951626",
"0.5947941",
"0.59360987",
"0.5891281",
"0.5891281",
"0.58835727",
"0.5879822",
"0.5850404",
"0.5824384",
"0.58189... | 0.563249 | 31 |
adds member variable to struct | def delete_field(var_name)
@fields.delete(var_name)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_member(member_name, klass, options = T.unsafe(nil)); end",
"def pfadd(key, member); end",
"def add_member_data(lb, member)\n begin\n obj = JSON.parse(lb.member_data_for(member[:handle]))\n obj.each { |key, value| member[key] = value }\n rescue\n # fail silently if no data exists\n end\n me... | [
"0.68165815",
"0.63841456",
"0.6377606",
"0.61829555",
"0.6135862",
"0.61096",
"0.60632855",
"0.60632855",
"0.6036514",
"0.60162026",
"0.5995039",
"0.5950875",
"0.5950334",
"0.5935485",
"0.5892236",
"0.5892236",
"0.58834124",
"0.5880016",
"0.58513147",
"0.58272964",
"0.581795... | 0.0 | -1 |
Traverses that PITO E2E document passed in using XPath and creates an Array of Entry objects based on what it finds | def create_entries(doc, id_map = {})
@id_map = id_map
allergy_list = []
entry_elements = doc.xpath(@entry_xpath)
entry_elements.each do |entry_element|
allergy = Allergy.new
extract_codes(entry_element, allergy)
extract_dates(entry_element, all... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_entries(doc,id_map = {})\n encounter_list = []\n entry_elements = doc.xpath(@entry_xpath)\n entry_elements.each do |entry_element|\n encounter = create_entry(entry_element, id_map={})\n if @check_for_usable\n encounter_list << encounter if en... | [
"0.6459335",
"0.6458006",
"0.6365074",
"0.63547665",
"0.6301117",
"0.6284545",
"0.60900223",
"0.60632706",
"0.6051682",
"0.5987893",
"0.58852553",
"0.58421105",
"0.5763403",
"0.5756542",
"0.5748658",
"0.57306814",
"0.57213104",
"0.5704622",
"0.5691529",
"0.56910145",
"0.56744... | 0.61354166 | 6 |
Sets the value of value | def value(value)
@value=value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_value(value)\n @value = value\n end",
"def setValue(value)\n @value = value\n end",
"def set_value( value )\n @value = value \n end",
"def set(value)\n value\n end",
"def value=(value)\n @value = value\n end",
"def value=(value)\n @value = v... | [
"0.8960657",
"0.88523364",
"0.88398176",
"0.8750828",
"0.8644541",
"0.8629607",
"0.8629607",
"0.8629607",
"0.8623264",
"0.8530324",
"0.851263",
"0.8428756",
"0.8401648",
"0.8359632",
"0.83535856",
"0.83298934",
"0.8277386",
"0.8200477",
"0.81246114",
"0.81145275",
"0.8086526"... | 0.86220396 | 9 |
Returns the value of value | def print_value
return @value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value\n value\n end",
"def get_value\n value\n end",
"def get_value\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def get(value)\n value\n end",
"def value\r\n @value\r\n end",
"def value\n return @... | [
"0.8921114",
"0.8921114",
"0.88181216",
"0.87535715",
"0.87535715",
"0.87196094",
"0.8655284",
"0.8643101",
"0.8643101",
"0.8643101",
"0.8582639",
"0.8581952",
"0.8560176",
"0.85336345",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023"... | 0.7828437 | 66 |
Filling the axon array (connection between dendrites and neurons) | def axon(connections)
@axons = connections
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(x, y)\n\t\t@neurons = Array.new\n\t\tx.times do\n\t\t\tneuron = Array.new(y)\n\t\t\t\n\t\t\t#create random weights\n\t\t\tneuron.each_index do |weight|\n\t\t\t\tneuron[weight] = rand * 2.0 - 1.0\n\t\t\tend\n\t\t\t@neurons << neuron\n\t\tend\n\tend",
"def init_activation_nodes\n @activation_... | [
"0.53963286",
"0.5313722",
"0.5270904",
"0.5261579",
"0.5054383",
"0.50463665",
"0.5036481",
"0.5015852",
"0.5001711",
"0.4994862",
"0.49638402",
"0.49524656",
"0.49290693",
"0.4923007",
"0.49201804",
"0.49199447",
"0.49173033",
"0.49173033",
"0.49150226",
"0.49084184",
"0.48... | 0.610784 | 0 |
Returns the values of axons | def print_axons
return @axons
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def print_axons\n\t\t\treturn @axons\n\t\tend",
"def ax\n points[0][0]\n end",
"def values\n @observables.map{|observable| @values[observable] }\n end",
"def values\n @observables.map{|observable| @values[observable] }\n end",
"def all_axes\n @structure.all_axes\n end",
... | [
"0.67526203",
"0.6614644",
"0.6259517",
"0.6246478",
"0.60684973",
"0.5905454",
"0.5892981",
"0.57336134",
"0.57055545",
"0.57025766",
"0.5679116",
"0.56720716",
"0.5668133",
"0.56318027",
"0.56228197",
"0.56220305",
"0.5598826",
"0.5577309",
"0.5577309",
"0.5577309",
"0.5577... | 0.67428714 | 1 |
Filling the weight array | def weight(connections)
weight_array=Array.new
for x in 0...connections.size
weight_array[x]=(rand() * (rand(3)-1))
end
@weights = weight_array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rebuild_weight_array\n end",
"def init_weight\n # (J, 1)\n @b = Matrix.columns([Array.new(@size) { 0.0 }])\n\n # (J, I)\n @W = Array.new(@J) do\n Array.new(@I) { Sabina::Utils.box_muller }\n end.tap { |ary| break Matrix[*ary] }\n end",
"def initializeWeights\n @matr... | [
"0.7962386",
"0.7227585",
"0.66444814",
"0.6634451",
"0.6605456",
"0.6556735",
"0.65026075",
"0.6456368",
"0.63265693",
"0.6311121",
"0.6144314",
"0.61377937",
"0.61140144",
"0.60413444",
"0.60258794",
"0.60112876",
"0.60069036",
"0.59738547",
"0.5955651",
"0.59296227",
"0.59... | 0.6733168 | 2 |
Returns the values of the weights | def print_weight
return @weights
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def weights()\r\n @weights = @layers.map {|layer| layer.to_a}.flatten\r\n @num_weights = @weights.size\r\n return @weights\r\n end",
"def print_weight\n\t\t\treturn @weights\n\t\tend",
"def computed_values\n unless defined?(@computed_values) && @computed_values\n # Do nothin... | [
"0.77241904",
"0.7503523",
"0.7201167",
"0.7180983",
"0.7086878",
"0.70398563",
"0.6862671",
"0.6846565",
"0.68245053",
"0.6800117",
"0.67974246",
"0.67865676",
"0.6637152",
"0.6617271",
"0.65825963",
"0.6531195",
"0.647185",
"0.6452606",
"0.6418409",
"0.64036345",
"0.6401830... | 0.7508567 | 1 |
Setting the value of the neuron | def value(dendrites_array,num)
x=activation(dendrites_array,num)
@value=sigmoidal(x)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def value=(n)\n Gate.activate\n self.set(n)\n Gate.deactivate\n end",
"def set(n)\r\n self.value=n\r\n end",
"def value=(value); self.data.value = value; end",
"def w=(value); self[W] = Float(value); end",
"def value=(val); end",
"def feedforward(val)\n @output = val * weight ... | [
"0.70439047",
"0.68322086",
"0.65990347",
"0.63878495",
"0.6365358",
"0.63543713",
"0.62646735",
"0.60662276",
"0.60662276",
"0.6060079",
"0.6048003",
"0.60327363",
"0.59967434",
"0.5995609",
"0.5985951",
"0.5971784",
"0.59702474",
"0.5968985",
"0.5926476",
"0.5924943",
"0.58... | 0.64710164 | 3 |
Returns the value of value | def print_value
return @value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_value\n value\n end",
"def get_value\n value\n end",
"def get_value\n @value\n end",
"def value\n @value\n end",
"def value\n @value\n end",
"def get(value)\n value\n end",
"def value\r\n @value\r\n end",
"def value\n return @... | [
"0.8921114",
"0.8921114",
"0.88181216",
"0.87535715",
"0.87535715",
"0.87196094",
"0.8655284",
"0.8643101",
"0.8643101",
"0.8643101",
"0.8582639",
"0.8581952",
"0.8560176",
"0.85336345",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023",
"0.8520023"... | 0.7933802 | 59 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.