query stringlengths 7 9.55k | document stringlengths 10 363k | metadata dict | negatives listlengths 0 101 | negative_scores listlengths 0 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
:nodoc: If data is set, uses a POST with data in the request body Otherwise uses GET | def send_request(url, data=nil)
begin
puts "BigBlueButtonAPI: URL request = #{url}" if @debug
url_parsed = URI.parse(url)
http = Net::HTTP.new(url_parsed.host, url_parsed.port)
http.open_timeout = @timeout
http.read_timeout = @timeout
if data.nil?
response... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def post(data = {})\n call data, method: :post\n end",
"def form_data= data\n @headers['Content-Type'] = \"application/x-www-form-urlencoded\"\n @body = self.class.build_query data\n end",
"def post(data = \"\")\n submit :Post, data\n end",
"def http_send url, form_data, headers,... | [
"0.69248354",
"0.6805413",
"0.67757183",
"0.65847856",
"0.6565718",
"0.6553006",
"0.6540688",
"0.65202355",
"0.6510752",
"0.6505452",
"0.6502223",
"0.6459863",
"0.64190793",
"0.64148325",
"0.6305806",
"0.62422645",
"0.6146376",
"0.6125995",
"0.6120194",
"0.6119033",
"0.605284... | 0.0 | -1 |
turn the import errors into a report in markdown format | def format_error_report(errors)
return if errors.empty?
errors.map { |error| "* #{error}" }.join("\n")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def markdown_issues (results, heading)\n message = \"#### #{heading}\\n\\n\"\n\n message << \"File | Line | Reason |\\n\"\n message << \"| --- | ----- | ----- |\\n\"\n\n results.each do |r|\n filename = r['file'].split('/').last\n line = r['line']\n reason = r['reason']\n\n... | [
"0.68400085",
"0.63761246",
"0.60195386",
"0.5989029",
"0.5989029",
"0.59572995",
"0.58851343",
"0.5861108",
"0.58065397",
"0.57971346",
"0.57545304",
"0.57242554",
"0.5678115",
"0.56671",
"0.5666511",
"0.56457436",
"0.5645607",
"0.56222373",
"0.5621972",
"0.56215656",
"0.561... | 0.6566495 | 1 |
Update meter with value | def sample(at, value)
@current += value
prune_samples(at)
@samples << [at, @current]
save_rate(at)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @meter.update(meter_params)\n format.html { redirect_to admin_meter_path(@meter), notice: 'Meter was successfully updated.' }\n format.json { render :show, status: :ok, location: admin_meter_path(@meter) }\n else\n format.html { render :edi... | [
"0.68119246",
"0.6678077",
"0.6670286",
"0.66381294",
"0.6635609",
"0.6635609",
"0.64513695",
"0.64161986",
"0.63813937",
"0.6369992",
"0.63066053",
"0.63003606",
"0.62900716",
"0.6255275",
"0.62384886",
"0.62384886",
"0.62384886",
"0.6214744",
"0.6205281",
"0.61336106",
"0.6... | 0.0 | -1 |
Remove samples that are obsolete | def prune_samples(at)
cutoff = at - @interval
while @samples.size > 1 && (@samples.first.first < cutoff)
@samples.shift
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sample_and_remove(n)\n samples = sample(n)\n @content -= samples\n samples\n end",
"def filter_samples(files)\n files.reject { |f| sample?(f) }\n end",
"def clean_arb_samples(src)\n Find.find(src) do |path|\n next if File.basename(path) !~ /^sample$/i\n FileUtils.rm_r(path,$options) ... | [
"0.6504869",
"0.6459845",
"0.64542097",
"0.6268867",
"0.6268867",
"0.62312734",
"0.62194836",
"0.5890662",
"0.5852494",
"0.5809523",
"0.57728016",
"0.5759747",
"0.57235175",
"0.5717218",
"0.5709445",
"0.56963664",
"0.5611392",
"0.5608601",
"0.5593993",
"0.5586954",
"0.5579051... | 0.5937178 | 7 |
The current rate of sampling for a given interval | def rate
first_at, first_value = @samples.first
last_at, last_value = @samples.last
if first_at == last_at
0
else
(last_value - first_value) / (last_at - first_at)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rate\n @rate * ONE_NANOS\n end",
"def sample_rate\n @format.sample_rate\n end",
"def sample_rate\n @values.fetch('sampleRate') { \n @values['sampleRate'] = 100.0\n }\n end",
"def mean_rate\n last_at, last_value = @samples.last\n if las... | [
"0.71659976",
"0.7150447",
"0.7074418",
"0.6759002",
"0.67450505",
"0.67213476",
"0.6694133",
"0.656817",
"0.6380868",
"0.6254083",
"0.62380844",
"0.6201092",
"0.6185521",
"0.6159747",
"0.6159747",
"0.6146827",
"0.61418337",
"0.61418337",
"0.60989517",
"0.60387707",
"0.603814... | 0.74027467 | 0 |
Group all rates per interval | def rates
@rates + [rate]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grouped_by_interval( range )\n grouped = Hash.new {|h,k| h[k] = [] }\n all.each { |r| r.period_in_seconds.step( range ) { |i| grouped[i/(range)] << r } }\n grouped\n end",
"def gm_full_rate(interval)\n @gm_full_rate ||= {}\n return @gm_full_rate[interval] if @gm_full_rate[interval]\n ... | [
"0.7481939",
"0.62314403",
"0.59225965",
"0.5908157",
"0.58185863",
"0.56001854",
"0.5533525",
"0.5401228",
"0.53987837",
"0.53920424",
"0.53527075",
"0.5288315",
"0.52504086",
"0.52504086",
"0.524879",
"0.5236919",
"0.5220759",
"0.52139974",
"0.52048373",
"0.5194042",
"0.517... | 0.56260085 | 5 |
The mean rate of all the sampled rates | def mean_rate
last_at, last_value = @samples.last
if last_at == @start_time
0
else
last_value / (last_at - @start_time)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def avg_rate\n if @total > 0\n if @interval == 0.0 then 0.0 else 1.0 / @interval end\n end\n end",
"def rate\n first_at, first_value = @samples.first\n last_at, last_value = @samples.last\n if first_at == last_at\n 0\n else\n (last_value - first... | [
"0.74250346",
"0.7255075",
"0.71559066",
"0.7040534",
"0.6966955",
"0.6955907",
"0.69440144",
"0.69143105",
"0.6901528",
"0.6862978",
"0.68456227",
"0.6841675",
"0.68279684",
"0.681715",
"0.6787557",
"0.6743045",
"0.67415255",
"0.66828513",
"0.668053",
"0.6672536",
"0.6669829... | 0.8186303 | 0 |
Reset the meter by clearing out it's metrics | def clear
start
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reset_metrics\n flush_cache\n self\n end",
"def clear_stats\n reset!\n NewRelic::Agent::BusyCalculator.reset\n end",
"def stats_reset\n @stats = nil\n end",
"def reset_stats; reset!; end",
"def reset_metrics_buffer\n @@metrics_buffer = []\n end",
"def reset... | [
"0.79300857",
"0.72694355",
"0.724922",
"0.7182558",
"0.7024842",
"0.6992253",
"0.6977997",
"0.69146115",
"0.6883066",
"0.68517023",
"0.6848623",
"0.6848623",
"0.68171513",
"0.68002975",
"0.6777676",
"0.67530906",
"0.67426294",
"0.67426294",
"0.67401505",
"0.6728937",
"0.6709... | 0.0 | -1 |
Going to make sure that the web server service will exist Could just look for the service in the resource list instead I suppose | def check_recipes
if new_resource.web_server == 'apache'
web_server_recipe = "apache2::default"
else
web_server_recipe = "#{new_resource.web_server}::default"
end
unless run_context.loaded_recipes.include?(web_server_recipe)
Chef::Application.fatal!("Did no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def service_path\n raise MethodMissingError\n end",
"def known_service? url\n !!service_endpoint(url)\n end",
"def ensure_service!\n service = params[:service] or raise \"no service given\"\n @service = Service(service, @realm) or raise \"invalid service\"\n end",
"def check_se... | [
"0.6145587",
"0.6002534",
"0.5966315",
"0.5876088",
"0.5864353",
"0.5858354",
"0.5855908",
"0.58148926",
"0.5765218",
"0.57550216",
"0.5751139",
"0.5751139",
"0.5729998",
"0.5729998",
"0.5729998",
"0.5729998",
"0.5727222",
"0.5674339",
"0.56673574",
"0.564226",
"0.564226",
... | 0.58495474 | 7 |
Install git if we cant find the git resource included | def install_git
begin
run_context.resource_collection.include(package: 'git')
rescue
git_package = Chef::Resource::Package.new('git', run_context)
git_package.name 'git'
git_package.run_action :install
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def install_git\n\tKitchenplan::Log.debug \"Git is installed by the go.bat bootstrap on Windows, skipping install_git()\"\n end",
"def install_git\n\tsudo \"apt-get install git\" unless git_installed?\n end",
"def install_git\n\tsudo \"apt-get install git\" unless git_installed?\n end",
"def i... | [
"0.8018472",
"0.77877426",
"0.77877426",
"0.76774365",
"0.76774365",
"0.72919255",
"0.705691",
"0.70567375",
"0.70567375",
"0.7025835",
"0.69054854",
"0.6631472",
"0.6554755",
"0.6473045",
"0.646783",
"0.646783",
"0.646767",
"0.64668757",
"0.6431818",
"0.63845646",
"0.6384564... | 0.84547806 | 0 |
given an AR object or array of AR objects, return the attributes | def attrs(obj)
if obj.respond_to?(:map)
records_attrs obj
else
record_attrs obj
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attributes\n @list.map(&:attributes)\n end",
"def attributes(*args)\n args.each do |attr|\n attribute(attr)\n end\n end",
"def attribute_values \n columns = self.class.columns\n columns.map { |col| self.send(col) } #=> ex. [:id, :name,... | [
"0.6581684",
"0.6533065",
"0.6436314",
"0.64212996",
"0.6380245",
"0.63775545",
"0.6260044",
"0.62223905",
"0.6199632",
"0.6186653",
"0.61742026",
"0.61720306",
"0.6098413",
"0.6095805",
"0.6090262",
"0.60810626",
"0.60810626",
"0.60810626",
"0.60534203",
"0.60508835",
"0.604... | 0.62654084 | 6 |
given an AR object, return the errors and attributes (both as hashes) | def attrs_and_errs(record)
errors = record.errors.to_hash
attribs = record.attributes
[attribs, errors]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def errors_on_object(record)\n record.errors.full_messages\n end",
"def errors_for(_object); end",
"def form_errors_from_model(obj)\n if obj.respond_to?(:errors)\n obj.errors.each do |key, value|\n if value.respond_to?(:first)\n value = value.first\n e... | [
"0.72118616",
"0.6946013",
"0.6912099",
"0.68574244",
"0.6842445",
"0.6522075",
"0.6464093",
"0.6390985",
"0.63833344",
"0.6339944",
"0.63240546",
"0.6292248",
"0.62902474",
"0.6286595",
"0.6279331",
"0.62763953",
"0.6238485",
"0.6225846",
"0.6211737",
"0.6184537",
"0.6141993... | 0.7536314 | 0 |
Make an HTTP request | def request(verb, uri, opts = {})
opts = @default_options.merge(opts)
req = build_request(verb, uri, opts)
res = perform(req, opts)
return res unless opts.follow
Redirector.new(opts.follow).perform(req, res) do |request|
perform(wrap_request(request, opts), opts)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_request\n response = @http.request(@request)\n end",
"def make_request(url,headers,query)\n c = HTTPClient.new\n c.get_content(url,query,headers)\nend",
"def do_request()\n uri = URI.parse(API_BASE_URL + build_request_path())\n response = Net::HTTP.get_response(uri)\n response... | [
"0.8042414",
"0.78584707",
"0.76592636",
"0.75314677",
"0.75151074",
"0.7472118",
"0.7444434",
"0.7431142",
"0.740172",
"0.73993415",
"0.7380401",
"0.7374962",
"0.73294693",
"0.73000824",
"0.72803706",
"0.7278908",
"0.7277784",
"0.7200123",
"0.71982",
"0.71946925",
"0.7188027... | 0.0 | -1 |
Prepare an HTTP request | def build_request(verb, uri, opts = {})
opts = @default_options.merge(opts)
uri = make_request_uri(uri, opts)
headers = make_request_headers(opts)
body = make_request_body(opts, headers)
req = HTTP::Request.new(
:verb => verb,
:uri => uri,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_request()\n @http = Net::HTTP.new(@uri.host, @uri.port)\n @http.use_ssl = true\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n end",
"def build_net_http_request request\n\n # Net::HTTP adds a content-type header automatically unless its set\n # and this messes with reque... | [
"0.71244776",
"0.7098596",
"0.7067127",
"0.70014745",
"0.69835323",
"0.6969639",
"0.6954709",
"0.6900277",
"0.68957466",
"0.6781143",
"0.6758644",
"0.67299014",
"0.6729322",
"0.6722447",
"0.66966784",
"0.66793776",
"0.6671555",
"0.6671167",
"0.66172534",
"0.6607671",
"0.65962... | 0.6352299 | 44 |
Perform a single (no follow) HTTP request | def perform(req, options)
verify_connection!(req.uri)
@state = :dirty
begin
@connection ||= HTTP::Connection.new(req, options)
unless @connection.failed_proxy_connect?
@connection.send_request(req)
@connection.read_headers!
end
rescue Error => e
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run_request(method, url, body, headers); end",
"def perform_single_request(env)\n req = create_request(env)\n req = req.setup_request(env[:method], request_config(env))\n req.callback do |client|\n if env[:request].stream_response?\n warn \"Streaming downloads for #{s... | [
"0.6862672",
"0.6837835",
"0.6802263",
"0.67843044",
"0.6782693",
"0.6769043",
"0.66941273",
"0.665357",
"0.66421276",
"0.6624555",
"0.65582794",
"0.6538545",
"0.65351206",
"0.65191764",
"0.6503422",
"0.6502893",
"0.64844406",
"0.64804405",
"0.6472424",
"0.6471103",
"0.646787... | 0.0 | -1 |
Verify our request isn't going to be made against another URI | def verify_connection!(uri)
if default_options.persistent? && uri.origin != default_options.persistent
raise StateError, "Persistence is enabled for #{default_options.persistent}, but we got #{uri.origin}"
end
# We re-create the connection object because we want to let prior requests
# ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verify_uri_acessibility uri\n res = Net::HTTP.get_response URI(uri)\n res.is_a? Net::HTTPSuccess\nend",
"def verify_connection!(uri); end",
"def verify_same_origin_request; end",
"def cannot_access_api?\n !request.env[\"REQUEST_METHOD\"].eql?(\"GET\") &&\n !request.headers['mw-token'].eql?(ENV[\"... | [
"0.6825868",
"0.66445756",
"0.64557064",
"0.64450014",
"0.6427309",
"0.64077455",
"0.6397994",
"0.6397994",
"0.6385076",
"0.6314896",
"0.629684",
"0.62404525",
"0.6231907",
"0.6225621",
"0.6215438",
"0.6204571",
"0.6204571",
"0.61718446",
"0.61657727",
"0.61657727",
"0.616577... | 0.0 | -1 |
Merges query params if needed | def make_request_uri(uri, opts)
uri = uri.to_s
uri = "#{default_options.persistent}#{uri}" if default_options.persistent? && uri !~ HTTP_OR_HTTPS_RE
uri = HTTP::URI.parse uri
uri.query_values = uri.query_values(Array).to_a.concat(opts.params.to_a) if opts.params && !opts.params.empty?
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_query\n\t\t\tp = []\n\t\t\tp << @params.query_string unless @params.query_string == \"\"\n\t\t\tp << @filters.query_string unless @filters.query_string == \"\"\n\t\t\treturn p.size > 0 ? p.join(\"&\") : nil\n\t\tend",
"def inject_last_query_into_params\n if current_search_session\n current_sear... | [
"0.7619678",
"0.71923447",
"0.71220136",
"0.6957798",
"0.68442714",
"0.6808063",
"0.6807166",
"0.67561007",
"0.67471075",
"0.67471075",
"0.67272",
"0.6697958",
"0.66942227",
"0.66942227",
"0.66942227",
"0.66942227",
"0.66922957",
"0.66922957",
"0.66766036",
"0.6631686",
"0.66... | 0.0 | -1 |
Creates request headers with cookies (if any) merged in | def make_request_headers(opts)
headers = opts.headers
# Tell the server to keep the conn open
headers[Headers::CONNECTION] = default_options.persistent? ? Connection::KEEP_ALIVE : Connection::CLOSE
cookies = opts.cookies.values
unless cookies.empty?
cookies = opts.headers.get(He... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def login_headers(request)\n if @cookie\n request['Cookie'] = @cookie\n else\n request['Fastly-Key'] = config[:key]\n end\n\n request\n end",
"def prepare_headers\n if @session_cookie\n @headers['cookie'] = @session_cookie\n end\n super\n end",
"def ext... | [
"0.7493506",
"0.7364052",
"0.72355837",
"0.7216342",
"0.7119418",
"0.71169555",
"0.70383024",
"0.69974065",
"0.6960397",
"0.69517374",
"0.6827501",
"0.68234193",
"0.6816265",
"0.67558897",
"0.6640557",
"0.6581517",
"0.65785074",
"0.6574879",
"0.65260565",
"0.65260565",
"0.651... | 0.728275 | 2 |
Create the request body object to send | def make_request_body(opts, headers)
case
when opts.body
opts.body
when opts.form
form = make_form_data(opts.form)
headers[Headers::CONTENT_TYPE] ||= form.content_type
form
when opts.json
body = MimeType[:json].encode opts.json
headers[Headers::CON... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_request_body(header_params, form_params, body)\n # http form\n if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||\n header_params['Content-Type'] == 'multipart/form-data'\n data = {}\n form_params.each do |key, value|\n case value\n ... | [
"0.739416",
"0.739416",
"0.739416",
"0.739416",
"0.7301358",
"0.72364676",
"0.7140018",
"0.7124113",
"0.7025348",
"0.701368",
"0.7005378",
"0.6962397",
"0.6922753",
"0.68136936",
"0.67817265",
"0.6779252",
"0.66338164",
"0.66282254",
"0.6611487",
"0.66102797",
"0.6609712",
... | 0.69850516 | 11 |
Return list of available options | def options
return self.methods - Object.instance_methods
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listOptions\n\n if @assessment.has_partners then\n partnersListOptions()\n end\n \n if @assessment.has_svn then\n svnListOptions()\n end\n \n if @assessment.has_scoreboard then\n scoreboardListOptions()\n end\n end",
"def get_options; end",
"def all\n @options\n ... | [
"0.7501882",
"0.7491665",
"0.7374118",
"0.73727214",
"0.7347314",
"0.7347314",
"0.7310681",
"0.7238418",
"0.71543026",
"0.7125444",
"0.7061763",
"0.70558476",
"0.70393944",
"0.7038197",
"0.70176613",
"0.7015852",
"0.6997814",
"0.69685715",
"0.69583535",
"0.6920617",
"0.691498... | 0.0 | -1 |
tell mailboxer what colum i have my email named | def mailboxer_email(object)
email
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mailboxer_name\n self.name\n end",
"def identifier\n name.presence || email.split('@').join(' from ')\n end",
"def mailboxer_name\n return \"#{name}\"\n end",
"def mail_nickname\n return @mail_nickname\n end",
"def email_from\n ... | [
"0.6219915",
"0.59389794",
"0.576575",
"0.57306045",
"0.56987756",
"0.5614907",
"0.5595551",
"0.55349934",
"0.55349934",
"0.5529706",
"0.5499224",
"0.5492321",
"0.5488332",
"0.5474033",
"0.54737127",
"0.54546535",
"0.5445485",
"0.54449433",
"0.54382575",
"0.54381186",
"0.5420... | 0.549753 | 11 |
calling the function Method to check if an integer can be perfectly divided by 3 | def by_three?(x)
if x % 3 == 0
return true
else
return false
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def can_be_divided_by_three(number)\n is_divisible_by_3 = number % 3\n is_divisible_by_3 == 0\nend",
"def divisible_by_three?(number)\n number % 3 == 0\nend",
"def is_divisible_by_three?(number)\n return true if number % 3 == 0\nend",
"def divisible_by_three(number)\n if number % 3 == 0 \n retu... | [
"0.8304793",
"0.81683975",
"0.80332893",
"0.8019587",
"0.7943878",
"0.7779862",
"0.76680195",
"0.7636797",
"0.75878644",
"0.74538416",
"0.7402452",
"0.739087",
"0.7384512",
"0.7345218",
"0.7345218",
"0.7342935",
"0.73406607",
"0.7303565",
"0.7280143",
"0.7215145",
"0.7169",
... | 0.7526999 | 9 |
Blocks nameless methods differ from methods in that they are only limited to that "block" or instance or in the context of an array, a block would last for the length of an array Methods can be called any number of times after they have been defined method that capitalizes a word | def capitalize(string)
puts "#{string[0].upcase}#{string[1..-1]}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def method a, &block\r\n\t1\r\nend",
"def method a, &block, *c\r\n\t1\r\nend",
"def method2(&block)\n block.call.upcase\nend",
"def method2(&block)\n block.call.upcase\nend",
"def method a, *b, &block\r\n\t1\r\nend",
"def method &block, a\r\n\t1\r\nend",
"def method_that_takes_a_block(&blk)\n p blk.... | [
"0.65029764",
"0.64983726",
"0.64646935",
"0.64646935",
"0.64325976",
"0.63840395",
"0.6382076",
"0.6363269",
"0.62403965",
"0.62403965",
"0.61860806",
"0.6182133",
"0.61653817",
"0.6024292",
"0.5906332",
"0.5838466",
"0.581198",
"0.581198",
"0.581198",
"0.581198",
"0.581198"... | 0.0 | -1 |
Response = StatusLine (( generalheader | responseheader | entityheader ) CRLF) CRLF [ messagebody ] | def initialize(status_line, headers = Array::new, message = "")
@_start_line = status_line
@_message_headers = headers
@_message_body = message
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def response_line\n \"#{Protocol::NAME}/#{@version} #{@code} #{@message}#{Protocol::CRLF}\"\n end",
"def status_line\n # First line is 'Status-Line' from RFC2616 section 6.1\n # Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF\n # etc...\n return \"HTTP/#{version} #{s... | [
"0.7433371",
"0.7290773",
"0.7232879",
"0.7230275",
"0.709512",
"0.7042659",
"0.6968288",
"0.69279766",
"0.6719796",
"0.67041147",
"0.6573977",
"0.65659994",
"0.6541246",
"0.6525909",
"0.65245837",
"0.64480793",
"0.6439908",
"0.6409394",
"0.63267714",
"0.62997895",
"0.6297580... | 0.5799266 | 54 |
Instantiates a new deviceComplianceScheduledActionForRule and sets the default values. | def initialize()
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scheduled_action_configurations=(value)\n @scheduled_action_configurations = value\n end",
"def create name, options = {}\n \n scheduled_action = ScheduledAction.new(name, \n :auto_scaling_group_name => auto_scaling_group_name_opt(options),\n :config ... | [
"0.51396394",
"0.5117516",
"0.5018338",
"0.49970505",
"0.49255744",
"0.4881171",
"0.48710778",
"0.48690212",
"0.48011807",
"0.474592",
"0.47012147",
"0.467794",
"0.46375513",
"0.46136",
"0.4605743",
"0.45656407",
"0.45521137",
"0.45288607",
"0.4510847",
"0.45047396",
"0.45025... | 0.0 | -1 |
The deserialization information for the current model | def get_field_deserializers()
return super.merge({
"ruleName" => lambda {|n| @rule_name = n.get_string_value() },
"scheduledActionConfigurations" => lambda {|n| @scheduled_action_configurations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Model... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def serialized_attributes\n read_inheritable_attribute(\"attr_serialized\") || { }\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus... | [
"0.65103906",
"0.63228637",
"0.632284",
"0.6309272",
"0.6295075",
"0.623873",
"0.62322974",
"0.6214971",
"0.61998814",
"0.619934",
"0.61737543",
"0.61737084",
"0.6170426",
"0.6162578",
"0.6161866",
"0.6157894",
"0.61552656",
"0.61428016",
"0.61396116",
"0.6137667",
"0.611978"... | 0.0 | -1 |
Gets the ruleName property value. Name of the rule which this scheduled action applies to. Currently scheduled actions are created per policy instead of per rule, thus RuleName is always set to default value PasswordRequired. | def rule_name
return @rule_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rule_name=(value)\n @rule_name = value\n end",
"def rule_name=(rule_name)\n @rule_name = rule_name.to_sym\n end",
"def rule_name=(rule_name)\n @rule_name = rule_name.to_sym\n end",
"def rule name\n @rule_map[name.downcase]\n end",
"def to_s\n rule_... | [
"0.75245035",
"0.6941797",
"0.6941797",
"0.61218035",
"0.5991571",
"0.59375787",
"0.5797347",
"0.5797347",
"0.57590336",
"0.5465742",
"0.54122704",
"0.53799385",
"0.53530705",
"0.53431964",
"0.5319757",
"0.52752036",
"0.52752036",
"0.52752036",
"0.52752036",
"0.52752036",
"0.... | 0.7734302 | 0 |
Sets the ruleName property value. Name of the rule which this scheduled action applies to. Currently scheduled actions are created per policy instead of per rule, thus RuleName is always set to default value PasswordRequired. | def rule_name=(value)
@rule_name = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rule_name=(rule_name)\n @rule_name = rule_name.to_sym\n end",
"def rule_name=(rule_name)\n @rule_name = rule_name.to_sym\n end",
"def set_rule_name(opts)\n opts = check_params(opts,[:rule_names])\n super(opts)\n end",
"def rule_name\n return @rule_name\n ... | [
"0.7448168",
"0.7448168",
"0.63525677",
"0.6057133",
"0.54787564",
"0.53617173",
"0.5338838",
"0.5309575",
"0.5264918",
"0.5122381",
"0.50101775",
"0.4948504",
"0.4941779",
"0.49072874",
"0.4904445",
"0.4877593",
"0.4877593",
"0.48472196",
"0.482137",
"0.48129916",
"0.4760319... | 0.7578986 | 0 |
Gets the scheduledActionConfigurations property value. The list of scheduled action configurations for this compliance policy. Compliance policy must have one and only one block scheduled action. | def scheduled_action_configurations
return @scheduled_action_configurations
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scheduled_action_configurations=(value)\n @scheduled_action_configurations = value\n end",
"def is_scheduled_action_enabled\n return @is_scheduled_action_enabled\n end",
"def scheduled\n response = get 'scheduled'\n response.map{|item| Hashie::M... | [
"0.7496535",
"0.5530832",
"0.5509932",
"0.5480652",
"0.5263062",
"0.5251833",
"0.5081743",
"0.5053663",
"0.50008625",
"0.49426487",
"0.4939407",
"0.4907666",
"0.48856187",
"0.4884995",
"0.48827863",
"0.48055127",
"0.48055127",
"0.48055127",
"0.4795476",
"0.4795476",
"0.479257... | 0.8078393 | 0 |
Sets the scheduledActionConfigurations property value. The list of scheduled action configurations for this compliance policy. Compliance policy must have one and only one block scheduled action. | def scheduled_action_configurations=(value)
@scheduled_action_configurations = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scheduled_action_configurations\n return @scheduled_action_configurations\n end",
"def populate_scheduled(actions)\n @scheduled = actions.map do |action|\n config = ScheduledConfig.new()\n config.populate(action)\n config\n end\n end",
... | [
"0.62396765",
"0.5680575",
"0.5112988",
"0.49128458",
"0.47851226",
"0.45478073",
"0.451942",
"0.451776",
"0.4498475",
"0.4357329",
"0.43567932",
"0.43278563",
"0.4295306",
"0.42779243",
"0.42446548",
"0.42417073",
"0.42098668",
"0.4209291",
"0.41808885",
"0.4168101",
"0.4155... | 0.77686083 | 0 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
super
writer.write_string_value("ruleName", @rule_name)
writer.write_collection_of_object_values("scheduledActionConfigurations", @scheduled_action_configurations)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
... | [
"0.7951372",
"0.7645999",
"0.7579812",
"0.7579812",
"0.7440032",
"0.720861",
"0.720861",
"0.7207583",
"0.7016516",
"0.70007193",
"0.6992252",
"0.69838214",
"0.69723576",
"0.69666415",
"0.69666415",
"0.6942002",
"0.69417155",
"0.6933786",
"0.6913977",
"0.6891677",
"0.68810964"... | 0.0 | -1 |
get number of this message for this user | def define_num
self.num ||= from.new_num_message
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def message_count\n\t s = status\n\t\t\ts[:message_count]\n\t end",
"def notification_number\n @notifications = Notification.get_number_of_notifications current_user\n end",
"def message_count\n to_i description['MessageCount']\n end",
"def get_num\n\t\treturn @num_users\n\tend",
"def m... | [
"0.7123138",
"0.70693636",
"0.70532095",
"0.6934111",
"0.6868182",
"0.6806947",
"0.67750853",
"0.67725724",
"0.6731581",
"0.67239034",
"0.66758907",
"0.6657914",
"0.6653945",
"0.6635001",
"0.6615929",
"0.659187",
"0.6586926",
"0.6537852",
"0.6506359",
"0.644512",
"0.6425802",... | 0.0 | -1 |
This code should be evaluated (evalr) inside `gdb` after attaching and then it executed you should dettach `gdb` in order to continue running script with debugger turned on. | def load_debugger(new_argv)
path_to_rdebug = "/home/user/Ruby/ruby-debug-ide/bin/rdebug-ide"
old_argv = ARGV.clone
ARGV.reject {|x| true}
new_argv.each do |x|
ARGV << x
end
old_0 = $0.clone
$0 = path_to_rdebug
load path_to_rdebug
$0 = old_0
ARGV.reject {|x| true}
old_argv.each do |x|
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rungdb\n gdbcmd = \"gdb --batch --quiet -x \\\"#{@cmdfilepath}\\\" \\\"#{@dsymfile}\\\"\"\n gdbout = `#{gdbcmd}`\n gdbout\n end",
"def debug it\n PryByebug::BreakCommand.new.send :add_breakpoint, \"Testo::Test#run\", nil\n # How to \"next next step\" automatically when the breakpoint is hit?\n\n ... | [
"0.6589884",
"0.6407879",
"0.6381641",
"0.62938976",
"0.62170637",
"0.6205211",
"0.60321397",
"0.6031262",
"0.59568834",
"0.5933138",
"0.5915665",
"0.5905137",
"0.5872696",
"0.5872696",
"0.5821637",
"0.57585317",
"0.5747641",
"0.57452065",
"0.57046115",
"0.569603",
"0.5690794... | 0.5917182 | 10 |
Gets the next character entered | def getch
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def next_char\n @current_char_pos += 1\n @current_char = @string[@current_char_pos, 1]\n end",
"def nextchar\n c = self.more?() ? @source[@index,1] : \"\\0\"\n @index += 1\n return(c)\n end",
"def read_character\n unless @input.empty?\n result(@input.at(0), advance(1))\... | [
"0.8003063",
"0.7946098",
"0.77114266",
"0.75831413",
"0.75341547",
"0.7493486",
"0.74354655",
"0.7301414",
"0.7145765",
"0.71374947",
"0.7135557",
"0.7133825",
"0.7102099",
"0.70924413",
"0.7079618",
"0.7075996",
"0.7013627",
"0.69952935",
"0.69742996",
"0.6970851",
"0.69593... | 0.0 | -1 |
do main loop here.... | def main()
while(line = STDIN.gets())
line = line.strip()
arr = line.split(' ')
cmd = arr[0]
args = arr[1..-1]
case cmd
when "EDGEB"; edgeb(args)
when "EDGED"; edged(args)
when "EDGEW"; edgew(args)
when "DUMPTABLE"; dumptable(args)
when "SHUTDOWN"; shutdown(args)
when "STATUS"; status()
when "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def loop; end",
"def loop\n end",
"def loop\n end",
"def loop\n end",
"def run_loop\n end",
"def post_loop; end",
"def loop_forever; end",
"def pre_loop; end",
"def postloop\n end",
"def preloop\n end",
"def parentloop; end",
"def main_loop\n @main_loop ||= lambda do\n # S... | [
"0.8564647",
"0.8516369",
"0.8516369",
"0.84616023",
"0.82521206",
"0.8024656",
"0.7735339",
"0.7631197",
"0.7602355",
"0.7532698",
"0.7404509",
"0.73160857",
"0.7300256",
"0.7291489",
"0.72511065",
"0.72511065",
"0.72511065",
"0.7250268",
"0.7250268",
"0.72476906",
"0.724659... | 0.0 | -1 |
Gets the value of an option with the matching name (can be the long name, short name or arg name). | def get_option_value(name=nil)
if name.class == String && !block_given?
return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getOptionValue, [Java::java.lang.String.java_class]).call(name))
end
raise ArgumentError, "Invalid arguments when calling get_option_value(name)"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getOption(name)\n return @options[name]\n end",
"def _get_option(name)\n\n # Start with nothing\n value = nil\n\n # First, get the default value by cycling through the allowed options\n method = self.class.metadata[:allowed_options].each do |allowed_option|\n value = allowed_option[:... | [
"0.79763955",
"0.78756124",
"0.7705032",
"0.75421363",
"0.74229074",
"0.7418298",
"0.71508515",
"0.709178",
"0.6897899",
"0.6728513",
"0.67163837",
"0.67029536",
"0.6654375",
"0.6625596",
"0.65183914",
"0.6492761",
"0.64776385",
"0.64600056",
"0.64600056",
"0.6451317",
"0.644... | 0.777985 | 2 |
Gets the value of an argument with the given index. | def get_argument_value(param_1=nil)
if param_1.class == String && !block_given?
return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getArgumentValue, [Java::java.lang.String.java_class]).call(param_1))
elsif param_1.class == Fixnum && !block_given?
return ::Vertx::Util::Utils.from_ob... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(index)\n args[index]\n end",
"def [](index); @args[index] end",
"def argument(args)\n args.first\n end",
"def [](key)\n return @args[key]\n end",
"def get_value!(args)\n idx = -1\n args.each_index do |index|\n result = find_me(args[index])\n if result... | [
"0.8657937",
"0.7569761",
"0.7109907",
"0.699885",
"0.68804365",
"0.6837058",
"0.683067",
"0.6699091",
"0.6406993",
"0.64029276",
"0.6322014",
"0.63137376",
"0.62975436",
"0.6277267",
"0.62659496",
"0.6263705",
"0.6225342",
"0.6217121",
"0.6215869",
"0.62033427",
"0.61730206"... | 0.56145054 | 96 |
Gets the value of an option marked as a flag. Calling this method an a nonflag option throws an IllegalStateException. | def flag_enabled?(name=nil)
if name.class == String && !block_given?
return @j_del.java_method(:isFlagEnabled, [Java::java.lang.String.java_class]).call(name)
end
raise ArgumentError, "Invalid arguments when calling flag_enabled?(name)"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch(flag)\n o = option(flag)\n if o.nil?\n cleaned_key = clean_key(flag)\n raise UnknownOption.new(\"option not found: '#{cleaned_key}'\", \"#{cleaned_key}\")\n else\n o.value\n end\n end",
"def get_value(flag)\n\t\tfp = @flag_pairs.get_value(flag)\n\t\tif !@no_v... | [
"0.78720886",
"0.7231016",
"0.7220729",
"0.69875383",
"0.6788867",
"0.66518176",
"0.66164917",
"0.6515345",
"0.6498469",
"0.6415445",
"0.6410464",
"0.6406881",
"0.6400724",
"0.6272586",
"0.6271874",
"0.625832",
"0.6248594",
"0.6244426",
"0.621493",
"0.6193806",
"0.61701167",
... | 0.0 | -1 |
Checks whether or not the given option has been assigned in the command line. | def option_assigned?(option=nil)
if option.class == Hash && !block_given?
return @j_del.java_method(:isOptionAssigned, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option)))
end
raise ArgumentError, "Invalid arguments when... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_option?(arg)\n !!find_option(arg)\n end",
"def is_option option\n Shell::Parser.is_option option, @argv\n end",
"def option_command?\n options || @option_command\n end",
"def option?(param)\n param[0] == \"-\"\n end",
"def has_option(opt)\n\n # Create a simple... | [
"0.81628",
"0.7978089",
"0.758479",
"0.756308",
"0.74008507",
"0.7316058",
"0.72287416",
"0.717223",
"0.7055268",
"0.70252836",
"0.68945444",
"0.6892625",
"0.68670183",
"0.67941386",
"0.6783093",
"0.6685573",
"0.66454595",
"0.66454595",
"0.66371566",
"0.6567513",
"0.6567211",... | 0.75103426 | 4 |
Gets the raw values of the given option. Raw values are simple "String", not converted to the option type. | def get_raw_values(option=nil)
if option.class == Hash && !block_given?
return @j_del.java_method(:getRawValues, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option))).to_a.map { |elt| elt }
end
raise ArgumentError, "Inval... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_raw_values_for_option(option=nil)\n if option.class == Hash && !block_given?\n return @j_del.java_method(:getRawValuesForOption, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option))).to_a.map { |elt| elt }\n end\n ... | [
"0.81779176",
"0.70571077",
"0.6386767",
"0.6346213",
"0.6313381",
"0.62106663",
"0.59538496",
"0.5819787",
"0.57850164",
"0.5754932",
"0.5737564",
"0.56942075",
"0.56849796",
"0.56849796",
"0.565532",
"0.5561936",
"0.55618876",
"0.5542867",
"0.55386645",
"0.55336064",
"0.553... | 0.815863 | 1 |
Gets the raw values of the given option. Raw values are simple "String", not converted to the option type. | def get_raw_values_for_option(option=nil)
if option.class == Hash && !block_given?
return @j_del.java_method(:getRawValuesForOption, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option))).to_a.map { |elt| elt }
end
raise A... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_raw_values(option=nil)\n if option.class == Hash && !block_given?\n return @j_del.java_method(:getRawValues, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option))).to_a.map { |elt| elt }\n end\n raise ArgumentErro... | [
"0.8158353",
"0.7057201",
"0.6387733",
"0.6346559",
"0.6314028",
"0.6210677",
"0.5954113",
"0.5820324",
"0.5785402",
"0.575356",
"0.5739642",
"0.56946045",
"0.5685208",
"0.5685208",
"0.56578267",
"0.5561892",
"0.55618453",
"0.55424845",
"0.5538626",
"0.5533599",
"0.5533075",
... | 0.8177661 | 0 |
Gets the raw values of the given argument. Raw values are simple "String", not converted to the argument type. | def get_raw_values_for_argument(argument=nil)
if argument.class == Hash && !block_given?
return @j_del.java_method(:getRawValuesForArgument, [Java::IoVertxCoreCli::Argument.java_class]).call(Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(argument))).to_a.map { |elt| elt }
end... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def raw\n @args\n end",
"def get_raw_value_for_argument(arg=nil)\n if arg.class == Hash && !block_given?\n return @j_del.java_method(:getRawValueForArgument, [Java::IoVertxCoreCli::Argument.java_class]).call(Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(arg)))\n end\... | [
"0.71455973",
"0.68555504",
"0.6500643",
"0.62882733",
"0.62742805",
"0.61527",
"0.6150011",
"0.61376816",
"0.6126288",
"0.6078526",
"0.60507804",
"0.599962",
"0.59245855",
"0.5851409",
"0.5843323",
"0.58209026",
"0.57952493",
"0.5791099",
"0.57782066",
"0.57758284",
"0.56159... | 0.73798203 | 0 |
Gets the raw value of the given option. Raw values are the values as given in the user command line. | def get_raw_value_for_option(option=nil)
if option.class == Hash && !block_given?
return @j_del.java_method(:getRawValueForOption, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option)))
end
raise ArgumentError, "Invalid ar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_raw_values_for_option(option=nil)\n if option.class == Hash && !block_given?\n return @j_del.java_method(:getRawValuesForOption, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option))).to_a.map { |elt| elt }\n end\n ... | [
"0.7074459",
"0.7036102",
"0.687944",
"0.6619966",
"0.6406483",
"0.6287547",
"0.6264247",
"0.61890095",
"0.6186009",
"0.61728007",
"0.6060771",
"0.5991143",
"0.59643894",
"0.59307337",
"0.5905617",
"0.5889318",
"0.58577144",
"0.5777088",
"0.5772011",
"0.5768482",
"0.57444495"... | 0.79103035 | 0 |
Checks whether or not the given option accept more values. | def accept_more_values?(option=nil)
if option.class == Hash && !block_given?
return @j_del.java_method(:acceptMoreValues, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option)))
end
raise ArgumentError, "Invalid arguments w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_much?(options)\n options.number.to_i > 20\n end",
"def should_be_limited?\n @options[:limit] == true or (@options[:limit].is_a?(Fixnum) and @options[:limit] > 0)\n end",
"def valid_num_values?(num, values)\n num == :many || (num == :one && values.length == 1)\n end",
"def ensure_no... | [
"0.6905162",
"0.66279775",
"0.65969175",
"0.65563226",
"0.6409512",
"0.6360267",
"0.6275569",
"0.62675184",
"0.62353206",
"0.6217352",
"0.6217323",
"0.6216566",
"0.6166548",
"0.6153621",
"0.6153128",
"0.6139829",
"0.60982203",
"0.60578585",
"0.6053232",
"0.6036393",
"0.602956... | 0.7857258 | 0 |
Gets the raw value of the given argument. Raw values are the values as given in the user command line. | def get_raw_value_for_argument(arg=nil)
if arg.class == Hash && !block_given?
return @j_del.java_method(:getRawValueForArgument, [Java::IoVertxCoreCli::Argument.java_class]).call(Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(arg)))
end
raise ArgumentError, "Invalid arg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_raw_values_for_argument(argument=nil)\n if argument.class == Hash && !block_given?\n return @j_del.java_method(:getRawValuesForArgument, [Java::IoVertxCoreCli::Argument.java_class]).call(Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(argument))).to_a.map { |elt| elt }\n ... | [
"0.63454896",
"0.63285506",
"0.62903416",
"0.6031652",
"0.5982848",
"0.5971573",
"0.5956417",
"0.5955385",
"0.58587027",
"0.58494604",
"0.5849353",
"0.5839661",
"0.5830822",
"0.5783868",
"0.57810277",
"0.5773502",
"0.5748328",
"0.57129556",
"0.5673015",
"0.56526357",
"0.56288... | 0.74284124 | 0 |
Checks whether or not the given argument has been assigned in the command line. | def argument_assigned?(arg=nil)
if arg.class == Hash && !block_given?
return @j_del.java_method(:isArgumentAssigned, [Java::IoVertxCoreCli::Argument.java_class]).call(Java::IoVertxCoreCli::Argument.new(::Vertx::Util::Utils.to_json_object(arg)))
end
raise ArgumentError, "Invalid arguments when ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_arg()\n if ARGV.length > 1\n print \"ERROR: Too many command line args.\\n\"\n print \"USAGE: #{$PROGRAM_NAME} [--FixThemAll]\\n\"\n exit ERR_EXIT_ARGS2MANY\n end\n if ARGV.length == 1 && ARGV[0] != '--FixThemAll'\n print \"ERROR: Invalid argument on command line: '#... | [
"0.7621335",
"0.7401696",
"0.71072394",
"0.7098379",
"0.7068102",
"0.7068102",
"0.7055099",
"0.70488864",
"0.70111644",
"0.6979828",
"0.69485015",
"0.6914939",
"0.6879087",
"0.6866674",
"0.68555105",
"0.6850819",
"0.684852",
"0.67584217",
"0.6753663",
"0.6709513",
"0.6705012"... | 0.7270476 | 2 |
Checks whether or not the given option has been seen in the user command line. | def seen_in_command_line?(option=nil)
if option.class == Hash && !block_given?
return @j_del.java_method(:isSeenInCommandLine, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option)))
end
raise ArgumentError, "Invalid argume... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_option?(arg)\n !!find_option(arg)\n end",
"def is_option option\n Shell::Parser.is_option option, @argv\n end",
"def option_command?\n options || @option_command\n end",
"def early_option?(args)\n if @options[:version]\n puts(\"boson #{Boson::VERSION}\")\n ... | [
"0.799002",
"0.7746168",
"0.755401",
"0.7242721",
"0.71040285",
"0.7054908",
"0.6925202",
"0.6829003",
"0.6759423",
"0.6734702",
"0.6702681",
"0.660446",
"0.6596146",
"0.659378",
"0.6587516",
"0.65470374",
"0.65337723",
"0.6495888",
"0.6459542",
"0.64031905",
"0.6399832",
"... | 0.7581421 | 2 |
Checks whether or not the user has passed a "help" option and is asking for help. | def asking_for_help?
if !block_given?
return @j_del.java_method(:isAskingForHelp, []).call()
end
raise ArgumentError, "Invalid arguments when calling asking_for_help?()"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_help?\n help.present?\n end",
"def help?\n return true if @commands[:help]\n false\n end",
"def dump_help_if_requested\n return unless self[:help]\n dump_help\n exit\n end",
"def handle_help\n if (ARGV.length >= 1) && is_help_flag?(ARGV[0])\n ... | [
"0.7980624",
"0.7832456",
"0.7603646",
"0.7533403",
"0.7507193",
"0.7502157",
"0.74983245",
"0.7456786",
"0.7453261",
"0.73566365",
"0.73472494",
"0.73339325",
"0.72753936",
"0.7242528",
"0.71156",
"0.71156",
"0.7065209",
"0.7065209",
"0.7021829",
"0.6984484",
"0.69775075",
... | 0.7865937 | 1 |
before_action :authenticate_with_token!, only: [:update, :destroy] | def index
#render all venue or dancer in venues or dancer controller
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n before_action :authenticate_user\n @user.destroy\n end",
"def after_token_authentication\n end",
"def after_token_authentication\n end",
"def authenticate_with_token!\n render json: { errors: 'Acesso não autorizado!' }, status: 401 unless user_logged_in?\n end",
"def toke... | [
"0.7057584",
"0.6959287",
"0.6959287",
"0.6937014",
"0.6929073",
"0.68506205",
"0.67149603",
"0.66609406",
"0.6641868",
"0.65718377",
"0.6569653",
"0.65575606",
"0.6540558",
"0.6535941",
"0.6512073",
"0.65118253",
"0.65026844",
"0.64970756",
"0.64764464",
"0.6443371",
"0.6438... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_user
#to do
#if cookie authentication_token type facebook
#elsif cookie authentication_token type email
#end
@user = User.find_by(authentication_token: request.headers['Authorization'])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6163754",
"0.6045816",
"0.5944853",
"0.59169096",
"0.58892167",
"0.58342934",
"0.5776148",
"0.57057375",
"0.57057375",
"0.56534296",
"0.56209534",
"0.54244673",
"0.54101455",
"0.54101455",
"0.54101455",
"0.53951085",
"0.5378493",
"0.53563684",
"0.53399915",
"0.5338049",
"0... | 0.0 | -1 |
TerminusBot: An IRC bot to solve all of the problems with IRC bots. | def initialize
raise "ignores script requires the ignores module" unless defined? MODULE_LOADED_IGNORES
register_script "Manipulate the bot's hostmask-based ignore list."
register_command "ignores", :cmd_ignores, 0, 4, nil, "List all active ignores."
register_command "ignore", :cmd_ignore, 1, 4, nil, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main\n @t.each do \n |line|\n info = grab_info(line) # grabs the info from an PRIVMSG\n STDOUT.puts line, \"\\n\" # puts to the console\n ##\n # An IRC client (a bot is a client) must respond to PINGs from the IRC server.\n # If not, the ... | [
"0.6729335",
"0.6103269",
"0.6096396",
"0.5950026",
"0.5930889",
"0.5684095",
"0.56514674",
"0.5632661",
"0.5597831",
"0.5594786",
"0.5576816",
"0.5574863",
"0.5525933",
"0.5485511",
"0.5471762",
"0.54686034",
"0.5436925",
"0.54367673",
"0.5411855",
"0.5407808",
"0.5393353",
... | 0.0 | -1 |
ECS loop last return | def loop_last_return
restore_prefix
removals = @removals
reversed_removals = removals.reverse
current_word = @current_word
reversed_removals.each do |reverse_removal|
next unless suffix_removal?(reverse_removal)
if reverse_removal.removed_part... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def endless_loop?; end",
"def ecs_wait_container_instances\n @ecs_wait_container_instances = true\n end",
"def loop_forever; end",
"def run!()\n\t\t\tif(@options[:elb])\n\t\t\t\tprocess_elbs()\n\t\t\tend\n\t\t\tnext_precience()\n\t\t\tif(@options[:ec2_tags])\n\t\t\t\t@options[:ec2_tags].each do |tag_... | [
"0.5440092",
"0.5347047",
"0.5315105",
"0.53033644",
"0.52862835",
"0.52714235",
"0.5254438",
"0.52436167",
"0.5218244",
"0.5218244",
"0.51698273",
"0.51573485",
"0.5145742",
"0.5139517",
"0.5127384",
"0.5094149",
"0.50931185",
"0.50861716",
"0.50859386",
"0.50738156",
"0.507... | 0.0 | -1 |
Check whether the removed part is a suffix | def suffix_removal?(removal)
removal.affix_type == 'DS' || removal.affix_type == 'PP' || removal.affix_type == 'P'
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def trim_suffix(s, suffix)\n s.end_with? suffix and s[0..-(suffix.length + 1)] or s\n end",
"def suffix?\n @type == SUFFIX\n end",
"def ends_with?(suffix)\r\n suffix = suffix.to_s\r\n self[-suffix.length, suffix.length] == suffix \r\n end",
"def ends_with?(suffix)\n ... | [
"0.7632953",
"0.7514059",
"0.7421617",
"0.73904145",
"0.73151034",
"0.7172178",
"0.7117391",
"0.7117391",
"0.7056916",
"0.6886818",
"0.6720571",
"0.66404456",
"0.66313016",
"0.6544871",
"0.6544871",
"0.6544871",
"0.6544871",
"0.6544871",
"0.6487844",
"0.6445726",
"0.6338687",... | 0.7372903 | 4 |
Restore prefix to proceed with ECS loop last return | def restore_prefix
@removals.each do |removal|
if removal.affix_type == 'DP'
@current_word = removal.subject
break
end
end
@removals.each do |removal|
if removal.affix_type == 'DP'
@removals.delete(removal)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def restart; end",
"def undo_create_namespace(namespace)\n name = namespace['name']\n \"kubectl delete ns #{name} --ignore-not-found=true \"\nend",
"def reset\n @is_echoed_prefix = true;\n @entries = []\n @curr_entry = nil\n @common_prefixes = []\n @common_prefix_entry = nil\n @... | [
"0.56724435",
"0.55563366",
"0.5546948",
"0.55259514",
"0.5521498",
"0.54909444",
"0.546521",
"0.5439104",
"0.5407529",
"0.5400234",
"0.53593546",
"0.5345738",
"0.5340132",
"0.5330088",
"0.5318293",
"0.5294538",
"0.52912563",
"0.52416563",
"0.5195696",
"0.5138132",
"0.5130244... | 0.6077659 | 0 |
class level POST /suggested_prices POST /suggested_prices.xml | def create
@suggested_price = SuggestedPrice.new(params[:suggested_price])
@suggested_price.user_id = current_user.id
respond_to do |format|
if @suggested_price.save
format.html { redirect_to(:controller=>"cafeterias", :action => "show", :id => @suggested_price.cafeteria_id, :notice => 'Thank... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_request\n if @test\n host = 'wwwcie.ups.com'\n else\n host = 'www.ups.com'\n end\n\n path = \"/ups.app/xml/Rate\"\n server = Net::HTTP.new(host, 443)\n data = @xml_pieces.collect{|p| p.to_s}.join(\"\\n\")\n if @debug\n File.open(@debug_request_... | [
"0.6158791",
"0.60636127",
"0.5601966",
"0.55108166",
"0.549086",
"0.54699016",
"0.54578656",
"0.5442632",
"0.5437419",
"0.5366665",
"0.53599185",
"0.53503",
"0.5341965",
"0.5339903",
"0.5327571",
"0.53246856",
"0.53106165",
"0.5291429",
"0.5284841",
"0.5280237",
"0.5278831",... | 0.5305423 | 17 |
AngularJS automatically sends CSRF token as a header called XXSRF this makes sure rails gets it | def verified_request?
!protect_against_forgery? || request.get? ||
form_authenticity_token == params[request_forgery_protection_token] ||
form_authenticity_token == request.headers['X-XSRF-Token']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n end",
"def set_csrf_cookie_for_ng\n cookies['XSRF-TOKEN'] = form_authenticity_t... | [
"0.80538714",
"0.80538714",
"0.80538714",
"0.80538714",
"0.80538714",
"0.80538714",
"0.80538714",
"0.80538714",
"0.7913876",
"0.7597636",
"0.7537447",
"0.7487715",
"0.74608064",
"0.74309903",
"0.71990126",
"0.7186827",
"0.71817094",
"0.71783227",
"0.71777344",
"0.7134331",
"0... | 0.0 | -1 |
attr_accessible :address1, :address2, :city, :state, :zip attr_accessible :lat, :lon attr_accessible :county | def get_zipcode
return zip
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def address_params\n params.permit(:street, :city, :county, :postcode)\n end",
"def address_params\n params.require(:address).permit(:lat, :lng, :formatted_address, :state, :city, :zipcode, :country)\n \n end",
"def address_params\n params.permit(:street, :city, :state, :zip)\n ... | [
"0.7024327",
"0.68612146",
"0.68438965",
"0.6692631",
"0.66361576",
"0.6626097",
"0.66211915",
"0.66006255",
"0.6588898",
"0.65882903",
"0.65683883",
"0.65617096",
"0.6560053",
"0.65532386",
"0.6550993",
"0.65140104",
"0.64930373",
"0.64852023",
"0.6457579",
"0.6435586",
"0.6... | 0.0 | -1 |
Expected output: ['tea', 'water', 'soda water'] Create a method called incl_letter Takes a parameter of an array I will probably need to iterate over the array using a block I will check each value of the array and see if it includes the letter given. If it does it will be pushed to an empty array | def incl_letter(array, letter)
fin_array = []
array.each do |value|
if value.include? (letter)
fin_array.push(value)
end
end
p fin_array
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def newBev (array, letter)\n array.select { |value| value.include?(letter)}\nend",
"def spec_letter(array, char)\n # select through the array\n array.select do |str|\n # using include to find the substrings\n # if str has specific letter\n str.include? char\n end\nend",
"def le... | [
"0.78408784",
"0.7822947",
"0.7716433",
"0.76864326",
"0.755606",
"0.7529852",
"0.75024486",
"0.74484324",
"0.74351424",
"0.74318945",
"0.7319082",
"0.72508836",
"0.72014374",
"0.71922314",
"0.71867555",
"0.717739",
"0.71427816",
"0.710475",
"0.6985284",
"0.6976581",
"0.69313... | 0.8214963 | 0 |
Expected output: 'bby Rd' Create a method called vowel_removed Takes a parameter of a String Iterate over the string using a block Check each value against a list of values and if it is a value then it will be deleted Return string with out vowels | def vowel_removed string
string.delete! "aeiouAEIOU"
p string
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_vowels(strings) # iterate through each vowel, set parameter to string, return string\n strings.map do |string|\n chars = string.split(\"\") # splitting the string into an array\n VOWELS.each { |vowel| chars.delete(vowel) }\n chars.join(\"\")\n end\nend",
"def noVowels string\n # # Create... | [
"0.8014331",
"0.752481",
"0.74854976",
"0.7479667",
"0.7476909",
"0.74492604",
"0.744902",
"0.74338907",
"0.740944",
"0.7399492",
"0.73959017",
"0.73896396",
"0.73896396",
"0.7386638",
"0.7373351",
"0.73658043",
"0.73620224",
"0.73567015",
"0.73498654",
"0.7345011",
"0.733388... | 0.75088376 | 2 |
Use callbacks to share common setup or constraints between actions. Never trust parameters from the scary internet, only allow the white list through. | def comment_params
params.require(:comment).permit(:body)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def action_hook; end",
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def before_action \n end",
"def before_setup; end",
"def my_action_params\n params.require(:my_action).permit(:name, :url, :active, :provider_id)\n end",
"def define_a... | [
"0.6089007",
"0.6079685",
"0.6010002",
"0.5875071",
"0.5798518",
"0.5752089",
"0.5593056",
"0.5514291",
"0.5514291",
"0.5514291",
"0.54074997",
"0.5401344",
"0.53852737",
"0.536707",
"0.53501713",
"0.53480023",
"0.5345948",
"0.53402156",
"0.5335114",
"0.5316476",
"0.53034335"... | 0.0 | -1 |
player_1 and player_2 are Arrays of numberoffingers on each hand. | def initialize(player_1, player_2, turn, parent = nil)
@players = [player_1, player_2]
@turn = turn
@parent = parent
@touch_reachable = @clap_reachable = nil
for player in @players do
State.normalize(player)
end
if end_state?
@best_outcome = (self.winner == Player1 ? Outcome::P... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def look_at_tie(hand1,hand2)\n\t# Empty face_value1 array created for hand1 faces\n\tface_value1 = []\n\t# Empty face_value2 array created for hand2 faces\n\tface_value2 = []\n\n\thand1.each do |card|\n\t\t# Pushing the face of each card into the empty array and grabbing it by the first index. Ex: \"Kd\" => \"K\" ... | [
"0.6507956",
"0.6462001",
"0.62974846",
"0.6239814",
"0.6216378",
"0.6195458",
"0.6191012",
"0.61760026",
"0.61515903",
"0.6101142",
"0.60371846",
"0.5953558",
"0.59177625",
"0.5870968",
"0.58431435",
"0.57966894",
"0.579525",
"0.5768791",
"0.57608014",
"0.5753872",
"0.574056... | 0.0 | -1 |
true if at least one player is dead. | def end_state?
not player_alive?(Player1) or not player_alive?(Player2)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_dead?\n if @actors.size == 0 and not $game_temp.in_battle\n return false \n end\n return existing_members.empty?\n end",
"def game_over?\n alive_players = @players.select {|player| player.alive? == true }\n if alive_players.length > 1\n false\n else\n true\n end\n end... | [
"0.75568134",
"0.7133423",
"0.702219",
"0.7009259",
"0.6954231",
"0.68986005",
"0.6868697",
"0.68394524",
"0.68389535",
"0.6796866",
"0.6794894",
"0.67321205",
"0.6725085",
"0.672214",
"0.6691718",
"0.6691011",
"0.6686998",
"0.66720444",
"0.6651626",
"0.6619519",
"0.6596228",... | 0.6225792 | 51 |
Return the winner. This should only be called on end states (otherwise, it'll always return Player1). | def winner
player_alive?(Player1) ? Player1 : Player2
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def winner\n if check_rows_for_winner || check_columns_for_winner || check_diagonals_for_winner\n return @player\n else\n return nil\n end\n end",
"def winner\n if won?\n puts \"Player #{@winner} has won the game!\"\n return @winner\n else\n puts \"No winner yet... | [
"0.82989293",
"0.82247996",
"0.8152905",
"0.81335694",
"0.8051505",
"0.8015107",
"0.80028313",
"0.7890172",
"0.781644",
"0.78155434",
"0.7770029",
"0.77630967",
"0.7753975",
"0.77532727",
"0.7744293",
"0.77440196",
"0.76652116",
"0.76621985",
"0.7658512",
"0.76388484",
"0.761... | 0.8244298 | 1 |
Return a nice string representation of a player. | def player_string(player_num)
player = @players[player_num]
'-' * (FingersPerHand-player[Left]) +
'|' * player[Left] +
' ' +
'|' * player[Right] +
'-' * (FingersPerHand-player[Right])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_str\n\t\t'Player %d\\n\\nScore: %.2f\\n' % [self.idNum, self.points]\n\tend",
"def to_s\n s = \"1: #{player_string(Player1)}\"\n s << ' *' if @turn == Player1\n s << \"\\n2: #{player_string(Player2)}\"\n s << ' *' if @turn == Player2\n s\n end",
"def show_player(name)\n if player = Pl... | [
"0.7553912",
"0.7078933",
"0.7018823",
"0.6931784",
"0.6895419",
"0.6843644",
"0.6816099",
"0.6813391",
"0.6805166",
"0.6801704",
"0.68008435",
"0.67908615",
"0.6656695",
"0.6642695",
"0.65858966",
"0.657545",
"0.65245116",
"0.64551145",
"0.64242184",
"0.6418761",
"0.6394975"... | 0.72997314 | 1 |
Return a nice string representation of this state (including both player strings). | def to_s
s = "1: #{player_string(Player1)}"
s << ' *' if @turn == Player1
s << "\n2: #{player_string(Player2)}"
s << ' *' if @turn == Player2
s
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def state\n players.map(&:inspect).join(\"\\n\")\n end",
"def to_s\n \"#{name}#{state}\"\n end",
"def to_s\n return \"Turn => #{self.current_turn}, Players => #{@players}, \"\n end",
"def to_game_string\n s = \"#{@state};\"\n s = \"#{s}#{@on_move};\"\n @@PLAYERS.each do |player|\... | [
"0.7649899",
"0.74668825",
"0.7466533",
"0.7384793",
"0.7347668",
"0.72939664",
"0.7002655",
"0.69552743",
"0.69465584",
"0.69384515",
"0.6880764",
"0.68314636",
"0.68071705",
"0.67805696",
"0.6757195",
"0.670792",
"0.6706531",
"0.66481483",
"0.66308206",
"0.6625433",
"0.6615... | 0.7079987 | 6 |
Return a compact string representation. | def to_compact_s
if @turn == Player1
"[#{@players[Player1].join(',')}]* [#{@players[Player2].join(',')}]"
else
"[#{@players[Player1].join(',')}] [#{@players[Player2].join(',')}]*"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_s\n full\n end",
"def stringify\n self.compact.join(' ')\n end",
"def compact_string\n s = [authors.collect{|a| a.compact_string}.join, year, self.title, publication, volume, number, pages, pg_start, pg_end, cited_page].join(\"|\").downcase.gsub(/\\s/, '')\n s\n end",
"d... | [
"0.7386117",
"0.72482145",
"0.70561886",
"0.7054928",
"0.7019387",
"0.69800365",
"0.6894481",
"0.6894481",
"0.6860273",
"0.6858965",
"0.6814828",
"0.6814828",
"0.6814828",
"0.6768253",
"0.67599624",
"0.67387885",
"0.67387885",
"0.67387885",
"0.67387885",
"0.6732192",
"0.67321... | 0.0 | -1 |
Equality only tests the players' hands and the turn. | def ==(other)
@players == other.players and @turn == other.turn
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def player_turns_are_equal?\n player_1['turns'] == player_2['turns']\n end",
"def test_flush_winner_hand_one_wins\n\t\thand1 = [\"3s\", \"5s\", \"4s\", \"2s\",\"7s\"]\n\t\thand2 = [\"2d\", \"4d\", \"3s\", \"6h\",\"5d\"]\n\t\thands = {\"hand1\" => hand1,\"hand2\" => hand2}\n\t\tassert_equal(\"Player One is th... | [
"0.7144671",
"0.6980569",
"0.6785458",
"0.6634601",
"0.6554081",
"0.64998287",
"0.6400166",
"0.62790465",
"0.62756544",
"0.6262615",
"0.6259565",
"0.6254138",
"0.62461734",
"0.6204512",
"0.6161787",
"0.6160903",
"0.61438465",
"0.6140237",
"0.61352736",
"0.61179143",
"0.611675... | 0.7526311 | 0 |
Both eql? and hash are defined so that Sets/Hashes of states will only | def eql?(other); self == other; end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eql?(o)\n o.class == self.class && o.state == state\n end",
"def == other\n self.class == other.class && self.state == other.state\n end",
"def == other\n self.class == other.class && self.state == other.state\n end",
"def == other\n self.class == other.class && self.state == other.sta... | [
"0.70158744",
"0.6937159",
"0.6937159",
"0.6937159",
"0.6925837",
"0.6875718",
"0.6847541",
"0.68400306",
"0.6813649",
"0.67901355",
"0.66724026",
"0.66724026",
"0.65494317",
"0.65393466",
"0.6498112",
"0.64920753",
"0.6441587",
"0.6441543",
"0.6433508",
"0.64241904",
"0.6422... | 0.6364409 | 31 |
Yield once for each ancestor state, starting from the oldest and ending on this state. | def each_ancestor
ancestors = [self]
while not ancestors.last.parent.nil?
ancestors << ancestors.last.parent
end
ancestors.reverse_each { |a| yield a }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_ancestor # :nodoc:\n end",
"def ancestors\n @ancestors ||=\n begin\n x = [ self ]\n if ss = superstate\n x.push(*ss.ancestors)\n end\n NamedArray.new(x.freeze, :state)\n end\n end",
"def each_ancestor # :nodoc:\n yield(self)\n ... | [
"0.65470016",
"0.6280378",
"0.603541",
"0.5974887",
"0.5801537",
"0.5801537",
"0.5801537",
"0.5801537",
"0.57716453",
"0.571968",
"0.57192874",
"0.5631181",
"0.56013185",
"0.56013185",
"0.5598697",
"0.5589204",
"0.55735326",
"0.55713737",
"0.5553034",
"0.55363196",
"0.5530768... | 0.68240875 | 0 |
Yield each state reachable from this state by a touch move. | def each_touch_reachable_state
if @touch_reachable.nil?
# Set to avoid duplicates.
@touch_reachable = Set[]
player = @players[@turn]
opponent_num = (@turn + 1) % 2
opponent = @players[opponent_num]
for player_hand in [Left, Right] do
for opponent_hand in [Left, Right] d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_reachable_state\n each_touch_reachable_state { |r| yield r }\n each_clap_reachable_state { |r| yield r }\n end",
"def each\r\n @state.each {|s| yield s}\r\n nil # return nil to avoid exposing a ref to @state\r\n end",
"def touch(&blk)\n Enumerator.new do |out|\n self.each do |x... | [
"0.65817004",
"0.5687644",
"0.5637335",
"0.5604532",
"0.559681",
"0.5464059",
"0.5403403",
"0.5394592",
"0.52857137",
"0.5282258",
"0.52785057",
"0.51286685",
"0.5075891",
"0.50685745",
"0.50278443",
"0.49959123",
"0.4992407",
"0.49907103",
"0.49808547",
"0.49787262",
"0.4974... | 0.70247704 | 0 |
Yield each state reachable from this state by a clap move. | def each_clap_reachable_state
if @clap_reachable.nil?
# Set to avoid duplicates.
@clap_reachable = Set[]
player = @players[@turn]
opponent_num = (@turn + 1) % 2
opponent = @players[opponent_num]
# Clap rules.
for source_hand in [Left, Right] do
target_hand = (source_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each_reachable_state\n each_touch_reachable_state { |r| yield r }\n each_clap_reachable_state { |r| yield r }\n end",
"def generate_possible_moves(state)\n end",
"def each\r\n @state.each {|s| yield s}\r\n nil # return nil to avoid exposing a ref to @state\r\n end",
"def each_move\n ... | [
"0.6825294",
"0.596363",
"0.59217346",
"0.5811578",
"0.5797751",
"0.56769705",
"0.5623848",
"0.5618339",
"0.5611428",
"0.5516661",
"0.55033123",
"0.5491598",
"0.54663956",
"0.54641986",
"0.5455502",
"0.545362",
"0.5442761",
"0.5433816",
"0.54299814",
"0.5426638",
"0.54098237"... | 0.61706436 | 1 |
Yield once for each state reachable from this one. | def each_reachable_state
each_touch_reachable_state { |r| yield r }
each_clap_reachable_state { |r| yield r }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def each\r\n @state.each {|s| yield s}\r\n nil # return nil to avoid exposing a ref to @state\r\n end",
"def each( &block )\n @states.each( &block )\n end",
"def state_each(&block)\r\n self.each(&block) \r\n end",
"def infinite_loops\n reachable_sets = @nodes.group_by(&:forward)\n... | [
"0.7286501",
"0.7039039",
"0.6736804",
"0.63980395",
"0.632675",
"0.62661386",
"0.6250795",
"0.62059027",
"0.60710436",
"0.6006144",
"0.5921162",
"0.58922225",
"0.5877096",
"0.5797242",
"0.5796502",
"0.5791572",
"0.57806075",
"0.57651633",
"0.57633764",
"0.56851816",
"0.56651... | 0.76528513 | 0 |
++ Confirms another user as being associated to its current swimmer. 'Another user' must be already selfassociated with a swimmer. This operation simply adds a confirmator to the selfassesment. If the operation succeeds, the method returns true; false otherwise. Works similarly to UserSwimmerConfirmatorconfirm_for() bu... | def confirm_with_notify(another_user)
return nil unless another_user.instance_of?(User) && @user.has_associated_swimmer? && another_user.has_associated_swimmer?
result = UserSwimmerConfirmation.confirm_for(another_user, another_user.swimmer, @user)
if result
NewsFeed.create_social_feed(
anoth... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unconfirm_with_notify(another_user)\n return nil unless another_user.instance_of?(User) && @user.has_associated_swimmer? && another_user.has_associated_swimmer?\n\n result = UserSwimmerConfirmation.unconfirm_for(another_user, another_user.swimmer, @user)\n if result\n NewsFeed.create_social_feed(... | [
"0.73411703",
"0.6434467",
"0.6328558",
"0.63263893",
"0.6260223",
"0.62275124",
"0.6172802",
"0.6147705",
"0.61293536",
"0.6044755",
"0.6002851",
"0.5986999",
"0.59774363",
"0.59430385",
"0.59037507",
"0.588308",
"0.58636886",
"0.58418137",
"0.5819475",
"0.58127165",
"0.5795... | 0.8072087 | 0 |
DeConfirms (or unconfirms) another user as being associated to its current swimmer. 'Another user' must be already selfassociated with a swimmer. This operation simply adds a confirmator to the selfassesment. If the operation succeeds, the method returns true; false otherwise. Works similarly to UserSwimmerConfirmatoru... | def unconfirm_with_notify(another_user)
return nil unless another_user.instance_of?(User) && @user.has_associated_swimmer? && another_user.has_associated_swimmer?
result = UserSwimmerConfirmation.unconfirm_for(another_user, another_user.swimmer, @user)
if result
NewsFeed.create_social_feed(
a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def confirm_with_notify(another_user)\n return nil unless another_user.instance_of?(User) && @user.has_associated_swimmer? && another_user.has_associated_swimmer?\n\n result = UserSwimmerConfirmation.confirm_for(another_user, another_user.swimmer, @user)\n if result\n NewsFeed.create_social_feed(\n ... | [
"0.6992436",
"0.6036105",
"0.57425636",
"0.57059485",
"0.5615175",
"0.55409217",
"0.5508851",
"0.54490745",
"0.5430437",
"0.5293319",
"0.529255",
"0.5281259",
"0.5280723",
"0.52770686",
"0.5243415",
"0.52337784",
"0.5218395",
"0.52088046",
"0.5194741",
"0.51802444",
"0.515818... | 0.7582164 | 0 |
++ Suggest a user to become a friend. If the operation succeeds, the method returns true, else false. Same as Userinvite() but updates also the news feed for the recipient (the invited friend) and sends him/her a notification email. The "requestee" friendable can also set the requested sharing attributes which will the... | def invite_with_notify(swimming_buddy, shares_passages = false, shares_trainings = false, shares_calendars = false)
if @user.invite(swimming_buddy, shares_passages, shares_trainings, shares_calendars)
news_feed = NewsFeed.create_social_feed(
swimming_buddy.id,
@user.id,
I18n.t('newsfee... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_friend_request(user_id)\n friend_suggestions.where(user_id: user_id).delete_all\n req = pending_friends.where(id: user_id).first\n if req.present?\n req.accept!\n else\n req = UserFriendRelationship.between(user_id, id).first || user_friend_relationships.create(user_to_id: user_id)\n ... | [
"0.7065843",
"0.6984608",
"0.69683087",
"0.68950856",
"0.6795577",
"0.67746174",
"0.6727944",
"0.6670259",
"0.66669655",
"0.6618263",
"0.66166097",
"0.6615684",
"0.6582357",
"0.6577639",
"0.65754914",
"0.6561805",
"0.6559791",
"0.655854",
"0.6552989",
"0.652507",
"0.65234673"... | 0.60444385 | 72 |
Approves a friendship invitation. If the operation succeeds, the method returns true, else false. Same as Userapprove() but updates also the news feed for both the recipient (the approved friend) and the sender (the user accepting the request). The friend approving a friendship request can only set sharing attributes t... | def approve_with_notify(swimming_buddy, shares_passages = false, shares_trainings = false, shares_calendars = false)
if @user.approve(swimming_buddy, shares_passages, shares_trainings, shares_calendars)
NewsFeed.create_social_approve_feed(@user, swimming_buddy)
# TODO: Create also achievement row accord... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def approve(user)\n friendship = find_any_friendship_with(user)\n return false if friendship.nil? || invited?(user)\n friendship.update_attribute(:pending, false)\n end",
"def approve_friend_request user_id\n response = post(\"/users/#{user_id}/approve\")[\"response\"]\n @user = Fours... | [
"0.7375792",
"0.6856941",
"0.6815624",
"0.671054",
"0.6572729",
"0.6532505",
"0.65211284",
"0.6486418",
"0.647102",
"0.63951033",
"0.6332174",
"0.63191605",
"0.62993956",
"0.62841135",
"0.6190364",
"0.61883235",
"0.61879027",
"0.6172886",
"0.61274856",
"0.61208165",
"0.610079... | 0.6735619 | 3 |
Same as Userremove_friendship() but updates also the news feed for the sender (the user casting the deletion on the friendship, to get something like "you are no longer a swimming buddy of ..."). | def remove_with_notify(swimming_buddy)
if @user.remove_friendship(swimming_buddy)
NewsFeed.create_social_feed(
@user.id,
swimming_buddy.id,
I18n.t('newsfeed.remove_title'),
I18n.t('newsfeed.remove_body').gsub('{SWIMMER_NAME}', swimming_buddy.get_full_name)
)
# TODO:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_friend\n end",
"def destroy\n friend_id = current_user.id # as it's the current user who's deleting the friendship\n friend = User.find(friend_id)\n \n # a notification message will be delivered to the the requestor anyway;\n # it may contain a personal note, if any was supplied\n ... | [
"0.67561036",
"0.67402124",
"0.6594456",
"0.6523468",
"0.65132886",
"0.65106803",
"0.645838",
"0.6439589",
"0.64215666",
"0.638448",
"0.6336583",
"0.6335638",
"0.6326274",
"0.6261245",
"0.6253142",
"0.6228339",
"0.62133586",
"0.6210465",
"0.62012476",
"0.619314",
"0.61701816"... | 0.76873934 | 0 |
checks if is deleted references of membership | def test_set3_04b_delete_group()
group = "test_group"
user = "test_user"
@test_acl.create_principal(user)
@test_acl.create_group(group, ["ALL"], [user])
query = "doc(\"#{@col_path}Principals.xml\")//node()[@id=\"#{user}\"]/membership/mgroup[@idref=\"#{group}\"]"
#puts query
handle ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_and_clean_deleted_membership\n deleted_membership = group.memberships.only_deleted.find_by(primary_email: primary_email)\n if deleted_membership && deleted_membership.destroy\n deleted_membership.really_destroy!\n end\n end",
"def deleted?\n !(%w(deleted removed) & flags).empty?\n en... | [
"0.6888818",
"0.66414624",
"0.66194075",
"0.6344119",
"0.63385063",
"0.63385063",
"0.63236064",
"0.63101137",
"0.63089323",
"0.6301153",
"0.6287204",
"0.62846017",
"0.6279138",
"0.6269198",
"0.62411076",
"0.62373483",
"0.6222551",
"0.6222323",
"0.62050885",
"0.6181766",
"0.61... | 0.0 | -1 |
checks if ACE is deleted | def test_set3_04c_delete_principal()
user = "test_user"
@test_acl.create_principal(user)
id = @test_acl.create_ace(user, "allow", "SELECT", "test", "/db/temporary/testsource")
@test_acl.delete_principal(user)
query = "doc(\"#{@col_path}acl.xml\")//node()[@id=\"#{id}\"]"
handle = @db.execute... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deleted?\n @deleted == true\n end",
"def deleted?\n false\n end",
"def deletable?\n parent.access?(:delete)\n end",
"def deleted?\n !(%w(deleted removed) & flags).empty?\n end",
"def deleted?\n end",
"def deleted?\n end",
"def _delete\n marked_for_destruct... | [
"0.6686168",
"0.6656048",
"0.66433394",
"0.66319543",
"0.66243273",
"0.66243273",
"0.6622759",
"0.65813905",
"0.6512057",
"0.6512057",
"0.6506479",
"0.64950216",
"0.6482427",
"0.6450601",
"0.64504945",
"0.64504945",
"0.64504945",
"0.6446781",
"0.6446781",
"0.64451545",
"0.644... | 0.0 | -1 |
Checks if ACE mentioning resOb is deleted too | def test_set3_06b_delete_res_object()
user = "test_user"
priv = "test_privilege"
res_ob_type = "test"
res_ob_adr = "/db/temporary/testsource"
@test_acl.create_principal(user)
@test_acl.create_resource_object(res_ob_type, res_ob_adr, user)
id = @test_acl.create_ace(user, "allow", priv, r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def del?(con)\n con.del(unique_check_key) == 1\n end",
"def deleted?\n author == '[deleted]' and body == '[deleted]'\n end",
"def deleted?\n author == '[deleted]' and body == '[deleted]'\n end",
"def deleteable?\n if smo_code == 'SPECIAL'\n # Can't delete the special code\... | [
"0.6029321",
"0.60207206",
"0.60207206",
"0.59051645",
"0.59012514",
"0.581887",
"0.5783131",
"0.5758368",
"0.5736768",
"0.5719958",
"0.5716478",
"0.56985927",
"0.5684131",
"0.5684131",
"0.5684131",
"0.5683817",
"0.5683817",
"0.5683817",
"0.5683817",
"0.5683817",
"0.5671021",... | 0.63190526 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_fibonacci
@fibonacci = Fibonacci.find(params[:id])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_... | [
"0.6165094",
"0.60450804",
"0.5944413",
"0.5915806",
"0.58885634",
"0.5835225",
"0.5775847",
"0.5700531",
"0.5700531",
"0.56543404",
"0.56209993",
"0.54238355",
"0.5410386",
"0.5410386",
"0.5410386",
"0.5394892",
"0.5377769",
"0.53559244",
"0.5339896",
"0.53388095",
"0.533008... | 0.0 | -1 |
Only allow a trusted parameter "white list" through. | def fibonacci_params
params.require(:fibonacci).permit(:input, :list => [])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
... | [
"0.71207976",
"0.705222",
"0.69488335",
"0.69021654",
"0.67362636",
"0.6717561",
"0.6689192",
"0.6678948",
"0.66622657",
"0.6555007",
"0.6527569",
"0.64588845",
"0.64522904",
"0.6450812",
"0.6448551",
"0.6434285",
"0.6412147",
"0.6412147",
"0.6393719",
"0.6381976",
"0.6381976... | 0.0 | -1 |
this is a huge bottleneck | def update_statuses(people)
queryTime = 0
updateTime = 0
personcount = 0
# first we need to update the ordinance statuses
#people = current_user.assignments.incomplete.joins(:person).pluck(:fs_pid).uniq
people.each do |person_id|
personcount += 1
start = Time.now
response = cu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def memos; end",
"def memos; end",
"def probers; end",
"def stderrs; end",
"def offences_by; end",
"def generate_kpi_from_key_counter(all_fomula,s1_ip,time_counter_hash,source_file,logger)\n\ncell_size=3\n\ntime_counter_hash.each do |start_time,one_time_counter|\n\n counter_hash=one... | [
"0.60214746",
"0.5666679",
"0.5666679",
"0.5617454",
"0.5593135",
"0.5543216",
"0.55036426",
"0.54526633",
"0.54030013",
"0.53855133",
"0.5306445",
"0.53055555",
"0.5292137",
"0.52601284",
"0.52058357",
"0.5205516",
"0.5204051",
"0.51587987",
"0.51587987",
"0.51587987",
"0.51... | 0.0 | -1 |
This method is provided so that the test code can use its own syslog | def run_with_syslog(zonelist_file, kasp_file, syslog,
working, signer_working_folder, enforcer_interval, conf_file) # :nodoc: all
syslog.log(LOG_INFO, "Auditor started")
print("Auditor started\n")
if (@enable_timeshift)
configure_timeshift(syslog)
end
zones = nil
beg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log(msg)\n\t\tSyslog.info(msg) if @verbose\n\tend",
"def log(message)\n puts message\n Syslog.open('volume_testing', Syslog::LOG_PID | Syslog::LOG_CONS) { |s| s.warning message }\nend",
"def inspect\n ::Syslog.inspect\n end",
"def test_logging\n\t$MEMORY_LOG.debug \"Test Memory Log : DE... | [
"0.6588477",
"0.65287596",
"0.64887905",
"0.6481108",
"0.61393553",
"0.61376244",
"0.61376244",
"0.61376244",
"0.61376244",
"0.61376244",
"0.61376244",
"0.61376244",
"0.61376244",
"0.61332566",
"0.613221",
"0.6109984",
"0.6106326",
"0.60923874",
"0.6050131",
"0.6049348",
"0.6... | 0.0 | -1 |
Invoke the partial auditor | def partial_audit(ret, input_file, output_file, working, config, syslog, enforcer_interval)
auditor = PartialAuditor.new(syslog, working)
ret_val = auditor.check_zone(config, input_file, output_file, enforcer_interval)
ret = ret_val if (ret_val < ret)
if ((config.err > 0) && (config.err < ret))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_auditioner\n\tend",
"def update_auditioner\n\tend",
"def run\n print_debug 'In #run'\n audit self.class.payloads, self.class.options\n end",
"def action_run\n end",
"def run_actions; end",
"def act\n end",
"def audit\n\t\t\treturn if completed?\n\t\t\trefresh... | [
"0.59902835",
"0.59902835",
"0.5871492",
"0.5860959",
"0.5764444",
"0.5700839",
"0.56270885",
"0.54883116",
"0.5486731",
"0.5457421",
"0.5418322",
"0.5405294",
"0.5405294",
"0.5405294",
"0.5405294",
"0.5390291",
"0.5386033",
"0.5367151",
"0.5354007",
"0.5344851",
"0.5339758",... | 0.0 | -1 |
Invoked the full auditor | def full_audit(ret, input_file, output_file, pid, working, config, syslog, enforcer_interval)
# Perform a full audit of every record. This requires sorting the zones canonically.
# Preparse the input and output files
do_audit = true
pids=[]
new_pid = normalise_and_sort(input_file, "in", pi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_auditioner\n\tend",
"def update_auditioner\n\tend",
"def run\n print_debug 'In #run'\n audit self.class.payloads, self.class.options\n end",
"def run_actions; end",
"def action_run\n end",
"def audit\n count_words unless audited?\n @audited = true\n end",
"... | [
"0.6748181",
"0.6748181",
"0.6282322",
"0.6024308",
"0.59418386",
"0.5909972",
"0.5896261",
"0.58305734",
"0.58139044",
"0.5774734",
"0.5774734",
"0.5774734",
"0.5774734",
"0.5774734",
"0.5774734",
"0.5774734",
"0.5774734",
"0.5761711",
"0.57615286",
"0.5738337",
"0.57357675"... | 0.0 | -1 |
Prepare the input unsigned and signed files for auditing | def normalise_and_sort(f, prefix, pid, working, config)
pp = Preparser.new(config)
parsed_file = working+get_name(f)+".#{prefix}.parsed.#{pid}"
sorted_file = working+get_name(f)+".#{prefix}.sorted.#{pid}"
delete_file(parsed_file)
delete_file(sorted_file)
new_pid = (fork {
p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prepare\r\n # if output_dir is not specified, output in the same directory\r\n # as the imput file\r\n @output_dir = File.dirname(@input_file) if !@output_dir && @input_file\r\n\r\n if /.bz2$/ =~ @input_file\r\n if @bz2_gem\r\n file = Bzip2::Reader.new File.open(@input_file,... | [
"0.5996157",
"0.58785707",
"0.5807197",
"0.57682645",
"0.55965304",
"0.55617994",
"0.5549123",
"0.5498344",
"0.54857713",
"0.5379443",
"0.5378458",
"0.53781134",
"0.53744155",
"0.53534484",
"0.53467405",
"0.5344677",
"0.53155327",
"0.5251616",
"0.52508944",
"0.52285963",
"0.5... | 0.0 | -1 |
Given a list of configured zones, and a list of zones_to_audit, return only those configured zones which are in the list of zones_to_audit. Ignore a trailing dot. | def check_zones_to_audit(zones, syslog) # :nodoc: all
# If @zone_name is present, then only check that zone
if @zone_name
to_keep = nil
zones.each {|z|
if (z[0].name.downcase == @zone_name.to_s.downcase)
to_keep = z
end
}
if (!to_keep)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def zone_check(*zones)\n send_req({a: :zone_check, zones: zones.kind_of?(Array) ? zones.join(',') : zones})\n end",
"def stripExcludes(servers, excludefile)\n excludes = readExcludes(excludefile)\n servers = servers.find_all{|server|\n !excludes.contains(getHostPortFromServerName(server).join(\":... | [
"0.569983",
"0.51822054",
"0.5141835",
"0.50857925",
"0.5014203",
"0.4867827",
"0.48058483",
"0.47589803",
"0.4744978",
"0.47413883",
"0.47191167",
"0.46969512",
"0.46743017",
"0.4618743",
"0.46010008",
"0.45887128",
"0.4586897",
"0.45855135",
"0.45855135",
"0.4568668",
"0.45... | 0.6816655 | 0 |
Try to load the info from the conf.xml file. Loads syslog facility, working folder and the zonelist file If Privileges items are specified, then user, groups and chroot are adjusted accordingly. Returns a Syslog::Constants value Returns Syslog::LOG_DAEMON on any error | def load_config_xml(conf_file) # :nodoc: all
working = ""
signer_working = ""
zonelist = ""
kasp = ""
begin
File.open((conf_file + "").untaint , 'r') {|file|
doc = REXML::Document.new(file)
enforcer_interval = nil
begin
e_i_text = doc.eleme... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_log_info_from_file(fname)\r\n base_dir_log = File.join(ResourceInfo.get_dir_appdata(), \"clientlogs\")\r\n info_hash = {:is_set_by_user => false, \r\n :stdout => false, :logfile => false,\r\n :base_dir_log => base_dir_log, \r\n :version => LOGGER_MODE_FILE_VERSION ,\r\n ... | [
"0.60464615",
"0.56669974",
"0.5156113",
"0.51022",
"0.5035213",
"0.49951878",
"0.497285",
"0.49563506",
"0.49332505",
"0.49091893",
"0.48490375",
"0.48451304",
"0.48251453",
"0.4810268",
"0.47978002",
"0.47247136",
"0.4710685",
"0.46811",
"0.46756676",
"0.46661466",
"0.46656... | 0.72281307 | 0 |
def change_chroot(dir) Dir.chroot((dir+"").untaint) end | def change_group(gid_text)
gid = Etc.getgrnam((gid_text+"").untaint).gid
Process::Sys.setgid(gid)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def chroot\n warn \"Path::Name#chroot is obsoleted. Use Dir.chroot.\"\n Dir.chroot(path)\n end",
"def chroot\n Dir.chdir '/'\n File.umask 0000\n end",
"def chroot(&block)\n ::Dir.chroot(path, &block)\n end",
"def chroot(new_root_dir)\n @commands_and_opts.push \"#{OPTIO... | [
"0.84516555",
"0.7921827",
"0.7678281",
"0.7466517",
"0.71001416",
"0.69284606",
"0.6662719",
"0.6578173",
"0.63400793",
"0.6092819",
"0.6092819",
"0.6092819",
"0.60633415",
"0.603456",
"0.59694415",
"0.5964369",
"0.5943086",
"0.5886702",
"0.58424234",
"0.5826308",
"0.5752355... | 0.0 | -1 |
:type key: Integer :rtype: Integer | def get(key)
return -1 unless @cache.key?(key)
val = @cache[key]
@cache.delete(key)
@cache[key] = val
val
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count(key)\n @counter[key]\n end",
"def get(key)\n bucket = @map[key.hash % @size]\n pair = bucket.find {|k, v| k == key}\n if pair \n pair[1]\n else\n -1\n end\n end",
"def findKey( node, key)\n index = 0\n while (index... | [
"0.71030253",
"0.708403",
"0.7013605",
"0.7008805",
"0.70020366",
"0.69897914",
"0.69840544",
"0.6965651",
"0.69207627",
"0.6900909",
"0.68132573",
"0.68132573",
"0.6763186",
"0.67449856",
"0.67326957",
"0.67326957",
"0.67215073",
"0.67203826",
"0.67144513",
"0.670168",
"0.67... | 0.0 | -1 |
:type key: Integer :type value: Integer :rtype: Void | def put(key, value)
return if @capacity.zero?
@cache.delete(key)
@cache.shift while @cache.size >= @capacity
@cache[key] = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def key=(value); end",
"def put(key, value)\n \n end",
"def put(key, value)\n return if @cap <= 0\n fav = @c[key]\n if fav\n return\n end\n \n end",
"def key=(key); end",
"def set(key, value)\n end",
"def setnx(key, value); end",
"def setnx(key, value);... | [
"0.74168605",
"0.69976693",
"0.68453825",
"0.67373747",
"0.67286235",
"0.67283523",
"0.67283523",
"0.66916203",
"0.66916203",
"0.66551894",
"0.65554124",
"0.65241337",
"0.65241337",
"0.65241337",
"0.65241337",
"0.6519254",
"0.6481898",
"0.6454785",
"0.64483076",
"0.64271593",
... | 0.0 | -1 |
return array of available commands and descriptions | def help
[['backlog', 'display (as a paste) a summary of all activity since you last logged out']]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commands\n help_list = {}\n @commands.map do |cmd|\n info = Commands.const_get(\"#{cmd}\".capitalize!).info #=> {cmd => \"Description\"}\n help_list[info.keys.first] = info.values.first\n end\n\n return help_list\n end",
"def commands\r\n @help_commands\r\n ... | [
"0.77622986",
"0.7728831",
"0.77115387",
"0.74761343",
"0.7391433",
"0.72897416",
"0.725781",
"0.72396576",
"0.72009283",
"0.7191642",
"0.717309",
"0.71242523",
"0.7112667",
"0.7092282",
"0.7058697",
"0.70278156",
"0.7008651",
"0.6989573",
"0.69214636",
"0.6908066",
"0.686347... | 0.0 | -1 |
get the backlog since the user last left the room. Filter out all the FB, Subversion, and Zod crap | def get_backlog(person_full_name, requester)
last_left = Message.first(
:conditions => {:person => person_full_name, :message_type => ['Leave','Kick']},
:order => [:timestamp.desc])
if last_left
# if person timed out, look for their last entry before the timeout
if last_left.messa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def backlog\n get_stories_by_iteration(\"backlog\")\n end",
"def backlog; end",
"def backlog; end",
"def backlog\n Endpoints::Backlog.new(client).get(id)\n end",
"def slackerboard()\n offset = self.timezone_offset()\n users_who_uploaded_yesterday = User.joins(:data_points).select(... | [
"0.6628455",
"0.6316269",
"0.6316269",
"0.6082014",
"0.58783835",
"0.5557275",
"0.5549081",
"0.5476276",
"0.54143584",
"0.5401387",
"0.53927183",
"0.53744113",
"0.53536105",
"0.53389895",
"0.5332126",
"0.5288778",
"0.5260508",
"0.5257799",
"0.5254576",
"0.5253652",
"0.5246474... | 0.68891895 | 0 |
allows a user to list songs | def songs
MusicImporter.new(path).print_songs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list\n for song in self.songs\n puts song.name\n end\n end",
"def songs\n\t\t@musician = User.find_by_id(current_user.id)\n\tend",
"def list_songs\n puts \"Here are the songs in your music library:\"\n Song.all.each.with_index(1){|song, index|\n puts \"#{index}. #{song.artist.name} -... | [
"0.7587497",
"0.7573673",
"0.75158596",
"0.7419962",
"0.73639625",
"0.7298581",
"0.72598183",
"0.7232895",
"0.72243696",
"0.72186357",
"0.7213874",
"0.71949536",
"0.7151026",
"0.7145996",
"0.7099311",
"0.7084963",
"0.7083502",
"0.6977542",
"0.6970498",
"0.6967163",
"0.6966103... | 0.7017473 | 17 |
allows a user to list artists | def artists
MusicImporter.new(path).print_artists
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def artists\n link :top_artists, :Artist, name\n end",
"def artists(options={})\n call_pageable('library.getartists', :artists, Artist, {:user => @user.name}.merge(options))\n end",
"def index\n @artists = current_user.artists.all\n end",
"def artists(user, options={})\n get(:s... | [
"0.78334326",
"0.78154004",
"0.7618334",
"0.75846094",
"0.7480265",
"0.74519145",
"0.72389406",
"0.72279423",
"0.72168034",
"0.72168034",
"0.72168034",
"0.72168034",
"0.72168034",
"0.72168034",
"0.7138246",
"0.70458925",
"0.7023335",
"0.70171666",
"0.70015436",
"0.6994657",
"... | 0.7377388 | 6 |
allows a user to list genres | def genres
MusicImporter.new(path).print_genres
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_genres\n\n puts \"1. Action\"\n puts \"2. Adventure\"\n puts \"3. Fighting Games\"\n puts \"4. First-Person Shooters\"\n puts \"5. Flight/Flying\"\n puts \"6. Party\"\n puts \"7. Platformer\"\n puts \"8. Puzzle\"\n puts \"9. Racing\"\n puts \"10. Real-Time Strategy (RTS)\"\n ... | [
"0.75434303",
"0.75355625",
"0.74441814",
"0.73763037",
"0.71717966",
"0.716493",
"0.7122719",
"0.708651",
"0.70858353",
"0.70858353",
"0.7046438",
"0.7046438",
"0.7016401",
"0.7004699",
"0.6999139",
"0.6995361",
"0.69243145",
"0.6913475",
"0.6903038",
"0.6896159",
"0.6885282... | 0.72257894 | 4 |
allows a user to play songs | def play_songs
MusicImporter.new(path).play_song
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def play(song)\n # artist = Artist.find_by(id: song.artist_id)\n puts \"Playing #{song}\"\n end",
"def play_song(sender)\n clicked_pos = self.songs_view.clickedRow\n if clicked_pos == -1 # first song or same song\n if @current_song.try(:song).try(:playing?) # same song\n ... | [
"0.75328535",
"0.71164256",
"0.7071253",
"0.69311184",
"0.6899454",
"0.6870545",
"0.68685144",
"0.68685144",
"0.68685144",
"0.68685144",
"0.68685144",
"0.68685144",
"0.68685144",
"0.68685144",
"0.6747084",
"0.67252046",
"0.6712222",
"0.6704936",
"0.66660863",
"0.6608008",
"0.... | 0.7739274 | 0 |
cannot be changed once assigned in initialize | def initialize(token)
@token = token
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def init; end",
"def init; end",
"def init; end",
"def init; end",
"def initialize() end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initialize; end",
"def initializ... | [
"0.7558713",
"0.7558713",
"0.7558713",
"0.7558713",
"0.75522137",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7342736",
"0.7232831",
"0.72118205",
"0.7168382",
"0.7168382",
"0.7168382",
... | 0.0 | -1 |
The output directory where files will be written. | def source_suffix
options[:source_suffix]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def output_dir\n @output_dir\n end",
"def output_dir\n output_dir = @output_dir.nil? ? Dir.getwd : @output_dir\n FileUtils.mkdir_p(output_dir) unless ::File.directory?(output_dir)\n output_dir\n end",
"def output_directory\n @output_directory ||= set_output_directory\n end",
... | [
"0.8693491",
"0.85165465",
"0.836071",
"0.79425",
"0.79425",
"0.79373604",
"0.79373604",
"0.77383745",
"0.7686236",
"0.7657276",
"0.754974",
"0.75046384",
"0.7491604",
"0.74642235",
"0.74360317",
"0.7379354",
"0.73335534",
"0.7325412",
"0.7324303",
"0.7308421",
"0.7298093",
... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.