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
Lists all tapes. API Key Scope: tapes / index
def index_tapes_by_pool_with_http_info(pool_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.index_tapes_by_pool ...' end # verify the required parameter 'pool_id' is set if @api_client.config.client_side_validation && pool_id.nil? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @tapes = Tape.all\n end", "def index\n @tarots = Tarot.all\n end", "def index\n @tunes = Tune.all\n end", "def index\n @taps = Tap.all\n end", "def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tun...
[ "0.73053455", "0.6834083", "0.67673725", "0.6723912", "0.6592991", "0.65795475", "0.65651053", "0.6564454", "0.65553343", "0.65553343", "0.65553343", "0.6479786", "0.63760966", "0.6351924", "0.6328797", "0.627339", "0.6256853", "0.6248856", "0.62472147", "0.62313294", "0.6226...
0.0
-1
Lists all tapes. API Key Scope: tapes / index
def index_tapes_by_tape_library(tape_library_id, opts = {}) data, _status_code, _headers = index_tapes_by_tape_library_with_http_info(tape_library_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @tapes = Tape.all\n end", "def index\n @tarots = Tarot.all\n end", "def index\n @tunes = Tune.all\n end", "def index\n @taps = Tap.all\n end", "def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tun...
[ "0.7304551", "0.6834718", "0.6767561", "0.67243123", "0.6594579", "0.65806556", "0.65656525", "0.6565334", "0.6556385", "0.6556385", "0.6556385", "0.6481384", "0.6374354", "0.6352452", "0.63298684", "0.6276484", "0.62576556", "0.6249787", "0.62455964", "0.6231836", "0.6228720...
0.0
-1
Lists all tapes. API Key Scope: tapes / index
def index_tapes_by_tape_library_with_http_info(tape_library_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.index_tapes_by_tape_library ...' end # verify the required parameter 'tape_library_id' is set if @api_client.config.client_sid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @tapes = Tape.all\n end", "def index\n @tarots = Tarot.all\n end", "def index\n @tunes = Tune.all\n end", "def index\n @taps = Tap.all\n end", "def index\n @tunes = Tune.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tun...
[ "0.7304551", "0.6834718", "0.6767561", "0.67243123", "0.6594579", "0.65806556", "0.65656525", "0.6565334", "0.6556385", "0.6556385", "0.6556385", "0.6481384", "0.6374354", "0.6352452", "0.63298684", "0.6276484", "0.62576556", "0.6249787", "0.62455964", "0.6231836", "0.6228720...
0.0
-1
Get mount status of Tape. API Key Scope: tapes / mount_status
def mount_status_tape(tape_id, opts = {}) data, _status_code, _headers = mount_status_tape_with_http_info(tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mount_status_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.mount_status_tape ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.ni...
[ "0.65815187", "0.64227724", "0.6223293", "0.6081219", "0.5859042", "0.58451957", "0.5823773", "0.5808824", "0.5806028", "0.5748464", "0.57191974", "0.5688184", "0.5683826", "0.5671489", "0.5669985", "0.5637585", "0.5630751", "0.5619874", "0.56155235", "0.5588589", "0.558555",...
0.6987487
0
Get mount status of Tape. API Key Scope: tapes / mount_status
def mount_status_tape_with_http_info(tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.mount_status_tape ...' end # verify the required parameter 'tape_id' is set if @api_client.config.client_side_validation && tape_id.nil? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mount_status_tape(tape_id, opts = {})\n data, _status_code, _headers = mount_status_tape_with_http_info(tape_id, opts)\n data\n end", "def mounts_info\n @mounts_info ||= vault_client.request(:get, \"/v1/sys/internal/ui/mounts\")\n rescue Vault::VaultError\n unable_to_determine...
[ "0.6988358", "0.64238703", "0.62242055", "0.6082232", "0.5857573", "0.58461565", "0.58223677", "0.5809651", "0.5804971", "0.5749684", "0.5716448", "0.56881696", "0.56844217", "0.5672868", "0.56696784", "0.56352353", "0.56295294", "0.56202954", "0.56131303", "0.5586351", "0.55...
0.6582322
1
Get mount status of Tape. API Key Scope: tapes / mount_status
def mount_status_tape_by_pool(pool_id, tape_id, opts = {}) data, _status_code, _headers = mount_status_tape_by_pool_with_http_info(pool_id, tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mount_status_tape(tape_id, opts = {})\n data, _status_code, _headers = mount_status_tape_with_http_info(tape_id, opts)\n data\n end", "def mount_status_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.m...
[ "0.6987487", "0.65815187", "0.64227724", "0.6223293", "0.5859042", "0.58451957", "0.5823773", "0.5808824", "0.5806028", "0.5748464", "0.57191974", "0.5688184", "0.5683826", "0.5671489", "0.5669985", "0.5637585", "0.5630751", "0.5619874", "0.56155235", "0.5588589", "0.558555",...
0.6081219
4
Get mount status of Tape. API Key Scope: tapes / mount_status
def mount_status_tape_by_pool_with_http_info(pool_id, tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.mount_status_tape_by_pool ...' end # verify the required parameter 'pool_id' is set if @api_client.config.client_side_validatio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mount_status_tape(tape_id, opts = {})\n data, _status_code, _headers = mount_status_tape_with_http_info(tape_id, opts)\n data\n end", "def mount_status_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.m...
[ "0.6987487", "0.65815187", "0.64227724", "0.6223293", "0.6081219", "0.5859042", "0.58451957", "0.5823773", "0.5808824", "0.5806028", "0.5748464", "0.57191974", "0.5688184", "0.5683826", "0.5671489", "0.5669985", "0.5637585", "0.5630751", "0.5619874", "0.56155235", "0.5588589"...
0.55224675
24
Get mount status of Tape. API Key Scope: tapes / mount_status
def mount_status_tape_by_tape_library(tape_library_id, tape_id, opts = {}) data, _status_code, _headers = mount_status_tape_by_tape_library_with_http_info(tape_library_id, tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mount_status_tape(tape_id, opts = {})\n data, _status_code, _headers = mount_status_tape_with_http_info(tape_id, opts)\n data\n end", "def mount_status_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.m...
[ "0.6987487", "0.65815187", "0.64227724", "0.6081219", "0.5859042", "0.58451957", "0.5823773", "0.5808824", "0.5806028", "0.5748464", "0.57191974", "0.5688184", "0.5683826", "0.5671489", "0.5669985", "0.5637585", "0.5630751", "0.5619874", "0.56155235", "0.5588589", "0.558555",...
0.6223293
3
Get mount status of Tape. API Key Scope: tapes / mount_status
def mount_status_tape_by_tape_library_with_http_info(tape_library_id, tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.mount_status_tape_by_tape_library ...' end # verify the required parameter 'tape_library_id' is set if @api_cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mount_status_tape(tape_id, opts = {})\n data, _status_code, _headers = mount_status_tape_with_http_info(tape_id, opts)\n data\n end", "def mount_status_tape_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.m...
[ "0.6988358", "0.6582322", "0.64238703", "0.62242055", "0.6082232", "0.5857573", "0.58461565", "0.58223677", "0.5809651", "0.5804971", "0.5749684", "0.5716448", "0.56881696", "0.5672868", "0.56696784", "0.56352353", "0.56295294", "0.56202954", "0.56131303", "0.5586351", "0.558...
0.56844217
13
Displays a specific tape. API Key Scope: tapes / show
def show_tape(tape_id, opts = {}) data, _status_code, _headers = show_tape_with_http_info(tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\n end", "def show\n @mag_tape = MagTape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n fo...
[ "0.7273812", "0.7042568", "0.70214087", "0.7020266", "0.68392646", "0.67891186", "0.6770354", "0.6768501", "0.6535275", "0.64061266", "0.63573396", "0.6324193", "0.62492365", "0.61649555", "0.6115621", "0.60963", "0.60786265", "0.6057338", "0.6033612", "0.60285956", "0.600045...
0.7783135
0
Displays a specific tape. API Key Scope: tapes / show
def show_tape_with_http_info(tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.show_tape ...' end # verify the required parameter 'tape_id' is set if @api_client.config.client_side_validation && tape_id.nil? fail ArgumentEr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end", "def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\...
[ "0.7783135", "0.7273812", "0.7042568", "0.70214087", "0.7020266", "0.67891186", "0.6770354", "0.6768501", "0.6535275", "0.64061266", "0.63573396", "0.6324193", "0.62492365", "0.61649555", "0.6115621", "0.60963", "0.60786265", "0.6057338", "0.6033612", "0.60285956", "0.6000454...
0.68392646
5
Displays a specific tape. API Key Scope: tapes / show
def show_tape_by_pool(pool_id, tape_id, opts = {}) data, _status_code, _headers = show_tape_by_pool_with_http_info(pool_id, tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end", "def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\...
[ "0.7783135", "0.7273812", "0.7042568", "0.70214087", "0.7020266", "0.68392646", "0.67891186", "0.6768501", "0.6535275", "0.64061266", "0.63573396", "0.6324193", "0.62492365", "0.61649555", "0.6115621", "0.60963", "0.60786265", "0.6057338", "0.6033612", "0.60285956", "0.600045...
0.6770354
7
Displays a specific tape. API Key Scope: tapes / show
def show_tape_by_pool_with_http_info(pool_id, tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_by_pool ...' end # verify the required parameter 'pool_id' is set if @api_client.config.client_side_validation && pool_id.nil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end", "def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\...
[ "0.7784493", "0.7274049", "0.7043217", "0.7021356", "0.7020796", "0.68402946", "0.6789417", "0.6772157", "0.6769031", "0.65373653", "0.64059764", "0.6358315", "0.6325184", "0.62494045", "0.6164397", "0.611568", "0.60954654", "0.6077425", "0.6056571", "0.60336244", "0.6029853"...
0.60015434
21
Displays a specific tape. API Key Scope: tapes / show
def show_tape_by_tape_library(tape_library_id, tape_id, opts = {}) data, _status_code, _headers = show_tape_by_tape_library_with_http_info(tape_library_id, tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end", "def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\...
[ "0.7783135", "0.7273812", "0.7042568", "0.70214087", "0.7020266", "0.68392646", "0.67891186", "0.6770354", "0.6768501", "0.64061266", "0.63573396", "0.6324193", "0.62492365", "0.61649555", "0.6115621", "0.60963", "0.60786265", "0.6057338", "0.6033612", "0.60285956", "0.600045...
0.6535275
9
Displays a specific tape. API Key Scope: tapes / show
def show_tape_by_tape_library_with_http_info(tape_library_id, tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_by_tape_library ...' end # verify the required parameter 'tape_library_id' is set if @api_client.config.clien...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape(tape_id, opts = {})\n data, _status_code, _headers = show_tape_with_http_info(tape_id, opts)\n data\n end", "def show\n @tape_type = TapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tape_type }\n end\...
[ "0.7783135", "0.7273812", "0.7042568", "0.70214087", "0.7020266", "0.68392646", "0.67891186", "0.6770354", "0.6768501", "0.6535275", "0.64061266", "0.63573396", "0.6324193", "0.62492365", "0.61649555", "0.6115621", "0.60963", "0.60786265", "0.6057338", "0.6033612", "0.6000454...
0.60285956
20
Display statistic for a specific tape. API Key Scope: tape_stats / show
def show_tape_stat(tape_id, opts = {}) data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape_stat_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_stat ...'\n end\n # verify the required parameter 'tape_id' is set\n if @api_client.config.client_side_validation && tape_id.nil?\n ...
[ "0.7237879", "0.71784854", "0.71049523", "0.69374514", "0.68808407", "0.67204887", "0.66114384", "0.66000193", "0.65713936", "0.6507892", "0.6413121", "0.640371", "0.640371", "0.63579345", "0.62870604", "0.61807364", "0.616873", "0.61666304", "0.6146121", "0.61160773", "0.605...
0.75545305
0
Display statistic for a specific tape. API Key Scope: tape_stats / show
def show_tape_stat_with_http_info(tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_stat ...' end # verify the required parameter 'tape_id' is set if @api_client.config.client_side_validation && tape_id.nil? fail ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end", "def index_tape_stats(opts = {})\n data, _status_code, _headers = index_tape_stats_with_http_info(opts)\n data\n end", "def index_tape_stats_with_http_in...
[ "0.7555227", "0.7179532", "0.71051323", "0.6938183", "0.6879742", "0.6720805", "0.66113275", "0.6599838", "0.65700126", "0.65088254", "0.6414262", "0.640454", "0.640454", "0.63591385", "0.62862283", "0.6182482", "0.6168954", "0.6165637", "0.6147543", "0.6117626", "0.6058842",...
0.7238161
1
Display statistic for a specific tape. API Key Scope: tape_stats / show
def show_tape_stat_by_pool(pool_id, tape_id, opts = {}) data, _status_code, _headers = show_tape_stat_by_pool_with_http_info(pool_id, tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end", "def show_tape_stat_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_...
[ "0.75545305", "0.7237879", "0.71784854", "0.71049523", "0.68808407", "0.67204887", "0.66114384", "0.66000193", "0.65713936", "0.6507892", "0.6413121", "0.640371", "0.640371", "0.63579345", "0.62870604", "0.61807364", "0.616873", "0.61666304", "0.6146121", "0.61160773", "0.605...
0.69374514
4
Display statistic for a specific tape. API Key Scope: tape_stats / show
def show_tape_stat_by_pool_with_http_info(pool_id, tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_stat_by_pool ...' end # verify the required parameter 'pool_id' is set if @api_client.config.client_side_validation && p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end", "def show_tape_stat_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_...
[ "0.75545305", "0.7237879", "0.71784854", "0.71049523", "0.69374514", "0.68808407", "0.66114384", "0.66000193", "0.65713936", "0.6507892", "0.6413121", "0.640371", "0.640371", "0.63579345", "0.62870604", "0.61807364", "0.616873", "0.61666304", "0.6146121", "0.61160773", "0.605...
0.67204887
6
Display statistic for a specific tape. API Key Scope: tape_stats / show
def show_tape_stat_by_tape_library(tape_library_id, tape_id, opts = {}) data, _status_code, _headers = show_tape_stat_by_tape_library_with_http_info(tape_library_id, tape_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end", "def show_tape_stat_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_...
[ "0.75545305", "0.7237879", "0.71784854", "0.71049523", "0.69374514", "0.68808407", "0.67204887", "0.66114384", "0.65713936", "0.6507892", "0.6413121", "0.640371", "0.640371", "0.63579345", "0.62870604", "0.61807364", "0.616873", "0.61666304", "0.6146121", "0.61160773", "0.605...
0.66000193
8
Display statistic for a specific tape. API Key Scope: tape_stats / show
def show_tape_stat_by_tape_library_with_http_info(tape_library_id, tape_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_stat_by_tape_library ...' end # verify the required parameter 'tape_library_id' is set if @api_client.co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_tape_stat(tape_id, opts = {})\n data, _status_code, _headers = show_tape_stat_with_http_info(tape_id, opts)\n data\n end", "def show_tape_stat_with_http_info(tape_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TapesApi.show_tape_...
[ "0.7555227", "0.7238161", "0.7179532", "0.71051323", "0.6938183", "0.6879742", "0.6720805", "0.6599838", "0.65700126", "0.65088254", "0.6414262", "0.640454", "0.640454", "0.63591385", "0.62862283", "0.6182482", "0.6168954", "0.6165637", "0.6147543", "0.6117626", "0.6058842", ...
0.66113275
7
:nodoc: Finds message according to given parameters
def find_message(recipient, subject) messages = filter_by_subject(recipient[/[^@]+/], subject) latest_message(messages) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lookup_message(name)\n\t\tend", "def find_by_name( name )\n\t\t\tnamed_message = nil\n\t\t\t@messages.values.each do |message|\n\t\t\t\tif message.descriptor.name == name\n\t\t\t\t\tnamed_message = message\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn named_message\n\t\tend", "def find_by_type( type )\n\t\t\tretur...
[ "0.7554267", "0.6928289", "0.6470047", "0.6375177", "0.6345039", "0.6291448", "0.6225567", "0.62252325", "0.6203884", "0.6171332", "0.6156813", "0.60782176", "0.60745215", "0.6062432", "0.6017277", "0.60140544", "0.59767854", "0.5947759", "0.58998543", "0.58998543", "0.589759...
0.6525667
2
Defaults a slug with title
def slug_by_title "#{title.gsub(/[^a-zA-Z0-9]/, '-')}-#{id}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_slug\n self.slug = title.downcase.gsub(\" \", \"_\") if slug.blank?\n slug\n end", "def set_slug\n self.slug = title.parameterize\n end", "def set_slug\n self.slug = title.downcase.tr(\" \", \"_\") if slug.blank?\n slug\n end", "def set_slug\n self.slug = self.title.parameteriz...
[ "0.85238653", "0.8463224", "0.84447926", "0.83729815", "0.8113656", "0.8109907", "0.80504274", "0.8040934", "0.79948485", "0.7925305", "0.79106814", "0.7835157", "0.77336377", "0.7720772", "0.7665326", "0.76653206", "0.7654618", "0.7644685", "0.764312", "0.7631017", "0.760854...
0.71124005
43
GET /staff_measurements GET /staff_measurements.json
def index @staff_measurements = StaffMeasurement.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_measurements\n render json: @data_source.measurements\n end", "def set_staff_measurement\n @staff_measurement = StaffMeasurement.find(params[:id])\n end", "def measurements_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#mea...
[ "0.73112553", "0.67767024", "0.67756605", "0.65740806", "0.65740806", "0.65740806", "0.6500111", "0.64957947", "0.64909726", "0.6474797", "0.64459884", "0.6412318", "0.6409012", "0.640893", "0.6339587", "0.6338455", "0.630764", "0.6218078", "0.6204607", "0.6180494", "0.617692...
0.7517941
0
GET /staff_measurements/1 GET /staff_measurements/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @staff_measurements = StaffMeasurement.all\n end", "def get_measurements\n render json: @data_source.measurements\n end", "def set_staff_measurement\n @staff_measurement = StaffMeasurement.find(params[:id])\n end", "def show\n @measurement = Measurement.find(params[:id])\n\n ...
[ "0.7353951", "0.72948515", "0.69890344", "0.6937414", "0.6851983", "0.67921436", "0.67522275", "0.67190343", "0.66883665", "0.66059154", "0.6555248", "0.6526428", "0.6516874", "0.64901954", "0.64901954", "0.64901954", "0.6468954", "0.6464006", "0.643451", "0.6406166", "0.6348...
0.0
-1
POST /staff_measurements POST /staff_measurements.json
def create @staff_measurement = StaffMeasurement.new(staff_measurement_params) respond_to do |format| if @staff_measurement.save format.html { redirect_to @staff_measurement, notice: (t 'staff_measurements.title')+(t 'actions.created')} format.json { render action: 'show', status: :create...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def staff_measurement_params\n params.require(:staff_measurement).permit(:staff_id, :uniform_id, :measurement_type, :value, :unit_type_id)\n end", "def set_staff_measurement\n @staff_measurement = StaffMeasurement.find(params[:id])\n end", "def create\n @measurement = Measurement.new(param...
[ "0.7135226", "0.67542064", "0.65739465", "0.6572687", "0.65565306", "0.65565306", "0.6531336", "0.6520251", "0.65093344", "0.6501826", "0.6462031", "0.6428928", "0.63540024", "0.6311951", "0.62123066", "0.61335415", "0.6123431", "0.6109178", "0.6099036", "0.6091802", "0.60867...
0.72072136
0
PATCH/PUT /staff_measurements/1 PATCH/PUT /staff_measurements/1.json
def update respond_to do |format| if @staff_measurement.update(staff_measurement_params) format.html { redirect_to @staff_measurement, notice: (t 'staff_measurements.title')+(t 'actions.updated')} format.json { head :no_content } else format.html { render action: 'edit' } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @measurement.update(correct_parameters_for_mongo)\n format.html { redirect_to @measurement, notice: \"Measurement was successfully updated.\" }\n format.json { render :show, status: :ok, location: @measurement }\n else\n format.html { rende...
[ "0.67170537", "0.6695035", "0.66580087", "0.66580087", "0.66580087", "0.66223186", "0.6587538", "0.65853924", "0.65627384", "0.6551661", "0.65467185", "0.65467185", "0.6544821", "0.6536741", "0.6513676", "0.64943093", "0.64790624", "0.6476925", "0.6476387", "0.64751244", "0.6...
0.75406903
0
DELETE /staff_measurements/1 DELETE /staff_measurements/1.json
def destroy @staff_measurement.destroy respond_to do |format| format.html { redirect_to staff_measurements_url, notice: (t 'staff_measurements.title')+(t 'actions.removed') } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @dbh_measurement.destroy\n respond_to do |format|\n format.html { redirect_to dbh_measurements_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_measurement.destroy\n respond_to do |format|\n format.html { redirect_to user_measurements_url }\...
[ "0.7133312", "0.7084401", "0.70323944", "0.70258075", "0.7021743", "0.6999892", "0.6982216", "0.6982216", "0.6982216", "0.6979784", "0.69768804", "0.6935123", "0.6935123", "0.6907299", "0.6876581", "0.68341213", "0.6811747", "0.6807033", "0.67687345", "0.67687345", "0.6768734...
0.7560766
0
Use callbacks to share common setup or constraints between actions.
def set_staff_measurement @staff_measurement = StaffMeasurement.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.6163754", "0.6045816", "0.5944853", "0.59169096", "0.58892167", "0.58342934", "0.5776148", "0.57057375", "0.57057375", "0.56534296", "0.56209534", "0.54244673", "0.54101455", "0.54101455", "0.54101455", "0.53951085", "0.5378493", "0.53563684", "0.53399915", "0.5338049", "0...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def staff_measurement_params params.require(:staff_measurement).permit(:staff_id, :uniform_id, :measurement_type, :value, :unit_type_id) 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
type could be ladp, horizon or mozy
def initialize(subdomain = nil, type = 'mozy') @subdomain = subdomain @type = type self.class.set_url("https://#{@subdomain}.mozypro.com/login/user") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bike_type(type)\n if type == 1\n @discipline = \"mountain\"\n @frame = \"mountain\"\n elsif type == 2\n @discipline = \"road\"\n @frame = \"road\"\n else\n @discipline = \"cyclo-cross\"\n @frame = \"cyclo-cross\"\n end\n @discipline\n @frame\n end", "def set_t...
[ "0.66726726", "0.6429254", "0.6274507", "0.60714024", "0.60548383", "0.60228145", "0.59751844", "0.5972987", "0.59055114", "0.584823", "0.58131075", "0.57939947", "0.57939947", "0.57897425", "0.5745344", "0.5742331", "0.5742331", "0.5742331", "0.5742331", "0.5742331", "0.5742...
0.0
-1
Public: get current url
def current_url page.current_url end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_url\n request.env['REQUEST_URI']\n end", "def current_url\n evaluate(\"window.top.location.href\")\n end", "def current_url; end", "def current_url\n return Knj::Web.url\n end", "def current_path\n URI.parse(current_url).path\nend", "def current_url\n @rawpage.curren...
[ "0.88253194", "0.8434936", "0.83938473", "0.8362959", "0.8267767", "0.817371", "0.81600547", "0.812003", "0.81106406", "0.7864976", "0.774946", "0.77321", "0.7727349", "0.76816225", "0.76720923", "0.76369196", "0.75834477", "0.7439597", "0.74388266", "0.7263823", "0.7226075",...
0.83635825
4
Public: get a computer message
def computer_message computer_msg.text end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def receive_message(msg)\n speakers = get_speakers(@resource[:name])\n answer = speakers.first.send(msg)\n Puppet.debug(\"#{resource[:name]} <= #{msg} <= #{answer}\")\n answer.to_s\n end", "def getMessage()\n return @message\n end", "def recv_mess()\n\tmenssage = @client.gets.chomp\n\treturn (...
[ "0.649959", "0.64314663", "0.641737", "0.6404763", "0.6404763", "0.6404763", "0.63995373", "0.6382488", "0.6305288", "0.63040334", "0.63030547", "0.627711", "0.6266684", "0.6266684", "0.6260196", "0.6231331", "0.6222047", "0.6212143", "0.6204721", "0.61992264", "0.61898094", ...
0.86905974
1
class Logger class Formatter Format='%Y%m%d %H:%M:%S' def call(severity, time, progname, msg) Format % [severity, format_datetime(time),progname,msg] end end end
def display_main_menu puts '################################' puts '# {N}- Network Stuff #' puts '# {RF}- Read File #' # puts '# {GF}- Generate File #' # puts '# {D}- Run as Daemon #' # puts '# {TD}- Run as Trigger Daemon #' puts '# {Q}- Quit ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def formatter\n Proc.new{|severity, time,progname, msg|\n formatted_time = time.strftime(\"%Y-%m-%d,%H:%M:%S\")\n \"#{formatted_time},#{msg.to_s.strip}\\n\"\n }\n end", "def call(severity, time, _progname, msg)\n format(FORMAT, format_datetime(time), severity, msg2str(msg))\n end", "d...
[ "0.8381347", "0.78356457", "0.76781815", "0.76781815", "0.74327433", "0.73684174", "0.7351936", "0.7251882", "0.7251882", "0.7188343", "0.7188343", "0.7188343", "0.71852064", "0.71585864", "0.70840025", "0.701112", "0.69666535", "0.6932978", "0.69092846", "0.6880378", "0.6766...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_wishlist @wishlist = Wishlist.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
Only allow a trusted parameter "white list" through.
def wishlist_params params.require(:wishlist).permit(:name, :user_id, :movie_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
Given a hash with numeric values, return the key for the smallest value
def key_for_min_value(name_hash) name_hash = name_hash.sort_by {|key, value| value} name_array = [] name_hash.each do |key, value| name_array << key end return name_array[0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n hash.each do |key, value|\n if value < lowest_value\n lowest_value = value\n lowest_key = key\n end\n end\n lowest_key\nend", "def key_for_min_value(hash)\n lowest_key = nil\n lowest_value = Float::INFINITY\n...
[ "0.8821712", "0.8778191", "0.8777454", "0.87460524", "0.86893994", "0.86558706", "0.8652922", "0.8617675", "0.85882956", "0.85725", "0.8567739", "0.8551992", "0.8530141", "0.8530141", "0.85190165", "0.8493276", "0.8475453", "0.8475453", "0.8466014", "0.8449399", "0.84491575",...
0.0
-1
Verify that case exists in Court Listener database
def exists_in_CL if !cl_hash errors.add(:cite1, "doesn't exist in CourtListener database.") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_unexistent_course_registering_member\n\t\tregistering_member = Enrollment.new(:participantID => participants(:one).participantID, :courseID => \"nap09877\")\n\t\tassert Participant.find_by(participantID: registering_member.participantID), \"Member was not found in Participant database\"\n \t\tassert !Cour...
[ "0.6178062", "0.58827204", "0.5765016", "0.57383394", "0.5698939", "0.5549441", "0.55336493", "0.54502636", "0.5431103", "0.5415661", "0.53579175", "0.53579175", "0.53291404", "0.53230685", "0.5316553", "0.528241", "0.52796537", "0.52463305", "0.5221526", "0.5211882", "0.5203...
0.65576184
0
Return full Bluebook citation
def full_citation "#{name}, #{cite1} (#{date_decided.year})" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def citation\n a = []\n a << CGI.escapeHTML(coins_authors) unless coins_authors.empty?\n a << CGI.escapeHTML(coins_year.to_s) unless coins_year.nil?\n a << \"'#{CGI.escapeHTML(coins_atitle)}'\" unless coins_atitle.nil?\n a << \"<i>#{CGI.escapeHTML(coins_title)}</i>\" unless coins_title.nil?\n a <...
[ "0.68912715", "0.6714805", "0.6679035", "0.66646606", "0.6652391", "0.65776527", "0.65585834", "0.6527695", "0.6485657", "0.64793676", "0.6314151", "0.63026136", "0.6284565", "0.62707", "0.62615657", "0.62388676", "0.62101036", "0.6187095", "0.6172488", "0.61059403", "0.60705...
0.7952577
0
Get case info from CourtListener
def cl_hash if @cl_hash return @cl_hash else courtlistener = CourtListener.new @cl_hash = courtlistener.case_by_cite(cite1) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def case; Case.get(self.case_id); end", "def case; Case.get(self.case_id); end", "def case; Case.get(self.case_id); end", "def cases; Case.get(self.cases_id); end", "def get_case_id\n end", "def get_course\n\t return TestCase.find(params[:id]).assignment.course\n end", "def contest_info\n @...
[ "0.5917773", "0.5917773", "0.5917773", "0.5856868", "0.5621202", "0.5503155", "0.53263426", "0.53045064", "0.52564067", "0.5253675", "0.52424276", "0.5212082", "0.5143297", "0.5106717", "0.50948477", "0.50840217", "0.50665015", "0.5046605", "0.5009593", "0.49936455", "0.49685...
0.6080533
0
Return text of main opinion
def opinion_url cl_hash["sub_opinions"][0] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nature_text\n return text_get(8, nature.first)\n end", "def text\n #[@organism, @symbol, @description, @aka, @protnames, @summary,@comentaries.join(\". \")].join(\". \") \n [@symbol, @description, @aka, @protnames, @summary].flatten.join(\". \") \n end", "def give_opinion\r\n retu...
[ "0.669008", "0.6603375", "0.6563013", "0.65435094", "0.6537405", "0.6537405", "0.6435266", "0.63170445", "0.6302871", "0.63027436", "0.62593454", "0.62538177", "0.6214066", "0.62017274", "0.6201552", "0.6194948", "0.61789566", "0.6173723", "0.6173723", "0.6170983", "0.6153586...
0.0
-1
Return five most recent citations as courtlistener urls
def recent_citations courtlistener = CourtListener.new citations = courtlistener.citing_opinions(cite1) citation_list = citations[0..4].map do |citation| data_hash = courtlistener.case_data_by_opinion(citation["citing_opinion"]) c = CLOpinion.new(data_hash) c.id = courtlistener.id_from_url...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_urls\n\n url_array = []\n top_five = 0\n\n while top_five < 5\n url_array << @news_instance[\"response\"][\"docs\"][top_five][\"web_url\"]\n top_five += 1\n end\n\n # returns the array\n return url_array\n\n end", "def get_last_fgc_courses(limit = 5)\n fgc_predictions.orde...
[ "0.6100725", "0.5829434", "0.57324934", "0.5506179", "0.55002487", "0.5469961", "0.546213", "0.5438312", "0.543607", "0.54281795", "0.5426684", "0.5402344", "0.5390171", "0.53790766", "0.53763837", "0.5345974", "0.5335427", "0.5309193", "0.52977395", "0.5257746", "0.52549595"...
0.7200833
0
Compare function for sorting simulators in order by OS Name: ascending OS Version: descending Device type: iPhone first, then ascending Model: ascending
def sim_list_compare(other) return os_name.to_s <=> other.os_name.to_s unless os_name == other.os_name return other.os_version <=> os_version unless os_version == other.os_version device1, model1 = device_and_model device2, model2 = other.device_and_model return device_compare(device1, dev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def device_and_model\n if os_name == :watchos\n # Sample string: Apple Watch Series 2 - 38mm\n name.split ' - '\n else\n # Sample string: \"iPhone 5s\" or \"iPhone 6 Plus\" or \"iPad Air 2\"\n if name.start_with? 'Apple TV'\n # The last part is the model, and the rest...
[ "0.6061653", "0.5878405", "0.5683818", "0.5599073", "0.5590243", "0.5523886", "0.55201197", "0.54918116", "0.54195356", "0.5411382", "0.53745365", "0.52997804", "0.52878785", "0.5262774", "0.5247064", "0.52034783", "0.52010405", "0.5187346", "0.51829267", "0.5182606", "0.5167...
0.6671567
0
Returns the [device, model] for use during sorting Examples: [iPhone, 5s], [iPhone, 6s Plus], [Apple Watch Series 2, 38mm]
def device_and_model if os_name == :watchos # Sample string: Apple Watch Series 2 - 38mm name.split ' - ' else # Sample string: "iPhone 5s" or "iPhone 6 Plus" or "iPad Air 2" if name.start_with? 'Apple TV' # The last part is the model, and the rest is the device ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def model_name\n fetch('device.model_name')\n end", "def product_model\n # CHANGED: DRYed\n # if recurring_monthly; elsif device_model.blank?; else <device_name_and_part_number>\n recurring_monthly ? \"Recurring Monthly\" : \\\n (device_model.blank? ? \"Unknown\" : \\\n (PRODUCT_...
[ "0.5502286", "0.5417474", "0.5389787", "0.5366722", "0.53261566", "0.5318222", "0.52888703", "0.5282843", "0.52723926", "0.5254035", "0.5253975", "0.523428", "0.52184886", "0.52065307", "0.5188185", "0.5146399", "0.5138291", "0.5118959", "0.51065534", "0.50929576", "0.5092957...
0.728325
0
Gets the simulators and transforms the simctl json into Simulator objects
def fetch_sims device_list = JSON.parse(list(['-j', 'devices']))['devices'] unless device_list.is_a?(Hash) msg = "Expected devices to be of type Hash but instated found #{device_list.class}" fail Fourflusher::Informative, msg end device_list.flat_map do |runtime_str, devices| ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simulators\n @instruments_simulators ||= lambda do\n fetch_devices[:out].chomp.split(\"\\n\").map do |line|\n stripped = line.strip\n if line_is_simulator?(stripped) &&\n !line_is_simulator_paired_with_watch?(stripped) &&\n !line_is_apple_tv?(stripped...
[ "0.7283886", "0.67518175", "0.58148575", "0.57392657", "0.5359357", "0.5224146", "0.5183207", "0.5160344", "0.5061691", "0.50410783", "0.5031672", "0.500877", "0.50056446", "0.49177882", "0.48672774", "0.48463887", "0.4838465", "0.4788344", "0.4766171", "0.4709509", "0.470783...
0.7409095
0
but extent="unknown" not explicitly combined with unit="character" in guidelines
def test_lost_gap_unknown # Some unknown number of lost characters assert_equal_fragment_transform '[.?]', '<gap reason="lost" extent="unknown" unit="character"/>' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dot_per_inch? = unit == 'dot-per-inch'", "def extent\n text(data.at_xpath(\"#{data_root}/did/physdesc/extent\"))\n end", "def genclase\n \"M\"\n end", "def specification(full_name); end", "def no_Units\n val = self.no_inch\n val = val.no_foot\n val = val.no_...
[ "0.5697451", "0.55706155", "0.55363756", "0.5298057", "0.52482486", "0.5226326", "0.5155259", "0.5143628", "0.50911313", "0.507288", "0.5025988", "0.502242", "0.50107896", "0.5006267", "0.4999274", "0.49832278", "0.49561796", "0.49468356", "0.49451718", "0.4926523", "0.491700...
0.48369223
30
should this have desc="vestiges"?
def test_vestige_lines_unknown # vestiges of an unspecified number of lines, mere smudges, visible assert_equal_fragment_transform 'vestig.?lin', '<gap reason="illegible" extent="unknown" unit="line"/>' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def desc; end", "def test_overriding_description\r\n\t\t# first, a feature with no description assigned\r\n\t\tfeatures = Feature.for_static_page(static_pages(:aboutus).id)\r\n\r\n\t\tassert_equal(\"Short description\", features.first[:short_description])\r\n\r\n\t\t# now, a feature with a description to overrid...
[ "0.6679729", "0.6505026", "0.65037006", "0.65037006", "0.64827603", "0.6396848", "0.63547945", "0.63491815", "0.62883586", "0.6232034", "0.6186079", "0.60783786", "0.60521275", "0.60101426", "0.60028994", "0.59702116", "0.59386975", "0.59114474", "0.5905018", "0.58974576", "0...
0.0
-1
no EpiDoc guideline, inherited from TEI
def test_quotation_marks # quotation marks on papyrus assert_equal_fragment_transform '"abc"', '<q>abc</q>' assert_equal_fragment_transform '"abc def ghi"', '<q>abc def ghi</q>' assert_equal_fragment_transform '"<:ἔλα 3. βα|corr|αιλαβα:> αὐτὰ"', '<q><choice><corr>ἔλα <lb n="3"/>βα</corr><sic>αιλαβα<...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base_docstring; end", "def docstring; end", "def docstring; end", "def doc; end", "def doc; end", "def doc; end", "def doc; end", "def link_documentation; end", "def doc_task; end", "def docs; end", "def doc=(_arg0); end", "def doc=(_arg0); end", "def doc=(_arg0); end", "def fulldoc_t...
[ "0.71276194", "0.6911503", "0.6911503", "0.68088275", "0.68088275", "0.68088275", "0.68088275", "0.6457565", "0.64047605", "0.6318108", "0.62609994", "0.62609994", "0.62609994", "0.62505317", "0.61257935", "0.6088845", "0.6073621", "0.6018481", "0.60095745", "0.59795177", "0....
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_blog @blog = Blog.first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163754", "0.6045816", "0.5944853", "0.59169096", "0.58892167", "0.58342934", "0.5776148", "0.57057375", "0.57057375", "0.56534296", "0.56209534", "0.54244673", "0.54101455", "0.54101455", "0.54101455", "0.53951085", "0.5378493", "0.53563684", "0.53399915", "0.5338049", "0...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def blog_params params.require(:blog).permit(:name, :about_url, :terms_url, :copyright_text) 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
GET /signspot/projects/1 GET /signspot/projects/1.json
def show @signspot_project = Signspot::Project.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @signspot_project } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list\n get 'projects'\n end", "def listprojects\n get('listprojects.json')['projects']\n end", "def projects\n request(method: 'getAllProjects')\n end", "def index\n # @projects = @current_user.projects\n @projects = Project.all\n json_response(@projects)\n end", "def index\n ...
[ "0.75685155", "0.7524928", "0.74281216", "0.7321878", "0.7267379", "0.72537833", "0.72503316", "0.7235318", "0.7186369", "0.71671736", "0.7143197", "0.71401334", "0.7139311", "0.71193016", "0.7105931", "0.70952004", "0.7087116", "0.70859987", "0.70428395", "0.7035838", "0.703...
0.77334166
0
GET /signspot/projects/new GET /signspot/projects/new.json
def new @signspot_project = Signspot::Project.new respond_to do |format| format.html # new.html.erb format.json { render json: @signspot_project } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @project = Project.new\n @services = Service.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "def new\n @project = current_user.projects.new\n\n respond_to do |format|\n format.html # new.html.erb\n...
[ "0.79497075", "0.7862129", "0.777953", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", "0.77417386", ...
0.80592346
0
POST /signspot/projects POST /signspot/projects.json
def create @signspot_project = Signspot::Project.new(params[:signspot_project]) respond_to do |format| if @signspot_project.save format.html { redirect_to @signspot_project, notice: 'Project was successfully created.' } format.json { render json: @signspot_project, status: :created, locat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n find_projects(params[:api_key])\n end", "def create\n @projects = current_user.projects\n @project = current_user.projects.new(project_params)\n\n respond_to do |format|\n if @projects << @project\n format.html { redirect_to user_projects_path(current_user), notice: 'Project...
[ "0.67615175", "0.67528623", "0.6704572", "0.6679568", "0.66464996", "0.6629414", "0.66174686", "0.65963346", "0.65823466", "0.65262866", "0.6513105", "0.6509844", "0.64940995", "0.64879674", "0.64552337", "0.64263564", "0.64260846", "0.6417211", "0.6407354", "0.63996154", "0....
0.73586494
0
PUT /signspot/projects/1 PUT /signspot/projects/1.json
def update @signspot_project = Signspot::Project.find(params[:id]) respond_to do |format| if @signspot_project.update_attributes(params[:signspot_project]) format.html { redirect_to @signspot_project, notice: 'Project was successfully updated.' } format.json { head :no_content } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_update(project)\n raise Client::FileboundClientException.new('Id is required', 0) unless project[:projectId].greater_than_zero?\n put('/projects', nil, project)\n end", "def update\n @sproject = current_user.sprojects.find(params[:id])\n\n respond_to do |format|\n if @sp...
[ "0.68657506", "0.6849882", "0.68106246", "0.67633456", "0.66837734", "0.6618376", "0.6596206", "0.6575585", "0.6549061", "0.65458655", "0.6524837", "0.64927155", "0.64894325", "0.6478632", "0.6478007", "0.64711535", "0.64543", "0.64543", "0.6447287", "0.6447287", "0.6440857",...
0.7526216
0
DELETE /signspot/projects/1 DELETE /signspot/projects/1.json
def destroy @signspot_project = Signspot::Project.find(params[:id]) @signspot_project.destroy respond_to do |format| format.html { redirect_to signspot_projects_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # @...
[ "0.75208664", "0.7475516", "0.7447716", "0.74266213", "0.7420925", "0.7418799", "0.7408124", "0.7406857", "0.73919076", "0.7391761", "0.7367874", "0.73676217", "0.73676217", "0.73676217", "0.73676217", "0.73676217", "0.7344868", "0.73427576", "0.73379934", "0.7329139", "0.732...
0.80271935
0
we use this to revert quantitychanges brought about by ordering, specifically when the seller rejects the order, or the buyer cancels the order
def increment_units contents.each do |key,content| id = content["_id"] || content["item_id"] begin product = shop.products.find(id) return false if product.nil? || product.dont_track_quantities? new_pv = [] if product.price_variants.length==1 new_pv ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decrement(order)\n order.order_products.each do |order_product|\n order_product.product.available -= order_product.quantity\n end\n end", "def cancel_order\n if self.status.downcase == \"pending\"\n self.status = \"Canceled\"\n self.save\n self\n els...
[ "0.64839274", "0.64472187", "0.6299472", "0.6107248", "0.61056054", "0.6068533", "0.6026", "0.6024715", "0.6014636", "0.5990565", "0.59301883", "0.591962", "0.58885473", "0.5883057", "0.5881188", "0.58798426", "0.5876975", "0.58729875", "0.58369184", "0.5831144", "0.58294505"...
0.0
-1
GET /events GET /events.json
def index @events = Event.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end", "def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end", "def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}...
[ "0.83374274", "0.8239167", "0.7943348", "0.79285383", "0.77672863", "0.7741231", "0.767051", "0.7665724", "0.765855", "0.7642782", "0.7621404", "0.7615919", "0.7615919", "0.7612841", "0.75691104", "0.7522856", "0.74889225", "0.74821275", "0.7470079", "0.74419075", "0.7440349"...
0.0
-1
GET /events/1 GET /events/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @event = Event.find(params[:id])\n render json: @event\n end", "def get(event_id)\n @client.request \"events/#{event_id}\"\n end", "def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @use...
[ "0.75029767", "0.74019474", "0.7361382", "0.7348975", "0.73475033", "0.7338018", "0.7317425", "0.72875094", "0.72813755", "0.7246173", "0.72317284", "0.7219172", "0.7219172", "0.7218839", "0.7218839", "0.721464", "0.7204848", "0.71989256", "0.7196662", "0.71925515", "0.719221...
0.0
-1
POST /events POST /events.json
def create @event = Event.new(event_params) respond_to do |format| if @event.save format.html { redirect_to @event, notice: 'Event was successfully created.' } format.json { render :show, status: :created, location: @event } else format.html { render :new } format.js...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_event event, data={}\n data[:event] = event\n post '/event', data\n end", "def create\n event = Event.new(event_params)\n event.save!\n render json: event\n end", "def create\n Rails.logger.debug(\"Received event #{params[:event]}\")\n head :ok\n end", "def crea...
[ "0.7714071", "0.7611226", "0.76028967", "0.7541319", "0.7444731", "0.73206913", "0.73138195", "0.728203", "0.7251226", "0.7235907", "0.7235907", "0.7215051", "0.71682763", "0.7150409", "0.7126664", "0.7118896", "0.7117831", "0.71162695", "0.70964044", "0.70907074", "0.7083036...
0.6948119
70
DELETE /events/1 DELETE /events/1.json
def destroy @event.destroy respond_to do |format| format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_...
[ "0.76929694", "0.7688217", "0.7688217", "0.7688217", "0.7681325", "0.7585923", "0.75685203", "0.7560765", "0.7541314", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0....
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_event @event = Event.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.6163754", "0.6045816", "0.5944853", "0.59169096", "0.58892167", "0.58342934", "0.5776148", "0.57057375", "0.57057375", "0.56534296", "0.56209534", "0.54244673", "0.54101455", "0.54101455", "0.54101455", "0.53951085", "0.5378493", "0.53563684", "0.53399915", "0.5338049", "0...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def event_params params.require(:event).permit(:name, :payments_attributes => [:id, :amount, :description, :transaction_date] ) 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
this returns an array of strings
def versions info[:versions] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all\n return @strings\n end", "def return_string_array(array)\n array.collect do |element|\n element.to_s\n end\nend", "def get_all_strings\n return @stringpool_main.values\n end", "def to_array\n self.word.split(\"\")\n end", "def make_array\n @phrase_string.downcase.split(W...
[ "0.70101416", "0.67951995", "0.67691475", "0.6700399", "0.65798116", "0.6564866", "0.6533304", "0.6528676", "0.6523642", "0.64671385", "0.64322186", "0.6419925", "0.6395857", "0.63718134", "0.6355153", "0.6352613", "0.6314684", "0.62973547", "0.6261302", "0.6254104", "0.62160...
0.0
-1
Returns the whole subtree including itself as array
def depth_first result = [self] if child_ids.empty? return result else children.sort.each do |child| result += child.depth_first end end...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtrees!\n trees = Array.new\n subtrees {|tree| trees.push(tree)}\n return trees\n end", "def object_tree\n head, *rest = array_tree\n object_subtree(head,rest)\n end", "def tree_to_array(node)\n h = height(node)\n tree_arr = []\n (1..h).each do |n|\n tree_arr << n...
[ "0.73582476", "0.7339181", "0.7325607", "0.71214837", "0.7035962", "0.696574", "0.69155073", "0.6914114", "0.6885352", "0.68762183", "0.682601", "0.6818968", "0.6771988", "0.6759147", "0.67027444", "0.67004526", "0.6659829", "0.6650861", "0.664593", "0.6641025", "0.66283816",...
0.6331316
40
Returns the whole subtree including itself as array
def breadth_first result = [] queue = [self] while !queue.empty? node = queue.shift result << node node.children.sort.each do |child| queue << child ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtrees!\n trees = Array.new\n subtrees {|tree| trees.push(tree)}\n return trees\n end", "def object_tree\n head, *rest = array_tree\n object_subtree(head,rest)\n end", "def tree_to_array(node)\n h = height(node)\n tree_arr = []\n (1..h).each do |n|\n tree_arr << n...
[ "0.73587424", "0.7340371", "0.7323463", "0.7120113", "0.7035242", "0.6968416", "0.691443", "0.6911427", "0.6883868", "0.6875819", "0.68256706", "0.68167573", "0.6771915", "0.6758571", "0.6701995", "0.6698465", "0.66598886", "0.664946", "0.66462904", "0.664052", "0.6628021", ...
0.0
-1
GET /incidents GET /incidents.xml
def index @incidents = Incident.where("project = ?", session[:project]).order( "reference DESC").\ paginate(:page => params[:page]) respond_to do |format| format.html # index.html.erb format.xml { render :xml => @incidents } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @incidents = current_user.incidents\n end", "def index\n @incidents = Incident.all\n end", "def list_incidents(opts = {})\n data, _status_code, _headers = list_incidents_with_http_info(opts)\n data\n end", "def index\n @title = \"Incidents\"\n \n @search = Incident.s...
[ "0.7235594", "0.69378823", "0.6865948", "0.6627273", "0.65809923", "0.6577421", "0.6559063", "0.6539335", "0.6440366", "0.64303905", "0.6398628", "0.6382044", "0.6293626", "0.617126", "0.61387575", "0.61361647", "0.61133105", "0.609857", "0.6077389", "0.602429", "0.6013475", ...
0.67583674
3
GET /incidents/1 GET /incidents/1.xml
def show @incident = Incident.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @incident } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @incidents = Incident.where(\"project = ?\", session[:project]).order( \"reference DESC\").\\\n\t paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @incidents }\n end\n end", "def index\n @incidents = Inc...
[ "0.6757851", "0.64627266", "0.6429753", "0.63989484", "0.63295704", "0.6234879", "0.6175497", "0.6140431", "0.6112885", "0.6093494", "0.6078193", "0.6047406", "0.6042712", "0.60416406", "0.6020014", "0.6011938", "0.5948279", "0.5948102", "0.5906589", "0.59039956", "0.58880085...
0.64234984
4
GET /incidents/new GET /incidents/new.xml
def new @incident = Incident.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @incident } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @incident = Incident.new\n \n @title = \"New Incident\" \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @incident }\n end\n end", "def new\n @counterparty = Counterparty.new\n\n respond_to do |format|\n format.html # ne...
[ "0.71463466", "0.68982583", "0.68084484", "0.6716667", "0.66290563", "0.6607494", "0.65551925", "0.6550746", "0.65499765", "0.65451473", "0.65425515", "0.65361816", "0.6518318", "0.6512689", "0.6511609", "0.6488026", "0.6483486", "0.6482422", "0.6482422", "0.6482422", "0.6481...
0.7216958
1
POST /incidents POST /incidents.xml
def create @incident = Incident.new(params[:incident]) @incident.project = session[:project] respond_to do |format| if @incident.save flash[:notice] = t 'flash.incident_create' format.html { redirect_to(@incident) } format.xml { render :xml => @incident, :status => :created, :lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :d...
[ "0.61765385", "0.56642395", "0.56618553", "0.5610488", "0.5605733", "0.55973524", "0.5587457", "0.55082744", "0.5498582", "0.54627097", "0.5397559", "0.5388963", "0.5332117", "0.52845526", "0.52757984", "0.5236884", "0.5234027", "0.521988", "0.5219423", "0.5215405", "0.520913...
0.49099058
76
PUT /incidents/1 PUT /incidents/1.xml
def update @incident = Incident.find(params[:id]) respond_to do |format| @incident.project = session[:project] if @incident.update_attributes(params[:incident]) flash[:notice] = t 'flash.incident_update' format.html { redirect_to(@incident) } format.xml { head :ok } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def update\n @incident = Incident.find(params[:id])\n\n respond_to do |format|\n if @incident.update_attributes(params[:incident])\n format.html { redirect_to(@i...
[ "0.63458645", "0.6273557", "0.6081763", "0.6011904", "0.59130806", "0.5762087", "0.568921", "0.56789774", "0.56417334", "0.5639396", "0.5622122", "0.5618449", "0.5617491", "0.5601132", "0.5601132", "0.5575538", "0.55543005", "0.5534985", "0.5515409", "0.5493875", "0.5478755",...
0.54252756
30
DELETE /incidents/1 DELETE /incidents/1.xml
def destroy @incident = Incident.find(params[:id]) @incident.destroy respond_to do |format| format.html { redirect_to(incidents_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end", "def destroy\n RestClient.delete \"#{REST...
[ "0.6662097", "0.6550553", "0.64814836", "0.64110076", "0.6390428", "0.63895005", "0.6378547", "0.6350924", "0.63076824", "0.6300429", "0.6290158", "0.6280524", "0.62728566", "0.6259319", "0.62566316", "0.6252717", "0.62487197", "0.62409705", "0.62249047", "0.6221952", "0.6215...
0.675543
1
:error, :warning or :ignore
def initialize_engine require_template_library 'opal' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def warning?; end", "def warning?; end", "def warning?; end", "def warned; end", "def error_mode; end", "def warned=(_arg0); end", "def warnings; end", "def warnings; end", "def warnings; end", "def warnings; end", "def warnings; end", "def warnings; end", "def warnings; end", "def warnin...
[ "0.72716963", "0.72716963", "0.72716963", "0.70622563", "0.7039519", "0.68805146", "0.68488705", "0.68488705", "0.68488705", "0.68488705", "0.68488705", "0.68488705", "0.68488705", "0.68488705", "0.6781559", "0.6781559", "0.67631674", "0.67631674", "0.66320634", "0.6627967", ...
0.0
-1
region applies_to_entities GET rules/:rule_id/entities
def show_entities rule = Rule.find_by(id: HASHIDS.decode(params[:rule_id])) return head :not_found if rule.nil? # raise Exceptions::SecurityTransgression unless rule.viewable_by? current_user render json: rule.entities, host: request.host_with_port, include: ['entity_type'], root: false, status: :ok e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rule_by_id; end", "def entity(content)\r\n puts \"entity: #{content}\" if $DEBUG\r\n\r\n if (inRule?)\r\n @curRuleSrc += content\r\n end\r\n end", "def apply!(env)\n @rules.each do |rule|\n rule.apply!(env)\n end\n end", "def apply_actions!\n\t @entity.apply_actions!...
[ "0.54274416", "0.54134965", "0.53740114", "0.5261061", "0.52562225", "0.5220396", "0.52111024", "0.517464", "0.51262873", "0.5110338", "0.50461465", "0.49853748", "0.49703085", "0.49160776", "0.4908862", "0.48416322", "0.48379648", "0.48362032", "0.48143816", "0.4810382", "0....
0.6543197
0
Principally ported from Jake Archibald's JS solution at
def solve(nums, target) bs = nil nums.sort.reverse.combination(2).each do |i, j| %I{+ - * /}.each do |op| next if op == :* && (i == 1 || j == 1) next if op == :/ && (j == 1 || i % j != 0) res = i.send(op, j) next if op == :- && res == 0 return "#{i} #{op} #{j} = #{res}" if res == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ie9_spray(t, p)\r\n js_code = Rex::Text.to_unescape(p, Rex::Arch.endian(t.arch))\r\n js_random_nops = Rex::Text.to_unescape(make_nops(4), Rex::Arch.endian(t.arch))\r\n\r\n js = %Q|\r\n\r\n function rop_chain(jutil_base){\r\n var arr = [\r\n Number(Math.floor(Math.random()*0xffffffff)),\...
[ "0.5591605", "0.54929245", "0.5288697", "0.5151443", "0.5147247", "0.5090557", "0.50661325", "0.50474674", "0.50302994", "0.5002995", "0.49915093", "0.49738467", "0.49719483", "0.4967817", "0.49599373", "0.4926256", "0.4926256", "0.49103674", "0.49103674", "0.49103674", "0.49...
0.0
-1
Public: Initializes with a Grit::Actor. actor Grit::Actor.
def initialize(actor) @actor = actor end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(actor)\n @actor = actor \n end", "def initialize(actor_id)\n super()\n setup(actor_id)\n end", "def initialize(name, actor)\n @name = name\n @actor = actor\n @@all << self\n end", "def set_actor(name, email='')\n @current_actor = Grit::Actor.new( name, email )\n ...
[ "0.8014584", "0.6812612", "0.680555", "0.6710361", "0.66102344", "0.66102344", "0.6584775", "0.6513507", "0.6507472", "0.6439009", "0.6246609", "0.62322855", "0.61307216", "0.60710436", "0.603286", "0.6032659", "0.59996283", "0.5996624", "0.5914824", "0.5911252", "0.5908644",...
0.79145855
1
Public: Initializes from a Grit::Commit. commit Grit::Commit.
def initialize(commit) @commit = commit end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(grit_commit)\n @grit_commit = grit_commit\n end", "def initialize(grit_commit)\n @grit_commit = grit_commit\n end", "def initialize(commit)\n @commit = commit\n end", "def initialize(commit, repository)\n @commit = commit\n @repository = repository\n @comments = nil\n ...
[ "0.86839354", "0.8663169", "0.83343613", "0.78626204", "0.7602221", "0.74529177", "0.7168615", "0.71381503", "0.7018095", "0.6820286", "0.6648124", "0.66022074", "0.6504482", "0.6333351", "0.628573", "0.627716", "0.6257828", "0.62441605", "0.62008756", "0.6191214", "0.6171236...
0.8352448
2
Public: Gets the original author of this Entry. In retweets or favorites, this is the author of the original Entry. Returns a Madrox::Actor.
def author @actor ||= Actor.new(@commit.author) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def author\n @author ||= begin\n UnfuddleAPI::People.find(self[:author_id]).username\n rescue\n ''\n end\n end", "def author\n object.user\n end", "def author\n @author ||= get_author\n end", "def author\n @author ||=\n convert_c...
[ "0.7618137", "0.7152144", "0.7085325", "0.7047926", "0.697599", "0.6939068", "0.6928405", "0.6923055", "0.6920061", "0.6904053", "0.68306124", "0.67923534", "0.6791079", "0.67648405", "0.67648405", "0.6740924", "0.67374414", "0.6726545", "0.6716376", "0.6706568", "0.66609645"...
0.7143602
2
Public: Gets the committer of this Entry. In retweets or favorites, this is the author in the current timeline. Returns a Madrox::Actor.
def committer @committer ||= Actor.new(@commit.committer) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def author\n @actor ||= Actor.new(@commit.author)\n end", "def committer() \n\t\tAccount.first(:id => self[:committer_id])\n\tend", "def author\n object.user\n end", "def inner_author\n @commit.author\n end", "def committer\n @committer ||= Person.new(connection, @attribute...
[ "0.74483675", "0.708218", "0.6936405", "0.68897563", "0.6835678", "0.68003964", "0.67081106", "0.64935833", "0.6485639", "0.64688087", "0.64342344", "0.64036083", "0.63258845", "0.632199", "0.63190055", "0.63139606", "0.6298829", "0.6281458", "0.619463", "0.618837", "0.618180...
0.7446971
1
GET|POST '/analysis' GET|POST '/analysis.json'
def analysis @str = params[:text] ||= '解析対象の文字列' @words = Tag.counter(Tag.generate(@str)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def analyse\n begin\n response = resource[\"/analyse/#{app}\"].post(nil)\n rescue RestClient::InternalServerError\n display \"An error has occurred.\"\n end\n display response.to_s\n end", "def analyses\n @project = Project.find(params[:id])\n @analyses = Analysis.all\n\n respond_...
[ "0.6926048", "0.6451678", "0.64396644", "0.6346326", "0.61920416", "0.6098996", "0.60399115", "0.60168225", "0.6004483", "0.59575546", "0.594397", "0.5872305", "0.58340234", "0.5811752", "0.576535", "0.57147235", "0.5703801", "0.5703801", "0.56816626", "0.56506485", "0.561738...
0.0
-1
Return string tag value for tag whose key is given as arg
def get_tag_value tag_key_name tag = self.tags.joins(:tag_key).where('tagging_tag_keys.name = ?', tag_key_name).includes(:tag_value).first tag.try(:tag_value).try(:value) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_tag_value(key)\n get_tag(key).try(:tag_value).try(:value)\n end", "def get_tagvalue(object, tagkey)\n value = \"\"\n if object[:tag_set]\n object[:tag_set].each do |tag|\n if tag[:key] == tagkey\n value = tag[:value]\n break\n end\n end\n end\n \n...
[ "0.77829754", "0.7443238", "0.7216726", "0.72124714", "0.7087206", "0.67224836", "0.66738427", "0.6510109", "0.6480844", "0.6371774", "0.6302646", "0.62220883", "0.620625", "0.6149586", "0.61059654", "0.60790807", "0.60790807", "0.60790807", "0.60790807", "0.6077587", "0.6071...
0.7163576
4
GET /projects/1 GET /projects/1.json
def show @project = Project.find(params[:id]) @user_type = @project.roles.where(:user_id => session[:id]).first.name @stats = @project.get_stats respond_to do |format| format.html # show.html.erb format.json { render json: @project } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list\n get 'projects'\n end", "def listprojects\n get('listprojects.json')['projects']\n end", "def show\n @project = @client.projects.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "def projects\n...
[ "0.78685594", "0.7697714", "0.76804394", "0.76113176", "0.7533562", "0.7525923", "0.74930453", "0.74930453", "0.74930453", "0.74930453", "0.74930453", "0.74930453", "0.74930453", "0.74928224", "0.7483378", "0.74790984", "0.7445097", "0.74296343", "0.74227774", "0.7415188", "0...
0.0
-1
GET /projects/new GET /projects/new.json
def new @project = Project.new script: "bundle install\r\nbundle exec rake db:setup RAILS_ENV=test" respond_to do |format| format.html # new.html.erb format.json { render json: @project } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @project = current_user.projects.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @...
[ "0.81725097", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", "0.8165836", ...
0.0
-1
POST /projects POST /projects.json
def create @project = Project.new(params[:project]) @project.roles.build name: Role.role_types.first, user: User.find(session[:id]) begin n_invitations = @project.add_colaborators notice = 'Project was successfully created. ' notice += '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html { redirect_to(projects_path) }\n else\n format.html { render :action => \"new...
[ "0.7338948", "0.73139244", "0.7308003", "0.7299582", "0.7227503", "0.7225945", "0.71982473", "0.71170384", "0.7104803", "0.7095263", "0.7070636", "0.70408624", "0.70358187", "0.7024969", "0.70191896", "0.7009597", "0.698481", "0.697517", "0.6963753", "0.6963096", "0.6948756",...
0.0
-1
PUT /projects/1 PUT /projects/1.json
def update @project = Project.find(params[:id]) respond_to do |format| if @project.update_attributes(params[:project]) format.html { redirect_to @project, notice: 'Project was successfully updated.' } format.json { head :ok } else format.html { render action: "edit" } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def project_update(project)\n raise Client::FileboundClientException.new('Id is required', 0) unless project[:projectId].greater_than_zero?\n put('/projects', nil, project)\n end", "def update\n if @project.update(project_params)\n render json: @project, status: 200\n else\n re...
[ "0.7380123", "0.7308916", "0.7181629", "0.7167707", "0.7132476", "0.7125153", "0.7081923", "0.7008695", "0.700572", "0.70002675", "0.69908255", "0.6983146", "0.69805205", "0.69805205", "0.6977218", "0.6970257", "0.6970257", "0.6970257", "0.6970257", "0.6970257", "0.6970257", ...
0.6989358
14
DELETE /projects/1 DELETE /projects/1.json
def destroy @project = Project.find(params[:id]) respond_to do |format| if current_user.role_in_project(@project.id) == "Manager" @project.users.each do |u| Notifier.project_deleted(@project, current_user, u.email ).deliver end @project.destroy ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pr...
[ "0.7894983", "0.78589386", "0.77775395", "0.7771137", "0.7758355", "0.77305937", "0.77302146", "0.77302146", "0.77302146", "0.77302146", "0.77302146", "0.7724", "0.7717915", "0.7717915", "0.7717915", "0.7717915", "0.77042484", "0.77042484", "0.77042484", "0.77042484", "0.7704...
0.0
-1
Complete the solve function below.
def solve(meal_cost, tip_percent, tax_percent) puts (meal_cost+(meal_cost*tip_percent/100)+(meal_cost*tax_percent/100)).round end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve\n end", "def solve!\n solve\n self\n end", "def solve!\n end", "def solve\n while !solved?\n step\n end\n\n self\n end", "def solve\n delegatee.solve\n end", "def solve\n loop { break if !shift }\n return @solutions\n ...
[ "0.7912264", "0.78778714", "0.7738673", "0.73811764", "0.71148485", "0.6969912", "0.68216586", "0.6817378", "0.68094444", "0.67890126", "0.67816764", "0.6774406", "0.6718856", "0.67047435", "0.6643811", "0.66219836", "0.6416877", "0.6373854", "0.6358416", "0.6346396", "0.6346...
0.0
-1
If no data sink is set, display using text
def terminal_show spectrum print "\e[2J\e[H" puts "Spectrum" bucket = MIN_BUCKET max = 0 spectrum.to_a[MIN_BUCKET, LINES*BUCKETS_PER_LINE].each_slice(BUCKETS_PER_LINE) do |a| sum = a.inject(0, :+) max = sum if max < sum @range = sum if @range < sum # Range down immediately or it...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output(data)\n msg @presenter.format(data)\n end", "def output(data)\n msg @presenter.format(data)\n end", "def text\n @text || @report\n end", "def d(data)\n data.send :display \n \"\\n\".send :display\nend", "def display!(data)\n self[:full_text] = (self[:symbol] || s...
[ "0.62434", "0.6230691", "0.6125876", "0.60235256", "0.5962044", "0.5916758", "0.5896779", "0.58762825", "0.58762825", "0.58475626", "0.5842191", "0.5829486", "0.5809702", "0.58066124", "0.57475597", "0.5731226", "0.57291985", "0.57087183", "0.57087183", "0.5703249", "0.569230...
0.0
-1
Loop through all available plays and parse XML for each one
def createAllScripts() # List of lists that pairs all play names with their Folger's acronyms plays = [["MND", "a_midsummer_nights_dream"], ["AWW", 'alls_well_that_ends_well'], ["Ant", 'antony_and_cleopatra'], ["AYL", 'as_you_like_it'], ["Cor", 'coriolanus'], ["Cym", 'cymbeline'], ["Ham", 'hamlet'], [...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def three_acts_xml\n \"<PLAY><TITLE>Title1</TITLE><ACT><TITLE>Act 1</TITLE></ACT><ACT><TITLE>Act 2</TITLE></ACT><ACT><TITLE>Act 3</TITLE></ACT></PLAY>\"\n end", "def good_xml\n \"<PLAY><TITLE>My Simple Play</TITLE></PLAY>\"\n end", "def populate_player (page)\n\n player = Player.new\n\n # find th...
[ "0.62553823", "0.6233047", "0.57886416", "0.57447004", "0.57416505", "0.56897336", "0.56812423", "0.56812423", "0.5640088", "0.55781853", "0.5555423", "0.5527891", "0.54419535", "0.5413614", "0.54080784", "0.53621584", "0.5358338", "0.53386074", "0.530174", "0.529556", "0.528...
0.0
-1
GET /coupons GET /coupons.json
def index @coupons = Coupon.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @coupons = Coupon.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coupons }\n end\n end", "def index\n @coupons = Coupon.where('shop_id = ?', params[:shop_id])\n\n respond_to do |format|\n format.html { show_from_resource('ind...
[ "0.7840701", "0.75152093", "0.74978065", "0.7319475", "0.71880704", "0.70985043", "0.70787275", "0.7023885", "0.69958496", "0.6910269", "0.69067407", "0.6838164", "0.6836833", "0.67868716", "0.67867994", "0.67544293", "0.6705512", "0.667904", "0.66253215", "0.65687054", "0.65...
0.73941004
6
GET /coupons/1 GET /coupons/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @coupons = Coupon.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coupons }\n end\n end", "def index\n @coupons = Coupon.where('shop_id = ?', params[:shop_id])\n\n respond_to do |format|\n format.html { show_from_resource('ind...
[ "0.75957096", "0.733593", "0.72154444", "0.71711814", "0.71678406", "0.7152881", "0.7115772", "0.7115772", "0.7115772", "0.7115772", "0.704226", "0.6935504", "0.68288225", "0.6807063", "0.6804124", "0.67553663", "0.67354006", "0.6734415", "0.67217904", "0.6707368", "0.6678304...
0.0
-1
POST /coupons POST /coupons.json
def create @coupan = Coupon.find_by(code: params[:code]) if @coupan.present? @coupon_used = current_user.coupon_useds.find_by(coupon_id: @coupan.id ) if @coupon_used.present? @sub_total, @discount, @tax, @shipping_cost, @final_total = calculate_amount(current_user) @messag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @coupon = @conference.coupons.new(coupon_params)\n\n respond_to do |format|\n if @coupon.save\n format.html { redirect_to admin_conference_coupons_path(@conference), notice: 'Coupon was successfully created.' }\n format.json { render json: @coupon, status: :created }...
[ "0.70953745", "0.7008299", "0.69268715", "0.69114083", "0.69036293", "0.68978333", "0.68978333", "0.68933547", "0.6884345", "0.68791074", "0.67236793", "0.66539603", "0.6616796", "0.6585765", "0.6504694", "0.6501039", "0.6482201", "0.6482201", "0.6482201", "0.6482201", "0.636...
0.0
-1
PATCH/PUT /coupons/1 PATCH/PUT /coupons/1.json
def update respond_to do |format| if @coupon.update(coupon_params) format.html { redirect_to @coupon, notice: 'Coupon was successfully updated.' } format.json { render :show, status: :ok, location: @coupon } else format.html { render :edit } format.json { render json: @co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @coupone.update(coupone_params)\n format.html { redirect_to admin_coupones_path, notice: 'Coupone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render j...
[ "0.70729274", "0.69253284", "0.6699822", "0.6478899", "0.64782244", "0.6358536", "0.6334699", "0.630045", "0.6287655", "0.62539", "0.621703", "0.61170834", "0.61170834", "0.6101269", "0.609336", "0.6081077", "0.60653317", "0.6057695", "0.5986614", "0.59785813", "0.59752285", ...
0.6314795
8
DELETE /coupons/1 DELETE /coupons/1.json
def destroy if session[:coupon_code].present? session[:coupon_code] = nil @message = "Coupon Removed" end @cart_items = current_user.cart_items @sub_total, @discount, @tax, @shipping_cost, @final_total = Coupon.destroy_coupon(@cart_items, session[:coupon_code]) respond_to do |format| ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @coupone.destroy\n respond_to do |format|\n format.html { redirect_to admin_coupones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @coupon = current_user.coupons.find(params[:id])\n @coupon.destroy\n\n respond_to do |format|\n format.html { ...
[ "0.7825726", "0.7566346", "0.75609595", "0.75609595", "0.7426853", "0.7410406", "0.73015195", "0.72779614", "0.725772", "0.7235256", "0.722246", "0.72130305", "0.71953785", "0.7180826", "0.718026", "0.71792126", "0.71792126", "0.71783185", "0.7156256", "0.6990653", "0.6957859...
0.0
-1
gpib write command def mode()
def mode=(mode) write("++mode 1" ) if mode==:Device write("++mode 0" ) if mode==:Controller @mode = write("++mode",true).to_i==1 ? :Controller : :Device end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def syswrite(p0) end", "def syswrite(p0) end", "def syswrite(p0) end", "def write_cmd(buf)\n\tend", "def write\n command :write\n self\n end", "def write!\n ensure_mode(:privileged)\n exec('write memory')\n end", "def write(p0) end", "def write(p0) end", "def write(p0) end...
[ "0.6652076", "0.6650099", "0.6650099", "0.651695", "0.64771223", "0.64022315", "0.6247925", "0.6247762", "0.6247762", "0.6175453", "0.6166755", "0.6158124", "0.61484784", "0.61484784", "0.61291605", "0.61291605", "0.61291605", "0.61291605", "0.61199635", "0.61181563", "0.6072...
0.6175308
10
print to out a list of all breweries ""
def breweries_list Brewery.all.each.with_index(1) do |brewery, i| puts "" puts "" puts "#{i}. #{brewery.name}" end brewery_selection end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_backpack_list\n output = []\n output << \"Melinda, here's your packing list!\"\n output << \"Day: #{@attributes[:day_of_week]}, Weather: #{@attributes[:weather]}\"\n output << \"\"\n\n @items.each do |item|\n output << \"- #{item}\"\n end\n output.join(\"\\n\")\n end", "def l...
[ "0.67376965", "0.6446181", "0.6435685", "0.63138974", "0.631201", "0.6291249", "0.62896264", "0.6253475", "0.62288153", "0.6161924", "0.6156617", "0.6151547", "0.6138976", "0.6113341", "0.6106359", "0.6104926", "0.610339", "0.61024594", "0.6095174", "0.60928994", "0.60810554"...
0.82905555
0
Example 1: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example 2: Input: "cbbd" Output: "bb" Iterate through the string and find all substrings that are palindromes Iterate through palindromes and pass &length and just return the longest string
def longest_palindrome(string) palindromes = [] (0...string.length).each do |i| (i+1...string.length).each do |j| sub = string[i..j] palindromes << sub if sub == sub.reverse end end palindromes.sort_by(&:length).last end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def longest_palindrome(string)\n string_arr = string.split(\"\")\n longest = 0\n substring = \"\"\n\n while string_arr.length > 0\n string_arr.each do |char|\n substring << char\n palindrome?(substring) && substring.length > longest ? longest = substring.length : next\n end\n\n string_arr.sh...
[ "0.8712758", "0.860486", "0.8604704", "0.8543196", "0.85280764", "0.8464971", "0.8459256", "0.8446064", "0.84386", "0.84103453", "0.84005034", "0.83745706", "0.8372793", "0.8353755", "0.8344089", "0.8342027", "0.8320044", "0.831829", "0.8313886", "0.82886237", "0.8265201", ...
0.8340985
16
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Note: Given n will be a positive integer. Example 1: Input: 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 step 2. 2 steps...
def num_steps(n) return 1 if n <= 1 num_steps(n-1) + num_steps(n-2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def climb_stairs(n)\n if n == 0 || n == 1 || n == 2\n return n\n else\n return climb_stairs(n-1)+climb_stairs(n-2)\n end\nend", "def climb_stairs(n)\n\treturn 1 if n <= 1\n\tclimb_stairs(n-1) + climb_stairs(n-2)\nend", "def stair_climb(n, step_sizes = [1, 2, 3], poss_steps = { 0 => [[]] })\n (1..n)...
[ "0.7600656", "0.7428719", "0.7408992", "0.7398867", "0.73760295", "0.7361347", "0.7349675", "0.73447317", "0.73176205", "0.73060286", "0.7259781", "0.72128034", "0.70826006", "0.7009299", "0.700422", "0.69720906", "0.69359666", "0.68537295", "0.6813634", "0.6783808", "0.67695...
0.5973905
56
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the nonzero elements. Example: Input: [0,1,0,3,12] Output: [1,3,12,0,0] Iterate through the array and shove nonzero elements into a new array Keep count of the 0's Shove count times of 0's into new array O(n)
def array_nums(arr) result = [] count = 0 arr.each { |num| num!=0 ? result << num : count += 1 } count.times { result.push(0) } result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_zeroes(nums)\n count = nums.select { |i| i.zero? }.count\n\n new = []\n nums.each do |value|\n if value != 0\n new.push(value)\n end\n end\n\n count.times { new.push(0) }\n\n nums.each_with_index do |value, index|\n nums[index] = new[index]\n end\n\n nums\nend", "def move_zeros(arr...
[ "0.8537467", "0.847794", "0.84415716", "0.8368101", "0.81877714", "0.817805", "0.8105923", "0.80256313", "0.7974573", "0.7942013", "0.7887532", "0.7883388", "0.7882476", "0.7862668", "0.7846398", "0.7773411", "0.77569556", "0.77209425", "0.73439026", "0.73231286", "0.71301275...
0.6863616
21
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad. Suppose you have n versions [1, 2, ..., n] and you...
def bad_version_finder(array) array.each { |version| return version if isBadVersion(version) } nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def first_bad_version(n, start = 1, finish = n)\n return start if start == finish\n mid = (start+finish)/2\n if is_bad_version(mid) \n return 0 if mid == 0\n # return mid if !is_bad_version(mid-1)\n return first_bad_version(n, start, mid)\n else\n return first_bad_version(n...
[ "0.6577105", "0.63559675", "0.6079", "0.6056374", "0.60500884", "0.6022939", "0.5945299", "0.5937624", "0.5929065", "0.5917881", "0.58787286", "0.5870832", "0.5866103", "0.58377445", "0.5836306", "0.5771533", "0.5771533", "0.57389337", "0.5730952", "0.5730827", "0.57188416", ...
0.77068543
0
GET /sections/1 GET /sections/1.json
def show @section = Section.find_by_id(params[:id]) @lesson = @section.lesson @activities = @section.activities respond_to do |format| format.html # show.html.erb format.json { render json: @section } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @sections = params[:path].nil? ? Section.all : Section.where(path: params[:path])\n\n respond_to do |format|\n format.html { render html: @sections }\n format.json { render json: @sections }\n end\n end", "def index\n @sections = Section.all\n\n respond_to do |format|\n ...
[ "0.76183075", "0.75328106", "0.7447012", "0.7353776", "0.7353776", "0.7353776", "0.72885877", "0.7163036", "0.71094126", "0.70714295", "0.70714295", "0.70714295", "0.70714295", "0.70714295", "0.70714295", "0.70714295", "0.70164174", "0.70164174", "0.69275254", "0.68962175", "...
0.6950342
18