_id stringlengths 2 6 | title stringlengths 9 130 | partition stringclasses 3
values | text stringlengths 30 4.3k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q7900 | RProgram.OptionList.method_missing | train | def method_missing(sym,*args,&block)
name = sym.to_s
unless block
if (name =~ /=$/ && args.length == 1)
return self[name.chop.to_sym] = args.first
| ruby | {
"resource": ""
} |
q7901 | HttpArchive.Archive.get_total_data | train | def get_total_data
size = calc_total_size.to_s
load_time = (@pages.first.on_load / 1000.0).to_s
| ruby | {
"resource": ""
} |
q7902 | HttpArchive.Archive.get_row_data | train | def get_row_data
rows = []
@entries.each do |entry|
method = entry.request.http_method
# get part after .com/ if any
url = entry.request.url
if url.end_with?("/")
ressource = entry.request.url
else
r = url.rindex("/")
| ruby | {
"resource": ""
} |
q7903 | Bisques.AwsRequest.make_request | train | def make_request
create_authorization
options = {}
options[:header] = authorization.headers.merge(
'Authorization' => authorization.authorization_header
)
options[:query] = query if query.any?
options[:body] = form_body if body
| ruby | {
"resource": ""
} |
q7904 | Bisques.AwsRequest.form_body | train | def form_body
if body.is_a?(Hash)
body.map do |k,v|
[AwsRequest.aws_encode(k), AwsRequest.aws_encode(v)].join("=")
| ruby | {
"resource": ""
} |
q7905 | Bisques.AwsRequest.create_authorization | train | def create_authorization
@authorization = AwsRequestAuthorization.new.tap do |authorization|
authorization.url = url
authorization.method = method
authorization.query = query
authorization.body = form_body
authorization.region = region
| ruby | {
"resource": ""
} |
q7906 | Bisques.Queue.retrieve | train | def retrieve(poll_time = 1)
response = client.receive_message(url, {"WaitTimeSeconds" => poll_time, "MaxNumberOfMessages" => 1})
raise QueueNotFound.new(self, "not found at #{url}") if response.http_response.status == 404
response.doc.xpath("//Message").map do |element|
attributes = Hash[*ele... | ruby | {
"resource": ""
} |
q7907 | Authorizable.Proxy.process_permission | train | def process_permission(permission, *args)
cached = value_from_cache(permission, *args)
if cached.nil?
| ruby | {
"resource": ""
} |
q7908 | Authorizable.Proxy.value_from_cache | train | def value_from_cache(permission, *args)
# object; Event, Discount, etc
o = args[0]
role = | ruby | {
"resource": ""
} |
q7909 | Authorizable.Proxy.evaluate_permission | train | def evaluate_permission(permission, *args)
# object; Event, Discount, etc
o = args[0]
# default to allow
result = true
role = get_role_of(o)
# evaluate procs
if (proc = PermissionUtilities.has_procs?(permission))
result &= proc.call(o, self)
end
# Here is... | ruby | {
"resource": ""
} |
q7910 | Authorizable.Proxy.has_role_with | train | def has_role_with(object)
if object.respond_to?(:user_id)
if object.user_id == actor.id
return IS_OWNER
else
return IS_UNRELATED
end
| ruby | {
"resource": ""
} |
q7911 | Threadz.ThreadPool.spawn_thread | train | def spawn_thread
Thread.new do
while true
x = @queue.shift
if x == Directive::SUICIDE_PILL
@worker_threads_count.decrement
Thread.current.terminate
| ruby | {
"resource": ""
} |
q7912 | Threadz.ThreadPool.spawn_watch_thread | train | def spawn_watch_thread
@watch_thread = Thread.new do
while true
# If there are idle threads and we're above minimum
if @queue.num_waiting > 0 && @worker_threads_count.value > @min_size # documented
@killscore += THREADS_IDLE_SCORE * @queue.num_waiting
#... | ruby | {
"resource": ""
} |
q7913 | DuckMap.ArrayHelper.convert_to | train | def convert_to(values, type)
buffer = []
if values.kind_of?(Array)
values.each do |value|
begin
if type == :string
buffer.push(value.to_s)
elsif type == :symbol
| ruby | {
"resource": ""
} |
q7914 | BabyErubis.Template.from_file | train | def from_file(filename, encoding='utf-8')
mode = "rb:#{encoding}"
mode = "rb" if RUBY_VERSION < '1.9'
input | ruby | {
"resource": ""
} |
q7915 | SchoolFriend.Session.additional_params | train | def additional_params
@additional_params ||= if session_scope?
if oauth2_session?
{application_key: application_key}
else
| ruby | {
"resource": ""
} |
q7916 | SchoolFriend.Session.api_call | train | def api_call(method, params = {}, force_session_call = false)
raise RequireSessionScopeError.new('This API call requires session scope') if force_session_call and application_scope? | ruby | {
"resource": ""
} |
q7917 | SchoolFriend.Session.build_uri | train | def build_uri(method, params = {})
uri = URI(api_server)
uri.path = '/api/' + method.sub('.', '/')
uri.query = | ruby | {
"resource": ""
} |
q7918 | LazyCrud.InstanceMethods.undestroy | train | def undestroy
@resource = resource_proxy(true).find(params[:id])
set_resource_instance
@resource.deleted_at = nil
@resource.save
respond_with(@resource, location: { | ruby | {
"resource": ""
} |
q7919 | LazyCrud.InstanceMethods.resource_proxy | train | def resource_proxy(with_deleted = false)
proxy = if parent_instance.present?
parent_instance.send(resource_plural_name)
| ruby | {
"resource": ""
} |
q7920 | PuppetDBQuery.Parser.read_maximal_term | train | def read_maximal_term(priority)
return nil if empty?
logger.debug "read maximal term (#{priority})"
| ruby | {
"resource": ""
} |
q7921 | Kublog.ApplicationHelper.error_messages_for | train | def error_messages_for(*objects)
options = objects.extract_options!
options[:header_message] ||= I18n.t(:"activerecord.errors.header", :default => "Invalid Fields")
options[:message] ||= I18n.t(:"activerecord.errors.message", :default => "Correct the following errors and try again.")
messages = ... | ruby | {
"resource": ""
} |
q7922 | ShinyThemes.RendersTheme.update_current_theme | train | def update_current_theme(name, options = {})
self.class.renders_theme(name, options)
Rails.application.config.theme.name = current_theme_name
| ruby | {
"resource": ""
} |
q7923 | Revenant.MySQL.acquire_lock | train | def acquire_lock(lock_name)
begin
acquired = false
sql = lock_query(lock_name)
connection.query(sql) do |result|
acquired = result.fetch_row.first == "1"
| ruby | {
"resource": ""
} |
q7924 | ShinyThemes.ThemeConfig.load | train | def load
new_config = full_config[Rails.env].try(:deep_symbolize_keys!) || {}
# Honor values in config file over defaults
| ruby | {
"resource": ""
} |
q7925 | ShinyThemes.ThemeConfig.save | train | def save
# Don't save default values
save_config = Rails.application.config.theme.reject { |k, _| @defaults.keys.include?(k) }
| ruby | {
"resource": ""
} |
q7926 | Rattler::Parsers.Super.parse | train | def parse(scanner, rules, scope = ParserScope.empty)
| ruby | {
"resource": ""
} |
q7927 | BorrowDirect.FindItem.exact_search_request_hash | train | def exact_search_request_hash(type, value)
# turn it into an array if it's not one already
values = Array(value)
hash = {
"PartnershipId" => Defaults.partnership_id,
"ExactSearch" => []
}
values.each do |value|
| ruby | {
"resource": ""
} |
q7928 | Hardmock.Expectation.raises | train | def raises(err=nil)
case err
when Exception
@options[:raises] = err
when String
@options[:raises] = RuntimeError.new(err)
else | ruby | {
"resource": ""
} |
q7929 | Hardmock.Expectation.yields | train | def yields(*items)
@options[:suppress_arguments_to_block] = true
if items.empty?
# Yield once
@options[:block] = lambda do |block|
if block.arity != 0 and block.arity != -1
raise ExpectationError.new("The given block was expected to have no parameter count; instead, got... | ruby | {
"resource": ""
} |
q7930 | Words.Wordnet.find | train | def find(term)
raise NoWordnetConnection, "There is presently no connection to wordnet. To attempt to reistablish a connection you should use | ruby | {
"resource": ""
} |
q7931 | Griddle.Point.to_rectangle | train | def to_rectangle(point)
d = delta(point)
Rectangle.new(
row,
col, | ruby | {
"resource": ""
} |
q7932 | MakeVoteable.Voter.up_vote | train | def up_vote(voteable)
check_voteable(voteable)
voting = fetch_voting(voteable)
if voting
if voting.up_vote
raise Exceptions::AlreadyVotedError.new(true)
else
voting.up_vote = true
voteable.down_votes -= 1
self.down_votes -= 1 if has_attribute?(... | ruby | {
"resource": ""
} |
q7933 | MakeVoteable.Voter.up_vote! | train | def up_vote!(voteable)
begin
up_vote(voteable)
success = true
rescue | ruby | {
"resource": ""
} |
q7934 | MakeVoteable.Voter.down_vote! | train | def down_vote!(voteable)
begin
down_vote(voteable)
success = true
rescue | ruby | {
"resource": ""
} |
q7935 | MakeVoteable.Voter.unvote | train | def unvote(voteable)
check_voteable(voteable)
voting = fetch_voting(voteable)
raise Exceptions::NotVotedError unless voting
if voting.up_vote
voteable.up_votes -= 1
self.up_votes -= 1 if has_attribute?(:up_votes)
else
voteable.down_votes -= 1
| ruby | {
"resource": ""
} |
q7936 | MakeVoteable.Voter.unvote! | train | def unvote!(voteable)
begin
unvote(voteable)
success = true
rescue | ruby | {
"resource": ""
} |
q7937 | MakeVoteable.Voter.down_voted? | train | def down_voted?(voteable)
check_voteable(voteable)
voting = fetch_voting(voteable)
return false if voting.nil?
return true | ruby | {
"resource": ""
} |
q7938 | Mindset.LoopbackConnection.read_packet_buffer | train | def read_packet_buffer
packets = @data[:wave][@wave_idx, 64].map { |val|
Packet.factory(:wave, val) }
@wave_idx += 64
@wave_idx = 0 if @wave_idx >= @data[:wave].count
if @counter == 7
packets << Packet.factory(:delta, @data[:delta][@esense_idx])
packets << Pack... | ruby | {
"resource": ""
} |
q7939 | Danger.DangerPackageJsonLockdown.verify | train | def verify(package_json)
inspect(package_json).each do |suspicious|
warn(
"`#{suspicious[:package]}` doesn't | ruby | {
"resource": ""
} |
q7940 | Danger.DangerPackageJsonLockdown.inspect | train | def inspect(package_json)
json = JSON.parse(File.read(package_json))
suspicious_packages = []
dependency_keys.each do |dependency_key|
next unless json.key?(dependency_key)
| ruby | {
"resource": ""
} |
q7941 | Bisques.QueueListener.listen | train | def listen(&block)
return if @listening
@listening = true
@thread = Thread.new do
while @listening
| ruby | {
"resource": ""
} |
q7942 | TokenField.FormBuilder.token_field | train | def token_field(attribute_name, options = {})
association_type = @object.send(attribute_name).respond_to?(:each) ? :many : :one
model_name = options.fetch(:model) { attribute_name.to_s.gsub(/_ids?/, "") }.to_s
association = attribute_name.to_s.gsub(/_ids?/, "").to_sym
token_url = options.fetch(:... | ruby | {
"resource": ""
} |
q7943 | TreeRb.DomWalker.process_node | train | def process_node(node, level=1)
entries = node.children
@visitor.enter_node(node)
entries.each do |entry|
unless is_leaf?(entry)
process_node(entry, level+1)
else
| ruby | {
"resource": ""
} |
q7944 | Cxxproject.Linkable.handle_whole_archive | train | def handle_whole_archive(building_block, res, linker, flag)
if is_whole_archive(building_block)
| ruby | {
"resource": ""
} |
q7945 | Cxxproject.Linkable.convert_to_rake | train | def convert_to_rake()
object_multitask = prepare_tasks_for_objects()
res = typed_file_task get_rake_task_type(), get_task_name => object_multitask do
cmd = calc_command_line
Dir.chdir(@project_dir) do
mapfileStr = @mapfile ? " >#{@mapfile}" : ""
rd, wr = IO.pipe
... | ruby | {
"resource": ""
} |
q7946 | Cxxproject.SharedLibrary.post_link_hook | train | def post_link_hook(linker)
basic_name = get_basic_name(linker)
| ruby | {
"resource": ""
} |
q7947 | DuckMap.Attributes.sitemap_attributes | train | def sitemap_attributes(key = :default)
key = key.blank? ? :default : key.to_sym
# if the key exists and has a Hash value, cool. Otherwise, go back to :default.
# self.class.sitemap_attributes should ALWAYS return a Hash, so, no need to test for that.
# however, key may or may not be a Hash. s... | ruby | {
"resource": ""
} |
q7948 | JBLAS.MatrixGeneralMixin.hcat | train | def hcat(y)
unless self.dims[0] == y.dims[0]
raise ArgumentError, "Matrices must have same number of rows"
| ruby | {
"resource": ""
} |
q7949 | JBLAS.MatrixGeneralMixin.vcat | train | def vcat(y)
unless self.dims[1] == y.dims[1]
raise ArgumentError, "Matrices must have same number of columns"
| ruby | {
"resource": ""
} |
q7950 | RProgram.Option.arguments | train | def arguments(value)
case value
when true
[@flag]
when false, nil
[]
else
value = super(value)
if @multiple
args = []
| ruby | {
"resource": ""
} |
q7951 | Specify.Database.close | train | def close
return if sessions.empty?
sessions.each do |session|
session.close
session.delete_observer self
| ruby | {
"resource": ""
} |
q7952 | Mei.WebServiceBase.get_json | train | def get_json(url)
r = Mei::WebServiceBase.fetch(url)
| ruby | {
"resource": ""
} |
q7953 | Logan.Comment.creator= | train | def creator=(creator)
@creator = creator.is_a?(Hash) | ruby | {
"resource": ""
} |
q7954 | Logan.Todo.assignee= | train | def assignee=(assignee)
@assignee = assignee.is_a?(Hash) | ruby | {
"resource": ""
} |
q7955 | Logan.Todo.create_comment | train | def create_comment(comment)
post_params = {
:body => comment.post_json,
:headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})
}
response = | ruby | {
"resource": ""
} |
q7956 | Firering.Room.today_transcript | train | def today_transcript(&callback)
connection.http(:get, "/room/#{id}/transcript.json") do |data, http|
| ruby | {
"resource": ""
} |
q7957 | Firering.Room.transcript | train | def transcript(year, month, day, &callback)
connection.http(:get, "/room/#{id}/transcript/#{year}/#{month}/#{day}.json") do |data, http|
| ruby | {
"resource": ""
} |
q7958 | Firering.Room.speak | train | def speak(data, &callback)
connection.http(:post, "/room/#{id}/speak.json", "message" => data) do |data, | ruby | {
"resource": ""
} |
q7959 | Emotions.Emotion.ensure_valid_emotion_name | train | def ensure_valid_emotion_name
unless Emotions.emotions.include?(emotion.try(:to_sym))
errors.add | ruby | {
"resource": ""
} |
q7960 | Sjekksum.ISBN10.of | train | def of number
raise_on_type_mismatch number
digits = convert_number_to_digits(number)[0..9]
sum = digits.reverse_each.with_index.reduce(0) do | ruby | {
"resource": ""
} |
q7961 | Sjekksum.ISBN10.valid? | train | def valid? number
raise_on_type_mismatch number
num, check = | ruby | {
"resource": ""
} |
q7962 | Sjekksum.ISBN10.convert | train | def convert number
raise_on_type_mismatch number
check = self.of(number)
if number.is_a?(String) or | ruby | {
"resource": ""
} |
q7963 | Calculated.Session.api_call | train | def api_call(method, path, params ={}, &proc)
if cache = caching? && (@cache[cache_key(path, params)])
return cache
else
if @logging
Calculated::Logging.log_calculated_api(method, path, params) do
| ruby | {
"resource": ""
} |
q7964 | IceCubeCron.ExpressionParser.split_parts_and_interval | train | def split_parts_and_interval(expression_str)
interval = nil
parts = expression_str.split(/ +/).map do |part|
part, part_interval = part.split('/')
interval = part_interval unless part_interval.blank?
| ruby | {
"resource": ""
} |
q7965 | IceCubeCron.ExpressionParser.string_to_expression_parts | train | def string_to_expression_parts(expression_str)
return {} if expression_str.nil?
parts, interval = split_parts_and_interval(expression_str)
expression_parts = ::Hash[EXPRESSION_PART_KEYS.zip(parts)]
expression_parts.select! do |_key, value|
| ruby | {
"resource": ""
} |
q7966 | Rattler::Parsers.Assert.parse | train | def parse(scanner, rules, scope = ParserScope.empty)
pos = scanner.pos
result = (child.parse(scanner, | ruby | {
"resource": ""
} |
q7967 | Cxxproject.OsxSharedLibs.post_link_hook | train | def post_link_hook(linker, bb)
basic_name = | ruby | {
"resource": ""
} |
q7968 | T2Airtime.API.transaction_list | train | def transaction_list(start = (Time.now - 24.hours), stop = Time.now, msisdn = nil, destination = nil, code = nil)
@params = {
stop_date: to_yyyymmdd(stop),
start_date: to_yyyymmdd(start)
}
code && !code.empty? && @params[:code] = code
msisdn && !msisdn.empty? && | ruby | {
"resource": ""
} |
q7969 | ProfitBricks.Server.detach_volume | train | def detach_volume(volume_id)
volume = ProfitBricks::Volume.get(datacenterId, | ruby | {
"resource": ""
} |
q7970 | DuckMap.ControllerHelpers.sitemap_setup | train | def sitemap_setup(options = {})
rows = []
DuckMap.logger.debug "sitemap_setup: action_name => #{options[:action_name]} source => #{options[:source]} model => #{options[:model]}"
attributes = self.sitemap_attributes(options[:action_name])
DuckMap.logger.debug "sitemap_setup: attributes => #{at... | ruby | {
"resource": ""
} |
q7971 | Rattler::Util.ParserCLI.run | train | def run
show_result @parser_class.parse!(ARGF.read)
| ruby | {
"resource": ""
} |
q7972 | PatternPatch.Methods.patch | train | def patch(name)
raise ConfigurationError, "patch_dir has not been set" if patch_dir.nil?
| ruby | {
"resource": ""
} |
q7973 | Rattler.Runner.run | train | def run
if result = analyze
synthesize(result)
else
puts parser.failure
| ruby | {
"resource": ""
} |
q7974 | Weather.Planner.get_dewpoints | train | def get_dewpoints(start_date, end_date, location)
response = get_planner_response(start_date, end_date, location)
return response['response']['error'] unless response['response']['error'].nil?
highs = response['trip']['dewpoint_high']
lows = response['trip']['dewpoint_low']
{
high... | ruby | {
"resource": ""
} |
q7975 | Weather.Planner.get_planner_response | train | def get_planner_response(start_date, end_date, location)
start = start_date.strftime('%m%d') | ruby | {
"resource": ""
} |
q7976 | BorrowDirect.Util.hash_key_path | train | def hash_key_path(hash, *path)
result = nil
path.each do |key|
return nil unless hash.respond_to? :"[]"
| ruby | {
"resource": ""
} |
q7977 | Dirigible.Configuration.options | train | def options
VALID_OPTION_KEYS.inject({}) do |option, key|
| ruby | {
"resource": ""
} |
q7978 | Logan.ProjectTemplate.create_project | train | def create_project( name, description = nil)
post_params = {
:body => {name: name, description: description}.to_json,
:headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})
}
| ruby | {
"resource": ""
} |
q7979 | DuckMap.ConfigHelpers.log_level | train | def log_level(value, options = {})
DuckMap::Logger.log_level = value
| ruby | {
"resource": ""
} |
q7980 | RProgram.Task.leading_non_options | train | def leading_non_options
args = []
# add the task leading non-options
@options.each do |name,value|
non_opt = get_non_option(name)
if (non_opt && non_opt.leading?)
args += non_opt.arguments(value)
end
end
| ruby | {
"resource": ""
} |
q7981 | RProgram.Task.options | train | def options
args = []
# add all subtask options
@subtasks.each_value do |task|
args += task.arguments
end
# add the task options
@options.each do |name,value|
| ruby | {
"resource": ""
} |
q7982 | RProgram.Task.tailing_non_options | train | def tailing_non_options
args = []
# add all tailing subtask non-options
@subtasks.each_value do |task|
args += task.tailing_non_options
end
# add the task tailing non-options
@options.each do |name,value|
non_opt = get_non_option(name)
| ruby | {
"resource": ""
} |
q7983 | RProgram.Task.arguments | train | def arguments
tailing_args = tailing_non_options
if tailing_args.any? { |arg| arg[0,1] == '-' }
tailing_args.unshift('--')
| ruby | {
"resource": ""
} |
q7984 | Rattler::Compiler::Optimizer.OptimizationSequence.deep_apply | train | def deep_apply(parser, context)
parser = apply(parser, context)
apply(parser.map_children { |child|
| ruby | {
"resource": ""
} |
q7985 | Rattler::Parsers.Choice.parse | train | def parse(scanner, rules, scope = ParserScope.empty)
for child in children
if r = child.parse(scanner, rules, scope)
| ruby | {
"resource": ""
} |
q7986 | Archive.Compress.compress | train | def compress(files, verbose=false)
if files.any? { |f| !File.file?(f) }
raise ArgumentError, "Files supplied must all be real, actual files -- not directories or symlinks."
end | ruby | {
"resource": ""
} |
q7987 | CfWebserver.CfApiServlet.do_POST | train | def do_POST(req, resp)
# Split the path into piece
path = req.path[1..-1].split('/')
# We don't want to cache catflap login page so set response headers.
# Chrome and FF respect the no-store, while IE respects no-cache.
resp['Cache-Control'] = 'no-cache, no-store'
resp['Pragma'] = '... | ruby | {
"resource": ""
} |
q7988 | Aptly.Snapshot.update! | train | def update!(**kwords)
kwords = kwords.map { |k, v| [k.to_s.capitalize, v] }.to_h
response = @connection.send(:put,
"/snapshots/#{self.Name}",
| ruby | {
"resource": ""
} |
q7989 | Aptly.Snapshot.diff | train | def diff(other_snapshot)
endpoint = "/snapshots/#{self.Name}/diff/#{other_snapshot.Name}" | ruby | {
"resource": ""
} |
q7990 | Codeqa.Configuration.git_root_till_home | train | def git_root_till_home
Pathname.new(Dir.pwd).ascend do |dir_pathname|
return | ruby | {
"resource": ""
} |
q7991 | PuppetDBQuery.MongoDB.node_properties | train | def node_properties
collection = connection[node_properties_collection]
result = {}
| ruby | {
"resource": ""
} |
q7992 | PuppetDBQuery.MongoDB.all_nodes | train | def all_nodes
collection = connection[nodes_collection]
| ruby | {
"resource": ""
} |
q7993 | PuppetDBQuery.MongoDB.query_nodes | train | def query_nodes(query)
collection = connection[nodes_collection]
| ruby | {
"resource": ""
} |
q7994 | PuppetDBQuery.MongoDB.query_facts | train | def query_facts(query, facts = [])
fields = Hash[facts.collect { |fact| [fact.to_sym, 1] }]
collection = connection[nodes_collection]
| ruby | {
"resource": ""
} |
q7995 | PuppetDBQuery.MongoDB.query_facts_exist | train | def query_facts_exist(query, facts = [])
result = query_facts(query, facts)
unless facts.empty?
result.keep_if do |_k, v|
| ruby | {
"resource": ""
} |
q7996 | PuppetDBQuery.MongoDB.search_facts | train | def search_facts(query, pattern, facts = [], facts_found = [], check_names = false)
collection = connection[nodes_collection]
result = {}
collection.find(query).batch_size(999).each do |values|
id = values.delete('_id')
found = {}
values.each do |k, v|
if v =~ pattern... | ruby | {
"resource": ""
} |
q7997 | PuppetDBQuery.MongoDB.single_node_facts | train | def single_node_facts(node, facts)
fields = Hash[facts.collect { |fact| [fact.to_sym, 1] }]
collection = connection[nodes_collection]
result = collection.find(_id: | ruby | {
"resource": ""
} |
q7998 | PuppetDBQuery.MongoDB.meta | train | def meta
collection = connection[meta_collection]
result = collection.find.first | ruby | {
"resource": ""
} |
q7999 | PuppetDBQuery.MongoDB.node_update | train | def node_update(node, facts)
logger.debug " updating #{node}"
connection[nodes_collection].find(_id: node).replace_one(facts,
upsert: true,
bypass_document_validation: true,
check_keys: false,
validating_keys: false)
rescue ::Mongo::Error::OperationFailure => e
log... | 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.