_id stringlengths 2 6 | title stringlengths 9 130 | partition stringclasses 3
values | text stringlengths 30 4.3k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q10100 | ProjectEulerCli.Scraper.load_page | train | def load_page(page)
return if Page.visited.include?(page)
html = open("https://projecteuler.net/archives;page=#{page}")
fragment = Nokogiri::HTML(html)
problem_links = fragment.css('#problems_table td a')
i = (page | ruby | {
"resource": ""
} |
q10101 | ProjectEulerCli.Scraper.load_problem_details | train | def load_problem_details(id)
return unless Problem[id].published.nil?
html = open("https://projecteuler.net/problem=#{id}")
fragment = Nokogiri::HTML(html)
problem_info = fragment.css('div#problem_info span span')
details = problem_info.text.split(';')
Problem[id].published = details[0].strip... | ruby | {
"resource": ""
} |
q10102 | Authpwn.SessionMailer.email_verification_email | train | def email_verification_email(token, root_url)
@token = token
@protocol, @host = *root_url.split('://', 2)
@host.slice!(-1) if @host[-1] == ?/
hostname = @host.split(':', 2).first # Strip out any port.
mail to: | ruby | {
"resource": ""
} |
q10103 | Authpwn.SessionMailer.reset_password_email | train | def reset_password_email(email, token, root_url)
@email, @token, @host, @protocol = email, token
@token = token
@protocol, @host = *root_url.split('://', 2)
@host.slice!(-1) if @host[-1] == ?/
hostname = @host.split(':', 2).first | ruby | {
"resource": ""
} |
q10104 | DescendantsLoader.ClassMethods.load_self_descendants | train | def load_self_descendants
file = ClassFinder.where_is(self)
path = File.expand_path(File.dirname(file))
| ruby | {
"resource": ""
} |
q10105 | Renegade.CommitMessage.check_commit_message_length | train | def check_commit_message_length(message)
check_label = 'Commit message length'
if message.length >= @min_length && message.length <= @max_length
| ruby | {
"resource": ""
} |
q10106 | Disqussion.Users.follow | train | def follow(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
target = args.first
merge_target_into_options!(target, | ruby | {
"resource": ""
} |
q10107 | Codependency.Parser.parse | train | def parse( file )
pattern = PATTERNS[ File.extname( file ) ]
IO.readlines( file ).take_while do |line|
| ruby | {
"resource": ""
} |
q10108 | Octo.Counter.increment_for | train | def increment_for(obj)
# decide the time of event asap
ts = Time.now.ceil.to_i
if obj.class.ancestors.include?Cequel::Record
args = obj.key_attributes.collect { |k,v| v.to_s }
cache_key = generate_key(ts, obj.class.name, *args)
val = Cequel::Record.redis.get(cache_key)
... | ruby | {
"resource": ""
} |
q10109 | Octo.Counter.aggregate | train | def aggregate(ts = Time.now.floor)
ts = ts.to_i
aggr = {}
# Find all counters from the index
index_key = generate_index_key(ts, '*')
counters = Cequel::Record.redis.keys(index_key)
counters.each do |cnt|
_tmp = cnt.split(SEPARATOR)
_ts = _tmp[2].to_i
aggr[_ts]... | ruby | {
"resource": ""
} |
q10110 | Taxonifi.Model::Name.rank= | train | def rank=(value)
r = value.to_s.downcase.strip
if !RANKS.include?(r)
| ruby | {
"resource": ""
} |
q10111 | Taxonifi.Model::IcznName.name= | train | def name=(name)
case @rank
when 'superfamily'
raise NameError, "ICZN superfamily name does not end in 'oidae'." if name[-5,5] != 'oidae'
when 'family'
raise NameError, "ICZN family name does not end in 'idae'." if name[-4,4] != 'idae'
when 'subfamily'
raise NameError, "IC... | ruby | {
"resource": ""
} |
q10112 | ActiveRecord.Transactions.rollback_active_record_state! | train | def rollback_active_record_state!
remember_transaction_record_state
yield
rescue Exception
IdentityMap.remove(self) if IdentityMap.enabled?
| ruby | {
"resource": ""
} |
q10113 | ActiveRecord.Transactions.rolledback! | train | def rolledback!(force_restore_state = false) #:nodoc:
run_callbacks :rollback
ensure
IdentityMap.remove(self) | ruby | {
"resource": ""
} |
q10114 | GemFootprintAnalyzer.ChildProcess.start_child | train | def start_child
@child_thread ||= Thread.new do # rubocop:disable Naming/MemoizedInstanceVariableName
Open3.popen3(child_env_vars, *ruby_command, context_file) do |_, stdout, stderr|
@pid = | ruby | {
"resource": ""
} |
q10115 | RailsIdentity.UsersController.create | train | def create
logger.debug("Create new user")
@user = User.new(user_params)
if @user.save
# Save succeeded. Render the response based on the created user.
render json: @user,
except: [:verification_token, :reset_token, :password_digest],
status: 201
... | ruby | {
"resource": ""
} |
q10116 | RailsIdentity.UsersController.update_user | train | def update_user(update_user_params)
if @user.update_attributes(update_user_params)
render json: @user, except: [:password_digest]
| ruby | {
"resource": ""
} |
q10117 | RailsIdentity.UsersController.update_token | train | def update_token(kind)
@user.issue_token(kind)
@user.save
if kind == :reset_token
user_mailer.password_reset(@user).deliver_later
else
| ruby | {
"resource": ""
} |
q10118 | FormatOutput.BulletPointBuilder.add | train | def add(bullet, *items)
items.each do |item|
@bullet_data << [bullet.to_s, | ruby | {
"resource": ""
} |
q10119 | FormatOutput.BulletPointBuilder.render | train | def render
@key_length, results = get_key_length, []
@bullet_data.each do |key, item|
| ruby | {
"resource": ""
} |
q10120 | StorageRoom.Model.create | train | def create
return false unless new_record?
run_callbacks :save do
run_callbacks :create do
httparty | ruby | {
"resource": ""
} |
q10121 | StorageRoom.Model.update | train | def update
return false if new_record?
run_callbacks :save do
run_callbacks :update do
| ruby | {
"resource": ""
} |
q10122 | StorageRoom.Model.destroy | train | def destroy
return false if new_record?
run_callbacks :destroy do
httparty = self.class.delete(self[:@url], request_options)
| ruby | {
"resource": ""
} |
q10123 | StorageRoom.Model.to_hash | train | def to_hash(args = {}) # :nodoc:
args ||= {}
if args[:nested]
{'url' => self[:@url] || self[:url]}
else
hash = super | ruby | {
"resource": ""
} |
q10124 | ActiveHarmony.Service.retrieve | train | def retrieve(url, method = :get, headers = {}, data = nil)
puts "[ActiveHarmony] Retrieving data:"
puts "[ActiveHarmony] URL: #{url}"
puts "[ActiveHarmony] Method: #{method}"
puts "[ActiveHarmony] Headers: #{headers.inspect}"
puts "[ActiveHarmony] Data: #{data.inspe... | ruby | {
"resource": ""
} |
q10125 | ActiveHarmony.Service.list | train | def list(object_type)
url = generate_rest_url(:list, object_type)
result = retrieve(url.path) | ruby | {
"resource": ""
} |
q10126 | ActiveHarmony.Service.show | train | def show(object_type, id)
url = generate_rest_url(:show, object_type, id)
result = retrieve(url.path)
parsed_result | ruby | {
"resource": ""
} |
q10127 | ActiveHarmony.Service.update | train | def update(object_type, id, data)
url = generate_rest_url(:update, object_type, id)
object_name = object_name_for(object_type, :update)
xml_data = data.to_xml(:root => object_name, :skip_instruct => true, :dasherize => false)
result = | ruby | {
"resource": ""
} |
q10128 | ActiveHarmony.Service.create | train | def create(object_type, data)
url = generate_rest_url(:create, object_type)
object_name = object_name_for(object_type, :create)
xml_data = data.to_xml(:root => object_name, :skip_instruct => true, :dasherize => false)
result = retrieve(url.path, url.method, {'Content-type' | ruby | {
"resource": ""
} |
q10129 | ActiveHarmony.Service.custom_url_for | train | def custom_url_for(object_type, action)
path = @paths.find do |path|
path[:object_type] == object_type && | ruby | {
"resource": ""
} |
q10130 | ActiveHarmony.Service.object_name_for | train | def object_name_for(object_type, action)
object_name = @object_names.find do |object_name|
object_name[:object_type] == object_type
object_name[:action] == action
end
| ruby | {
"resource": ""
} |
q10131 | LoLBase.Connection.get | train | def get(path, options = {})
if options[:query].nil?
options.merge!({ query: { api_key: @key } })
else
options[:query].merge!({ api_key: @key })
end
| ruby | {
"resource": ""
} |
q10132 | Sinatra::TwitterOAuth.Helpers.login_required | train | def login_required
setup_client
@user = ::TwitterOAuth::User.new(@client, session[:user]) if | ruby | {
"resource": ""
} |
q10133 | Sinatra::TwitterOAuth.Helpers.redirect_to_twitter_auth_url | train | def redirect_to_twitter_auth_url
request_token = get_request_token
session[:request_token] = request_token.token
session[:request_token_secret]= request_token.secret
| ruby | {
"resource": ""
} |
q10134 | SIUnits.Unit.convert_to | train | def convert_to(other)
return self if other.nil?
case other
when Unit
return self if other == self
target = other
when String
target = | ruby | {
"resource": ""
} |
q10135 | Fotofetch.Fetch.add_sources | train | def add_sources(urls)
urls.each_with_object( {}.compare_by_identity ) do |link, pairs|
| ruby | {
"resource": ""
} |
q10136 | Fotofetch.Fetch.save_images | train | def save_images(urls, file_path)
urls.each_with_index do |url, i|
open("#{@topic.gsub(' | ruby | {
"resource": ""
} |
q10137 | Calco.Sheet.row | train | def row row_number
if row_number == 0
cells = []
if @has_titles
@column_titles.each do |title|
| ruby | {
"resource": ""
} |
q10138 | Calco.Sheet.each_cell_definition | train | def each_cell_definition &block
if block.arity == 1
@columns.each do |column|
yield column
end
else
| ruby | {
"resource": ""
} |
q10139 | Empyrean.TemplateRenderer.render | train | def render
mentions = mentions_erb
hashtags = hashtags_erb
smileys = smileys_erb
clients = clients_erb
counters = {
tweets: @parsed[:tweet_count],
retweets: @parsed[:retweet_count],
retweets_percentage: (@parsed[:retweet_count] * 100 / @parsed[:tweet_count].to_f).ro... | ruby | {
"resource": ""
} |
q10140 | Empyrean.TemplateRenderer.mentions_erb | train | def mentions_erb
retdict = {
enabled: @config[:mentions][:enabled],
top: [],
nottop: []
}
if @config[:mentions][:enabled]
top = @parsed[:mentions].slice(0, @config[:mentions][:top]) # top X mentions
top.each do |mention|
retdict[:top] << mention[1]
... | ruby | {
"resource": ""
} |
q10141 | Empyrean.TemplateRenderer.hashtags_erb | train | def hashtags_erb
retdict = {
enabled: @config[:hashtags][:enabled],
top: [],
nottop: []
}
if @config[:hashtags][:enabled]
top = @parsed[:hashtags].slice(0, @config[:hashtags][:top]) # top X hashtags
top.each do |hashtag|
retdict[:top] << hashtag[1]
... | ruby | {
"resource": ""
} |
q10142 | Empyrean.TemplateRenderer.smileys_erb | train | def smileys_erb
retdict = {
enabled: @config[:smileys][:enabled],
top: [],
nottop: []
}
if @config[:smileys][:enabled]
top = @parsed[:smileys].slice(0, @config[:smileys][:top]) # top X smileys
top.each do |smiley|
retdict[:top] << smiley[1]
en... | ruby | {
"resource": ""
} |
q10143 | Empyrean.TemplateRenderer.clients_erb | train | def clients_erb
retdict = {
enabled: @config[:clients][:enabled],
top: [],
nottop: []
}
if @config[:clients][:enabled]
top = @parsed[:clients].slice(0, @config[:clients][:top]) # top X clients
top.each do |client|
retdict[:top] << {
name: ... | ruby | {
"resource": ""
} |
q10144 | TodoLint.FileFinder.list | train | def list(*extensions)
all_files.keep_if do |filename|
extensions.include?(Pathname.new(filename).extname)
end
| ruby | {
"resource": ""
} |
q10145 | TodoLint.FileFinder.excluded_file? | train | def excluded_file?(file)
full_path = File.expand_path(file)
options.fetch(:excluded_files) { [] }.any? do |file_to_exclude|
| ruby | {
"resource": ""
} |
q10146 | Prequel.Errors.full_messages | train | def full_messages
inject([]) do |m, kv|
att, errors = *kv
| ruby | {
"resource": ""
} |
q10147 | StixSchemaSpy.Schema.find_prefix | train | def find_prefix(doc)
return config['prefix'] if config && config['prefix']
# Loop through the attributes until we see one with the same value
ns_prefix_attribute = doc.namespaces.find do |prefix, ns|
ns.to_s == namespace.to_s && prefix != 'xmlns'
end
# If | ruby | {
"resource": ""
} |
q10148 | MultiGit.Config.each | train | def each
return to_enum unless block_given?
each_explicit_key do |*key|
| ruby | {
"resource": ""
} |
q10149 | Eventual.Node.include? | train | def include? date
result = false
walk { |elements|
break result = true if elements.include? date
}
return | ruby | {
"resource": ""
} |
q10150 | Rokko.Task.define | train | def define
desc "Generate rokko documentation"
task @name do
# Find README file for `index.html` and delete it from `sources`
if @options[:generate_index]
readme_source = @sources.detect { |f| File.basename(f) =~ /README(\.(md|text|markdown|mdown|mkd|mkdn)$)?/i }
readme =... | ruby | {
"resource": ""
} |
q10151 | Stocker.Generator.new | train | def new(item, total)
data = read_file
data[item] = {'total' => total.to_i, | ruby | {
"resource": ""
} |
q10152 | Stocker.Generator.delete | train | def delete(item)
data = read_file
match_name(item)
| ruby | {
"resource": ""
} |
q10153 | Stocker.Generator.check | train | def check
links = []
read_file.each do |key, value|
value["checked"] = Time.now
if value["total"] < value["min"]
puts "You're running low on #{key}!" | ruby | {
"resource": ""
} |
q10154 | Stocker.Generator.total | train | def total(item, total)
data = read_file
match_name(item)
data[@@item]["total"] = total.to_i | ruby | {
"resource": ""
} |
q10155 | Stocker.Generator.url | train | def url(item, url)
data = read_file
match_name(item)
data[@@item]["url"] = url | ruby | {
"resource": ""
} |
q10156 | Stocker.Generator.min | train | def min(item, min)
data = read_file
match_name(item) | ruby | {
"resource": ""
} |
q10157 | Stocker.Generator.list | train | def list
begin
@header = [["", ""]]
# @header = [[set_color("Item", :white), set_color("Total", :white)], [set_color("=================", :white), set_color("=====", :white)]]
@green = []
@yellow = []
@yellow2 = []
@green2 = []
@red = []
@red2 = []
... | ruby | {
"resource": ""
} |
q10158 | Gumdrop.DataManager.parse_file | train | def parse_file(path, target_ext=nil)
return nil if path.nil?
return nil if File.directory? path
_load_from_file path, target_ext
# if File.directory? path
| ruby | {
"resource": ""
} |
q10159 | MIPPeR.Model.build_pointer_array | train | def build_pointer_array(array, type)
buffer = FFI::MemoryPointer.new | ruby | {
"resource": ""
} |
q10160 | HasDefaultAssociation.ClassMethods.has_default_association | train | def has_default_association *names, &default_proc
opts = names.extract_options!
opts.assert_valid_keys(:eager)
names.each do |name|
| ruby | {
"resource": ""
} |
q10161 | VCSToolkit.Repository.status | train | def status(commit, ignore: [])
tree = get_object(commit.tree) unless commit.nil?
Utils::Status.compare_tree_and_store tree,
staging_area,
| ruby | {
"resource": ""
} |
q10162 | VCSToolkit.Repository.commit_status | train | def commit_status(base_commit, new_commit, ignore: [])
base_tree = get_object(base_commit.tree) unless base_commit.nil?
new_tree = get_object(new_commit.tree) unless new_commit.nil?
Utils::Status.compare_trees base_tree,
| ruby | {
"resource": ""
} |
q10163 | VCSToolkit.Repository.merge | train | def merge(commit_one, commit_two)
common_ancestor = commit_one.common_ancestor(commit_two, object_store)
commit_one_files = Hash[get_object(commit_one.tree).all_files(object_store).to_a]
commit_two_files = Hash[get_object(commit_two.tree).all_files(object_store).to_a]
if common_ancestor.nil?
... | ruby | {
"resource": ""
} |
q10164 | VCSToolkit.Repository.file_difference | train | def file_difference(file_path, commit)
if staging_area.file? file_path
file_lines = staging_area.fetch(file_path).lines
file_lines.last << "\n" unless file_lines.last.nil? or file_lines.last.end_with? "\n"
else
file_lines = []
end
tree = get_object commit.tree
b... | ruby | {
"resource": ""
} |
q10165 | Oauthio.Client.me_url | train | def me_url(provider, params=nil)
connection.build_url(options[:me_url].sub(/:provider/, | ruby | {
"resource": ""
} |
q10166 | MuchPlugin.ClassMethods.included | train | def included(plugin_receiver)
return if plugin_receiver.include?(self.much_plugin_included_detector)
plugin_receiver.send(:include, | ruby | {
"resource": ""
} |
q10167 | AmberbitConfig.HashStruct.to_hash | train | def to_hash
_copy = {}
@table.each { |key, value| _copy[key] = value.is_a?(HashStruct) ? | ruby | {
"resource": ""
} |
q10168 | AmberbitConfig.HashStruct.check_hash_for_conflicts | train | def check_hash_for_conflicts(hash)
raise HashArgumentError, 'It must be a hash' unless hash.is_a?(Hash)
unless (conflicts = self.public_methods & hash.keys.map(&:to_sym)).empty?
| ruby | {
"resource": ""
} |
q10169 | Unchained.Request.get_resource | train | def get_resource(url, resource_class, params={})
| ruby | {
"resource": ""
} |
q10170 | Unchained.Request.get_resources | train | def get_resources(url, resource_class, params={})
get(url, params).map do |result|
| ruby | {
"resource": ""
} |
q10171 | Auditing.AuditRelationship.audit_relationship_enabled | train | def audit_relationship_enabled(opts={})
include InstanceMethods
# class_inheritable_accessor :audit_enabled_models
# class_inheritable_accessor :field_names
class_attribute :audit_enabled_models
| ruby | {
"resource": ""
} |
q10172 | Myrrha.Coercions.delegate | train | def delegate(method, &convproc)
convproc ||= lambda{|v,t| | ruby | {
"resource": ""
} |
q10173 | Myrrha.Coercions.coercion | train | def coercion(source, target = main_target_domain, converter = nil, &convproc)
@rules.send(@appender, [source, | ruby | {
"resource": ""
} |
q10174 | Myrrha.Coercions.coerce | train | def coerce(value, target_domain = main_target_domain)
return value if belongs_to?(value, target_domain)
error = nil
each_rule do |from,to,converter|
next unless from.nil? or belongs_to?(value, from, target_domain)
begin
catch(:nextrule) do
if to.nil? or subdomain?... | ruby | {
"resource": ""
} |
q10175 | Myrrha.Coercions.belongs_to? | train | def belongs_to?(value, domain, target_domain = domain)
if domain.is_a?(Proc) and domain.arity==2
domain.call(value, target_domain)
else
| ruby | {
"resource": ""
} |
q10176 | KynetxAmApi.Application.endpoint | train | def endpoint(type, opts={})
options = {
:extname => @name,
:extdesc => "",
:extauthor => @user.name,
:force_build => 'N',
:contents => "compiled",
:format => 'json',
:env => 'prod'
}
# Set type specific options
case type.to_s
when ... | ruby | {
"resource": ""
} |
q10177 | Handcart::Concerns::Handcarts.ClassMethods.handcart_show_path | train | def handcart_show_path(handcart)
if Handcart.handcart_show_path.present?
# Load it straight from the config
"/#{Handcart.handcart_show_path}/#{handcart.to_param}"
else
if Rails.application.routes.url_helpers.respond_to?("#{Handcart.handcart_class.model_name.singular}_path".to_sym)
... | ruby | {
"resource": ""
} |
q10178 | LatoBlog.Back::PostFieldsController.destroy_relay_field | train | def destroy_relay_field
# find post field
child_field = LatoBlog::PostField.find_by(id: params[:id])
@post_field = child_field.post_field
unless @post_field
@error = true
respond_to { |r| r.js }
end
# find post field child and destroy it | ruby | {
"resource": ""
} |
q10179 | Guard.Shopifytheme.start | train | def start
if File.exist? 'config.yml'
Notifier.notify "Watching for changes to Shopify Theme"
else
data = <<-EOF
---
:api_key: YOUR_API_KEY
:password: YOUR_PASSWORD
:store: YOURSHOP.myshopify.com
:theme_id: 'YOUR_THEME_ID'
:ignore_files:
- README.md
- CHANGELOG.md
EOF
| ruby | {
"resource": ""
} |
q10180 | FentonShell.Project.create | train | def create(global_options, options)
status, body = project_create(global_options, options)
if status == 201
save_message(create_success_message(body))
| ruby | {
"resource": ""
} |
q10181 | FentonShell.Project.project_json | train | def project_json(options)
{
project: {
name: options[:name],
description: options[:description],
passphrase: options[:passphrase],
| ruby | {
"resource": ""
} |
q10182 | StorageRoom.Resource.reload | train | def reload(url = nil, parameters = {})
httparty = self.class.get(url || self[:@url], StorageRoom.request_options.merge(parameters)) | ruby | {
"resource": ""
} |
q10183 | RDO.Connection.debug | train | def debug
raise ArgumentError,
"RDO::Connection#debug requires a block" unless block_given?
reset, | ruby | {
"resource": ""
} |
q10184 | RDO.Connection.normalize_options | train | def normalize_options(options)
case options
when Hash
Hash[options.map{|k,v| [k.respond_to?(:to_sym) ? k.to_sym : k, v]}].tap do |opts|
opts[:driver] = opts[:driver].to_s if opts[:driver]
end
when String, URI
parse_connection_uri(options)
| ruby | {
"resource": ""
} |
q10185 | UnifiedPayment.InstallGenerator.create_migrations | train | def create_migrations
Dir["#{self.class.source_root}/migrations/*.rb"].sort.each do |filepath|
name = File.basename(filepath)
| ruby | {
"resource": ""
} |
q10186 | FFI.Bitmask.to_native | train | def to_native(query, ctx)
return 0 if query.nil?
flat_query = [query].flatten
flat_query.inject(0) do |val, o|
case o
when Symbol
v = @kv_map[o]
raise ArgumentError, "invalid bitmask value, #{o.inspect}" unless v
val |= v
when Integer
| ruby | {
"resource": ""
} |
q10187 | FormatOutput.ColumnBuilder.render | train | def render
results, column_widths = [], get_column_widths
rows.times { |row_index| results << | ruby | {
"resource": ""
} |
q10188 | FormatOutput.ColumnBuilder.add_a_row | train | def add_a_row
new_rows = rows + 1
pool, @page_data = @page_data.flatten, []
until pool.empty?
| ruby | {
"resource": ""
} |
q10189 | Aker::Cas.RackProxyCallback.call | train | def call(env)
return receive(env) if env["PATH_INFO"] == RECEIVE_PATH
return retrieve(env) if | ruby | {
"resource": ""
} |
q10190 | Aker::Cas.RackProxyCallback.store_iou | train | def store_iou(pgt_iou, pgt)
pstore = open_pstore
| ruby | {
"resource": ""
} |
q10191 | Aker::Cas.RackProxyCallback.resolve_iou | train | def resolve_iou(pgt_iou)
pstore = open_pstore
pgt = nil
pstore.transaction do
pgt = pstore[pgt_iou]
| ruby | {
"resource": ""
} |
q10192 | QuadrigaCX.Private.withdraw | train | def withdraw(coin, params = {})
raise ConfigurationError.new('No coin type specified') unless coin
raise ConfigurationError.new('Invalid coin | ruby | {
"resource": ""
} |
q10193 | QuadrigaCX.Private.user_transactions | train | def user_transactions(params = {})
request(:post, | ruby | {
"resource": ""
} |
q10194 | Bixby.Bench.label_width | train | def label_width
if !@label_width then
@label_width = @samples.find_all{ |s| Sample === s }.
max{ |a, b| a.label.length <=> b.label.length }.
| ruby | {
"resource": ""
} |
q10195 | GenSpec.Matchers.delete | train | def delete(filename)
within_source_root do
FileUtils.mkdir_p File.dirname(filename)
FileUtils.touch filename
| ruby | {
"resource": ""
} |
q10196 | SoundDrop.Client.get_client | train | def get_client
init_opts = {
client_id: @CLIENT_ID,
client_secret: @CLIENT_SECRET
} | ruby | {
"resource": ""
} |
q10197 | SoundDrop.Client.get_drop | train | def get_drop(url)
sc_track = client.get('/resolve', | ruby | {
"resource": ""
} |
q10198 | ExceptionDog.Handler.format_backtrace | train | def format_backtrace(backtrace)
backtrace ||= []
backtrace[0..BACKTRACE_LINES].collect do |line|
| ruby | {
"resource": ""
} |
q10199 | Bixby.CommandSpec.validate | train | def validate(expected_digest)
if not bundle_exists? then
raise BundleNotFound.new("repo = #{@repo}; bundle = #{@bundle}")
end
if not command_exists? then
raise CommandNotFound.new("repo = #{@repo}; bundle = #{@bundle}; command = #{@command}")
end
| 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.