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
This sweeper is going to keep an eye on the UniqueShapeName model If our sweeper detects that a UniqueShapeName was created call this
def after_create(unique_shape_name) expire_cache_for(unique_shape_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_shape\n id = rand 7\n @cur_y = 0\n @cur_x = 5\n @shape = SHAPES[id].dup\n end", "def remove_shape\n\t\t@shapes.delete_at(0)\n\tend", "def initialize_ISG_shape(shape_uid)\n\t\t\t# create dictionary if it doesn't exist\n\t\t\t@dict = self.attribute_dictionary 'IterativeSG', true\n\t\t\t@r...
[ "0.65151423", "0.58718973", "0.5719948", "0.5717422", "0.56124854", "0.5588835", "0.5378931", "0.52917635", "0.52866364", "0.527403", "0.5267726", "0.5264684", "0.5264684", "0.5220904", "0.51848567", "0.5181494", "0.5163503", "0.5147804", "0.5133412", "0.5107059", "0.50914145...
0.6410919
1
If our sweeper detects that a UniqueShapeName was updated call this
def after_update(unique_shape_name) expire_cache_for(unique_shape_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_create(unique_shape_name)\n expire_cache_for(unique_shape_name)\n end", "def after_destroy(unique_shape_name)\n expire_cache_for(unique_shape_name)\n end", "def after_update(shape_type)\n expire_cache_for(shape_type)\n end", "def after_update(shape)\n expire_cache_for(shape)\n end",...
[ "0.6507056", "0.60477304", "0.56410486", "0.5639614", "0.55599785", "0.5416625", "0.5255165", "0.5229306", "0.5210432", "0.51466656", "0.51098204", "0.5103404", "0.5073991", "0.50669867", "0.5055709", "0.50451624", "0.50352347", "0.5023767", "0.5012722", "0.500739", "0.497949...
0.70050925
0
If our sweeper detects that a UniqueShapeName was deleted call this
def after_destroy(unique_shape_name) expire_cache_for(unique_shape_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_shape\n\t\t@shapes.delete_at(0)\n\tend", "def after_create(unique_shape_name)\n expire_cache_for(unique_shape_name)\n end", "def remove shape\n @remove_shapes << shape\n end", "def after_update(unique_shape_name)\n expire_cache_for(unique_shape_name)\n end", "def after_destroy(shape_...
[ "0.6897539", "0.68258774", "0.6726054", "0.6667117", "0.61867195", "0.6176698", "0.6073247", "0.5678825", "0.5678825", "0.5655568", "0.5644912", "0.5583315", "0.55753475", "0.5567295", "0.55632305", "0.5528086", "0.5423195", "0.5402216", "0.5401047", "0.5361197", "0.53326184"...
0.7283331
0
method to get location
def get_zip print "What is you location? (zip code): " zipcode = gets.chomp end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_location\n\n end", "def location\n fetch('hey_arnold.locations')\n end", "def getLocation\r\n\t\t\t\t\treturn @location\r\n\t\t\t\tend", "def location\n @location\n end", "def location\n return @location\n end", "def location\n @location...
[ "0.90447307", "0.83649945", "0.83343536", "0.83129394", "0.83128643", "0.8299312", "0.8299312", "0.8198253", "0.81554526", "0.8142865", "0.80478805", "0.8023135", "0.7997128", "0.7991822", "0.79700375", "0.79527926", "0.7949214", "0.7903897", "0.7882957", "0.78698426", "0.782...
0.0
-1
method to draw separator line
def hor_line for i in 1..40 print "-" end puts '' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def draw_line\n print H_SEP * columns\n end", "def draw_separation(x_start, y_start, y_min, y_max, x)\n @canvas.g.translate(x_start, y_start) do |lines|\n lines.styles(:stroke=>'#CCCCCC', :stroke_width=>1, :opacity=>0.05)\n lines.line(x, y_min, x, y_max)\n end\n end", "def line_divider \...
[ "0.7522219", "0.73153824", "0.69710934", "0.6936839", "0.689818", "0.6823194", "0.66816515", "0.66569805", "0.65903026", "0.6587138", "0.657772", "0.6540361", "0.6522437", "0.65151834", "0.65151834", "0.65151834", "0.6491642", "0.6491642", "0.646288", "0.64345604", "0.6418327...
0.0
-1
option ['swiftversion'], 'SWIFT_VERSION', 'What Swift version to change into', :required => true
def execute supported_swift_versions = ['3.0', '4.0', '4.2'] if !supported_swift_versions.include? swift_version signal_usage_error "'#{swift_version}' swift version is not supported. Supported values: " + supported_swift_versions.map { |v| "'#{v}'" }.join(", ") end ProjectMod.apply_build_setting(name: 'SWIFT_VERSION', value: "#{swift_version}.0", target_names: target_list) targets_string = target_list.empty? ? 'All targets' : (target_list.join(", ") + " targets") puts "#{targets_string} were updated to use Swift #{swift_version}!" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_swift_version\n return unless uses_swift?\n spec_swift_versions = spec.swift_versions.map(&:to_s)\n\n unless spec_swift_versions.empty?\n message = nil\n if !dot_swift_version.nil? && !spec_swift_versions.include?(dot_swift_version)\n message = \"Specification `#{...
[ "0.6580914", "0.5924886", "0.5924886", "0.5924886", "0.5924886", "0.5924886", "0.5924886", "0.5924886", "0.5924886", "0.5924886", "0.590996", "0.57647663", "0.5632774", "0.5626702", "0.56221426", "0.56058323", "0.55801165", "0.5579629", "0.55401284", "0.55283296", "0.5526932"...
0.5974765
1
To replicate the behavior in ActiveRecordattributes, :except takes precedence over :only. If :only is not set for a N level model but is set for the N+1 level models, then because :except is set to a default value, the second level model can have both :except and :only set. So if :only is set, always delete :except.
def attributes_hash attributes = @serializable.attributes if options[:only].any? attributes.slice(*options[:only]) elsif options[:except].any? attributes.except(*options[:except]) else attributes end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def only\n attributes.fetch(:only)\n end", "def except(*keys)\n common = keys & self.class.required_attributes\n\n if common.empty?\n self.class.new(@hash.except(*keys))\n else\n to_hash.except(*keys)\n end\n end", "def except_attributes\n [].freeze\n end", "def cle...
[ "0.67332566", "0.6430014", "0.6336545", "0.63268477", "0.60581917", "0.59833455", "0.59803396", "0.5867166", "0.5836784", "0.58291423", "0.58207476", "0.5781079", "0.57531565", "0.57452184", "0.57451046", "0.57441616", "0.56608605", "0.5618999", "0.56106395", "0.5602447", "0....
0.53207374
47
Returns FXML representing the model. Configuration can be passed through +options+.
def to_fxml(options = {}, &block) options.merge!(:dasherize => false) default_except = [:encrypted_password, :password_salt, :remember_token, :remember_token_expires_at, :created_at, :updated_at] options[:except] = (options[:except] ? options[:except] + default_except : default_except) Serializer.new(self, options).serialize(&block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_fxml(options = {})\n options.merge!(:dasherize => false)\n default_except = [:crypted_password, :salt, :remember_token, :remember_token_expires_at, :created_at, :updated_at]\n options[:except] = (options[:except] ? options[:except] + default_except : default_except)\n \n R...
[ "0.6096836", "0.54186976", "0.5318185", "0.52335274", "0.5195478", "0.51227534", "0.50567734", "0.5029529", "0.5011169", "0.49898344", "0.4956624", "0.48802328", "0.48799238", "0.48693708", "0.48692635", "0.48650995", "0.48609874", "0.48609874", "0.48133314", "0.48082572", "0...
0.54155153
2
serialize errors to JSON
def as_json(options = {}) "{#{'errors'.inspect}:#{as_json_original(options)}}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_json\n { errors: @errors.as_json }\n end", "def error_messages_as_json\n { errors: object.errors.messages }\n end", "def errors_to_json(model)\n\t\treturn ModelError.new({\n\t\t\t:model => model,\n\t\t\t:error => model.errors.collect{ |attr,msg| attr.humanize+' - '+msg }.join('\\n'),\n\t\t})...
[ "0.80529106", "0.77316046", "0.7552049", "0.75032115", "0.7482961", "0.7448", "0.74449426", "0.7393748", "0.71646625", "0.7100807", "0.7095447", "0.7089109", "0.70874184", "0.69845635", "0.6957885", "0.69160426", "0.68817127", "0.6829011", "0.6715763", "0.6695147", "0.6669575...
0.7398163
7
serialize errors to AMF
def to_amf(options = {}) options[:amf_version] = 3 options[:serializer] ||= RestfulX::AMF::RxAMFSerializer.new options[:serializer].serialize_errors(Hash[*@errors.to_a.flatten]).to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_amf(options = {})\n options[:amf_version] = 3\n options[:serializer] ||= RestfulX::AMF::RxAMFSerializer.new\n options[:serializer].serialize_errors(Hash[*@errors.to_a.flatten]).to_s\n end", "def serialize_error\n case error\n when Common::Exceptions::BaseError\n base_err...
[ "0.7167281", "0.67037886", "0.6085184", "0.58845764", "0.5805347", "0.56878185", "0.56590694", "0.56496", "0.56488997", "0.5643584", "0.56181484", "0.56171775", "0.5615485", "0.5604924", "0.5600717", "0.5592583", "0.55849624", "0.558445", "0.55825907", "0.5560151", "0.5531363...
0.7100394
1
Whether this station has a "borne" (yellow selfservice ticket machine)
def has_borne? sncf_self_service_machine == "t" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_bees?\n state == 'bees'\n end", "def away?\n online? and (presence.show == :away or presence.show == :xa)\n end", "def in_journey?\n @entry_station != nil\n end", "def away?\n status == :away\n end", "def occupied?\n !!@boat\n end", "def global_water_sport?\n # TODO\n ...
[ "0.6407664", "0.63906956", "0.6372528", "0.635399", "0.6334876", "0.62397814", "0.6199753", "0.61698484", "0.61692524", "0.61418283", "0.6135924", "0.6134875", "0.6134158", "0.6130723", "0.6125004", "0.611604", "0.6097274", "0.60916394", "0.6061751", "0.6046658", "0.60454136"...
0.8183597
0
List of the next departing trains from this station.
def departures(refresh = false) if tvs trains(:departure, refresh) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_train(station, destinations, opts = {})\n ldbws.next_departures_with_details(station, destinations, opts)\n end", "def next_station\n @route.stations[@current_station_index + 1]\n end", "def next_station\n @route.stations[@current_station + 1] if current_station != @route.stations.last\n e...
[ "0.6469744", "0.61163056", "0.5991272", "0.5883788", "0.5858357", "0.5711918", "0.57000464", "0.5684157", "0.56806576", "0.5672466", "0.5582665", "0.55755", "0.5536568", "0.5531512", "0.54865736", "0.5446997", "0.54408914", "0.54368967", "0.53815633", "0.53712076", "0.5270465...
0.4956044
69
List of the next arriving trains in this station.
def arrivals(refresh = false) if tvs trains(:arrival, refresh) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_station\n @route.stations[@current_station_index + 1]\n end", "def current_trains\n data = parse_json\n current_trains = []\n data['Trips'].each do |train|\n if !train['Position'].nil?\n train_number = train['Position']['Train']\n position = {lat: train['Posit...
[ "0.6327635", "0.6229601", "0.6184856", "0.61160535", "0.60464865", "0.6030311", "0.59977305", "0.5937847", "0.59195274", "0.58768094", "0.5801475", "0.57896984", "0.57860595", "0.574707", "0.57089055", "0.56736386", "0.56332046", "0.5628711", "0.56283045", "0.5627789", "0.561...
0.60622156
4
Remove all competitors, and readd them to the competition
def rebuild_competitors(bib_numbers) clear_competitors build_competitors(bib_numbers) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_competencies\r\n @communication.destroy\r\n @decision_making.destroy\r\n @problem_solving.destroy\r\n end", "def remove_competence(competence)\n # Remove competence\n competences.delete(competence)\n\n # Remove courses\n needed_scoped_course_ids = needed_scoped_courses(se...
[ "0.72931963", "0.6423695", "0.61529243", "0.58806735", "0.58217484", "0.56935084", "0.5682762", "0.5674633", "0.5671789", "0.56699336", "0.56699336", "0.56460965", "0.55888903", "0.55872184", "0.55872184", "0.5582059", "0.55765736", "0.5573042", "0.55425006", "0.55383384", "0...
0.5492919
23
describes how to label the results of this competition
def result_description nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def labels\n return \"Title: #{@title}; Description: #{@desc}; #{@complete}\"\n end", "def lab_obs_lab_results_string(observation)\n if observation.answer_concept\n if !observation.answer_concept.fullname.include?(\"NO\")\n \"#{(observation.concept.fullname == \"LAB TEST RESULT\" ? \"<b>#{obse...
[ "0.71965396", "0.6990186", "0.66584706", "0.6623342", "0.65199596", "0.64700925", "0.64518017", "0.6416198", "0.6406615", "0.63071686", "0.62908536", "0.62908536", "0.6266051", "0.6250404", "0.62403315", "0.6234206", "0.6205086", "0.62042624", "0.61774296", "0.6152176", "0.61...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_attached_image @attached_image = AttachedImage.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.6163443", "0.604317", "0.5943409", "0.59143174", "0.5887026", "0.58335453", "0.57738566", "0.5701527", "0.5701527", "0.56534666", "0.5618685", "0.54237175", "0.5407991", "0.5407991", "0.5407991", "0.5394463", "0.5376582", "0.5355932", "0.53376216", "0.5337122", "0.5329516"...
0.0
-1
Only allow a trusted parameter "white list" through.
def attached_image_params params.require(:attached_image).permit(:image_id, :response_id, :question_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
Get all tickets. Can select projects p[]=
def overall_tickets end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tickets_for_project(project_id)\n tickets = send(:get , \"/api/v1/projects/#{project_id}/tickets.json\")\n\n process_list_response( tickets , Unfuddled::Ticket )\n end", "def tickets\n Ticket.find_all_by_project_id_and_milestone_id(project_id, id)\n end", "def index\n @t...
[ "0.77884585", "0.773211", "0.7170943", "0.6977903", "0.69335794", "0.69092107", "0.67012507", "0.6667955", "0.6654992", "0.66492873", "0.66492873", "0.66492873", "0.66492873", "0.66492873", "0.66492873", "0.66492873", "0.66492873", "0.66492873", "0.66492873", "0.66492873", "0...
0.0
-1
:nodoc: Initialize a new MessageEncryptor. +secret+ must be at least as long as the cipher key size. For the default 'aes256gcm' cipher, this is 256 bits. If you are using a userentered secret, you can generate a suitable key by using ActiveSupport::KeyGenerator or a similar key derivation function. The first additional parameter is used as the signature key for MessageVerifier. This allows you to specify keys to encrypt and sign data. Ignored when using an AEAD cipher like 'aes256gcm'. ActiveSupport::MessageEncryptor.new('secret', 'signature_secret') ==== Options [+:cipher+] Cipher to use. Can be any cipher returned by +OpenSSL::Cipher.ciphers+. Default is 'aes256gcm'. [+:digest+] Digest used for signing. Ignored when using an AEAD cipher like 'aes256gcm'. [+:serializer+] The serializer used to serialize message data. You can specify any object that responds to +dump+ and +load+, or you can choose from several preconfigured serializers: +:marshal+, +:json_allow_marshal+, +:json+, +:message_pack_allow_marshal+, +:message_pack+. The preconfigured serializers include a fallback mechanism to support multiple deserialization formats. For example, the +:marshal+ serializer will serialize using +Marshal+, but can deserialize using +Marshal+, ActiveSupport::JSON, or ActiveSupport::MessagePack. This makes it easy to migrate between serializers. The +:marshal+, +:json_allow_marshal+, and +:message_pack_allow_marshal+ serializers support deserializing using +Marshal+, but the others do not. Beware that +Marshal+ is a potential vector for deserialization attacks in cases where a message signing secret has been leaked. If possible, choose a serializer that does not support +Marshal+. The +:message_pack+ and +:message_pack_allow_marshal+ serializers use ActiveSupport::MessagePack, which can roundtrip some Ruby types that are not supported by JSON, and may provide improved performance. However, these require the +msgpack+ gem. When using \Rails, the default depends on +config.active_support.message_serializer+. Otherwise, the default is +:marshal+. [+:url_safe+] By default, MessageEncryptor generates RFC 4648 compliant strings which are not URLsafe. In other words, they can contain "+" and "/". If you want to generate URLsafe strings (in compliance with "Base 64 Encoding with URL and Filename Safe Alphabet" in RFC 4648), you can pass +true+. [+:force_legacy_metadata_serializer+] Whether to use the legacy metadata serializer, which serializes the message first, then wraps it in an envelope which is also serialized. This was the default in \Rails 7.0 and below. If you don't pass a truthy value, the default is set using +config.active_support.use_message_serializer_for_metadata+.
def initialize(secret, sign_secret = nil, **options) super(**options) @secret = secret @cipher = options[:cipher] || self.class.default_cipher @aead_mode = new_cipher.authenticated? @verifier = if !@aead_mode MessageVerifier.new(sign_secret || secret, **options, serializer: NullSerializer) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(secret, *signature_key_or_options)\n options = signature_key_or_options.extract_options!\n sign_secret = signature_key_or_options.first\n @secret = secret\n @sign_secret = sign_secret\n @cipher = options[:cipher] || 'aes-256-cbc'\n @verifier = MessageVerifier.new(@sign_secret || @secret, :seri...
[ "0.76652634", "0.62599945", "0.61852354", "0.6174547", "0.60118634", "0.5985314", "0.5906838", "0.5849017", "0.5724652", "0.54843014", "0.5484181", "0.548224", "0.5430207", "0.5414475", "0.5410282", "0.5389058", "0.53805494", "0.5374937", "0.537212", "0.5371237", "0.53517276"...
0.6988171
1
Encrypt and sign a message. We need to sign the message in order to avoid padding attacks. Reference: ==== Options [+:expires_at+] The datetime at which the message expires. After this datetime, verification of the message will fail. message = encryptor.encrypt_and_sign("hello", expires_at: Time.now.tomorrow) encryptor.decrypt_and_verify(message) => "hello" 24 hours later... encryptor.decrypt_and_verify(message) => nil [+:expires_in+] The duration for which the message is valid. After this duration has elapsed, verification of the message will fail. message = encryptor.encrypt_and_sign("hello", expires_in: 24.hours) encryptor.decrypt_and_verify(message) => "hello" 24 hours later... encryptor.decrypt_and_verify(message) => nil [+:purpose+] The purpose of the message. If specified, the same purpose must be specified when verifying the message; otherwise, verification will fail. (See decrypt_and_verify.)
def encrypt_and_sign(value, **options) create_message(value, **options) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_and_encrypt_encapsulated(message)\n sign(message)\n encrypt(message)\n end", "def encrypt(data, expires_at: nil, expires_in: nil, purpose: nil)\n return nil unless data\n\n service.encrypt_and_sign(\n data,\n expires_at: expires_at,\n expires_in: expires...
[ "0.73770535", "0.65298843", "0.6349692", "0.61546856", "0.59450585", "0.59331924", "0.58103764", "0.57964015", "0.5724142", "0.56248355", "0.56002694", "0.55829126", "0.55593044", "0.54894763", "0.54792666", "0.5453584", "0.5436879", "0.54147094", "0.54018295", "0.53944355", ...
0.7556189
0
Decrypt and verify a message. We need to verify the message in order to avoid padding attacks. Reference: ==== Options [+:purpose+] The purpose that the message was generated with. If the purpose does not match, +decrypt_and_verify+ will return +nil+. message = encryptor.encrypt_and_sign("hello", purpose: "greeting") encryptor.decrypt_and_verify(message, purpose: "greeting") => "hello" encryptor.decrypt_and_verify(message) => nil message = encryptor.encrypt_and_sign("bye") encryptor.decrypt_and_verify(message) => "bye" encryptor.decrypt_and_verify(message, purpose: "greeting") => nil
def decrypt_and_verify(message, **options) catch_and_raise :invalid_message_format, as: InvalidMessage do catch_and_raise :invalid_message_serialization, as: InvalidMessage do catch_and_ignore :invalid_message_content do read_message(message, **options) end end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def verify(msg)\n \t\t\t\tbegin\n \t\t\t\t\tx,y,z,cmd,sig,iv = msg.split(/\\|/)\n \t\t\t\t\treturn nil unless iv\n \t\t\t\t\tdigest = Digest::MD5.hexdigest(cmd+iv).upcase\n \t\t\t\t\tsb1 = [@signature_block + digest].pack(\"h*\")\n \t\t\t\t\tsb2 = @signingkey_pub.public_decrypt([sig].pack(\"h*\"))\n \t\t\t\...
[ "0.6425691", "0.62018293", "0.60890734", "0.60718334", "0.60361207", "0.59915733", "0.5948968", "0.5900383", "0.5837054", "0.57272506", "0.5719386", "0.5656487", "0.563251", "0.5623464", "0.5613236", "0.5608425", "0.55842906", "0.5573507", "0.55440694", "0.55421746", "0.55421...
0.70903915
0
Execute 'query' and output response to 'output_file'. 'skip_lines' specifies which lines to exclude, where skip_lines[1] indicates the first line of the response. precondition: query != nil && ! output_file.closed? && ! skip_lines.nil?
def output_response(output_file, skip_lines = {}) begin open(query) do |f| current_line_index = 1 # Process (output, if appropriate) the first line: first_line = f.readline if bad_data_match(first_line) or first_line.empty? then raise "Bad or no data [#{first_line}]" end if first_line && ! skip_lines[current_line_index] then if @filter_function != nil then first_line << @filter_function.call(first_line, current_line_index) end if ! first_line.nil? then output_file.write(first_line) end end if ! f.eof? then current_line_index += 1 f.each_line do |l| if @filter_function != nil then if ! skip_lines[current_line_index] then filtered_line = @filter_function.call(l, current_line_index) if ! filtered_line.empty? then output_file.write(filtered_line) end end else if ! skip_lines[current_line_index] then output_file.write(l) end end current_line_index += 1 end end end rescue StandardError => error @fatal_error = true @error_message = error.to_s end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_reversed_response(output_file, skip_lines)\n output_file.write(reversed_response(skip_lines).join(\"\\n\") + \"\\n\")\n end", "def reversed_response(skip_lines)\n if query then\n begin\n open(query) do |f|\n i = 1\n f.each_line do |l|\n if i == 1 then\n ...
[ "0.6028171", "0.5739844", "0.5531127", "0.5428932", "0.5326213", "0.5306126", "0.53000873", "0.5140424", "0.51161087", "0.5101366", "0.50569564", "0.50442004", "0.50104123", "0.49411508", "0.4894905", "0.48860353", "0.48815703", "0.48299485", "0.4767706", "0.47452787", "0.471...
0.81314886
0
Execute 'query' and return the response, reversed linebyline, as an array. 'skip_lines' specifies which lines to exclude, where skip_lines[1] indicates the first line of the (unreversed) response. precondition: query != nil && ! skip_lines.nil?
def reversed_response(skip_lines) if query then begin open(query) do |f| i = 1 f.each_line do |l| if i == 1 then if bad_data_match(l) or first_line.empty? then raise "Bad or no data [#{first_line}]" end end if ! skip_lines[i] then @response_lines << l.chomp end i += 1 end end rescue OpenURI::HTTPError => error @fatal_error = true response = error.io @error_message = "status: #{response.status}, error: #{response.string}" end end result = [] if ! @fatal_error then current_line_index = 1 if @filter_function != nil then (0 .. response_lines.count - 1).reverse_each do |i| result << @filter_function.call(response_lines[i], current_line_index) current_line_index += 1 end else (0 .. response_lines.count - 1).reverse_each do |i| result << response_lines[i] end end end result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_response(output_file, skip_lines = {})\n begin\n open(query) do |f|\n current_line_index = 1\n # Process (output, if appropriate) the first line:\n first_line = f.readline\n if bad_data_match(first_line) or first_line.empty? then\n raise \"Bad or no data [#{f...
[ "0.62689096", "0.6100934", "0.5325119", "0.51745105", "0.5120857", "0.511498", "0.5073157", "0.50579166", "0.49561867", "0.48449647", "0.4787308", "0.47579235", "0.47050315", "0.4702483", "0.46775198", "0.466473", "0.46353033", "0.46348712", "0.46332514", "0.46268523", "0.459...
0.8070327
0
Execute 'query' and output response, reversed, to 'output_file'. 'skip_lines' specifies which lines to exclude, where skip_lines[1] indicates the first line of the response. precondition: query != nil && ! output_file.closed? && ! skip_lines.nil?
def output_reversed_response(output_file, skip_lines) output_file.write(reversed_response(skip_lines).join("\n") + "\n") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_response(output_file, skip_lines = {})\n begin\n open(query) do |f|\n current_line_index = 1\n # Process (output, if appropriate) the first line:\n first_line = f.readline\n if bad_data_match(first_line) or first_line.empty? then\n raise \"Bad or no data [#{f...
[ "0.7910778", "0.66135293", "0.5318729", "0.52248454", "0.5138868", "0.5112188", "0.5058764", "0.5006289", "0.49882725", "0.4909226", "0.48741266", "0.48708925", "0.48606223", "0.48233008", "0.48045418", "0.47964084", "0.46586055", "0.46293446", "0.46200824", "0.45876616", "0....
0.7085524
1
Initialize with 'the_query' and, if supplied, the 'filter' function. postcondition: query() != nil
def initialize(the_query, bad_data_expr = nil, filter = nil) if the_query.nil? then raise "Invalid (nil) constructor query arg" end @response_lines = [] @fatal_error = false # Function to call on each line after scanning: @filter_function = filter @bad_data_expr = bad_data_expr @query = the_query end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_filters(query)\n query\n end", "def apply_filter(query)\n query\n end", "def apply_filter(query)\n query\n end", "def retrieve_query\n if params[:set_filter] or !session[:query] or session[:query].project_id\n # Give it a name, required to be valid\n @query = Qu...
[ "0.70675766", "0.7058405", "0.7058405", "0.67657757", "0.67077416", "0.66206855", "0.6616937", "0.6594497", "0.65907794", "0.65654206", "0.6564716", "0.6517352", "0.6356355", "0.62802786", "0.62757814", "0.62329704", "0.61897224", "0.618001", "0.6154256", "0.6136374", "0.6118...
0.7177048
0
we create new instance of the AddressBook model and assign it to the variable named "book" using the "let" syntax provided by RSpec. This lets us use "book" in all our tests, removing the duplication of having to instantiate a new "AddressBook" for each test. commented out all "book = AddressBook.new" let means the code runs only when called! over the instiante it method "before do" video example in the classwork ass. why let is the appropriate way to remove code duplication we create a helper method named check_entry which consolidates the redundant code. We can now pass in the particular name, number, and email address we want into this reusable helper method.
def check_entry(entry, expected_name, expected_number, expected_email) expect(entry.name).to eq expected_name expect(entry.phone_number).to eq expected_number expect(entry.email).to eq expected_email end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_entry(entry, expected_name, expected_number, expected_email) #helper method used to consildate redundant code\n expect(entry.name).to eq expected_name\n expect(entry.phone_number).to eq expected_number\n expect(entry.email).to eq expected_email\n end", "def check_entry(entr...
[ "0.6847821", "0.6577647", "0.65682316", "0.65462273", "0.63722837", "0.5821735", "0.58070284", "0.5804971", "0.58046925", "0.5754864", "0.57307976", "0.5725659", "0.5664572", "0.56587064", "0.5658354", "0.5572273", "0.55511546", "0.5549308", "0.55173546", "0.5499889", "0.5488...
0.6500354
4
def show begin artwork = Artwork.find(params[:id]) render json: artwork rescue render text: "artwork not found" end end
def create new_artwork_share = ArtworkShare.new(artwork_share_params) if new_artwork_share.save render json: new_artwork_share else render( json: new_artwork_share.errors.full_messages, status: :unprocessable_entity ) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @art = Art.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @art }\n end\n end", "def show\n \n @artist = Artist.where(id: params[:id]).first\n if @artist \n render json: @artist, status: 200\n ...
[ "0.85059524", "0.8366392", "0.8175893", "0.8080685", "0.8070809", "0.78263795", "0.7744503", "0.7744503", "0.7744503", "0.7696021", "0.7682267", "0.7533115", "0.74949116", "0.74949116", "0.74949116", "0.74949116", "0.74949116", "0.74936175", "0.7454687", "0.7454687", "0.74546...
0.0
-1
def update updated_artwork = ArtworkShare.find(params[:id]).update(artwork_params) render json: updated_artwork end
def destroy begin found_artwork_share = find_artwork_shares found_artwork_share.destroy render json: found_artwork_share rescue render text: "Sharing not found" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @artwork.update(update_artwork_params)\n format.json { render :show, status: :ok, location: @artwork }\n else\n format.json { render json: @artwork.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to ...
[ "0.88644284", "0.84564495", "0.84221727", "0.84146965", "0.83546954", "0.83195406", "0.82671034", "0.7829537", "0.7751965", "0.7698267", "0.76660085", "0.76660085", "0.763793", "0.76301897", "0.7619327", "0.7564934", "0.7486118", "0.7475587", "0.74569345", "0.7455977", "0.745...
0.0
-1
ACK01 Id: 668 Name: Line Item Status Code Type: ID Min/Max: 2/2 Description: Code specifying the action taken by the seller on a line item requested by the buyer
def ACK01=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purchase_response(code = '00000')\n \"NUMTRANS=0720248861&NUMAPPEL=0713790302&NUMQUESTION=0000790217&SITE=1999888&RANG=99&AUTORISATION=XXXXXX&CODEREPONSE=#{code}&COMMENTAIRE=Demande trait?e avec succ?s ✔漢\"\n end", "def item_type_with_status_code\n :thesis\n end", "def exchange_code; end", "def d...
[ "0.5701915", "0.5555529", "0.5385378", "0.53127086", "0.5277006", "0.52588254", "0.5243664", "0.5235464", "0.5217895", "0.5211837", "0.5201202", "0.51469094", "0.51326954", "0.5120543", "0.5110281", "0.50990105", "0.50856054", "0.508221", "0.5068412", "0.505626", "0.50545245"...
0.4919293
40
ACK02 Id: 380 Name: Quantity Type: R Min/Max: 1/15 Description: Numeric value of quantity
def ACK02=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def quantity\n return @ucItemNumber.value\n end", "def quantity\n read_integer('quantity')\n end", "def sell_quantity\r\n 100000000000\r\n end", "def qty()\n 1\n end", "def getValue(quantity)\n if self.name.include?(\"BALDOSA\")\n self.value*quantity\n else\n sel...
[ "0.6809836", "0.6775975", "0.6690085", "0.64319664", "0.63662946", "0.6348344", "0.6330754", "0.6315505", "0.6189523", "0.6114082", "0.610348", "0.6098476", "0.6098476", "0.59895706", "0.59608895", "0.59427977", "0.5929411", "0.5920596", "0.58081454", "0.5807811", "0.5768504"...
0.0
-1
ACK03 Id: 355 Name: Unit or Basis for Measurement Code Type: ID Min/Max: 2/2 Description: Code specifying the units in which a value is being expressed, or manner in which a measurement has been taken
def ACK03=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value\n if eng_unit_type\n \"#{data} #{eng_unit_type.tag}\"\n else\n data.to_s\n end\n end", "def unit\n parts[3]\n end", "def base_unit\n units[0]\n end", "def convertUnitValue(value,unit)\n if (unit.present?)\n unit.strip!\n else\n return value\n end\n ...
[ "0.563207", "0.5570383", "0.546565", "0.54535824", "0.53640985", "0.534949", "0.53433055", "0.53088784", "0.52860063", "0.5267539", "0.52592987", "0.52484906", "0.5242789", "0.5224872", "0.5222251", "0.5215271", "0.5141634", "0.5099529", "0.5090693", "0.5089259", "0.50868446"...
0.0
-1
ACK04 Id: 374 Name: Date/Time Qualifier Type: ID Min/Max: 3/3 Description: Code specifying type of date or time, or both date and time
def ACK04=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_entry_time_type_code\n entry_time_type ? entry_time_type.code : 'M'\n end", "def type_code \n 4\n end", "def parse_datetime_date(type, resource)\n year = resource[\"#{type}(1i)\"].to_i\n month = resource[\"#{type}(2i)\"].to_i\n day = resource[\"#{type}(3i)\"].to_i\n hour = resou...
[ "0.59769195", "0.5396606", "0.5353971", "0.53273356", "0.5122766", "0.51031023", "0.50942683", "0.5035734", "0.50207156", "0.501616", "0.5006013", "0.49989507", "0.49770126", "0.49764395", "0.49650824", "0.49599096", "0.49510604", "0.49273527", "0.49157703", "0.4914556", "0.4...
0.0
-1
ACK05 Id: 373 Name: Date Type: DT Min/Max: 8/8 Description: Date expressed as CCYYMMDD
def ACK05=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_date; end", "def read_date=(_); end", "def date; end", "def date; end", "def date; end", "def date; end", "def date() self[:date]; end", "def date(input, format); end", "def claim_from_date\n unless eob.claim_from_date.blank?\n if eob.claim_from_date.strftime(\"%Y%m%d\") == \"20000...
[ "0.687373", "0.6756421", "0.6490232", "0.6490232", "0.6490232", "0.6490232", "0.62341404", "0.6076975", "0.6044691", "0.60063", "0.5970772", "0.5939975", "0.5939975", "0.5939975", "0.5909674", "0.5901575", "0.5861703", "0.5848714", "0.5848606", "0.58441675", "0.58201116", "...
0.0
-1
ACK06 Id: 326 Name: Request Reference Number Type: AN Min/Max: 1/45 Description: Reference number or RFQ number to use to identify a particular transaction set and query (additional reference number or description which can be used with contract number)
def ACK06=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def acknowledgement_reference_id\r\n\t\tacknowledgement_message.split(\":\")[1].gsub(/\\s/,\"\")\r\n\tend", "def Com6 # Recuperation Info\n \n end", "def purchase_response(code = '00000')\n \"NUMTRANS=0720248861&NUMAPPEL=0713790302&NUMQUESTION=0000790217&SITE=1999888&RANG=99&AUTORISATION=XXXXXX&CODEREPO...
[ "0.55239296", "0.53948915", "0.5362379", "0.52976155", "0.52036434", "0.51425076", "0.5116596", "0.5092556", "0.5091087", "0.5080851", "0.5080851", "0.5077033", "0.5071219", "0.49948198", "0.49844977", "0.4982748", "0.49796268", "0.49771672", "0.49535206", "0.49384794", "0.49...
0.48913085
25
ACK07 Id: 235 Name: Product/Service ID Qualifier Type: ID Min/Max: 2/2 Description: Code identifying the type/source of the descriptive number used in Product/Service ID (234)
def ACK07=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manufacturer_id\n mac[0..7]\n end", "def identifier_code\n 'QuestionnaireResponseID'\n end", "def service_prov_identification\n code, qual = nil, nil\n claim = eob.claim_information\n\n if (claim && !claim.provider_npi.blank?)\n code = claim.provider_npi\n qual = 'XX'...
[ "0.59378564", "0.58263505", "0.58005244", "0.5726464", "0.57073325", "0.5682998", "0.56727046", "0.56295437", "0.5558307", "0.55364335", "0.5534659", "0.5480653", "0.54482937", "0.53254443", "0.53215224", "0.5295071", "0.5292925", "0.52752215", "0.527499", "0.5258509", "0.523...
0.0
-1
ACK08 Id: 234 Name: Product/Service ID Type: AN Min/Max: 1/48 Description: Identifying number for a product or service
def ACK08=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_service_msg_number\n 1002\n end", "def default_service_msg_number\n \"0002\"\n end", "def service_payee_identification\n code, qual = nil, nil\n claim = eob.claim_information\n fac = facility\n\n if (claim && !claim.payee_npi.blank?)\n code = claim.p...
[ "0.5923048", "0.57499444", "0.55433947", "0.55170137", "0.55041224", "0.549043", "0.5463996", "0.5418305", "0.539549", "0.53248733", "0.5254535", "0.5240311", "0.52114373", "0.51996535", "0.5197837", "0.5195088", "0.5146734", "0.513048", "0.51129854", "0.5106533", "0.50745547...
0.0
-1
ACK09 Id: 235 Name: Product/Service ID Qualifier Type: ID Min/Max: 2/2 Description: Code identifying the type/source of the descriptive number used in Product/Service ID (234)
def ACK09=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def manufacturer_id\n mac[0..7]\n end", "def identifier_code\n 'QuestionnaireResponseID'\n end", "def service_prov_identification\n code, qual = nil, nil\n claim = eob.claim_information\n\n if (claim && !claim.provider_npi.blank?)\n code = claim.provider_npi\n qual = 'XX'...
[ "0.5930636", "0.57382226", "0.5727505", "0.5642756", "0.5642053", "0.56048656", "0.55941564", "0.5573798", "0.5573516", "0.55725354", "0.5537394", "0.5473357", "0.5447961", "0.5375135", "0.5370509", "0.53426796", "0.5300786", "0.5299057", "0.5298297", "0.52878845", "0.5287061...
0.0
-1
ACK10 Id: 234 Name: Product/Service ID Type: AN Min/Max: 1/48 Description: Identifying number for a product or service
def ACK10=(arg)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_service_msg_number\n 1002\n end", "def default_service_msg_number\n \"0002\"\n end", "def get_serial_number(data)\n data['product']['serial_number'] || 'n/a'\n end", "def service_payee_identification\n code, qual = nil, nil\n claim = eob.claim_information...
[ "0.59463835", "0.57325035", "0.544988", "0.54101753", "0.5391643", "0.5390331", "0.5362745", "0.53425485", "0.5288533", "0.5267563", "0.52146196", "0.51571774", "0.5150533", "0.51503986", "0.5136635", "0.5098059", "0.50921005", "0.5071283", "0.50500387", "0.50330955", "0.5031...
0.0
-1
Triggered by Group callbacks
def add_user_member(user, group) ids = users_by_group_id(group.id).push(user).map(&:id) current_ids = users_by_group_id(group.id).map(&:id) create_member(ids, current_ids, 'User', inherited_by: group.id, destroy: false) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_update_group\n\n controller = PublicActivity.get_controller\n\n # Return if seeding or nothing changes\n return if !controller || self.changed.blank?\n\n current_user = PublicActivity.get_controller.current_user\n\n self.create_activity :update, owner: current_user,organization_id: self.or...
[ "0.69475347", "0.6751781", "0.66889435", "0.6669486", "0.65381587", "0.646725", "0.6465422", "0.64219606", "0.62591434", "0.62356716", "0.6233789", "0.6233789", "0.6233789", "0.61967", "0.61446214", "0.6142359", "0.6110487", "0.6087711", "0.6086199", "0.6067021", "0.6029804",...
0.0
-1
Returns linking params for a specified +page_number+. The returned Hash is intended for use with +link_to+, +url_for+, etc.
def params_for_page(page_number) { controller: controller, action: action, params: query_params.merge( Foliate.config.page_param => (page_number if page_number > 1) ) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_to_page(page_number)\n q = Rack::Utils.parse_query(request.query_string)\n q['page'] = page_number\n query_string = Rack::Utils.build_query(q)\n { 'href' => \"#{request.path}?#{query_string}\" }\n end", "def pagination_params(page)\n # TODO: include sort params\n ...
[ "0.72023064", "0.6036921", "0.5969339", "0.5950147", "0.59397346", "0.58530027", "0.58235127", "0.5805302", "0.57417786", "0.569462", "0.5633448", "0.5611987", "0.5611987", "0.5575739", "0.55337757", "0.5467556", "0.5466564", "0.53366023", "0.5324554", "0.53241247", "0.528546...
0.71736586
1
Indicates if there is a page expected before the current page.
def prev? current_page > 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prev_page?\n page_number > first_page_number\n end", "def has_previous_page?\n @current_page != 1\n end", "def has_previous_page\n if last\n paged_nodes.length >= last\n else\n false\n end\n end", "def previous_page?\n page > 1\n end", ...
[ "0.74566734", "0.7410143", "0.7139342", "0.7093873", "0.70392466", "0.70324326", "0.6994375", "0.6945464", "0.69131947", "0.6795923", "0.67908967", "0.67281073", "0.66923183", "0.6682758", "0.6645045", "0.6589202", "0.6589202", "0.6589202", "0.6589202", "0.6573795", "0.657379...
0.7025491
6
Indicates if there is a page expected after the current page.
def next? current_page < total_pages end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_page?\n return true\n # hack to remove this call so we don't do any counting\n #current_page >= total_pages\n end", "def next_page?\n page_number < last_page_number\n end", "def last_page?\n !next_page_url\n end", "def last_page?\n return true if total_pages < ...
[ "0.7279935", "0.7204565", "0.71954507", "0.71824455", "0.71665156", "0.71585774", "0.7155386", "0.7152426", "0.7134372", "0.7065591", "0.7051688", "0.70505506", "0.7032502", "0.7023006", "0.7020634", "0.70202196", "0.70202196", "0.70174813", "0.70095366", "0.6986155", "0.6973...
0.68062925
30
Path to the view partial. This method exists to allow +Pagination+ objects to be passed directly to +render+ calls in the view.
def to_partial_path "pagination" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_partial_path\n self.class._to_partial_path\n end", "def to_partial_path\n self.class._to_partial_path\n end", "def set_partial_path\n @partial_path = params[:partial_path]\n end", "def to_partial_path\n \"/fields/belongs_to/#{page}\"\n end", "def to_partial_path\n \"...
[ "0.7239226", "0.7102923", "0.6909864", "0.6883244", "0.6808162", "0.67922246", "0.67852366", "0.6759466", "0.67230576", "0.6609029", "0.65802264", "0.65341324", "0.64742404", "0.64742404", "0.63011765", "0.62252325", "0.6155496", "0.6140437", "0.6140437", "0.61348027", "0.608...
0.7642336
0
a [0, 1, 0, 3, 12] r a [1, 0, 0, 3, 12] r a [1, 0, 0, 3, 12] r a [1, 3, 0, 0, 12] r a [1, 3, 12, 0, 0] r > length so break let anchor = 0 let runner = 1 while runner < array.length // if anchor value = 0 & runner value = 0 // move runner forward if runner value != 0 swap values and incremenet both anchor value isn't 0 push them both forward
def move_zeroes(nums) a = 0 r = 1 while r < nums.length if nums[a] == 0 if nums[r] != 0 nums[a], nums[r] = nums[r], nums[a] else r += 1 next end end a += 1 r += 1 end return nums end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def arrayChange(a)\n total = 0\n a.each_with_index do |v, i|\n next if i == 0 \n if(v <= a [i-1]) \n total += (a[i-1] + 1) - a[i]\n a[i] = a[i-1] + 1\n end\n end\n total\nend", "def lAS(n: 0)\n array = [1]\n puts \"#{array.inspect}\"\n previous = array.fi...
[ "0.66889143", "0.661509", "0.6571891", "0.65650797", "0.651446", "0.6492954", "0.6449491", "0.6388994", "0.6383238", "0.63700044", "0.63621944", "0.63609236", "0.632027", "0.6316491", "0.63137066", "0.63135296", "0.63039297", "0.6291633", "0.62479186", "0.6243802", "0.6238597...
0.6482195
6
GET /docker_instances GET /docker_instances.json
def index @docker_instances = DockerInstance.all @docker_instance = DockerInstance.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instances\n instances = []\n JSON.parse(resource['/instances'].get)[\"instances\"].each do |i|\n instances << Instance.new(i)\n end\n return instances\n end", "def get_docker_instance_list(options)\n message = \"Information:\\tListing docker images\"\n command = \"docker ps\"\n outpu...
[ "0.7425574", "0.7313987", "0.72997725", "0.6924347", "0.6922358", "0.6885139", "0.6794389", "0.6633275", "0.66304946", "0.651521", "0.6483365", "0.64713603", "0.6466137", "0.6465683", "0.644895", "0.6391875", "0.6333607", "0.63240856", "0.62963235", "0.6283747", "0.6277314", ...
0.70174915
3
GET /docker_instances/1 GET /docker_instances/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @docker_instances = DockerInstance.all\n @docker_instance = DockerInstance.new\n end", "def get_docker_instance_list(options)\n message = \"Information:\\tListing docker images\"\n command = \"docker ps\"\n output = execute_command(options,message,command)\n instances = output.split...
[ "0.7129193", "0.698261", "0.6781233", "0.6536462", "0.64651084", "0.6353131", "0.62947845", "0.62450594", "0.62361497", "0.6226456", "0.6218825", "0.61803246", "0.6174355", "0.61647004", "0.61521846", "0.61426276", "0.6120157", "0.6094671", "0.60613567", "0.6038533", "0.60223...
0.0
-1
POST /docker_instances POST /docker_instances.json
def create @docker_instance = DockerInstance.new(docker_instance_params) @docker_instance.creating! respond_to do |format| if @docker_instance.save format.js else format.html { render :new } format.json { render json: @docker_instance.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_instances(num_vms, opts, roles, disks)\n # Make a copy (the options are a simple hash so shallow copy does the\n # trick) to not modify the original.\n options = opts.clone\n options['num_vms'] = num_vms.to_s\n\n uri = URI(\"http://#{@ip}:#{SERVER_PORT}/instances\")\n headers = {'Content-...
[ "0.66692275", "0.62857574", "0.6244871", "0.6199069", "0.6053712", "0.6033599", "0.5999574", "0.5984011", "0.5884817", "0.5844355", "0.5842025", "0.57820374", "0.57688624", "0.5767724", "0.57607335", "0.575", "0.57462853", "0.57270616", "0.5682304", "0.5658339", "0.55079955",...
0.6829213
0
PATCH/PUT /docker_instances/1 PATCH/PUT /docker_instances/1.json
def update respond_to do |format| if @docker_instance.update(docker_instance_params) format.html { redirect_to @docker_instance, notice: 'Docker instance was successfully updated.' } format.json { render :show, status: :ok, location: @docker_instance } else format.html { render :edit } format.json { render json: @docker_instance.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update!(**args)\n @instances = args[:instances] if args.key?(:instances)\n end", "def set_docker_instance\n @docker_instance = DockerInstance.find(params[:id])\n end", "def update!(**args)\n @instances = args[:instances] if args.key?(:instances)\n @parameters = arg...
[ "0.5964702", "0.58961076", "0.5888172", "0.58842486", "0.5882556", "0.57575846", "0.57229674", "0.5715818", "0.56957597", "0.56505954", "0.5632361", "0.55824476", "0.5564999", "0.55546474", "0.5550443", "0.55327386", "0.5493891", "0.54817617", "0.54778326", "0.5461803", "0.54...
0.7074607
0
DELETE /docker_instances/1 DELETE /docker_instances/1.json
def destroy @docker_instance.destroy respond_to do |format| format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @docker_cfg.destroy\n respond_to do |format|\n format.html { redirect_to docker_cfgs_url, notice: 'Docker cfg was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n response = get_request(URI.parse(\"http://\"+(sesh :donabe_ip)+\"/\"+(s...
[ "0.68750197", "0.68050814", "0.67170155", "0.66775703", "0.66538495", "0.66162044", "0.65888125", "0.6586511", "0.65755445", "0.6561942", "0.6534104", "0.6531095", "0.64382535", "0.64339375", "0.63985187", "0.63976926", "0.63849646", "0.63735545", "0.6371583", "0.6343241", "0...
0.8178466
0
Use callbacks to share common setup or constraints between actions.
def set_docker_instance @docker_instance = DockerInstance.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 docker_instance_params params.require(:docker_instance).permit(:name, :branch) 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
get every test to pass before coding runner below
def runner welcome card_sum = 0 card_sum += initial_round until card_sum > 21 card_sum = hit?(card_sum) display_card_total(card_sum) end end_game(card_sum) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_tests\n puts \"Running exactly #{@spec.size} tests.\"\n @spec.each do |test_case|\n sleep test_case.wait_before_request\n response = send_request_for(test_case)\n Checker.available_plugins.each do |plugin|\n result = @expectation.check(plugin, response, test_case)\n if no...
[ "0.7273319", "0.7200172", "0.7192304", "0.7132192", "0.71287894", "0.7034781", "0.68627185", "0.682233", "0.6806946", "0.67918724", "0.67918724", "0.67662716", "0.6571297", "0.65539306", "0.6548272", "0.6544406", "0.6529377", "0.6458632", "0.6448801", "0.6448801", "0.644239",...
0.0
-1
ActiveRecord::Blob class first destroy the record data and then calls the service.delete method with key as an argument. But the imagekit.io needs fileId to destroy the file which can be get from the metadata. So first destroy the remote file and then destroy the local blob record.
def remove_imagekit_file service.class.delete_ik_file(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy!\r\n self.class.service_instance.delete_blob(path)\r\n end", "def delete\n @service.delete_blob(self)\n end", "def destroy\n Rails.logger.debug {\"destroying gridfs file #{@id}\"}\n if persisted?\n Photo.mongo_client.database.fs.find(:_id=>BSON::ObjectId.from_stri...
[ "0.7767731", "0.7396194", "0.7236817", "0.69665974", "0.69524175", "0.6906084", "0.69053084", "0.69009584", "0.6822038", "0.66167414", "0.65783256", "0.6578069", "0.65346766", "0.65346766", "0.65309423", "0.6524279", "0.64868706", "0.6481013", "0.64683735", "0.6445531", "0.64...
0.6002151
98
Needs to reload the record to reflect updated remote meta data.
def check_metadata self.reload end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload!\n if new_meta = job_class.get_meta(meta_id)\n @data = new_meta.data\n end\n self\n end", "def reload\n return if new_record?\n refresh\n end", "def _save_refresh\n _save_set_values(_refresh_get(this.server?(:default)) || raise(NoExist...
[ "0.66971016", "0.66257024", "0.6438894", "0.6438894", "0.64217144", "0.64216363", "0.64216363", "0.63113016", "0.62837213", "0.6242441", "0.6206165", "0.6195001", "0.6195001", "0.61815614", "0.60881513", "0.60564905", "0.60564905", "0.604486", "0.60441405", "0.6034743", "0.60...
0.67446625
0
A full attribute hash, used by the SDK for writing. This is in an annoyingly different format than that which is returned by the SDK when getting an item.
def dynamo_attribute_from_value(attr_val) # { dynamo_attribute_key => { dynamo_attribute_value_type_key => convert_to_dynamo_value(attr_val) }} unless attr_val.nil? { dynamo_attribute_key => convert_to_dynamo_value(attr_val)} unless attr_val.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attr_hash\n Digest::MD5.hexdigest(\"#{@name}:#{@ruby_type}\")\n end", "def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end", "def hash\n attributes.hash\n end", "def hash\n attributes.hash\n end", "def hash\n ...
[ "0.70676976", "0.6741792", "0.6686655", "0.6686655", "0.6686655", "0.6560281", "0.6511229", "0.64984924", "0.6414638", "0.6406996", "0.6319517", "0.6319517", "0.6224321", "0.6178939", "0.6167137", "0.61554897", "0.6122845", "0.6121333", "0.60823137", "0.6044015", "0.60311973"...
0.0
-1
DynamoDB's Ruby uses lowercase symbols (:n, :s, :b ...) for attribute values, but uses uppercase strings as keys for attribute definitions. Override this in the AttributeTypeHandler subclass for types which cannot be keys, in which case this should return nil.
def dynamo_attribute_definition_type dynamo_attribute_value_type_key.to_s.upcase end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attributes\n super.map { |k, v| [ k.to_s.camelize(:lower).to_sym, v ] }.to_h\n end", "def normalize_keys\n transform_keys { |key| key.downcase.to_sym rescue key }\n end", "def normalize_key(key)\n key_mapping[EnumType.comparable(key)] || key.to_sym\n end", "def key(*args)\n key = super ...
[ "0.65496284", "0.65174466", "0.63750446", "0.6283036", "0.6274528", "0.6253914", "0.6240106", "0.61326027", "0.6115173", "0.60837656", "0.60150737", "0.600186", "0.59969056", "0.5993615", "0.59907967", "0.5965298", "0.5951801", "0.5927734", "0.59234035", "0.5907286", "0.58967...
0.66301763
0
Override this to produce a value suitable for storing in dynamo. This is the place to do type conversions.
def convert_to_dynamo_value(object_value); object_value; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_object_value(dynamo_value); dynamo_value; end", "def value\n to_type(@value)\n end", "def value\n @casted_value ||= type_cast_value(@value)\n end", "def typecast(value)\n value\n end", "def object_value(dynamo_data)\n dynamo_data[dynamo_attribute_key].sen...
[ "0.76428676", "0.701886", "0.6908685", "0.68884724", "0.6856077", "0.6853378", "0.67747927", "0.66775376", "0.66073084", "0.6497957", "0.6485203", "0.6456468", "0.6418363", "0.63628113", "0.63197905", "0.6308066", "0.62769896", "0.6250316", "0.6232659", "0.62255126", "0.61903...
0.76029176
1
Override this to convert a value out of dynamo back into something suitable for your application, such as deserializing, parsing, etc.
def convert_to_object_value(dynamo_value); dynamo_value; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_to_dynamo_value(object_value); object_value; end", "def cast_value\n value.mongoize\n end", "def untypecasted_value\n read_attribute(:value)\n end", "def deserialize_value(value)\r\n value\r\n end", "def convert(value) value end", "def value\n @casted_value ||= ...
[ "0.80261844", "0.70328337", "0.6952075", "0.6781407", "0.6754817", "0.67406756", "0.6658484", "0.6648005", "0.66399866", "0.656494", "0.6496792", "0.6490786", "0.6465923", "0.6462184", "0.6455521", "0.6455499", "0.64459467", "0.64368844", "0.63951504", "0.63822037", "0.636796...
0.83642954
0
Gets data out of the attribute value hash returned from the dynamo sdk
def object_value_from_dynamo_data(dynamo_record) dynamo_record[dynamo_attribute_key] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value_for_item(it)\n it.data[uuid]\n end", "def hash\n value_id.hash\n end", "def hash\n attributes.hash\n end", "def hash\n attributes.hash\n end", "def hash\n attributes.hash\n end", "def get_attribute_value(attribute)\n data[attribute]\n end", "def _read_a...
[ "0.64458394", "0.6418478", "0.6265948", "0.6265948", "0.6265948", "0.62477744", "0.62364864", "0.62346596", "0.6230348", "0.61771125", "0.6169472", "0.61675084", "0.61655", "0.6141847", "0.6132852", "0.6100489", "0.60981876", "0.6060772", "0.6060772", "0.5977261", "0.5970301"...
0.6621023
0
The string for the name of the field in dynamo
def dynamo_attribute_key @attr.dynamo_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def field_name\n @field.name\n end", "def field_name\n @gapi.field_name\n end", "def get_string_field(field_name)\n\t\tend", "def get_field_name\n\t\tend", "def field\n @field ||= quoted_field(field_name)\n end", "def field_name(ind)\n IBM_DB.field_name(@stm...
[ "0.75596917", "0.73883694", "0.7318507", "0.7192372", "0.715136", "0.69608676", "0.69309056", "0.6922584", "0.6893304", "0.68780804", "0.6867596", "0.6854278", "0.6849706", "0.6784067", "0.6774963", "0.6773497", "0.6765429", "0.67558837", "0.6750166", "0.67350596", "0.6715508...
0.7062308
5
GET /memories GET /memories.xml
def index authorize! :view_memories, current_account if can? :manage_account, current_account @memories = current_account.memories else @memories = current_account.memories.where('access=?', 'public') end order = filter_sortable_column_order %w{sort_time name} order ||= '-sort_time' @tags = @memories.tag_counts_on(:tags).sort_by(&:name) if params[:tag] @memories = @memories.tagged_with(params[:tag]) end @memories = @memories.order(order) respond_with @memories end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @memories = Memory.all\n end", "def index\n @memories = Memory.paginate(page: params[:page], per_page: 4)\n end", "def index\n @memos = Memo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @memos }\n end\n end", "def show\n ...
[ "0.7115413", "0.68196136", "0.6785562", "0.63610965", "0.633174", "0.6312043", "0.62222296", "0.6158267", "0.6106193", "0.60824776", "0.60257673", "0.6006439", "0.60056925", "0.59629506", "0.59629506", "0.59323996", "0.59323996", "0.58919036", "0.58869827", "0.58821416", "0.5...
0.68316025
1
GET /memories/1 GET /memories/1.xml
def show @memory = current_account.memories.find(params[:id]) authorize! :view, @memory respond_with @memory end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @memories = Memory.all\n end", "def index\n @memos = Memo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @memos }\n end\n end", "def show\n @memory_models = MemoryModels.find(params[:id])\n\n respond_to do |format|\n f...
[ "0.6799529", "0.6764979", "0.6593381", "0.6550932", "0.63519", "0.62966657", "0.61530864", "0.6135297", "0.6117443", "0.6069675", "0.6008877", "0.5988488", "0.59492135", "0.5942312", "0.5935805", "0.5930901", "0.5892192", "0.588354", "0.5871794", "0.5861447", "0.5849239", "...
0.63960534
4
GET /memories/new GET /memories/new.xml
def new authorize! :create, Memory @memory = current_account.memories.new @memory.access = 'public' respond_with @memory end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @memory_models = MemoryModels.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @memory_models }\n end\n end", "def new\n @memory = Memory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :jso...
[ "0.72044355", "0.6867924", "0.68360865", "0.68360865", "0.6828115", "0.6819418", "0.6804412", "0.6779119", "0.67190415", "0.6692919", "0.66653115", "0.66644466", "0.66552806", "0.6649544", "0.6642455", "0.6622863", "0.6622267", "0.66117525", "0.6605893", "0.66031224", "0.6600...
0.6976083
1
POST /memories POST /memories.xml
def create @memory = current_account.memories.new(memory_params[:memory]) authorize! :create, Memory @memory.user = current_account if @memory.save add_flash :notice, 'Memory was successfully created.' respond_with @memory, :location => params[:destination].blank? ? memories_path : params[:destination] else respond_with @memory end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @memory_models = MemoryModels.new(params[:memory_models])\n\n respond_to do |format|\n if @memory_models.save\n flash[:notice] = 'MemoryModels was successfully created.'\n format.html { redirect_to(@memory_models) }\n format.xml { render :xml => @memory_models, :status...
[ "0.6091765", "0.5966113", "0.5909013", "0.59001017", "0.5876687", "0.5805373", "0.5751909", "0.5682716", "0.5625541", "0.55786455", "0.55786043", "0.5555427", "0.55526555", "0.55523294", "0.5503384", "0.54861456", "0.54226923", "0.5407255", "0.5358719", "0.53322107", "0.53217...
0.61654025
0
PUT /memories/1 PUT /memories/1.xml
def update @memory = current_account.memories.find(params[:id]) authorize! :update, @memory params[:memory].delete(:user_id) if @memory.update_attributes(memory_params[:memory]) add_flash :notice, 'Memory was successfully updated.' respond_with @memory, :location => memories_path else respond_with @memory end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @memory = Memory.find(params[:id])\n\n respond_to do |format|\n if @memory.update_attributes(params[:memory])\n flash[:notice] = 'Memory was successfully updated.'\n format.html { redirect_to(@memory) }\n format.xml { head :ok }\n else\n format.html { rende...
[ "0.62417144", "0.5981071", "0.5956824", "0.5720279", "0.5678719", "0.56699955", "0.5663539", "0.5594048", "0.5581706", "0.5503542", "0.5426321", "0.54036367", "0.54036367", "0.54036367", "0.54036367", "0.54036367", "0.54036367", "0.54036367", "0.53663146", "0.53498006", "0.53...
0.6059317
1
DELETE /memories/1 DELETE /memories/1.xml
def destroy @memory = current_account.memories.find(params[:id]) authorize! :delete, @memory @memory.destroy respond_to do |format| format.html { go_to(memories_url) } format.any { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @memory = Memory.find(params[:id])\n @memory.destroy\n\n respond_to do |format|\n format.html { redirect_to(memories_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @tx_memory = TxMemory.find(params[:id])\n @tx_memory.destroy\n\n respond_to do |format|...
[ "0.71606076", "0.6744775", "0.6728058", "0.6698001", "0.6697423", "0.66447955", "0.62601215", "0.6259028", "0.62158287", "0.62131137", "0.619885", "0.618305", "0.61690277", "0.61683583", "0.61507", "0.61292183", "0.6107319", "0.6107319", "0.6094037", "0.60761666", "0.60410225...
0.662709
6
Write a program that prints a greeting message. This program should contain a method called greeting that takes a name as its parameter and returns a string.
def greetings(name) puts "Hello #{name.capitalize}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def greeting(name)\n puts \"Hello #{name}, welcome to the program!\"\nend", "def greeting(name)\n print \"hello \" + name + \" what the fuck is your problem?\"\nend", "def greeting(name)\n\tputs \"Hello \" + name + \". Have a nice day!\"\nend", "def greeting(name)\n\tp \"hello\" + \" \" + name\nend", ...
[ "0.8355077", "0.8237434", "0.8092483", "0.8079213", "0.8079213", "0.80635774", "0.80542254", "0.8041203", "0.803089", "0.79517186", "0.78680205", "0.7828249", "0.78250694", "0.78155804", "0.7797733", "0.77777797", "0.7766429", "0.77566206", "0.7753752", "0.77497584", "0.77065...
0.0
-1
Write a program that includes a method called multiply that takes two arguments and returns the product of the two numbers.
def multiply(num1, num2) num1 * num2 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def multiply(num1, num2)\n product = num1 * num2\n puts product\nend", "def multiply(num1,num2)\n product = num1 * num2\n puts product\nend", "def multiply(num1, num2)\n puts num1 * num2\nend", "def multiply(a, b)\n puts a*b\nend", "def multiply(num1, num2)\n num1 ** num2\nend", "def multiply(a,b)...
[ "0.85417473", "0.8510501", "0.85090566", "0.8498431", "0.84594536", "0.8457658", "0.84546375", "0.84519905", "0.84519905", "0.8451737", "0.84453964", "0.8434526", "0.8426326", "0.8421011", "0.8416704", "0.8406636", "0.84050006", "0.8400107", "0.83973855", "0.83797866", "0.837...
0.84118396
54
Relays (send or broadcast) the JSON message hash to the receiver (web socket or channel). origin_client_id is the client id of the sender of the qeemono JSON message (message). In this method the message is actually sent to the receiver. The receiver can be a web socket (aka client) or a channel. If sent to a channel the actual sending to the destination clients is done in the Ruby block passed to the EM::Channelsubscribe method which is called in Qeemono::ChannelManagersubscribe.
def relay(origin_client_id, receiver, message) relay_internal(origin_client_id, receiver, message, false) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_message(origin_client_id, message, &block)\n parse_message_internal(origin_client_id, message, false, &block)\n end", "def handle_message(event)\n sender = @users[event['sender']]\n timestamp = event['origin_server_ts'] || Time.now.to_i\n content = event['content']\n ...
[ "0.6396157", "0.5633048", "0.5466951", "0.541618", "0.5351561", "0.52735054", "0.5224363", "0.51919067", "0.51678246", "0.5089629", "0.5086707", "0.5023725", "0.49872816", "0.49752948", "0.4944641", "0.4943584", "0.49298522", "0.4894096", "0.48817024", "0.48723805", "0.486685...
0.72194684
0
Returns true if all mandatory keys are existent in the qeemono JSON message (message) and no error during parsing occurred; otherwise false is returned. Additionally, optional keys like the originator (sender) client id (:client_id), the protocol version (:version), and the sequencer id (:seq_id) are added to the qeemono JSON message if not existent. If some error occurs an exception is raised. If no error occurs the given block is executed.
def parse_message(origin_client_id, message, &block) parse_message_internal(origin_client_id, message, false, &block) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_keys?(message)\n [:sender, :sent_to, :type, :uid] - message.keys == []\n end", "def required_alert_keys?(json)\n %w[title description artifacts].all? { |key| json.key? key }\n end", "def valid?\n mandatory_keys = %w[message stacktrace]\n return false unless mandatory_key...
[ "0.6255635", "0.6224626", "0.6027533", "0.58262444", "0.56628567", "0.56574786", "0.55944353", "0.5533318", "0.5478522", "0.54676586", "0.54034764", "0.5377904", "0.5342022", "0.53010494", "0.5219694", "0.5183437", "0.5175279", "0.5167227", "0.5166309", "0.51385164", "0.51357...
0.0
-1
Return a Container Application within a container project Returns information about a specific Container Application within a project.
def get_container_application(container_application_id, opts = {}) data, _status_code, _headers = get_container_application_with_http_info(container_application_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app\n @container.app\n end", "def get_container_application_with_http_info(container_application_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiFabricContainerApplicationsApi.get_container_application ...'\n end\n #...
[ "0.6412242", "0.62636536", "0.62615454", "0.6135576", "0.5972415", "0.593051", "0.5892886", "0.5892133", "0.58571845", "0.58524406", "0.5801672", "0.5788559", "0.57761794", "0.57700455", "0.5765077", "0.5757923", "0.5710487", "0.5703222", "0.5700002", "0.56757206", "0.5663574...
0.61661774
3
Return a Container Application within a container project Returns information about a specific Container Application within a project.
def get_container_application_with_http_info(container_application_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementPlaneApiFabricContainerApplicationsApi.get_container_application ...' end # verify the required parameter 'container_application_id' is set if @api_client.config.client_side_validation && container_application_id.nil? fail ArgumentError, "Missing the required parameter 'container_application_id' when calling ManagementPlaneApiFabricContainerApplicationsApi.get_container_application" end # resource path local_var_path = '/fabric/container-applications/{container-application-id}'.sub('{' + 'container-application-id' + '}', container_application_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ContainerApplication') if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementPlaneApiFabricContainerApplicationsApi#get_container_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def app\n @container.app\n end", "def application!\n res = get!(APPLICATION_PATH)\n build_application(res)\n end", "def get_container_application(container_application_id, opts = {})\n data, _status_code, _headers = get_container_application_with_http_info(container_application_id, ...
[ "0.6413513", "0.62612426", "0.616299", "0.61356246", "0.59723204", "0.59294903", "0.58932036", "0.5892956", "0.5856151", "0.58512676", "0.5799907", "0.5785492", "0.5775512", "0.5768937", "0.57613087", "0.5756969", "0.5710843", "0.57035387", "0.56996", "0.5675529", "0.5663067"...
0.62629676
1
Return a container application instance Returns information about a specific container application instance.
def get_container_application_instance(container_application_instance_id, opts = {}) data, _status_code, _headers = get_container_application_instance_with_http_info(container_application_instance_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instance(payload)\n ApplicationInstance.new(@version, payload, account_sid: @solution[:account_sid])\n end", "def application_instance\n target\n end", "def app\n @container.app\n end", "def get_instance(payload)\n AppMa...
[ "0.69512665", "0.6897422", "0.68099475", "0.6725789", "0.6423067", "0.6388604", "0.6372137", "0.6352633", "0.62013894", "0.6196321", "0.6171778", "0.61308265", "0.6094984", "0.6048397", "0.60243315", "0.6015017", "0.6004326", "0.59988546", "0.5992356", "0.59265554", "0.591771...
0.6551504
4
Return a container application instance Returns information about a specific container application instance.
def get_container_application_instance_with_http_info(container_application_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementPlaneApiFabricContainerApplicationsApi.get_container_application_instance ...' end # verify the required parameter 'container_application_instance_id' is set if @api_client.config.client_side_validation && container_application_instance_id.nil? fail ArgumentError, "Missing the required parameter 'container_application_instance_id' when calling ManagementPlaneApiFabricContainerApplicationsApi.get_container_application_instance" end # resource path local_var_path = '/fabric/container-application-instances/{container-application-instance-id}'.sub('{' + 'container-application-instance-id' + '}', container_application_instance_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ContainerApplicationInstance') if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementPlaneApiFabricContainerApplicationsApi#get_container_application_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_instance(payload)\n ApplicationInstance.new(@version, payload, account_sid: @solution[:account_sid])\n end", "def application_instance\n target\n end", "def app\n @container.app\n end", "def get_instance(payload)\n AppMa...
[ "0.69512665", "0.6897422", "0.68099475", "0.6725789", "0.6551504", "0.6423067", "0.6388604", "0.6372137", "0.6352633", "0.62013894", "0.6196321", "0.6171778", "0.61308265", "0.6048397", "0.60243315", "0.6015017", "0.6004326", "0.59988546", "0.5992356", "0.59265554", "0.591771...
0.6094984
13
Return the list of container application instance Returns information about all container application instance.
def list_container_application_instances(opts = {}) data, _status_code, _headers = list_container_application_instances_with_http_info(opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @app_instances = AppInstance.all\n end", "def list_instances_detail()\n response = dbreq(\"GET\", dbmgmthost, \"#{dbmgmtpath}/instances/detail\", dbmgmtport, dbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n instances = CloudDB....
[ "0.70741653", "0.68802667", "0.686303", "0.6844367", "0.6828871", "0.68145436", "0.6807638", "0.6773848", "0.67506623", "0.67151296", "0.6690729", "0.6690729", "0.6588561", "0.6568741", "0.65001595", "0.6460871", "0.64605767", "0.6438094", "0.640327", "0.63563186", "0.6343829...
0.72023904
0
Return the list of container application instance Returns information about all container application instance.
def list_container_application_instances_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementPlaneApiFabricContainerApplicationsApi.list_container_application_instances ...' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementPlaneApiFabricContainerApplicationsApi.list_container_application_instances, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementPlaneApiFabricContainerApplicationsApi.list_container_application_instances, must be greater than or equal to 0.' end # resource path local_var_path = '/fabric/container-application-instances' # query parameters query_params = {} query_params[:'container_application_id'] = opts[:'container_application_id'] if !opts[:'container_application_id'].nil? query_params[:'container_cluster_id'] = opts[:'container_cluster_id'] if !opts[:'container_cluster_id'].nil? query_params[:'container_project_id'] = opts[:'container_project_id'] if !opts[:'container_project_id'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ContainerApplicationInstanceListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementPlaneApiFabricContainerApplicationsApi#list_container_application_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_container_application_instances(opts = {})\n data, _status_code, _headers = list_container_application_instances_with_http_info(opts)\n data\n end", "def index\n @app_instances = AppInstance.all\n end", "def list_instances_detail()\n response = dbreq(\"GET\", dbmgmthost, \"#{dbmg...
[ "0.7200382", "0.70771295", "0.6882792", "0.68627363", "0.6846671", "0.6831928", "0.68171144", "0.68112445", "0.6777662", "0.6752903", "0.6716031", "0.66912186", "0.66912186", "0.6590937", "0.6571754", "0.65021604", "0.6462238", "0.6461963", "0.6440176", "0.6406511", "0.635650...
0.0
-1
Return the List of Container Applications Returns information about all Container Applications.
def list_container_applications(opts = {}) data, _status_code, _headers = list_container_applications_with_http_info(opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def applications_list\n get \"applications\"\n end", "def applications\n Application.from session.get 'operations/application', API_V1\n end", "def get_applications\n http_get_request(Scalarium.applications_url)\n end", "def applications(options = {})\n @applications = api.get_ap...
[ "0.78616524", "0.7678432", "0.7557101", "0.74325347", "0.72949404", "0.72949404", "0.7161362", "0.7102965", "0.70759654", "0.70349514", "0.6901106", "0.68714505", "0.6860461", "0.67731696", "0.67603207", "0.6759043", "0.6711178", "0.6661583", "0.66463166", "0.66190475", "0.66...
0.7863949
0
Return the List of Container Applications Returns information about all Container Applications.
def list_container_applications_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ManagementPlaneApiFabricContainerApplicationsApi.list_container_applications ...' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementPlaneApiFabricContainerApplicationsApi.list_container_applications, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ManagementPlaneApiFabricContainerApplicationsApi.list_container_applications, must be greater than or equal to 0.' end # resource path local_var_path = '/fabric/container-applications' # query parameters query_params = {} query_params[:'container_cluster_id'] = opts[:'container_cluster_id'] if !opts[:'container_cluster_id'].nil? query_params[:'container_project_id'] = opts[:'container_project_id'] if !opts[:'container_project_id'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ContainerApplicationListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: ManagementPlaneApiFabricContainerApplicationsApi#list_container_applications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_container_applications(opts = {})\n data, _status_code, _headers = list_container_applications_with_http_info(opts)\n data\n end", "def applications_list\n get \"applications\"\n end", "def applications\n Application.from session.get 'operations/application', API_V1\n end"...
[ "0.7863949", "0.78616524", "0.7678432", "0.7557101", "0.74325347", "0.72949404", "0.72949404", "0.7161362", "0.7102965", "0.70759654", "0.70349514", "0.6901106", "0.68714505", "0.6860461", "0.67731696", "0.67603207", "0.6759043", "0.6711178", "0.6661583", "0.66463166", "0.661...
0.60713595
57
Marks a word as forbidden for identifiers.
def not_keyword(string) (str(string) >> identifier_match.absent?).absent? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_illegal_words(board, dict)\n new_words(board).reject {|word| dict.legal_word?(word.to_s)}\n end", "def reserved(words)\n lang_eval { @reserved = words }\n nil\n end", "def forbidden_keyword_validation\n errors.add :value, I18n.t('errors.messages.exclusion') if value =~ /...
[ "0.63714725", "0.6279902", "0.6228516", "0.6198688", "0.6157733", "0.60355353", "0.5936666", "0.5930061", "0.5857756", "0.5852166", "0.5827314", "0.581316", "0.58029705", "0.5734699", "0.56894755", "0.5661616", "0.5655303", "0.56150174", "0.55704474", "0.55484295", "0.5524326...
0.51536924
46
GET /project_developers/1 GET /project_developers/1.json
def show @project_developer = ProjectDeveloper.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @project_developer } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n if(current_user.has_role?(:developer))\n @projects = Project.joins(:developers).where(\"users.id= #{current_user.id}\")\n else\n @projects = Project.all\n end\n render json: @projects\n end", "def show\n set_surrogate_key_header \"api/platforms/#{@platform.id}/projects\"\n ...
[ "0.7242238", "0.72193015", "0.72064775", "0.71052754", "0.7093152", "0.70486575", "0.70313406", "0.70287514", "0.7005226", "0.69446915", "0.6918673", "0.6914748", "0.6888663", "0.6880406", "0.6868041", "0.6868041", "0.6868041", "0.6868041", "0.6868041", "0.6868041", "0.686804...
0.7353545
0
GET /project_developers/new GET /project_developers/new.json
def new @project_developer = ProjectDeveloper.new respond_to do |format| format.html # new.html.erb format.json { render json: @project_developer } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @project = Project.new(user_id: current_user.id)\n find_people_list\n fetch_clients\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "def new_link\n @project = Project.new(user_id: current_user.id)\n fetch_proj...
[ "0.8223063", "0.8123179", "0.81114984", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", "0.80880743", ...
0.77727586
39
POST /project_developers POST /project_developers.json
def create @project_developer = ProjectDeveloper.new(params[:project_developer]) respond_to do |format| if @project_developer.save format.html { redirect_to @project_developer, notice: 'Project developer was successfully created.' } format.json { render json: @project_developer, status: :created, location: @project_developer } else format.html { render action: "new" } format.json { render json: @project_developer.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @project = Project.new(project_params)\n @project.project_developers.new(developer_id: current_user.id, is_creator: true)\n respond_to do |format|\n if @project.save\n format.html { redirect_to add_developer_project_url(@project), notice: 'Project was successfully created.' }\n ...
[ "0.75814474", "0.68438554", "0.6755185", "0.67182094", "0.67029667", "0.6671006", "0.66655385", "0.6575432", "0.65573704", "0.6542593", "0.65305126", "0.6500427", "0.64721096", "0.6469582", "0.64685637", "0.6468156", "0.64530027", "0.64296067", "0.6428455", "0.6423522", "0.64...
0.69291526
1
PUT /project_developers/1 PUT /project_developers/1.json
def update @project_developer = ProjectDeveloper.find(params[:id]) respond_to do |format| if @project_developer.update_attributes(params[:project_developer]) format.html { redirect_to @project_developer, notice: 'Project developer was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @project_developer.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'PUT'\n\t\targs[:pattern] = '/projects/[ProjectName]'\n\t\targs[:query]['Action'] = 'UpdateProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project\n...
[ "0.69619554", "0.6888588", "0.6885766", "0.6881098", "0.6879897", "0.679647", "0.67608637", "0.6744371", "0.67327344", "0.6708739", "0.6705506", "0.66924673", "0.6686431", "0.66856587", "0.6658466", "0.66511136", "0.6643734", "0.6629499", "0.66246736", "0.6622314", "0.6613056...
0.65930057
21
DELETE /project_developers/1 DELETE /project_developers/1.json
def destroy @project_developer = ProjectDeveloper.find(params[:id]) @project_developer.destroy respond_to do |format| format.html { redirect_to project_developers_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @project = Project.find(params[:id])\n @project.delete\n\n respond_to do |format|\n format.html { redirect_to request.referer }\n format.json { head :no_conten...
[ "0.7498583", "0.7466114", "0.74535763", "0.74474853", "0.7407827", "0.7388403", "0.7384838", "0.7370378", "0.73628443", "0.73472995", "0.7332888", "0.7329687", "0.73255384", "0.73187464", "0.73150516", "0.7312549", "0.7287514", "0.7281139", "0.7276472", "0.72719777", "0.72667...
0.76469755
0
Returns a list of roles we have permission to assign
def roles_for_select Role.all.select {|role| can? :add_user, role }.sort.map {|r| [r.name.titleize, r.id] } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def roles\n # we can't use abilities as those are not defined when creating a new operator that is not yet saved\n #result = abilities.collect(&:name)\n authorizations.collect{|auth| auth.ability.try(:name)}\n end", "def roles\n # we can't use abilities as those are not defined when creati...
[ "0.7961274", "0.7961274", "0.78211755", "0.7805926", "0.777467", "0.7765346", "0.7642368", "0.7590508", "0.75558734", "0.7555324", "0.75542194", "0.75542194", "0.75542194", "0.75542194", "0.755171", "0.7516201", "0.75057757", "0.7470726", "0.74580353", "0.74580353", "0.745014...
0.7181458
40
initializes with a name, always with a balance of 1000, and always with a status of "open"
def initialize(name) @name = name @balance = 1000 @status = "open" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(name)\n @name = name\n @balance = 1000\n @status = \"open\"\n end", "def initialize(name) # takes in name for account\n @name = name # assigns instance variables\n @balance = 1000 # starting out balance\n @status = \"open\" # sets status to \"open\" when c...
[ "0.8795592", "0.8673122", "0.8481442", "0.84619963", "0.8369874", "0.7936659", "0.7903903", "0.7824567", "0.7817918", "0.7790271", "0.7772847", "0.7526974", "0.7119722", "0.7080683", "0.69818026", "0.68975455", "0.68658704", "0.68627304", "0.68241763", "0.681126", "0.67644423...
0.8772102
1
can deposit money into its account
def deposit(money) self.balance = (self.balance + money) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deposit (amount, account)\n if account == \"checking\"\n @checking_account_balance += amount\n elsif account == \"saving\"\n @saving_account_balance += amount\n else\n puts \"No account was selected\"\n end\n end", "def deposit\n end", "def deposit\n end", "def deposit(amoun...
[ "0.7813424", "0.7774127", "0.7774127", "0.75479126", "0.75432813", "0.7491637", "0.74026537", "0.7385984", "0.7365258", "0.7334569", "0.7331713", "0.7331658", "0.7331658", "0.7325905", "0.73096097", "0.73096097", "0.73096097", "0.73078656", "0.7297343", "0.729532", "0.7235098...
0.72865784
20
can display its balance
def display_balance "Your balance is $#{self.balance}." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_balance()\n puts \"Balance:$#{@balance}.\"\n returned\n end", "def show_balance\n\t\t\treturn @balance\n\t\tend", "def balance_display(balance)\n puts \"Your current balance is $#{@balance}.\"\n end", "def current_balance_display\n number_to_currency(current_balance)...
[ "0.8508467", "0.83462274", "0.81983024", "0.80116713", "0.79525816", "0.78881663", "0.7806524", "0.77841616", "0.767867", "0.7646203", "0.7646203", "0.7644793", "0.76190525", "0.7573928", "0.75675935", "0.755066", "0.7517488", "0.7513542", "0.7494483", "0.7490018", "0.7489263...
0.7590332
13
is valid with open status and a balance greater than 0
def valid? if status != "open" || balance == 0 false else true end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid?\n balance > 0 && status == \"open\"\n end", "def valid?\n @status == 'open' && @balance > 0\n end", "def valid? \n balance > 0 && status == 'open'\n end", "def valid?\n @balance > 0 && @status == \"open\"\n end", "def valid?\n @status == \"open\" && @balance > 0 \n...
[ "0.8760936", "0.8736063", "0.87166816", "0.862196", "0.85786635", "0.83929384", "0.8107673", "0.725797", "0.66484445", "0.6616169", "0.66124284", "0.65710354", "0.6539395", "0.6496315", "0.64564383", "0.64217", "0.64134145", "0.6409339", "0.63671815", "0.6355064", "0.6349653"...
0.84753686
5
can close its account
def close_account self.status = "closed" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def close_account\n self.status = \"closed\"\n end", "def close_account\n @status = 'closed'\n end", "def close_account\n @status = \"closed\"\n end", "def close_account \n @status = \"closed\" \n end", "def close_account\n self.void_pending_authorizations\n if probono = Organ...
[ "0.7792949", "0.7652441", "0.7563503", "0.722757", "0.7101658", "0.6441255", "0.6397707", "0.63665074", "0.63282776", "0.6236617", "0.621774", "0.6130505", "0.59812987", "0.59445584", "0.58914953", "0.5889675", "0.58874696", "0.58824694", "0.586955", "0.58655894", "0.5863964"...
0.7382381
3
GET /traded_contacts/1 GET /traded_contacts/1.json
def show @traded_contact = TradedContact.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @traded_contact } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contacts\n respond_with_entity(api.get('/api/v1/profile/contacts'),\n NexaasID::Entities::Profile::Contacts)\n end", "def new\n @traded_contact = TradedContact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @traded_contact }...
[ "0.6873559", "0.68089205", "0.68003875", "0.6777273", "0.67317975", "0.6606174", "0.660239", "0.6568577", "0.64534885", "0.64042234", "0.63922286", "0.63890934", "0.63555866", "0.63540447", "0.63411003", "0.6333284", "0.6324839", "0.6310962", "0.6310599", "0.63015854", "0.629...
0.73813266
0
GET /traded_contacts/new GET /traded_contacts/new.json
def new @traded_contact = TradedContact.new respond_to do |format| format.html # new.html.erb format.json { render json: @traded_contact } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n\t\t\t\t# we are going to make a new contact yall\n\t\t\t\t# comes in like post\n\t\t\t\t# {'api_token': ..., 'contact': {}}\n\t\t\t\tcontact_params = params[:contact] # be sure to clean all the values\n\t\t\t\t# clean them up\n\t\t\t\tcontact_params = sanitize_obj(contact_params);\n\t\t\t\t# lets allow r...
[ "0.76800346", "0.7492992", "0.74658173", "0.74141914", "0.7252208", "0.7105118", "0.70777303", "0.70777303", "0.70777303", "0.70354754", "0.70173347", "0.7013792", "0.69985336", "0.6941247", "0.6923718", "0.69222015", "0.6877605", "0.6845283", "0.6845169", "0.6836063", "0.683...
0.80314195
0
POST /traded_contacts POST /traded_contacts.json
def create @traded_contact = TradedContact.new(params[:traded_contact]) respond_to do |format| if @traded_contact.save format.html { redirect_to @traded_contact, notice: 'Traded contact was successfully created.' } format.json { render json: @traded_contact, status: :created, location: @traded_contact } else format.html { render action: "new" } format.json { render json: @traded_contact.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @traded_contact = TradedContact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @traded_contact }\n end\n end", "def create_list\n # First delete all current contacts for this user (no overlapping contacts)\n Contact.delete_all(\"user_i...
[ "0.6605225", "0.63128066", "0.6236456", "0.62179726", "0.6161837", "0.6120184", "0.6045358", "0.604509", "0.5956315", "0.59332", "0.5925741", "0.5923131", "0.58933395", "0.589315", "0.5890042", "0.5871507", "0.58490944", "0.5805748", "0.57989794", "0.5794468", "0.579427", "...
0.7248378
0
PUT /traded_contacts/1 PUT /traded_contacts/1.json
def update @traded_contact = TradedContact.find(params[:id]) respond_to do |format| if @traded_contact.update_attributes(params[:traded_contact]) format.html { redirect_to @traded_contact, notice: 'Traded contact was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @traded_contact.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_contacts(contacts)\n b = Builder::XmlMarkup.new\n request_xml = b.Contacts {\n contacts.each do | contact |\n contact.to_xml(b)\n end\n }\n\n response_xml = http_post(@client, \"#{@xero_url}/Contacts\", request_xml, {})\n\n response = parse_response(respon...
[ "0.64655876", "0.63682073", "0.62679166", "0.6263075", "0.615947", "0.60822165", "0.606527", "0.60127795", "0.5910292", "0.59077436", "0.58503604", "0.584946", "0.58452976", "0.5835972", "0.5797832", "0.5797656", "0.5741505", "0.57066053", "0.57032037", "0.5684102", "0.565338...
0.7031796
0
DELETE /traded_contacts/1 DELETE /traded_contacts/1.json
def destroy @traded_contact = TradedContact.find(params[:id]) @traded_contact.destroy respond_to do |format| format.html { redirect_to traded_contacts_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(contactname)\n\n end", "def destroy\n Conshejointable.where(:contact_id =>@contact.id).delete_all\n Description.where(:contact_id =>@contact.id).delete_all\n puts @contact.id.to_s + \": \" + @contact.name\n @contact.delete\n respond_to do |format|\n format.html { redirect_to conta...
[ "0.73942363", "0.7232646", "0.70827925", "0.70704037", "0.70154643", "0.7007486", "0.6965657", "0.6905969", "0.68942845", "0.68882906", "0.68840176", "0.68840176", "0.68840176", "0.6853569", "0.68421364", "0.68375385", "0.68375385", "0.68368655", "0.6833954", "0.6826107", "0....
0.7745995
0
Channels brakes Borsa Italiana
def filter_overResistanceBorsaItaliana @overResistanceStocksBorsaItaliana = @@SJA.select("stocks.isin, name, last_price, borsa_italiana_resistance").where("borsa_italiana_resistance > 0 AND last_price > borsa_italiana_resistance").order(:name) render json: @overResistanceStocksBorsaItaliana end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channels; end", "def cable; end", "def witcher; end", "def channels\n []\n end", "def circuit_breaker; end", "def each_channel(&block); end", "def pitch_bend( channel, value )\n message( PB | channel, value )\n end", "def part_all()\n @channels.clear()\n end", "def bury\n ...
[ "0.7051922", "0.59848416", "0.5977472", "0.59599334", "0.5805278", "0.57999384", "0.57564306", "0.5719745", "0.56589764", "0.5593077", "0.55754435", "0.5569902", "0.55639875", "0.5554487", "0.5501904", "0.54837495", "0.5480029", "0.54775393", "0.5442823", "0.54199713", "0.539...
0.0
-1
Channels brakes Sole 24 Ore
def filter_overResistanceSoleXXIVOre @overResistanceStocksSolexxivore = @@SJA.select("stocks.isin, name, last_price, xxivore_resistance").where("xxivore_resistance > 0 AND last_price > xxivore_resistance").order(:name) render json: @overResistanceStocksSolexxivore end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def channels; end", "def channels\n []\n end", "def part_all()\n @channels.clear()\n end", "def channelDown\n\t\t@previousChannel = @currentChannel\n\t\tif @currentChannel == @config.lowestChannel \n\t\t\t@currentChannel = @config.highestChannel\n\t\t\tlogStatus @previousChannel, @currentChannel\...
[ "0.6845944", "0.59654546", "0.5938828", "0.5851249", "0.57966876", "0.5750821", "0.5725818", "0.57128656", "0.567642", "0.5645508", "0.5607094", "0.5595669", "0.5593223", "0.55656266", "0.55279404", "0.5503553", "0.5502866", "0.54866606", "0.54770243", "0.5452569", "0.5437113...
0.0
-1
Suggestions Sole 24 Ore
def filter_suggestionsSoleXXIVOre @suggestionsFromSole24Ore = @@SJA.select("stocks.isin, name, last_price, xxivore_shorttrend, xxivore_ftaindex, xxivore_rsi").where("xxivore_shorttrend = ? AND xxivore_ftaindex > ? AND xxivore_rsi > ?", "molto rialzista", 50, 75).order(:name) render json: @suggestionsFromSole24Ore end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def findorsuggest()\n \n end", "def sanitize text\n SANITIZE_THIS.each { |s| text = text.gsub(/#{s}/,'') }\n\n #római számok kiegészítés\n text = text.gsub(/\\W*(#{ROMAISZAMOK.keys.join('|')})\\.\\W*(\\w+)/) do \n ROMAISZAMOK[$1] ? ( ROMAISZAMOK[$1] + ' ' + $2 ) : $&\n end\n \n #századok\n text = ...
[ "0.60147995", "0.56466407", "0.56322396", "0.549939", "0.5470212", "0.54232776", "0.5340587", "0.5327706", "0.53213376", "0.531095", "0.5303589", "0.52974606", "0.52776086", "0.52680314", "0.5264563", "0.5239856", "0.5234957", "0.5220638", "0.52076626", "0.51983064", "0.51848...
0.5261307
15
Suggestions Investing Dot Com
def filter_suggestionsInvestingDotCom @suggestionsFromInvestingDotCom = @@SJA.select("stocks.isin, name, last_price, investing_dotcomrating").where("investing_dotcomrating = ?", true).order(:name) render json: @suggestionsFromInvestingDotCom end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scan_for_dots(token); end", "def lex_en_leading_dot; end", "def lex_en_leading_dot; end", "def lex_en_leading_dot; end", "def dottify\n self.gsub(/[^[:print:]]/, \".\")\n end", "def handle_agent_corporate_punctuation(name_fields)\n name_fields.sort! {|a, b| a[0][0] <=> b[0][0]}\n\n # The va...
[ "0.6595069", "0.60781986", "0.60781986", "0.60781986", "0.5987779", "0.5914746", "0.58901894", "0.5822822", "0.5822822", "0.5822822", "0.58210534", "0.58011115", "0.5774837", "0.57570976", "0.5734523", "0.568982", "0.5641017", "0.5578494", "0.5577055", "0.553349", "0.5516518"...
0.0
-1
Filter based on Studies
def filter_overResistanceStocksOnStudy @overResistanceStocksOnStudy = @@SJS.select("isin, name, last_price, resistance").where("last_price > resistance").order(:updated_at).reverse render json: @overResistanceStocksOnStudy end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def related_studies\n _studies = []\n under_supervision_studies.each do |study|\n unless _studies.include?(study)\n _studies.append(study)\n end\n end\n studies.each do |study|\n unless _studies.include?(study)\n _studies.append(study)\n end\n end\n return _studi...
[ "0.65235084", "0.64073277", "0.61655235", "0.61655235", "0.61435187", "0.6138783", "0.6130579", "0.60794574", "0.60365516", "0.5985732", "0.5949009", "0.5949009", "0.5949009", "0.5881404", "0.5849883", "0.5837846", "0.5763468", "0.5758133", "0.5749137", "0.57466376", "0.57370...
0.54922175
44