query
stringlengths
7
6.41k
document
stringlengths
12
28.8k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Adds a subscription for the user to the given topic
def subscribe_to(topic) StreamUser.create(:user => self, :stream_message => topic.stream_messages.last, :source => 'followed') if topic.stream_messages.last subscriptions << Subscription.new(:topic => topic) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscribe!(topic)\n subscriptions.create!( :topic_id => topic.id )\n end", "def subscribe_to_topic(tokens, topic)\n make_topic_mgmt_request(tokens, topic, \"batchAdd\")\n end", "def subscribe_author\n self.subscriptions.create user_id: self.user.id\n end", "def subscribe(_topic, *...
[ "0.81512696", "0.7070888", "0.7040874", "0.70373267", "0.67486745", "0.66825444", "0.663919", "0.6626898", "0.6621064", "0.66059786", "0.6599181", "0.6571987", "0.65571517", "0.6556943", "0.65291584", "0.64855635", "0.6478466", "0.645491", "0.64543647", "0.6447197", "0.638413...
0.8117725
1
Removes subscriptions for this user to the given topic
def unsubscribe_from(topic) subscriptions.find_by_topic_id(topic.id).try(:destroy) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsubscribe_from_topic(tokens, topic)\n make_topic_mgmt_request(tokens, topic, \"batchRemove\")\n end", "def destroy\n topic = Topic.find params[:id]\n user_topic = current_user.user_topics.find_by!(topic_id: topic.id)\n user_topic.destroy\n\n respond_to do |format|\n ...
[ "0.78070605", "0.7528983", "0.7261029", "0.69946027", "0.6703463", "0.66892874", "0.65922135", "0.6569172", "0.65643096", "0.6481982", "0.641013", "0.6405847", "0.6399709", "0.63749194", "0.6328091", "0.6282876", "0.6281427", "0.62758833", "0.62713367", "0.6254413", "0.623343...
0.82400113
0
Finds subscription to the given topic
def subscription_for(topic) subscriptions.where(:topic_id => topic.id).first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_topic(topic)\n @subscription_group.topics.find(topic) || raise(Errors::TopicNotFoundError, topic)\n end", "def find_topic\n @topic = current_user.topics.find(params[:topic_id])\n end", "def find_topic\n @topic = current_user.topics.find(params[:topic_id])\n end", "def subscribe!(...
[ "0.7928342", "0.7137102", "0.7137102", "0.70296943", "0.7007277", "0.6946221", "0.69441426", "0.68553925", "0.67524695", "0.6596232", "0.6556846", "0.65511703", "0.6510501", "0.6493501", "0.64616305", "0.6346345", "0.6336999", "0.6325711", "0.63208884", "0.63087606", "0.62803...
0.83120275
0
if a user is destroyed change the ownership of its topics to admin
def change_topics_owner self.topics.each do |topic| topic.user = User.where(:is_admin => true).first topic.save! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n# @topic = current_user.topics.find(params[:id])\n @topic = Topic.find(params[:id])\n\n if @topic.owner != current_user\n flash[:notice] = \"You are not OWNER. No Permission!\"\n redirect_to topics_path\n else\n @topic.destroy\n respond_to do |format|\n format.ht...
[ "0.7436648", "0.6806079", "0.6798248", "0.6742251", "0.66281784", "0.6439939", "0.6408619", "0.6371251", "0.63659513", "0.6353874", "0.6349523", "0.6303384", "0.62920004", "0.628072", "0.62624013", "0.6248637", "0.6245208", "0.6244804", "0.6215825", "0.6210043", "0.6186702", ...
0.71738094
1
send notification to participate in a topic
def notify_about_topic!(topic) with_user_locale do UserMailer.topic_match_notification(self, topic).deliver! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topic(channel, str)\n sendmsg \"TOPIC #{channel} :#{str}\"\n end", "def topic(chan, topic)\n sep = $config['plugins/topic/separator', '|']\n chan.server.cmd('TOPIC', chan.name, topic.join(\" #{sep} \"))\n end", "def topic(channel, topic = nil)\n topic = \":#{topic}\" if topic\n send_ms...
[ "0.699971", "0.66226083", "0.6611411", "0.65195584", "0.6487083", "0.6380094", "0.6282782", "0.62392765", "0.6177437", "0.61726207", "0.6136041", "0.61165684", "0.6105603", "0.60867095", "0.60844904", "0.6061362", "0.60434234", "0.60432816", "0.603741", "0.60295355", "0.60226...
0.6643092
1
sends notification for sign up confirmation
def notify_sign_up_confirmation! UserMailer.sign_up_confirmation(self).deliver! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_signup_notification\n deliver_activation_email(:signup, :subject => (MaSA[:activation_subject] || \"Please Activate Your Account\") )\n end", "def signup_email\n MnoEnterprise::SystemNotificationMailer.registration_instructions(params.require(:user).require(:email)).deliver_late...
[ "0.8001082", "0.7680669", "0.75045353", "0.750069", "0.74309945", "0.74296886", "0.7428404", "0.7413921", "0.7397638", "0.7385989", "0.73800105", "0.7302603", "0.724891", "0.72397524", "0.7225533", "0.71696067", "0.71642977", "0.71474373", "0.7144565", "0.71250105", "0.712501...
0.7901955
1
Resets single access token for user
def reset_single_access_token! update_attribute(:single_access_token, User.encrypt_token(Time.now.to_i, "password reset--")) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset\n session.delete(:access_token)\n session.delete(:refresh_token)\n redirect('/auth/gowalla')\n end", "def reset_auth_token!\n reset_auth_token\n save(:validate => false)\n end", "def reset_token\r\n authentication_token true\r\n end", "def reset_authentication_token!\n ...
[ "0.7779253", "0.7520163", "0.7363187", "0.73345065", "0.7310071", "0.728621", "0.72823536", "0.7277697", "0.72747725", "0.7239439", "0.72380817", "0.72291934", "0.7217942", "0.7217228", "0.7105236", "0.70980066", "0.70633", "0.7039718", "0.69984984", "0.6968136", "0.69253993"...
0.8090825
0
Scopes a block to the user's profile locale
def with_user_locale raise "No block given" unless block_given? begin tmp_locale = I18n.locale I18n.locale = profile.language yield ensure I18n.locale = tmp_locale end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def locale(locale, &block)\n scope :locale => locale, &block\n end", "def l_scope(*sections, &block)\r\n ArkanisDevelopment::SimpleLocalization::Language.with_app_scope(*sections, &block)\r\n end", "def scope(&block)\n Videojuicer.enter_scope local_config\n block_out = block.call(Vide...
[ "0.6205569", "0.57523596", "0.5596278", "0.5557078", "0.5486455", "0.53251946", "0.52780575", "0.52779925", "0.52670324", "0.52548236", "0.5240761", "0.5231338", "0.5229526", "0.52157927", "0.5202352", "0.5182616", "0.5159665", "0.51307464", "0.5128995", "0.51274276", "0.5125...
0.58253735
1
Checks if the type of the field is `NULLABLE`.
def nullable? mode == "NULLABLE" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def null?(field_info, field)\n field_info[\"notnull\"] == 1 && self.send(field).blank?\n end", "def nullable?\n @nullable\n end", "def nullable?\n @nullable\n end", "def nullable?\n @nullable\n end", "def null?(record)\n type.nullable? && record[:header][:field_nulls][positi...
[ "0.7116849", "0.7033838", "0.7033838", "0.7033838", "0.6741239", "0.67272633", "0.65234756", "0.64722276", "0.6397258", "0.6397258", "0.6327046", "0.6263092", "0.6189515", "0.60874486", "0.60874486", "0.6068387", "0.60558814", "0.60558814", "0.60491836", "0.6020958", "0.59833...
0.7666801
0
Checks if the type of the field is `REPEATED`.
def repeated? mode == "REPEATED" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def must_recreate\n @args[:___recreate___]\n end", "def validate_task(task, instance, options)\n return true unless options[:task] == \"retire_now\" && instance.retired?\n task.error(\"#{instance.name} is already retired\")\n false\n end", "def temporary?\n !new_record? && valid_un...
[ "0.56279904", "0.55290604", "0.5352991", "0.5344293", "0.5280932", "0.51619273", "0.51452637", "0.5143574", "0.51344734", "0.51068354", "0.5084741", "0.5069809", "0.50224143", "0.5022201", "0.4972323", "0.4969593", "0.49602592", "0.49500215", "0.49348223", "0.4924736", "0.491...
0.6251948
0
Updates the description of the field.
def description= new_description @gapi.update! description: new_description end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(description) # :nodoc:\n @description = description\n self\n end", "def update(description) # :nodoc:\n @description = description\n self\n end", "def description=(value)\n @description = value\n end", "def description=(value)\n ...
[ "0.7363507", "0.7363507", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", ...
0.76463753
0
Updates the mode of the field.
def mode= new_mode @gapi.update! mode: verify_mode(new_mode) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mode=(new_mode)\n handle_old_mode\n @mode = new_mode\n handle_new_mode\n end", "def set_mode(new)\n @mode = new\n end", "def set_Mode(value)\n set_input(\"Mode\", value)\n end", "def set_Mode(value)\n set_input(\"Mode\", value)\n end", "def set_...
[ "0.74436414", "0.7338009", "0.72996503", "0.72996503", "0.72854596", "0.71889395", "0.71225977", "0.71225977", "0.6927123", "0.68225056", "0.6785598", "0.6779125", "0.67547053", "0.6741139", "0.6693237", "0.66868323", "0.6656586", "0.6616257", "0.66143656", "0.6610173", "0.64...
0.7462092
0
The policy tag list for the field. Policy tag identifiers are of the form `projects//locations//taxonomies//policyTags/`. At most 1 policy tag is currently allowed.
def policy_tags names = @gapi.policy_tags&.names names.to_a if names && !names.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_policy_tags\n policy_tags = []\n if @policy_tags_enabled\n if @node.respond_to?('policy_group') && !@node.policy_group.nil?\n policy_tags << \"#{@scope_prefix}policy_group:#{@node.policy_group}\"\n end\n if @node.respond_to?('policy_name') && !@node.policy_name.nil?\n po...
[ "0.686827", "0.64193606", "0.6193602", "0.6193602", "0.60909736", "0.6085833", "0.60737056", "0.606432", "0.6043317", "0.6029182", "0.6021539", "0.6021539", "0.601281", "0.59840417", "0.59713894", "0.5930394", "0.5914106", "0.5884815", "0.5884815", "0.5884815", "0.58509874", ...
0.7704126
0
Updates the policy tag list for the field.
def policy_tags= new_policy_tags # If new_policy_tags is nil, send an empty array. # Sending a nil value for policy_tags results in no change. new_policy_tags = Array(new_policy_tags) policy_tag_list = Google::Apis::BigqueryV2::TableFieldSchema::PolicyTags.new names: new_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_tags=(values)\n self.tag_list = values\n end", "def tag_list= value\n self.tags = value.split(',').map(&:strip)\n end", "def tag_list= value\n self.tags = value.split(',').map(&:strip)\n end", "def update_tags\n if self.tags.any?\n self.tags.each do |tag|\n tag.update(o...
[ "0.55922896", "0.539742", "0.539742", "0.53874755", "0.535781", "0.5308555", "0.5232926", "0.5229278", "0.5211289", "0.5194023", "0.51815975", "0.5173509", "0.5172196", "0.51485544", "0.5132083", "0.5130251", "0.51200163", "0.51054484", "0.50936425", "0.509348", "0.50623614",...
0.68708473
0
The default value of a field using a SQL expression. It can only be set for top level fields (columns). Default value for the entire struct or array is set using a struct or array expression. The valid SQL expressions are: Literals for all data types, including STRUCT and ARRAY. The following functions: `CURRENT_TIMEST...
def default_value_expression @gapi.default_value_expression end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_definition_default_sql(sql, column)\n sql << \" DEFAULT #{literal(column[:default])}\" if column.include?(:default)\n end", "def default_value_expression= default_value_expression\n @gapi.update! default_value_expression: default_value_expression\n end", "def default_valu...
[ "0.67377514", "0.6483813", "0.6316746", "0.6221594", "0.6145545", "0.6050926", "0.600729", "0.599084", "0.59106916", "0.5907113", "0.588262", "0.58748096", "0.58539283", "0.5853167", "0.5814387", "0.57894194", "0.5741978", "0.5655963", "0.5608236", "0.56039613", "0.56001836",...
0.65507853
1
Updates the default value expression of the field.
def default_value_expression= default_value_expression @gapi.update! default_value_expression: default_value_expression end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_value_expression\n @gapi.default_value_expression\n end", "def attribute_default(field)\n return unless field.has_default?\n val = field.default\n case\n when val.is_a?(Proc) && (val.arity == 0)\n self.instance_exec(&val)\n when val.is_a?(UnboundMet...
[ "0.7305109", "0.67668134", "0.6487752", "0.64311534", "0.6340553", "0.63329947", "0.63080865", "0.6295609", "0.62812674", "0.62658536", "0.625919", "0.6181035", "0.6158315", "0.6101479", "0.6034576", "0.59987116", "0.5988971", "0.5962693", "0.59526", "0.5948998", "0.59461987"...
0.7989715
0
Checks if the type of the field is `STRING`.
def string? type == "STRING" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string?\n data_type == String\n end", "def is_string?(); @type == GRT_STRING; end", "def is_string\n return @is_string\n end", "def value?(value) value.is_a?(String) end", "def is_strtype?(); @type == GRT_STRTYPE; end", "def valid_string?(field, param)\n true\n end", "def st...
[ "0.766883", "0.7502291", "0.7177248", "0.7105687", "0.7097787", "0.69959325", "0.69954354", "0.6947247", "0.6862597", "0.6823381", "0.6794733", "0.6788983", "0.6743994", "0.6729507", "0.66976947", "0.6691452", "0.66257066", "0.6589806", "0.6552939", "0.6374711", "0.636748", ...
0.8085952
0
Checks if the type of the field is `NUMERIC`.
def numeric? type == "NUMERIC" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_be_numeric?\n type == :numeric\n end", "def is_numeric?\n self.data_type == 'number'\n end", "def is_numeric?\n data_type == 'number'\n end", "def force_numeric?(column)\n (column.nil? || [:integer, :float, :decimal].include?(column.type))\n end", "def is_numeric?\n b...
[ "0.8123423", "0.81146765", "0.80457455", "0.7489456", "0.74260485", "0.736178", "0.7325247", "0.71158636", "0.7065441", "0.70591086", "0.7019456", "0.70072466", "0.6976461", "0.6957395", "0.69145", "0.6912553", "0.6883778", "0.6883057", "0.68391424", "0.6837754", "0.6830816",...
0.8336803
0
Checks if the type of the field is `BIGNUMERIC`.
def bignumeric? type == "BIGNUMERIC" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numeric?\n type == \"NUMERIC\"\n end", "def type_literal_generic_bigdecimal(column)\n type_literal_generic_numeric(column)\n end", "def is_numeric?\n self.data_type == 'number'\n end", "def is_numeric?\n data_type == 'number'\n end", "def can_be_numeric?\n type ...
[ "0.6738808", "0.6559789", "0.6464305", "0.6322639", "0.6197289", "0.61915845", "0.61214185", "0.60701454", "0.60350496", "0.602095", "0.5962229", "0.59568995", "0.58549404", "0.5850209", "0.5802794", "0.579359", "0.5774934", "0.5733052", "0.5723241", "0.57167006", "0.5706896"...
0.80970097
0
Checks if the type of the field is `BOOLEAN`.
def boolean? type == "BOOLEAN" || type == "BOOL" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_boolean_type(field)\n if field.is_a?(TrueClass) || field.is_a?(FalseClass)\n return true\n else\n return false\n end\n end", "def boolean?\n @type == :boolean\n end", "def boolean?(column)\n column.type == :boolean\n end", "def boolean_type\n 'B...
[ "0.8182188", "0.7985818", "0.790566", "0.76356053", "0.7247902", "0.7122026", "0.7076148", "0.7015558", "0.69802076", "0.69467354", "0.69068044", "0.6845731", "0.68139756", "0.6801363", "0.67474", "0.6743324", "0.673224", "0.6679746", "0.6620197", "0.6601278", "0.65994644", ...
0.8220208
0
Checks if the type of the field is `BYTES`.
def bytes? type == "BYTES" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes?(object)\n object.kind_of?(Fixnum) && object >= 0x00 && object <= 0xFF\n end", "def binary?\n t = @type.downcase\n !!((t =~ /binary/) || (t =~ /blob/))\n end", "def as_many_bytes_as?(other)\n type_id.abs >= other.type_id.abs # TODO: use possible_byte_sizes\n end", "def byt...
[ "0.65713304", "0.6396643", "0.6071401", "0.6001402", "0.5939501", "0.59050196", "0.5901824", "0.5715024", "0.56709874", "0.5662601", "0.5643503", "0.5616308", "0.56033313", "0.5599911", "0.55633765", "0.55584276", "0.5554243", "0.55297375", "0.55066544", "0.5505588", "0.54903...
0.807143
0
Checks if the type of the field is `TIMESTAMP`.
def timestamp? type == "TIMESTAMP" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_timestamp(timestamp)\n fail ArgumentError, 'Timestamp must be a Time' unless timestamp.is_a? Time\n end", "def check_timestamp!(timestamp)\n fail ArgumentError, 'Timestamp must be a Time' unless timestamp.is_a? Time\n end", "def datetime?\n type == \"DATETIME\"\n ...
[ "0.70083463", "0.69439775", "0.67441046", "0.67128104", "0.67067975", "0.6548675", "0.6139999", "0.613817", "0.6133439", "0.6036024", "0.6018841", "0.6016524", "0.5987084", "0.59496635", "0.590741", "0.5900461", "0.5894694", "0.5881744", "0.5848368", "0.5846171", "0.58445066"...
0.8122504
0
Checks if the type of the field is `TIME`.
def time? type == "TIME" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_value?(input)\n return input.is_a?(Time) || input.is_a?(Date)\n end", "def valid_time_or_date?(value)\n value.is_a?(Time) || value.is_a?(Date) || value.is_a?(ActiveSupport::TimeWithZone)\n end", "def is_time_unit?\n self.is_numeric? && TIME_UNITS.include?(self.unit)\n end", "def ...
[ "0.75910455", "0.71092737", "0.6954289", "0.69318175", "0.69092184", "0.6798967", "0.67504483", "0.6715974", "0.6713501", "0.6647548", "0.6590515", "0.6581413", "0.64501256", "0.6442437", "0.6401007", "0.6358342", "0.6355443", "0.63516265", "0.63376915", "0.6305664", "0.62841...
0.8383756
0
Checks if the type of the field is `DATETIME`.
def datetime? type == "DATETIME" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_validations_for_datetime\n flex_column_class.validates_each field_name do |record, attr, value|\n record.errors.add(attr, \"must be a Time or DateTime\") if value && (! value.kind_of?(Time)) && (value.class.name != 'DateTime')\n end\n end", "def is_valid?\n is_valid_datet...
[ "0.7253279", "0.7066005", "0.695279", "0.6949436", "0.69007933", "0.67179453", "0.6636011", "0.66234845", "0.6473741", "0.639751", "0.6379868", "0.6309361", "0.6288109", "0.62505186", "0.6227763", "0.62239206", "0.6209907", "0.6202373", "0.60372734", "0.59958756", "0.5961784"...
0.84741426
0
Checks if the type of the field is `DATE`.
def date? type == "DATE" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def looks_like_date?(value)\n value.is_a?(Date) || value.is_a?(Time)\n end", "def can_be_date?\n raise NoMethodError, \"This method is no longer supported.\"\n end", "def has_date?\n !fields.select { |f| f.responsible_for?('Date') }.empty?\n end", "def validate_date_attribute(date_typ...
[ "0.76774865", "0.74911207", "0.74447596", "0.7014848", "0.6945377", "0.6918824", "0.6865966", "0.6765849", "0.6597502", "0.6591865", "0.65790087", "0.652027", "0.65072876", "0.648048", "0.6462714", "0.64104706", "0.6385692", "0.6359112", "0.631448", "0.628149", "0.6255187", ...
0.8253281
0
Checks if the type of the field is `GEOGRAPHY`.
def geography? type == "GEOGRAPHY" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geo_object\n begin\n if r = geo_object_type # rubocop:disable Lint/AssignmentInCondition\n send(r)\n else\n false\n end\n rescue RGeo::Error::InvalidGeometry\n return nil # TODO: we need to render proper error for this!\n end\n end", "def is_xy?(); @type == GRT_XY;...
[ "0.6524741", "0.6107748", "0.6041386", "0.60261095", "0.59719145", "0.59719145", "0.59719145", "0.5869683", "0.5709475", "0.5698675", "0.5697295", "0.56849015", "0.56849015", "0.5669533", "0.55479497", "0.54863834", "0.54706085", "0.5457221", "0.5456846", "0.5456844", "0.5406...
0.75620186
0
Checks if the type of the field is `RECORD`.
def record? type == "RECORD" || type == "STRUCT" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def expect_record name, value\n expect_type name, value, \"Record\", lambda{ value.is_a?(Record) }\n end", "def record?\n type.record?\n end", "def uses_record_type?\n list_class.attribute_names.include?('record_type')\n end", "def record_with_type?(record)\n record.i...
[ "0.6796277", "0.6785496", "0.66050035", "0.65891266", "0.6562007", "0.6303785", "0.613521", "0.61300427", "0.6009332", "0.6004249", "0.5814604", "0.56702024", "0.5624154", "0.56034684", "0.554095", "0.54789495", "0.54681534", "0.5450118", "0.5432151", "0.5392479", "0.53802425...
0.7889294
0
Adds a boolean field to the nested schema of a record field. This can only be called on fields that are of type `RECORD`.
def boolean name, description: nil, mode: :nullable, policy_tags: nil record_check! add_field name, :boolean, description: description, mode: mode, policy_tags: policy_tags end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_boolean_field(field_name)\n\t\tend", "def record?\n type == \"RECORD\" || type == \"STRUCT\"\n end", "def type_literal_generic_boolean(column)\n :boolean\n end", "def attr_set_boolean(attr_type, attr_value)\n #This is a stub, used for indexing\n end", "def fiel...
[ "0.5923192", "0.5616594", "0.55987525", "0.5588339", "0.5562626", "0.54920614", "0.54363596", "0.536065", "0.5359438", "0.53562176", "0.53481424", "0.5345932", "0.53389186", "0.53388315", "0.53347766", "0.53011334", "0.5284964", "0.5282979", "0.5282359", "0.52556163", "0.5211...
0.6239906
0
Adds a bytes field to the nested schema of a record field. This can only be called on fields that are of type `RECORD`.
def bytes name, description: nil, mode: :nullable, policy_tags: nil, max_length: nil record_check! add_field name, :bytes, description: description, mode: mode, policy_tags: policy_tags, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_field(type, value)# {{{\n t = TLV.new(2,2)\n t.type = type\n t.value = value\n t.length = 4 + value.length\n self.payload += t.encode \n end", "def add_raw(raw)\n @fields << Field.new(raw)\n self\n end", "def record=(record)\n self.record_data = Base64.encode64(Marsh...
[ "0.59158766", "0.56080073", "0.55081683", "0.5453812", "0.5372978", "0.53194565", "0.5313502", "0.52146715", "0.518387", "0.5176976", "0.5137892", "0.5135207", "0.512863", "0.51171196", "0.50648403", "0.50606465", "0.50067043", "0.49941772", "0.49736175", "0.49674642", "0.496...
0.5954681
0
Adds a timestamp field to the nested schema of a record field. This can only be called on fields that are of type `RECORD`.
def timestamp name, description: nil, mode: :nullable, policy_tags: nil record_check! add_field name, :timestamp, description: description, mode: mode, policy_tags: policy_tags end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def timestamp_field=(_field_name)\n raise Error, E_TIMESTAMP_FIELD_CONFIG\n end", "def type_literal_generic_datetime(column)\n :timestamp\n end", "def append_timestamp(value)\n time = case value\n when Time\n value\n when Date\n value.to_...
[ "0.61602205", "0.58389205", "0.57605076", "0.57245356", "0.5676347", "0.5663652", "0.5568894", "0.5564433", "0.556219", "0.55579257", "0.5527557", "0.5512983", "0.5490998", "0.5455854", "0.54368854", "0.5419557", "0.5390411", "0.5357996", "0.53446263", "0.5336489", "0.5306169...
0.66636753
0
Adds a time field to the nested schema of a record field. This can only be called on fields that are of type `RECORD`.
def time name, description: nil, mode: :nullable, policy_tags: nil record_check! add_field name, :time, description: description, mode: mode, policy_tags: policy_tags end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def time_field field = nil\n @time_field = field if field\n @time_field\n end", "def type_literal_generic_only_time(column)\n :time\n end", "def time_field(object_name, method, options = T.unsafe(nil)); end", "def type_literal_generic_time(column)\n column[:only_time] ?...
[ "0.67043835", "0.61925834", "0.60828453", "0.6065578", "0.60606164", "0.594004", "0.58431935", "0.5765489", "0.57491165", "0.57446575", "0.572281", "0.5712897", "0.5704962", "0.56798023", "0.5677857", "0.5674365", "0.566035", "0.5653106", "0.56337565", "0.55973554", "0.556360...
0.6748423
0
Adds a datetime field to the nested schema of a record field. This can only be called on fields that are of type `RECORD`.
def datetime name, description: nil, mode: :nullable, policy_tags: nil record_check! add_field name, :datetime, description: description, mode: mode, policy_tags: policy_tags end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datetime_field(object_name, method, options = T.unsafe(nil)); end", "def to_doc\n # doc now has all the fields of our model instance, we \n # just add another field to it:\n doc = super\n # add a field containing the current time\n doc[:added] = Time.now.to_i.to_s\n return doc\n end", "d...
[ "0.5910415", "0.56748605", "0.5605256", "0.5586138", "0.5501807", "0.5490748", "0.54817814", "0.54065937", "0.5399331", "0.534236", "0.53157085", "0.5314812", "0.5298801", "0.52873474", "0.52333033", "0.52229726", "0.519428", "0.51758206", "0.5173208", "0.51540613", "0.515311...
0.6224733
0
Adds a date field to the nested schema of a record field. This can only be called on fields that are of type `RECORD`.
def date name, description: nil, mode: :nullable, policy_tags: nil record_check! add_field name, :date, description: description, mode: mode, policy_tags: policy_tags end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def date_nested\n self[Solrizer.solr_name('date_nested', :displayable)]\n end", "def date_field(object_name, method, options = T.unsafe(nil)); end", "def _build_date_single(date, xml)\n attrs = { localType: date['date_label'] }\n create_node(xml, 'date', attrs, date['structured_date_single']['date_ex...
[ "0.5841291", "0.562257", "0.5616748", "0.55500364", "0.54208255", "0.5420433", "0.5403138", "0.53960913", "0.53750974", "0.531933", "0.5253915", "0.52248484", "0.5169552", "0.51013654", "0.5096172", "0.50791895", "0.5062106", "0.50587535", "0.50331414", "0.49732295", "0.49703...
0.6045377
0
Adds a geography field to the nested schema of a record field.
def geography name, description: nil, mode: :nullable, policy_tags: nil record_check! add_field name, :geography, description: description, mode: mode, policy_tags: policy_tags end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def geography(name, options = {})\n column(name, :geography, options)\n end", "def append_geom( geom, **other_attrs )\n if geom.is_a?(GeoRuby::SimpleFeatures::Geometry)\n geom = RGeo::WKRep::WKBParser.new.parse(geom.as_wkb) rescue nil\n end\n new_geom = geom\n self.place_geometry.rel...
[ "0.62719226", "0.588863", "0.5782519", "0.56411237", "0.5554195", "0.55347544", "0.5418438", "0.53993815", "0.53862447", "0.5324835", "0.5264566", "0.52550924", "0.52292585", "0.5180059", "0.516564", "0.5143548", "0.514169", "0.5134572", "0.5062158", "0.5061737", "0.49898568"...
0.7446773
0
Adds a record field to the nested schema of a record field. A block must be passed describing the nested fields of the record. For more information about nested and repeated records, see [Preparing Data for BigQuery]( This can only be called on fields that are of type `RECORD`.
def record name, description: nil, mode: nil record_check! # TODO: do we need to raise if no block was given? raise ArgumentError, "a block is required" unless block_given? nested_field = add_field name, :record, description: description, mode: mode yield ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fields_for(record_name, record_object = T.unsafe(nil), fields_options = T.unsafe(nil), &block); end", "def semantic_fields_for(record_or_name_or_array, *args, &block)\n fields_for(record_or_name_or_array, *args, &block)\n end", "def sub_field(named, human_name = nil, &block)\n human_name ||= nam...
[ "0.59745246", "0.59244794", "0.59064597", "0.5882015", "0.5728995", "0.55676645", "0.55551004", "0.55478865", "0.5523331", "0.5452229", "0.535457", "0.53500193", "0.5318665", "0.53053296", "0.5280825", "0.5272067", "0.52714926", "0.52476114", "0.5243147", "0.5241524", "0.5202...
0.6552268
0
==Execute db migration tasks pdm database migrate up|down|reset PATH/TO/STEP1 PATH/TO/STEP2 task: up/down/reset/backup
def migrate(task, *step_files) step_files = begin Dir[File.join(File.dirname(__FILE__),"../../migrate/*.rb")] end if step_files.empty? establish! do step_files.each do |step_file| require step_file File.basename(step_file) =~ /(.*)\.rb$/ migration ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def migrate\n run_migrations pending_migrations, :up\n end", "def migrate\n with_maintenance do\n backup if backup?\n run_migration\n restart\n end\n end", "def migrate\n puts 'Migrating DBs on containers'\n puts Open3.capture3(\"pushd #{dot_futureadvisor} 2>&1; ./bin/dev re...
[ "0.7123244", "0.6536604", "0.64443934", "0.640779", "0.64054996", "0.6379107", "0.6359264", "0.6316476", "0.6315159", "0.6297739", "0.62144125", "0.61788976", "0.61778206", "0.6170276", "0.61682343", "0.6162269", "0.6156761", "0.61159277", "0.6076526", "0.6068247", "0.6065849...
0.7597206
0
GET /music_discs GET /music_discs.json
def index @music_discs = MusicDisc.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @music = Music.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @music }\n end\n end", "def index\n @musics = Music.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mus...
[ "0.66433537", "0.66346246", "0.6624503", "0.65975785", "0.6589996", "0.6425613", "0.6425613", "0.6425613", "0.6425613", "0.63963896", "0.6370514", "0.6312383", "0.62550277", "0.62399554", "0.61923176", "0.6153997", "0.6124523", "0.61007077", "0.6087293", "0.60776764", "0.6077...
0.7271684
0
POST /music_discs POST /music_discs.json
def create @music_disc = MusicDisc.new(music_disc_params) @music_disc.user = current_user respond_to do |format| if @music_disc.save format.html { redirect_to @music_disc } format.json { render :show, status: :created, location: @music_disc } else format.html { render :ne...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def music_disc_params\n params.require(:music_disc).permit(:title, :discography, :group_name, { music_category_ids: []}, :image)\n end", "def create\n @music = Music.new(params[:music])\n\n respond_to do |format|\n if @music.save\n format.html { redirect_to \"/musics\", notice: 'Music w...
[ "0.6636835", "0.6348932", "0.6282617", "0.6282617", "0.6168037", "0.6168037", "0.6167091", "0.61183494", "0.6093184", "0.60146844", "0.5986225", "0.59618896", "0.5864717", "0.5846669", "0.58346194", "0.5820219", "0.58141947", "0.58125854", "0.5804949", "0.5793953", "0.5793888...
0.65569896
1
DELETE /music_discs/1 DELETE /music_discs/1.json
def destroy @music_disc.destroy respond_to do |format| format.html { redirect_to music_discs_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @music = Music.find(params[:id])\n @music.destroy\n\n respond_to do |format|\n format.html { redirect_to musics_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @music = Music.find(params[:id])\n @music.destroy\n\n respond_to do |format|\n f...
[ "0.729984", "0.729984", "0.729984", "0.7267837", "0.7264692", "0.71721333", "0.7161083", "0.7139181", "0.7012895", "0.6947899", "0.6940732", "0.69337344", "0.69337344", "0.69007456", "0.6861175", "0.6856993", "0.6849808", "0.68394935", "0.68394935", "0.6828294", "0.68102556",...
0.76910615
0
POST /points POST /points.xml
def create @point = Point.new(params[:point]) respond_to do |format| if @point.save format.html { redirect_to(@point, :notice => 'Point was successfully created.') } format.xml { render :xml => @point, :status => :created, :location => @point } else format.html { render :ac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @point = Point.new(params[:point])\n\n respond_to do |format|\n if @point.save\n format.html { redirect_to(@point, :notice => 'Point added') }\n format.xml { render :xml => @point, :status => :created, :location => @point }\n else\n format.html { render :action =>...
[ "0.65661246", "0.63137096", "0.6232738", "0.62048274", "0.6202215", "0.6144506", "0.60958636", "0.60784113", "0.5952932", "0.5941154", "0.5929124", "0.5846992", "0.58336085", "0.58318824", "0.58300966", "0.57990026", "0.5783145", "0.57431936", "0.5743137", "0.5733619", "0.572...
0.65305614
1
GET /store_managers GET /store_managers.json
def index @store_managers = StoreManager.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def managers\n response = request(:get, \"/manager\")\n response_to_array(response, \"managers\", KontaktIo::Resource::Manager)\n end", "def _manager_list\n\t\t\t# Author\n\t\t\treturn render json: { status: 6 } if cannot? :manage, User\n\t\t\t\n\t\t\t# Check unless exists is_add, type\n\t\t\treturn...
[ "0.7572758", "0.71441805", "0.6855907", "0.6815052", "0.66974133", "0.6695657", "0.6676692", "0.6665478", "0.6645525", "0.6615003", "0.6614031", "0.6568612", "0.6517625", "0.64856637", "0.6463473", "0.6438148", "0.6399849", "0.6394502", "0.63829434", "0.6374996", "0.6374236",...
0.76231325
0
POST /store_managers POST /store_managers.json
def create @store_manager = StoreManager.new(store_manager_params) respond_to do |format| if @store_manager.save format.html { redirect_to @store_manager, notice: 'Store manager was successfully created.' } format.json { render :show, status: :created, location: @store_manager } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @manager = Manager.new(manager_params)\n\n if @manager.save\n render :show, status: :created, location: @manager\n else\n render json: @manager.errors, status: :unprocessable_entity\n end\n end", "def create\n @manager = Manager.new(params[:manager])\n\n respond_to do |f...
[ "0.69857246", "0.6829435", "0.6551086", "0.6466746", "0.6425457", "0.6420798", "0.6373931", "0.63274926", "0.62881345", "0.62680864", "0.62455356", "0.62400454", "0.6219898", "0.6170301", "0.61547476", "0.6133173", "0.61242354", "0.6064748", "0.60476995", "0.60435224", "0.603...
0.75044817
0
PATCH/PUT /store_managers/1 PATCH/PUT /store_managers/1.json
def update respond_to do |format| if @store_manager.update(store_manager_params) format.html { redirect_to @store_manager, notice: 'Store manager was successfully updated.' } format.json { render :show, status: :ok, location: @store_manager } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n if @manager.update(manager_params)\n render :show, status: :ok, location: @manager\n else\n render json: @manager.errors, status: :unprocessable_entity\n end\n end", "def update\n @manager = Manager.find(params[:id])\n\n respond_to do |format|\n if @manager.update_attr...
[ "0.68259954", "0.67671925", "0.67176247", "0.654345", "0.64958966", "0.6468298", "0.6430893", "0.64291024", "0.64241815", "0.63655216", "0.63577807", "0.635734", "0.63391775", "0.63195163", "0.6317951", "0.6317951", "0.6317951", "0.6317951", "0.63138616", "0.63138616", "0.630...
0.72280097
0
DELETE /store_managers/1 DELETE /store_managers/1.json
def destroy @store_manager.destroy respond_to do |format| format.html { redirect_to store_managers_url, notice: 'Store manager was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @admin_store = Admin::Store.find(params[:id])\n @admin_store.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_stores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @manager = Manager.find(params[:id])\n @manager.destroy\n\n ...
[ "0.75522566", "0.74253094", "0.7415629", "0.74060535", "0.72904855", "0.7289748", "0.7289748", "0.7289748", "0.7289748", "0.72742367", "0.72742367", "0.72742367", "0.72742367", "0.72740823", "0.72718334", "0.72522384", "0.7247328", "0.71995854", "0.71833086", "0.7179625", "0....
0.7751048
0
Public: Search for schedules that will soon overdue range The overdue time, must be UTC int (Default: 4.days) Returns the Mongoid::Criteria
def soon range=4.days schedules.where(:when.lte => range.from_now) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def overdue\n schedules.where(:when.lte => Time.now)\n end", "def client_tasks_overdue\n self.find_all {|e| (e.completed.nil? or !e.completed) and e.complete_by < Time.zone.now }\n end", "def future from=7.days\n schedules.where(:when.gte => from.from_now)\n end", "def overdue?\n if is_appoint...
[ "0.7787857", "0.6186143", "0.5992936", "0.56769466", "0.566428", "0.5557885", "0.555084", "0.55211115", "0.5510264", "0.5500905", "0.5485369", "0.53618103", "0.5327263", "0.52653277", "0.5250627", "0.5248456", "0.5218757", "0.5200439", "0.51879436", "0.5132213", "0.51033014",...
0.6626659
1
Lazily fetches all builds.
def builds(filters = {}) fetch_resources_lazily("builds", filters) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_all\n response_json = @client.api_get_request(\"/api/build\")\n\n return nil unless response_json\n\n response_json[\"builds\"].map do |build|\n {\n :name => build[\"uri\"].sub(/^\\//,''),\n :uri => build[\"uri\"],\n :lastStarted => build[\"la...
[ "0.7296129", "0.6667138", "0.6655257", "0.64318824", "0.64318824", "0.6394068", "0.6388178", "0.63228804", "0.6315594", "0.63138396", "0.62459344", "0.62009", "0.61851406", "0.6077386", "0.60382944", "0.6001163", "0.5963967", "0.5928858", "0.59113204", "0.5886723", "0.588318"...
0.75809765
0
ENV['PVC_DEPLOY_TO_BASE'] = stage_data[:deploy_to] || '/sites'
def deploy_to_base_dir # stage[:deploy_to] || '/sites' # TODO: verify if server setup supports `:deploy_to` override Pvcglue.configuration.web_app_base_dir # TODO: server setup does not yet support `:deploy_to` override, and would have to be refactored at a higher level than stage. end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deploy_to\n fetch(:deploy_to, nil) || \"/opt/apps/#{fetch(:application)}\"\n end", "def deploy_to\n \"/data/#{app_name.downcase}/app\"\n end", "def deploy?; run_options[:deploy]; end", "def defaults \n default_run_options[:pty] = true\n\tset :deploy_to, \"/usr/local/www/#{application}-...
[ "0.736962", "0.6881185", "0.64545506", "0.63965285", "0.6289924", "0.62297416", "0.6101152", "0.60693705", "0.6054623", "0.60220146", "0.60220146", "0.6010095", "0.5999325", "0.5978251", "0.59468144", "0.58942914", "0.5858668", "0.5810374", "0.5801588", "0.57986265", "0.57815...
0.80964094
0
GET /cooperatives GET /cooperatives.json
def index @cooperatives = Cooperative.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @coasters = Coaster.all\n\n render json: @coasters\n end", "def index\n @creatives = @org.creatives\n end", "def index\n @cocktails = Cocktail.where(\"oficial = ?\", false)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cocktail...
[ "0.6678411", "0.6565149", "0.6411777", "0.63552314", "0.63453263", "0.6303329", "0.6295732", "0.6292242", "0.6262387", "0.6251463", "0.62386984", "0.62302285", "0.6222405", "0.6180417", "0.61521375", "0.6135253", "0.61308223", "0.61206263", "0.6118713", "0.61167467", "0.60735...
0.7567936
0
POST /cooperatives POST /cooperatives.json
def create @cooperative = Cooperative.new(cooperative_params) respond_to do |format| if @cooperative.save format.html { redirect_to @cooperative, notice: 'Cooperative was successfully created.' } format.json { render :show, status: :created, location: @cooperative } else for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @congresso = Congresso.new(congresso_params)\n\n respond_to do |format|\n if @congresso.save\n format.html { redirect_to @congresso, notice: 'Congresso was successfully created.' }\n format.json { render :show, status: :created, location: @congresso }\n else\n form...
[ "0.5972425", "0.5955439", "0.58297646", "0.57903653", "0.57780814", "0.5767716", "0.5766921", "0.5761265", "0.57344115", "0.5729172", "0.57279915", "0.5706497", "0.56831455", "0.56721836", "0.5669756", "0.5666183", "0.5648887", "0.5643536", "0.5633182", "0.5628177", "0.562293...
0.6995013
0
PATCH/PUT /cooperatives/1 PATCH/PUT /cooperatives/1.json
def update respond_to do |format| if @cooperative.update(cooperative_params) format.html { redirect_to @cooperative, notice: 'Cooperative was successfully updated.' } format.json { render :show, status: :ok, location: @cooperative } else format.html { render :edit } forma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entit...
[ "0.64254296", "0.6286189", "0.61793596", "0.6178764", "0.6149227", "0.6079479", "0.6067912", "0.60595495", "0.605646", "0.6055527", "0.602482", "0.6000337", "0.5922706", "0.59148216", "0.59128577", "0.59127146", "0.591116", "0.5909698", "0.5906518", "0.5878436", "0.58767176",...
0.66824746
0
DELETE /cooperatives/1 DELETE /cooperatives/1.json
def destroy @cooperative.destroy respond_to do |format| format.html { redirect_to cooperatives_url, notice: 'Cooperative was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n resp...
[ "0.70096076", "0.6769179", "0.6762237", "0.6703216", "0.6689681", "0.66804343", "0.664934", "0.6637919", "0.6627466", "0.6621922", "0.66214293", "0.66147023", "0.66145146", "0.6606146", "0.6596792", "0.6576839", "0.65711504", "0.65647215", "0.6559654", "0.6548392", "0.6541989...
0.7141181
0
functions for seeing if moves are valid Top
def canMoveTop(row,col,disc) max = @size -1 min = 0 notDisc = "" c = 1 if disc == "B" notDisc = "W" end if disc == "W" notDisc = "B" end if row-c >= min && @board[row-c][col] == notDisc while row-c >= min && @b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid_move?(board, position)\n position.between?(0, 8) && !position_taken?(board, position)\nend", "def valid_moves\n\n end", "def valid_move?(board, position)\n !position_taken?(board, position) && position.between?(0,8)\nend", "def valid_moves\n moves.reject { |end_pos| move_into_check?(end_pos) ...
[ "0.670112", "0.66919005", "0.6688539", "0.6680369", "0.6636218", "0.6625445", "0.6602211", "0.66011834", "0.65814084", "0.6576568", "0.65746796", "0.6574358", "0.6570878", "0.6560727", "0.65515715", "0.6547356", "0.6546352", "0.6546008", "0.65457726", "0.6535237", "0.6533379"...
0.7201266
0
Places the disc of current player at row,col and flips the opponent discs as needed
def placeDiscAt(row, col) if (!isValidMove(row, col)) return end # place the current player's disc at row,col @board[row][col] = @disc # TO DO: COMPLETE THIS PART OF THE METHOD c = 1 notDisc = "" if @disc == "B" notDisc = "W" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def placeDiscAt(row, col)\n\t\tif (!isValidMove(row, col))\n\t\t\treturn\n\t\tend\n\n #\n # TO DO: add your code below\n\t\t#\n\t\t@board[row][col] = @disc;\n\t\t# flips any opponent discs down\n\t\tr = row + 1\n\t\tc = col\n\t\twhile r < @size && @board[r][c] != EMPTY && @board[r][c] != @disc do\n\t\t\t\tr ...
[ "0.76008284", "0.6716554", "0.6695476", "0.65508103", "0.63319093", "0.6143951", "0.61018014", "0.607248", "0.60643834", "0.59181416", "0.591742", "0.5902453", "0.5868368", "0.5852522", "0.58520985", "0.58352107", "0.5818336", "0.58010536", "0.57892674", "0.5773215", "0.57570...
0.6882374
1
Returns command to grep config file for assignment
def grep_cmd sprintf 'grep -Fq "%s" %s', key_set_string, @file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_config(file); end", "def getconf(target)\n\t\t@log.info \"--util.rb : util.getconf(\" + target + \") \"\n\t\tFile.foreach(@config_file) do |line|\n\t\t#File.foreach(\"../../config.txt\") do |line|\n\t\t\tconf = line.chomp\n\t\t\tif(conf.index(target)) then\n\t\t\t\t@log.debug \"return \" + conf.split[1]...
[ "0.5852091", "0.5773518", "0.57331246", "0.5667553", "0.5643085", "0.5566762", "0.55313295", "0.5511817", "0.5504865", "0.5457773", "0.5404175", "0.53757", "0.53671145", "0.5356291", "0.53178984", "0.5289387", "0.5241179", "0.5232754", "0.5229069", "0.52215624", "0.5180762", ...
0.6838154
0
Returns command to append assignment to config file
def append_cmd sprintf 'echo "%s%s" >> %s', key_set_string, @config[:value], @file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setconfig(str)\n add_cmd str\n end", "def configure_command(cmd)\n end", "def add_new_config\n name = @options.new_config[0]\n path = @options.new_config.length == 2 ? @options.new_config[1] : nil\n # makes a call to generate a default configuration file\n new_file = OutputOperator.new_d...
[ "0.6018097", "0.60125196", "0.59455025", "0.5894086", "0.5713274", "0.55858445", "0.5501646", "0.54982245", "0.5494143", "0.548474", "0.5477435", "0.5427472", "0.53431004", "0.5334085", "0.5334061", "0.52811843", "0.5267606", "0.5255126", "0.52521455", "0.5226453", "0.5225942...
0.72833645
0
Returns command to remove assignment from config file
def unset_cmd sprintf 'sed -i /%s/d %s', key_set_string, @file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_command(name)\n @commands ||= {}\n @commands.delete name\n end", "def remove_config(name)\n\t\tend", "def removeCommandAliases(repo)\n config = repo.config(true, '--list').lines.each do |line|\n next unless line.start_with? 'alias.' and line.match /\\!_git\\-bpf/\n a = /ali...
[ "0.65352476", "0.6505543", "0.61993665", "0.615171", "0.61218435", "0.612007", "0.6094497", "0.6053946", "0.6038202", "0.59354615", "0.5923372", "0.5921481", "0.5908367", "0.5841326", "0.58399504", "0.5825802", "0.57967013", "0.5787193", "0.57484883", "0.5747127", "0.5722159"...
0.664374
0
find out the weightage for first record of the exam
def weightage return unless exams.first.nil? exams.first.weightage end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def measure() @measure ||= (nb_weight == 0.0 ? 0.0 : sum_weight / nb_weight) end", "def weight\n return @weight\n end", "def weight; end", "def weight\n 0\n end", "def weight\n return data.weight\n end", "def weight\n if @weight\n @weight\n else\n @co...
[ "0.6543537", "0.63375103", "0.62807703", "0.6257638", "0.611474", "0.60140914", "0.60140914", "0.59837097", "0.59794754", "0.59682655", "0.5942232", "0.5917063", "0.5903843", "0.58963495", "0.58960855", "0.5851221", "0.58236784", "0.5816772", "0.57607096", "0.57357216", "0.56...
0.7843295
0
Generate the result by subject id and exam group id.
def exam_data(subject) Exam.result(subject.id, id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @exam_group = ExamGroup.shod(params[:exam_group_id])\n @batch = @exam_group.batch\n @subjects = @batch.subjects.where(no_exams: false)\n @exam = @exam_group.exams.new(params_exam)\n exam_create\n end", "def get_group\n if params[:stu].present? && params[:sub].present?\n stude...
[ "0.5998218", "0.59294164", "0.5825492", "0.56342965", "0.55390203", "0.54909605", "0.54435915", "0.5425885", "0.53993165", "0.5381499", "0.53383166", "0.53188086", "0.53066975", "0.53012055", "0.52827716", "0.5275306", "0.5266171", "0.5252848", "0.52089965", "0.52079445", "0....
0.6695062
0
This action manage the type of exam result i.e.Grades or Marks.
def type_result(e, es) if exam_type == 'Grades' es.grading_level.name || 'AB' elsif exam_type == 'Marks' [es.marks || 'AB', e.maximum_marks].join('/') else [[es.marks || 'AB', e.maximum_marks].join('/'), es.grading_level.name || '-'].join('|') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_exam_result\n @exam_result = ExamResult.find(params[:id])\n end", "def set_results\n @exam = Exam.find(params[:exam_id])\n end", "def result\n @exam = current_exam(params)\n\n @exam_reporter = @exam.evaluate(params[:answers])\n end", "def exam_result\n if params[:exam_id]\n ...
[ "0.620552", "0.6189071", "0.6129202", "0.60192055", "0.5950334", "0.59310293", "0.58985204", "0.58715355", "0.58357334", "0.57796127", "0.576083", "0.57585895", "0.57585895", "0.56722754", "0.565495", "0.5603482", "0.55952436", "0.5567693", "0.55228853", "0.54315674", "0.5425...
0.64122814
0
Calculating the exam marks.
def exam_mar(subject, student, marks) exam = exam_data(subject) exam_score = exam.scores(student) return if exam.nil? marks.to_f + exam_score.marks.to_f end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exam_marks(subject, student)\n exam = exam_data(subject)\n exam_score = exam.scores(student)\n unless exam_score.nil?\n if exam.nil?\n result = 'NA'\n else\n exam_score.nil? ? result = '-' : result = type_result(exam, exam_score)\n end\n result\n end \n end", ...
[ "0.7437175", "0.69961363", "0.6912861", "0.66114014", "0.6560791", "0.6390787", "0.63760436", "0.62102973", "0.6148726", "0.5929783", "0.5929743", "0.58902735", "0.5840896", "0.58071953", "0.5787153", "0.5777845", "0.5758071", "0.57267874", "0.57106924", "0.5695518", "0.56823...
0.70685697
1
GET /venue_products/1 GET /venue_products/1.json
def show @venue_product = VenueProduct.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @venue_product } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @api_v1_products = Product.all\n json_response(@api_v1_products)\n end", "def show\n json_response(@api_v1_product)\n end", "def show\n \n @product = Product.find(params[:id])\n @vendors = @product.vendor(:all)\n #@vendors = Vendor.find(params[:id])\n #@vendors = Vendor.al...
[ "0.743204", "0.730987", "0.7213589", "0.70481384", "0.7044168", "0.7021765", "0.6987864", "0.69718915", "0.69664615", "0.68962646", "0.68946964", "0.68872815", "0.68672884", "0.6861995", "0.6859079", "0.6854056", "0.68468815", "0.6840597", "0.6788395", "0.6785125", "0.6762956...
0.77853984
0
GET /venue_products/new GET /venue_products/new.json
def new @venue_product = VenueProduct.new respond_to do |format| format.html # new.html.erb format.json { render json: @venue_product } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @product = Product.new\n\n render json: @product\n end", "def new\n @product = ProductProduct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product }\n end\n end", "def new\n @product = Product.new\n\n respond_to do |format|...
[ "0.7708331", "0.75812113", "0.7542354", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", "0.7541824", ...
0.79925734
0
PUT /venue_products/1 PUT /venue_products/1.json
def update @venue_product = VenueProduct.find(params[:id]) respond_to do |format| if @venue_product.update_attributes(params[:venue_product]) format.html { redirect_to @venue_product, notice: 'Venue product was successfully updated.' } format.json { head :ok } else format.ht...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n begin\n @api_v1_product.update!(api_v1_product_params)\n head :no_content\n rescue => ex\n json_response({error: ex.message}, :unprocessable_entity)\n end\n end", "def create\n @venue_product = VenueProduct.new(params[:venue_product])\n @venue = Venue.find_by_fs_venue_...
[ "0.7166039", "0.70487285", "0.6803697", "0.6775359", "0.6721408", "0.66535074", "0.65982443", "0.65561634", "0.6468863", "0.64300823", "0.6405758", "0.6347122", "0.6334088", "0.63302326", "0.62840956", "0.6268829", "0.6233896", "0.6210458", "0.6177357", "0.6169723", "0.615473...
0.7164332
1
DELETE /venue_products/1 DELETE /venue_products/1.json
def destroy @venue_product = VenueProduct.find(params[:id]) @venue_product.destroy @venue = Venue.find_by_fs_venue_id(@venue_product.fs_venue_id) @venue.update_attribute(:product_count,(@venue.product_count).to_i - 1) respond_to do |format| format.html { redirect_to venue_products_url } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @product.destroy\n\n render json: @product, status: :ok#, location: @collection\n end", "def destroy\n @onecompany_product = Onecompany::Product.find(params[:id])\n @onecompany_product.destroy\n\n respond_to do |format|\n format.html { redirect_to onecompany_products_url }\n ...
[ "0.7410696", "0.7306608", "0.72702295", "0.72172797", "0.71904117", "0.71089923", "0.709993", "0.70936406", "0.7086999", "0.7046182", "0.7044976", "0.7018566", "0.7004353", "0.7001813", "0.6991188", "0.699093", "0.699093", "0.699093", "0.699093", "0.699093", "0.699093", "0....
0.73826516
1
GET /class_mstrs/1 GET /class_mstrs/1.json
def show @class_mstr = ClassMstr.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @class_mstr } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @class_mstr = ClassMstr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_mstr }\n end\n end", "def create\n @class_mstr = ClassMstr.new(params[:class_mstr])\n\n respond_to do |format|\n if @class_mstr.save\n format.htm...
[ "0.6766376", "0.6220849", "0.6136893", "0.57798994", "0.5594178", "0.5497495", "0.5411029", "0.53584445", "0.53566587", "0.5325192", "0.5323454", "0.5296612", "0.52880615", "0.5262098", "0.5259857", "0.5237473", "0.520919", "0.518276", "0.5181694", "0.5165975", "0.51525146", ...
0.74215513
0
GET /class_mstrs/new GET /class_mstrs/new.json
def new @class_mstr = ClassMstr.new respond_to do |format| format.html # new.html.erb format.json { render json: @class_mstr } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @class_mstr = ClassMstr.new(params[:class_mstr])\n\n respond_to do |format|\n if @class_mstr.save\n format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully created.' }\n format.json { render json: @class_mstr, status: :created, location: @class_mstr }\n ...
[ "0.73339677", "0.6836156", "0.6742399", "0.6738194", "0.6734112", "0.66999346", "0.66479534", "0.6599336", "0.65674067", "0.6533665", "0.64841795", "0.6473684", "0.6430053", "0.64299434", "0.64298135", "0.64269", "0.64241457", "0.64189464", "0.6397075", "0.63805115", "0.63781...
0.8153798
0
POST /class_mstrs POST /class_mstrs.json
def create @class_mstr = ClassMstr.new(params[:class_mstr]) respond_to do |format| if @class_mstr.save format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully created.' } format.json { render json: @class_mstr, status: :created, location: @class_mstr } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @class_mstr = ClassMstr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_mstr }\n end\n end", "def update\n @class_mstr = ClassMstr.find(params[:id])\n\n respond_to do |format|\n if @class_mstr.update_attributes(params[:class...
[ "0.65978897", "0.5741829", "0.5736589", "0.56870127", "0.55405754", "0.54426616", "0.53879553", "0.53110605", "0.52808344", "0.5262188", "0.5228495", "0.52097076", "0.5171778", "0.5115983", "0.50619906", "0.5047747", "0.50452596", "0.50334734", "0.50328296", "0.5022774", "0.5...
0.74123466
0
PUT /class_mstrs/1 PUT /class_mstrs/1.json
def update @class_mstr = ClassMstr.find(params[:id]) respond_to do |format| if @class_mstr.update_attributes(params[:class_mstr]) format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully updated.' } format.json { head :no_content } else format.html { rende...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @class_mstr = ClassMstr.new(params[:class_mstr])\n\n respond_to do |format|\n if @class_mstr.save\n format.html { redirect_to @class_mstr, notice: 'Class mstr was successfully created.' }\n format.json { render json: @class_mstr, status: :created, location: @class_mstr }\n ...
[ "0.6341769", "0.59903437", "0.5927272", "0.583068", "0.5781234", "0.5694129", "0.5645306", "0.55119747", "0.5507019", "0.55057716", "0.54600924", "0.5445111", "0.5440505", "0.5432048", "0.54282683", "0.5306748", "0.52981883", "0.52841765", "0.5282905", "0.5274818", "0.5228124...
0.7273992
0
DELETE /class_mstrs/1 DELETE /class_mstrs/1.json
def destroy @class_mstr = ClassMstr.find(params[:id]) @class_mstr.destroy respond_to do |format| format.html { redirect_to class_mstrs_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @clclass = Clclass.find(params[:id])\n @clclass.destroy\n\n respond_to do |format|\n format.html { redirect_to clclasses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @s_class.destroy\n respond_to do |format|\n format.html { redirect_to s_cl...
[ "0.6695708", "0.66694635", "0.66257393", "0.6602856", "0.6503053", "0.649038", "0.6460784", "0.64586323", "0.6439553", "0.6428524", "0.6426718", "0.6402536", "0.63996416", "0.63938695", "0.63475513", "0.6335546", "0.6328293", "0.63274884", "0.6316141", "0.63152456", "0.624975...
0.7703819
0
Replaces the CORS rules attached to this bucket. You can pass one or more rules as an array or a list. replace all exisitng rules with a single rule bucket.cors.set( :allowed_methods => %w(GET), :allowed_origins => %w( :max_age_seconds => 3600) If you pass an empty array, all of the rules will be removed from the bucke...
def set *rules raise ArgumentError, 'expected one or more rules' if rules.empty? if rules == [[]] self.clear else rules = rule_hashes(rules) client.put_bucket_cors(:bucket_name => bucket.name, :rules => rules) end nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_cors(allowed_methods, allowed_origins)\n @bucket_cors.put(\n cors_configuration: {\n cors_rules: [\n {\n allowed_methods: allowed_methods,\n allowed_origins: allowed_origins,\n allowed_headers: %w[*],\n max_age_seconds: 3600\n }\n...
[ "0.70802253", "0.6572307", "0.6097518", "0.60075957", "0.60075957", "0.60075957", "0.6005232", "0.6005232", "0.59778595", "0.58880824", "0.5879022", "0.5877326", "0.5834417", "0.5806228", "0.57988816", "0.5797561", "0.5780403", "0.5775429", "0.5775429", "0.5775429", "0.577542...
0.8100972
0
Removes all CORS rules attached to this bucket. bucket.cors.count => 3 bucket.cors.clear bucket.cors.count => 0
def clear client.delete_bucket_cors(:bucket_name => bucket.name) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_cors\n @bucket_cors.delete\n true\n rescue Aws::Errors::ServiceError => e\n puts \"Couldn't delete CORS rules for #{@bucket_cors.bucket.name}. Here's why: #{e.message}\"\n false\n end", "def removed_cors\n @aws.cors.rules - (@local.cors || [])\n end", "def added_cors\n ...
[ "0.7843477", "0.75620306", "0.6479524", "0.6401524", "0.6287629", "0.58730346", "0.57741576", "0.577237", "0.5769519", "0.57166946", "0.5590231", "0.55848", "0.5551601", "0.5487881", "0.5487881", "0.5487881", "0.54851735", "0.54374814", "0.54336375", "0.54336375", "0.5429699"...
0.7577958
1
/ Initialize zbuffer, projection matrix, light source, and lighting model. Do not specify a material property here.
def myinit position = [0.0, 3.0, 3.0, 0.0]; local_view = [0.0]; GL.Enable(GL::DEPTH_TEST); GL.DepthFunc(GL::LESS); GL.Light(GL::LIGHT0, GL::POSITION, position); GL.LightModel(GL::LIGHT_MODEL_LOCAL_VIEWER, local_view); GL.FrontFace(GL::CW); GL.Enable(GL::LIGHTING); GL.E...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init\n mat_specular = [ 1.0, 1.0, 1.0, 1.0 ];\n light_position = [ 1.0, 1.0, 1.0, 0.0 ];\n\n GL.ClearColor(0.0, 0.0, 0.0, 0.0);\n GL.ShadeModel(GL::SMOOTH);\n GL.Enable(GL::DEPTH_TEST);\n GL.Material(GL::FRONT, GL::DIFFUSE, $diffuseMaterial);\n GL.Material(GL::FRONT, GL::SPECULAR, mat_specular);\...
[ "0.7218433", "0.6365604", "0.6299344", "0.61007434", "0.5911895", "0.5872389", "0.5635595", "0.5551103", "0.5492953", "0.54854167", "0.53656685", "0.53372777", "0.5322898", "0.52987057", "0.5292068", "0.52403736", "0.5221845", "0.51984245", "0.5195289", "0.51843226", "0.51746...
0.656252
1
GET /claim_submissions/1 GET /claim_submissions/1.json
def show @claim_submission = ClaimSubmission.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @claim_submission } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @claim_submission = ClaimSubmission.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @claim_submission }\n end\n end", "def show\n @submissions = Contests.get_contest_submissions(params[:id])\n unless @submissions.nil?\n render json...
[ "0.6813238", "0.6807171", "0.64583385", "0.6272739", "0.6244118", "0.6244118", "0.62435657", "0.6182019", "0.6182019", "0.61767715", "0.617586", "0.6171506", "0.60907423", "0.60907423", "0.60907423", "0.60907423", "0.60791945", "0.607315", "0.59617007", "0.5911678", "0.589942...
0.7241201
0
GET /claim_submissions/new GET /claim_submissions/new.json
def new @claim_submission = ClaimSubmission.new respond_to do |format| format.html # new.html.erb format.json { render json: @claim_submission } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @claim_submission = ClaimSubmission.new(params[:claim_submission])\n\n respond_to do |format|\n if @claim_submission.save\n format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully created.' }\n format.json { render json: @claim_submission, statu...
[ "0.73083645", "0.730175", "0.70419043", "0.6944726", "0.6853168", "0.6849316", "0.68190694", "0.68190694", "0.6806833", "0.67574584", "0.6699049", "0.66672105", "0.66314304", "0.6609953", "0.65931195", "0.65611", "0.6553012", "0.65363985", "0.65244067", "0.6505716", "0.648817...
0.79409283
0
POST /claim_submissions POST /claim_submissions.json
def create @claim_submission = ClaimSubmission.new(params[:claim_submission]) respond_to do |format| if @claim_submission.save format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully created.' } format.json { render json: @claim_submission, status: :created...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n submission = Submission.new(submission_params)\n unless submission.save\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n claim = Claim.new(\n insured_id: submission.insured_id,\n provider_id: submission.provider_id\n ...
[ "0.71465874", "0.63417673", "0.6149975", "0.6113587", "0.61065835", "0.6066622", "0.60623986", "0.6039936", "0.6032935", "0.5940368", "0.5926616", "0.5919459", "0.5914436", "0.5873408", "0.58711284", "0.5820877", "0.58056426", "0.5804987", "0.5800932", "0.5794164", "0.5785113...
0.71877235
0
PUT /claim_submissions/1 PUT /claim_submissions/1.json
def update @claim_submission = ClaimSubmission.find(params[:id]) respond_to do |format| if @claim_submission.update_attributes(params[:claim_submission]) format.html { redirect_to @claim_submission, notice: 'Claim submission was successfully updated.' } format.json { head :no_content } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n submission = Submission.new(submission_params)\n unless submission.save\n render json: {errors: submmission.errors.full_messages}, status: :bad_request\n return\n end\n\n claim = Claim.new(\n insured_id: submission.insured_id,\n provider_id: submission.provider_id\n ...
[ "0.6415024", "0.6354963", "0.6158007", "0.61313814", "0.6063084", "0.5971259", "0.5859312", "0.5801251", "0.57798254", "0.57783216", "0.5768422", "0.5757671", "0.57420313", "0.5669171", "0.5662383", "0.56543", "0.5653432", "0.56460124", "0.5645715", "0.56304663", "0.56257087"...
0.7159447
0
DELETE /claim_submissions/1 DELETE /claim_submissions/1.json
def destroy @claim_submission = ClaimSubmission.find(params[:id]) @claim_submission.destroy respond_to do |format| format.html { redirect_to claim_submissions_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @claim.destroy\n respond_to do |format|\n format.html { redirect_to claims_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @email_submission = EmailSubmission.find(params[:id])\n @email_submission.destroy\n\n respond_to do |format|\n format.ht...
[ "0.71459085", "0.708304", "0.70242375", "0.70242375", "0.70242375", "0.69954276", "0.69857734", "0.69857734", "0.69855833", "0.6954726", "0.69509745", "0.69039905", "0.67750174", "0.6749984", "0.67270607", "0.66955394", "0.66955394", "0.66955394", "0.66955394", "0.66955394", ...
0.7863417
0
GET /aircraft_histories/1 GET /aircraft_histories/1.xml
def show @aircraft_history = AircraftHistory.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @aircraft_history } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end", "def index\n #@histories = History.all\n @histories = History.find( :all, ...
[ "0.69748545", "0.66913915", "0.66322863", "0.6499734", "0.64886814", "0.63193476", "0.622778", "0.62066996", "0.61777604", "0.61715925", "0.614232", "0.6087778", "0.60778946", "0.607693", "0.60368115", "0.6023199", "0.6017405", "0.59801674", "0.5979623", "0.5979623", "0.59787...
0.704304
0
GET /aircraft_histories/new GET /aircraft_histories/new.xml
def new @aircraft_history = AircraftHistory.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @aircraft_history } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @aircraft = Aircraft.find(params[:aircraft_id])\n @aircraft_history = @aircraft.aircraft_histories.create(params[:aircraft_history])\n redirect_to aircraft_path(@aircraft)\n end", "def new\n @hpt_history = HptHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n ...
[ "0.7092833", "0.69028634", "0.6814686", "0.6809867", "0.67817616", "0.67567396", "0.6713136", "0.6688578", "0.66781557", "0.6595214", "0.6587581", "0.6546707", "0.65267587", "0.6519798", "0.6519798", "0.65143394", "0.65130866", "0.65061", "0.6501725", "0.647719", "0.6475656",...
0.7760129
0
POST /aircraft_histories POST /aircraft_histories.xml
def create @aircraft = Aircraft.find(params[:aircraft_id]) @aircraft_history = @aircraft.aircraft_histories.create(params[:aircraft_history]) redirect_to aircraft_path(@aircraft) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n megam_rest.post_billedhistories(to_hash)\n end", "def new\n @aircraft_history = AircraftHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aircraft_history }\n end\n end", "def rss\n @event = Event.find_by_key(params['...
[ "0.6337723", "0.59994936", "0.588678", "0.58084923", "0.5748535", "0.5648055", "0.56187075", "0.5613745", "0.5592188", "0.55539745", "0.5476832", "0.54742116", "0.5469944", "0.5442814", "0.5433915", "0.5395365", "0.53786737", "0.5364867", "0.53593886", "0.5341449", "0.530511"...
0.7189772
0
PUT /aircraft_histories/1 PUT /aircraft_histories/1.xml
def update @aircraft_history = AircraftHistory.find(params[:id]) respond_to do |format| if @aircraft_history.update_attributes(params[:aircraft_history]) format.html { redirect_to(@aircraft_history, :notice => 'Aircraft history was successfully updated.') } format.xml { head :ok } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @aircraft = Aircraft.find(params[:aircraft_id])\n @aircraft_history = @aircraft.aircraft_histories.create(params[:aircraft_history])\n redirect_to aircraft_path(@aircraft)\n end", "def update\n @historical = Historical.find(params[:id])\n\n respond_to do |format|\n if @historica...
[ "0.6193407", "0.5949652", "0.5938229", "0.5921804", "0.5873809", "0.5821155", "0.5758614", "0.57473296", "0.57473296", "0.57378584", "0.5707945", "0.5655108", "0.5635162", "0.5596993", "0.5574498", "0.5565909", "0.5565576", "0.55444473", "0.55292416", "0.5521721", "0.551546",...
0.6375209
0
DELETE /aircraft_histories/1 DELETE /aircraft_histories/1.xml
def destroy @aircraft_history = AircraftHistory.find(params[:id]) @aircraft_history.destroy respond_to do |format| format.html { redirect_to(aircraft_histories_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @accessory = Accessory.find(params[:id])\n @accessory.destroy\n\n respond_to do |format|\n format.html { redirect_to(accessories_url) }\n format.xml { head :ok }\n end\n end", "d...
[ "0.6688579", "0.65868336", "0.6505595", "0.6488745", "0.6483323", "0.6396523", "0.6394068", "0.63887805", "0.63262826", "0.6304719", "0.6303515", "0.62910354", "0.6268343", "0.6266102", "0.62575483", "0.62019557", "0.6197609", "0.6196667", "0.618626", "0.61861223", "0.6182908...
0.7139268
0
Dump one fact type.
def fact_type_dump(fact_type, name) @fact_types_dumped[fact_type] = true return objectified_fact_type_dump(fact_type.entity_type) if fact_type.entity_type puts fact_type.scala_definition @metamodel << fact_type.scala_metamodel end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fact_type_dump_with_dependents(fact_type)\n fact_type.ordered_dumped!\n return if skip_fact_type(fact_type)\n\n if (et = fact_type.entity_type) &&\n fact_type.all_role.size > 1 &&\n (pi = et.preferred_identifier) &&\n pi.role_sequence.all_role_r...
[ "0.6774727", "0.67335397", "0.6292088", "0.62656057", "0.6161495", "0.5973203", "0.5946446", "0.5662874", "0.56528383", "0.5648619", "0.56041765", "0.56018597", "0.5573867", "0.5552066", "0.55419964", "0.5519449", "0.55164355", "0.5495487", "0.54875857", "0.5486334", "0.54581...
0.83341646
0
authenticate_admin GET /user_funs GET /user_funs.json
def index @user_funs = UserFun.all respond_to do |format| format.html # index.html.erb format.json { render :json => @user_funs } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_fun }\n end\n end", "def show\n @user_fun = UserFun.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n form...
[ "0.67171574", "0.67171574", "0.6575392", "0.63004786", "0.6248893", "0.6089287", "0.60848415", "0.60662574", "0.60122967", "0.59738284", "0.5918241", "0.5916683", "0.59052306", "0.5879071", "0.5876672", "0.58741665", "0.5865761", "0.5865761", "0.5844039", "0.5844039", "0.5841...
0.6774119
0
GET /user_funs/new GET /user_funs/new.json
def new @user_fun = UserFun.new respond_to do |format| format.html # new.html.erb format.json { render :json => @user_fun } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @fun = Fun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @fun }\n end\n end", "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n e...
[ "0.73716295", "0.73560536", "0.73407894", "0.72152513", "0.7164537", "0.71468985", "0.70103586", "0.695236", "0.69225395", "0.6912087", "0.69076306", "0.6899815", "0.6872671", "0.6872671", "0.6868551", "0.68684214", "0.6860861", "0.6847907", "0.6823381", "0.6823381", "0.68233...
0.78505397
1
PUT /user_funs/1 PUT /user_funs/1.json
def update @user_fun = UserFun.find(params[:id]) respond_to do |format| if @user_fun.update_attributes(params[:user_fun]) format.html { redirect_to @user_fun, :notice => 'User fun was successfully updated.' } format.json { head :no_content } else format.html { render :action...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @fun.update(fun_params)\n format.html { redirect_to @fun, notice: 'Fun was successfully updated.' }\n format.json { render :show, status: :ok, location: @fun }\n else\n format.html { render :edit }\n format.json { render json: @fun.e...
[ "0.6353547", "0.6350216", "0.6221167", "0.6041664", "0.600621", "0.60039973", "0.59994996", "0.598807", "0.598807", "0.5945116", "0.583446", "0.580848", "0.5807766", "0.5788849", "0.57870704", "0.5733116", "0.57325166", "0.5731583", "0.57263786", "0.57020533", "0.5671742", ...
0.7342087
1
DELETE /user_funs/1 DELETE /user_funs/1.json
def destroy @user_fun = UserFun.find(params[:id]) @user_fun.destroy respond_to do |format| format.html { redirect_to user_funs_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @fun = Fun.find(params[:id])\n @fun.destroy\n\n respond_to do |format|\n format.html { redirect_to funs_url }\n format.json { head :no_content }\n end\n end", "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end", "...
[ "0.6992293", "0.69635135", "0.68825", "0.68398446", "0.68136066", "0.67572737", "0.6698803", "0.66330427", "0.66330427", "0.663094", "0.6623205", "0.66100335", "0.6599963", "0.65765154", "0.65672076", "0.65511775", "0.6548282", "0.6539716", "0.6539565", "0.65371895", "0.65352...
0.76978886
1
authenticate_user register fun POST /user_funs POST /user_funs.json create INPUT: fun_id (value) OUTPUT: SAVE user_fun (UserFun.object), fun.popularity +1 FROM: views/funs/list_selected TO: 2012.7.6 Yueying
def create hash = params[:register] if hash != nil user_fun = UserFun.new user_fun.user_id = current_user.id hash_invert = hash.invert user_fun.fun_id = hash_invert.values_at("register").first.to_i user_fun.save fun = user_fun.fun sql = ActiveRecord::Base.connection(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n hash = params[:register]\n\n if hash != nil\n user_fun = UserFun.new\n user_fun.user_id = session[:user_id]\n hash_invert = hash.invert\n user_fun.fun_id = hash_invert.values_at(\"register\").first.to_i\n user_fun.save\n\n fun = user_fun.fun\n sql = ActiveReco...
[ "0.81044847", "0.62539935", "0.62117267", "0.62008613", "0.6184326", "0.5888632", "0.5888632", "0.58826387", "0.58337003", "0.58322114", "0.58198047", "0.57927793", "0.57707685", "0.57703114", "0.5749007", "0.57120514", "0.5696879", "0.5694718", "0.56727064", "0.5668079", "0....
0.8103665
1
attend fun attend INPUT: user_fun_id (value), user_id (session value) OUTPUT: SAVE user_point, team_point, user_fun.attend FROM: /views/funs/my_fun_list TO: 2012.7.17 Yueying
def attend # update user_fun.is_attend user_fun = UserFun.find(params[:user_fun_id]) user_fun.update_attribute(:is_attend, 1) # save user_point user_point = UserPoint.new user_point.add_point(current_user.id, 30000, 'fun') # save team_point team_point = TeamPoint.new team = Tea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attend\n\n @event = Event.find(params[:id])\n if attending?\n @text = \"unattended\"\n else\n @attendee =@event.attendees.create(user_id: current_user.id)\n @text = \"attending\"\n end\n redirect_to event_path(@event)\n end", "def invite\n \...
[ "0.5802408", "0.56107306", "0.55837446", "0.5581934", "0.5563374", "0.5479594", "0.54458916", "0.5440408", "0.5437752", "0.5430034", "0.5400913", "0.5358919", "0.5355068", "0.53386754", "0.5335862", "0.5323309", "0.531489", "0.53122133", "0.52920073", "0.5260539", "0.5234853"...
0.75433725
0
Downloads the source file to the destination file. It is up to implementors of this class to handle the logic.
def download!(source_url, destination_file); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_file(source, destination, targets)\n destination = File.expand_path(destination, Dir.pwd)\n targets = inventory.get_targets(targets)\n\n with_benchmark do\n executor.download_file(targets, source, destination)\n end\n end", "def download_bad_way(destination_path, so...
[ "0.664336", "0.65572953", "0.6548299", "0.64787436", "0.646987", "0.63807416", "0.63784015", "0.63293827", "0.6324968", "0.63138986", "0.62876976", "0.62316144", "0.6208024", "0.61742264", "0.61642087", "0.6158972", "0.6158867", "0.6157813", "0.61549294", "0.61214465", "0.611...
0.7652758
0
GET /outmails GET /outmails.json
def index @outmails = Outmail.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @outmessages = Outmessage.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @outmessages }\n end\n end", "def index\n @emails = Email.all\n json_response(@emails)\n end", "def index\n @emails = @user.emails\n\n r...
[ "0.6662594", "0.6617626", "0.6471754", "0.6471754", "0.6435658", "0.63467026", "0.6313058", "0.6282166", "0.62671053", "0.6201223", "0.6184651", "0.60781384", "0.607289", "0.6066874", "0.604244", "0.6040889", "0.60359544", "0.5984598", "0.59760356", "0.59663045", "0.59570825"...
0.75974256
0
POST /outmails POST /outmails.json
def create @outmail = Outmail.new(outmail_params) respond_to do |format| if @outmail.save format.html { redirect_to @outmail, notice: 'Outmail was successfully created.' } format.json { render :show, status: :created, location: @outmail } else format.html { render :new } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def outmail_params\n params.require(:outmail).permit(:title, :to, :datesend, :mailtext, :response)\n end", "def index\n @outmails = Outmail.all\n end", "def destroy\n @outmail.destroy\n respond_to do |format|\n format.html { redirect_to outmails_url, notice: 'Outmail was successfully des...
[ "0.66350275", "0.64947957", "0.6109473", "0.5841467", "0.58384764", "0.5626277", "0.5548303", "0.55094033", "0.5487426", "0.54558563", "0.52912575", "0.5282537", "0.5274942", "0.5267035", "0.52233577", "0.5219571", "0.52139235", "0.5199292", "0.51882917", "0.5153854", "0.5089...
0.69465715
0
PATCH/PUT /outmails/1 PATCH/PUT /outmails/1.json
def update respond_to do |format| if @outmail.update(outmail_params) format.html { redirect_to @outmail, notice: 'Outmail was successfully updated.' } format.json { render :show, status: :ok, location: @outmail } else format.html { render :edit } format.json { render json...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n remove_email_dependencies\n migrate_template_to_email\n respond_to do |format|\n if @email.save\n build_emails\n format.html {redirect_to emails_url, notice: 'Email was updated.'}\n format.json {render :index, status: :ok }\n else\n format.html {render :e...
[ "0.6490116", "0.6359001", "0.6267009", "0.61628485", "0.61537343", "0.6149882", "0.6140833", "0.61353207", "0.6077239", "0.60719633", "0.60473126", "0.6039272", "0.6033884", "0.6032661", "0.6022152", "0.6011104", "0.6011002", "0.5973488", "0.59649724", "0.59647995", "0.595535...
0.70983607
0
DELETE /outmails/1 DELETE /outmails/1.json
def destroy @outmail.destroy respond_to do |format| format.html { redirect_to outmails_url, notice: 'Outmail was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @mail.destroy\n respond_to do |format|\n format.html { redirect_to mails_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ourmail.destroy\n respond_to do |format|\n format.html { redirect_to ourmails_url }\n format.json { head :no_content }\...
[ "0.7261736", "0.71905136", "0.7028897", "0.6978332", "0.6911046", "0.6895673", "0.68913597", "0.68913597", "0.68858176", "0.68458706", "0.6802125", "0.67750746", "0.67691565", "0.67633086", "0.67427605", "0.67371416", "0.6714568", "0.6711987", "0.670825", "0.67059284", "0.670...
0.7249165
1
Return a unary minus function
def unary_minus UnaryMinus.new(self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unary\n if match?(:bang, :minus)\n operator = previous\n right = unary\n return Ringo::Unary.new(operator, right)\n end\n\n return call\n end", "def negative(num)\n - num.abs\nend", "def unary\r\n if consume(\"+\")\r\n unary()\r\n elsif consume(\"-\")\r\n new...
[ "0.77617466", "0.7279514", "0.72100866", "0.7196679", "0.71557677", "0.7085589", "0.7085589", "0.7085589", "0.7085589", "0.7055862", "0.7007924", "0.69345987", "0.6868508", "0.6864128", "0.6864128", "0.6864128", "0.6864128", "0.68543804", "0.6849356", "0.6844577", "0.68321157...
0.8064377
0
Returns a new +Mail::Part+ with the same content and MIME headers as the message passed as an argument. Although Mail gem provides +Mail::Messageconvert_to_multipart+ method, it works correctly for nonmultipart text/plain messages only. This method is more robust, and handles messages containing any content type, be th...
def body_to_part(message) part = ::Mail::Part.new part.content_type = message.content_type if message.multipart? message.body.parts.each { |p| part.add_part duplicate_part(p) } else part.body = message.body.decoded end part end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(headers, body)\n content_type = headers['Content-Type']\n boundary = content_type.parameters['boundary']\n\n if boundary.nil?\n raise Malformed.new(\"Expected multipart Content-Type header to contain 'boundary' parameter\",\n 1)\n else...
[ "0.61831546", "0.60385853", "0.60258377", "0.59242654", "0.569401", "0.5650386", "0.556802", "0.55310506", "0.55279696", "0.5503629", "0.5468469", "0.5391712", "0.5383793", "0.5360579", "0.5327401", "0.52827686", "0.52722377", "0.5253468", "0.52444655", "0.52317613", "0.51520...
0.73677135
0
Duplicates a message part, preserving its ContentID if present.
def duplicate_part(part) duplicate = part.dup duplicate.add_content_id(part.content_id) unless part.content_id.nil? duplicate end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def duplicate\n dup_frames = @msg_frames.map {|frame| frame.dup}\n ZMQ::StringMultipartMessage.new(dup_frames)\n end", "def duplicate\n dup_frames = @msg_frames.map {|frame| frame.duplicate}\n ZMQ::RawMultipartMessage.new(dup_frames)\n end", "def set_duplicate_message(message, clone)\...
[ "0.6750182", "0.6711373", "0.6142976", "0.59297216", "0.56527936", "0.561795", "0.56056607", "0.55850834", "0.5555147", "0.5487492", "0.5387761", "0.5357841", "0.534906", "0.53393614", "0.5322278", "0.5310345", "0.5227316", "0.52197605", "0.518457", "0.517322", "0.5138059", ...
0.77275276
0
Detects email which should be used to find a message signer key. Basically, it is taken from the message +From:+ field, but may be overwritten by +:signer+ adapter option.
def find_signer_for(message) options[:signer] || message.from_addrs.first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sender_email\n msg['from_email'] || msg['sender'] || entry['sender'] || reject['sender']\n end", "def from_email\n AppConfig[:pui_request_email_fallback_from_address]\n end", "def mail_from\n if @yaml[\"mail\"][\"from\"] != \"example@example.com\"\n return @yaml[\"mail\"][\"from\"]\...
[ "0.6344786", "0.6035565", "0.59352106", "0.5764179", "0.5728069", "0.56504536", "0.5629755", "0.5609708", "0.54774934", "0.5453946", "0.5441865", "0.54181695", "0.5406117", "0.54011726", "0.5400863", "0.53920156", "0.53900605", "0.5389332", "0.5374156", "0.5355137", "0.534385...
0.69793427
0
Replaces a message body. Clears all the existing body, be it multipart or not, and then appends parts passed as an argument.
def rewrite_body(message, content_type:, parts: []) message.body = nil message.content_type = content_type parts.each { |p| message.add_part(p) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replace_in_pure_html_message(new_part)\n if new_part.content_type.include?('text/html')\n message.body = new_part.decoded\n message.content_type = new_part.content_type\n else\n message.body = nil\n message.content_type = new_part.content_type\n new_pa...
[ "0.6492179", "0.6316403", "0.63132346", "0.6295004", "0.6236843", "0.59948057", "0.5994469", "0.5994469", "0.5964942", "0.5960431", "0.59463966", "0.58319706", "0.58181804", "0.577461", "0.5750326", "0.57361454", "0.57271147", "0.57247853", "0.5715063", "0.57140785", "0.57105...
0.79076236
0
Importing translations for given page. They look like `content.locale.html`
def import_translations(path, page) old_translations = page.translations.pluck(:locale) new_translations = [] Dir["#{path}content.*.html"].each do |file_path| locale = File.basename(file_path).match(%r{content\.(\w+)\.html})[1] new_translations << locale translation = page.tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def i18n\n %w(en es).each do |locale|\n copy_file \"i18n.#{ locale }.yml\", \"config/locales/seo_landing_pages.#{ locale }.yml\"\n end\n end", "def seed_page_content_translations!\n I18n.available_locales.each do |locale|\n seed_content_for_locale locale.to_s\n end\n end",...
[ "0.66005903", "0.6434012", "0.6153062", "0.6153062", "0.60005456", "0.60005456", "0.5946621", "0.59438527", "0.59423167", "0.58755416", "0.5845026", "0.58390385", "0.57943356", "0.5731144", "0.57250303", "0.57180715", "0.57020986", "0.5696444", "0.56761223", "0.5607724", "0.5...
0.75523263
0