_id stringlengths 2 6 | title stringlengths 9 130 | partition stringclasses 3
values | text stringlengths 30 4.3k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q9500 | LolitaPaypal.TransactionsController.set_active_payment | train | def set_active_payment
@payment ||= session[:payment_data][:billing_class].constantize.find(session[:payment_data][:billing_id])
rescue
| ruby | {
"resource": ""
} |
q9501 | DwCAContentAnalyzer.FileContents.headers | train | def headers(file)
Array.new(CSV.open(file, | ruby | {
"resource": ""
} |
q9502 | Machined.Sprocket.use_all_templates | train | def use_all_templates
Utils.available_templates.each do |ext, template|
next if engines(ext)
| ruby | {
"resource": ""
} |
q9503 | Fetch.Callbacks.run_callbacks_for | train | def run_callbacks_for(name, args, reverse)
callbacks_for(name, reverse).map do |block|
| ruby | {
"resource": ""
} |
q9504 | Announcer.Subscription._determine_path | train | def _determine_path
path = File.expand_path('../..', __FILE__)
# Will be something like:
# "/path/to/file.rb:47:in `method_name'"
non_announcer_caller = caller.find { |c| !c.start_with?(path) }
unless non_announcer_caller
| ruby | {
"resource": ""
} |
q9505 | Announcer.Subscription._generate_identifier | train | def _generate_identifier
# Cut off everything from the line number onward. That way, the identifier
# does not change when the subscription block moves to a different line. | ruby | {
"resource": ""
} |
q9506 | Announcer.Subscription._evaluate_priority_int | train | def _evaluate_priority_int(int)
raise Errors::InvalidPriorityError, int unless int > | ruby | {
"resource": ""
} |
q9507 | Announcer.Subscription._evaluate_priority_symbol | train | def _evaluate_priority_symbol(sym)
if (priority = _symbol_to_priority(sym))
_evaluate_priority(priority)
else
| ruby | {
"resource": ""
} |
q9508 | Announcer.Subscription._evaluate_priority_nil | train | def _evaluate_priority_nil
# Need to specify value explicitly here, otherwise in the call to
# _evaluate_priority, the case statement won't recognize it as a Symbol.
| ruby | {
"resource": ""
} |
q9509 | LolitaPaypal.ApplicationHelper.encrypt_request | train | def encrypt_request(payment_request)
variables = payment_request.request_variables.reverse_merge({
'notify_url'=> answer_paypal_url(protocol: 'https') | ruby | {
"resource": ""
} |
q9510 | Musako.Configuration.read_config_file | train | def read_config_file
c = clone
config = YAML.load_file(File.join(DEFAULTS[:source], "config.yml"))
unless config.is_a? Hash
raise ArgumentError.new("Configuration file: invalid #{file}")
| ruby | {
"resource": ""
} |
q9511 | Ichiban.Helpers.path_with_slashes | train | def path_with_slashes(path)
path = '/' + path unless path.start_with?('/')
path << | ruby | {
"resource": ""
} |
q9512 | Checkdin.Votes.votes | train | def votes(options={})
response = connection.get do |req|
req.url "votes", options
end | ruby | {
"resource": ""
} |
q9513 | FentonShell.Client.create | train | def create(global_options, options)
status, body = client_create(global_options, options)
if status == 201
save_message('Client': ['created!']) | ruby | {
"resource": ""
} |
q9514 | FentonShell.Client.create_with_organization | train | def create_with_organization(global_options, options)
create(global_options, options)
if Organization.new.create(global_options, name: options[:username],
| ruby | {
"resource": ""
} |
q9515 | FentonShell.Client.client_json | train | def client_json(options)
{
client: {
username: options[:username],
name: options[:name],
email: options[:email],
| ruby | {
"resource": ""
} |
q9516 | Scat.Authorization.perform! | train | def perform!(email, password, &block)
login_required
| ruby | {
"resource": ""
} |
q9517 | Attention.Publisher.publish | train | def publish(channel, value)
redis = Attention.redis.call
| ruby | {
"resource": ""
} |
q9518 | Attention.Publisher.payload_for | train | def payload_for(value)
case value
when Array, Hash
JSON.dump value
else
| ruby | {
"resource": ""
} |
q9519 | AzureJwtAuth.JwtManager.custom_valid? | train | def custom_valid?
@provider.validations.each do |key, value|
| ruby | {
"resource": ""
} |
q9520 | AzureJwtAuth.JwtManager.rsa_decode | train | def rsa_decode
kid = header['kid']
try = false
begin
rsa = @provider.keys[kid]
raise KidNotFound, 'kid not found into provider keys' unless rsa
JWT.decode(@jwt, rsa.public_key, true, algorithm: 'RS256')
| ruby | {
"resource": ""
} |
q9521 | Vigilem::Core.Hooks.run_hook | train | def run_hook(hook_name, *args, &block)
hooks.find | ruby | {
"resource": ""
} |
q9522 | StixSchemaSpy.ComplexType.vocab_values | train | def vocab_values
type = Schema.find(self.schema.prefix, stix_version).find_type(name.gsub("Vocab", "Enum"))
| ruby | {
"resource": ""
} |
q9523 | Coach.Entity.fetch | train | def fetch
assert_has_uri!
response = client.get clean_uri, query: { start: 0, size: 10000 }
| ruby | {
"resource": ""
} |
q9524 | Funl.Message.to_msgpack | train | def to_msgpack(pk = nil)
case pk
when MessagePack::Packer
pk.write_array_header(6)
pk.write @client_id
pk.write @local_tick
pk.write @global_tick
pk.write @delta
pk.write @tags
| ruby | {
"resource": ""
} |
q9525 | Retentiongrid.Resource.attributes | train | def attributes
self.class::ATTRIBUTES_NAMES.inject({}) do |attribs, attrib_name|
value = self.send(attrib_name)
| ruby | {
"resource": ""
} |
q9526 | ODBA.Persistable.odba_cut_connection | train | def odba_cut_connection(remove_object)
odba_potentials.each { |name|
var = instance_variable_get(name)
| ruby | {
"resource": ""
} |
q9527 | ODBA.Persistable.odba_take_snapshot | train | def odba_take_snapshot
@odba_snapshot_level ||= 0
snapshot_level = @odba_snapshot_level.next
current_level = [self]
tree_level = 0
while(!current_level.empty?)
tree_level += 1
obj_count = 0
next_level = []
current_level.each { |item|
if(item.odba_unsaved?(snapshot_level))
obj_c... | ruby | {
"resource": ""
} |
q9528 | Scholar.Citation.to_hash | train | def to_hash
hash = {}
instance_variables.each do |v|
hash[v.to_s[1..-1].to_sym] | ruby | {
"resource": ""
} |
q9529 | Notifaction.Helpers.deprecation_notice | train | def deprecation_notice(version, config = {})
handler = Notifaction::Type::Terminal.new
| ruby | {
"resource": ""
} |
q9530 | Mysql2Model.Composer.compose_sql | train | def compose_sql(*statement)
raise PreparedStatementInvalid, "Statement is blank!" if statement.blank?
if statement.is_a?(Array)
| ruby | {
"resource": ""
} |
q9531 | Mysql2Model.Composer.compose_sql_array | train | def compose_sql_array(ary)
statement, *values = ary
if values.first.is_a?(Hash) and statement =~ /:\w+/
replace_named_bind_variables(statement, values.first)
elsif statement.include?('?')
replace_bind_variables(statement, | ruby | {
"resource": ""
} |
q9532 | LatoBlog.Tag::SerializerHelpers.serialize | train | def serialize
serialized = {}
# set basic info
serialized[:id] = id
serialized[:title] = title
serialized[:meta_language] = meta_language
serialized[:meta_permalink] = meta_permalink
| ruby | {
"resource": ""
} |
q9533 | Ichiban.Deleter.delete_dest | train | def delete_dest(path)
file = Ichiban::ProjectFile.from_abs(path)
# file will be nil if the path doesn't map to a known subclass of IchibanFile. Furthermore,
# even if file is not nil, it may be a kind of IchibanFile that does not have a destination.
if file and file.has_dest?
dest = file... | ruby | {
"resource": ""
} |
q9534 | Couchbase.Model.delete | train | def delete(options = {})
raise Couchbase::Error::MissingId, 'missing id attribute' unless @id
| ruby | {
"resource": ""
} |
q9535 | Couchbase.Model.reload | train | def reload
raise Couchbase::Error::MissingId, 'missing id attribute' unless @id
pristine = model.find(@id)
| ruby | {
"resource": ""
} |
q9536 | Orchestrate::API.Request.perform | train | def perform
uri = URI(url)
response = Net::HTTP.start(uri.hostname, uri.port,
:use_ssl => uri.scheme == 'https' ) { |http|
| ruby | {
"resource": ""
} |
q9537 | Octo.Trendable.aggregate_sum | train | def aggregate_sum(aggr)
sum = {}
aggr.each do |ts, counterVals|
sum[ts] = {} unless sum.has_key?ts
counterVals.each do |obj, count|
if obj.respond_to?(:enterprise_id)
| ruby | {
"resource": ""
} |
q9538 | Sortifiable.InstanceMethods.add_to_list | train | def add_to_list
if in_list?
move_to_bottom
else
list_class.transaction do
ids = lock_list!
last_position = ids.size
if persisted?
update_position last_position + 1
| ruby | {
"resource": ""
} |
q9539 | LatoBlog.FieldsHelper.render_post_fields | train | def render_post_fields(post)
post_fields = post.post_fields.visibles.roots.order('position | ruby | {
"resource": ""
} |
q9540 | LatoBlog.FieldsHelper.render_post_field | train | def render_post_field(post_field, key_parent = 'fields')
# define key
key = "#{key_parent}[#{post_field.id}]"
# render correct field
case post_field.typology
when 'text'
render_post_field_text(post_field, key)
when 'textarea'
render_post_field_textarea(post_field, key... | ruby | {
"resource": ""
} |
q9541 | Stylesheet.FakeRequest.get | train | def get(url)
begin
uri = URI.parse(url.strip)
rescue URI::InvalidURIError
uri = URI.parse(URI.escape(url.strip))
| ruby | {
"resource": ""
} |
q9542 | ICU.Player.renumber | train | def renumber(map)
raise "player number #{@num} not found in renumbering hash" | ruby | {
"resource": ""
} |
q9543 | ICU.Player.merge | train | def merge(other)
raise "cannot merge two players that are not equal" unless self == other
[:id, :fide_id, :rating, :fide_rating, :title, :fed, :gender].each do |m|
| ruby | {
"resource": ""
} |
q9544 | Kawaii.ServerMethods.start! | train | def start!(port) # @todo Support other handlers http://www.rubydoc.info/github/rack/rack/Rack/Handler
Rack::Handler.get(WEBRICK).run(self, Port: port) do |s|
@server = s
at_exit { stop! }
[:INT, :TERM].each do | ruby | {
"resource": ""
} |
q9545 | RsMule.RunExecutable.run_executable | train | def run_executable(tags, executable, options={})
options = {
:executable_type => "auto",
:right_script_revision => "latest",
:tag_match_strategy => "all",
:inputs => {},
:update_inputs => []
}.merge(options)
execute_params = {}
tags = [tags] unle... | ruby | {
"resource": ""
} |
q9546 | RsMule.RunExecutable.right_script_revision_from_lineage | train | def right_script_revision_from_lineage(lineage, revision="latest")
right_script = nil
if revision == "latest"
latest_script = lineage.max_by{|rs| rs.revision}
right_script = latest_script
else
desired_script = lineage.select{|rs| rs.revision == revision}
if desired_scri... | ruby | {
"resource": ""
} |
q9547 | StorageRoom.Array.each_page_each_resource | train | def each_page_each_resource(args={})
self.each_page(args) do |page| | ruby | {
"resource": ""
} |
q9548 | Diffbot.Article.extract_article | train | def extract_article
api_response = request.get article_endpoint, token: Diffbot.token, url: @url
| ruby | {
"resource": ""
} |
q9549 | Vigilem.Assembly.find_stat | train | def find_stat(opts={}, &block)
stats = Core::Stat.all_available
# @fixme just grabs first
stat = if stats.size > 1
[*opts[:platform_defaults]].map do |os_pattern, gem_name|
if System.check[:os][os_pattern]
stats.select {|stat| stat.gem_name == gem_name }
if s... | ruby | {
"resource": ""
} |
q9550 | ChoresKit.Chore.task | train | def task(options, &block)
name, params = *options
raise "Couldn't create task without a name" if name.nil?
raise "Couldn't create task without a block" unless block_given?
task = Task.new(name, | ruby | {
"resource": ""
} |
q9551 | JiraIssues.JiraQuery.jql_query | train | def jql_query(query)
result = adapter.jql(query, fields:[:description, :summary, :created, :status, :issuetype, :priority, :resolutiondate], max_results: @query_max_results)
| ruby | {
"resource": ""
} |
q9552 | Mongolicious.Filesystem.compress | train | def compress(path, compress_tar_file)
Mongolicious.logger.info("Compressing database #{path}")
system("cd #{path} && tar -cpf#{compress_tar_file ? 'j' : ''} #{path}.tar.bz2 .")
raise "Error while compressing #{path}" if | ruby | {
"resource": ""
} |
q9553 | Mongolicious.Filesystem.cleanup_tar_file | train | def cleanup_tar_file(path)
Mongolicious.logger.info("Cleaning up local path #{path}")
begin
File.delete(path)
rescue => exception
Mongolicious.logger.error("Error | ruby | {
"resource": ""
} |
q9554 | Mongolicious.Filesystem.cleanup_parts | train | def cleanup_parts(file_parts)
Mongolicious.logger.info("Cleaning up file parts.")
if file_parts
file_parts.each do |part|
Mongolicious.logger.info("Deleting part: #{part}")
begin
File.delete(part)
rescue => exception
| ruby | {
"resource": ""
} |
q9555 | DealRedemptions.RedeemController.validate_code | train | def validate_code
redeem_code = DealRedemptions::RedeemCode.find_by_code(params[:code])
if redeem_code
@redeem = | ruby | {
"resource": ""
} |
q9556 | FlexibleApi.ClassMethods.define_request_level | train | def define_request_level(name, &block)
level = RequestLevel.new(name, self)
level.instance_eval &block | ruby | {
"resource": ""
} |
q9557 | FlexibleApi.ClassMethods.find_hash | train | def find_hash(id, options = {})
options.assert_valid_keys(:request_level)
level = find_level(options[:request_level])
record = self.find(id, | ruby | {
"resource": ""
} |
q9558 | FlexibleApi.ClassMethods.find_level | train | def find_level(name = nil)
@levels ||= {}
level = name.nil? ? load_default_request_level : @levels[name.to_sym]
level = superclass.find_level(name) and @levels[name.to_sym] = level if level.nil? && | ruby | {
"resource": ""
} |
q9559 | ActionDispatch::Routing.Mapper.use_reaction | train | def use_reaction(opts = {})
raise RuntimeError, 'Already using Reaction.' if Reaction.client
opts = use_reaction_defaults opts
EM.next_tick {
faye = Faye::Client.new(opts[:at] + '/bayeux')
| ruby | {
"resource": ""
} |
q9560 | CloudCrooner.Storage.upload_files | train | def upload_files
files_to_upload = local_compiled_assets.reject { |f| exists_on_remote?(f) }
files_to_upload.each | ruby | {
"resource": ""
} |
q9561 | CloudCrooner.Storage.upload_file | train | def upload_file(f)
# grabs the compiled asset from public_path
full_file_path = File.join(File.dirname(@manifest.dir), f)
one_year = 31557600
mime = Rack::Mime.mime_type(File.extname(f))
file = {
:key => f,
:public => true,
:content_type => mime,
:cache_con... | ruby | {
"resource": ""
} |
q9562 | Undies.API.__yield | train | def __yield
return if (source = @_undies_source_stack.pop).nil?
if source.file?
instance_eval(source.data, | ruby | {
"resource": ""
} |
q9563 | Rink.Console.apply_options | train | def apply_options(options)
return unless options
options.each do |key, value|
options[key] = value.call if value.kind_of?(Proc)
end
@_options ||= {}
@_options.merge! options
@input = setup_input_method(options[:input] || @input)
@output = setup_output_method(opt... | ruby | {
"resource": ""
} |
q9564 | Rink.Console.autocomplete | train | def autocomplete(line)
return [] unless @line_processor
result = @line_processor.autocomplete(line, namespace)
case result
when String
[result]
| ruby | {
"resource": ""
} |
q9565 | Maestro.MaestroWorker.perform | train | def perform(action, workitem)
@action, @workitem = action, workitem
send(action)
write_output('') # Triggers any remaining buffered output to be sent
run_callbacks
rescue MaestroDev::Plugin::PluginError => e
write_output('') # Triggers any remaining buffered output to be sent
set... | ruby | {
"resource": ""
} |
q9566 | Maestro.MaestroWorker.handle_exception | train | def handle_exception(e)
if self.class.exception_handler_method
send(self.class.exception_handler_method, e)
elsif self.class.exception_handler_block | ruby | {
"resource": ""
} |
q9567 | Maestro.MaestroWorker.save_output_value | train | def save_output_value(name, value)
set_field(CONTEXT_OUTPUTS_META, {}) if get_field(CONTEXT_OUTPUTS_META).nil?
| ruby | {
"resource": ""
} |
q9568 | Maestro.MaestroWorker.read_output_value | train | def read_output_value(name)
if get_field(PREVIOUS_CONTEXT_OUTPUTS_META).nil?
set_field(CONTEXT_OUTPUTS_META, {}) if get_field(CONTEXT_OUTPUTS_META).nil?
| ruby | {
"resource": ""
} |
q9569 | Maestro.MaestroWorker.set_waiting | train | def set_waiting(should_wait)
workitem[WAITING_META] = should_wait
send_workitem_message
rescue Exception => e | ruby | {
"resource": ""
} |
q9570 | Maestro.MaestroWorker.cancel | train | def cancel
workitem[CANCEL_META] = true
send_workitem_message
rescue Exception => e
Maestro.log.warn "Failed To Send Cancel Message To Server | ruby | {
"resource": ""
} |
q9571 | Maestro.MaestroWorker.not_needed | train | def not_needed
workitem[NOT_NEEDED] = true
send_workitem_message
rescue Exception => e
Maestro.log.warn "Failed To Send Not Needed Message | ruby | {
"resource": ""
} |
q9572 | Maestro.MaestroWorker.update_fields_in_record | train | def update_fields_in_record(model, name_or_id, record_field, record_value)
workitem[PERSIST_META] = true
workitem[UPDATE_META] = true
workitem[MODEL_META] = model
workitem[RECORD_ID_META] = name_or_id.to_s
workitem[RECORD_FIELD_META] = | ruby | {
"resource": ""
} |
q9573 | Maestro.MaestroWorker.get_field | train | def get_field(field, default = nil)
value = fields[field]
value | ruby | {
"resource": ""
} |
q9574 | Maestro.MaestroWorker.add_link | train | def add_link(name, url)
set_field(LINKS_META, []) if fields[LINKS_META].nil?
| ruby | {
"resource": ""
} |
q9575 | Maestro.MaestroWorker.as_int | train | def as_int(value, default = 0)
res = default
if value
if value.is_a?(Fixnum)
res = value
| ruby | {
"resource": ""
} |
q9576 | Maestro.MaestroWorker.as_boolean | train | def as_boolean(value)
res = false
if value
if value.is_a?(TrueClass) || value.is_a?(FalseClass)
res = value
elsif value.is_a?(Fixnum)
res = value != 0
elsif value.respond_to?(:to_s)
| ruby | {
"resource": ""
} |
q9577 | SortRank.Solver.parse | train | def parse(args={})
string_block = args.fetch(:text, nil)
string_block = sample_string_block if !string_block.present?
result_hash | ruby | {
"resource": ""
} |
q9578 | DSLKit.ThreadLocal.instance_thread_local | train | def instance_thread_local(name, value = nil)
sc = class << self
extend DSLKit::ThreadLocal
self
| ruby | {
"resource": ""
} |
q9579 | DSLKit.ThreadGlobal.instance_thread_global | train | def instance_thread_global(name, value = nil)
sc = class << self
extend DSLKit::ThreadGlobal
self
| ruby | {
"resource": ""
} |
q9580 | DSLKit.Deflect.deflect_start | train | def deflect_start(from, id, deflector)
@@sync.synchronize do
Deflect.deflecting ||= DeflectorCollection.new
Deflect.deflecting.member?(from, id) and
raise DeflectError, "#{from}##{id} is already deflected"
Deflect.deflecting.add(from, id, deflector)
from.class_eval do
... | ruby | {
"resource": ""
} |
q9581 | DSLKit.Deflect.deflect | train | def deflect(from, id, deflector)
@@sync.synchronize do
begin
deflect_start(from, id, deflector)
yield
| ruby | {
"resource": ""
} |
q9582 | DSLKit.Deflect.deflect_stop | train | def deflect_stop(from, id)
@@sync.synchronize do
Deflect.deflecting.delete(from, id) or
raise DeflectError, "#{from}##{id} is not deflected | ruby | {
"resource": ""
} |
q9583 | DSLKit.MethodMissingDelegator.method_missing | train | def method_missing(id, *a, &b)
unless method_missing_delegator.nil? | ruby | {
"resource": ""
} |
q9584 | Redlander.Statement.subject | train | def subject
if instance_variable_defined?(:@subject)
@subject
else
rdf_node = Redland.librdf_statement_get_subject(rdf_statement)
| ruby | {
"resource": ""
} |
q9585 | Redlander.Statement.predicate | train | def predicate
if instance_variable_defined?(:@predicate)
@predicate
else
rdf_node = Redland.librdf_statement_get_predicate(rdf_statement)
| ruby | {
"resource": ""
} |
q9586 | Redlander.Statement.object | train | def object
if instance_variable_defined?(:@object)
@object
else
rdf_node = Redland.librdf_statement_get_object(rdf_statement)
| ruby | {
"resource": ""
} |
q9587 | Redlander.Statement.rdf_node_from | train | def rdf_node_from(source)
case source
when NilClass
nil
when Node
Redland.librdf_new_node_from_node(source.rdf_node) | ruby | {
"resource": ""
} |
q9588 | Datacraft.Runner.run | train | def run(instruction)
@inst = instruction
measurements = []
# run pre_build hooks
if @inst.respond_to? :pre_hooks
measurements << Benchmark.measure('pre build:') do
@inst.pre_hooks.each(&:call)
end
end
# process the rows
measurements << Benchmark.meas... | ruby | {
"resource": ""
} |
q9589 | Datacraft.Runner.report | train | def report(measurements)
width = measurements.max_by { |m| m.label.size }.label.size + 1
| ruby | {
"resource": ""
} |
q9590 | Datacraft.Runner.process | train | def process(row)
@inst.tweakers.each do |tweaker|
row = tweaker.tweak row
return nil unless row
| ruby | {
"resource": ""
} |
q9591 | Datacraft.Runner.pprocess_rows | train | def pprocess_rows
thread_number = [@inst.sources.size,
@inst.options[:n_threads]].min
queue = Queue.new
@inst.sources.each { |p| queue << p }
threads = thread_number.times.map do
Thread.new do
begin
| ruby | {
"resource": ""
} |
q9592 | Datacraft.Runner.build | train | def build(consumers)
consumers.each do |consumer|
consumer.build if consumer.respond_to? :build
| ruby | {
"resource": ""
} |
q9593 | Checkdin.Campaigns.campaigns | train | def campaigns(options={})
response = connection.get do |req|
| ruby | {
"resource": ""
} |
q9594 | Clea.Sender.get_sender_alias | train | def get_sender_alias
puts "What is your name?"
while @from_alias = gets.chomp
catch :badalias do
puts "Are you sure your name is #{@from_alias}? [y/n]:"
| ruby | {
"resource": ""
} |
q9595 | Clea.Sender.get_sender_gmail | train | def get_sender_gmail
puts "Enter your gmail address:"
while @from_address = gets.chomp
catch :badfrom do
if ValidateEmail.validate(@from_address) == true
puts "Is your email address #{@from_address}? [y/n]:"
while address_confirmation = gets.chomp
case... | ruby | {
"resource": ""
} |
q9596 | Clea.Sender.get_sender_password | train | def get_sender_password
puts "Enter your password:"
while @password = gets.chomp
catch :badpass do
puts "Are you sure your password is #{@password}? [y/n]:"
| ruby | {
"resource": ""
} |
q9597 | Clea.Sender.get_recipient_data | train | def get_recipient_data
puts "Enter the recipient's email address:"
while @to_address = gets.chomp
catch :badto do
if ValidateEmail.validate(@to_address) == true
puts "Is the recipient's email address #{@to_address}? [y/n]:"
while to_address_confirmation = gets.chomp... | ruby | {
"resource": ""
} |
q9598 | Clea.Sender.send_message | train | def send_message
# Read the user's password from the persistent hash
stored_password = @sender_info.transaction { @sender_info[:password] }
# Initialize the gmail SMTP connection and upgrade to SSL/TLS
smtp = Net::SMTP.new('smtp.gmail.com', 587)
smtp.enable_starttls
# Open SMTP conne... | ruby | {
"resource": ""
} |
q9599 | Socketlab.SocketlabRequest.set_response | train | def set_response(item_class_name)
if @api_response.success?
@total_count = @api_response["totalCount"]
@total_pages = @api_response["totalPages"]
@count = @api_response["count"]
@timestamp = @api_response["timestamp"]
@items = []
unless @api_response["collection"].n... | ruby | {
"resource": ""
} |
Subsets and Splits
SQL Console for CoIR-Retrieval/CodeSearchNet-ccr-ruby-queries-corpus
Retrieves a large number of entries in the 'ruby' language, providing basic information but limited analytical value.