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
get_datasource get datasource object
def get_datasource() # was an input file arg provided? if ($input_file) # yes -- use local xml file as source source_xml = get_local_datasource($input_file) else # no -- get sourcex xml from account source_xml = get_remote_datasource($account, $userid, $passwd, $instance_id) end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_datasource\n\t\tif @request.include?(:transaction)\n\t\t\treturn @request[:transaction][:operations][0][:dataSource]\n\t\telse\n\t\t\treturn @request[:dataSource]\n\t\tend\n\tend", "def datasource\n @datasource ||= endpoint_connection.get(endpoint_url)\n end", "def datasource\n ...
[ "0.814141", "0.80614656", "0.80614656", "0.80614656", "0.78018266", "0.7708135", "0.73912126", "0.7255456", "0.68941325", "0.67167854", "0.6713347", "0.6713347", "0.66498625", "0.6595686", "0.63504374", "0.6311707", "0.6256929", "0.6229832", "0.6058662", "0.6058424", "0.60116...
0.6890668
9
write_datasource_file write remote datasource to local file
def write_datasource_file(dsxml) dsobj = Nokogiri::XML(dsxml) dshash = get_dshash(dsobj) filename = '/tmp/' + dshash['name'] + '.xml' # does the output file exist? if ( File.exists?(filename) ) # yes -- write out an error message puts "* file " + filename + " already exists -- refusing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_write(remote_path, payload, payload_filename)\n writable = remote_path + payload_filename\n begin\n print_status(\"Writing payload to #{writable}....\")\n query = @db_connection.query(\"SELECT #{payload} INTO OUTFILE '#{writable}';\")\n print_good(\"OK, should be all set if you didn't...
[ "0.6326622", "0.5821609", "0.5608735", "0.5531469", "0.5512392", "0.54492295", "0.54458547", "0.5445284", "0.5364383", "0.5238902", "0.5228751", "0.5210548", "0.51529485", "0.5135433", "0.5132889", "0.5125674", "0.51124096", "0.50773424", "0.50705665", "0.5070232", "0.5064606...
0.6856583
0
get_dshash build a hash containing datasource metadata objects
def get_dshash(dsobj) dshash = Hash[ 'name' => dsobj.at_xpath('//feed/entry/name').text, 'dname' => dsobj.at_xpath('//feed/entry/displayedas').text, 'desc' => dsobj.at_xpath('//feed/entry/description').text, 'applies' => dsobj.at_xpath('//feed/entry/appliesTo').text, 'multi' => dsobj.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_graphdphash(graph_datapoint_obj)\n graphdphash = Hash[\n 'name' => graph_datapoint_obj.at_xpath(\"name\").text,\n 'dpname' => graph_datapoint_obj.at_xpath(\"datapointname\").text,\n ]\n\n return graphdphash\n end", "def hash\n [class_id, object_type, accessibility_summary...
[ "0.648899", "0.6347956", "0.6129919", "0.6092024", "0.6092024", "0.6092024", "0.6050614", "0.6048604", "0.5854772", "0.5851763", "0.58353275", "0.582366", "0.58184254", "0.57686925", "0.5763343", "0.5726663", "0.57087475", "0.56479776", "0.56453294", "0.5612709", "0.56076795"...
0.741291
0
get_dphash build a hash containing datapoints
def get_dphash(dpobj) dp_hash = Hash[ 'ppmethod' => dpobj.at_xpath("postprocessormethod").text, 'name' => dpobj.at_xpath("name").text, 'desc' => dpobj.at_xpath("description").text, 'ppparam' => dpobj.at_xpath("postprocessorparam").text, 'alert_trigger' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_graphdphash(graph_datapoint_obj)\n graphdphash = Hash[\n 'name' => graph_datapoint_obj.at_xpath(\"name\").text,\n 'dpname' => graph_datapoint_obj.at_xpath(\"datapointname\").text,\n ]\n\n return graphdphash\n end", "def get_dshash(dsobj)\n dshash = Hash[\n 'name' => ds...
[ "0.7569537", "0.7101933", "0.6807546", "0.6383438", "0.6038502", "0.6008279", "0.5948346", "0.59477556", "0.5940852", "0.5912131", "0.5907972", "0.58731085", "0.58602005", "0.58530074", "0.58331484", "0.58098394", "0.5808285", "0.57923585", "0.57897466", "0.57897466", "0.5789...
0.6492823
3
get_graphhash build a hash containing graph objects
def get_graphhash(graphobj) graphhash = Hash[ 'display' => graphobj.at_xpath("displayprio").text, 'name' => graphobj.at_xpath("name").text, 'yaxis' => graphobj.at_xpath("verticallabel").text, 'datapoints' => graphobj.xpath('graphdatapoints/graphdatapoint'), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n ([graph_name] + operands).hash\n end", "def hash\n @node.sort.push(@edge).hash\n end", "def to_hash\n h = hash.dup\n @hash.each do |name, node|\n h[name] = node.to_hash if node.respond_to? :to_hash\n end\n h\n end", "def to_h\n nodes = @graph.nodes.group_by { |...
[ "0.7673605", "0.75784075", "0.69229645", "0.67974424", "0.66915417", "0.6568686", "0.6540061", "0.6488536", "0.6449959", "0.64287466", "0.6416977", "0.63933456", "0.6378928", "0.6369119", "0.6301138", "0.6295913", "0.62694967", "0.6262821", "0.62478817", "0.62269574", "0.6216...
0.7110069
2
get_ographhash build a hash containing ograph objects
def get_ographhash(ographobj) ographhash = Hash[ 'display' => ographobj.at_xpath("displayprio").text, 'name' => ographobj.at_xpath("name").text, 'yaxis' => ographobj.at_xpath("verticallabel").text, 'datapoints' => ographobj.xpath('datapoints/overviewgraphdatapoi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n ([graph_name] + operands).hash\n end", "def to_hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash\n @node.sort.push(@edge).hash\n end", "def hash; end", "def hash; end", ...
[ "0.68413013", "0.67558706", "0.6730864", "0.6730864", "0.6730864", "0.6730864", "0.6730864", "0.6730864", "0.6730864", "0.66696936", "0.6462852", "0.6462852", "0.6462852", "0.6462852", "0.6462852", "0.6462852", "0.6462852", "0.6462852", "0.6462852", "0.6462852", "0.6434273", ...
0.7883773
0
get_graphdphash build a hash containing graph datapoint objects
def get_graphdphash(graph_datapoint_obj) graphdphash = Hash[ 'name' => graph_datapoint_obj.at_xpath("name").text, 'dpname' => graph_datapoint_obj.at_xpath("datapointname").text, ] return graphdphash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_graphhash(graphobj)\n graphhash = Hash[\n 'display' => graphobj.at_xpath(\"displayprio\").text,\n 'name' => graphobj.at_xpath(\"name\").text,\n 'yaxis' => graphobj.at_xpath(\"verticallabel\").text,\n 'datapoints' => graphobj.xpath('graphdatapoints/graphd...
[ "0.6785817", "0.6538147", "0.65289867", "0.65104145", "0.64963967", "0.64725274", "0.6361043", "0.632116", "0.6249954", "0.6197289", "0.61818093", "0.61801714", "0.6143703", "0.61227757", "0.6071598", "0.604039", "0.60365224", "0.5984062", "0.59672713", "0.5955115", "0.593428...
0.82835126
0
print_summary print the datasource summary report section
def print_summary(dsobj) dshash = get_dshash(dsobj) ds_pollint_m = dshash['pollint_s'].to_i / 60 dp_alert_count = 0.to_i # iterate over each datapoint dshash['datapoints'].each { |datapoint| dphash = get_dphash(datapoint) # is the alert trigger set on this datapoint if ( dphash...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_summary\n puts \"\\n\\nScore : # Instances\\n\" << (\"=\" * 19)\n @summary_totals.each_with_index { |value, index| puts \" %5d:%8d\\n\" % [index, value] unless value.nil? }\n puts \"\\n** End of Report\"\n end", "def dump_summary *args; end", "def dump_summary( summary )\n\t...
[ "0.7133723", "0.6949961", "0.689564", "0.6753738", "0.6753738", "0.67272085", "0.66398466", "0.6614073", "0.6614073", "0.6614073", "0.6614073", "0.65785563", "0.6532568", "0.64496046", "0.63807595", "0.6378121", "0.63727635", "0.6299348", "0.6231313", "0.6221184", "0.6201219"...
0.69794023
1
test_dsname run tests on datasource name & displayname
def test_dsname(dsobj) errors = [] dshash = get_dshash(dsobj) # does the name contain whitespace? if ( dshash['name'] =~ /\s+/ ) # yes -- record an error errors.push("datasource name contains whitespace") end # does the name end in a trailing dash? if ( dshash['name'] =~ /\-$/ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simpletest_tests(bs)\n #check to see if our internal description is correct.\n assert_equal [:simpletest], bs.tables.keys\n assert_equal [:id, :test], bs.tables[:simpletest].columns.keys\n #check to see if our database description is correct\n bs.connect do |db|\n ...
[ "0.62087184", "0.57134306", "0.5686716", "0.56726795", "0.5648968", "0.5632808", "0.5611829", "0.5508593", "0.5500898", "0.548648", "0.5440097", "0.54230744", "0.53737825", "0.5371237", "0.5347694", "0.53278095", "0.53278095", "0.5289818", "0.5275562", "0.5257076", "0.5252834...
0.63396454
0
test_dsdesc run tests on datasource description
def test_dsdesc(dsobj) error = nil dshash = get_dshash(dsobj) # is the description size less than 10 characters in length? if ( dshash['desc'].to_s.size < 10) # yes -- record an error error = "datasource description is empty or sparse" end return(error) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def simpletest_tests(bs)\n #check to see if our internal description is correct.\n assert_equal [:simpletest], bs.tables.keys\n assert_equal [:id, :test], bs.tables[:simpletest].columns.keys\n #check to see if our database description is correct\n bs.connect do |db|\n ...
[ "0.64923245", "0.6192969", "0.60294074", "0.60244817", "0.5888318", "0.58712363", "0.5702962", "0.56700426", "0.56675303", "0.56675303", "0.5576063", "0.55655473", "0.55484015", "0.5526045", "0.5517943", "0.54972374", "0.54954416", "0.5491094", "0.5479224", "0.5463195", "0.54...
0.6844526
0
test_dstags run tests on datasource tags
def test_dstags(dsobj) error = nil dshash = get_dshash(dsobj) # Are there one or more tags? if ( dshash['tags'].split(',').size < 3) # yes -- record an error error = "datasource search keywords are sparse" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_cases_by_tag_name; end", "def test_sanitize_tags_with_require_valid_tags_false\n setup_gce_metadata_stubs\n ALL_TAGS.each do |tag, sanitized_tag|\n setup_logging_stubs do\n @logs_sent = []\n d = create_driver(APPLICATION_DEFAULT_CONFIG, tag)\n d.emit('msg' => log_entry(0)...
[ "0.6263242", "0.5782377", "0.5485181", "0.5466529", "0.54627657", "0.54355407", "0.54355407", "0.5403441", "0.5402678", "0.5315781", "0.52228034", "0.52039814", "0.52039814", "0.51789457", "0.5168626", "0.5163406", "0.5155758", "0.51423854", "0.512605", "0.5123609", "0.512039...
0.6982456
0
test_datapoint_desc run tests on datapoint descriptions
def test_datapoint_desc(dsobj) errors = [] dshash = get_dshash(dsobj) # iterate over each datapoint dshash['datapoints'] .each { |datapoint| dphash = get_dphash(datapoint) # is the description size less than 10 characters in length? if ( dphash['desc'].to_s.size < 10) # yes -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_datapoint_usage(dsobj)\n errors = []\n datapoint_ok = []\n dshash = get_dshash(dsobj)\n\n puts \"Datapoints:\\n\"\n\n # iterate over each datapoint\n dshash['datapoints'].each { |datapoint|\n dphash = get_dphash(datapoint)\n\n # is this a complex datapoint?\n if (dphash[...
[ "0.70504546", "0.56422204", "0.54303414", "0.5350363", "0.5349404", "0.53339374", "0.5331084", "0.5284815", "0.52742004", "0.5271906", "0.5255825", "0.52427065", "0.5199345", "0.5190523", "0.5175601", "0.5134404", "0.51190895", "0.511583", "0.5100549", "0.50908136", "0.507621...
0.7127834
0
test_datapoint_alert run tests on datapoint alerts
def test_datapoint_alert(dsobj) errors = [] dshash = get_dshash(dsobj) tokens = [ '##HOST##', '##VALUE##', '##DURATION##', '##START##', ] # iterate over each datapoint dshash['datapoints'].each { |datapoint| dphash = get_dphash(datapoint) # is there a dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_datapoint_usage(dsobj)\n errors = []\n datapoint_ok = []\n dshash = get_dshash(dsobj)\n\n puts \"Datapoints:\\n\"\n\n # iterate over each datapoint\n dshash['datapoints'].each { |datapoint|\n dphash = get_dphash(datapoint)\n\n # is this a complex datapoint?\n if (dphash[...
[ "0.68924975", "0.5376915", "0.5366682", "0.5354901", "0.5326844", "0.5323181", "0.5315598", "0.52917033", "0.52823734", "0.52390164", "0.51822793", "0.51791024", "0.5170558", "0.51646304", "0.5128562", "0.5120589", "0.5114428", "0.51092154", "0.50984764", "0.5086508", "0.5080...
0.73959744
0
test_datapoint_usage run tests to determine where datapoints are used
def test_datapoint_usage(dsobj) errors = [] datapoint_ok = [] dshash = get_dshash(dsobj) puts "Datapoints:\n" # iterate over each datapoint dshash['datapoints'].each { |datapoint| dphash = get_dphash(datapoint) # is this a complex datapoint? if (dphash['ppmethod'] == 'expr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_e121_point_distance\n (1..30).each {#Idempotence verification\n verify_method :e121_point_distance,\n :with => [{\n param: 2,\n predicate: Proc.new { |points_pairs, shortest|\n ...
[ "0.59275275", "0.5764523", "0.57578176", "0.56879425", "0.5525361", "0.5445217", "0.5400686", "0.5400686", "0.5400686", "0.53776956", "0.53567785", "0.5312579", "0.527756", "0.52463156", "0.5217506", "0.5213007", "0.5197756", "0.51954335", "0.51822793", "0.51659876", "0.51478...
0.7631334
0
test_graphs run tests to check graph styling
def test_graphs(dsobj) errors = [] dshash = get_dshash(dsobj) graph_types = Hash[ 'graphs' => 'Graphs', 'ographs' => 'Overview Graphs', ] # iterate over the two graph types graph_types.keys.each { |type| # init/reinit the display hash display = {} puts graph_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test\n puts 'Building Graph for tests...'\n # Simple graph\n #\n # First\n # / \\\n # second third\n # / | | \\\n # fourth fifth goal sixth\n #\n # Construct graph\n first = GraphNode.new 'First'\n second = GraphNode.new 'Second'\n third ...
[ "0.6572807", "0.6514884", "0.63719434", "0.6262923", "0.6172577", "0.60662055", "0.59363866", "0.5920476", "0.5892912", "0.5878993", "0.5836297", "0.5835537", "0.5832031", "0.58002937", "0.5784653", "0.57284397", "0.5711602", "0.566038", "0.5646354", "0.5535234", "0.55230206"...
0.6862969
0
To display output immediately on windows using git bash
def penultimate(string) string.split[-2] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prompt_git_branch\n if !is_git?\n return \"\"\n end\n stat = `git status`\n \"[#{stat.split(\"\\n\")[0].split(\" \")[-1]}]\".yellow\nend", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def prep_screen\n system(\"clear\...
[ "0.6219506", "0.61200327", "0.61200327", "0.61200327", "0.61200327", "0.61200327", "0.61200327", "0.6103044", "0.60350794", "0.59949106", "0.5973232", "0.59097284", "0.58951396", "0.5886012", "0.586864", "0.58550465", "0.582788", "0.5807792", "0.5802978", "0.5773198", "0.5745...
0.0
-1
This regex is the only real requirement for OAuth token format, per Bitbucket's tokens also can include an underscore, so that is added here.
def valid_token?(token) return token =~ /^[\w\-\.~_\+\/]+$/ end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def escape_token(token)\n token && token.tr(':', '_')\n end", "def rfc_2045_token; end", "def token_pattern\n /\\A#{pattern}\\z/\n end", "def validate token\r\n token =~ /[A-Za-z0-9]/\r\n end", "def parse_auth_token(token)\n return if token.nil?\n if token ...
[ "0.614731", "0.5982818", "0.5940342", "0.5887095", "0.58414423", "0.57247835", "0.56939954", "0.5674768", "0.5647226", "0.5613578", "0.55531776", "0.5544648", "0.5536544", "0.5515515", "0.5514376", "0.5503551", "0.54939246", "0.54699475", "0.5459316", "0.5459037", "0.5455444"...
0.58235466
5
GET /user_infoms GET /user_infoms.json
def index @user_infoms = UserInfom.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @infants = current_user.infants\n end", "def influencer_of(usernames)\n get(\"/1/soi/influencer_of.json\", :users => [usernames].flatten).users\n end", "def get_user_informations(user_id)\n url = \"#{GRAPH_URL}/#{user_id}?fields=first_name,last_name,profile_pic,locale,timezone,gender...
[ "0.6810778", "0.67795444", "0.6536452", "0.6526537", "0.64346117", "0.6410033", "0.6372597", "0.6340332", "0.6262474", "0.6238137", "0.6233221", "0.6228459", "0.6226151", "0.62127346", "0.61869377", "0.61862904", "0.61719066", "0.6142443", "0.6136518", "0.6136518", "0.6134815...
0.7716668
0
GET /user_infoms/1 GET /user_infoms/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @user_infoms = UserInfom.all\n end", "def show_disposisi_user\n\t\t@user = Disposisi.where(user_id: params[:user_id]).order(id: :desc).limit(20)\n\t\trender json: @user\t\n\tend", "def mf_api_get_user_info\n\n # Get the user from the DB\n user = User.find(params[:user_id])\n\n # If no ...
[ "0.7451838", "0.66928464", "0.6588625", "0.65358454", "0.6518362", "0.6483722", "0.64236504", "0.6402925", "0.6385672", "0.636079", "0.6353965", "0.6352552", "0.6341763", "0.6311951", "0.6307217", "0.62991035", "0.62848824", "0.62706184", "0.6255886", "0.6226901", "0.622331",...
0.0
-1
POST /user_infoms POST /user_infoms.json
def create @user_infom = UserInfom.new(user_infom_params) respond_to do |format| if @user_infom.save format.html { redirect_to @user_infom, notice: 'User infom was successfully created.' } format.json { render :show, status: :created, location: @user_infom } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_infom_params\n params.require(:user_infom).permit(:name, :address, :phone_number, :email)\n end", "def index\n @user_infoms = UserInfom.all\n end", "def set_user_infom\n @user_infom = UserInfom.find(params[:id])\n end", "def update\n respond_to do |format|\n if @user_info...
[ "0.68699855", "0.6696669", "0.6420985", "0.6397588", "0.60748255", "0.60267353", "0.59423494", "0.5776221", "0.5761798", "0.5760872", "0.5746508", "0.5712332", "0.5675992", "0.56195164", "0.5610075", "0.5599226", "0.5573044", "0.55720896", "0.557173", "0.55081576", "0.5485821...
0.74865896
0
PATCH/PUT /user_infoms/1 PATCH/PUT /user_infoms/1.json
def update respond_to do |format| if @user_infom.update(user_infom_params) format.html { redirect_to @user_infom, notice: 'User infom was successfully updated.' } format.json { render :show, status: :ok, location: @user_infom } else format.html { render :edit } format.jso...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend", "def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end", "def modify_user(user)\n query_api_object Mod...
[ "0.6615385", "0.66147894", "0.64507455", "0.6402", "0.6386745", "0.63462704", "0.6320079", "0.6316961", "0.6240665", "0.62352", "0.62147117", "0.62013155", "0.61937326", "0.61151314", "0.61145294", "0.6113553", "0.6110769", "0.6109003", "0.6103621", "0.60961366", "0.60886586"...
0.7292405
0
DELETE /user_infoms/1 DELETE /user_infoms/1.json
def destroy @user_infom.destroy respond_to do |format| format.html { redirect_to user_infoms_url, notice: 'User infom was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end", "def user_management_delete_user id\n # the base uri for api requests\n query_builder = Configuration.BASE_URI.dup\n\n # prepare query string for API call\n query_builder << \"/v1/...
[ "0.70498395", "0.68277913", "0.6770382", "0.67619956", "0.6628056", "0.6601004", "0.65995103", "0.65995103", "0.6595688", "0.6559151", "0.6553978", "0.6548279", "0.65370506", "0.65366685", "0.6532592", "0.65325725", "0.6527084", "0.65259564", "0.6520926", "0.6502779", "0.6501...
0.73673546
0
Use callbacks to share common setup or constraints between actions.
def set_user_infom @user_infom = UserInfom.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def user_infom_params params.require(:user_infom).permit(:name, :address, :phone_number, :email) 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 /to_dos/1 GET /to_dos/1.json
def show @to_do = ToDo.find(params[:id]) render json: @to_do end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @project = Project.find(params[:project_id])\n @to_dos = @project.to_dos.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @to_dos }\n end\n end", "def index\n @to_dos = ToDo.all\n\n render json: @to_dos\n end", "def sho...
[ "0.7233594", "0.7113351", "0.67739314", "0.65174794", "0.63395596", "0.6299065", "0.6258278", "0.6143423", "0.607123", "0.5914661", "0.58923167", "0.58923167", "0.5890316", "0.5872412", "0.5859374", "0.585394", "0.5851193", "0.58403164", "0.582402", "0.5821056", "0.5817261", ...
0.63611954
4
POST /to_dos POST /to_dos.json
def create @to_do = ToDo.new(todo_params) if @to_do.save render json: @to_do, status: :created, location: @to_do else render json: @to_do.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @project = Project.find(session[:current_project])\n @to_do = @project.to_dos.new(params[:to_do])\n \n respond_to do |format|\n if @to_do.save\n format.html { redirect_to(project_to_do_path(@project, @to_do), :notice => 'To do was successfully created.') }\n #format.html...
[ "0.6296423", "0.59965247", "0.59182805", "0.5768479", "0.57587856", "0.57159907", "0.56926596", "0.56864804", "0.5677991", "0.5660546", "0.56483686", "0.5629459", "0.55906177", "0.55649626", "0.55495477", "0.55418354", "0.55248475", "0.55218375", "0.5518386", "0.5512161", "0....
0.6239335
1
PATCH/PUT /to_dos/1 PATCH/PUT /to_dos/1.json
def update @to_do = ToDo.find(params[:id]) if @to_do.update(params[:to_do]) head :no_content else render json: @to_do.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @to_do.update(to_do_params)\n format.html { redirect_to :to_dos, notice: 'To do was successfully updated.' }\n format.json { render :show, status: :ok, location: @to_do }\n else\n format.html { render :edit }\n format.json { render j...
[ "0.66546637", "0.6602009", "0.6582188", "0.6523228", "0.64645225", "0.63748574", "0.6326427", "0.6324192", "0.63163286", "0.62771416", "0.6234821", "0.6234821", "0.61776525", "0.6147212", "0.6131364", "0.61209744", "0.61082125", "0.60651875", "0.60476035", "0.60335076", "0.60...
0.66045874
1
DELETE /to_dos/1 DELETE /to_dos/1.json
def destroy @to_do = ToDo.find(params[:id]) @to_do.destroy head :no_content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @to_do.destroy\n\n respond_to do |format|\n format.html { redirect_to to_dos_url, notice: 'To do was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @to_do.destroy\n respond_to do |format|\n format.html { redirect_to to_dos_u...
[ "0.71048135", "0.7100258", "0.69711", "0.68940604", "0.682315", "0.68101007", "0.67741466", "0.67690367", "0.6755809", "0.6755809", "0.6750927", "0.6747538", "0.67267275", "0.67247987", "0.6714626", "0.66550666", "0.6649561", "0.6635794", "0.6634437", "0.6594713", "0.6592283"...
0.6483616
33
Base methods: Computes a shorter description for the name associated with this data
def get_full_name "#{get_scheduled_date}, #{get_event_type}: #{rank}) #{get_team_name}, #{get_timing}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def long_name\n if @description\n @name + ' ' + @description\n else\n @name\n end\n end", "def name\n description\n end", "def name\n description\n end", "def name\n data.name\n end", "def name() return @name end", "def name() return @name end", "def name() end", "def ...
[ "0.7580669", "0.7563897", "0.7563897", "0.74959916", "0.73954344", "0.73954344", "0.7363213", "0.73235005", "0.7228466", "0.7212478", "0.71993315", "0.7199093", "0.7197691", "0.7196926", "0.7196926", "0.7164955", "0.7160113", "0.71546173", "0.71546173", "0.7146659", "0.711903...
0.0
-1
Computes a verbose or formal description for the name associated with this data
def get_verbose_name "#{get_meeting_program_verbose_name}: #{rank}) #{get_team_name}, #{get_timing}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def long_name\n if @description\n @name + ' ' + @description\n else\n @name\n end\n end", "def name\n description\n end", "def name\n description\n end", "def description\n self[:description] || name\n end", "def generate_description\n\t\t\tself.log.debug \"Auto-gene...
[ "0.7701005", "0.76854527", "0.76854527", "0.7549837", "0.74863166", "0.7388833", "0.7383719", "0.7320546", "0.7272374", "0.72530633", "0.7250277", "0.71965224", "0.71965224", "0.71965224", "0.714959", "0.7138751", "0.7068359", "0.7065503", "0.7065503", "0.7065503", "0.7065503...
0.0
-1
Retrieves the user name associated with this instance
def user_name user ? user.name : '' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_username\n @user_name ||= self.user.username\n end", "def user_name\n @user_name ||= SlackUtils::SingletonClient.instance.find_user_name(@user_id)\n end", "def user_name\n return User.find(user_id).name\n end", "def user_name\n return User.find(user_id).name\n end", "def...
[ "0.82827526", "0.8230201", "0.80104524", "0.80104524", "0.7933546", "0.7915788", "0.78437614", "0.77606475", "0.76689744", "0.7650169", "0.76485777", "0.7632554", "0.7632554", "0.7632554", "0.75868064", "0.75719786", "0.7547479", "0.7542634", "0.7539556", "0.74807906", "0.747...
0.74632573
29
Check if this result is valid for the ranking system.
def is_valid_for_ranking !( (meeting_event && meeting_event.is_out_of_race) || (meeting_program && meeting_program.is_out_of_race) || is_out_of_race || is_disqualified ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid?(result)\n log(result)\n\n true\n end", "def valid?\n !!result\n end", "def validated?\n !@result.nil?\n end", "def valid_rank\n\t\treturn true if self.student == nil || self.section == nil\n\t\tunless self.student.rank >= self.section.min_rank && self.student.rank <= s...
[ "0.69737136", "0.6847625", "0.67681164", "0.67449015", "0.6502418", "0.6296459", "0.619907", "0.6194455", "0.61694497", "0.616365", "0.61462975", "0.60809517", "0.6059406", "0.6055645", "0.6017365", "0.601447", "0.60019964", "0.59948236", "0.5994082", "0.5984632", "0.5959709"...
0.6151879
10
Retrieves the associated Team full name
def get_team_name team ? team.get_full_name : '?' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_team_name\n team ? team.get_full_name : (data_import_team ? data_import_team.get_full_name : '?')\n end", "def away_team_name\n return away_team.try(:name)\n end", "def get_team_name_by_id(team_id)\n response = parse_api_request(\"#{BASE_URL}teams/team/#{team_id}\")[\"teams\"].values.first[\"n...
[ "0.7572397", "0.73970866", "0.7385011", "0.73800886", "0.73640317", "0.72956985", "0.7264201", "0.7083541", "0.6999696", "0.6977729", "0.69758993", "0.6931344", "0.692415", "0.69173616", "0.68160367", "0.67088795", "0.66410923", "0.653627", "0.6520873", "0.65179706", "0.64489...
0.8065527
3
Retrieves the localized Event Type code
def get_event_type meeting_program ? meeting_program.event_type.i18n_short : '?' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_event_type\n event_type ? event_type.i18n_short : '?'\n end", "def get_event_type\n event_type ? event_type.i18n_short : '?'\n end", "def get_event_type_code\n event_type ? event_type.code : '?'\n end", "def event_type\n @attributes[:event_type]\n end", "def event_type\n ev...
[ "0.7958139", "0.7958139", "0.79352665", "0.7230469", "0.7115702", "0.7063253", "0.702781", "0.70139784", "0.69287145", "0.6874542", "0.6854266", "0.6745785", "0.6659904", "0.66007173", "0.6521397", "0.65060794", "0.6399143", "0.63873535", "0.6260946", "0.6223919", "0.6218836"...
0.71059084
6
Retrieves the scheduled_date of this result
def get_scheduled_date # The following ActiveRecord chain is granted in existence by validation assertions: (even the first check could be avoided) meeting_program ? meeting_program.get_scheduled_date : '?' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scheduled_date_time\n return @scheduled_date_time\n end", "def scheduled_date\n return Date.today if @header == 'Today' # Change tomorrow to Today if you're generating it in the morning.\n return Date.today + 1 if @header == 'Tomorrow'\n parse_date_in_the_future(@head...
[ "0.79479724", "0.7209043", "0.69906604", "0.6921781", "0.6816651", "0.677491", "0.664641", "0.65805745", "0.64017063", "0.62870896", "0.62658477", "0.6257093", "0.6246092", "0.61516505", "0.60875034", "0.59683955", "0.59683955", "0.59683955", "0.59285355", "0.58935213", "0.57...
0.57611525
21
Retrieves the Meeting Program short name
def get_meeting_program_name meeting_program ? meeting_program.get_meeting_program_name : '?' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meeting_program_name\n meeting_program ? meeting_program.get_full_name : '?'\n end", "def get_meeting_program_verbose_name\n meeting_program ? meeting_program.get_meeting_program_verbose_name : '?'\n end", "def get_meeting_program_name\n meeting_program ? meeting_program.get_full_name : (da...
[ "0.77596647", "0.73975044", "0.73357147", "0.7268767", "0.71160924", "0.6965613", "0.6838517", "0.6815514", "0.6679929", "0.6625754", "0.6624803", "0.6594424", "0.6545799", "0.6545799", "0.6545799", "0.6453804", "0.64207447", "0.6341872", "0.63180214", "0.6306318", "0.6303238...
0.7451233
1
Retrieves the Meeting Program verbose name
def get_meeting_program_verbose_name meeting_program ? meeting_program.get_meeting_program_verbose_name : '?' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_meeting_program_verbose_name\n meeting_program ? meeting_program.get_verbose_name : '?'\n end", "def get_meeting_program_verbose_name\n meeting_program ? meeting_program.get_verbose_name : (data_import_meeting_program ? data_import_meeting_program.get_verbose_name : '?')\n end", "def get_verbos...
[ "0.8476699", "0.8310679", "0.81714606", "0.79002666", "0.78483856", "0.76759076", "0.7270693", "0.68800676", "0.6878543", "0.6833053", "0.6769838", "0.6667852", "0.666658", "0.66613173", "0.66189003", "0.65742755", "0.65742755", "0.6466925", "0.64276075", "0.6389692", "0.6329...
0.8384753
1
Retrieves the relay header if present If not present gets the team name
def get_relay_name relay_header && relay_header != '' ? relay_header : get_team_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_team_name\n team ? team.get_full_name : (data_import_team ? data_import_team.get_full_name : '?')\n end", "def get_team_name\n team ? team.get_full_name : '?'\n end", "def get_team_name\n team ? team.get_full_name : '?'\n end", "def get_team_name\n team ? team.get_full_name : '?'\n en...
[ "0.6221635", "0.6144462", "0.6144462", "0.6144462", "0.6144462", "0.5910531", "0.58129233", "0.57531786", "0.5672363", "0.566336", "0.55756587", "0.5522273", "0.5463742", "0.5427403", "0.54220605", "0.5412459", "0.54080653", "0.53218514", "0.53117937", "0.5308412", "0.5246642...
0.8767464
0
Retrieves the complete names of relay swimmers if present
def get_short_relay_swimmers if meeting_relay_swimmers.exists? "(#{meeting_relay_swimmers.map { |mrs| mrs.swimmer.get_full_name }.join('-')})" else '' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_complete_relay_name\n \"#{get_relay_name} #{get_short_relay_swimmers}\"\n end", "def names\n $LEDGER.keys\n end", "def get_relay_meters_swam\r\n @summary.relays.meters_swam\r\n end", "def get_relay_name\n relay_header && relay_header != '' ? relay_header : get_team_name\n end", ...
[ "0.6578887", "0.5998084", "0.5947734", "0.5910344", "0.5619883", "0.56195813", "0.56124157", "0.56124157", "0.5574108", "0.5560517", "0.55079895", "0.54671824", "0.54656285", "0.5443251", "0.54421645", "0.54086065", "0.5401212", "0.53823894", "0.5374065", "0.53493917", "0.532...
0.7554221
0
Retrieves a complete relay name The complete relay name consists in the relay header (or team name) followed by swimmer's complete names (if stored)
def get_complete_relay_name "#{get_relay_name} #{get_short_relay_swimmers}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_relay_name\n relay_header && relay_header != '' ? relay_header : get_team_name\n end", "def get_short_relay_swimmers\n if meeting_relay_swimmers.exists?\n \"(#{meeting_relay_swimmers.map { |mrs| mrs.swimmer.get_full_name }.join('-')})\"\n else\n ''\n end\n end", "def get_full_na...
[ "0.83768594", "0.6482007", "0.6438857", "0.5960676", "0.58999467", "0.58999467", "0.5863845", "0.5727682", "0.56617796", "0.56617796", "0.56617796", "0.56617796", "0.5604497", "0.551484", "0.54846185", "0.54457885", "0.5415648", "0.53547925", "0.53403103", "0.53372276", "0.53...
0.8132104
1
Create an udid2 language: (String)
def to_udid2(last_name, first_name, birthdate,latitude,longitude) latitude = Float(latitude) longitude = Float(longitude) #get only ascci last_name = last_name[0..25].gsub(/[^a-z ]/i, '').upcase first_name = first_name[0..26].gsub(/[^a-z-]/i, '').upcase #verify latitude and longitude retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def language\n return 'en' if code == \"ind2:0\"\n \n return 'se' if code == \"ind2:4\"\n\n return nil\n end", "def international_create(label_options)\n create_label File.join(LABEL_URL, 'international', label_options)\n end", "def polyglossia_default_language(language_code_3_chars)\n ...
[ "0.6240886", "0.6082768", "0.60789037", "0.60504204", "0.60504204", "0.60504204", "0.60504204", "0.60286283", "0.6015959", "0.6001604", "0.6001604", "0.5953539", "0.5942708", "0.59388214", "0.59384406", "0.5923447", "0.58843297", "0.5883818", "0.58801156", "0.5844188", "0.583...
0.0
-1
Create object Udid2 from existing udid2 string language: (String)
def udid2(udid2) tab_hash = udid2.split(';') @type = tab_hash[0] return 'error_type' if @type != @@type @mode = tab_hash[1] if @mode == 'h' && tab_hash.length == 4 @hash = tab_hash[2] @number = tab_hash[3] elsif @mode == 'c' && tab_hash.length == 8 to_udid2 tab_hash[2],tab_h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def language\n return OrderedStringHelper.deserialize(super )\n end", "def convert_u2!(comment=nil)\n v = get_u2\n out_with_comment! \"<u2>#{v}</u2>\", comment\n end", "def initialize(language)\n @lang = language\n end", "def from_param(string)\n UUID.parse(string)\n end", "def i...
[ "0.5613438", "0.54986674", "0.5374817", "0.5367535", "0.5336331", "0.5336331", "0.524941", "0.5237108", "0.5224465", "0.51757246", "0.5167639", "0.5162829", "0.5157165", "0.5131442", "0.5082108", "0.5073824", "0.50609285", "0.5055321", "0.5052318", "0.5039159", "0.5033299", ...
0.6412994
0
def rotate_array(arr) new_arr = [] 1.upto(arr.size 1) do |i| new_arr << arr[i] end new_arr << arr[0] end
def rotate_array(array) array[1..-1] + [array[0]] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rotate_array(arr)\nnew_arr = []\narr.each do |num|\nnew_arr << num\nend\t\nnew_arr << new_arr.shift\nend", "def rotate_array(arr)\n arr[1..(arr.size - 1)] << arr[0]\nend", "def rotate_array(arr)\n arr[1..(arr.size - 1)] << arr[0]\nend", "def rotate_array(arr)\n arr[1...arr.size] + [arr[0]]\nend", "d...
[ "0.9373181", "0.9337964", "0.9337964", "0.9302785", "0.9302785", "0.92614096", "0.91848683", "0.91346246", "0.91256464", "0.90894496", "0.9079026", "0.9040547", "0.9019476", "0.9019476", "0.9019476", "0.9019476", "0.9019476", "0.9019476", "0.9019476", "0.90167415", "0.9016546...
0.86168724
64
The language file suffix (e.g. "py") in which `file_name` is written.
def file_suffix file_name.split('.').last end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def file_name\n \"#{@file_name}.#{extension}\"\n end", "def file_name(name)\r\n return name.to_s.downcase + '.rb' if name.kind_of?(Symbol)\r\n return ext_name(name).downcase + '.rb'\r\n end", "def _output_filename(file)\n sub_strings = File.basename(file).split('.')\n bas...
[ "0.71721274", "0.7149033", "0.6985433", "0.69012964", "0.68374634", "0.6759491", "0.67329234", "0.67015344", "0.6638358", "0.66267204", "0.66267204", "0.6623191", "0.6595689", "0.65765744", "0.6568812", "0.6566356", "0.6566356", "0.6501581", "0.64789134", "0.64670265", "0.645...
0.7502258
0
The namespace (full class name, full module name) in which the function will be found.
def namespace case language when 'py', 'go', 'java' File.basename(file_name, '.' + language) end # TODO: Add support for Java packages. #open(file_name) { |f| /^\s*package\s+(.*)\s*;$/.match(f.read)[1] } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def namespace\n @namestack.join(\"::\")\n end", "def namespace_module\n klass.name.to_s.split('::')[0..-4].join('::').constantize\n end", "def namespace\n self.class.namespace\n end", "def namespace\n @namespace.ns\n end", "def namespace\n NAMESPACE\n end", "def namespace;...
[ "0.77953863", "0.7457303", "0.7440114", "0.742124", "0.73974174", "0.73844975", "0.73844975", "0.73844975", "0.73844975", "0.73844975", "0.73844975", "0.73844975", "0.73844975", "0.7300189", "0.7243504", "0.72038835", "0.70878845", "0.7085228", "0.7077939", "0.7061676", "0.69...
0.0
-1
This function finds out what language the application we need to make 'Ciceroready' is, and if it is a supported language, dispatches the necessary function to do so. See `self.class.supported_languages` for the currently supported languages.
def generate_app if file_suffix.empty? # no suffix abort("The file specified needs an extension.") end if !self.class.supported_languages.include?(file_suffix) abort("The file specified is not in a supported language. Supported " + "languages are #{self.class.supported_languages.join('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def detect_language\n self.language = LanguageDetector.new(self).detect\n end", "def check_language!\n condition { self.class.languages.include?(params[:lang]) }\n end", "def compute_effective_locale\n # Priority order:\n # 1.query parameter 'lang'\n # 2.cookie 'lang'\n # 3.brow...
[ "0.5729437", "0.55082756", "0.5332508", "0.53023756", "0.5215873", "0.5200796", "0.5166559", "0.49548838", "0.48658478", "0.48433477", "0.47914293", "0.478103", "0.47529474", "0.47236112", "0.4700582", "0.4667449", "0.46662223", "0.46521544", "0.46136943", "0.45993623", "0.45...
0.0
-1
Hook function called from the 'setup' recipe.
def setup super handle_packages end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_setup\n end", "def setup\n # override this if needed\n end", "def setup\n # override and do something appropriate\n end", "def setup\n self.setup! unless self.setup?\n end", "def setup()\n end", "def setup\n debug 'No custom setup defined'\n end", "def setup\n ...
[ "0.79991764", "0.78538287", "0.76406324", "0.76069945", "0.75565636", "0.75462586", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.7537134", "0.75336176", "0.7528871", "0.752887...
0.7007418
96
Creates a monit config file for managing the appserver and then notifies monit to reload it.
def add_appserver_monit opts = { app_shortname: app['shortname'], adapter: adapter, appserver_command: appserver_command, appserver_name: adapter, deploy_to: deploy_dir(app), environment: embed_environment_in_monit? ? environment : {}, source...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_monit_config\n # Scope closureeeeeee.\n _options = options\n _pid_file = pid_file\n _parent = service_resource.parent\n _script_path = script_path\n monit_config new_resource.service_name do\n if _options['monit_template']\n # If we have a te...
[ "0.70206124", "0.6577704", "0.6249865", "0.611913", "0.6104138", "0.6062772", "0.59667826", "0.5880101", "0.58241427", "0.5813825", "0.5729824", "0.57146686", "0.56779546", "0.5677853", "0.5674162", "0.5671364", "0.56571877", "0.56442523", "0.5643906", "0.5640066", "0.5636527...
0.7243646
0
Immediately attempts to restart the appserver using monit.
def restart_monit(pidfile = nil) return if ENV['TEST_KITCHEN'] # Don't like it, but we can't run multiple processes in Docker on travis @monit_hook = { restart: true, pidfile: pidfile, apps: ["#{adapter}_#{app['shortname']}"] } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def restart_server\n stop_server\n sleep 1\n start_server\n end", "def restart_monit\n return if ENV['TEST_KITCHEN'] # Don't like it, but we can't run multiple processes in Docker on travis\n\n pidfile = \"/var/run/lock/#{app['shortname']}/puma.pid\"\n context.execute \"mon...
[ "0.7607977", "0.75397253", "0.7450942", "0.74159986", "0.7176216", "0.7091822", "0.7048402", "0.7006487", "0.69861126", "0.69690806", "0.6968827", "0.6963625", "0.6920003", "0.6873383", "0.6864872", "0.68623173", "0.6857853", "0.6843713", "0.6817831", "0.67747146", "0.6734345...
0.72997594
4
If an instance fails to start, the adapter process may not exist and trying to unmonitor it might fail.
def unmonitor_monit monit_status = "monit status | grep -q #{adapter}_#{app['shortname']}" context.execute "monit unmonitor #{adapter}_#{app['shortname']}" do retries 3 only_if monit_status end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_monit\n pidfile = \"/var/run/lock/#{app['shortname']}/puma.pid\"\n context.execute \"monit start #{adapter}_#{app['shortname']}\" do\n retries 3\n creates pidfile\n end\n end", "def present_and_stopped?\n return inactive_instance_dir_exists?\n end", "de...
[ "0.5970942", "0.5877728", "0.5830319", "0.5725644", "0.55882895", "0.55445623", "0.55107075", "0.54911286", "0.54203165", "0.5359393", "0.5350183", "0.5347866", "0.53338444", "0.5333259", "0.53283244", "0.53181964", "0.5286203", "0.5282139", "0.52813196", "0.52584946", "0.525...
0.6135912
0
Invoke the monit start command for the appserver. This may only be needed during the initial setup of the instance. After that the 'restart' command is sufficient.
def start_monit(pidfile = nil) context.execute "monit start #{adapter}_#{app['shortname']}" do retries 3 creates pidfile unless pidfile.to_s.empty? end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_monit\n pidfile = \"/var/run/lock/#{app['shortname']}/puma.pid\"\n context.execute \"monit start #{adapter}_#{app['shortname']}\" do\n retries 3\n creates pidfile\n end\n end", "def start_app_manager_server\n @state = \"Starting up AppManager\"\n env_va...
[ "0.7360995", "0.7108334", "0.69979864", "0.6988236", "0.69568163", "0.6916012", "0.687249", "0.67504287", "0.6727486", "0.66900927", "0.6656461", "0.6535871", "0.65332216", "0.65033776", "0.646783", "0.6447688", "0.6445249", "0.6435835", "0.6418729", "0.63916194", "0.63557994...
0.6776894
7
Overriding the appserver monit configs can be useful to provide more finegrained control over how the appserver starts, stops and restarts. It can also allow additional configuration to provide alerting.
def appserver_monit_template_cookbook node['deploy'][app['shortname']].try(:[], driver_type).try(:[], 'monit_template_cookbook') || context.cookbook_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_appserver_monit\n opts = {\n app_shortname: app['shortname'],\n adapter: adapter,\n appserver_command: appserver_command,\n appserver_name: adapter,\n deploy_to: deploy_dir(app),\n environment: embed_environment_in_monit? ? environment : {},\n ...
[ "0.64434576", "0.60774803", "0.60347813", "0.5995912", "0.5962995", "0.5882099", "0.5862755", "0.5843979", "0.58388054", "0.5810814", "0.5810814", "0.5752424", "0.57204384", "0.56823534", "0.56763345", "0.56703055", "0.564509", "0.5571936", "0.55625546", "0.55602646", "0.5543...
0.0
-1
Post Install processing for Flipper
def flipper_post_install(installer) file_name = Dir.glob("*.xcodeproj")[0] app_project = Xcodeproj::Project.open(file_name) app_project.native_targets.each do |target| target.build_configurations.each do |config| cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) ' unless cflags.inclu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_install\n end", "def post_install; end", "def pre_install; end", "def install_post_hook\n end", "def install_pre_hook\n end", "def install\n \n end", "def post_install(&block)\n @post_install_callback = block\n end", "def install\n end", "def install\n end", "def post_...
[ "0.84634644", "0.8418884", "0.78978646", "0.75723356", "0.73625416", "0.7361725", "0.72906864", "0.7270273", "0.7270273", "0.72576654", "0.7225776", "0.71913993", "0.7127661", "0.7120892", "0.7017187", "0.6929767", "0.67922884", "0.67776185", "0.67183137", "0.6696246", "0.662...
0.0
-1
Time Complexity: O(n) where n depends on size of .gsub? Space Complexity: O(n) where n depends on size of .gsub?
def is_palindrome(string) string = string.gsub(/\W/, "").downcase # modify string without non word characters and spaces x = 0 i = (string.length - 1) until x >= i if string[x] != string[i] return false end x += 1 i -= 1 end return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sub_replacements text\n if REPLACEABLE_TEXT_RX.match? text\n # NOTE interpolation is faster than String#dup\n text = text.to_s\n REPLACEMENTS.each do |pattern, replacement, restore|\n # NOTE Using gsub! as optimization\n text.gsub!(pattern) { ...
[ "0.5768671", "0.57619417", "0.5720767", "0.5672045", "0.56668955", "0.56247455", "0.56149113", "0.560978", "0.5604132", "0.55691344", "0.5549745", "0.5512622", "0.5510744", "0.55034566", "0.550247", "0.5493103", "0.5489927", "0.5470483", "0.54220814", "0.5417308", "0.5417308"...
0.0
-1
Time Complexity: O(nm) where n is strings size, m is smallest word size? Space Complexity: 0(n) where n is smallest word size?
def longest_prefix(strings) return "" if strings.empty? prefix = "" smallest_word = strings.min_by { |word| word.length } # start with smallest word for i in 0..smallest_word.length-1 if strings.all? { |word| word[i] == smallest_word[i] } # if the index matches the same index of the other words prefix...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def word_sizes(str)\n hash = {}\n idx = 0\n\n loop do \n break if idx == (str.split.size)\n word = str.split[idx]\n hash[word.size] = 0 unless hash.keys.include?(word.size)\n hash[word.size] += 1\n idx += 1\n end\n\n hash\nend", "def word_sizes2(string)\n frequency = Hash.new(0) #set the def...
[ "0.64259124", "0.6416163", "0.63912976", "0.6378067", "0.6364643", "0.6323237", "0.631442", "0.62846917", "0.62805283", "0.6277032", "0.6272538", "0.62635726", "0.6261738", "0.62351376", "0.62274545", "0.6225315", "0.62252164", "0.6221417", "0.6199729", "0.61949927", "0.61942...
0.0
-1
initialize the server. _options_ :: server options. currently effective options are as below: _port_:: HTTP port to listen.
def initialize(options = {}) @http_port = options[:port].to_i @https_port = options[:https_port].to_i if options[:https_port] @jetty = Jetty.new @applications = {} @handler_collection = ContextHandlerCollection.new jetty.handler = @handler_collection end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize server, options\n super server\n @options = options\n end", "def initialize options\n # stats\n\n @stats = {}\n\n clear_stats\n\n if options[:host]\n port = options[:port]\n port = DEFAULT_PORT if port.nil?\n @socket = TCPSocket.new options[:ho...
[ "0.7582842", "0.75455576", "0.69488686", "0.6935617", "0.6907325", "0.69050467", "0.6836465", "0.6831765", "0.6828651", "0.6814192", "0.6813459", "0.6807212", "0.6799882", "0.6770894", "0.67610437", "0.6715891", "0.66868097", "0.66493386", "0.6641114", "0.6614203", "0.6568637...
0.74396676
2
register the application. _application_ :: The application to deploy. It must be an instance of Hokuto::Application.
def add(application) previous_application = applications.delete application.context_root handler_collection.remove_handler previous_application.context if previous_application handler_collection.add_handler application.context applications[application.context_root] = application end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_application(application)\n APPLICATIONS.push(application)\n end", "def register_application(app_name, namespace, public_hostname)\n end", "def create\n\t\t@application = Application.new(params[:application])\n\n\t\tif @application.save\n\t\t\tflash[:developer] = \"Yay! Your applicat...
[ "0.8417841", "0.7245058", "0.6697506", "0.66342807", "0.66342807", "0.66342807", "0.6522779", "0.6481437", "0.63702875", "0.6258977", "0.62216806", "0.6203096", "0.61899614", "0.6180997", "0.6117103", "0.6089562", "0.60895157", "0.60786533", "0.6051465", "0.6027814", "0.60260...
0.6486532
7
Boot server and returns immediately.
def start [:INT, :TERM, :ABRT].each{|signal|Signal.trap(signal, ->{stop})} connector = SelectChannelConnector.new connector.port = http_port connector.confidential_port = https_port if https_port jetty.add_connector connector jetty.start end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bootstrap_server\n bootstrap_config\n\n bootstrap_init\n bootstrap_run\n bootstrap_cleanup\n rescue Hazetug::Exception => e\n ui.error(e.message); 1\n ensure \n knife and knife.ui.stdout.close\n end", "def boot params={}\n Server.node = Server.sta...
[ "0.7547981", "0.73606807", "0.6862254", "0.6766992", "0.6661478", "0.66028476", "0.6556612", "0.6525715", "0.64280486", "0.6417545", "0.64167583", "0.63259417", "0.6278832", "0.62473243", "0.6238131", "0.6214815", "0.6200791", "0.61901456", "0.61714953", "0.6167581", "0.61547...
0.0
-1
Boot this server. Invocation of this method blocks the thread.
def run start jetty.join end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boot params={}\n Server.node = Server.start! params\n Server.semaphore = Mutex.new\n Server.workers = []; true\n end", "def boot\n Thread.new do\n sleep 1 until EM.reactor_running?\n\n begin\n log.info \"Loading application...\"\n app_init\n load_s...
[ "0.74617904", "0.7232447", "0.6792151", "0.6617321", "0.6574739", "0.64952815", "0.6455256", "0.6409987", "0.6389724", "0.63332057", "0.6322798", "0.6305804", "0.61793256", "0.6164773", "0.6137643", "0.6115135", "0.6097806", "0.60874677", "0.60505116", "0.604581", "0.60346955...
0.52807987
93
Shutting down the server.
def stop jetty.stop end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shutdown\n @server.shutdown\n end", "def shutdown\n connection.write(\"shutdown\")\n end", "def shutdown\n request('shutdown')\n end", "def shut_down\n trigger(:shut_down_started)\n @server.stop(true) if @server\n @server_thread.join if @server_thread\n ada...
[ "0.83394754", "0.78308296", "0.77912676", "0.7724265", "0.76148045", "0.7613724", "0.76053226", "0.75247186", "0.7451037", "0.7437494", "0.7431591", "0.7417834", "0.74142253", "0.7352359", "0.73279876", "0.7325457", "0.7282674", "0.71764886", "0.71764886", "0.7167523", "0.716...
0.0
-1
vote method is called by transition Syntax example: record.vote!(my_user, 10)
def vote(value) args = self.state_properties args[:vote] += value[0] self.state_properties=args end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vote\n\tend", "def vote up\n end", "def new_vote(vote, votable, voter)\n vote == 'up' ? votable.upvote_by(voter) : votable.downvote_by(voter)\n change_carma(vote, votable, voter,\n ex_up: 2, ex_down: -1, ph_up: 4, ph_down: -2, usr: 1)\n flash[:notice] = 'Thank you for your vote.'\...
[ "0.7753127", "0.77215445", "0.735953", "0.7192715", "0.71732306", "0.7114955", "0.709762", "0.7075159", "0.70627874", "0.7052002", "0.7044894", "0.70396143", "0.69934535", "0.6959023", "0.68121314", "0.6765686", "0.67624736", "0.6748912", "0.672618", "0.67053956", "0.668458",...
0.70742255
8
accessors for attributes defined by R package
def description data_from_r['description'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attribute(name); end", "def attr(name); end", "def attr; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attribute; end", "def attributes=(_arg0); end", "def attributes; end", "def attributes;...
[ "0.72361153", "0.707081", "0.6799635", "0.6712273", "0.6712273", "0.6712273", "0.6712273", "0.6712273", "0.6712273", "0.6712273", "0.6696367", "0.66370255", "0.66370255", "0.66370255", "0.66370255", "0.66370255", "0.66370255", "0.66370255", "0.66370255", "0.66370255", "0.6637...
0.0
-1
=begin Here is another method which solves the challenge solely with a regex and the case equality operator. 1) ^ asserts the start of the string. 2) (https?:\/\/)? matches 0 or 1 scheme. Because the scheme could be http:// or inside this capture group we place a 0 or 1 quantifier after s (s?). 3) ([az]+\.) matches the...
def codwars?(url) /^(https?:\/\/)?([a-z]+\.)*codwars\.com([?\/]|$)/ === url end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def domain_name(url)\n url.match(/(http[s]?:\\/\\/[\\\\w]{3}?\\.?)(\\w+-?\\w+)/)[-1]\nend", "def domain_name(url)\n url.gsub(/http(s)?:\\/\\/(www.)?/, '').match(/[^.]+/)[0]\nend", "def domain_name(url)\n #url.gsub(/http:|https:|www.|\\/\\/|.com.*/,'')\n url.gsub(/http:|https:|www.|\\/\\//,'').split('.').fi...
[ "0.64569646", "0.6396647", "0.63534147", "0.6342148", "0.6157932", "0.6129903", "0.61219996", "0.61089027", "0.60890746", "0.60885197", "0.605832", "0.605832", "0.6021328", "0.6010232", "0.5985928", "0.59645104", "0.59310293", "0.5912718", "0.58994335", "0.58555067", "0.58494...
0.69531447
0
GET /m2s GET /m2s.json
def index @m2s = M2.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_m2\n @m2 = M2.find(params[:id])\n end", "def create\n @m2 = M2.new(m2_params)\n\n respond_to do |format|\n if @m2.save\n format.html { redirect_to @m2, notice: 'M2 was successfully created.' }\n format.json { render :show, status: :created, location: @m2 }\n else\n ...
[ "0.6323411", "0.59473455", "0.5796414", "0.5565576", "0.5296749", "0.5188784", "0.51144", "0.50355047", "0.50355047", "0.5021901", "0.49708754", "0.49708754", "0.49482462", "0.48777574", "0.48586455", "0.48433352", "0.48273563", "0.482532", "0.48232618", "0.48173282", "0.4809...
0.72625875
0
GET /m2s/1 GET /m2s/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @m2s = M2.all\n end", "def set_m2\n @m2 = M2.find(params[:id])\n end", "def create\n @m2 = M2.new(m2_params)\n\n respond_to do |format|\n if @m2.save\n format.html { redirect_to @m2, notice: 'M2 was successfully created.' }\n format.json { render :show, status: ...
[ "0.7226277", "0.6768004", "0.6182963", "0.6100802", "0.5980741", "0.53596467", "0.5318448", "0.5173656", "0.5167107", "0.51311886", "0.5082298", "0.50422204", "0.5037177", "0.5025415", "0.501556", "0.49637327", "0.49553895", "0.49419808", "0.49161845", "0.48867008", "0.488194...
0.0
-1
POST /m2s POST /m2s.json
def create @m2 = M2.new(m2_params) respond_to do |format| if @m2.save format.html { redirect_to @m2, notice: 'M2 was successfully created.' } format.json { render :show, status: :created, location: @m2 } else format.html { render :new } format.json { render json: @m2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_m2\n @m2 = M2.find(params[:id])\n end", "def index\n @m2s = M2.all\n end", "def update\n respond_to do |format|\n if @m2.update(m2_params)\n format.html { redirect_to @m2, notice: 'M2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @m2...
[ "0.58051527", "0.57833225", "0.5521427", "0.54620224", "0.5256795", "0.51081675", "0.5075327", "0.50454956", "0.5006234", "0.49559033", "0.48874426", "0.4868855", "0.48393244", "0.48204592", "0.4784071", "0.47610676", "0.47579417", "0.47517112", "0.47512412", "0.47441727", "0...
0.6986923
0
PATCH/PUT /m2s/1 PATCH/PUT /m2s/1.json
def update respond_to do |format| if @m2.update(m2_params) format.html { redirect_to @m2, notice: 'M2 was successfully updated.' } format.json { render :show, status: :ok, location: @m2 } else format.html { render :edit } format.json { render json: @m2.errors, status: :un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_m2\n @m2 = M2.find(params[:id])\n end", "def update\n respond_to do |format|\n if @m1.update(m1_params)\n format.html { redirect_to @m1, notice: 'M1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @m1 }\n else\n format.html { ren...
[ "0.59011555", "0.5829728", "0.56544036", "0.5618085", "0.55550253", "0.546108", "0.5453394", "0.5416409", "0.54153275", "0.54126763", "0.5401924", "0.54001504", "0.53912205", "0.53778553", "0.5361919", "0.5361714", "0.53481203", "0.5347545", "0.53475", "0.5337816", "0.5330403...
0.6760014
0
DELETE /m2s/1 DELETE /m2s/1.json
def destroy @m2.destroy respond_to do |format| format.html { redirect_to m2s_url, notice: 'M2 was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @level2.destroy\n respond_to do |format|\n format.html { redirect_to level2s_url, notice: 'Level2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @m1.destroy\n respond_to do |format|\n format.html { redirect_to m1s_url, n...
[ "0.64192486", "0.6415871", "0.63221216", "0.6312803", "0.62802154", "0.6249909", "0.6246265", "0.6205525", "0.6185355", "0.61490744", "0.6130984", "0.6099969", "0.6075173", "0.6054215", "0.6051645", "0.6051304", "0.60497284", "0.60286534", "0.59992284", "0.59672534", "0.59629...
0.7351245
0
Use callbacks to share common setup or constraints between actions.
def set_m2 @m2 = M2.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.6162554", "0.60452986", "0.5945278", "0.59169763", "0.58877826", "0.5834763", "0.5775349", "0.5704972", "0.5704972", "0.56543803", "0.5621491", "0.5427202", "0.54093206", "0.54093206", "0.54093206", "0.53975695", "0.53776276", "0.53562194", "0.5340594", "0.5337824", "0.532...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def m2_params params.require(:m2).permit(:one, :two, :three, :quiz_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
GET /missing_people GET /missing_people.json
def index @missing_people = MissingPerson.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @missing_person = MissingPerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @missing_person }\n end\n end", "def index\n\t\tall_people = Person.all.sort_by(&:id)\n\t\tif all_people\n\t\t\trender json: {people: all_people}\...
[ "0.720787", "0.665935", "0.66163456", "0.65648174", "0.65129155", "0.6309683", "0.6282331", "0.6270231", "0.6253682", "0.6251965", "0.6209477", "0.6209107", "0.6160902", "0.6144441", "0.6134518", "0.6128302", "0.6122582", "0.6100109", "0.60566944", "0.60293204", "0.59747845",...
0.77729493
0
GET /missing_people/1 GET /missing_people/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @missing_people = MissingPerson.all\n end", "def show\n @missing_person = MissingPerson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @missing_person }\n end\n end", "def new\n @missing_person = MissingPerson.new\n...
[ "0.75911736", "0.7498817", "0.6888337", "0.6826597", "0.661755", "0.6554655", "0.65223265", "0.6474877", "0.6330462", "0.63290375", "0.6296056", "0.6275812", "0.62632346", "0.62532336", "0.6247059", "0.62133884", "0.62038285", "0.61455166", "0.6118059", "0.6101156", "0.607014...
0.0
-1
POST /missing_people POST /missing_people.json
def create @missing_person = MissingPerson.new(missing_person_params) respond_to do |format| if @missing_person.save format.html { redirect_to @missing_person, notice: 'Missing person was successfully created.' } format.json { render :show, status: :created, location: @missing_person } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @missing_person = MissingPerson.new(params[:missing_person])\n\n respond_to do |format|\n if @missing_person.save\n format.html { redirect_to @missing_person, notice: 'Missing person was successfully created.' }\n format.json { render json: @missing_person, status: :created, l...
[ "0.697957", "0.6708633", "0.66972804", "0.6343741", "0.62600696", "0.6189469", "0.6163748", "0.60371697", "0.5936564", "0.5830364", "0.57069343", "0.5671836", "0.5638195", "0.5582714", "0.5566397", "0.5554473", "0.55521804", "0.55249083", "0.5521342", "0.5488701", "0.54787725...
0.7042442
0
PATCH/PUT /missing_people/1 PATCH/PUT /missing_people/1.json
def update respond_to do |format| if @missing_person.update(missing_person_params) format.html { redirect_to @missing_person, notice: 'Missing person was successfully updated.' } format.json { render :show, status: :ok, location: @missing_person } else format.html { render :edit ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @missing_person = MissingPerson.find(params[:id])\n\n respond_to do |format|\n if @missing_person.update_attributes(params[:missing_person])\n format.html { redirect_to @missing_person, notice: 'Missing person was successfully updated.' }\n format.json { head :no_content }\n ...
[ "0.7237858", "0.67574745", "0.65572864", "0.6462759", "0.6434644", "0.63955384", "0.6357756", "0.635665", "0.6349818", "0.63441163", "0.6310374", "0.62806505", "0.62806505", "0.6277942", "0.6248078", "0.61633635", "0.6149352", "0.6149352", "0.6149352", "0.6118799", "0.6094889...
0.71559066
1
DELETE /missing_people/1 DELETE /missing_people/1.json
def destroy @missing_person.destroy respond_to do |format| format.html { redirect_to missing_people_url, notice: 'Missing person was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @missing_person = MissingPerson.find(params[:id])\n @missing_person.destroy\n\n respond_to do |format|\n format.html { redirect_to missing_people_url }\n format.json { head :no_content }\n end\n end", "def destroy\n # @person = Person.find(params[:id])\n @person.destroy...
[ "0.7376529", "0.7098308", "0.7045986", "0.7032185", "0.7032185", "0.7032185", "0.7026752", "0.7026752", "0.7026752", "0.7026752", "0.7026752", "0.70254606", "0.70254606", "0.70254606", "0.70254606", "0.696825", "0.6955498", "0.69386536", "0.69386536", "0.6899419", "0.6896093"...
0.71715194
1
Use callbacks to share common setup or constraints between actions.
def set_missing_person @missing_person = MissingPerson.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def missing_person_params params.require(:missing_person).permit(:oca, :operator_name, :officer_name, :ncic_num, :missing_f_name, :missing_l_name, :missing_dob, :missing_race, :missing_sex, :owner_name, :owner_phone, :date_add, :date_remove, :remove_by) 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.69802505", "0.6781974", "0.67470175", "0.67430073", "0.67350477", "0.6593221", "0.6504263", "0.64988977", "0.6481794", "0.64800006", "0.64568025", "0.64411247", "0.6379476", "0.63765615", "0.6368045", "0.6320141", "0.6300363", "0.6300057", "0.62952244", "0.6294712", "0.629...
0.0
-1
POST albums/replace_all_snapshots params: (album defined by source and user_id) src_source src_user_id dst_source dst_user_id Replaces content of 'dst' album with content of 'src' album.
def replace_all_snapshots src_token = album_token('src_') dst_token = album_token('dst_') src_album = Album.find_by(token: src_token) if src_token.blank? || dst_token.blank? || src_album.nil? render nothing: true, status: 400 and return end # Source album needs to be present, destination c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync_albums\n raise 'Source must embed :albums for this to work' if ! self.respond_to?(:albums)\n # First sync all websites, that's creating/updating albums\n Website.where(:source_ids => self.id).only(:albums).each do |website|\n website.import_albums(self.albums)\n end\n self.albums.each ...
[ "0.50722516", "0.46582288", "0.4598983", "0.4571302", "0.45531625", "0.45415345", "0.45028242", "0.44992897", "0.44532076", "0.4443486", "0.4441198", "0.4441198", "0.44383636", "0.4429717", "0.4416723", "0.4416722", "0.43810612", "0.43656832", "0.42417204", "0.42354718", "0.4...
0.8173046
0
Use callbacks to share common setup or constraints between actions.
def set_album if token = album_token @album = Album.find_or_create_by(token: token) else @album = Album.find_by(uuid: params[:id]) end 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
GET /tb_solicituds GET /tb_solicituds.json
def index @tb_solicituds = TbSolicitud.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @solicituds = Solicitud.all\n end", "def index\n @solicituds = Solicitud.all\n end", "def index\n @solicitantes = Solicitante.all\n end", "def index\n @solicitacoes = Solicitacao.all\n end", "def index\n @solicitacao_tipos = SolicitacaoTipo.all\n end", "def index\n @sol...
[ "0.69873744", "0.69873637", "0.6945364", "0.6801515", "0.6775192", "0.6721086", "0.6700022", "0.64653647", "0.64523244", "0.64514923", "0.64041424", "0.6275401", "0.61235344", "0.6111218", "0.60958886", "0.60919005", "0.60644263", "0.60595745", "0.60595745", "0.60595745", "0....
0.74352175
0
GET /tb_solicituds/1 GET /tb_solicituds/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @tb_solicituds = TbSolicitud.all\n end", "def set_tb_solicitud\n @tb_solicitud = TbSolicitud.find(params[:id])\n end", "def index\n @solicituds = Solicitud.all\n end", "def index\n @solicituds = Solicitud.all\n end", "def index\n @solicitantes = Solicitante.all\n end", ...
[ "0.71673584", "0.6874997", "0.6674768", "0.6674746", "0.662485", "0.64392173", "0.6437846", "0.64222234", "0.63436097", "0.6337094", "0.6153981", "0.61378205", "0.61133474", "0.61133474", "0.61133474", "0.61133474", "0.61133474", "0.61133474", "0.60902244", "0.6076644", "0.60...
0.0
-1
POST /tb_solicituds POST /tb_solicituds.json
def create @tb_solicitud = TbSolicitud.new(tb_solicitud_params) respond_to do |format| if @tb_solicitud.save format.html { redirect_to @tb_solicitud, notice: 'Tb solicitud was successfully created.' } format.json { render :show, status: :created, location: @tb_solicitud } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solicitud_params\n params.require(:solicitud).permit(:status, :descripcion, :ayuda_id, :beneficiario_id, :solicitante_id)\n end", "def tb_solicitud_params\n params.fetch(:tb_solicitud, {})\n end", "def create\n authorize! :create, Solicitud\n @solicitante=Solicitante.find(params[:soli...
[ "0.65780145", "0.6575793", "0.6474065", "0.642626", "0.6415298", "0.6309209", "0.62856483", "0.6240865", "0.6174742", "0.61540014", "0.61421806", "0.6064381", "0.6055326", "0.60095716", "0.59712666", "0.5970077", "0.59138244", "0.59003645", "0.5879601", "0.58513683", "0.58481...
0.7114881
0
PATCH/PUT /tb_solicituds/1 PATCH/PUT /tb_solicituds/1.json
def update respond_to do |format| if @tb_solicitud.update(tb_solicitud_params) format.html { redirect_to @tb_solicitud, notice: 'Tb solicitud was successfully updated.' } format.json { render :show, status: :ok, location: @tb_solicitud } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json...
[ "0.6549778", "0.6549553", "0.6473747", "0.6449768", "0.6398544", "0.63747746", "0.63730246", "0.63668287", "0.6235307", "0.62145007", "0.6194887", "0.6153285", "0.6150126", "0.6143688", "0.60497165", "0.5991415", "0.59363824", "0.5924876", "0.59188694", "0.59178865", "0.58242...
0.7197063
0
DELETE /tb_solicituds/1 DELETE /tb_solicituds/1.json
def destroy @tb_solicitud.destroy respond_to do |format| format.html { redirect_to tb_solicituds_url, notice: 'Tb solicitud was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicitudes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @solicitud.destroy\n respond_to do |format|\n format.html { redirect_to solicituds_url, notice: 'Solicitud was suc...
[ "0.7289429", "0.714196", "0.71301657", "0.70311487", "0.6984027", "0.69175285", "0.68670744", "0.68317074", "0.67728364", "0.6766923", "0.6754014", "0.67532957", "0.671836", "0.6664807", "0.66551274", "0.66500396", "0.6573578", "0.65614796", "0.6532719", "0.6515296", "0.65017...
0.75678927
0
Use callbacks to share common setup or constraints between actions.
def set_tb_solicitud @tb_solicitud = TbSolicitud.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.6162554", "0.60452986", "0.5945278", "0.59169763", "0.58877826", "0.5834763", "0.5775349", "0.5704972", "0.5704972", "0.56543803", "0.5621491", "0.5427202", "0.54093206", "0.54093206", "0.54093206", "0.53975695", "0.53776276", "0.53562194", "0.5340594", "0.5337824", "0.532...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def tb_solicitud_params params.fetch(:tb_solicitud, {}) 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 /pastes/1 GET /pastes/1.xml
def show @paste = Paste.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @paste } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(id)\n self.class.get(\"/paste/#{id}\").parsed_response\n end", "def show\n @pastor = Pastor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pastor }\n end\n end", "def index\n unless read_fragment({})\n @past...
[ "0.63709456", "0.61454195", "0.60696155", "0.5849818", "0.5829455", "0.56041944", "0.5449568", "0.5422229", "0.537156", "0.53567773", "0.5348611", "0.53480476", "0.53223", "0.5311295", "0.5292102", "0.5239574", "0.5239574", "0.5237301", "0.5227026", "0.52255297", "0.5207878",...
0.65493953
0
GET /pastes/new GET /pastes/new.xml
def new @paste = Paste.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @paste } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @pastor = Pastor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pastor }\n end\n end", "def new\n @paste = Paste.new\n @languages = Language.find :all\n respond_to do |format|\n format.html # new.html.erb\n format.xml ...
[ "0.6825782", "0.6654043", "0.6479395", "0.6423327", "0.6305111", "0.6195788", "0.6099233", "0.6099233", "0.6095398", "0.6069644", "0.6049743", "0.60087836", "0.6002221", "0.5994028", "0.5993182", "0.5947324", "0.5943598", "0.5943598", "0.59298265", "0.5921654", "0.5893591", ...
0.73081154
0
POST /pastes POST /pastes.xml
def create @paste = Paste.new(params[:paste]) respond_to do |format| if @paste.save flash[:notice] = 'Paste was successfully created.' format.html { redirect_to(@paste) } format.xml { render :xml => @paste, :status => :created, :location => @paste } else format.html...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save\n syntax, text, private = request[:syntax, :text, :private]\n private = !!private # force to boolean for sequel\n\n if request.post? and text and $rapaste_syntaxes[syntax]\n paste = Paste.create(:text => text, :syntax => syntax,\n :private => private, :ip => request.ip)\n\n redir...
[ "0.60137075", "0.5721806", "0.5507307", "0.5466098", "0.5458373", "0.5447851", "0.5375907", "0.5331494", "0.5312567", "0.53016174", "0.52583027", "0.5250013", "0.52485603", "0.5244533", "0.520747", "0.5201718", "0.5150346", "0.5093994", "0.5046321", "0.5023533", "0.49951124",...
0.64230645
0
PUT /pastes/1 PUT /pastes/1.xml
def update @paste = Paste.find(params[:id]) respond_to do |format| if @paste.update_attributes(params[:paste]) flash[:notice] = 'Paste was successfully updated.' format.html { redirect_to(@paste) } format.xml { head :ok } else format.html { render :action => "edit" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_pasta\n @pasta = Pasta.find(params[:id])\n end", "def update\n @pastor = Pastor.find(params[:id])\n\n respond_to do |format|\n if @pastor.update_attributes(params[:pastor])\n format.html { redirect_to(@pastor, :notice => 'El párroco se modificó correctamente.') }\n format...
[ "0.5854791", "0.57318425", "0.5575758", "0.5557874", "0.55031157", "0.53960973", "0.5376799", "0.5344584", "0.52946585", "0.5275045", "0.5269965", "0.52425784", "0.5223912", "0.5194048", "0.51422006", "0.51267767", "0.5104104", "0.5099289", "0.509427", "0.5080112", "0.5051973...
0.6244361
0
DELETE /pastes/1 DELETE /pastes/1.xml
def destroy @paste = Paste.find(params[:id]) @paste.destroy respond_to do |format| format.html { redirect_to(pastes_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @copy = Copy.find(params[:id])\n @copy.destroy\n\n respond_to do |format|\n format.html { redirect_to(copies_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @pas...
[ "0.6241289", "0.6210206", "0.620593", "0.6055521", "0.59508073", "0.5949602", "0.5925162", "0.5923682", "0.5880272", "0.5865128", "0.58320475", "0.5825472", "0.5817971", "0.57744676", "0.57504565", "0.574399", "0.57426393", "0.57426393", "0.57426393", "0.57426393", "0.5738811...
0.72327787
0
require 'rqrcode' GET /users GET /users.json
def index #@qr = RQRCode::QRCode.new(request.url, :size => 6) @title = "Users List" @navinner = "1" @users = User.all respond_to do |format| format.html # index.html.erb format.json { render json: @users } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_for_user(params) # :yields: JSON\n uri=URI.parse(@uri_builder.get_user_contents(Api_options::USER::SEARCH, params))\n http=HttpHandler.initiate_http(uri)\n begin\n response=HttpHandler.get_response(http,uri)\n rescue ArgumentError\n puts \"Request failed with code: #{response.code}...
[ "0.6743876", "0.6588151", "0.646925", "0.6414278", "0.63947225", "0.62865806", "0.62754613", "0.62239325", "0.61910695", "0.61837256", "0.61533374", "0.61295515", "0.6121887", "0.61193174", "0.60884345", "0.6080604", "0.6074794", "0.6055882", "0.6044547", "0.60436183", "0.603...
0.67508435
0
GET /users/1 GET /users/1.json
def show @user = User.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @user } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/users/#{params[:id]}.json\"\n\t response = RestClient.get(url)\n\t @user = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/users.json\"\t \n response = RestClient.get(url)\n @users = JSON.parse(response.body)\t\t \n\tend\n ...
[ "0.81048644", "0.7702803", "0.7702737", "0.76266515", "0.7583709", "0.748053", "0.7460765", "0.74468184", "0.73059213", "0.73002905", "0.7289745", "0.7277051", "0.72353625", "0.7233246", "0.7233246", "0.7233246", "0.7233246", "0.7233246", "0.7233246", "0.7233246", "0.7225044"...
0.0
-1
GET /users/new GET /users/new.json
def new @title = "New User" @navinner = "2" @user = User.new respond_to do |format| format.html # new.html.erb format.json { render json: @user } #format.svg { render :qrcode => request.url, :level => :h, :unit => 10 } #format.png { render :qrcode => request.url } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end", "def new\n @usernew = Usernew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usernew }\n ...
[ "0.8287397", "0.8169197", "0.8155916", "0.80483407", "0.8022376", "0.8021751", "0.8009459", "0.7950995", "0.793078", "0.793078", "0.7873476", "0.7873476", "0.7873476", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0.7860956", "0...
0.0
-1
POST /users POST /users.json
def create if params[:is_site] == "yes" @user = User.new(params[:user]) @user.username = @user.name @user.cell_number = "5555555555" @user.email = (0...8).map{65.+(rand(26)).chr}.join + "@bioneox.com" else @user = User.new(params[:user]) end respond_to do |format| if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "def CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end", "def post b...
[ "0.77179813", "0.75206673", "0.73831296", "0.72405374", "0.719841", "0.7140812", "0.71038526", "0.7058827", "0.7041636", "0.70236504", "0.7003128", "0.70021695", "0.70021695", "0.70021695", "0.69936967", "0.6990463", "0.6980393", "0.6979075", "0.69788617", "0.69788617", "0.69...
0.0
-1
PUT /users/1 PUT /users/1.json
def update @user = User.find(params[:id]) respond_to do |format| if @user.update_attributes(params[:user]) if current_user.is_admin? format.html { redirect_to users_url, notice: 'User was successfully updated.' } format.json { head :no_content } else format.h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n render json: Users.update(params[\"id\"], params[\"user\"])\n end", "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "def UpdateUser params = {}\n \n APICall(path: 'users.json',method: 'PUT',payload: params.to_json)\n \n end", "de...
[ "0.74114245", "0.73920554", "0.73041475", "0.7254177", "0.7202618", "0.70756376", "0.70535713", "0.7029043", "0.70075685", "0.69883573", "0.6983195", "0.694263", "0.69409895", "0.692315", "0.6909438", "0.687742", "0.68486536", "0.6834162", "0.6821841", "0.6801179", "0.6770304...
0.0
-1
DELETE /users/1 DELETE /users/1.json
def destroy @user = User.find(params[:id]) @user.destroy respond_to do |format| format.html { redirect_to users_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end", "def delete\n render json: User.delete(params[\"id\"])\n end", "def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end", "def delete\n render json: Users.delete(params[\"id\...
[ "0.7873292", "0.7750298", "0.7712461", "0.7608525", "0.74697524", "0.7405238", "0.7405238", "0.7367449", "0.7343722", "0.7337858", "0.73261935", "0.7307456", "0.73072684", "0.73045266", "0.7295572", "0.7288997", "0.72888744", "0.7287881", "0.72815514", "0.72480947", "0.724809...
0.0
-1
Test that the result from recommend method returns user menu items and recommended menu items
def test_return_hash_of_recommendations assert_equal({ :recommendation => [4, 5, 2, 3, 6] }, item_based_recommendation(ItemBasedMock.matrix_data).recommendation) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recommendations_menu\n if @user.mylist.length.positive?\n recommendation = Rec.new(@user)\n recommendation.amount_of_suggestions\n else\n no_items\n end\n end", "def analyze\n analyze = Menu.new(\"What would you like to see?\")\n analyze.add_menu_item({key_user_returns:...
[ "0.7141897", "0.6209805", "0.61417294", "0.61111474", "0.58744437", "0.58342326", "0.5739922", "0.5735809", "0.5723904", "0.5706842", "0.57068086", "0.5704993", "0.56834763", "0.5675316", "0.56527364", "0.5614366", "0.56017125", "0.5578361", "0.55378497", "0.5522751", "0.5514...
0.6448469
1
Initialize Recommend class for user based recommendation
def item_based_recommendation(matrix_data) Recommend.new(ItemBasedRecommendation.new,@menu,[],matrix_data) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recommendations\n check_preference_setup \n check_last_played_time\n add_personality_recommendations\n\n @recommendations\n end", "def recommendation=(value)\n @recommendation = value\n end", "def set_recommendation\n @recommendation = Recommendation.find(params[...
[ "0.6768572", "0.6662622", "0.6546614", "0.6546614", "0.6512615", "0.647396", "0.64479417", "0.6371568", "0.6365608", "0.63374984", "0.62370133", "0.6229826", "0.6205669", "0.62052447", "0.61296034", "0.61071223", "0.60778993", "0.6061658", "0.60406995", "0.600647", "0.5990243...
0.6441973
7
Renders json for tree specifc to Treant format. Uses jbuilder file
def tree @vision = Vision.first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render_process_tree_json (expressions)\n\n OpenWFE::Json.encode(expressions.tree)\n end", "def jstree\n @obj = @questionnaire.questionnaire_structure_for_js_tree(params)\n respond_to do |format|\n format.js { render :json => @obj.to_json, :callback => params[:callback] }\n end\n end", ...
[ "0.6780147", "0.66811574", "0.62786555", "0.6186167", "0.6132701", "0.61027867", "0.61023307", "0.60939366", "0.6083948", "0.6072437", "0.60572016", "0.6049777", "0.6044451", "0.59875715", "0.5896443", "0.5890393", "0.58756584", "0.587464", "0.5855137", "0.5807967", "0.579056...
0.0
-1