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 |
|---|---|---|---|---|---|---|
The external encoding for standard input. | def encoding
@stdin.external_encoding
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @io.external_encoding\n end",
"def encoding\n @io.external_encoding\n end",
"def external_e... | [
"0.8817308",
"0.8817308",
"0.8817308",
"0.7801851",
"0.7801851",
"0.75976175",
"0.7445937",
"0.74431443",
"0.7262264",
"0.70237064",
"0.70237064",
"0.6949471",
"0.67953056",
"0.67772",
"0.6755564",
"0.6755564",
"0.6755564",
"0.6755564",
"0.6755564",
"0.6755564",
"0.6755564",
... | 0.884759 | 3 |
Creates a new input method object | def initialize(file)
super
@io = IRB::MagicFile.open(file)
@external_encoding = @io.external_encoding
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def input(*args)\n self::Input.new(*args)\n end",
"def _input(*a)\n Input.new(self, *a)\n end",
"def input\n @input ||= Input.new\n end",
"def new\n @first_input = FirstInput.new\n end",
"def initialize(input)\n @input = input\n end",
"def initialize(input)\n @input... | [
"0.70449436",
"0.69880927",
"0.66705793",
"0.6561114",
"0.65194345",
"0.6385082",
"0.6385082",
"0.6385082",
"0.632922",
"0.62296593",
"0.62069035",
"0.62069035",
"0.62028044",
"0.61985064",
"0.61875707",
"0.61875707",
"0.61875707",
"0.61349845",
"0.6130233",
"0.61100143",
"0.... | 0.0 | -1 |
Whether the end of this input method has been reached, returns +true+ if there is no more data to read. See IOeof? for more information. | def eof?
@io.closed? || @io.eof?
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eof?\n @input.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n if @buffer.size > 0\n false\n else\n @io.eof?\n end\n end",
"def eof?\n @stdin.eof?\n end",
"... | [
"0.8428176",
"0.8327931",
"0.8327931",
"0.8327931",
"0.83195615",
"0.82551247",
"0.82551247",
"0.82551247",
"0.82350457",
"0.8093757",
"0.80902207",
"0.8055823",
"0.8055823",
"0.8013636",
"0.8013636",
"0.8013636",
"0.80133796",
"0.80133796",
"0.80133796",
"0.7958979",
"0.7954... | 0.80559486 | 11 |
Reads the next line from this input method. See IOgets for more information. | def gets
print @prompt
@io.gets
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def readline\n @handle.gets\n end",
"def next_line\n $stdin.tty? ?\n Readline.readline('> ', true) :\n $stdin.gets\n end",
"def next_line\n return nil if @input.eof?\n line, ch, @pos, @line_no = '', '', 0, @line_no + 1\n until ch == \"\\r\" || ch == \"\\n\" || c... | [
"0.780316",
"0.7783962",
"0.75837356",
"0.75026417",
"0.73918134",
"0.7364275",
"0.7219437",
"0.7180387",
"0.70494616",
"0.70401937",
"0.6948011",
"0.6859545",
"0.6809955",
"0.67550033",
"0.6743591",
"0.6693659",
"0.66171867",
"0.656309",
"0.65275556",
"0.64980316",
"0.649615... | 0.0 | -1 |
The external encoding for standard input. | def encoding
@external_encoding
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n ... | [
"0.884759",
"0.884759",
"0.884759",
"0.884759",
"0.884759",
"0.8817308",
"0.8817308",
"0.8817308",
"0.7801851",
"0.7801851",
"0.75976175",
"0.74431443",
"0.7262264",
"0.70237064",
"0.70237064",
"0.6949471",
"0.67953056",
"0.67772",
"0.6755564",
"0.6755564",
"0.6755564",
"0.... | 0.7445937 | 11 |
Creates a new input method object using Readline | def initialize
self.class.initialize_readline
if Readline.respond_to?(:encoding_system_needs)
IRB.__send__(:set_encoding, Readline.encoding_system_needs.name, override: false)
end
super
@line_no = 0
@line = []
@eof = false
@stdin = IO.open(STDI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_input; end",
"def read_input\n end",
"def input\n @input ||= STDIN.readlines\nend",
"def input(*args)\n self::Input.new(*args)\n end",
"def initialize\n @input = STDIN.readlines.join\n @input.strip!\n end",
"def initialize(input)\n @user_input = input\n end",
"... | [
"0.67063016",
"0.66345",
"0.651094",
"0.64850616",
"0.6477843",
"0.6379598",
"0.6348295",
"0.62869865",
"0.6261005",
"0.62240446",
"0.61513317",
"0.61513317",
"0.61513317",
"0.6127269",
"0.6127269",
"0.6127269",
"0.6127269",
"0.6127269",
"0.60913634",
"0.6031691",
"0.60170746... | 0.61173236 | 18 |
Reads the next line from this input method. See IOgets for more information. | def gets
Readline.input = @stdin
Readline.output = @stdout
if l = readline(@prompt, false)
HISTORY.push(l) if !l.empty?
@line[@line_no += 1] = l + "\n"
else
@eof = true
l
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def readline\n @handle.gets\n end",
"def next_line\n $stdin.tty? ?\n Readline.readline('> ', true) :\n $stdin.gets\n end",
"def next_line\n return nil if @input.eof?\n line, ch, @pos, @line_no = '', '', 0, @line_no + 1\n until ch == \"\\r\" || ch == \"\\n\" || c... | [
"0.78057957",
"0.7783704",
"0.75825244",
"0.7502848",
"0.7392771",
"0.73623085",
"0.7216161",
"0.71780384",
"0.70475715",
"0.7040226",
"0.6948474",
"0.6858508",
"0.68097866",
"0.6753403",
"0.6743692",
"0.6691443",
"0.6618903",
"0.65607995",
"0.65258086",
"0.64976496",
"0.6497... | 0.5873486 | 56 |
Whether the end of this input method has been reached, returns +true+ if there is no more data to read. See IOeof? for more information. | def eof?
@eof
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eof?\n @input.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n if @buffer.size > 0\n false\n else\n @io.eof?\n end\n end",
"def eof?\n @stdin.eof?\n end",
"... | [
"0.84289277",
"0.83289754",
"0.83289754",
"0.83289754",
"0.83202326",
"0.82557166",
"0.82557166",
"0.82557166",
"0.82359946",
"0.80939215",
"0.8090698",
"0.80573064",
"0.80573064",
"0.80572337",
"0.80148035",
"0.80148035",
"0.80148035",
"0.79590636",
"0.7955267",
"0.79542494",
... | 0.8014555 | 19 |
Whether this input method is still readable when there is no more data to read. See IOeof for more information. | def readable_after_eof?
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def readable_after_eof?\n false\n end",
"def readable_after_eof?\n false\n end",
"def readable_after_eof?\n true\n end",
"def readable_after_eof?\n true\n end",
"def readable_after_eof?\n true\n end",
"def readable_after_eof?\n true\n end",
"def readable_... | [
"0.8101688",
"0.8101688",
"0.78530055",
"0.78530055",
"0.78530055",
"0.78530055",
"0.78530055",
"0.77030784",
"0.7504637",
"0.7446381",
"0.72414696",
"0.71988434",
"0.7187068",
"0.71612906",
"0.71453553",
"0.70650727",
"0.7054687",
"0.7054687",
"0.7050462",
"0.7050351",
"0.70... | 0.79366976 | 4 |
Returns the current line number for io. line counts the number of times gets is called. See IOlineno for more information. | def line(line_no)
@line[line_no]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lineno\n @__line\n end",
"def line_number(pos=pos())\n line_index(pos) + 1\n end",
"def line_number(pos=pos)\n line_index(pos) + 1\n end",
"def line_number\n\t\t\t@line_index + 1\n\t\tend",
"def lineno\n @_st_lineno\n end",
"def linenumber\n return @cmd.nil? ? 0 :... | [
"0.77956223",
"0.75462675",
"0.7489332",
"0.7474644",
"0.7408547",
"0.7389007",
"0.7375559",
"0.7337328",
"0.7319706",
"0.72941047",
"0.7248679",
"0.72156656",
"0.7192943",
"0.71361876",
"0.71361876",
"0.7135818",
"0.7134504",
"0.71038955",
"0.71038955",
"0.71038955",
"0.7059... | 0.0 | -1 |
The external encoding for standard input. | def encoding
@stdin.external_encoding
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n ... | [
"0.8846827",
"0.8846827",
"0.8846827",
"0.8846827",
"0.8846827",
"0.7802193",
"0.7802193",
"0.75972736",
"0.74464196",
"0.74434274",
"0.7262075",
"0.7025114",
"0.7025114",
"0.69503665",
"0.67964894",
"0.6778243",
"0.6758498",
"0.6758498",
"0.6758498",
"0.6758498",
"0.6758498"... | 0.8816693 | 7 |
Creates a new input method object using Reline | def initialize
IRB.__send__(:set_encoding, Reline.encoding_system_needs.name, override: false)
super
@line_no = 0
@line = []
@eof = false
@stdin = ::IO.open(STDIN.to_i, :external_encoding => IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => "-")
@stdout = ::IO.open(STDOU... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_method_from_expressions; end",
"def new\n\t\t@research_method = ResearchMethod.new\n\tend",
"def create_input_edge_method(method_id, carrier_name, side, method)\n if /^(.*)_(constant|share|inversedflexible|flexible)$/.match?(carrier_name)\n carrier_name, edge_type =\n ... | [
"0.62126464",
"0.6048186",
"0.5945292",
"0.5859749",
"0.5839089",
"0.5817271",
"0.5556731",
"0.55276453",
"0.5508858",
"0.5482882",
"0.54485536",
"0.5428401",
"0.5418186",
"0.53827727",
"0.53519464",
"0.5348892",
"0.5348892",
"0.5348892",
"0.5348892",
"0.5348892",
"0.5348892"... | 0.0 | -1 |
Reads the next line from this input method. See IOgets for more information. | def gets
Reline.input = @stdin
Reline.output = @stdout
Reline.prompt_proc = @prompt_proc
Reline.auto_indent_proc = @auto_indent_proc if @auto_indent_proc
if l = readmultiline(@prompt, false, &@check_termination_proc)
HISTORY.push(l) if !l.empty?
@line[@line_no += 1] = l + "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def readline\n @handle.gets\n end",
"def next_line\n $stdin.tty? ?\n Readline.readline('> ', true) :\n $stdin.gets\n end",
"def next_line\n return nil if @input.eof?\n line, ch, @pos, @line_no = '', '', 0, @line_no + 1\n until ch == \"\\r\" || ch == \"\\n\" || c... | [
"0.7804162",
"0.7784264",
"0.75842696",
"0.7501555",
"0.73926586",
"0.73627335",
"0.72175115",
"0.7178649",
"0.7049941",
"0.7039928",
"0.694934",
"0.6858305",
"0.6810599",
"0.67554563",
"0.67433083",
"0.6692614",
"0.6619185",
"0.65622807",
"0.6527588",
"0.6497652",
"0.6497479... | 0.60883117 | 46 |
Whether the end of this input method has been reached, returns +true+ if there is no more data to read. See IOeof? for more information. | def eof?
@eof
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eof?\n @input.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n @io.eof?\n end",
"def eof?\n if @buffer.size > 0\n false\n else\n @io.eof?\n end\n end",
"def eof?\n @stdin.eof?\n end",
"... | [
"0.8427554",
"0.83269066",
"0.83269066",
"0.83269066",
"0.8319218",
"0.825478",
"0.825478",
"0.825478",
"0.82337767",
"0.8093038",
"0.8089921",
"0.80557567",
"0.80557567",
"0.8055129",
"0.80124694",
"0.80124694",
"0.80124694",
"0.7959204",
"0.795454",
"0.79535663",
"0.7923975... | 0.80127895 | 16 |
Whether this input method is still readable when there is no more data to read. See IOeof for more information. | def readable_after_eof?
true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def readable_after_eof?\n false\n end",
"def readable_after_eof?\n false\n end",
"def readable_after_eof?\n true\n end",
"def readable_after_eof?\n true\n end",
"def readable_after_eof?\n true\n end",
"def read?\n !@read.nil?\n end",
"... | [
"0.81007844",
"0.81007844",
"0.79353905",
"0.79353905",
"0.79353905",
"0.7701659",
"0.75033706",
"0.7445043",
"0.72401077",
"0.71984696",
"0.7185892",
"0.7160068",
"0.7144063",
"0.70658004",
"0.70542705",
"0.70542705",
"0.70508385",
"0.70489913",
"0.7042181",
"0.7042181",
"0.... | 0.78516805 | 9 |
Returns the current line number for io. line counts the number of times gets is called. See IOlineno for more information. | def line(line_no)
@line[line_no]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lineno\n @__line\n end",
"def line_number(pos=pos())\n line_index(pos) + 1\n end",
"def line_number(pos=pos)\n line_index(pos) + 1\n end",
"def line_number\n\t\t\t@line_index + 1\n\t\tend",
"def lineno\n @_st_lineno\n end",
"def linenumber\n return @cmd.nil? ? 0 :... | [
"0.77966374",
"0.7547844",
"0.74908954",
"0.74756074",
"0.7408915",
"0.73889834",
"0.7375762",
"0.73385555",
"0.73202735",
"0.72944635",
"0.7249864",
"0.72158384",
"0.71936166",
"0.7136799",
"0.7136799",
"0.7136406",
"0.71351844",
"0.71045375",
"0.71045375",
"0.71045375",
"0.... | 0.0 | -1 |
The external encoding for standard input. | def encoding
@stdin.external_encoding
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @stdin.external_encoding\n end",
"def encoding\n @io.external_encoding\n end",
"def encoding\n @io.external_encoding\n end",
"def external_e... | [
"0.8817308",
"0.8817308",
"0.8817308",
"0.7801851",
"0.7801851",
"0.75976175",
"0.7445937",
"0.74431443",
"0.7262264",
"0.70237064",
"0.70237064",
"0.6949471",
"0.67953056",
"0.67772",
"0.6755564",
"0.6755564",
"0.6755564",
"0.6755564",
"0.6755564",
"0.6755564",
"0.6755564",
... | 0.884759 | 4 |
Prints the given +opts+, with a newline delimiter. | def printn(*opts)
print opts.join(" "), "\n"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(opts = {})\n @opts =\n {\n :print_lines => false\n }.merge!(opts)\n end",
"def print(*args,**opts)\n stdout = opts.fetch(:out, $stdout)\n t = args.map{|a|apply(a)}\n stdout.print *t\n end",
"def print_opts()\n puts \"--- Opt... | [
"0.6344621",
"0.6303781",
"0.62991196",
"0.5942267",
"0.59101385",
"0.5892295",
"0.569206",
"0.5650236",
"0.56147015",
"0.56147015",
"0.56029505",
"0.55879724",
"0.5488975",
"0.54521996",
"0.54498726",
"0.54415673",
"0.542959",
"0.54225785",
"0.5415064",
"0.54094833",
"0.5386... | 0.79820824 | 0 |
Extends IOprintf to format the given +opts+ for Kernelsprintf using parse_printf_format | def printf(format, *opts)
if /(%*)%I/ =~ format
format, opts = parse_printf_format(format, opts)
end
print sprintf(format, *opts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_printf_format(format, opts)\n return format, opts if $1.size % 2 == 1\n end",
"def sprintf(fmt, *rest) end",
"def format(fmt, *rest) end",
"def printf(fmt, *rest) end",
"def printf(fmt, *rest) end",
"def printf(fmt, *rest) end",
"def printf(fmt, *rest) end",
"def printf(format_strin... | [
"0.68474925",
"0.6380309",
"0.6146492",
"0.59645337",
"0.59645337",
"0.59645337",
"0.59645337",
"0.5878174",
"0.5780087",
"0.57395184",
"0.5609937",
"0.5609937",
"0.5609937",
"0.5609937",
"0.5581299",
"0.55571175",
"0.5396682",
"0.5347613",
"0.53207165",
"0.5295359",
"0.52836... | 0.7114762 | 0 |
Returns an array of the given +format+ and +opts+ to be used by Kernelsprintf, if there was a successful Regexp match in the given +format+ from printf % [0 +] (\|\[19][09]\$|[19][09]) .(\|\[19][09]\$|[19][09]|)? (hh|h|l|ll|L|q|j|z|t) [diouxXeEfgGcsb%] | def parse_printf_format(format, opts)
return format, opts if $1.size % 2 == 1
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def printf(format, *opts)\n if /(%*)%I/ =~ format\n format, opts = parse_printf_format(format, opts)\n end\n print sprintf(format, *opts)\n end",
"def allowed_format(fmt = nil, note = nil, only:)\n fmt, note = [nil, fmt] if fmt.is_a?(String)\n only = Array.wrap(only).compact\n o... | [
"0.60263985",
"0.58380556",
"0.5728899",
"0.56607217",
"0.56515706",
"0.56515706",
"0.5555781",
"0.55475587",
"0.5532034",
"0.5483668",
"0.5474114",
"0.54508495",
"0.5374352",
"0.5344861",
"0.53354216",
"0.53250504",
"0.5301101",
"0.52595454",
"0.5225323",
"0.52077794",
"0.52... | 0.6992713 | 0 |
Calls print on each element in the given +objs+, followed by a newline character. | def puts(*objs)
for obj in objs
print(*obj)
print "\n"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def puts(*objs)\n return write(context.newline) if objs.empty?\n\n objs = *objs.flatten\n s = +''\n objs.map(&:to_s).each do |elem|\n s << elem\n s << context.newline unless elem.end_with?(context.newline)\n end\n write(s)\n end",
"def pp(*objs)\n ... | [
"0.7898649",
"0.75673026",
"0.71446586",
"0.6992259",
"0.69613147",
"0.6738374",
"0.66801256",
"0.661324",
"0.6592417",
"0.6592417",
"0.6491205",
"0.63824415",
"0.6356001",
"0.62937653",
"0.61699086",
"0.60391945",
"0.59859556",
"0.5952025",
"0.58980805",
"0.58681256",
"0.583... | 0.8616924 | 0 |
Prints the given +objs+ calling Objectinspect on each. See puts for more detail. | def pp(*objs)
puts(*objs.collect{|obj| obj.inspect})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def puts(*objs)\n for obj in objs\n print(*obj)\n print \"\\n\"\n end\n end",
"def puts(*objs)\n return write(context.newline) if objs.empty?\n\n objs = *objs.flatten\n s = +''\n objs.map(&:to_s).each do |elem|\n s << elem\n s << context.ne... | [
"0.83240634",
"0.7212446",
"0.6956892",
"0.65920657",
"0.65920657",
"0.64967513",
"0.6441386",
"0.64334196",
"0.6349748",
"0.6207696",
"0.6166113",
"0.6029335",
"0.6004935",
"0.60001284",
"0.5946222",
"0.5869241",
"0.5798377",
"0.5761712",
"0.57060796",
"0.5691311",
"0.565135... | 0.77366614 | 1 |
Prints the given +objs+ calling Objectinspect on each and appending the given +prefix+. See puts for more detail. | def ppx(prefix, *objs)
puts(*objs.collect{|obj| prefix+obj.inspect})
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def puts(*objs)\n for obj in objs\n print(*obj)\n print \"\\n\"\n end\n end",
"def pp(*objs)\n puts(*objs.collect{|obj| obj.inspect})\n end",
"def puts(*objs)\n return write(context.newline) if objs.empty?\n\n objs = *objs.flatten\n s = +''\n objs.... | [
"0.71974975",
"0.68412244",
"0.63762224",
"0.6234265",
"0.6157207",
"0.6036326",
"0.6036326",
"0.58761275",
"0.58487254",
"0.5754771",
"0.57532984",
"0.5723562",
"0.56557083",
"0.56454515",
"0.5624654",
"0.5623074",
"0.5539539",
"0.55071235",
"0.5438358",
"0.54330343",
"0.543... | 0.7624624 | 0 |
The toplevel workspace, see WorkSpacemain | def main
@workspace.main
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toplevel; end",
"def public_workspace\n Figgy.config[\"geoserver\"][\"open\"][\"workspace\"]\n end",
"def workspace\n @cue_list.workspace\n end",
"def workspace_info\n link_to_workspace_info(\"http://library.nyu.edu/info/myworkspace.html\", \"left\")\n end",
"def workspace\n... | [
"0.6891507",
"0.6690521",
"0.66089714",
"0.65461403",
"0.6531998",
"0.64596945",
"0.6444638",
"0.6329674",
"0.6287822",
"0.6275994",
"0.62082875",
"0.6186856",
"0.616939",
"0.6141006",
"0.6094769",
"0.60916764",
"0.6042505",
"0.60285264",
"0.5921637",
"0.589369",
"0.586893",
... | 0.7674652 | 0 |
Returns whether messages are displayed or not. | def verbose?
if @verbose.nil?
if @io.kind_of?(ReidlineInputMethod)
false
elsif defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)
false
elsif !STDIN.tty? or @io.kind_of?(FileInputMethod)
true
else
false
end
else
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_messages?\n\t\t\treturn !(messages.empty?)\n\t\tend",
"def message_rendered?\n @_message_rendered\n end",
"def update_message?\r\n # If message window is showing\r\n return $game_temp.message_window_showing\r\n end",
"def message_window_showing\n if Input.timed_permanent? and $scene... | [
"0.7388131",
"0.7340042",
"0.7298194",
"0.71088487",
"0.7095314",
"0.707982",
"0.70250434",
"0.68454355",
"0.6649681",
"0.6631958",
"0.65693194",
"0.6502229",
"0.6487316",
"0.6487316",
"0.64564574",
"0.6444761",
"0.64337456",
"0.6403722",
"0.6390247",
"0.6357578",
"0.63518935... | 0.0 | -1 |
Whether verbose? is +true+, and +input_method+ is either StdioInputMethod or ReidlineInputMethod or ReadlineInputMethod, see io for more information. | def prompting?
verbose? || (STDIN.tty? && @io.kind_of?(StdioInputMethod) ||
@io.kind_of?(ReidlineInputMethod) ||
(defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def verbose?\n if @verbose.nil?\n if @io.kind_of?(ReidlineInputMethod)\n false\n elsif defined?(ReadlineInputMethod) && @io.kind_of?(ReadlineInputMethod)\n false\n elsif !STDIN.tty? or @io.kind_of?(FileInputMethod)\n true\n else\n false\n ... | [
"0.7967623",
"0.636563",
"0.56455976",
"0.53180104",
"0.52041876",
"0.5141627",
"0.5119377",
"0.5096624",
"0.5096624",
"0.5056806",
"0.50563765",
"0.50456756",
"0.50370824",
"0.5028059",
"0.5006037",
"0.5006037",
"0.500344",
"0.49696714",
"0.4967457",
"0.4965623",
"0.495978",... | 0.696972 | 1 |
Sets the return value from the last statement evaluated in this context to last_value. | def set_last_value(value)
@last_value = value
@workspace.local_variable_set :_, value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def last_value exp\n case exp.node_type\n when :rlist, :block, :scope, Sexp\n last_value exp.last\n when :if\n then_clause = exp.then_clause\n else_clause = exp.else_clause\n\n if then_clause.nil? and else_clause.nil?\n nil\n elsif then_clause.nil?\n last_value else_... | [
"0.63585335",
"0.6215452",
"0.6135892",
"0.6100538",
"0.6026475",
"0.6013461",
"0.6003413",
"0.5893197",
"0.588336",
"0.5793061",
"0.5786494",
"0.57807404",
"0.56522787",
"0.564574",
"0.564574",
"0.564574",
"0.56188464",
"0.5606783",
"0.55534464",
"0.55336326",
"0.5530294",
... | 0.74925685 | 0 |
Sets the +mode+ of the prompt in this context. | def prompt_mode=(mode)
@prompt_mode = mode
pconf = IRB.conf[:PROMPT][mode]
@prompt_i = pconf[:PROMPT_I]
@prompt_s = pconf[:PROMPT_S]
@prompt_c = pconf[:PROMPT_C]
@prompt_n = pconf[:PROMPT_N]
@return_format = pconf[:RETURN]
@return_format = "%s\n" if @return_format == nil
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_mode(m)\n @mode = m\n end",
"def mode=(mode)\n @mode = mode ? mode.to_sym : nil\n end",
"def set_mode(new)\n @mode = new\n end",
"def select_mode\n @new_prompt.mode\n puts ''\n begin\n @mode = gets.chomp.upcase\n handle_mode\n rescue StandardE... | [
"0.72319686",
"0.71740407",
"0.7151668",
"0.7137655",
"0.70825267",
"0.6848388",
"0.67740345",
"0.67713815",
"0.6742702",
"0.6693638",
"0.6684703",
"0.6684703",
"0.66430706",
"0.66229826",
"0.6595854",
"0.6556016",
"0.6536894",
"0.6524771",
"0.6484622",
"0.6434663",
"0.637277... | 0.8100633 | 0 |
Whether inspect_mode is set or not, see inspect_mode= for more detail. | def inspect?
@inspect_mode.nil? or @inspect_mode
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inspect?\n @inspect\n end",
"def debug_mode\n @@debug_mode == 1\n end",
"def inspect_mode=(opt)\n\n if i = Inspector::INSPECTORS[opt]\n @inspect_mode = opt\n @inspect_method = i\n i.init\n else\n case opt\n when nil\n if Inspector.keys_with_... | [
"0.6942217",
"0.69066197",
"0.68846565",
"0.681688",
"0.67059463",
"0.6695927",
"0.6517685",
"0.6418847",
"0.640383",
"0.6380086",
"0.6346997",
"0.62981796",
"0.6209343",
"0.6198695",
"0.61504334",
"0.61139864",
"0.60989326",
"0.6093298",
"0.6062764",
"0.60551417",
"0.5990565... | 0.8537229 | 0 |
Whether io uses a File for the +input_method+ passed when creating the current context, see ::new | def file_input?
@io.class == FileInputMethod
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def open_file(io)\n io.kind_of?(File) ? io : File.open(io)\n end",
"def file_input(method, options)\n basic_input_helper(:file_field, :file, method, options)\n end",
"def file_input(method, options)\n basic_input_helper(:file_field, :file, method, options)\n end",
"def open(io... | [
"0.71813285",
"0.66308916",
"0.6626372",
"0.65747577",
"0.63129467",
"0.63129467",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6283772",
"0.6238046",
"0.62270135",
"0.6214254",
"0.6197808... | 0.68626934 | 1 |
Specifies the inspect mode with +opt+: +true+:: display +inspect+ +false+:: display +to_s+ +nil+:: inspect mode in nonmath mode, noninspect mode in math mode See IRB::Inspector for more information. Can also be set using the +inspect+ and +noinspect+ command line options. | def inspect_mode=(opt)
if i = Inspector::INSPECTORS[opt]
@inspect_mode = opt
@inspect_method = i
i.init
else
case opt
when nil
if Inspector.keys_with_inspector(Inspector::INSPECTORS[true]).include?(@inspect_mode)
self.inspect_mode = false
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def inspect?\n @inspect_mode.nil? or @inspect_mode\n end",
"def make_inspect **options\n\n\t\t::Xqsr3::Diagnostics::InspectBuilder.make_inspect self, **options\n\tend",
"def inspect(options={})\n \"(TODO: def #{self.class}#inspect(options={}))\"\n end",
"def set_inspect_mode(mode:, highlight_conf... | [
"0.6601137",
"0.6554633",
"0.6191946",
"0.59750205",
"0.5694081",
"0.54926",
"0.5483841",
"0.54596716",
"0.5340464",
"0.5279585",
"0.52700627",
"0.513733",
"0.50568175",
"0.5051242",
"0.5051242",
"0.50298077",
"0.49902204",
"0.49863142",
"0.49564078",
"0.49416393",
"0.4927381... | 0.79444605 | 0 |
Exits the current session, see IRB.irb_exit | def exit(ret = 0)
IRB.irb_exit(@irb, ret)
rescue UncaughtThrowError
super
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exit\n send_cmd \"exit\"\n nil\n end",
"def exit() end",
"def exit\n\t\tquit\n\tend",
"def exit!() end",
"def irb_exit(ret = 0)\n irb_context.exit(ret)\n end",
"def exit_program\n exit\n end",
"def exit_program\n exit\n end",
"def quit!\n quit\n exit!\n end... | [
"0.7573318",
"0.7437869",
"0.7419721",
"0.7376362",
"0.73200816",
"0.72004056",
"0.7133528",
"0.71272343",
"0.71118474",
"0.7084229",
"0.70698375",
"0.69515437",
"0.6938874",
"0.69269663",
"0.69220823",
"0.6911623",
"0.6901948",
"0.6901948",
"0.68964034",
"0.68849283",
"0.687... | 0.6748435 | 22 |
Quits the current irb context +ret+ is the optional signal or message to send to Contextexit Same as IRB.CurrentContext.exit. | def irb_exit(ret = 0)
irb_context.exit(ret)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def exit(ret = 0)\n IRB.irb_exit(@irb, ret)\n rescue UncaughtThrowError\n super\n end",
"def exit\n send_cmd \"exit\"\n nil\n end",
"def exit(ret)\n @exit_status = ret\n if defined? Rbkb::Cli::TESTING\n throw(((ret==0)? :exit_zero : :exit_err), ret)\n else\n ... | [
"0.71357155",
"0.65882653",
"0.64003766",
"0.63990945",
"0.63695574",
"0.6345361",
"0.63366073",
"0.63013744",
"0.62537086",
"0.62364894",
"0.62340593",
"0.6185955",
"0.6184603",
"0.6165907",
"0.61485213",
"0.6100929",
"0.6069752",
"0.60662866",
"0.6065977",
"0.60404325",
"0.... | 0.7643645 | 0 |
Displays current configuration. Modifying the configuration is achieved by sending a message to IRB.conf. | def irb_context
IRB.CurrentContext
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def do_print_configuration\n frame('Configuration') do\n fade_code = CLI::UI::Color.new(90, '').code\n puts stylize(\"{{?}} #{fade_code}Values starting with {{*}} #{fade_code}were lazy loaded.#{CLI::UI::Color::RESET.code}\")\n print \"\\n\"\n\n configuration.instance_vari... | [
"0.6814462",
"0.6590233",
"0.6579158",
"0.65616137",
"0.65054834",
"0.6504763",
"0.63323045",
"0.6290371",
"0.6188783",
"0.61801267",
"0.61556107",
"0.615221",
"0.60870945",
"0.60520524",
"0.600979",
"0.6009647",
"0.59663683",
"0.59352624",
"0.5908562",
"0.58831817",
"0.58692... | 0.0 | -1 |
Installs alias methods for the default irb commands, see ::install_extend_commands. | def install_alias_method(to, from, override = NO_OVERRIDE)
to = to.id2name unless to.kind_of?(String)
from = from.id2name unless from.kind_of?(String)
if override == OVERRIDE_ALL or
(override == OVERRIDE_PRIVATE_ONLY) && !respond_to?(to) or
(override == NO_OVERRIDE) && !respond_t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def script_aliases\n end",
"def method_missing(symbol, *args)\n #$stdout.puts(\"method_missing: #{symbol}\")\n self.ext_aliases.aliases[symbol.to_s]\n end",
"def install_commands\n raise 'Concrete installers implement this to specify commands to run to install their respective packages'\n ... | [
"0.65214",
"0.6507829",
"0.6476352",
"0.6474487",
"0.64515984",
"0.6443923",
"0.64177006",
"0.6369947",
"0.6369947",
"0.6316247",
"0.6142845",
"0.60254514",
"0.6023125",
"0.5997739",
"0.59768",
"0.5963815",
"0.5948856",
"0.5917871",
"0.5917517",
"0.5913833",
"0.589556",
"0.... | 0.6112485 | 11 |
Extends the given +base_method+ with a postfix call to the given +extend_method+. | def def_post_proc(base_method, extend_method)
base_method = base_method.to_s
extend_method = extend_method.to_s
alias_name = new_alias_name(base_method)
module_eval %[
alias_method alias_name, base_method
def #{base_method}(*opts)
__send__ :#{alias_name}, *opts
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def phi_wrap_extension(method_name)\n raise NameError, \"Undefined relationship in `extend_phi_access`: #{method_name}\" unless respond_to?(method_name)\n return if self.class.__phi_methods_to_extend.include? method_name\n\n wrapped_method = wrapped_extended_name(method_name)\n unwrapped_method... | [
"0.58763176",
"0.5423875",
"0.5391288",
"0.532385",
"0.529954",
"0.5292827",
"0.5243378",
"0.5223182",
"0.5214091",
"0.52140725",
"0.51413316",
"0.5125327",
"0.51218885",
"0.51098114",
"0.5108154",
"0.50834715",
"0.5067666",
"0.50663394",
"0.50179684",
"0.49920002",
"0.496992... | 0.7169063 | 0 |
If `complete` is false (code is incomplete), this does not warn compile_error. This option is needed to avoid warning a user when the compile_error is happening because the input is not wrong but just incomplete. | def colorize_code(code, complete: true, ignore_error: false, colorable: colorable?)
return code unless colorable
symbol_state = SymbolState.new
colored = +''
length = 0
end_seen = false
scan(code, allow_last_error: !complete) do |token, str, expr|
# IRB::Color... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def incomplete!\r\n @is_complete = false\r\n end",
"def check_completion!\n if defined?(@complete_block) && @complete_block # rubocop:todo Style/GuardClause\n begin\n complete! if @complete_block.call\n rescue StandardError => e\n Vanity.logger.warn(\"Error ... | [
"0.58577794",
"0.5818327",
"0.529456",
"0.5271597",
"0.51753",
"0.5160913",
"0.5135282",
"0.50532216",
"0.5022684",
"0.502001",
"0.5008009",
"0.49970666",
"0.4982479",
"0.49633682",
"0.492885",
"0.49192935",
"0.49192935",
"0.4905453",
"0.4866409",
"0.48587734",
"0.48457083",
... | 0.45914358 | 47 |
Return true if the token is a part of Symbol. | def scan_token(token)
prev_state = @stack.last
case token
when :on_symbeg, :on_symbols_beg, :on_qsymbols_beg
@stack << true
when :on_ident, :on_op, :on_const, :on_ivar, :on_cvar, :on_gvar, :on_kw
if @stack.last # Pop only when it's Symbol
@stack.pop
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_symbol\n <<-CODE\n t1 = stack_pop();\n stack_push(SYMBOL_P(t1) ? Qtrue : Qfalse);\n CODE\n end",
"def valid_symbol?(symbol)\n return false if [].include?(symbol)\n true\n end",
"def is_token? m\n return false if m == nil\n m = m.to_s\n (m =~ /^([a-zA-Z0-9\\-\\.\\_\\~]|... | [
"0.76065373",
"0.7227119",
"0.68623227",
"0.68623227",
"0.67849576",
"0.6701354",
"0.6679142",
"0.66600424",
"0.66538006",
"0.65992963",
"0.657329",
"0.6517056",
"0.64254165",
"0.6409809",
"0.6363597",
"0.63542527",
"0.6282035",
"0.62785786",
"0.62770766",
"0.6234524",
"0.618... | 0.55093414 | 71 |
Note: instance and index assignment expressions could also be written like: "foo.bar=(1)" and "foo.[]=(1, bar)", when expressed that way, the former be parsed as :assign and echo will be suppressed, but the latter is parsed as a :method_add_arg and the output won't be suppressed Creates a new irb session | def initialize(workspace = nil, input_method = nil)
@context = Context.new(self, workspace, input_method)
@context.main.extend ExtendCommandBundle
@signal_status = :IN_IRB
@scanner = RubyLex.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def operator=(_arg0); end",
"def []=(*args); end",
"def test_can_assign_to_object_with_subscript_deref\n result = interpret 'o=~{one: 1, two: 2, three: 3};o[two:]=22;:o[two:]'\n assert_eq result, 22\n end",
"def []=(*) end",
"def a *args\n args[1] = args[1].to_s if args[1].is_a?(Symbol)\n ... | [
"0.63791573",
"0.6338182",
"0.60763514",
"0.59740967",
"0.58153796",
"0.58146834",
"0.58146834",
"0.58088845",
"0.57957757",
"0.5789063",
"0.5785751",
"0.57451814",
"0.57142645",
"0.5698441",
"0.5669378",
"0.5669378",
"0.5605295",
"0.5596119",
"0.5591546",
"0.55866295",
"0.55... | 0.0 | -1 |
Evaluates input for this session. | def eval_input
exc = nil
@scanner.set_prompt do
|ltype, indent, continue, line_no|
if ltype
f = @context.prompt_s
elsif continue
f = @context.prompt_c
elsif indent > 0
f = @context.prompt_n
else
f = @context.prompt_i
en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluation(input)\n operand_output = operand.call(input)\n evaluation_success(input, operand_output, !operand_output)\n end",
"def evaluate\n\n end",
"def eval(input)\n return false\n end",
"def evaluate_input\n puts \"\\tInitial Stack and Input values:\\n\\... | [
"0.69074523",
"0.6832033",
"0.68174887",
"0.6756694",
"0.6681618",
"0.6676235",
"0.6550006",
"0.65012336",
"0.6364584",
"0.6352955",
"0.6156989",
"0.61267704",
"0.5957157",
"0.5957157",
"0.5879342",
"0.58433634",
"0.5822458",
"0.5809356",
"0.5800615",
"0.5766658",
"0.5755644"... | 0.633597 | 10 |
Evaluates the given block using the given +path+ as the Contextirb_path and +name+ as the Contextirb_name. | def suspend_name(path = nil, name = nil)
@context.irb_path, back_path = path, @context.irb_path if path
@context.irb_name, back_name = name, @context.irb_name if name
begin
yield back_path, back_name
ensure
@context.irb_path = back_path if path
@context.irb_name = back_na... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluate(path)\n @context.evaluate(path)\n end",
"def evaluate(context, path)\n content_type, attributes = content_type_of_path(context, path)\n processors = get_all_processors_for_evaluate(context, content_type, attributes, path)\n filter_all_processors(processors)\n ... | [
"0.64433885",
"0.5574531",
"0.548334",
"0.548334",
"0.54503435",
"0.5125403",
"0.5081428",
"0.50652796",
"0.5015892",
"0.50038534",
"0.49969888",
"0.499177",
"0.49756125",
"0.49704152",
"0.4961932",
"0.49244523",
"0.49210778",
"0.4916099",
"0.49127436",
"0.49101138",
"0.48729... | 0.61037225 | 1 |
Evaluates the given block using the given +workspace+ as the Contextworkspace. | def suspend_workspace(workspace)
@context.workspace, back_workspace = workspace, @context.workspace
begin
yield back_workspace
ensure
@context.workspace = back_workspace
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def evaluate\n context = Context.new(self, node)\n context.instance_exec(&block)\n node\n end",
"def evaluate!(scope, &block)\n new(scope).evaluate(&block)\n end",
"def eval\n @block.eval\n end",
"def evaluate(&block)\n instance_eval(&block)\n end",
"... | [
"0.65568984",
"0.63278866",
"0.6235908",
"0.61679363",
"0.6071549",
"0.59191257",
"0.5906989",
"0.5804918",
"0.5669352",
"0.5645332",
"0.564509",
"0.560705",
"0.55978525",
"0.5539847",
"0.5508322",
"0.540438",
"0.53596085",
"0.5354995",
"0.5353567",
"0.5353567",
"0.53261626",... | 0.49519873 | 38 |
Evaluates the given block using the given +input_method+ as the Contextio. | def suspend_input_method(input_method)
back_io = @context.io
@context.instance_eval{@io = input_method}
begin
yield back_io
ensure
@context.instance_eval{@io = back_io}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def call(input)\n body.all? { |evaluator| evaluator.call(input) }\n end",
"def call(input)\n body.any? { |evaluator| evaluator.call(input) }\n end",
"def call(input)\n evaluator_klass.new(self, input)\n end",
"def evaluate(input)\n if input.operator?\n perf... | [
"0.63167465",
"0.5947923",
"0.5890692",
"0.5824413",
"0.56931365",
"0.56348366",
"0.561626",
"0.54249096",
"0.5412921",
"0.5405411",
"0.54043674",
"0.539064",
"0.53766197",
"0.53714794",
"0.5360716",
"0.5348755",
"0.5345285",
"0.5332569",
"0.5310929",
"0.53077537",
"0.5291142... | 0.6220024 | 1 |
Evaluates the given block using the given +context+ as the Context. | def suspend_context(context)
@context, back_context = context, @context
begin
yield back_context
ensure
@context = back_context
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def eval_context(context, node); end",
"def evaluate\n context = Context.new(self, node)\n context.instance_exec(&block)\n node\n end",
"def evaluate(context)\n Parser.new(@expr).parse.evaluate(context)\n end",
"def eval\n @block.eval\n end",
"def _run(context)\n ... | [
"0.7057041",
"0.69050384",
"0.67585284",
"0.66053",
"0.6538175",
"0.6464268",
"0.64641464",
"0.6401169",
"0.63889503",
"0.6342763",
"0.6301597",
"0.6300245",
"0.62797266",
"0.62444377",
"0.6189696",
"0.61706424",
"0.61706424",
"0.6137961",
"0.61084086",
"0.6017533",
"0.600055... | 0.0 | -1 |
Handler for the signal SIGINT, see Kerneltrap for more information. | def signal_handle
unless @context.ignore_sigint?
print "\nabort!\n" if @context.verbose?
exit
end
case @signal_status
when :IN_INPUT
print "^C\n"
raise RubyLex::TerminateLineInput
when :IN_EVAL
IRB.irb_abort(self)
when :IN_LOAD
IRB.irb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sigHandler\n Signal.trap(\"INT\") { stop }\n Signal.trap(\"TERM\") { stop }\n end",
"def trap_sigint(metabolizer, &block)\n trap 'SIGINT', proc {\n block.call if block\n metabolizer.stop\n }\nend",
"def interrupt_handler\n signal_handler(2)\n end",
"def add_sigint_handler\n tra... | [
"0.77008355",
"0.7619444",
"0.7584016",
"0.7563689",
"0.7494791",
"0.7494486",
"0.74760586",
"0.74760586",
"0.73699206",
"0.7357768",
"0.7184476",
"0.71514267",
"0.7149645",
"0.7142858",
"0.6958633",
"0.6922269",
"0.69068944",
"0.6862928",
"0.6855117",
"0.68153167",
"0.676322... | 0.7351583 | 10 |
Evaluates the given block using the given +status+. | def signal_status(status)
return yield if @signal_status == :IN_LOAD
signal_status_back = @signal_status
@signal_status = status
begin
yield
ensure
@signal_status = signal_status_back
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on(status, &block)\n yield(self) if status?(status) && block\n\n self\n end",
"def handle(status, &block)\n inbox[status] = block\n end",
"def on_status(&block)\n @on_status = block\n end",
"def on_status(&block)\n @on_status = block\n end",
"def evaluate!\n ... | [
"0.6339772",
"0.6261311",
"0.61220634",
"0.61220634",
"0.56142807",
"0.5529337",
"0.5511373",
"0.544139",
"0.5439072",
"0.5403868",
"0.53733176",
"0.53541297",
"0.5320481",
"0.5302593",
"0.5293814",
"0.5290271",
"0.5215234",
"0.5199654",
"0.51966643",
"0.51747215",
"0.5146727... | 0.54728746 | 7 |
Outputs the local variables to this current session, including signal_status and context, using IRB::Locale. | def inspect
ary = []
for iv in instance_variables
case (iv = iv.to_s)
when "@signal_status"
ary.push format("%s=:%s", iv, @signal_status.id2name)
when "@context"
ary.push format("%s=%s", iv, eval(iv).__to_s__)
else
ary.push format("%s=%s", iv, ev... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def track_locale\n I18n.locale = session[:current_locale] || I18n.default_locale\n end",
"def info_locals\n @queue << \"i l\"\n end",
"def locals\n @locals ||= {message: self.message}\n end",
"def local_variables() end",
"def local_global\n\t\t\they = \"hey there\" # Local - only access... | [
"0.56605184",
"0.55126244",
"0.5430128",
"0.5356135",
"0.5333381",
"0.53304166",
"0.5280384",
"0.51430404",
"0.510467",
"0.507855",
"0.5049466",
"0.49913874",
"0.49313056",
"0.48989603",
"0.48780084",
"0.4857535",
"0.48383808",
"0.48132098",
"0.47995806",
"0.47977713",
"0.477... | 0.5367664 | 3 |
Breaks the buffer into lines that are shorter than maxwidth | def break_outmost_groups
while @maxwidth < @output_width + @buffer_width
return unless group = @group_queue.deq
until group.breakables.empty?
data = @buffer.shift
@output_width = data.output(@output, @output_width)
@buffer_width -= data.width
end
while !@buffer.empty?... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def word_wrap(text, line_width=40)\n text.split(\"\\n\").collect do |line|\n line.length > line_width ? line.gsub(/(.{1,#{line_width}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",
"def word_wrap(text, line_width = 80)\n text.split(\"\\n\").collect do |line|\n line... | [
"0.66748416",
"0.65695095",
"0.6544882",
"0.6518621",
"0.650562",
"0.6417858",
"0.63971686",
"0.63663155",
"0.6353987",
"0.63280463",
"0.63263595",
"0.6315871",
"0.6283404",
"0.6279053",
"0.6249068",
"0.6242028",
"0.6206574",
"0.61726916",
"0.616826",
"0.6163936",
"0.6153462"... | 0.62818944 | 13 |
This adds +obj+ as a text of +width+ columns in width. If +width+ is not specified, obj.length is used. | def text(obj, width=obj.length)
if @buffer.empty?
@output << obj
@output_width += width
else
text = @buffer.last
unless Text === text
text = Text.new
@buffer << text
end
text.add(obj, width)
@buffer_width += width
break_outmost_groups
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def text(obj, width=nil)\n @output << obj\n end",
"def add(obj, width)\n @objs << obj\n @width += width\n end",
"def wrap(width=nil)\n if width.nil? or width < 0\n term_width, _ = Term.size\n\n if width and width < 0\n width = (term_width - 1) + width\n else\n ... | [
"0.72331345",
"0.6900624",
"0.58438957",
"0.57378983",
"0.5653301",
"0.5629683",
"0.5623277",
"0.5423683",
"0.54078174",
"0.5395868",
"0.53922635",
"0.53922635",
"0.53681064",
"0.53548235",
"0.5332592",
"0.53183687",
"0.53183687",
"0.5306759",
"0.52813786",
"0.527963",
"0.526... | 0.7294602 | 2 |
This is similar to breakable except the decision to break or not is determined individually. Two fill_breakable under a group may cause 4 results: (break,break), (break,nonbreak), (nonbreak,break), (nonbreak,nonbreak). This is different to breakable because two breakable under a group may cause 2 results: (break,break)... | def fill_breakable(sep=' ', width=sep.length)
group { breakable sep, width }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def breakable(sep=' ', width=sep.length)\n group = @group_stack.last\n if group.break?\n flush\n @output << @newline\n @output << @genspace.call(@indent)\n @output_width = @indent\n @buffer_width = 0\n else\n @buffer << Breakable.new(sep, width, self)\n @buffer_width += ... | [
"0.7693627",
"0.7693627",
"0.7693627",
"0.7070315",
"0.64994544",
"0.6135311",
"0.6135311",
"0.5955294",
"0.586291",
"0.555767",
"0.5523257",
"0.5438779",
"0.53643",
"0.5325681",
"0.5254203",
"0.5251702",
"0.5116074",
"0.5106152",
"0.5060323",
"0.5051519",
"0.50147355",
"0.... | 0.8556797 | 0 |
This says "you can break a line here if necessary", and a +width+\column text +sep+ is inserted if a line is not broken at the point. If +sep+ is not specified, " " is used. If +width+ is not specified, +sep.length+ is used. You will have to specify this when +sep+ is a multibyte character, for example. | def breakable(sep=' ', width=sep.length)
group = @group_stack.last
if group.break?
flush
@output << @newline
@output << @genspace.call(@indent)
@output_width = @indent
@buffer_width = 0
else
@buffer << Breakable.new(sep, width, self)
@buffer_width += width
bre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def breakable(sep=' ', width=nil)\n @output << sep\n end",
"def fill_breakable(sep=' ', width=sep.length)\n group { breakable sep, width }\n end",
"def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end",
"def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end",
"def lineBreak \... | [
"0.7685754",
"0.69397736",
"0.654028",
"0.654028",
"0.62940586",
"0.62000847",
"0.6182973",
"0.61579835",
"0.6140755",
"0.612629",
"0.6093729",
"0.6008207",
"0.5997428",
"0.59630173",
"0.5957201",
"0.59513015",
"0.5905137",
"0.5894877",
"0.5834884",
"0.5834884",
"0.5828256",
... | 0.6583602 | 4 |
Takes a block and queues a new group that is indented 1 level further. | def group_sub
group = Group.new(@group_stack.last.depth + 1)
@group_stack.push group
@group_queue.enq group
begin
yield
ensure
@group_stack.pop
if group.breakables.empty?
@group_queue.delete group
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group(name, &block)\n namespace = Namespace.new(name, &block)\n @blocks << namespace\n namespace\n end",
"def group!( &block )\n\t\tn = new!( true )\n\t\tblock.call(n)\n\t\tn\n\tend",
"def group(name = nil, &block)\n make_child(name, nil, &block)\n end",
"def group(indent=ni... | [
"0.65754604",
"0.65338856",
"0.652024",
"0.61913276",
"0.6069466",
"0.60177606",
"0.60088503",
"0.5957245",
"0.5921816",
"0.5921816",
"0.5892524",
"0.58411986",
"0.58228135",
"0.5786121",
"0.57829696",
"0.57503915",
"0.5746685",
"0.5742895",
"0.5688871",
"0.56511295",
"0.5649... | 0.6410803 | 3 |
Increases left margin after newline with +indent+ for line breaks added in the block. | def nest(indent)
@indent += indent
begin
yield
ensure
@indent -= indent
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def indent_for(line); end",
"def with_indent ()\n thread[:indent] += 1\n yield\n ensure\n thread[:indent] -= 1\n end",
"def indent\n\t\tif @marked\n\t\t\tmark_row,row = ordered_mark_rows\n\t\t\tblock_indent(mark_row,row)\n\t\telse\n\t\t\taddchar(?\\t)\n\t\tend\n\tend",
"def unindent line... | [
"0.6833905",
"0.6685831",
"0.6567285",
"0.6539423",
"0.6512825",
"0.65121573",
"0.64649814",
"0.6434075",
"0.64330417",
"0.64330417",
"0.64330417",
"0.64330417",
"0.64330417",
"0.64025515",
"0.6366656",
"0.62984407",
"0.6298315",
"0.6267769",
"0.62326854",
"0.6210368",
"0.621... | 0.0 | -1 |
Render the String text of the objects that have been added to this Text object. Output the text to +out+, and increment the width to +output_width+ | def output(out, output_width)
@objs.each {|obj| out << obj}
output_width + @width
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def text(obj, width=nil)\n @output << obj\n end",
"def text(obj, width=obj.length)\n if @buffer.empty?\n @output << obj\n @output_width += width\n else\n text = @buffer.last\n unless Text === text\n text = Text.new\n @buffer << text\n end\n text.add(obj, ... | [
"0.76025885",
"0.73840564",
"0.73840564",
"0.73840564",
"0.6821067",
"0.6486341",
"0.64092326",
"0.6188753",
"0.6165198",
"0.609395",
"0.6043468",
"0.6024569",
"0.5919359",
"0.5918378",
"0.58594286",
"0.5853997",
"0.5835921",
"0.57870656",
"0.5781394",
"0.5768444",
"0.5747734... | 0.6149831 | 9 |
Include +obj+ in the objects to be pretty printed, and increment this Text object's total width by +width+ | def add(obj, width)
@objs << obj
@width += width
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def text(obj, width=obj.length)\n if @buffer.empty?\n @output << obj\n @output_width += width\n else\n text = @buffer.last\n unless Text === text\n text = Text.new\n @buffer << text\n end\n text.add(obj, width)\n @buffer_width += width\n break_outmost_gro... | [
"0.73051375",
"0.73051375",
"0.73051375",
"0.69742155",
"0.57264507",
"0.5627336",
"0.5490137",
"0.539477",
"0.53651136",
"0.5309579",
"0.5274029",
"0.52131355",
"0.51795214",
"0.51765674",
"0.51270086",
"0.51207244",
"0.5113998",
"0.5056359",
"0.5055708",
"0.50492543",
"0.50... | 0.6339762 | 4 |
Render the String text of the objects that have been added to this Breakable object. Output the text to +out+, and increment the width to +output_width+ | def output(out, output_width)
@group.breakables.shift
if @group.break?
out << @pp.newline
out << @pp.genspace.call(@indent)
@indent
else
@pp.group_queue.delete @group if @group.breakables.empty?
out << @obj
output_width + @width
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def text(obj, width=nil)\n @output << obj\n end",
"def text(obj, width=obj.length)\n if @buffer.empty?\n @output << obj\n @output_width += width\n else\n text = @buffer.last\n unless Text === text\n text = Text.new\n @buffer << text\n end\n text.add(obj, ... | [
"0.7414827",
"0.72057694",
"0.72057694",
"0.72057694",
"0.6429127",
"0.63488424",
"0.624344",
"0.6081962",
"0.59123546",
"0.5791207",
"0.5773319",
"0.5768776",
"0.5749039",
"0.56946033",
"0.5676836",
"0.567455",
"0.56589234",
"0.5653175",
"0.5646352",
"0.5620246",
"0.5615008"... | 0.63558 | 5 |
Makes a break for this Group, and returns true | def break
@break = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def break?\n @break\n end",
"def break\n if ! advance? then return self end\n @@logger.debug \"Handle break.\"\n SandboxModule::set_break\n @break_at = SandboxModule::line_count\n return self\n end",
"def break\n\t\t# Jump back into the outer loop of #each \n\t\tthrow( :break ) if @iter... | [
"0.8190019",
"0.6630003",
"0.6521333",
"0.63035727",
"0.62931716",
"0.6290927",
"0.62066954",
"0.61589223",
"0.60921484",
"0.58891374",
"0.5877903",
"0.5877903",
"0.5877903",
"0.5825662",
"0.58020025",
"0.5714805",
"0.5665801",
"0.5665576",
"0.561192",
"0.5598242",
"0.5568555... | 0.73346806 | 1 |
Boolean of whether this Group has made a break | def break?
@break
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def running?\n\t\t\t\t@group.running?\n\t\t\tend",
"def group?\n true\n end",
"def step_completed?\n !object.waiting_on.include?(scope)\n end",
"def group_entry?\n flags.include? :g\n end",
"def evaluate_group(grp)\n true\n end",
"def ended?\n uncovered = 0\n @mi... | [
"0.6690303",
"0.65839326",
"0.6363045",
"0.63538194",
"0.62808204",
"0.6200546",
"0.6108741",
"0.60412544",
"0.60237473",
"0.6022184",
"0.6014031",
"0.6004885",
"0.5988692",
"0.5975518",
"0.5955938",
"0.59307325",
"0.59107256",
"0.5888896",
"0.58736616",
"0.5873611",
"0.58736... | 0.7711138 | 0 |
Boolean of whether this Group has been queried for being first This is used as a predicate, and ought to be called first. | def first?
if defined? @first
false
else
@first = false
true
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def first?\n not first.nil?\n end",
"def first?\n self.rel == \"first\"\n end",
"def first_item?\n true\n end",
"def is_first\n @values.fetch('ai.session.isFirst') { \n @values['ai.session.isFirst'] = nil\n }\n end",
"def first_order?\n ... | [
"0.7317722",
"0.72093016",
"0.69485503",
"0.6819679",
"0.67724264",
"0.6760503",
"0.6737587",
"0.67249554",
"0.67249554",
"0.66439164",
"0.66420996",
"0.6464105",
"0.6453528",
"0.64254457",
"0.6414916",
"0.6397671",
"0.6355126",
"0.62992924",
"0.6298498",
"0.6297881",
"0.6294... | 0.749515 | 0 |
Enqueue +group+ This does not strictly append the group to the end of the queue, but instead adds it in line, base on the +group.depth+ | def enq(group)
depth = group.depth
@queue << [] until depth < @queue.length
@queue[depth] << group
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_sub\n group = Group.new(@group_stack.last.depth + 1)\n @group_stack.push group\n @group_queue.enq group\n begin\n yield\n ensure\n @group_stack.pop\n if group.breakables.empty?\n @group_queue.delete group\n end\n end\n end",
"def add_group( group )\n r... | [
"0.5845999",
"0.57834095",
"0.56179416",
"0.55833197",
"0.5477296",
"0.5428982",
"0.5420811",
"0.54184633",
"0.54091436",
"0.54042155",
"0.53968143",
"0.5375432",
"0.5364848",
"0.53507245",
"0.5342938",
"0.53375685",
"0.53198105",
"0.5291594",
"0.5286655",
"0.5244551",
"0.522... | 0.79346156 | 0 |
Returns the outer group of the queue | def deq
@queue.each {|gs|
(gs.length-1).downto(0) {|i|
unless gs[i].breakables.empty?
group = gs.slice!(i, 1).first
group.break
return group
end
}
gs.each {|group| group.break}
gs.clear
}
return nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enq(group)\n depth = group.depth\n @queue << [] until depth < @queue.length\n @queue[depth] << group\n end",
"def group_sub\n group = Group.new(@group_stack.last.depth + 1)\n @group_stack.push group\n @group_queue.enq group\n begin\n yield\n ensure\n @group_stack.po... | [
"0.6714131",
"0.63947326",
"0.59197754",
"0.59016263",
"0.5572337",
"0.5572337",
"0.5545838",
"0.5522658",
"0.55210763",
"0.55175924",
"0.5502364",
"0.5502364",
"0.5502364",
"0.54514647",
"0.54337066",
"0.54281056",
"0.5380569",
"0.5376455",
"0.5347412",
"0.53148836",
"0.5298... | 0.6550397 | 1 |
Remote +group+ from this queue | def delete(group)
@queue[group.depth].delete(group)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_remote_group\n self.each_security_group do |sg|\n sg.rules.map do |rule|\n next if rule.group.nil? || rule.group == rule.parent_group_name\n rule.group = self.find_by(:name, sg.name)\n end\n end\n end",
"def group; Group.get(self.group_id); end",
"def g... | [
"0.7246614",
"0.6764669",
"0.6624493",
"0.6619703",
"0.6595391",
"0.6526664",
"0.642307",
"0.6421771",
"0.6399283",
"0.6394054",
"0.6380082",
"0.63259363",
"0.63259363",
"0.63158983",
"0.6281682",
"0.6231506",
"0.6216323",
"0.62071395",
"0.61361235",
"0.6122429",
"0.60848486"... | 0.6021708 | 24 |
Add +obj+ to the text to be output. +width+ argument is here for compatibility. It is a noop argument. | def text(obj, width=nil)
@output << obj
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def text(obj, width=obj.length)\n if @buffer.empty?\n @output << obj\n @output_width += width\n else\n text = @buffer.last\n unless Text === text\n text = Text.new\n @buffer << text\n end\n text.add(obj, width)\n @buffer_width += width\n break_outmost_gro... | [
"0.78848535",
"0.78848535",
"0.78848535",
"0.7040841",
"0.6135815",
"0.5994453",
"0.559223",
"0.5527794",
"0.550939",
"0.5476638",
"0.53594834",
"0.5349323",
"0.52714723",
"0.5229523",
"0.5221194",
"0.51912737",
"0.5168539",
"0.5168539",
"0.5145589",
"0.5140142",
"0.51104456"... | 0.84734696 | 0 |
Appends +sep+ to the text to be output. By default +sep+ is ' ' +width+ argument is here for compatibility. It is a noop argument. | def breakable(sep=' ', width=nil)
@output << sep
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end",
"def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end",
"def separator\n '+' + @widths.map { |w| '-' * (w+2) }.join('+') + '+' \n end",
"def sep; end",
"def sep; end",
"def print_separator\n str = \"+\" + \"-\" ... | [
"0.68424463",
"0.68424463",
"0.66938424",
"0.6668005",
"0.6668005",
"0.6629264",
"0.6510972",
"0.64609766",
"0.6397147",
"0.63759017",
"0.63759017",
"0.63759017",
"0.6284119",
"0.6271035",
"0.6248806",
"0.61155087",
"0.61073315",
"0.61015975",
"0.60765964",
"0.6073946",
"0.60... | 0.78920656 | 0 |
Takes +indent+ arg, but does nothing with it. Yields to a block. | def nest(indent) # :nodoc:
yield
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def with_indent ()\n thread[:indent] += 1\n yield\n ensure\n thread[:indent] -= 1\n end",
"def nest(indent)\n @indent += indent\n begin\n yield\n ensure\n @indent -= indent\n end\n end",
"def nest(indent)\n @indent += indent\n begin\n yield\n ensure\n ... | [
"0.7299355",
"0.7061045",
"0.7061045",
"0.7061045",
"0.6763839",
"0.6656038",
"0.65758616",
"0.63992304",
"0.62806207",
"0.626037",
"0.6240931",
"0.62303996",
"0.6022286",
"0.6022286",
"0.6022286",
"0.6022286",
"0.6022286",
"0.5987562",
"0.5980523",
"0.59623605",
"0.59344274"... | 0.66445225 | 6 |
Opens a block for grouping objects to be pretty printed. Arguments: +indent+ noop argument. Present for compatibility. +open_obj+ text appended before the &blok. Default is '' +close_obj+ text appended after the &blok. Default is '' +open_width+ noop argument. Present for compatibility. +close_width+ noop argument. Pre... | def group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil)
@first.push true
@output << open_obj
yield
@output << close_obj
@first.pop
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def with_indentation(&block) # :doc:\n @indentation += 1\n instance_eval(&block)\n ensure\n @indentation -= 1\n end",
"def enclose_display(obj, c, out, indent=0)\n if RubyExpression === obj\n c = c::Prec if Class === c\n obj = Parenthesis.new(obj) if obj.clas... | [
"0.5939542",
"0.57243055",
"0.5666956",
"0.56580484",
"0.56577414",
"0.54900396",
"0.54776126",
"0.5466602",
"0.5375663",
"0.528712",
"0.5287006",
"0.52584785",
"0.52438796",
"0.5232103",
"0.52191615",
"0.51956433",
"0.5122193",
"0.51020527",
"0.5096373",
"0.5096373",
"0.5094... | 0.78486407 | 0 |
Method present for compatibility, but is a noop | def flush # :nodoc:
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def nothing; end",
"def noop\n -> { }\n end",
"def nothing(_)\n end",
"def method_missing(*)\n invertable nil\n end",
"def nothing\nend",
"def do_nothing\nend",
"def do_nothing\nend",
"def missing; end",
"def never?; end",
"def method_missing(*)\n return nil\n end",
"d... | [
"0.73729265",
"0.7199371",
"0.7030234",
"0.68677956",
"0.68398124",
"0.6804304",
"0.6804304",
"0.680132",
"0.67591816",
"0.6703064",
"0.6688562",
"0.6668645",
"0.6637906",
"0.662695",
"0.6620854",
"0.65689975",
"0.6559923",
"0.6559923",
"0.6559923",
"0.65508986",
"0.6474952",... | 0.0 | -1 |
This is used as a predicate, and ought to be called first. | def first?
result = @first[-1]
@first[-1] = false
result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_predicate; end",
"def filter; end",
"def filter; end",
"def filter; end",
"def examine(item)\r\n \r\n end",
"def condition; end",
"def hit_condition()\n #This is a stub, used for indexing\n end",
"def find; end",
"def filter!; end",
"def test_emptyUsableItem\n f =... | [
"0.6391316",
"0.59781504",
"0.59781504",
"0.59781504",
"0.5882811",
"0.5721401",
"0.571051",
"0.56580573",
"0.56568336",
"0.5594836",
"0.5575415",
"0.5557222",
"0.5541784",
"0.5518169",
"0.55116135",
"0.5495203",
"0.5491645",
"0.54868037",
"0.54506147",
"0.54391426",
"0.53920... | 0.0 | -1 |
Sets the sharing detection flag to b. | def sharing_detection=(b)
Ractor.current[:pp_sharing_detection] = b
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_shared=(value)\n @is_shared = value\n end",
"def setB(b)\r\n @b = b\r\n end",
"def can_share=(value)\n @can_share = value\n end",
"def sharing_capability=(value)\n @sharing_capability = value\n end",
"def work_profile_... | [
"0.58403444",
"0.58091277",
"0.5799222",
"0.57927144",
"0.5696589",
"0.5627042",
"0.56270415",
"0.56010354",
"0.5565019",
"0.55049217",
"0.5472368",
"0.5435128",
"0.54195267",
"0.53776693",
"0.5298258",
"0.5174198",
"0.51583916",
"0.51549375",
"0.5067083",
"0.5058695",
"0.500... | 0.8003529 | 0 |
Check whether the object_id +id+ is in the current buffer of objects to be pretty printed. Used to break cycles in chains of objects to be pretty printed. | def check_inspect_key(id)
Thread.current[:__recursive_key__] &&
Thread.current[:__recursive_key__][:inspect] &&
Thread.current[:__recursive_key__][:inspect].include?(id)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def scrooge_dump_flagged?\n Thread.current[:scrooge_dumping_objects] &&\n Thread.current[:scrooge_dumping_objects].include?(object_id)\n end",
"def incremental_dump?(object)\n\t object.respond_to?(:remote_siblings) && object.remote_siblings[self] \n\tend",
"def include?(obj)\n... | [
"0.67834824",
"0.62539166",
"0.58679175",
"0.58247954",
"0.58247954",
"0.5785559",
"0.5763845",
"0.57148504",
"0.56782234",
"0.56503135",
"0.56499845",
"0.56438863",
"0.56333566",
"0.56200635",
"0.5566382",
"0.5532477",
"0.5515274",
"0.55076313",
"0.55038404",
"0.5497699",
"0... | 0.6434032 | 1 |
Adds the object_id +id+ to the set of objects being pretty printed, so as to not repeat objects. | def push_inspect_key(id)
Thread.current[:__recursive_key__][:inspect][id] = true
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pp(obj)\n id = obj.object_id\n\n if check_inspect_key(id)\n group {obj.pretty_print_cycle self}\n return\n end\n\n begin\n push_inspect_key(id)\n group {obj.pretty_print self}\n ensure\n pop_inspect_key(id) unless PP.sharing_detection\n end\n ... | [
"0.6247327",
"0.59170705",
"0.5621095",
"0.5619771",
"0.5614195",
"0.56007916",
"0.55963176",
"0.5508399",
"0.5413894",
"0.53864896",
"0.5362",
"0.5362",
"0.5362",
"0.5362",
"0.5358409",
"0.53221995",
"0.53171676",
"0.5285954",
"0.52517253",
"0.52436084",
"0.52426213",
"0.5... | 0.46914667 | 93 |
Removes an object from the set of objects being pretty printed. | def pop_inspect_key(id)
Thread.current[:__recursive_key__][:inspect].delete id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_marked\n @objects.remove_marked\n end",
"def remove(obj)\n @set.removeObject obj\n end",
"def scrooge_dump_unflag_this\n Thread.current[:scrooge_dumping_objects].delete(object_id)\n end",
"def unclear(object)\n toys = object[0]\n toys.each do |toy|\n add_... | [
"0.6509626",
"0.638906",
"0.6302473",
"0.62376636",
"0.6063818",
"0.5974772",
"0.59342706",
"0.5913833",
"0.58486056",
"0.5727375",
"0.57248044",
"0.5589696",
"0.556275",
"0.55416036",
"0.5509802",
"0.5501322",
"0.54694587",
"0.5459405",
"0.5426874",
"0.5419716",
"0.5383621",... | 0.0 | -1 |
Adds +obj+ to the pretty printing buffer using Objectpretty_print or Objectpretty_print_cycle. Objectpretty_print_cycle is used when +obj+ is already printed, a.k.a the object reference chain has a cycle. | def pp(obj)
# If obj is a Delegator then use the object being delegated to for cycle
# detection
obj = obj.__getobj__ if defined?(::Delegator) and obj.is_a?(::Delegator)
if check_inspect_key(obj)
group {obj.pretty_print_cycle self}
return
end
begin
push_insp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pp(obj)\n id = obj.object_id\n\n if check_inspect_key(id)\n group {obj.pretty_print_cycle self}\n return\n end\n\n begin\n push_inspect_key(id)\n group {obj.pretty_print self}\n ensure\n pop_inspect_key(id) unless PP.sharing_detection\n end\n ... | [
"0.6728845",
"0.6128602",
"0.61237895",
"0.58291143",
"0.57644254",
"0.5751263",
"0.5696027",
"0.5550908",
"0.5550908",
"0.5401711",
"0.5383444",
"0.53783256",
"0.5367241",
"0.5357268",
"0.5297026",
"0.5291539",
"0.5279507",
"0.526151",
"0.5243828",
"0.5220501",
"0.5220501",
... | 0.6695801 | 1 |
A convenience method, like object_group, but also reformats the Object's object_id. | def object_address_group(obj, &block)
str = Kernel.instance_method(:to_s).bind_call(obj)
str.chomp!('>')
group(1, str, '>', &block)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def object_id\n object.object_id\n end",
"def id_format(object)\n object.id_format || object.self_link_uri\n end",
"def group\n object.group.id\n end",
"def id\n object.object_id\n end",
"def get_object_id object\n object.respond_to?(:id) ? object.id : object\n end",
"def id_f... | [
"0.64654565",
"0.63073677",
"0.6292793",
"0.62323254",
"0.6227806",
"0.61990917",
"0.6159507",
"0.6159507",
"0.60450786",
"0.60122085",
"0.6007377",
"0.5867962",
"0.5862752",
"0.5822894",
"0.5822894",
"0.5788402",
"0.5774306",
"0.57668823",
"0.57557863",
"0.57461506",
"0.5735... | 0.5376721 | 57 |
A convenience method which is same as follows: text ',' breakable | def comma_breakable
text ','
breakable
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def comma_breakable\n text ','\n fill_breakable\n end",
"def breakable(sep=' ', width=nil)\n @output << sep\n end",
"def separator\n ','\n end",
"def sep; end",
"def sep; end",
"def separate_comma(number)\n\tnumber\nend",
"def separator; end",
"def commas(num)\nend",
"d... | [
"0.839284",
"0.64928514",
"0.630972",
"0.62464386",
"0.62464386",
"0.61889166",
"0.6178983",
"0.6134015",
"0.6133615",
"0.61323833",
"0.60954046",
"0.6084332",
"0.6057236",
"0.6040758",
"0.6015767",
"0.5947553",
"0.5895845",
"0.585469",
"0.58495176",
"0.58421105",
"0.58382505... | 0.8650837 | 1 |
A present standard failsafe for pretty printing any given Object | def pp_object(obj)
object_address_group(obj) {
seplist(obj.pretty_print_instance_variables, lambda { text ',' }) {|v|
breakable
v = v.to_s if Symbol === v
text v
text '='
group(1) {
breakable ''
pp(obj.instance_eval(v))
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pretty(object)\n PP.pp(object, out)\n end",
"def prettify(obj)\n # Most look best with pretty_inspect\n str = obj.pretty_inspect\n # Mashes need to be first converted to Hashes then pretty_inspect\n if obj.kind_of? Mash\n str = obj.to_hash.pretty_inspect\n end\n # For Array... | [
"0.75884235",
"0.73499185",
"0.7309182",
"0.7239908",
"0.7106024",
"0.7067775",
"0.6988345",
"0.6936494",
"0.68930846",
"0.6885203",
"0.6877869",
"0.68694085",
"0.67672384",
"0.66502887",
"0.6607379",
"0.6542163",
"0.64882123",
"0.64849645",
"0.6478941",
"0.64773554",
"0.6466... | 0.6745095 | 13 |
A pretty print for a Hash | def pp_hash(obj)
group(1, '{', '}') {
seplist(obj, nil, :each_pair) {|k, v|
group {
pp k
text '=>'
group(1) {
breakable ''
pp v
}
}
}
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pretty(hash)\n hash.each do |key,value|\n puts \"#{key}: #{value}\"\n end\nend",
"def pretty(hash)\n hash.each do |key,value|\n puts \"#{key}: #{value}\"\n end\nend",
"def pretty_print(pp)\n pp.pp_hash to_hash\n end",
"def render_hash(hsh)\n str = \"\"\n indiff_hsh = hsh.w... | [
"0.75162077",
"0.75162077",
"0.73290634",
"0.7300342",
"0.7227751",
"0.7211835",
"0.72094274",
"0.7107687",
"0.7107687",
"0.7007786",
"0.69282985",
"0.69000405",
"0.68613535",
"0.6855423",
"0.68373674",
"0.6773637",
"0.676093",
"0.6663804",
"0.6644251",
"0.6552197",
"0.654811... | 0.6790528 | 15 |
A default pretty printing method for general objects that are detected as part of a cycle. | def pretty_print_cycle(q)
q.object_address_group(self) {
q.breakable
q.text '...'
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pp(obj)\n # If obj is a Delegator then use the object being delegated to for cycle\n # detection\n obj = obj.__getobj__ if defined?(::Delegator) and obj.is_a?(::Delegator)\n\n if check_inspect_key(obj)\n group {obj.pretty_print_cycle self}\n return\n end\n\n begin\n ... | [
"0.7357758",
"0.6909234",
"0.6666561",
"0.6549883",
"0.65253437",
"0.64137316",
"0.6393004",
"0.6358597",
"0.62914133",
"0.62589085",
"0.62439305",
"0.6199151",
"0.61709106",
"0.61696184",
"0.6167552",
"0.6152001",
"0.61411726",
"0.60957295",
"0.6081147",
"0.60754395",
"0.602... | 0.6566143 | 4 |
Returns a sorted array of instance variable names. This method should return an array of names of instance variables as symbols or strings as: | def pretty_print_instance_variables
instance_variables.sort
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def instance_variables\n get_instance_variables.to_a.collect{ |n| \"#{n}\".to_sym }\n end",
"def instance_variables\n get_instance_variables.to_a.collect{ |n| \"@#{n}\".to_sym }\n end",
"def symbolized_instance_variables\n instance_variables.map { |ivar| ivar.to_sym }\n end",
"def ins... | [
"0.8123597",
"0.7952946",
"0.7614613",
"0.7416934",
"0.73888016",
"0.7233328",
"0.70941544",
"0.69636667",
"0.69540614",
"0.6645265",
"0.6559444",
"0.64144546",
"0.63899016",
"0.63528097",
"0.6343646",
"0.6315452",
"0.62160057",
"0.6170045",
"0.61362404",
"0.61090827",
"0.608... | 0.7401538 | 5 |
prints arguments in pretty form. pp returns argument(s). | def pp(*objs)
objs.each {|obj|
PP.pp(obj)
}
objs.size <= 1 ? objs.first : objs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pretty_print pp\n pp.pp eval(self.asPPString)\n end",
"def pretty_print pp\n pp.pp eval(self.asPPString)\n end",
"def pprint(object)\n PP.pp(object)\nend",
"def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n \n pp nds\n puts nds \nend",
"def pretty... | [
"0.74079376",
"0.74079376",
"0.6922165",
"0.69085985",
"0.6892184",
"0.68798035",
"0.68663716",
"0.68173635",
"0.67788833",
"0.66608167",
"0.6623696",
"0.6573856",
"0.6566208",
"0.6534998",
"0.65171444",
"0.64803606",
"0.64679736",
"0.6443602",
"0.6443377",
"0.6443206",
"0.64... | 0.0 | -1 |
A copy of the default IRB.conf[:SAVE_HISTORY] | def save_history
IRB.conf[:SAVE_HISTORY]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_history=(val)\n IRB.conf[:SAVE_HISTORY] = val\n if val\n main_context = IRB.conf[:MAIN_CONTEXT]\n main_context = self unless main_context\n main_context.init_save_history\n end\n end",
"def history_file\n IRB.conf[:HISTORY_FILE]\n end",
"def history_file=... | [
"0.78334016",
"0.76163167",
"0.74927276",
"0.7476581",
"0.7476581",
"0.71854055",
"0.71376383",
"0.6968509",
"0.67393106",
"0.6637548",
"0.662054",
"0.6597935",
"0.65710515",
"0.63521725",
"0.630159",
"0.62708724",
"0.62677306",
"0.61960816",
"0.6189571",
"0.6099352",
"0.6035... | 0.8873833 | 0 |
Sets IRB.conf[:SAVE_HISTORY] to the given +val+ and calls init_save_history with this context. Will store the number of +val+ entries of history in the history_file Add the following to your +.irbrc+ to change the number of history entries stored to 1000: IRB.conf[:SAVE_HISTORY] = 1000 | def save_history=(val)
IRB.conf[:SAVE_HISTORY] = val
if val
main_context = IRB.conf[:MAIN_CONTEXT]
main_context = self unless main_context
main_context.init_save_history
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_history\n IRB.conf[:SAVE_HISTORY]\n end",
"def history_file=(hist)\n IRB.conf[:HISTORY_FILE] = hist\n end",
"def save_history\n\t\thistfile = HISTORY_FILE.expand_path\n\n\t\tlines = Readline::HISTORY.to_a.reverse.uniq.reverse\n\t\tlines = lines[ -DEFAULT_HISTORY_SIZE, DEFAULT_HISTORY_S... | [
"0.713647",
"0.675933",
"0.6664067",
"0.6664067",
"0.62082976",
"0.62082976",
"0.6154319",
"0.6076819",
"0.6072983",
"0.59437567",
"0.5937368",
"0.58924234",
"0.5847672",
"0.58209974",
"0.57697666",
"0.5762803",
"0.5692422",
"0.56654954",
"0.5656346",
"0.5498388",
"0.54273003... | 0.8599458 | 0 |
A copy of the default IRB.conf[:HISTORY_FILE] | def history_file
IRB.conf[:HISTORY_FILE]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def history_file=(hist)\n IRB.conf[:HISTORY_FILE] = hist\n end",
"def history_file_init\n\n self.history_file = \"#{FRAMEWORKDIR}/.history\"\n\n if ! ::File.exists?(\"#{self.history_file}\")\n File.new(\"#{self.history_file}\", 'w+')\n end\n\n hist_file\n end",
"def histor... | [
"0.84035957",
"0.80699146",
"0.79915965",
"0.7923957",
"0.7459613",
"0.71617943",
"0.7088803",
"0.708634",
"0.69330066",
"0.6882558",
"0.6882558",
"0.6856642",
"0.6856642",
"0.660539",
"0.659346",
"0.64997745",
"0.64678216",
"0.6407841",
"0.6393133",
"0.6367496",
"0.63185316"... | 0.89863217 | 0 |
Set IRB.conf[:HISTORY_FILE] to the given +hist+. | def history_file=(hist)
IRB.conf[:HISTORY_FILE] = hist
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def hist_file\n hfile = File.open(\"#{self.history_file}\", 'r')\n hfile.each do |line|\n line.chomp!\n ::Readline::HISTORY.push(line)\n end\n hfile.close\n end",
"def read_history\n unless @histfile\n dirname = ENV['HOME'] || ENV['HOMEPATH'] || File.expand_path('~')... | [
"0.6882958",
"0.68526363",
"0.68428606",
"0.6730211",
"0.6506673",
"0.6506673",
"0.63171655",
"0.63124007",
"0.62740767",
"0.6236049",
"0.6213549",
"0.6119041",
"0.60710263",
"0.60710263",
"0.59872407",
"0.5986684",
"0.58459496",
"0.5845218",
"0.5845218",
"0.57444084",
"0.574... | 0.8973126 | 0 |
Prepares for parsing +str+. If you define a custom initialize you must call this method before parse | def setup_parser(str, debug=false)
set_string str, 0
@memoizations = Hash.new { |h,k| h[k] = {} }
@result = nil
@failed_rule = nil
@failing_rule_offset = -1
@line_offsets = nil
setup_foreign_grammar
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(str = nil)\n parse(str) if str\n end",
"def initialize(str)\n @raw = str # Keeps th original string for later use\n @buffer = StringScanner.new(str) # Create StringScanner buffer\n @attributes = {} # Initialize the attributes... | [
"0.80807114",
"0.80049115",
"0.74486226",
"0.74486226",
"0.74486226",
"0.7266622",
"0.7187379",
"0.69944113",
"0.69774467",
"0.69368935",
"0.69368935",
"0.69368935",
"0.69368935",
"0.6933669",
"0.6897163",
"0.6893511",
"0.6872854",
"0.6825807",
"0.6825807",
"0.6816265",
"0.67... | 0.63215035 | 51 |
Sets the string and current parsing position for the parser. | def set_string string, pos
@string = string
@string_size = string ? string.size : 0
@pos = pos
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_string string, pos\n @string = string\n @string_size = string ? string.size : 0\n @pos = pos\n @position_line_offsets = nil\n end",
"def pos=(n)\n n += @string.length if n.negative?\n raise RangeError, \"index out of range\" if n.negative?\n raise RangeError, \"index out o... | [
"0.751787",
"0.64531726",
"0.63920784",
"0.6257828",
"0.6257828",
"0.62034255",
"0.6065973",
"0.602774",
"0.58982104",
"0.5875002",
"0.5867286",
"0.58068085",
"0.57819635",
"0.5768482",
"0.5765891",
"0.5754783",
"0.5746028",
"0.5724649",
"0.5724649",
"0.57238877",
"0.56699514... | 0.73816484 | 3 |
:nodoc: Creates a new markdown parser that enables the given +extensions+. | def initialize extensions = DEFAULT_EXTENSIONS, debug = false
@debug = debug
@formatter = RDoc::Markup::ToJoinedParagraph.new
@extensions = extensions
@references = nil
@unlinked_references = nil
@footnotes = nil
@note_order = nil
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def register_as_default_for_extensions(extensions)\n ExtensionMap.default_parser_for ||= {}\n extensions = [*extensions]\n extensions.each do |extension|\n ExtensionMap.default_parser_for[extension.to_sym] = self\n end\n end",
"def register_for_extensions(extensions)\n ... | [
"0.6152058",
"0.598946",
"0.5748767",
"0.54826915",
"0.54108626",
"0.53683895",
"0.53374195",
"0.53319806",
"0.5324882",
"0.5249997",
"0.5230492",
"0.520792",
"0.520792",
"0.5187645",
"0.51736194",
"0.51589686",
"0.5091329",
"0.5055004",
"0.50449294",
"0.5036244",
"0.5036236"... | 0.56054735 | 3 |
Wraps `text` in emphasis for rdoc inline formatting | def emphasis text
if text =~ /\A[a-z\d.\/]+\z/i then
"_#{text}_"
else
"<em>#{text}</em>"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def emphasis(text)\n \"<em>#{do_not_break_string text}</em>\"\n end",
"def wrapped_by_paragraph; end",
"def emphasis; end",
"def wrap_text(content)\n unless content.nil? or content.empty?\n content.gsub(/\\n/, '<br />').html_safe\n else\n \"<em>Not provided</em>\".html_safe\n end\n en... | [
"0.7604536",
"0.6913859",
"0.6806649",
"0.65927154",
"0.6559296",
"0.64678365",
"0.6384367",
"0.63480437",
"0.63289964",
"0.6327582",
"0.6327582",
"0.6317433",
"0.629606",
"0.6256392",
"0.6245038",
"0.6230748",
"0.6216936",
"0.61782664",
"0.6156856",
"0.6148007",
"0.6127919",... | 0.67341673 | 3 |
:category: Extensions Is the extension `name` enabled? | def extension? name
@extensions.include? name
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_extension(name)\n end",
"def enable_extension(name, **)\n end",
"def extension name, enable\n if enable then\n @extensions |= [name]\n else\n @extensions -= [name]\n end\n end",
"def supports_extensions?\n false\n end",
"def supports_extensions?\n ... | [
"0.7971297",
"0.7594839",
"0.6962607",
"0.68760353",
"0.68760353",
"0.6815019",
"0.6814043",
"0.6814043",
"0.6794711",
"0.6793728",
"0.67281073",
"0.6719274",
"0.6719274",
"0.6669114",
"0.66585344",
"0.6567272",
"0.6567272",
"0.6567272",
"0.6567272",
"0.65153646",
"0.6472925"... | 0.7916506 | 1 |
:category: Extensions Enables or disables the extension with `name` | def extension name, enable
if enable then
@extensions |= [name]
else
@extensions -= [name]
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def enable_extension(name)\n end",
"def enable_extension(name, **)\n end",
"def disable_extension(name)\n end",
"def disable_extension(name, **)\n end",
"def enable_extension(name)\n execute(\"CREATE EXTENSION IF NOT EXISTS \\\"#{name}\\\"\")\n end",
"def extension_name=(name)... | [
"0.79920775",
"0.7701415",
"0.73346806",
"0.7312685",
"0.6958377",
"0.6355125",
"0.60725456",
"0.60527265",
"0.5802261",
"0.57538795",
"0.57538795",
"0.57538795",
"0.57538795",
"0.5673099",
"0.56684744",
"0.56684744",
"0.56684744",
"0.5662549",
"0.56495035",
"0.561091",
"0.56... | 0.7866888 | 1 |
Parses `text` in a clone of this parser. This is used for handling nested lists the same way as markdown_parser. | def inner_parse text # :nodoc:
parser = clone
parser.setup_parser text, @debug
parser.peg_parse
doc = parser.result
doc.accept @formatter
doc.parts
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def parse_from_text(text)\n parser = TextParser.new\n parser.parse_text(text, self)\n return self\n end",
"def parse(text)\n parse_references(text) if @project\n parse_emoji(text)\n\n text\n end",
"def parse_text(text)\n\t\tNode.destroy_all(work_id: self.id)\n\t\tLink.destro... | [
"0.6582587",
"0.6342226",
"0.6322666",
"0.6115986",
"0.609669",
"0.6095196",
"0.605687",
"0.60095567",
"0.59244007",
"0.5858823",
"0.57435197",
"0.5741568",
"0.57065386",
"0.5674354",
"0.5619465",
"0.5609627",
"0.5593978",
"0.5565156",
"0.5560928",
"0.55363137",
"0.5531371",
... | 0.6383787 | 1 |
Finds a link reference for `label` and creates a new link to it with `content` as the link text. If `label` was not encountered in the referencegathering parser pass the label and content are reconstructed with the linking `text` (usually whitespace). | def link_to content, label = content, text = nil
raise ParseError, 'enable notes extension' if
content.start_with? '^' and label.equal? content
if ref = @references[label] then
"{#{content}}[#{ref}]"
elsif label.equal? content then
"[#{content}]#{text}"
else
"[#{content}]#{text}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reference label, link\n if ref = @unlinked_references.delete(label) then\n ref.replace link\n end\n\n @references[label] = link\n end",
"def text_link(label,options={})\n options[:label]=label\n set RGhost::TextLinkIn.new(options)\n end",
"def label_link_filter(text)\n project... | [
"0.67071855",
"0.6243332",
"0.61160827",
"0.6042388",
"0.578168",
"0.5774807",
"0.57340604",
"0.5701518",
"0.5690202",
"0.5639831",
"0.55969",
"0.55477434",
"0.55280906",
"0.54484844",
"0.5357942",
"0.5341251",
"0.53242147",
"0.5308221",
"0.52912956",
"0.52764523",
"0.5176574... | 0.6754168 | 0 |
Creates an RDoc::Markup::ListItem by parsing the `unparsed` content from the first parsing pass. | def list_item_from unparsed
parsed = inner_parse unparsed.join
RDoc::Markup::ListItem.new nil, *parsed
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_list_item indent, item_type = nil\n p :list_item_start => [indent, item_type] if @debug\n\n list_item = RDoc::Markup::ListItem.new item_type\n\n until @tokens.empty? do\n type, data, column = get\n\n if column < indent and\n not type == :NEWLINE and\n (type != :INDENT o... | [
"0.61793053",
"0.5867472",
"0.5867472",
"0.5576961",
"0.55732507",
"0.5464326",
"0.5448657",
"0.5444213",
"0.5333044",
"0.5333044",
"0.528445",
"0.5208461",
"0.52054375",
"0.51469815",
"0.51233894",
"0.5120586",
"0.51159775",
"0.5103568",
"0.50989294",
"0.50931853",
"0.503786... | 0.83496493 | 0 |
Stores `label` as a note and fills in previously unknown note references. | def note label
#foottext = "rdoc-label:foottext-#{label}:footmark-#{label}"
#ref.replace foottext if ref = @unlinked_notes.delete(label)
@notes[label] = foottext
#"{^1}[rdoc-label:footmark-#{label}:foottext-#{label}] "
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_label label\n # added case for user just using a string\n case label\n when String\n # what if no form at this point\n @label_unattached = true unless @form\n label = Label.new @form, {:text => label}\n end\n @label = label\n # in the case of app it won't ... | [
"0.63725305",
"0.6340136",
"0.6293523",
"0.62302744",
"0.62150997",
"0.61846775",
"0.6173791",
"0.6109299",
"0.60451204",
"0.60434544",
"0.6031726",
"0.6021544",
"0.6021544",
"0.5958431",
"0.593963",
"0.59350646",
"0.59317154",
"0.590783",
"0.588988",
"0.5889552",
"0.586161",... | 0.76206315 | 0 |
Creates a new link for the footnote `reference` and adds the reference to the note order list for proper display at the end of the document. | def note_for ref
@note_order << ref
label = @note_order.length
"{*#{label}}[rdoc-label:foottext-#{label}:footmark-#{label}]"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_ref_link(index)\n %Q([<a href=\"##{NOTE}-#{index}\">#{index}</a>])\n end",
"def add_footnote content\n index = @footnotes.length / 2 + 1\n\n footmark_link = \"{^#{index}}[rdoc-label:footmark-#{index}:foottext-#{index}]\"\n\n @footnotes << RDoc::Markup::Paragraph.new(footmark_link, ' ', ... | [
"0.62371004",
"0.6160416",
"0.60637075",
"0.5963386",
"0.59520316",
"0.5753668",
"0.57351434",
"0.56127036",
"0.55902714",
"0.5572727",
"0.5563335",
"0.55564827",
"0.55512935",
"0.5538892",
"0.5507195",
"0.54724026",
"0.54423076",
"0.5418113",
"0.5406558",
"0.5384097",
"0.535... | 0.668604 | 0 |
:nodoc: Creates an RDoc::Markup::Paragraph from `parts` and including extensionspecific behavior | def paragraph parts
parts = parts.map do |part|
if "\n" == part then
RDoc::Markup::HardBreak.new
else
part
end
end if break_on_newline?
RDoc::Markup::Paragraph.new(*parts)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_paragraph(content)\n text = Text.new(content)\n run = Run.new\n run << text\n paragraph = Paragraph.new\n paragraph << run\n paragraph\nend",
"def parse_paragraph; end",
"def parse_paragraph document, par, env\n paragraph = Paragraph.new(par)\n\n if env == nil\n is_indented, env = B... | [
"0.6478229",
"0.6444247",
"0.6423046",
"0.6289644",
"0.62852883",
"0.62852883",
"0.62407607",
"0.6217149",
"0.6185488",
"0.60824174",
"0.60810643",
"0.60459584",
"0.6037933",
"0.60019106",
"0.59126776",
"0.5869946",
"0.58512497",
"0.58281595",
"0.58023196",
"0.5779343",
"0.57... | 0.80128896 | 0 |
Parses `markdown` into an RDoc::Document | def parse markdown
@references = {}
@unlinked_references = {}
markdown += "\n\n"
setup_parser markdown, @debug
peg_parse 'References'
if notes? then
@footnotes = {}
setup_parser markdown, @debug
peg_parse 'Notes'
# using note_order on the first pass wo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def rst_to_md(rst)\n return PandocRuby.convert(rst, :from => :rst, :to => :markdown)\nend",
"def markdown(doc)\n doc = Nokogiri::HTML(doc)\n if doc.at(\"body\").nil?\n doc = \"\"\n else\n doc = ReverseMarkdown.convert(doc.at(\"body\").inner_html)\n end\n end",
"def parse!(markup)\n ... | [
"0.7050478",
"0.69929373",
"0.67569125",
"0.6724586",
"0.66783065",
"0.6674347",
"0.6661156",
"0.66235346",
"0.65852463",
"0.6567745",
"0.65150803",
"0.65106165",
"0.64996004",
"0.64982563",
"0.6461671",
"0.63974684",
"0.6353917",
"0.6344491",
"0.632807",
"0.6325702",
"0.6254... | 0.67619914 | 2 |
Stores `label` as a reference to `link` and fills in previously unknown link references. | def reference label, link
if ref = @unlinked_references.delete(label) then
ref.replace link
end
@references[label] = link
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve_link(label)\n label = label.to_sym unless label.nil?\n lnk = @links[label] || @links[nil]\n return nil if lnk.nil?\n set_link_target(lnk) if lnk.target.nil?\n lnk\n end",
"def link_labels\n {}\n end",
"def link(label, target, op, flow_name=nil)\n label = lab... | [
"0.67618346",
"0.6478124",
"0.6380902",
"0.6214239",
"0.6180679",
"0.6020497",
"0.5998389",
"0.5936329",
"0.5890724",
"0.58703655",
"0.58595747",
"0.58382034",
"0.5838012",
"0.58293086",
"0.5791197",
"0.57658094",
"0.5727605",
"0.5722958",
"0.57019556",
"0.56921864",
"0.56836... | 0.80465794 | 0 |
Wraps `text` in strong markup for rdoc inline formatting | def strong text
if text =~ /\A[a-z\d.\/-]+\z/i then
"*#{text}*"
else
"<b>#{text}</b>"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def strong(txt)\n enclose('strong', txt)\n end",
"def wrap\n @text\n end",
"def text_block(text)\n h(text).gsub(/\\n/, '<br/>').html_safe\n end",
"def format_text(text)\n h(text.to_s).gsub(/\\n/, '<br>').html_safe\n end",
"def format_text(text)\n h(text.to_s).gsub(/\\n/, '<... | [
"0.7088065",
"0.6884279",
"0.6825236",
"0.6708803",
"0.6708803",
"0.66539603",
"0.6531069",
"0.64091134",
"0.6387332",
"0.63514626",
"0.6351459",
"0.63396585",
"0.63206285",
"0.6318846",
"0.6280613",
"0.62617207",
"0.62597865",
"0.6229905",
"0.61811274",
"0.6161669",
"0.61392... | 0.67416227 | 3 |
Wraps `text` in strike markup for rdoc inline formatting | def strike text
if text =~ /\A[a-z\d.\/-]+\z/i then
"~#{text}~"
else
"<s>#{text}</s>"
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wrap\n @text\n end",
"def wrap(text)\n return text if @done\n\n text = \"#{@pre_wrap.values}#{text}\" if @pre_wrap\n\n if dyn_params[:id]\n @tag ||= 'div'\n end\n\n if @tag\n if text.blank? && EMPTY_TAGS.include?(@tag)\n res = \"#{@pre_wrap}<#{@tag}#{pa... | [
"0.66042775",
"0.65247667",
"0.6487266",
"0.63706243",
"0.6213938",
"0.61567795",
"0.61352146",
"0.61271024",
"0.61271024",
"0.61124945",
"0.6099652",
"0.60757565",
"0.605241",
"0.6039666",
"0.6035695",
"0.601474",
"0.59970915",
"0.59960496",
"0.598829",
"0.5952582",
"0.59166... | 0.6838777 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.