_id stringlengths 2 6 | title stringlengths 9 130 | partition stringclasses 3
values | text stringlengths 30 4.3k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q16700 | Kontena.Client.get_stream | train | def get_stream(path, response_block, params = nil, headers = {}, auth = true)
request(path: path, query: params, headers: headers, | ruby | {
"resource": ""
} |
q16701 | Kontena.Client.request | train | def request(http_method: :get, path:'/', body: nil, query: {}, headers: {}, response_block: nil, expects: [200, 201, 204], host: nil, port: nil, auth: true, gzip: true)
retried ||= false
if auth && token_expired?
raise Excon::Error::Unauthorized, "Token expired or not valid, you need to login agai... | ruby | {
"resource": ""
} |
q16702 | Kontena.Client.token_account | train | def token_account
return {} unless token
if token.respond_to?(:account)
token.account
elsif token.kind_of?(Hash) && token['account'].kind_of?(String)
| ruby | {
"resource": ""
} |
q16703 | Kontena.Client.refresh_token | train | def refresh_token
debug { "Performing token refresh" }
return false if token.nil?
return false if token['refresh_token'].nil?
uri = URI.parse(token_account['token_endpoint'])
endpoint_data = { path: uri.path }
endpoint_data[:host] = uri.host if uri.host
endpoint_data[:port] = u... | ruby | {
"resource": ""
} |
q16704 | Kontena.Client.encode_body | train | def encode_body(body, content_type)
if content_type =~ JSON_REGEX # vnd.api+json should pass as json
| ruby | {
"resource": ""
} |
q16705 | Kontena.Client.in_to_at | train | def in_to_at(expires_in)
if expires_in.to_i < 1
0
else
| ruby | {
"resource": ""
} |
q16706 | Kontena.RpcClient.request | train | def request(method, params, timeout: 30)
if !wait_until("websocket client is connected", timeout: timeout, threshold: 10.0, interval: 0.1) { connected? }
raise TimeoutError.new(500, 'WebsocketClient is not connected')
end
id = request_id
observable = @requests[id] = RequestObservable.ne... | ruby | {
"resource": ""
} |
q16707 | Agent.NodePlugger.reject! | train | def reject!(connected_at, code, reason)
self.update_node!(connected_at,
connected: false,
updated: false,
websocket_connection: {
opened: false,
close_code: code,
close_reason: reason,
| ruby | {
"resource": ""
} |
q16708 | Stacks.SortHelper.sort_services | train | def sort_services(services)
# Map of service name to array of deep links, including links of linked services
service_links = {}
# Build hash of service name to shallow array of linked service names
# {service => [linked_service]}
services.each do |service|
service_links[service[:n... | ruby | {
"resource": ""
} |
q16709 | Kontena::Cli::Helpers.HealthHelper.grid_health | train | def grid_health(grid, nodes)
initial = grid['initial_size']
minimum = grid['initial_size'] / 2 + 1 # a majority is required for etcd quorum
online = nodes.select{|node| node['initial_member'] && node['connected']}
if online.length < minimum
| ruby | {
"resource": ""
} |
q16710 | Kontena::Cli::Stacks.Common.stack | train | def stack
@stack ||= reader.execute(
name: stack_name,
parent_name: self.respond_to?(:parent_name) ? self.parent_name : nil,
| ruby | {
"resource": ""
} |
q16711 | Kontena::Cli::Stacks.Common.set_env_variables | train | def set_env_variables(stack, grid, platform = grid)
ENV['STACK'] = stack
| ruby | {
"resource": ""
} |
q16712 | Kontena::Cli::Stacks.Common.stacks_client | train | def stacks_client
@stacks_client ||= Kontena::StacksClient.new(current_account.stacks_url, | ruby | {
"resource": ""
} |
q16713 | Kontena::Stacks.ChangeResolver.stack_upgraded? | train | def stack_upgraded?(name)
old_stack = old_data.stack(name)
new_stack = new_data.stack(name)
return true if new_stack.root?
return true if old_stack.version != new_stack.version
| ruby | {
"resource": ""
} |
q16714 | Kontena::Workers.LogWorker.process_queue | train | def process_queue
loop do
sleep 1 until processing?
buffer = @queue.shift(BATCH_SIZE)
| ruby | {
"resource": ""
} |
q16715 | Kontena::Workers.LogWorker.start_streaming | train | def start_streaming
info 'start streaming logs from containers'
Docker::Container.all.each do |container|
begin
self.stream_container_logs(container) unless container.skip_logs?
rescue Docker::Error::NotFoundError => exc
| ruby | {
"resource": ""
} |
q16716 | Kontena::Workers.LogWorker.stop_streaming | train | def stop_streaming
@streaming = false
info 'stop log streaming'
@workers.keys.dup.each do |id|
queued_item = @queue.find { |i| i[:id] == id }
time = queued_item.nil? ? | ruby | {
"resource": ""
} |
q16717 | Kontena::Cli::Stacks.UpgradeCommand.process_data | train | def process_data(old_data, new_data)
logger.debug { "Master stacks: #{old_data.keys.join(",")} YAML stacks: #{new_data.keys.join(",")}" }
new_data.reverse_each do |stackname, data|
spinner "Processing stack #{pastel.cyan(stackname)}"
process_stack_data(stackname, data, old_data)
hin... | ruby | {
"resource": ""
} |
q16718 | Kontena.LocalhostWebServer.serve_one | train | def serve_one
Kontena.logger.debug("LHWS") { "Waiting for connection on port #{port}.." }
socket = server.accept
content = socket.recvfrom(2048).first.split(/(?:\r)?\n/)
request = content.shift
headers = {}
while line = content.shift
break if line.nil?
break if lin... | ruby | {
"resource": ""
} |
q16719 | Contracts.MethodHandler.handle | train | def handle
return unless engine?
return if decorators.empty?
validate_decorators!
validate_pattern_matching!
| ruby | {
"resource": ""
} |
q16720 | Contracts.MethodReference.make_definition | train | def make_definition(this, &blk)
is_private = private?(this)
is_protected = protected?(this)
| ruby | {
"resource": ""
} |
q16721 | Contracts.MethodReference.make_alias | train | def make_alias(this)
_aliased_name = aliased_name
original_name = name
alias_target(this).class_eval do
| ruby | {
"resource": ""
} |
q16722 | Parslet::Atoms.CanFlatten.flatten | train | def flatten(value, named=false)
# Passes through everything that isn't an array of things
return value unless value.instance_of? Array
# Extracts the s-expression tag
tag, *tail = value
# Merges arrays:
result = tail.
map { |e| flatten(e) } # first flatten each e... | ruby | {
"resource": ""
} |
q16723 | Parslet::Atoms.CanFlatten.foldl | train | def foldl(list, &block)
return '' if | ruby | {
"resource": ""
} |
q16724 | Parslet::Atoms.CanFlatten.flatten_sequence | train | def flatten_sequence(list)
foldl(list.compact) { |r, e| # | ruby | {
"resource": ""
} |
q16725 | Parslet::Atoms.CanFlatten.flatten_repetition | train | def flatten_repetition(list, named)
if list.any? { |e| e.instance_of?(Hash) }
# If keyed subtrees are in the array, we'll want to discard all
# strings inbetween. To keep them, name them.
return list.select { |e| e.instance_of?(Hash) }
end
if list.any? { |e| e.instance_of?(A... | ruby | {
"resource": ""
} |
q16726 | Parslet.ClassMethods.rule | train | def rule(name, opts={}, &definition)
undef_method name if method_defined? name
define_method(name) do
@rules ||= {} # <name, rule> memoization
return @rules[name] if @rules.has_key?(name)
# Capture the self of the parser class along with the definition.
| ruby | {
"resource": ""
} |
q16727 | Parslet.Cause.raise | train | def raise(exception_klass=Parslet::ParseFailed)
exception = exception_klass.new(self.to_s, | ruby | {
"resource": ""
} |
q16728 | Parslet.Source.consume | train | def consume(n)
position = self.pos
slice_str = @str.scan(@re_cache[n])
slice = Parslet::Slice.new(
position, | ruby | {
"resource": ""
} |
q16729 | Surrealist.Builder.construct_collection | train | def construct_collection(schema, instance, key, value)
schema[key] = instance.send(key).map do |inst|
| ruby | {
"resource": ""
} |
q16730 | Surrealist.InstanceMethods.surrealize | train | def surrealize(**args)
return args[:serializer].new(self).surrealize(args) if args[:serializer]
if (serializer = | ruby | {
"resource": ""
} |
q16731 | Surrealist.InstanceMethods.build_schema | train | def build_schema(**args)
return args[:serializer].new(self).build_schema(args) if args[:serializer]
if (serializer = find_serializer(args[:for]))
| ruby | {
"resource": ""
} |
q16732 | Surrealist.Serializer.build_schema | train | def build_schema(**args)
if Helper.collection?(object)
build_collection_schema(args)
| ruby | {
"resource": ""
} |
q16733 | Surrealist.Serializer.build_collection_schema | train | def build_collection_schema(**args)
object.map | ruby | {
"resource": ""
} |
q16734 | Surrealist.Carrier.parameters | train | def parameters
{ camelize: camelize, include_root: include_root, include_namespaces: include_namespaces,
| ruby | {
"resource": ""
} |
q16735 | Surrealist.Carrier.check_booleans! | train | def check_booleans!
booleans_hash.each do |key, value|
unless BOOLEANS.include?(value)
| ruby | {
"resource": ""
} |
q16736 | Surrealist.Carrier.check_root! | train | def check_root!
unless root.nil? || (root.is_a?(String) && !root.strip.empty?) || root.is_a?(Symbol)
| ruby | {
"resource": ""
} |
q16737 | Surrealist.ClassMethods.delegate_surrealization_to | train | def delegate_surrealization_to(klass)
raise TypeError, "Expected type of Class got #{klass.class} instead" unless klass.is_a?(Class)
Surrealist::ExceptionRaiser.raise_invalid_schema_delegation! unless Helper.surrealist?(klass)
| ruby | {
"resource": ""
} |
q16738 | Surrealist.ClassMethods.surrealize_with | train | def surrealize_with(klass, tag: Surrealist::VarsHelper::DEFAULT_TAG)
if klass < Surrealist::Serializer
Surrealist::VarsHelper.add_serializer(self, klass, | ruby | {
"resource": ""
} |
q16739 | Faktory.Client.fetch | train | def fetch(*queues)
job = nil
transaction do
command("FETCH", *queues)
| ruby | {
"resource": ""
} |
q16740 | Faktory.Client.beat | train | def beat
transaction do
command("BEAT", %Q[{"wid":"#{@@random_process_wid}"}])
str = result!
if str == "OK"
str
else
| ruby | {
"resource": ""
} |
q16741 | SimpleDiscussion.BootstrapLinkRenderer.url | train | def url(page)
@base_url_params ||= begin
url_params = merge_get_params(default_url_params)
merge_optional_params(url_params)
end
url_params | ruby | {
"resource": ""
} |
q16742 | Gemirro.Source.fetch_prerelease_versions | train | def fetch_prerelease_versions
Utils.logger.info(
"Fetching #{Configuration.prerelease_versions_file}" \
" on #{@name} (#{@host})"
| ruby | {
"resource": ""
} |
q16743 | Gemirro.MirrorDirectory.add_file | train | def add_file(name, content)
full_path = File.join(@path, name)
file | ruby | {
"resource": ""
} |
q16744 | Gemirro.GemsFetcher.versions_for | train | def versions_for(gem)
available = @versions_file.versions_for(gem.name)
return [available.last] if gem.only_latest?
versions = available.select do |v|
| ruby | {
"resource": ""
} |
q16745 | Gemirro.GemsFetcher.fetch_gemspec | train | def fetch_gemspec(gem, version)
filename = gem.gemspec_filename(version)
satisfied = if gem.only_latest?
true
else
gem.requirement.satisfied_by?(version)
end
if gemspec_exists?(filename) || !satisfied
| ruby | {
"resource": ""
} |
q16746 | Gemirro.GemsFetcher.fetch_gem | train | def fetch_gem(gem, version)
filename = gem.filename(version)
satisfied = if gem.only_latest?
true
else
gem.requirement.satisfied_by?(version)
end
name = gem.name
if gem_exists?(filename) || ignore_gem?(name, version, ge... | ruby | {
"resource": ""
} |
q16747 | Gemirro.VersionsFetcher.read_file | train | def read_file(file, prerelease = false)
destination = Gemirro.configuration.destination
file_dst = File.join(destination, file)
unless File.exist?(file_dst)
File.write(file_dst, @source.fetch_versions) unless prerelease
| ruby | {
"resource": ""
} |
q16748 | Gemirro.Gem.filename | train | def filename(gem_version = nil)
gem_version ||= version.to_s
n = [name, gem_version]
| ruby | {
"resource": ""
} |
q16749 | Gemirro.Gem.gemspec_filename | train | def gemspec_filename(gem_version = nil)
gem_version ||= version.to_s
| ruby | {
"resource": ""
} |
q16750 | Gemirro.Server.fetch_gem | train | def fetch_gem(resource)
return unless Utils.configuration.fetch_gem
name = File.basename(resource)
result = name.match(URI_REGEXP)
return unless result
gem_name, gem_version, gem_platform, gem_type = result.captures
return unless gem_name && gem_version
begin
gem = Ut... | ruby | {
"resource": ""
} |
q16751 | Gemirro.Server.update_indexes | train | def update_indexes
indexer = Gemirro::Indexer.new(Utils.configuration.destination)
indexer.only_origin = true
indexer.ui = ::Gem::SilentUI.new
| ruby | {
"resource": ""
} |
q16752 | Gemirro.Server.query_gems_list | train | def query_gems_list
Utils.gems_collection(false) # load collection
gems = Parallel.map(query_gems, in_threads: | ruby | {
"resource": ""
} |
q16753 | Gemirro.Server.gem_dependencies | train | def gem_dependencies(gem_name)
Utils.cache.cache(gem_name) do
gems = Utils.gems_collection(false)
gem_collection = gems.find_by_name(gem_name)
return '' if gem_collection.nil?
gem_collection = Parallel.map(gem_collection, in_threads: 4) do |gem|
[gem, spec_for(gem.name,... | ruby | {
"resource": ""
} |
q16754 | Gemirro.Indexer.download_from_source | train | def download_from_source(file)
source_host = Gemirro.configuration.source.host
Utils.logger.info("Download from source: #{file}")
| ruby | {
"resource": ""
} |
q16755 | Gemirro.Indexer.map_gems_to_specs | train | def map_gems_to_specs(gems)
gems.map.with_index do |gemfile, index|
# rubocop:disable Metrics/LineLength
Utils.logger.info("[#{index + 1}/#{gems.size}]: Processing #{gemfile.split('/')[-1]}")
# rubocop:enable Metrics/LineLength
if File.size(gemfile).zero?
Utils.logger.wa... | ruby | {
"resource": ""
} |
q16756 | Gemirro.GemVersionCollection.by_name | train | def by_name(&block)
if @grouped.nil?
@grouped = @gems.group_by(&:name).map do |name, collection|
[name, GemVersionCollection.new(collection)]
end
@grouped.reject! do |name, _collection|
name.nil?
end
| ruby | {
"resource": ""
} |
q16757 | Gemirro.GemVersionCollection.find_by_name | train | def find_by_name(gemname)
gem = by_name.select do |name, _collection|
name == gemname
| ruby | {
"resource": ""
} |
q16758 | Gemirro.Configuration.logger_level= | train | def logger_level=(level)
logger.level = LOGGER_LEVEL[level] if | ruby | {
"resource": ""
} |
q16759 | Gemirro.Configuration.ignore_gem | train | def ignore_gem(name, version, platform)
ignored_gems[platform] ||= {}
ignored_gems[platform][name] | ruby | {
"resource": ""
} |
q16760 | Gemirro.Configuration.ignore_gem? | train | def ignore_gem?(name, version, platform)
if ignored_gems[platform][name] | ruby | {
"resource": ""
} |
q16761 | Gemirro.Configuration.define_source | train | def define_source(name, url, &block)
source = Source.new(name, | ruby | {
"resource": ""
} |
q16762 | Gemirro.MirrorFile.read | train | def read
handle = File.open(@path, 'r')
| ruby | {
"resource": ""
} |
q16763 | Upton.Scraper.next_index_page_url | train | def next_index_page_url(url, pagination_index)
return url unless @paginated
if pagination_index > @pagination_max_pages
puts "Exceeded pagination limit of #{@pagination_max_pages}" if @verbose
EMPTY_STRING
else
uri = URI.parse(url)
query = uri.query ? Hash[URI.decode_w... | ruby | {
"resource": ""
} |
q16764 | Upton.Scraper.scrape_to_csv | train | def scrape_to_csv filename, &blk
require 'csv'
self.url_array = self.get_index unless self.url_array
CSV.open filename, 'wb' do |csv|
#this is a conscious choice: each document is a list of things, either single elements or rows (as lists).
self.scrape_from_list(self.url_array, blk).co... | ruby | {
"resource": ""
} |
q16765 | Upton.Scraper.get_page | train | def get_page(url, stash=false, options={})
return EMPTY_STRING if url.nil? || url.empty? #url is nil if the <a> lacks an `href` attribute.
global_options = {
:cache => stash,
:verbose => @verbose
}
if @readable_filenames
global_options[:readable_filenames] = true
en... | ruby | {
"resource": ""
} |
q16766 | Upton.Scraper.get_instance | train | def get_instance(url, pagination_index=0, options={})
resps = [self.get_page(url, @debug, options)]
pagination_index = pagination_index.to_i
prev_url = url
while !resps.last.empty?
| ruby | {
"resource": ""
} |
q16767 | Upton.Scraper.scrape_from_list | train | def scrape_from_list(list, blk)
puts "Scraping #{list.size} instances" if @verbose
list.each_with_index.map do |instance_url, instance_index|
instance_resps = get_instance | ruby | {
"resource": ""
} |
q16768 | CF::UAA.Info.varz | train | def varz(name, pwd)
json_get(target, "/varz", | ruby | {
"resource": ""
} |
q16769 | CF::UAA.Info.server | train | def server
reply = json_get(target, '/login', key_style)
return reply if reply && (reply[:prompts] || reply['prompts'])
| ruby | {
"resource": ""
} |
q16770 | CF::UAA.Info.discover_uaa | train | def discover_uaa
info = server
links = info['links'] || info[:links]
uaa = links | ruby | {
"resource": ""
} |
q16771 | CF::UAA.Info.validation_key | train | def validation_key(client_id = nil, client_secret = nil)
hdrs = client_id && client_secret ?
| ruby | {
"resource": ""
} |
q16772 | CF::UAA.Info.password_strength | train | def password_strength(password)
json_parse_reply(key_style, *request(target, :post, '/password/score',
Util.encode_form(:password | ruby | {
"resource": ""
} |
q16773 | CF::UAA.Scim.type_info | train | def type_info(type, elem)
scimfo = {
user: {
path: '/Users',
name_attr: 'userName',
origin_attr: 'origin'
},
group: {
path: '/Groups',
name_attr: 'displayName',
origin_attr: 'zoneid'
},
client: {
... | ruby | {
"resource": ""
} |
q16774 | CF::UAA.Scim.add | train | def add(type, info)
path, info = type_info(type, :path), force_case(info)
reply = json_parse_reply(@key_style, *json_post(@target, | ruby | {
"resource": ""
} |
q16775 | CF::UAA.Scim.put | train | def put(type, info)
path, info = type_info(type, :path), force_case(info)
ida = type == :client ? 'client_id' : 'id'
raise ArgumentError, "info must include #{ida}" unless id = info[ida]
hdrs = headers
if info && info['meta'] && | ruby | {
"resource": ""
} |
q16776 | CF::UAA.Scim.query | train | def query(type, query = {})
query = force_case(query).reject {|k, v| v.nil? }
if attrs = query['attributes']
attrs = Util.arglist(attrs).map {|a| force_attr(a)}
query['attributes'] = Util.strlist(attrs, ",")
end
qstr = query.empty?? '': "?#{Util.encode_form(query)}"
info = json_get(@targ... | ruby | {
"resource": ""
} |
q16777 | CF::UAA.Scim.get | train | def get(type, id)
info = json_get(@target, "#{type_info(type, :path)}/#{URI.encode(id)}",
| ruby | {
"resource": ""
} |
q16778 | CF::UAA.TokenIssuer.implicit_grant_with_creds | train | def implicit_grant_with_creds(credentials, scope = nil)
# this manufactured redirect_uri is a convention here, not part of OAuth2
redir_uri = "https://uaa.cloudfoundry.com/redirect/#{@client_id}"
response_type = "token"
response_type = "#{response_type} id_token" if scope && (scope.include? "openid")
... | ruby | {
"resource": ""
} |
q16779 | CF::UAA.TokenIssuer.implicit_uri | train | def implicit_uri(redirect_uri, scope = nil)
response_type = "token"
response_type = "#{response_type} id_token" if scope && (scope.include? "openid")
| ruby | {
"resource": ""
} |
q16780 | CF::UAA.TokenIssuer.implicit_grant | train | def implicit_grant(implicit_uri, callback_fragment)
in_params = Util.decode_form(URI.parse(implicit_uri).query)
unless in_params['state'] && in_params['redirect_uri']
raise | ruby | {
"resource": ""
} |
q16781 | CF::UAA.TokenIssuer.autologin_uri | train | def autologin_uri(redirect_uri, credentials, scope = nil)
headers = {'content-type' => FORM_UTF8, 'accept' => JSON_UTF8,
'authorization' => Http.basic_auth(@client_id, @client_secret) }
body = Util.encode_form(credentials)
reply = json_parse_reply(nil, *request(@target, :post, "/autologin", body, he... | ruby | {
"resource": ""
} |
q16782 | CF::UAA.TokenIssuer.authcode_grant | train | def authcode_grant(authcode_uri, callback_query)
ac_params = Util.decode_form(URI.parse(authcode_uri).query)
unless ac_params['state'] && ac_params['redirect_uri']
raise ArgumentError, "authcode redirect must happen before authcode grant"
end
begin
params = Util.decode_form(callback_query)
... | ruby | {
"resource": ""
} |
q16783 | FiniteMachine.EventsMap.choice_transition? | train | def choice_transition?(name, from_state)
find(name).select { |trans| | ruby | {
"resource": ""
} |
q16784 | FiniteMachine.EventsMap.match_transition | train | def match_transition(name, from_state)
find(name).find { | ruby | {
"resource": ""
} |
q16785 | FiniteMachine.EventsMap.match_transition_with | train | def match_transition_with(name, from_state, *conditions)
find(name).find do | ruby | {
"resource": ""
} |
q16786 | FiniteMachine.EventsMap.select_transition | train | def select_transition(name, from_state, *conditions)
if choice_transition?(name, from_state)
match_transition_with(name, | ruby | {
"resource": ""
} |
q16787 | FiniteMachine.EventsMap.move_to | train | def move_to(name, from_state, *conditions)
transition = select_transition(name, from_state, *conditions)
transition | ruby | {
"resource": ""
} |
q16788 | FiniteMachine.EventsMap.to_s | train | def to_s
hash = {}
@events_map.each_pair do |name, trans|
| ruby | {
"resource": ""
} |
q16789 | FiniteMachine.Transition.make_conditions | train | def make_conditions
@if.map { |c| Callable.new(c) } +
| ruby | {
"resource": ""
} |
q16790 | FiniteMachine.Transition.matches? | train | def matches?(from)
states.keys.any? | ruby | {
"resource": ""
} |
q16791 | FiniteMachine.ChoiceMerger.choice | train | def choice(to, **conditions)
transition_builder = TransitionBuilder.new(@machine, @name,
| ruby | {
"resource": ""
} |
q16792 | FiniteMachine.StateDefinition.define_state_query_method | train | def define_state_query_method(state)
return if machine.respond_to?("#{state}?") | ruby | {
"resource": ""
} |
q16793 | FiniteMachine.Observer.on | train | def on(hook_type, state_or_event_name = nil, async = nil, &callback)
sync_exclusive do
if state_or_event_name.nil?
state_or_event_name = HookEvent.any_state_or_event(hook_type)
| ruby | {
"resource": ""
} |
q16794 | FiniteMachine.Observer.off | train | def off(hook_type, name = ANY_STATE, &callback)
sync_exclusive do
| ruby | {
"resource": ""
} |
q16795 | FiniteMachine.Observer.emit | train | def emit(event, *data)
sync_exclusive do
[event.type].each do |hook_type|
any_state_or_event = HookEvent.any_state_or_event(hook_type)
[any_state_or_event, event.name].each do | ruby | {
"resource": ""
} |
q16796 | FiniteMachine.Observer.handle_callback | train | def handle_callback(hook, event, *data)
to = machine.events_map.move_to(event.event_name, event.from, *data)
trans_event = TransitionEvent.new(event.event_name, event.from, to)
callable = create_callable(hook)
| ruby | {
"resource": ""
} |
q16797 | FiniteMachine.Observer.defer | train | def defer(callable, trans_event, *data)
async_call = AsyncCall.new(machine, callable, trans_event, *data)
callback_queue.start | ruby | {
"resource": ""
} |
q16798 | FiniteMachine.Observer.create_callable | train | def create_callable(hook)
callback = proc do |trans_event, *data|
machine.instance_exec(trans_event, | ruby | {
"resource": ""
} |
q16799 | FiniteMachine.HookEvent.notify | train | def notify(subscriber, *data)
return unless subscriber.respond_to?(MESSAGE) | 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.