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 |
|---|---|---|---|---|---|---|
fiber this method first reads the input file and downcase sorts it, | def doing_raw_file_to_verified_unique_researches # adjustable line length filter
consumer = Fiber.new do |producer, queue|
a = File.read("../../Documents/20111224-research.txt")
new = a.to_textual
#TODO finishe
@megadata = a.sort do |x,y|
x.downcase <=> y.downcase
end
@megadata_unique = @megadata.uniq
f = open("./tmp/database_doings/doing_uniques/uniques_done.txt", "a") do |f|
loop do
queue = producer.transfer(consumer, queue)
puts f << queue
queue.clear
end
raise StopIteration
end
end
producer = Fiber.new do |consumer, queue|
#IO.foreach("./tmp/database_doings/doing_uniques/uniques_todo.txt") do |line|
queue = ""
puts queue
@megadata_unique.each do |line|
sequence_text = line.to_textual.de_comma
if sequence_text.length < 50 # adjustable
puts "line ignored due to length"
elsif Sequence.find_by_sequence_text(sequence_text)
puts "line ignored as it is already in database : " + "#{sequence_text}"
else
sequence_creation = sequence_text.de_space unless nil
sequence_complete = sequence_text.split(//).sort.join('').strip unless nil
sequence_lexigram = lexigram_sequencer(sequence_text) unless nil
sequence_singular = sequence_complete.squeeze unless nil
description = "research"
reference = "literoti"
anagram = 0
name = 0
phrase = 0
research = 1
external = 0
internal = 0
created_at = "2011-12-21 12:12:00"
#line = "#{sequence_text}\n"
line = "#{sequence_text}\t#{sequence_creation}\t#{sequence_complete}\t#{sequence_lexigram}\t#{sequence_singular}\t#{description}\t#{reference}\t#{anagram}\t#{name}\t#{phrase}\t#{research}\t#{external}\t#{internal}\t#{created_at}\n"
queue << line
break unless line
consumer.transfer queue
queue.clear
end
end
end
raise StopIteration
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def humongous_sort\n list = File.readlines(file_name)\n full_list = list.sort_by { |x| x.downcase }\n end",
"def sorting_file\n a = File.readlines(file_name)\n a.sort do |x,y|\n x.downcase <=> y.downcase\n end\n end",
"def textualed\n list = File.readlines(file_name)\n full_list = l... | [
"0.76304334",
"0.755775",
"0.68935245",
"0.63521373",
"0.6057862",
"0.59918505",
"0.58981997",
"0.58711994",
"0.5859831",
"0.5843661",
"0.57936025",
"0.576914",
"0.57135165",
"0.5695219",
"0.5689491",
"0.5680237",
"0.56761724",
"0.5670575",
"0.566158",
"0.5625387",
"0.5611408... | 0.0 | -1 |
GET /manage_teams GET /manage_teams.json | def index
@manage_teams = ManageTeam.all
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_team_list ( page = 1 )\n get_api_resource \"#{@@api_base_url}teams/#{page}\"\n end",
"def organization_teams\n get(\"/organizations/#{@default_org_slug}/teams/\")\n end",
"def index\n @teams = current_user.teams\n end",
"def index\n @teams = current_user.teams\n end",
"def team(... | [
"0.7537896",
"0.74025214",
"0.72080195",
"0.72080195",
"0.71886444",
"0.7104305",
"0.7054615",
"0.7020705",
"0.6986244",
"0.69394225",
"0.6888179",
"0.68863684",
"0.6882221",
"0.6882011",
"0.6860769",
"0.68204665",
"0.68204665",
"0.68204665",
"0.68204665",
"0.68204665",
"0.68... | 0.73477256 | 2 |
GET /manage_teams/1 GET /manage_teams/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_team_list ( page = 1 )\n get_api_resource \"#{@@api_base_url}teams/#{page}\"\n end",
"def team(id)\n get \"/teams/#{id}\"\n end",
"def index\n @manage_teams = ManageTeam.all\n end",
"def organization_teams\n get(\"/organizations/#{@default_org_slug}/teams/\")\n end",
"de... | [
"0.75918406",
"0.7432122",
"0.7356902",
"0.7101455",
"0.70920885",
"0.70920885",
"0.70477575",
"0.7011361",
"0.7005574",
"0.70009863",
"0.69872016",
"0.69806784",
"0.69773656",
"0.69548273",
"0.6945705",
"0.6934425",
"0.6920693",
"0.6874304",
"0.68714315",
"0.6867092",
"0.686... | 0.0 | -1 |
POST /manage_teams POST /manage_teams.json | def create
@manage_team = ManageTeam.new(manage_team_params)
respond_to do |format|
if @manage_team.save
format.html { redirect_to @manage_team, notice: 'Manage team was successfully created.' }
format.json { render action: 'show', status: :created, location: @manage_team }
else
format.html { render action: 'new' }
format.json { render json: @manage_team.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @team = @organization.teams.build(team_params)\n\n respond_to do |format|\n if @team.save\n current_user.add_role :admin, @team\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team ... | [
"0.7127008",
"0.6976158",
"0.6949987",
"0.69198996",
"0.6915161",
"0.6896242",
"0.6895454",
"0.68951243",
"0.6886849",
"0.6885882",
"0.6869468",
"0.6863314",
"0.6819483",
"0.67638206",
"0.6760003",
"0.6749173",
"0.6744825",
"0.67044556",
"0.67005664",
"0.66879034",
"0.6663607... | 0.71856725 | 0 |
PATCH/PUT /manage_teams/1 PATCH/PUT /manage_teams/1.json | def update
respond_to do |format|
if @manage_team.update(manage_team_params)
format.html { redirect_to @manage_team, notice: 'Manage team was successfully updated.' }
format.json { head :no_content }
else
format.html { render action: 'edit' }
format.json { render json: @manage_team.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @team = Team.find(params[:id])\n\n if @team.update_attributes(params[:team])\n head :no_content\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end",
"def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_... | [
"0.7077925",
"0.70685786",
"0.69005555",
"0.68992907",
"0.68281853",
"0.68102705",
"0.67890507",
"0.6768613",
"0.6767848",
"0.6767848",
"0.67654705",
"0.67580426",
"0.67580426",
"0.67580426",
"0.67580426",
"0.67580426",
"0.67580426",
"0.67541224",
"0.6725877",
"0.6712826",
"0... | 0.6883057 | 4 |
DELETE /manage_teams/1 DELETE /manage_teams/1.json | def destroy
@manage_team.destroy
respond_to do |format|
format.html { redirect_to manage_teams_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n team.destroy\n\n respond_to do |format|\n format.html { redirect_to teams_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @team = @club.teams.find(params[:id])\n @team.destroy\n\n respond_to do |format|\n format.html { redirect_to club_teams_u... | [
"0.778806",
"0.7686574",
"0.76810706",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7672189",
"0.7662108",
"0.7662108",
"0.7662108",
"0.7662108",
"0.75636023",
"0.75437754",
... | 0.7943891 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_manage_team
@manage_team = ManageTeam.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.6163927",
"0.6046165",
"0.59465253",
"0.59167755",
"0.58904207",
"0.58346355",
"0.577713",
"0.5703502",
"0.5703502",
"0.56531286",
"0.56215113",
"0.54224145",
"0.5410795",
"0.5410795",
"0.5410795",
"0.53924775",
"0.5379919",
"0.53580743",
"0.53401667",
"0.53397506",
"0.533... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def manage_team_params
params.require(:manage_team).permit(:name, :image, :position, :desc)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
release is not relevant | def default_docker_image
"#{env}/#{appname}:#{image_tag}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release\n end",
"def release\n end",
"def release\n end",
"def finalized; end",
"def release()\n res = super(self)\n return res\n end",
"def dispose; end",
"def finalize!; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def re... | [
"0.7480898",
"0.7480898",
"0.73503584",
"0.7184724",
"0.7163193",
"0.71506006",
"0.70466864",
"0.7043542",
"0.7043542",
"0.7043542",
"0.7043542",
"0.6980772",
"0.6922221",
"0.68838364",
"0.6745545",
"0.670832",
"0.670832",
"0.670832",
"0.670832",
"0.670832",
"0.670832",
"0.... | 0.0 | -1 |
maybe from external image | def dkrun_cmd(labeled: true, opts: nil, named: false)
cmd = "docker run"
if labeled
release_labels = release_label_hash.map do |k, v|
"--label=#{k}=#{v}"
end.join(' ')
cmd += " #{release_labels}"
end
cmd += " --net #{netname}" if netname
cmd += " --name #{container_name}" if named
cmd += " #{opts}" if opts
cmd
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def image; end",
"def load_image(path)\n end",
"def load_image\n Magick::Image.from_blob(data).first\n end",
"def imgurl\n picref.imgurl if picref\n end",
"def img\n Magick::Image::read(self.image).first\n end",
"def image_from_url\n io = open(URI.parse(image_url))\n def io.original_fi... | [
"0.6854997",
"0.679832",
"0.66605616",
"0.6649216",
"0.655588",
"0.6523349",
"0.64725894",
"0.6455004",
"0.6455004",
"0.64312565",
"0.6409965",
"0.63859403",
"0.6385652",
"0.6378157",
"0.6366419",
"0.6366419",
"0.63482726",
"0.6345442",
"0.6341713",
"0.63313997",
"0.63313997"... | 0.0 | -1 |
Note: if img1:t1 = img2:t2 points to same image hashid, they will be selected as same | def containers_for_image(img = docker_image)
`docker ps -aq -f ancestor=#{img}`.split("\n")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_refute_png_equal_with_different_image\n refute_png_equal(comparison_png(0), comparison_png(1))\n end",
"def hash\n @real.hash ^ @image.hash\n end",
"def find_matching_image(image)\n hue = @histogram.set_hue image: image\n bucket = @cache[hue]\n index = rand(bucket.size) # 0 <= ind... | [
"0.6200108",
"0.61960924",
"0.5743759",
"0.57078624",
"0.5675269",
"0.5612333",
"0.55850804",
"0.5549796",
"0.55158186",
"0.5506872",
"0.5486608",
"0.5486608",
"0.54725033",
"0.54370236",
"0.5409583",
"0.5389876",
"0.53847975",
"0.53576136",
"0.5330202",
"0.53106725",
"0.5307... | 0.0 | -1 |
use _ to ensure possible unique | def script_name # not file name
sname = fetch(:script_name)
return sname if sname
name = dklet_script.basename('.rb').to_s
pname = script_path.basename.to_s
"#{pname}_#{name}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allows_unique?\n true\n end",
"def unique_safe_name\n \"#{safe_name}_#{id}\"\n end",
"def uniq!() end",
"def unique?\n false\n end",
"def is_unique?(str)\n\nend",
"def test_unique\n assert_equal \".archetype-uid-RANDOM_UID\", evaluate(\"unique(class)\")\n assert_equal \"\\#a... | [
"0.74093693",
"0.6758839",
"0.6663089",
"0.66524804",
"0.6634064",
"0.658854",
"0.6531395",
"0.6505814",
"0.6499127",
"0.64559036",
"0.64087635",
"0.64051026",
"0.6400907",
"0.63916856",
"0.63460857",
"0.6334097",
"0.6326431",
"0.63120043",
"0.63098216",
"0.6249823",
"0.62488... | 0.0 | -1 |
Dockerfile for image build | def write_dockerfile(str, path: nil)
set_file_for(:dockerfile, str)
register_build_root(path) if path
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_docker_image\n return if File.exist?(Kubes.config.state.path)\n Build.new(@options).run\n end",
"def build_docker_image(image_version)\n @process_runner.execute!(\"cd #{@working_directory} && docker build -t #{repository_name}:latest -t #{repository_name}:#{image_version} .\")\n end",
... | [
"0.76331735",
"0.7375778",
"0.72752917",
"0.71773374",
"0.714699",
"0.702284",
"0.6941528",
"0.69206464",
"0.68949676",
"0.687601",
"0.6792107",
"0.6784374",
"0.671487",
"0.6593091",
"0.6569525",
"0.65620726",
"0.6549633",
"0.650985",
"0.64788747",
"0.64742786",
"0.64659786",... | 0.6021984 | 32 |
specfile for k8s resources spec manifest | def write_specfile(str)
set_file_for(:specfile, str)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def spec\n YAML.load_file(\"#{tmp_folder}/#{repository_name}/#{spec_name}\")\n end",
"def load_manifests(path)\n path = Pathname.new(path).freeze\n files = if File.file?(path)\n [path]\n else\n Pathname.glob(path.join('*.{yml,yaml,yml.erb,yaml.er... | [
"0.6289966",
"0.6240017",
"0.60639185",
"0.58766145",
"0.5859065",
"0.5838692",
"0.57796484",
"0.57654995",
"0.5725692",
"0.56259096",
"0.5619568",
"0.5596181",
"0.5596181",
"0.55631053",
"0.5478355",
"0.5465605",
"0.5458232",
"0.54559684",
"0.5451283",
"0.5424018",
"0.541030... | 0.0 | -1 |
rendered in current context | def specfile
rendered_file_for(:specfile)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rendered; end",
"def rendered=(_arg0); end",
"def render\n end",
"def render; end",
"def render; end",
"def render; end",
"def render; end",
"def render; end",
"def render\n end",
"def render\n end",
"def render\n end",
"def render(context, options); end",
"def render\n e... | [
"0.8321957",
"0.78472924",
"0.7809874",
"0.7743724",
"0.7743724",
"0.7743724",
"0.7743724",
"0.7743724",
"0.75730246",
"0.75730246",
"0.75730246",
"0.7479907",
"0.74188644",
"0.73201036",
"0.724864",
"0.7146596",
"0.71322936",
"0.7111423",
"0.71088016",
"0.70662886",
"0.70428... | 0.0 | -1 |
use label (not name) filter to avoid str part match | def find_net(name)
cmd = "docker network ls -q --filter label=#{label_pair(:name, name)}"
netid = `#{cmd}`.chomp
return netid unless netid.empty?
nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sanitize_label(label); end",
"def includes_special_label?(label)\n ids.first.to_s.downcase == label || usernames.map(&:downcase).include?(label)\n end",
"def label_link_filter(text)\n project = context[:project]\n\n self.class.references_in(text) do |match, id, name|\n params... | [
"0.7043509",
"0.62652767",
"0.6213342",
"0.6136195",
"0.61010605",
"0.6006082",
"0.5971048",
"0.59525317",
"0.5937394",
"0.58967113",
"0.5894078",
"0.58233005",
"0.58233005",
"0.5818699",
"0.58022684",
"0.5708786",
"0.56704324",
"0.5651206",
"0.5638042",
"0.5632317",
"0.56142... | 0.0 | -1 |
project name for dockercompose | def compose_name
"#{env}-#{fetch(:compose_name) || appname}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def docker_compose_project_name\n compose_project_name = ENV['COMPOSE_PROJECT_NAME']\n if compose_project_name.nil? || compose_project_name.empty?\n compose_project_name = \"rhd_#{ENV['rhd_test']}_testing\"\n end\n compose_project_name\n end",
"def docker_compose_project_name\n compose_proje... | [
"0.8261772",
"0.82611597",
"0.7155166",
"0.646076",
"0.6389967",
"0.6380868",
"0.6370124",
"0.6282495",
"0.62050664",
"0.62050664",
"0.61707693",
"0.613646",
"0.61011755",
"0.61011755",
"0.60452896",
"0.6020921",
"0.60172826",
"0.5978754",
"0.5885832",
"0.5870178",
"0.5867966... | 0.71263045 | 3 |
f, file p, projectname to altertive project name, eg. default net prefix | def compose_cmd
"docker-compose -f #{specfile} --project-name #{compose_name} --project-directory #{approot}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def projectizeName(filename)\n return ApplicationController.projectizeName(filename)\n end",
"def project_filename; end",
"def project_file(fname)\n \"#{@project_path}/#{fname}\"\nend",
"def project_name(new_name = T.unsafe(nil)); end",
"def change_name!\n @project[:name] = \"#{@project[:name]}-P... | [
"0.6794774",
"0.6739951",
"0.6683074",
"0.6572354",
"0.6522106",
"0.6216885",
"0.618316",
"0.61010385",
"0.6020969",
"0.6020866",
"0.5960323",
"0.59455127",
"0.5927612",
"0.58929986",
"0.5892349",
"0.58813894",
"0.58737075",
"0.58435756",
"0.58141893",
"0.58141893",
"0.580075... | 0.0 | -1 |
todo disentangle here paths | def appname
fetch(:appname) || script_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def paths; end",
"def paths; end",
"def paths; end",
"def paths; end",
"def paths; end",
"def path() end",
"def path() end",
"def path() end",
"def path(*) end",
"def path; end",
"def path; end",
"def path; end",
"def path; end",
"def path; end",
"def path; end",
"def path; end",
"d... | [
"0.767024",
"0.767024",
"0.767024",
"0.767024",
"0.767024",
"0.7222189",
"0.7222189",
"0.7222189",
"0.71529245",
"0.70031244",
"0.70031244",
"0.70031244",
"0.70031244",
"0.70031244",
"0.70031244",
"0.70031244",
"0.70031244",
"0.70031244",
"0.70031244",
"0.70031244",
"0.700312... | 0.0 | -1 |
URI not support underscore hostname | def default_container_name
full_release_name.gsub('_', '-')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uri_host; end",
"def do_url (name)\n name.to_s.downcase.gsub(' ', '_')\n end",
"def normalized_host; end",
"def http_uri\n \"http://#{hostname}/\"\n end",
"def test_absolute_uri_underscores\n parser = HttpParser.new\n req = parser.env\n http = \"GET http://under_score.example.com/f... | [
"0.73826665",
"0.6853446",
"0.6795866",
"0.6704539",
"0.6463444",
"0.6461036",
"0.6426392",
"0.63171715",
"0.6282429",
"0.62471646",
"0.6220746",
"0.6214699",
"0.619488",
"0.6167247",
"0.61516565",
"0.6143218",
"0.6142354",
"0.61412287",
"0.61328757",
"0.61328495",
"0.6125854... | 0.0 | -1 |
fix appname in top domain( eg ab app for ab.c top domain) | def smart_proxy_domain
if proxy_base_domain =~ /^#{appname}/
return proxy_base_domain
end
proxy_domains
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sanitized_app_name\n app_name.gsub(' ', '_').downcase\n end",
"def sanitized_app_name\n application.gsub(' ', '_').downcase\n end",
"def safe_app_name\n app_name.gsub(/[^a-zA-Z0-9_-]/, \"_\")\n end",
"def subdomain\n ([self.short_name] + self.class.dalianshops.domain.split('.')... | [
"0.738992",
"0.7350941",
"0.6876867",
"0.667217",
"0.6657035",
"0.6636623",
"0.6589322",
"0.65572685",
"0.65468764",
"0.648841",
"0.6462511",
"0.64286095",
"0.6367601",
"0.6339413",
"0.63339216",
"0.63218164",
"0.62802386",
"0.6254827",
"0.6251783",
"0.62161",
"0.6151194",
... | 0.619268 | 20 |
Confirms the correct user. | def correct_user
@user = User.find(params[:id])
redirect_to(root_url) unless current_user?(@user)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def correct_user\n msg = \"You do not have permission to update another user's information\"\n require_correct_user(@user, msg)\n end",
"def correct_user\n\t\t\tauthenticate_user!\n\t\t\tunless @user == current_user || current_user.admin?\n\t\t\t\tredirect_to (root_path)\n\t\t\t\tflash[:alert]\n... | [
"0.7474727",
"0.73414856",
"0.73176336",
"0.7183247",
"0.71750194",
"0.705034",
"0.7012752",
"0.7011754",
"0.7006919",
"0.70057875",
"0.70035315",
"0.6966616",
"0.6913424",
"0.6911236",
"0.69037426",
"0.68929136",
"0.6844362",
"0.6843171",
"0.68401915",
"0.68352634",
"0.68265... | 0.0 | -1 |
Checks more licenses are available | def moreLicenses
unless current_user.clearance>=2&¤t_user.organization.numLicenses-current_user.organization.users.length+1>=3
store_location
redirect_to current_user
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_license()\n return true\n end",
"def validate_license_info\n # First check the project licensing information\n\n # Check existence of licensing information\n if project.license == \"Unspecified\"\n licensing_warning(\"Project '#{project.name}' does not contain licensing inform... | [
"0.73579264",
"0.7127158",
"0.6927624",
"0.68518174",
"0.6771183",
"0.65903586",
"0.6578795",
"0.6572097",
"0.6542428",
"0.65185803",
"0.6499136",
"0.6475447",
"0.6465352",
"0.6452822",
"0.641776",
"0.64027387",
"0.63427246",
"0.63095415",
"0.6287338",
"0.62574804",
"0.623504... | 0.7096969 | 2 |
Not converted to the new system since this will be refactored a lot | def serialize(biome)
name = biome.fetch('DisplayName', biome.name)
color = biome.color('Color', '#000000')
bg_color = biome.color('BackgroundColor', '#000000')
symbol = biome.symbol('Symbol', 0)
height = biome.fetch('Height', '0 0').split(' ').map{|x| x.strip.to_i}
temperature = biome.fetch('Temperature', '0 1000').split(' ').map{|x| x.strip.to_i}
rain = biome.fetch('Rain', '0 1000').split(' ').map{|x| x.strip.to_i}
drainage = biome.fetch('Drainage', '0 1000').split(' ').map{|x| x.strip.to_i}
layer_top = biome.ref(:material, 'LayerTop', 'Air')
layer_middle = biome.ref(:material, 'LayerMiddle', 'Air')
layer_bottom = biome.ref(:material, 'LayerBottom', 'Air')
noise_amplitude = biome.integer('NoiseAmplitude', 20)
noise_power = biome.fetch('NoisePower', '1.0').to_f
tree_density = biome.fetch('TreeDensity', '0').to_i
tree_tile, tree_mat = tile_pair(biome.fetch('TreeType', 'Nothing:Air'))
flags = 0
flags |= (biome.boolean('NoEmbark') ? 0x01 : 0)
emit(biome.id, 'S<')
emit([name.size, name], 'S<a*')
emit(color, 'C3')
emit(bg_color, 'C3')
emit(symbol, 'S<')
emit(height, 'S<2')
emit(temperature, 'S<2')
emit(rain, 'S<2')
emit(drainage, 'S<2')
emit(layer_top, 'C')
emit(layer_middle, 'C')
emit(layer_bottom, 'C')
emit(noise_amplitude, 'C')
emit(noise_power, 'F')
emit(tree_density, 'S<')
emit(tree_tile, 'C')
emit(tree_mat, 'C')
emit(flags, 'S<')
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def schubert; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def implementation; end",
"def implementation; end",
"def custom; end",
"def custom; end",
"def intensifier; end",
"def formation; end",
"def operations... | [
"0.75085455",
"0.6450165",
"0.63193375",
"0.6286371",
"0.6286371",
"0.6286371",
"0.6286371",
"0.61530834",
"0.61530834",
"0.60867906",
"0.60867906",
"0.6049085",
"0.60185874",
"0.59923214",
"0.59923214",
"0.5987173",
"0.59864175",
"0.59112334",
"0.58637273",
"0.5808186",
"0.5... | 0.0 | -1 |
Returns the current workitem if no fei is given. If a fei is given, it will return the applied workitem for that fei (if any). The optional fei is mostly here for backward compatibility (with 2.2.0) | def workitem(fei=nil)
return fetch_workitem(fei) if fei
@workitem ? @workitem : applied_workitem
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applied_workitem(_fei=nil)\n\n fetch_workitem(_fei || fei)\n end",
"def [](fei)\n\n doc = fetch(fei)\n\n doc ? Ruote::Workitem.new(doc) : nil\n end",
"def applied_workitem\n\n @awi ||= Ruote::Workitem.new(h.applied_workitem)\n end",
"def fei\n\n @fei ? @fei : @workitem.f... | [
"0.84802353",
"0.684329",
"0.6823826",
"0.68020475",
"0.643721",
"0.6433544",
"0.6280204",
"0.54779565",
"0.54373527",
"0.54275143",
"0.53904945",
"0.53726786",
"0.5338978",
"0.53344524",
"0.530411",
"0.5216317",
"0.52095455",
"0.5204724",
"0.5140214",
"0.5126467",
"0.5124346... | 0.8818345 | 0 |
Returns the current fei (Ruote::FlowExpressionId). | def fei
@fei ? @fei : @workitem.fei
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fei\n\n Ruote::FlowExpressionId.new(h.fei)\n end",
"def fei\n\n FlowExpressionId.new(h.fei)\n end",
"def full_fei\n\n @full_fei ||= OpenWFE::FlowExpressionId.from_s(fei)\n end",
"def full_fei\n\n @full_fei ||= OpenWFE::FlowExpressionId.from_s(fei)\n end",
"def get_fei (a... | [
"0.88221747",
"0.8765431",
"0.72101337",
"0.72101337",
"0.7183698",
"0.6429862",
"0.6220795",
"0.61703753",
"0.61633503",
"0.609138",
"0.5986439",
"0.591195",
"0.5887307",
"0.58856684",
"0.58752126",
"0.5804085",
"0.5781046",
"0.5652986",
"0.55530804",
"0.5544083",
"0.5500107... | 0.69209236 | 5 |
Returns the Ruote::ParticipantExpression that corresponds with this participant. If a wi_or_fei arg is given, will return the corresponding flow expression. This arg is mostly here for backward compatibility. | def fexp(wi_or_fei=nil)
flow_expression(wi_or_fei || fei)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def expression\n Bumbleworks::Expression.from_fei(fei)\n end",
"def fei\n\n Ruote::FlowExpressionId.new(h.fei)\n end",
"def workitems\n\n @expressions.select { |fexp|\n #fexp.is_a?(Ruote::Exp::ParticipantExpression)\n fexp.h.name == 'participant'\n }.collect { |fexp|... | [
"0.57996374",
"0.5785982",
"0.5749371",
"0.54768634",
"0.5452336",
"0.5304602",
"0.5132638",
"0.50958204",
"0.49156335",
"0.48420572",
"0.4831378",
"0.4815506",
"0.4800935",
"0.4784268",
"0.47835112",
"0.4621719",
"0.46015272",
"0.4573871",
"0.456725",
"0.4551349",
"0.454514"... | 0.5659175 | 3 |
Returns the workitem as was applied when the Ruote::ParticipantExpression was reached. If the _fei arg is specified, it will return the corresponding applied workitem. This args is mostly here for backward compatibility. | def applied_workitem(_fei=nil)
fetch_workitem(_fei || fei)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def workitem(fei=nil)\n\n return fetch_workitem(fei) if fei\n\n @workitem ? @workitem : applied_workitem\n end",
"def workitems\n\n @expressions.select { |fexp|\n #fexp.is_a?(Ruote::Exp::ParticipantExpression)\n fexp.h.name == 'participant'\n }.collect { |fexp|\n Ruote... | [
"0.69228023",
"0.673776",
"0.64550436",
"0.6228524",
"0.621126",
"0.620049",
"0.6040509",
"0.6015035",
"0.5945306",
"0.59317875",
"0.570277",
"0.5623642",
"0.55669945",
"0.5513758",
"0.5512242",
"0.5394764",
"0.5365102",
"0.53589064",
"0.5353701",
"0.53218883",
"0.52656335",
... | 0.6482672 | 2 |
Up until ruote 2.3.0, the participant name had to be fetched from the workitem. This is a shortcut, it lets you write participant code that look like def on_workitem (workitem.fields['supervisors'] || []) << participant_name reply end | def participant_name
workitem.participant_name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def participant_name\n\n h.participant_name\n end",
"def participant\n ScriptoriaCore::Ruote.engine.participant(participant_name)\n end",
"def first_name\n self.participant.user.first_name\n end",
"def per_participant\n\n each_with_object({}) { |wi, h| (h[wi.participant_name] ||= []) ... | [
"0.6996525",
"0.6951807",
"0.6424882",
"0.63494736",
"0.6316345",
"0.604646",
"0.5998308",
"0.595223",
"0.59515834",
"0.594469",
"0.59238636",
"0.5910781",
"0.59065545",
"0.5887175",
"0.58622307",
"0.5847711",
"0.5793256",
"0.5784561",
"0.5768779",
"0.5760542",
"0.5757097",
... | 0.7839455 | 0 |
A shortcut for fexp.lookup_variable(key) | def lookup_variable(key)
fexp.lookup_variable(key)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get(key)\n @variables[key.to_sym]\n end",
"def lookup_variable (varname)\n\n env, var = lookup_environment(varname)\n env[var]\n end",
"def lookup(key)\n if @data[\"vars\"] && @data[\"vars\"].has_key?(key)\n return true, @data[\"vars\"][key]\n end\n return false, ... | [
"0.7180863",
"0.7162888",
"0.7091131",
"0.6904678",
"0.6882745",
"0.6804528",
"0.67784435",
"0.67784435",
"0.6759197",
"0.6651394",
"0.66347355",
"0.6626815",
"0.65954655",
"0.6576653",
"0.6562062",
"0.65050054",
"0.65023965",
"0.6495059",
"0.6487961",
"0.643238",
"0.6425157"... | 0.941451 | 0 |
Participant implementations call this method when their on_workitem (consume) methods are done and they want to hand back the workitem to the engine so that the flow can resume. the (wi=workitem) is mostly for backward compatibility (or for passing a totally different workitem to the engine). | def reply_to_engine(wi=workitem)
receive(wi)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _on_workitem(wi)\n Ruote.participant_send(\n self, [ :on_workitem, :consume ], 'workitem' => wi)\n end",
"def consume (workitem)\n # does nothing and does not reply to the engine.\n end",
"def consume (workitem)\n\n reply_to_engine(workitem)\n end",
"def consume (workitem)\... | [
"0.86300087",
"0.7754322",
"0.7484925",
"0.69160575",
"0.6657702",
"0.6639928",
"0.662259",
"0.66056997",
"0.6591868",
"0.64952314",
"0.64819765",
"0.64460456",
"0.63810974",
"0.63067853",
"0.6274159",
"0.62303877",
"0.61929846",
"0.6155849",
"0.6145177",
"0.608055",
"0.60208... | 0.65715486 | 9 |
Use this method to re_dispatch the workitem. It takes two options :in and :at for "later re_dispatch". Look at the unschedule_re_dispatch method for an example of participant implementation that uses re_dispatch. Without one of those options, the method is a "reject". | def re_dispatch(wi=nil, opts=nil)
wi, opts = [ nil, wi ] if wi.is_a?(Hash) && opts.nil?
wi ||= workitem()
opts ||= {}
wi.h.re_dispatch_count = wi.h.re_dispatch_count.to_s.to_i + 1
msg = {
'action' => 'dispatch',
'fei' => wi.h.fei,
'workitem' => wi.to_h,
'participant_name' => wi.participant_name
}
if t = opts[:in] || opts[:at]
sched_id = @context.storage.put_schedule('at', wi.h.fei, t, msg)
exp = fexp(wi)
exp.h['re_dispatch_sched_id'] = sched_id
exp.try_persist
else
@context.storage.put_msg('dispatch', msg)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def requeue\n @action = :requeue\n end",
"def reply (workitem)\n\n unschedule_timeout(workitem)\n\n super\n end",
"def unschedule_re_dispatch(fei=nil)\n\n if s = fexp.h.re_dispatch_sched_id\n @context.storage.delete_schedule(s)\n end\n end",
"def reschedule\n @... | [
"0.6316928",
"0.6085091",
"0.60215694",
"0.5790598",
"0.57287294",
"0.5726804",
"0.5712782",
"0.5612365",
"0.56099004",
"0.5555017",
"0.55294377",
"0.5504642",
"0.5460236",
"0.5460236",
"0.5415176",
"0.5389228",
"0.5353655",
"0.53491056",
"0.52825385",
"0.52738285",
"0.527199... | 0.78486353 | 0 |
Cancels the scheduled re_dispatch, if any. An example of 'retrying participant' : class RetryParticipant include Ruote::LocalParticipant def initialize(opts) | def unschedule_re_dispatch(fei=nil)
if s = fexp.h.re_dispatch_sched_id
@context.storage.delete_schedule(s)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_participant_re_dispatch_later_cancel\n\n pdef = Ruote.process_definition do\n alpha\n end\n\n @dashboard.register_participant :alpha, RetryParticipant, 'delay' => '1m'\n\n #noisy\n\n wfid = @dashboard.launch(pdef)\n sleep 0.7\n\n @dashboard.cancel_process(wfid)\n wait_for(wfid... | [
"0.7231477",
"0.6118492",
"0.61060846",
"0.60801023",
"0.58072376",
"0.5660678",
"0.5636772",
"0.5621804",
"0.5502451",
"0.5500963",
"0.5495482",
"0.5494649",
"0.5482683",
"0.54642874",
"0.5449592",
"0.54485846",
"0.5436719",
"0.541484",
"0.5372443",
"0.53614",
"0.5355417",
... | 0.0 | -1 |
test methods prefixed with an underscore ++ Test shortcut, alleviates the need to set the workitem before calling consume / on_workitem. | def _on_workitem(wi)
Ruote.participant_send(
self, [ :on_workitem, :consume ], 'workitem' => wi)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_tests\n end",
"def _test_message ; process_test_case(\"message\") ; end",
"def test_case; end",
"def stest_method_1(test); end",
"def tests; end",
"def tests; end",
"def work!(work_item)\n raise NotImplementedError\n end",
"def running_test_case; end",
"def test_setup\r\n ... | [
"0.6321941",
"0.6216913",
"0.60990405",
"0.6000415",
"0.59984595",
"0.59984595",
"0.5987207",
"0.59119505",
"0.5909353",
"0.59074557",
"0.59007967",
"0.5885891",
"0.5876107",
"0.5870387",
"0.5870387",
"0.5870387",
"0.5852583",
"0.5852583",
"0.58299494",
"0.5825924",
"0.582592... | 0.5680749 | 24 |
Test shortcut, alleviates the need to set fei and flavour before calling cancel / on_consume. | def _on_cancel(fei, flavour)
Ruote.participant_send(
self, [ :on_cancel, :cancel ], 'fei' => fei, 'flavour' => flavour)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testShortcut\n execute_Deliver_WithConf({\n :WaveFiles => { :FilesList => [ { :Name => 'Wave1.wav' } ] },\n :Mix => { 'Mix1' => { :Tracks => { 'Wave1.wav' => {} } } },\n :Deliver => {\n :Formats => {\n 'Test' => {\n ... | [
"0.60770327",
"0.5641215",
"0.53163886",
"0.527576",
"0.5110359",
"0.5054678",
"0.50456005",
"0.49956292",
"0.49534383",
"0.49175087",
"0.48714948",
"0.4857888",
"0.48518184",
"0.48454732",
"0.47849166",
"0.4767513",
"0.4757586",
"0.47565967",
"0.4740271",
"0.47304425",
"0.47... | 0.438795 | 94 |
Test shortcut, alleviates the need to set the workitem before calling on_reply. | def _on_reply(wi)
Ruote.participant_send(self, :on_reply, 'workitem' => wi)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testShortcut\n execute_Deliver_WithConf({\n :WaveFiles => { :FilesList => [ { :Name => 'Wave1.wav' } ] },\n :Mix => { 'Mix1' => { :Tracks => { 'Wave1.wav' => {} } } },\n :Deliver => {\n :Formats => {\n 'Test' => {\n ... | [
"0.6283067",
"0.6050339",
"0.6001547",
"0.6001547",
"0.5951583",
"0.5847452",
"0.56966007",
"0.56752044",
"0.56427646",
"0.56338197",
"0.5612089",
"0.559568",
"0.5581304",
"0.55049735",
"0.5406963",
"0.5389959",
"0.5356444",
"0.5343097",
"0.53312415",
"0.5303894",
"0.52936673... | 0.5595258 | 12 |
Test shortcut, alleviates the need to set the workitem before calling accept? | def _accept?(wi)
Ruote.participant_send(self, :accept?, 'workitem' => wi)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def testShortcut\n execute_Deliver_WithConf({\n :WaveFiles => { :FilesList => [ { :Name => 'Wave1.wav' } ] },\n :Mix => { 'Mix1' => { :Tracks => { 'Wave1.wav' => {} } } },\n :Deliver => {\n :Formats => {\n 'Test' => {\n ... | [
"0.6379436",
"0.62393254",
"0.60731393",
"0.60169333",
"0.59492135",
"0.5410678",
"0.5377292",
"0.5250186",
"0.52102816",
"0.5125814",
"0.51195455",
"0.49969402",
"0.49882382",
"0.49752152",
"0.48895246",
"0.48823044",
"0.48383337",
"0.4837686",
"0.48165548",
"0.4811047",
"0.... | 0.5083653 | 11 |
Test shortcut, alleviates the need to set the workitem before calling dont_thread?, do_not_thread? or do_not_thread. | def _dont_thread?(wi)
Ruote.participant_send(
self,
[ :dont_thread?, :do_not_thread?, :do_not_thread ],
'workitem' => wi)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_not_thread; true; end",
"def do_not_thread; true; end",
"def do_not_thread; true; end",
"def do_not_thread\n\n true\n end",
"def do_not_thread\n true\n end",
"def do_not_thread\n true\n end",
"def do_not_thread\n true\n end",
"def do_not_thread(participa... | [
"0.63700503",
"0.63700503",
"0.63700503",
"0.60720485",
"0.60569835",
"0.6045292",
"0.6045292",
"0.5916683",
"0.5628588",
"0.5460189",
"0.54113245",
"0.5293728",
"0.528961",
"0.5265767",
"0.5254842",
"0.5206723",
"0.5185462",
"0.505428",
"0.5046881",
"0.50449824",
"0.5035791"... | 0.64119935 | 0 |
Test shortcut, alleviates the need to set the workitem before calling rtimeout. | def _rtimeout(wi)
Ruote.participant_send(self, :rtimeout, 'workitem' => wi)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_check_shortcut\n N::Namespace.shortcut(:xyshortcut, \"http://xyz/\")\n assert_equal(:xyshortcut, N::URI.new(\"http://xyz/\").my_shortcut)\n end",
"def testShortcut\n execute_Deliver_WithConf({\n :WaveFiles => { :FilesList => [ { :Name => 'Wave1.wav' } ] },\n :Mi... | [
"0.58481675",
"0.5791252",
"0.5766254",
"0.5631291",
"0.5610015",
"0.5375871",
"0.5327903",
"0.5195429",
"0.51676375",
"0.5136263",
"0.5132085",
"0.5082546",
"0.50743175",
"0.49227077",
"0.49002203",
"0.48898408",
"0.48631418",
"0.48252332",
"0.48249716",
"0.4813007",
"0.4800... | 0.49013478 | 14 |
Returns true if the underlying participant expression is 'gone' (probably cancelled somehow). | def is_gone?
fexp.nil?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_orphaned?\n participants.reduce(true) do |is_orphaned, participant|\n is_orphaned && is_deleted?(participant)\n end\n end",
"def is_cancelled?\n\n if fe = fexp\n return fe.h.state == 'cancelling'\n else\n true\n end\n end",
"def canceled?\n special_message ... | [
"0.65181994",
"0.6196268",
"0.618774",
"0.6095869",
"0.60403264",
"0.6031088",
"0.60306865",
"0.5997672",
"0.5996893",
"0.59890646",
"0.59806854",
"0.59496784",
"0.59496784",
"0.5936161",
"0.58958703",
"0.5894774",
"0.58602965",
"0.584036",
"0.5831636",
"0.5800843",
"0.579707... | 0.7242993 | 0 |
Returns true if the underlying participant expression is gone or cancelling. | def is_cancelled?
if fe = fexp
return fe.h.state == 'cancelling'
else
true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cancelled?\n !cancellation_date.nil? && cancellation_reason.present?\n end",
"def pending?\n !self.canceled?\n end",
"def canceled?\n special_message == \"This talk has been canceled/deleted\"\n end",
"def cancellation_pending?\n if self.state_changed?\n before_after_state... | [
"0.68071556",
"0.68060905",
"0.677476",
"0.6774061",
"0.6765638",
"0.67286915",
"0.6709092",
"0.66983825",
"0.6658313",
"0.66545635",
"0.6653472",
"0.6650867",
"0.6645448",
"0.6645448",
"0.66445667",
"0.6553049",
"0.6543486",
"0.6527468",
"0.6495556",
"0.6450873",
"0.6405137"... | 0.7062001 | 0 |
Receivers and local participants share the stash_put and stash_get methods. The local participant has put and get which don't need an initial fei, thus get and put deal with the participant expression directly, whereas stash_put and stash_get can point at any expression. 'put' can be called as put('secret' => 'message', 'to' => 'embassy') or put('secret', 'message') | def put(key, value=nil)
stash_put(fei, key, value)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def put(action, **args); end",
"def put(*args, &block); end",
"def setup(stash, point)\n\t\t@stash = stash\n\t\t\n\t\t\n\tend",
"def put(*args, &block)\n map_method(:put, args, &block)\n end",
"def store *args, █ put *args, █ end",
"def put(obj)\n end",
"def stash(kwds={})\... | [
"0.5950176",
"0.5928903",
"0.5537035",
"0.5534227",
"0.54704285",
"0.54209244",
"0.53131396",
"0.5263091",
"0.52621305",
"0.52610976",
"0.52190435",
"0.51065546",
"0.5093494",
"0.5082537",
"0.5081666",
"0.5049095",
"0.50184506",
"0.50062263",
"0.4982559",
"0.48761484",
"0.487... | 0.5914395 | 2 |
give random card from existing deck | def random_card
result = @deck.sample(1)
@deck.delete result
result.first
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def random_card\n return @deck[rand(@deck.length)]\n end",
"def get_card (random_num)\n\t\t@deck[random_num]\n\tend",
"def create_card(deck)\n card = deck.shuffle.pop\nend",
"def random\n card_dealt = @possible_cards.sample\n end",
"def random_card\n # @deck[1].rank\n size = @deck.size\n... | [
"0.8859846",
"0.8326462",
"0.8264971",
"0.8244094",
"0.8235121",
"0.8228347",
"0.82211405",
"0.8096481",
"0.80816954",
"0.8058726",
"0.79990375",
"0.7897901",
"0.7888068",
"0.7815481",
"0.7815481",
"0.7799077",
"0.773085",
"0.7695517",
"0.7694014",
"0.7665135",
"0.76401836",
... | 0.8746319 | 1 |
game is active now? | def game_unactive?
!@game_active
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_active_game\n # TODO\n end",
"def active?\n game.winner.nil?\n end",
"def game_paused? ; @game_paused end",
"def game_running?\n @game_running\nend",
"def in_battle?\n Game_Temp.in_battle\n end",
"def event_running?\n @battle_event.active?\n end",
"def game_has_st... | [
"0.85417086",
"0.7637689",
"0.75576115",
"0.75097305",
"0.7384127",
"0.72765917",
"0.7228609",
"0.7218822",
"0.7160009",
"0.71311605",
"0.71208596",
"0.70827085",
"0.7066289",
"0.7065482",
"0.7022806",
"0.69871336",
"0.6986222",
"0.6986222",
"0.69861585",
"0.69831055",
"0.697... | 0.74526805 | 4 |
Security stuff applies here Public it applies a single security check given by its name name the security check to be applied Examples engine.apply("CVE20131800") => boolean Returns a true value if the security check was successfully applied or false otherwise | def apply(name)
load_knowledge_base if @checks.nil?
return false if @checks.empty?
@checks.each do |check|
if check.name == name
unless ((check.kind == Codesake::Dawn::KnowledgeBase::PATTERN_MATCH_CHECK || check.kind == Codesake::Dawn::KnowledgeBase::COMBO_CHECK ) && @name == "Gemfile.lock")
debug_me "applying check #{check.name}"
@applied_checks += 1
@applied << { :name=>name }
check.ruby_version = @ruby_version[:version]
check.detected_ruby = @ruby_version if check.kind == Codesake::Dawn::KnowledgeBase::RUBY_VERSION_CHECK
check.dependencies = self.connected_gems if check.kind == Codesake::Dawn::KnowledgeBase::DEPENDENCY_CHECK
check.root_dir = self.target if check.kind == Codesake::Dawn::KnowledgeBase::PATTERN_MATCH_CHECK
check.options = {:detected_ruby => self.ruby_version, :dependencies => self.connected_gems, :root_dir => self.target } if check.kind == Codesake::Dawn::KnowledgeBase::COMBO_CHECK
check_vuln = check.vuln?
@vulnerabilities << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>nil} if check_vuln && check.kind != Codesake::Dawn::KnowledgeBase::COMBO_CHECK
@vulnerabilities << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>check.vulnerable_checks} if check_vuln && check.kind == Codesake::Dawn::KnowledgeBase::COMBO_CHECK
@mitigated_issues << {:name=> check.name, :message=>check.message, :remediation=>check.remediation, :evidences=>check.evidences, :vulnerable_checks=>nil} if check.mitigated?
return true
else
debug_me "skipping check #{check.name}"
@skipped_checks += 1
end
end
end
false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def apply(name)\n load_knowledge_base if @checks.nil?\n return false if @checks.empty?\n\n @checks.each do |check|\n if check.name == name\n @applied << { :name=>name }\n check.ruby_version = self.ruby_version[:version]\n check.detected_ruby = self.ru... | [
"0.70551425",
"0.6566007",
"0.553612",
"0.542689",
"0.5353791",
"0.53266376",
"0.52394813",
"0.5206308",
"0.5162355",
"0.5162355",
"0.5080505",
"0.50774515",
"0.5066082",
"0.5057112",
"0.501505",
"0.5014266",
"0.49934995",
"0.49897236",
"0.4985214",
"0.49814662",
"0.49698296"... | 0.6096549 | 2 |
How does this even work in core? Oh, nevermind, it doesn't. Patch submitted. :) | def conditions_with_metawhere
@conditions ||= interpolate_sql(association_class.send(:sanitize_sql, @reflection.options[:conditions])) if @reflection.options[:conditions]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def private; end",
"def probers; end",
"def internship_passed; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def specie; end",
"def anchored; end",
"def schubert; end",
"def isolated; end",
"def isolated; end",
"def internal; end",
"def wrapper; end",
"def custom; end",
... | [
"0.6922895",
"0.6533438",
"0.61480564",
"0.61338806",
"0.61338806",
"0.61338806",
"0.61338806",
"0.60601676",
"0.6008689",
"0.59750587",
"0.59750587",
"0.5940247",
"0.58633757",
"0.5856138",
"0.5856138",
"0.5854709",
"0.58337164",
"0.58337164",
"0.5825243",
"0.58144903",
"0.5... | 0.0 | -1 |
Write a function add_numbers(nums_array) that takes in an array of Integers and returns the sum of those numbers. Write this method recursively. | def add_numbers(nums_array)
return nil if nums_array.length == 0
return nums_array.first if nums_array.length == 1
nums_array.first + add_numbers(nums_array[1..-1])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_numbers(nums_array)\n\treturn nil if nums_array.length == 0\n\n\treturn nums_array.first if nums_array.length == 1\n\n\treturn nums_array.shift + add_numbers(nums_array)\nend",
"def add_numbers(num_array)\n return num_array[0] if num_array.length <= 1\n sum = num_array[0]\n sum += add_numbers(num_arra... | [
"0.8435391",
"0.8267358",
"0.82461274",
"0.8147379",
"0.8099505",
"0.8067153",
"0.8012289",
"0.79946655",
"0.79374665",
"0.79179955",
"0.7890794",
"0.7866834",
"0.78535163",
"0.7849921",
"0.78071046",
"0.77837145",
"0.775841",
"0.77236456",
"0.77192",
"0.77192",
"0.7710903",
... | 0.7911742 | 10 |
=> returns 5040 Write a function ice_cream_shop(flavors, favorite) that takes in an array of ice cream flavors available at the ice cream shop, as well as the user's favorite ice cream flavor. Recursively find out whether or not the shop offers their favorite flavor. | def ice_cream_shop(flavors, favorite)
return false if flavors.length.zero?
return flavors.first == favorite if flavors.length == 1
flavors.first == favorite || ice_cream_shop(flavors[1..-1], favorite)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ice_cream_shop(flavors, favorite)\n # Base step\n return false if flavors.empty?\n return true if flavors[0] == favorite\n # Recursive Step\n ice_cream_shop(flavors[1..-1], favorite)\nend",
"def ice_cream_shop(flavors, favorite)\n return false if flavors == []\n return true if flavors[0] == favorite\n... | [
"0.85914654",
"0.8256179",
"0.8204483",
"0.81669104",
"0.81622183",
"0.8137911",
"0.8128142",
"0.8102174",
"0.81006896",
"0.80890834",
"0.80784893",
"0.8051379",
"0.803514",
"0.8023674",
"0.7987004",
"0.7960586",
"0.79499376",
"0.7944276",
"0.7929472",
"0.7905324",
"0.7856332... | 0.80819464 | 10 |
=> returns false Write a function reverse(string) that takes in a string and returns it reversed. | def reverse(string)
return "" if string.length == 0
return string[0] if string.length == 1
reverse(string[1..-1]) + string[0]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse_string(string)\n answer = string.reverse\n return answer\nend",
"def reverse_string(string)\n reverse = string.reverse\n return reverse\nend",
"def reverse(string)\nend",
"def reverse_string(s)\n s.reverse!\nend",
"def reverse(str)\n return str.reverse()\nend",
"def reverse(str)\n ... | [
"0.84106237",
"0.8379405",
"0.8349062",
"0.8336613",
"0.83336335",
"0.83160585",
"0.8314077",
"0.8284059",
"0.82519865",
"0.82519865",
"0.82519865",
"0.82319546",
"0.82033616",
"0.817473",
"0.8174294",
"0.8157376",
"0.8157376",
"0.8092723",
"0.8075627",
"0.806348",
"0.8058772... | 0.0 | -1 |
GET /logs GET /logs.json | def index
if current_user.admin
@logs = Log.all
else
@logs = Log.where(:reference_code => current_user.content_code)
@clientlogs = Log.where(:client_code => current_user.client_code)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_logs(opts = {})\n @transporter.read(:GET, '/1/logs', {}, opts)\n end",
"def log\n @client.get(\"#{path}/log\")\n end",
"def index\n @wr_logs = WrLog.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wr_logs }\n end\n end",
... | [
"0.73838407",
"0.7217653",
"0.70543104",
"0.6947491",
"0.6945824",
"0.6937659",
"0.6903222",
"0.68449336",
"0.6843485",
"0.6843485",
"0.6810154",
"0.67356384",
"0.6704352",
"0.6674407",
"0.66210747",
"0.6616622",
"0.65853655",
"0.6546039",
"0.6533585",
"0.6505296",
"0.6480125... | 0.0 | -1 |
GET /logs/1 GET /logs/1.json | def show
is_admin?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def log\n @client.get(\"#{path}/log\")\n end",
"def show\n @log = Log.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @log }\n end\n end",
"def show\n @log = Log.find(params[:id])\n\n respond_to do |format|\n format.html... | [
"0.70589846",
"0.68281573",
"0.68281573",
"0.676178",
"0.665446",
"0.6634931",
"0.6577052",
"0.655347",
"0.6544362",
"0.6542115",
"0.6509032",
"0.64878905",
"0.6466216",
"0.6396822",
"0.63887364",
"0.63504505",
"0.63151747",
"0.62759453",
"0.6271731",
"0.62654126",
"0.6260569... | 0.0 | -1 |
POST /logs POST /logs.json | def create
@log = Log.new(log_params)
respond_to do |format|
if @log.save
format.html { redirect_to @log, notice: 'Log was successfully created.' }
format.json { render :show, status: :created, location: @log }
else
format.html { render :new }
format.json { render json: @log.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @log = current_app.logs.create(params)\n render json: @log\n end",
"def create\n # If the request body contains a single log (request body is not an array)\n if ( !JSON.parse(request.body.read).is_a?(Array) )\n log_data = JSON.parse(request.body.read)\n status, log = c... | [
"0.750983",
"0.73959804",
"0.7082373",
"0.70688707",
"0.6887694",
"0.6584805",
"0.6558032",
"0.65430963",
"0.648967",
"0.64812374",
"0.64736736",
"0.6473286",
"0.64448255",
"0.64101034",
"0.63376373",
"0.63022965",
"0.62919223",
"0.6282118",
"0.6264109",
"0.62557644",
"0.6251... | 0.6532103 | 10 |
PATCH/PUT /logs/1 PATCH/PUT /logs/1.json | def update
respond_to do |format|
if @log.update(log_params)
format.html { redirect_to @log, notice: 'Log was successfully updated.' }
format.json { render :show, status: :ok, location: @log }
else
format.html { render :edit }
format.json { render json: @log.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @log = Log.find(params[:id])\n\n if @log.update(log_params)\n head :no_content\n else\n render json: @log.errors, status: :unprocessable_entity\n end\n end",
"def update\n @log = Log.find(params[:id])\n\n respond_to do |format|\n if @log.update_attributes(params[:lo... | [
"0.63702244",
"0.6192638",
"0.6142398",
"0.6072837",
"0.602619",
"0.6021332",
"0.6009091",
"0.59995717",
"0.5970933",
"0.5964536",
"0.5951586",
"0.5923268",
"0.59215367",
"0.5919344",
"0.59146863",
"0.59006196",
"0.58807683",
"0.58788246",
"0.5866625",
"0.5855332",
"0.5851782... | 0.6026794 | 6 |
DELETE /logs/1 DELETE /logs/1.json | def destroy
@log.destroy
respond_to do |format|
format.html { redirect_to logs_url, notice: 'Log was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @log = @client.logs.find(params[:id])\n @log.destroy\n\n respond_to do |format|\n format.html { redirect_to(client_url(@client)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @log.destroy\n respond_to do |format|\n format.html { redirect_to logs_url }\n... | [
"0.71921927",
"0.71642995",
"0.71139425",
"0.71139425",
"0.7061044",
"0.6956337",
"0.6928689",
"0.6925817",
"0.69248325",
"0.68974054",
"0.6888822",
"0.68592334",
"0.6852717",
"0.68110347",
"0.6801446",
"0.67904896",
"0.67643666",
"0.67599887",
"0.67484516",
"0.6746382",
"0.6... | 0.68093884 | 15 |
Use callbacks to share common setup or constraints between actions. | def set_log
@log = Log.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.6163927",
"0.6046165",
"0.59465253",
"0.59167755",
"0.58904207",
"0.58346355",
"0.577713",
"0.5703502",
"0.5703502",
"0.56531286",
"0.56215113",
"0.54224145",
"0.5410795",
"0.5410795",
"0.5410795",
"0.53924775",
"0.5379919",
"0.53580743",
"0.53401667",
"0.53397506",
"0.533... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def log_params
params.require(:log).permit(:date_of_session, :time_of_sesion, :details, :reference_code, :client_code, :iname)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",... | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_memorial
@memorial = Memorial.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.6163163",
"0.6045976",
"0.5946146",
"0.591683",
"0.5890051",
"0.58349305",
"0.5776858",
"0.5703237",
"0.5703237",
"0.5652805",
"0.5621621",
"0.54210985",
"0.5411113",
"0.5411113",
"0.5411113",
"0.5391541",
"0.53794575",
"0.5357573",
"0.53402257",
"0.53394014",
"0.53321576"... | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def memorial_params
params.require(:memorial).permit(:title, :name, :description, :birth_date, :death_date, :path, :crop_top, :crop_left, :crop_width)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n... | [
"0.6981273",
"0.6783789",
"0.67460483",
"0.6742222",
"0.67354137",
"0.65934366",
"0.65028495",
"0.6497783",
"0.64826745",
"0.6479415",
"0.6456823",
"0.6440081",
"0.63800216",
"0.6376521",
"0.636652",
"0.6319898",
"0.6300256",
"0.62994003",
"0.6293621",
"0.6292629",
"0.6291586... | 0.0 | -1 |
Return the enumerated lines of the command's output | def getCommandOutput(command)
#N If we don't output the command it won't be echoed before it's output appears
puts "#{command.inspect} ..."
#N If we don't call this, the command won't run(?) and it's output won't be available
return IO.popen(command)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def command_output\n [command.stdout, command.stderr].join(\"\\n\\n\")\n end",
"def read_lines(cmd)\n IO.popen(cmd + ' 2>&1') do |child|\n child.read.split(\"\\n\")\n end\n end",
"def exec_read\n lines = []\n MEX.synchronize do\n puts \"% \" + to_s\n end\n... | [
"0.68375665",
"0.6826725",
"0.66310817",
"0.65137786",
"0.65059036",
"0.6493662",
"0.6324124",
"0.6252752",
"0.62455964",
"0.62303513",
"0.6177085",
"0.61643153",
"0.616375",
"0.61044544",
"0.60965055",
"0.6002687",
"0.59949625",
"0.5969165",
"0.59628254",
"0.59436184",
"0.59... | 0.5599947 | 51 |
Check if the last executed process exited with status 0, if not, raise an exception | def checkProcessStatus(description)
#N Without this, we won't know the status of the last process
processStatus = $?
#N If we don't check for exited, then we might report an invalid or undefined status value
if not processStatus.exited?
raise "#{description}: process did not exit normally"
end
#N Without this, we won't know if the status was non-zero
exitStatus = processStatus.exitstatus
#N If we don't check for zero, then we'll always raise an error, even for success
if exitStatus != 0
#N If we don't raise the error, then an invalid exit status will seem to exit successfully
raise "#{description}: exit status = #{exitStatus}"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exit_status_from_exception; end",
"def last_command_successful?\n $?.exitstatus == 0\n end",
"def exit_status\n @failure_count == 0 ? exit(0) : exit(1)\n end",
"def exitcode\n run unless @process\n @process.exitstatus\n end",
"def last_exit_successful?\n $!.nil? || $!.is_a?(Syst... | [
"0.6983408",
"0.6960143",
"0.6929326",
"0.68289566",
"0.6827344",
"0.6754732",
"0.67523843",
"0.6647697",
"0.6574119",
"0.6560714",
"0.65605265",
"0.6555435",
"0.64986783",
"0.648988",
"0.64773035",
"0.64683384",
"0.6449335",
"0.64396006",
"0.6414914",
"0.6333834",
"0.6330399... | 0.71758777 | 0 |
N Without this, we won't be able to construct the object representing the file path and the hash of its contents in a single expression (also there is no other way to set the readonly attributes) | def initialize(relativePath, hash)
#N Without this, we won't rememeber the relative path value
@relativePath = relativePath
#N Without this, we won't remember the file's cryptographic hash of its contents
@hash = hash
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n return (path + file_id.to_s).hash\n end",
"def file_digest(pathname)\n key = pathname.to_s\n if @digests.key?(key)\n @digests[key]\n else\n @digests[key] = super\n end\n end",
"def hash\n path.hash\n end",
"def file_sha256\n Digest::SHA256.fi... | [
"0.64729065",
"0.6364296",
"0.6325907",
"0.6279384",
"0.6247734",
"0.6226727",
"0.61595744",
"0.6123822",
"0.60323095",
"0.60049224",
"0.5966486",
"0.595585",
"0.59557825",
"0.59490746",
"0.5922426",
"0.58755106",
"0.58542365",
"0.58368963",
"0.5832685",
"0.578687",
"0.578657... | 0.64585716 | 1 |
N Without this, it's more work to output the description of this object | def inspect
#N Without this output, we won't know what class it belongs to or what the relative path and file content hash is
return "RelativePathWithHash[#{relativePath}, #{hash}]"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inspect\n \"#{self.class}<#{@description.inspect}>\"\n end",
"def inspect\n \"#<#{self.class.name}: #{to_s}>\"\n end",
"def inspect\n \"#<#{self.class} @label=#{label} docs=#{docs}>\"\n end",
"def inspect()\n #This is a stub, used for indexing\n end",
"... | [
"0.72545236",
"0.7052086",
"0.7047996",
"0.7016574",
"0.69726527",
"0.6956438",
"0.6951416",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
"0.6930877",
... | 0.0 | -1 |
N Without this we won't be able to construct the hash command object in a single expression (also there is no other way to set the readonly attributes) | def initialize(command, length, spacerLen)
#N Without this we won't remember the command to execute (on each file)
@command = command
#N Without this we won't remember how long a hash value to expect from the output line
@length = length
#N Without this we won't remember how many space characters to expect in the output line between the file name and the hash value
@spacerLen = spacerLen
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash\n self.class.hash ^ operand.hash\n end",
"def hash=(_arg0); end",
"def hash\n @hash[:perm_type].hash ^\n @hash[:perms].hash ^\n @hash[:inheritance].hash ^\n @hash[:target].hash\n end",
"def hash\n expr.hash\n end",
"def hash_for(expression)\n\n ... | [
"0.63045603",
"0.61514795",
"0.59913",
"0.59377694",
"0.58837736",
"0.58124214",
"0.57262135",
"0.57143325",
"0.56628305",
"0.56608355",
"0.56062055",
"0.5605712",
"0.5605712",
"0.5605712",
"0.5605712",
"0.5605712",
"0.5605712",
"0.5605712",
"0.55969113",
"0.5593327",
"0.5589... | 0.5271131 | 49 |
Parse a hash line relative to a base directory, returning a RelativePathWithHash N Without this method, we won't know how to parse the line of output from the hash command applied to the file | def parseFileHashLine(baseDir, fileHashLine)
#N Without this we won't get the hash line from the last <length> characters of the output line
hash = fileHashLine[0...length]
#N Without this we won't read the full file path from the output line preceding the spacer and the hash value
fullPath = fileHashLine[(length + spacerLen)..-1]
#N Without checking that the full path matches the base directory, we would fail to make this redundant check that the remote system has applied to the hash to the file we expected it to be applied to
if fullPath.start_with?(baseDir)
#N If we won't return this, we will fail to return the object representing the relative path & hash.
return RelativePathWithHash.new(fullPath[baseDir.length..-1], hash)
else
#N If we don't raise this error (which hopefully won't ever happen anyway), there won't be any sensible value we can return from this method
raise "File #{fullPath} from hash line is not in base dir #{baseDir}"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listFileHashLines(baseDir)\n #N Without this, the base directory might be missing the final '/', which might cause a one-off error when 'subtracting' the base directory name from the absolute paths to get relative paths\n baseDir = normalisedDir(baseDir)\n #N Without this, we wouldn't know what ... | [
"0.5887747",
"0.58208567",
"0.5716864",
"0.5669151",
"0.56038135",
"0.55389607",
"0.5512642",
"0.5444282",
"0.54402876",
"0.54324114",
"0.54298586",
"0.5364812",
"0.5314956",
"0.5281662",
"0.5218624",
"0.5170875",
"0.51430035",
"0.513666",
"0.51208264",
"0.5110224",
"0.510455... | 0.79346603 | 0 |
N Without this, the default string value of the hash command object will be less indicative of what it is | def to_s
#N Without this we won't see the command as a command and a list of arguments
return command.join(" ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hash=(_arg0); end",
"def default_key \n Digest::SHA1.hexdigest(\"riaque:#{name}\")\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash_length\n super\n end",
"def default_hash_functio... | [
"0.6394411",
"0.62673795",
"0.61873937",
"0.61873937",
"0.61873937",
"0.61873937",
"0.61873937",
"0.61873937",
"0.61873937",
"0.609414",
"0.6066696",
"0.6030287",
"0.60247064",
"0.6000437",
"0.5975495",
"0.59492004",
"0.5910227",
"0.5891778",
"0.5850345",
"0.58478415",
"0.584... | 0.0 | -1 |
Put "/" at the end of a directory name if it is not already there. N Without this method, we will constantly be testing if directory paths have '/' at the end and adding it if it doesn't | def normalisedDir(baseDir)
return baseDir.end_with?("/") ? baseDir : baseDir + "/"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def format_directory(dir)\n format_dir = dir.strip\n format_dir = \"/#{format_dir}\" unless format_dir.start_with?('/')\n format_dir\nend",
"def build_dir_path(dir_path)\r\n dir_builder = \"\"\r\n dir_path.split(\"/\").each { |dir|\r\n unless Dir.exists?(dir_builder + dir)\r\n Dir.mkdir(dir_... | [
"0.6624387",
"0.661011",
"0.656361",
"0.63372576",
"0.6265527",
"0.6183738",
"0.61595523",
"0.61358327",
"0.60846496",
"0.6037723",
"0.5943778",
"0.59264416",
"0.5878882",
"0.5826261",
"0.5824257",
"0.58223414",
"0.5818853",
"0.5810974",
"0.58080727",
"0.5804661",
"0.5802477"... | 0.61220855 | 8 |
N Without constructor we could not create object with readonly attribute values | def initialize(hashCommand, pathPrefix = "")
#N Without this, would not know the how to execute and parse the result of the hash command
@hashCommand = hashCommand
#N Without this, would not know how to execute 'find' if it's not on the path
@pathPrefix = pathPrefix
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(*args)\n result = super(*args)\n ensure\n readonly! if result\n end",
"def koan_6\n c = Class::new {\n attribute 'a' => 42\n }\n\n o = c::new\n\n assert{ o.a == 42 }\n assert{ o.a? }\n assert{ (o.a = nil) == nil }\n assert{ not o.a? }\nend",
"def immutable\n obj = self.class.c... | [
"0.61288303",
"0.60933834",
"0.6062224",
"0.60028726",
"0.5981488",
"0.5977132",
"0.5973516",
"0.5934166",
"0.59296185",
"0.5836796",
"0.5836796",
"0.5833756",
"0.5830253",
"0.58220136",
"0.58220136",
"0.58220136",
"0.57861567",
"0.576626",
"0.56919235",
"0.56653786",
"0.5664... | 0.0 | -1 |
Generate the find command which will list all the subdirectories of the base directory N Without this, wouldn't know how to execute 'find' command to list all subdirectories of specified directory | def findDirectoriesCommand(baseDir)
#N Without path prefix, wouldn't work if 'find' is not on path, without baseDir, wouldn't know which directory to start, without '-type d' would list more than just directories, without -print, would not print out the values found (or is that the default anyway?)
return ["#{@pathPrefix}find", baseDir, "-type", "d", "-print"]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def findFilesCommand(baseDir)\n #N Without path prefix, wouldn't work if 'find' is not on path, without baseDir, wouldn't know which directory to start, without '-type f' would list more than just directories, without -print, would not print out the values found (or is that the default anyway?)\n return ... | [
"0.63822263",
"0.6259442",
"0.59495145",
"0.5918191",
"0.5823449",
"0.5777494",
"0.57679945",
"0.57384145",
"0.5724316",
"0.5708177",
"0.57043",
"0.5600914",
"0.5598248",
"0.55707324",
"0.5567015",
"0.55295247",
"0.54997355",
"0.54976577",
"0.54235226",
"0.54173493",
"0.54105... | 0.7117432 | 0 |
Return the list of subdirectories relative to the base directory N Without this method, would not be able to list the directories of a base directory, as part of getting the content tree (be it local or remote) | def listDirectories(baseDir)
#N if un-normalised, code assuming '/' at the end might be one-off
baseDir = normalisedDir(baseDir)
#N without the command, we don't know what command to execute to list the directories
command = findDirectoriesCommand(baseDir)
#N without this, the command won't execute, or we it might execute in a way that doesn't let us read the output
output = getCommandOutput(command)
#N without initial directories, we would have nowhere to accumulate the directory relative paths
directories = []
#N without the base dir length, we don't know how much to chop off the path names to get the relative path names
baseDirLen = baseDir.length
#N without this, would not get feedback that we are listing directories (which might be a slow remote command)
puts "Listing directories ..."
#N without looping over the output, we wouldn't be reading the output of the listing command
while (line = output.gets)
#N without chomping, eoln would be included in the directory paths
line = line.chomp
#N without this, would not get feedback about each directory listed
puts " #{line}"
#N without this check, unexpected invalid output not including the base directory would be processed as if nothing had gone wrong
if line.start_with?(baseDir)
#N without this, the directory in this line of output wouldn't be recorded
directories << line[baseDirLen..-1]
else
#N if we don't raise the error, an expected result (probably a sign of some important error) would be ignored
raise "Directory #{line} is not a sub-directory of base directory #{baseDir}"
end
end
#N if we don't close the output, then un-opened output stream objects will accumulate (and leak resources)
output.close()
#N if we don't check the process status, then a failed command will be treated as if it had succeeded (i.e. as if there were no directories found)
checkProcessStatus(command)
return directories
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dir_list(path, bases, paging)\n items = paging[:items]\n page = paging[:page]\n offset = paging[:offset]\n raise 'Disabling paging is not supported for a directory listing' if paging[:disable_paging]\n\n max_items = 1000\n\n child_paths, total = FileSystems::Combined.directory_lis... | [
"0.7064652",
"0.6976425",
"0.679826",
"0.67918026",
"0.6723324",
"0.67213833",
"0.65266395",
"0.6350759",
"0.6289712",
"0.62105185",
"0.6205237",
"0.6143932",
"0.60980284",
"0.6033957",
"0.60284305",
"0.6017417",
"0.5995194",
"0.5980907",
"0.5976133",
"0.5961318",
"0.5927347"... | 0.697383 | 2 |
Generate the find command which will list all the files within the base directory N without this method, we wouldn't know what command to use to list all the files in the base directory | def findFilesCommand(baseDir)
#N Without path prefix, wouldn't work if 'find' is not on path, without baseDir, wouldn't know which directory to start, without '-type f' would list more than just directories, without -print, would not print out the values found (or is that the default anyway?)
return ["#{@pathPrefix}find", baseDir, "-type", "f", "-print"]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_files(base_dir, flags); end",
"def find_files\n find_files_recursive(@build_result_dir, '')\n end",
"def find(dirs); end",
"def findDirectoriesCommand(baseDir)\n #N Without path prefix, wouldn't work if 'find' is not on path, without baseDir, wouldn't know which directory to... | [
"0.6947323",
"0.66125506",
"0.6553254",
"0.65213066",
"0.636708",
"0.6217633",
"0.61417025",
"0.59928054",
"0.5979982",
"0.59361076",
"0.5914705",
"0.57880175",
"0.5741297",
"0.5728098",
"0.5701846",
"0.56588197",
"0.5651589",
"0.5610105",
"0.5595152",
"0.55942845",
"0.558685... | 0.7599086 | 0 |
List file hashes by executing the command to hash each file on the output of the find command which lists all files, and parse the output. N Without this, would not be able to list all the files in the base directory and the hashes of their contents (as part of getting the content tree) | def listFileHashes(baseDir)
#N Un-normalised, an off-by-one error would occur when 'subtracting' the base dir off the full paths to get relative paths
baseDir = normalisedDir(baseDir)
#N Without this, we would have nowhere to accumulate the file hash objects
fileHashes = []
#N Without this, we would not be executing and parsing the results of the file-listing command
listFileHashLines(baseDir) do |fileHashLine|
#N Without this, we would not be parsing the result line containing this file and its hash value
fileHash = self.hashCommand.parseFileHashLine(baseDir, fileHashLine)
#N Without this check we would be accumulating spurious nil values returned from listFileHashLines (even though listFileHashLines doesn't actually do that)
if fileHash != nil
#N Without this, we would fail to include this file & hash in the list of file hashes.
fileHashes << fileHash
end
end
return fileHashes
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listFileHashes\n return contentHost.listFileHashes(baseDir)\n end",
"def listFileHashLines(baseDir)\n #N Without this, the base directory might be missing the final '/', which might cause a one-off error when 'subtracting' the base directory name from the absolute paths to get relative paths\n ... | [
"0.73317564",
"0.6945365",
"0.62079465",
"0.5961802",
"0.5961802",
"0.59590673",
"0.59041077",
"0.5857626",
"0.57781035",
"0.5773977",
"0.5767927",
"0.5757519",
"0.57531357",
"0.5749062",
"0.5730316",
"0.5708884",
"0.56661063",
"0.5659761",
"0.5649932",
"0.56416607",
"0.56304... | 0.6718793 | 2 |
Construct the ContentTree for the given base directory N Without this, wouldn't know how to construct a content tree from a list of relative directory paths and relative file paths with associated hash values | def getContentTree(baseDir)
#N Without this, wouldn't have an empty content tree that we could start filling with dir & file data
contentTree = ContentTree.new()
#N Without this, wouldn't record the time of the content tree, and wouldn't be able to determine from a file's modification time that it had been changed since that content tree was recorded.
contentTree.time = Time.now.utc
#N Without this, the listed directories won't get included in the content tree
for dir in listDirectories(baseDir)
#N Without this, this directory won't get included in the content tree
contentTree.addDir(dir)
end
#N Without this, the listed files and hashes won't get included in the content tree
for fileHash in listFileHashes(baseDir)
#N Without this, this file & hash won't get included in the content tree
contentTree.addFile(fileHash.relativePath, fileHash.hash)
end
return contentTree
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getContentTree\n #N Without this we won't have timestamp and the map of file hashes used to efficiently determine the hash of a file which hasn't been modified after the timestamp\n cachedTimeAndMapOfHashes = getCachedContentTreeMapOfHashes\n #N Without this we won't have the timestamp to compar... | [
"0.6141361",
"0.60677546",
"0.55811995",
"0.5536122",
"0.5411839",
"0.5408992",
"0.53689533",
"0.53160125",
"0.5287648",
"0.52826625",
"0.5224509",
"0.52074564",
"0.5200433",
"0.51936454",
"0.51655424",
"0.51397675",
"0.5049832",
"0.50456506",
"0.5010944",
"0.5000327",
"0.499... | 0.6081249 | 1 |
Execute a (local) command, or, if dryRun, just pretend to execute it. Raise an exception if the process exit status is not 0. N Without this method, wouldn't have an easy way to execute a command, echoing the command before it's executed, and optionally only doing a 'dry run', i.e. not running the command at all. | def executeCommand(command, dryRun)
#N Without this, the command won't be echoed
puts "EXECUTE: #{command}"
#N Without this check, the command will be executed even if it is meant to be a dry run
if not dryRun
#N Without this, the command won't actualy be execute even when it is meant to be run
system(command)
#N Without this check, a failed command will be treated as if it had executed successfully
checkProcessStatus(command)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def executeCommand(command, dryRun)\n #N Without this, the command won't be echoed to the user\n puts \"EXECUTE: #{command}\"\n #N Without this check, the command will be executed, even though it is intended to be a dry run\n if not dryRun\n #N Without this, the command won't be executed... | [
"0.76763886",
"0.71551645",
"0.6957548",
"0.679227",
"0.6657023",
"0.6637209",
"0.65126526",
"0.6484159",
"0.648315",
"0.63907516",
"0.63817585",
"0.63771355",
"0.6376905",
"0.63291615",
"0.63220257",
"0.63069695",
"0.6257568",
"0.62249607",
"0.6215184",
"0.6151733",
"0.61421... | 0.74745876 | 1 |
N Without a base close method, implementations that don't need anything closed will fail when 'close' is called on them. | def close
# by default do nothing - close any cached connections
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close\n # no-op\n end",
"def close\n # NOOP\n end",
"def close\n # NOOP\n end",
"def close\n\t\traise NotImplementedError\n\tend",
"def close?\n fail NotImplementedError\n end",
"def close\n super\n rescue IOError\n # Already closed\n end",
"def close\n... | [
"0.6287926",
"0.6172954",
"0.6172954",
"0.6170204",
"0.6131228",
"0.6066422",
"0.6061416",
"0.60394496",
"0.60394496",
"0.60394496",
"0.6004966",
"0.59934956",
"0.59934956",
"0.59934956",
"0.59934956",
"0.5993111",
"0.5969297",
"0.5947212",
"0.5947212",
"0.59210753",
"0.59110... | 0.0 | -1 |
delete remote directory (if dryRun is false) using "rm r" N Without this method, there won't be any way to delete a directory and it's contents on a remote system | def deleteDirectory(dirPath, dryRun)
#N Without this, the required ssh command to recursive remove a directory won't be (optionally) executed. Without the '-r', the attempt to delete the directory won't be successful.
ssh("rm -r #{dirPath}", dryRun)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rm_r(path)\n cmd 'rm', '-r', path\nend",
"def deleteDirectory(dirPath, dryRun)\n #N Without this, the deletion command won't be run at all\n sshAndScp.deleteDirectory(dirPath, dryRun)\n end",
"def files_remote_remove(options = {})\n post('files.remote.remove', options)\n e... | [
"0.7130752",
"0.6805416",
"0.66199857",
"0.65953046",
"0.65492356",
"0.6544834",
"0.65383387",
"0.652285",
"0.6471513",
"0.64702445",
"0.64633733",
"0.64335304",
"0.64040303",
"0.6390499",
"0.63491863",
"0.6349054",
"0.6345273",
"0.6340789",
"0.63024414",
"0.62994343",
"0.627... | 0.75328726 | 0 |
delete remote file (if dryRun is false) using "rm" N Without this method, there won't be any way to delete a file from the remote system | def deleteFile(filePath, dryRun)
#N Without this, the required ssh command to delete a file won't be (optionally) executed.
ssh("rm #{filePath}", dryRun)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove!\n FileUtils.rm(File.join(remote_path, remote_file))\n end",
"def files_remote_remove(options = {})\n post('files.remote.remove', options)\n end",
"def deleteFile(filePath, dryRun)\n #N Without this, the deletion command won't be run at all\n sshAndScp.delet... | [
"0.75129706",
"0.7461836",
"0.7266126",
"0.7093599",
"0.7048033",
"0.7048033",
"0.69546664",
"0.69349205",
"0.6753107",
"0.67431206",
"0.66946757",
"0.6642938",
"0.6627236",
"0.6626439",
"0.6622883",
"0.660031",
"0.6517856",
"0.64861757",
"0.6485835",
"0.6485835",
"0.64798725... | 0.7606322 | 0 |
N Without this method, we can't get a cached SSH connection (opening a new one if necessary) | def connection
#N Without this check, we would get a new connection even though we already have a new one
if @connection == nil
#N Without this, we don't get feedback about an SSH connection being opened
puts "Opening SSH connection to #{user}@#{host} ..."
#N Without this, we won't actually connect to the SSH host
@connection = Net::SSH.start(host, user)
end
return @connection
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_ssh_connection\n conn = nil\n attempts = 0\n 5.times do |attempt|\n @lock.synchronize do\n if @connection_pool.count > 0\n conn = @connection_pool.shift\n end\n end\n unless conn\n params = {\n :paranoid => false,\n ... | [
"0.7308735",
"0.70887524",
"0.7011901",
"0.6992324",
"0.69500595",
"0.67557055",
"0.6741859",
"0.66920483",
"0.6656344",
"0.66263884",
"0.6623412",
"0.6534857",
"0.65147537",
"0.6505765",
"0.650505",
"0.6498305",
"0.6469774",
"0.6390665",
"0.6361739",
"0.63234186",
"0.6270014... | 0.6975452 | 4 |
N Without this method, we can't get a connection for doing SCP commands (i.e. copying files or directories from local to remote system) | def scpConnection
return connection.scp
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scp_connect\n # Connect to SCP and yield the SCP object\n connect do |connection|\n scp = Net::SCP.new(connection)\n return yield scp\n end\n rescue Net::SCP::Error => e\n # If we get the exit code of 127, then this means SCP is unavailable.\n raise Vag... | [
"0.68333906",
"0.6414909",
"0.64033014",
"0.6350961",
"0.6203266",
"0.6192439",
"0.617495",
"0.61690027",
"0.6163215",
"0.60408545",
"0.6029382",
"0.6021623",
"0.60060203",
"0.6000578",
"0.5997791",
"0.59711623",
"0.5958206",
"0.5952393",
"0.5935774",
"0.59356195",
"0.589367"... | 0.7044333 | 0 |
N Without this we can't close the connection when we have finished with it (so it might "leak") | def close()
#N Without this check, we'll be trying to close the connection even if there isn't one, or it was already closed
if @connection != nil
#N Without this we won't get feedback about the SSH connection being closed
puts "Closing SSH connection to #{user}@#{host} ..."
#N Without this the connection won't actually get closed
@connection.close()
#N Without this we won't know the connection has been closed, because a nil @connection represents "no open connection"
@connection = nil
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close_connection; end",
"def connection_closed\n end",
"def close_connection\n @connection.finish\n end",
"def disconnect; @connection.close end",
"def connection_closed\n close\n end",
"def close\n connection.close if connection\n end",
"def close_connection_after_writing\n\t\t... | [
"0.7510732",
"0.7180008",
"0.7137829",
"0.7107519",
"0.7085904",
"0.7050359",
"0.69946563",
"0.6952209",
"0.69191736",
"0.6900246",
"0.68631774",
"0.6840803",
"0.6840803",
"0.68220145",
"0.67939407",
"0.67939407",
"0.6788303",
"0.67876893",
"0.6725066",
"0.6717042",
"0.670863... | 0.0 | -1 |
execute command on remote host (if dryRun is false), yielding lines of output N Without this method, we can't execute SSH commands on the remote host, echoing the command first, and optionally executing the command (or optionally not executing it and just doing a "dry run") | def ssh(commandString, dryRun)
#N Without this we won't have a description to display (although the value is only used in the next statement)
description = "SSH #{user}@#{host}: executing #{commandString}"
#N Without this the command description won't be echoed
puts description
#N Without this check, the command will execute even when it's only meant to be a dry run
if not dryRun
#N Without this, the command won't execute, and we won't have the output of the command
outputText = connection.exec!(commandString)
#N Without this check, there might be a nil exception, because the result of exec! can be nil(?)
if outputText != nil then
#N Without this, the output text won't be broken into lines
for line in outputText.split("\n") do
#N Without this, the code iterating over the output of ssh won't receive the lines of output
yield line
end
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ssh(commandString, dryRun)\n #N Without this, command being executed won't be echoed to output\n puts \"SSH #{userAtHost} (#{shell.join(\" \")}): executing #{commandString}\"\n #N Without this check, the command will execute even it it's meant to be a dry run\n if not dryRun\n #N Wit... | [
"0.7706527",
"0.7246989",
"0.66088617",
"0.65754145",
"0.64343476",
"0.6330856",
"0.6329962",
"0.6301226",
"0.62073845",
"0.61928236",
"0.61751336",
"0.6160614",
"0.61470526",
"0.61143106",
"0.61039174",
"0.6091824",
"0.60885215",
"0.60855305",
"0.6029195",
"0.6012004",
"0.60... | 0.76521194 | 1 |
copy a local directory to a remote directory (if dryRun is false) N Without this method there won't be an easy way to copy a local directory to a remote directory (optionally doing only a dry run) | def copyLocalToRemoteDirectory(sourcePath, destinationPath, dryRun)
#N Without this there won't be a description of the copy operation that can be displayed to the user as feedback
description = "SCP: copy directory #{sourcePath} to #{user}@#{host}:#{destinationPath}"
#N Without this the user won't see the echoed description
puts description
#N Without this check, the files will be copied even if it is only meant to be a dry run.
if not dryRun
#N Without this, the files won't actually be copied.
scpConnection.upload!(sourcePath, destinationPath, :recursive => true)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copyLocalToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N Without this, the copy command won't be run at all\n sshAndScp.copyLocalToRemoteDirectory(sourcePath, destinationPath, dryRun)\n end",
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N Without t... | [
"0.8446901",
"0.8436639",
"0.82682866",
"0.80182594",
"0.745539",
"0.7195446",
"0.6848897",
"0.6643685",
"0.6643246",
"0.6632449",
"0.6631437",
"0.6595472",
"0.65916073",
"0.65916073",
"0.6571246",
"0.64980274",
"0.6489907",
"0.6474773",
"0.64021623",
"0.64021623",
"0.6401248... | 0.7848379 | 4 |
copy a local file to a remote directory (if dryRun is false) N Without this method there won't be an easy way to copy a single local file to a remove directory (optionally doing only a dry run) | def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)
#N Without this there won't be a description of the copy operation that can be displayed to the user as feedback
description = "SCP: copy file #{sourcePath} to #{user}@#{host}:#{destinationPath}"
#N Without this the user won't see the echoed description
puts description
#N Without this check, the file will be copied even if it is only meant to be a dry run.
if not dryRun
#N Without this, the file won't actually be copied.
scpConnection.upload!(sourcePath, destinationPath)
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N Without this, the copy command won't be run at all\n sshAndScp.copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n end",
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N W... | [
"0.76276386",
"0.7606336",
"0.7373558",
"0.7336695",
"0.7267998",
"0.7042028",
"0.69630325",
"0.696159",
"0.6896305",
"0.6853501",
"0.67238754",
"0.6649978",
"0.65474635",
"0.6505691",
"0.6497019",
"0.6368123",
"0.63333625",
"0.6302963",
"0.6252137",
"0.6243156",
"0.6202148",... | 0.7188568 | 5 |
N Without initialize, we won't be able to construct an SSH/SCP object initialised with readonly attributes representing the SSH shell application and the SCP application. | def initialize(shell, scpProgram)
#N Without this we won't have the remote shell command as an array of executable + arguments
@shell = shell.is_a?(String) ? [shell] : shell
#N Without this we won't have the SCP command as an array of executable + arguments
@scpProgram = scpProgram.is_a?(String) ? [scpProgram] : scpProgram
#N Without this we won't have the SCP command as single string of white-space separated executable + arguments
@scpCommandString = @scpProgram.join(" ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_ssh; end",
"def initialize(userAtHost, hashCommand, sshAndScp = nil)\n #N Without calling super, the hash command won't be configured\n super(hashCommand)\n #N Without this, the SSH & SCP implementation won't be configured\n @sshAndScp = sshAndScp != nil ? sshAndScp : Internal... | [
"0.63484156",
"0.62579525",
"0.58904535",
"0.56857866",
"0.564141",
"0.5612764",
"0.55691224",
"0.5514253",
"0.54923546",
"0.54875916",
"0.5448789",
"0.53873605",
"0.53124034",
"0.5292555",
"0.5263233",
"0.52530557",
"0.5239517",
"0.5230193",
"0.52048624",
"0.5201732",
"0.517... | 0.6842911 | 0 |
execute command on remote host (if dryRun is false), yielding lines of output N Without this, won't be able to execute ssh commands using an external ssh application | def ssh(commandString, dryRun)
#N Without this, command being executed won't be echoed to output
puts "SSH #{userAtHost} (#{shell.join(" ")}): executing #{commandString}"
#N Without this check, the command will execute even it it's meant to be a dry run
if not dryRun
#N Without this, the command won't actually execute and return lines of output
output = getCommandOutput(shell + [userAtHost, commandString])
#N Without this loop, the lines of output won't be processed
while (line = output.gets)
#N Without this, the lines of output won't be passed to callers iterating over this method
yield line.chomp
end
#N Without closing, the process handle will leak resources
output.close()
#N Without a check on status, a failed execution will be treated as a success (yielding however many lines were output before an error occurred)
checkProcessStatus("SSH #{userAtHost} #{commandString}")
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ssh(commandString, dryRun)\n #N Without this we won't have a description to display (although the value is only used in the next statement)\n description = \"SSH #{user}@#{host}: executing #{commandString}\"\n #N Without this the command description won't be echoed\n puts description\n ... | [
"0.7485441",
"0.72331065",
"0.6559856",
"0.6510699",
"0.6482226",
"0.6452301",
"0.644141",
"0.6405239",
"0.6391583",
"0.63715464",
"0.6363025",
"0.63483626",
"0.6316167",
"0.62552166",
"0.6223655",
"0.6214566",
"0.61449265",
"0.6117743",
"0.60976374",
"0.60766476",
"0.6061096... | 0.7549649 | 0 |
copy a local directory to a remote directory (if dryRun is false) N Without this method, a local directory cannot be copied to a remote directory using an external SCP application | def copyLocalToRemoteDirectory(sourcePath, destinationPath, dryRun)
#N Without this, the external SCP application won't actually be run to copy the directory
executeCommand("#{@scpCommandString} -r #{sourcePath} #{userAtHost}:#{destinationPath}", dryRun)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N Without this, the copy command won't be run at all\n sshAndScp.copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n end",
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N W... | [
"0.8529124",
"0.84920573",
"0.8481336",
"0.8209311",
"0.7828138",
"0.7116001",
"0.69933236",
"0.6935151",
"0.68590575",
"0.68590575",
"0.6774887",
"0.6774887",
"0.67535084",
"0.6748667",
"0.67113864",
"0.6676996",
"0.6663779",
"0.6655769",
"0.6624962",
"0.6624124",
"0.6602266... | 0.8691553 | 0 |
copy a local file to a remote directory (if dryRun is false) N Without this method, a local file cannot be copied to a remote directory using an external SCP application | def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)
#N Without this, the external SCP application won't actually be run to copy the file
executeCommand("#{@scpCommandString} #{sourcePath} #{userAtHost}:#{destinationPath}", dryRun)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N Without this, the copy command won't be run at all\n sshAndScp.copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n end",
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N W... | [
"0.816521",
"0.8074268",
"0.8028088",
"0.77565366",
"0.77083254",
"0.76527417",
"0.7611533",
"0.7346336",
"0.71129376",
"0.71005017",
"0.70374",
"0.69821036",
"0.69817716",
"0.6946812",
"0.69423676",
"0.6940771",
"0.69298744",
"0.6915015",
"0.68877095",
"0.68843323",
"0.67827... | 0.85354877 | 0 |
N Without initialize, it won't be possible to construct an object representing a remote host and the means to execute SSH & SCP commands and return hash values of remote file contents (with readonly attributes) | def initialize(userAtHost, hashCommand, sshAndScp = nil)
#N Without calling super, the hash command won't be configured
super(hashCommand)
#N Without this, the SSH & SCP implementation won't be configured
@sshAndScp = sshAndScp != nil ? sshAndScp : InternalSshScp.new()
#N Without this, the SSH & SCP implementation won't be configured with the user/host details to connect to.
@sshAndScp.setUserAtHost(userAtHost)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize_ssh; end",
"def initialize(host, user, comm = nil)\n\n ssh_opts = {\n :port => host.port,\n :config => true,\n :keys => \"~/.ssh/id_rsa\",\n :verbose => :debug,\n :timeout => 20\n #:paranoid => true\n }\n\n ssh_opts.merge!(:password => host.... | [
"0.66841555",
"0.640424",
"0.6091002",
"0.60506135",
"0.5983183",
"0.5975798",
"0.5973566",
"0.59719867",
"0.59036124",
"0.5883768",
"0.58589464",
"0.58589464",
"0.58589464",
"0.58589464",
"0.5791261",
"0.5717099",
"0.5709597",
"0.5641079",
"0.5618762",
"0.5617753",
"0.561261... | 0.5890126 | 9 |
N Without this method, we cannot easily close any cached connections in the SSH & SCP implementation | def closeConnections()
#N Without this, the connections won't be closed
@sshAndScp.close()
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def closeConnections\n #N Without this, cached SSH connections to the remote system won't get closed\n destinationLocation.closeConnections()\n end",
"def closeConnections\n #N Without this the cached connections won't get closed\n @contentHost.closeConnections()\n end",
"def close\n ... | [
"0.7229412",
"0.69069695",
"0.66445017",
"0.6554237",
"0.6432202",
"0.6409133",
"0.6390772",
"0.6328181",
"0.62917966",
"0.625158",
"0.6216336",
"0.6216336",
"0.61963433",
"0.6148562",
"0.61121523",
"0.60858256",
"0.60329705",
"0.6009913",
"0.5998809",
"0.5927027",
"0.5927027... | 0.7248976 | 0 |
Return readable description of base directory on remote system N Without this, we have no easy way to display a description of a directory location on this remote host | def locationDescriptor(baseDir)
#N Without this, the directory being displayed might be missing the final '/'
baseDir = normalisedDir(baseDir)
return "#{userAtHost}:#{baseDir} (connect = #{shell}/#{scpProgram}, hashCommand = #{hashCommand})"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_remote_dir\n return @resource[:remote_dir]\n end",
"def full_path_to_remote_dir\n (remote_dir[0] == ?/ ? remote_dir : \"$(pwd)/#{remote_dir}\").chomp('/')\n end",
"def describe\n\t\t\"Shows the folder and files of the present working directory.\"\n\tend",
"def pathBaseSummary(... | [
"0.66585267",
"0.64245605",
"0.63922226",
"0.634003",
"0.62467635",
"0.6228812",
"0.60992074",
"0.6099058",
"0.60652155",
"0.6019648",
"0.60022634",
"0.59377795",
"0.5921625",
"0.59187955",
"0.5873931",
"0.5818918",
"0.5818918",
"0.5818918",
"0.57985294",
"0.5767316",
"0.5766... | 0.692154 | 0 |
execute an SSH command on the remote system, yielding lines of output (or don't actually execute, if dryRun is false) N Without this method, we won't have an easy way to execute a remote command on the host, echoing the command details first (so that we can see what command is to be executed), and possibly only doing a dry run and not actually executing the command | def ssh(commandString, dryRun = false)
#N Without this, the command won't actually be executed
sshAndScp.ssh(commandString, dryRun) do |line|
#N Without this, this line of output won't be available to the caller
yield line
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ssh(commandString, dryRun)\n #N Without this we won't have a description to display (although the value is only used in the next statement)\n description = \"SSH #{user}@#{host}: executing #{commandString}\"\n #N Without this the command description won't be echoed\n puts description\n ... | [
"0.80623156",
"0.7998833",
"0.72342867",
"0.70143723",
"0.69197494",
"0.6885934",
"0.68766254",
"0.68601596",
"0.6830038",
"0.67334074",
"0.6721422",
"0.66990197",
"0.6686303",
"0.6633429",
"0.662474",
"0.6609969",
"0.6594626",
"0.656683",
"0.65378016",
"0.6530301",
"0.650622... | 0.7554006 | 2 |
delete a remote directory, if dryRun is false N Without this, we won't have an easy way to delete a directory on the remote system, echoing the command used to delete the directory, and optionally only doing a dry run | def deleteDirectory(dirPath, dryRun)
#N Without this, the deletion command won't be run at all
sshAndScp.deleteDirectory(dirPath, dryRun)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deleteDirectory(dirPath, dryRun)\n #N Without this, the required ssh command to recursive remove a directory won't be (optionally) executed. Without the '-r', the attempt to delete the directory won't be successful.\n ssh(\"rm -r #{dirPath}\", dryRun)\n end",
"def deleteFile(filePath, dryRun)\n ... | [
"0.72875273",
"0.60775054",
"0.60387176",
"0.5988651",
"0.594037",
"0.582975",
"0.5825996",
"0.5807917",
"0.5720745",
"0.5713057",
"0.56959915",
"0.56953317",
"0.56894636",
"0.5675578",
"0.56639045",
"0.54741323",
"0.5473462",
"0.54661775",
"0.5463827",
"0.54415953",
"0.54240... | 0.68658614 | 1 |
delete a remote file, if dryRun is false N Without this, we won't have an easy way to delete a file on the remote system, echoing the command used to delete the file, and optionally only doing a dry run | def deleteFile(filePath, dryRun)
#N Without this, the deletion command won't be run at all
sshAndScp.deleteFile(filePath, dryRun)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deleteFile(filePath, dryRun)\n #N Without this, the required ssh command to delete a file won't be (optionally) executed.\n ssh(\"rm #{filePath}\", dryRun)\n end",
"def delete(command)\n pp @client.files.delete(clean_up(command[1]))\n end",
"def remove!\n FileUtils.rm(File.join(remo... | [
"0.7648883",
"0.6528032",
"0.6501078",
"0.63450044",
"0.63450044",
"0.62438625",
"0.6195591",
"0.6190072",
"0.6120277",
"0.6110655",
"0.6108295",
"0.6097406",
"0.60720545",
"0.60720545",
"0.5911697",
"0.590147",
"0.5888189",
"0.57554114",
"0.5752706",
"0.56581146",
"0.5644830... | 0.7520168 | 1 |
copy a local directory to a remote directory, if dryRun is false N Without this, we won't have an easy way to copy a local directory to a directory in the remote system, echoing the command used to copy the directory, and optionally only doing a dry run | def copyLocalToRemoteDirectory(sourcePath, destinationPath, dryRun)
#N Without this, the copy command won't be run at all
sshAndScp.copyLocalToRemoteDirectory(sourcePath, destinationPath, dryRun)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N Without this, the copy command won't be run at all\n sshAndScp.copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n end",
"def copyLocalToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N Witho... | [
"0.7924269",
"0.7891084",
"0.7789641",
"0.75127715",
"0.7503792",
"0.6595715",
"0.65707874",
"0.65075445",
"0.6326693",
"0.63083494",
"0.62250787",
"0.6197228",
"0.6197228",
"0.61680806",
"0.6136275",
"0.6134887",
"0.6109418",
"0.6078698",
"0.60196143",
"0.6013813",
"0.600557... | 0.7968297 | 0 |
copy a local file to a remote directory, if dryRun is false N Without this, we won't have an easy way to copy a local file to a directory in the remote system, echoing the command used to copy the file, and optionally only doing a dry run | def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)
#N Without this, the copy command won't be run at all
sshAndScp.copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)\n #N Without this there won't be a description of the copy operation that can be displayed to the user as feedback\n description = \"SCP: copy file #{sourcePath} to #{user}@#{host}:#{destinationPath}\"\n #N Without this the user... | [
"0.7723254",
"0.7532556",
"0.73338854",
"0.7277002",
"0.7147048",
"0.6654628",
"0.66349113",
"0.65113837",
"0.64394206",
"0.64373875",
"0.63955307",
"0.632376",
"0.62834203",
"0.6182566",
"0.6164122",
"0.61620396",
"0.6141504",
"0.6138029",
"0.61282855",
"0.61193615",
"0.6109... | 0.7578403 | 1 |
Return a list of all subdirectories of the base directory (as paths relative to the base directory) N Without this we won't have a way to list the relative paths of all directories within a particular base directory on the remote system. | def listDirectories(baseDir)
#N Without this, the base directory might be missing the final '/', which might cause a one-off error when 'subtracting' the base directory name from the absolute paths to get relative paths
baseDir = normalisedDir(baseDir)
#N Without this, we won't know that directories are about to be listed
puts "Listing directories ..."
#N Without this, we won't have an empty array ready to accumulate directory relative paths
directories = []
#N Without this, we won't know the length of the base directory to remove from the beginning of the absolute directory paths
baseDirLen = baseDir.length
#N Without this, the directory-listing command won't be executed
ssh(findDirectoriesCommand(baseDir).join(" ")) do |line|
#N Without this, we won't get feedback about which directories were found
puts " #{line}"
#N Without this check, we might ignore an error that somehow resulted in directories being listed that aren't within the specified base directory
if line.start_with?(baseDir)
#N Without this, the relative path of this directory won't be added to the list
directories << line[baseDirLen..-1]
else
#N Without raising this error, an unexpected directory not in the base directory would just be ignored
raise "Directory #{line} is not a sub-directory of base directory #{baseDir}"
end
end
return directories
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listDirectories(baseDir)\n #N if un-normalised, code assuming '/' at the end might be one-off\n baseDir = normalisedDir(baseDir)\n #N without the command, we don't know what command to execute to list the directories\n command = findDirectoriesCommand(baseDir)\n #N without this, the co... | [
"0.71614486",
"0.6702439",
"0.66858256",
"0.65969807",
"0.6452298",
"0.6432997",
"0.6388576",
"0.62940454",
"0.62447226",
"0.61075294",
"0.6099555",
"0.6071435",
"0.59856206",
"0.5985451",
"0.59788847",
"0.59520894",
"0.5933878",
"0.5927118",
"0.5927118",
"0.59236586",
"0.591... | 0.6923882 | 1 |
Yield lines of output from the command to display hash values and file names of all files within the base directory N Without this, where would be no way to list all files in a directory on the remote system and determine the hash of the contents of the file | def listFileHashLines(baseDir)
#N Without this, the base directory might be missing the final '/', which might cause a one-off error when 'subtracting' the base directory name from the absolute paths to get relative paths
baseDir = normalisedDir(baseDir)
#N Without this, we wouldn't know what command to run remotely to loop over the output of the file-files command and run the hash command on each line of output
remoteFileHashLinesCommand = findFilesCommand(baseDir) + ["|", "xargs", "-r"] + @hashCommand.command
#N Without this we wouldn't actually run the command just defined
ssh(remoteFileHashLinesCommand.join(" ")) do |line|
#N Without this the line of output wouldn't be echoed to the user
puts " #{line}"
#N Without this the line of output (with a file name and a hash value) wouldn't be available to the caller of this method
yield line
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listFileHashes\n return contentHost.listFileHashes(baseDir)\n end",
"def listFileHashes(baseDir)\n #N Un-normalised, an off-by-one error would occur when 'subtracting' the base dir off the full paths to get relative paths\n baseDir = normalisedDir(baseDir)\n #N Without this, we would h... | [
"0.6758",
"0.636422",
"0.60122323",
"0.59544075",
"0.5839591",
"0.5820808",
"0.5805336",
"0.57254446",
"0.57254446",
"0.57133675",
"0.5705163",
"0.56717473",
"0.5663655",
"0.56469375",
"0.562107",
"0.5612269",
"0.55898225",
"0.5586432",
"0.5569841",
"0.5569841",
"0.5546227",
... | 0.76697594 | 0 |
List all files within the base directory to stdout N Without this, we wouldn't have a way to list what files are currently in the target directory on the remote host (i.e. if we wanted to see what files where currently there) | def listFiles(baseDir)
#N Without this, the base directory might be missing the final '/', which might cause a one-off error when 'subtracting' the base directory name from the absolute paths to get relative paths
baseDir = normalisedDir(baseDir)
#N Without this we wouldn't be executing the command to list all files in the remote directory
ssh(findFilesCommand(baseDir).join(" ")) do |line|
#N Without this we wouldn't be echoing the file name on this line for the user to read
puts " #{line}"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def listFiles()\n #N Without this the files won't get listed\n contentHost.listFiles(baseDir)\n end",
"def list_files\n [].tap do |files|\n remote_files do |file|\n files << file\n end\n end\n end",
"def list(client, current_path)\n\n\tfiles = Dir.gl... | [
"0.71905494",
"0.6553604",
"0.64859414",
"0.6302285",
"0.6161784",
"0.6137971",
"0.608298",
"0.60754967",
"0.6050267",
"0.5998176",
"0.5972664",
"0.59714186",
"0.5927817",
"0.5909759",
"0.5909759",
"0.59042823",
"0.5853349",
"0.5811345",
"0.578424",
"0.5782921",
"0.57507265",... | 0.74977964 | 0 |
N Without this we can't construct an object representing our initial knowledge of a file that exists (and which we might later decide to mark for copying or for deletion) | def initialize(name, hash, parentPathElements)
#N Without this we won't remember the name of the file
@name = name
#N Without this we won't know the hash of the contents of the file
@hash = hash
#N Without this we won't know the path elements of the sub-directory (within the directory tree) containing the file
@parentPathElements = parentPathElements
#N Without this the file object won't be in a default state of _not_ to be copied
@copyDestination = nil
#N Without this the file object won't be in a default state of _not_ to be deleted
@toBeDeleted = false
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(filename, mode=\"r\", perm=0) end",
"def initialize(file_name)\n create(file_name)\n end",
"def existing_files; end",
"def newobj(type, name, hash)\n transport = Puppet::TransObject.new(name, \"file\")\n transport[:path] = path\n transport[:ensure] = \"file\"\n assert_nothing_r... | [
"0.6378086",
"0.63116616",
"0.62711704",
"0.6256389",
"0.62529093",
"0.622761",
"0.6196516",
"0.6140266",
"0.6137014",
"0.6136738",
"0.6133041",
"0.6133041",
"0.6133041",
"0.6115019",
"0.60814065",
"0.6069924",
"0.6069924",
"0.60565966",
"0.6044891",
"0.6038416",
"0.6000153",... | 0.68079025 | 0 |
Mark this file to be copied to a destination directory (from a destination content tree) N Without this we can't decide to copy a local file to a remote directory | def markToCopy(destinationDirectory)
#N Without this we won't remember that the file is to be copied to the destination directory
@copyDestination = destinationDirectory
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_copied_remote_file(file, copy)\n # the remote has a file that has been copied or moved from copy[file] to file.\n # file is also destination.\n src = copy[file]\n \n # If the user doen't even have the source, then we apparently renamed a directory.\... | [
"0.6833985",
"0.67162126",
"0.6716197",
"0.6524444",
"0.65067613",
"0.6400878",
"0.63855714",
"0.6340511",
"0.626542",
"0.6263418",
"0.62446815",
"0.62236696",
"0.6202445",
"0.6194939",
"0.6185554",
"0.6178778",
"0.61633927",
"0.61369395",
"0.6132378",
"0.6118917",
"0.6107427... | 0.6681991 | 3 |
Mark this file to be deleted N Without this we can't decide to delete a remote file | def markToDelete
#N Without this we won't remember that this file is to be deleted
@toBeDeleted = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(filename); end",
"def update_remotely_deleted(file, node)\n #\n if node != ancestor.file_node(file) && !overwrite?\n if UI.ask(\"local changed #{file} which remote deleted\\n\" +\n \"use (c)hanged version or (d)elete?\") == \"d\"\n ... | [
"0.66196465",
"0.6512705",
"0.6489451",
"0.621683",
"0.61120754",
"0.6106331",
"0.60709137",
"0.60230595",
"0.5995096",
"0.5991736",
"0.59622043",
"0.59556276",
"0.59556276",
"0.593416",
"0.5933601",
"0.59313464",
"0.5926523",
"0.5926523",
"0.5829114",
"0.58247",
"0.5819209",... | 0.71494764 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.