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 /eventinterests/1 GET /eventinterests/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_interest }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.json { render js...
[ "0.744504", "0.71390194", "0.71185654", "0.7068642", "0.7023972", "0.7018341", "0.69449764", "0.68843067", "0.6743654", "0.6743654", "0.6658405", "0.6602967", "0.65270346", "0.65088576", "0.65007055", "0.62919736", "0.62904423", "0.6278622", "0.6273331", "0.6258273", "0.62567...
0.0
-1
POST /eventinterests POST /eventinterests.json
def create @eventinterest = Eventinterest.new(eventinterest_params) respond_to do |format| if @eventinterest.save format.html { redirect_to @eventinterest, notice: 'Eventinterest was successfully created.' } format.json { render :show, status: :created, location: @eventinterest } else format.html { render :new } format.json { render json: @eventinterest.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @event_interest = EventInterest.new(params[:event_interest])\n\n respond_to do |format|\n if @event_interest.save\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully created.' }\n format.json { render json: @event_interest, status: :created, l...
[ "0.707777", "0.68618846", "0.68135554", "0.65843797", "0.6525929", "0.6335123", "0.6230702", "0.6202513", "0.61847836", "0.6179254", "0.6154558", "0.6091796", "0.60894305", "0.6083123", "0.59956443", "0.5987523", "0.5913445", "0.5896425", "0.5891812", "0.58892655", "0.5867812...
0.70627296
1
PATCH/PUT /eventinterests/1 PATCH/PUT /eventinterests/1.json
def update respond_to do |format| if @eventinterest.update(eventinterest_params) format.html { redirect_to @eventinterest, notice: 'Eventinterest was successfully updated.' } format.json { render :show, status: :ok, location: @eventinterest } else format.html { render :edit } format.json { render json: @eventinterest.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n if @event_interest.update_attributes(params[:event_interest])\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully updated.' }\n format.json { head :no_content }\n ...
[ "0.7378092", "0.7067416", "0.675718", "0.67105275", "0.66952074", "0.66684645", "0.64933866", "0.6488396", "0.64568275", "0.6375166", "0.63739395", "0.6278687", "0.6265169", "0.6237687", "0.6232738", "0.6200686", "0.6192138", "0.6175111", "0.6160488", "0.6145741", "0.61438537...
0.7274615
1
DELETE /eventinterests/1 DELETE /eventinterests/1.json
def destroy @eventinterest.destroy respond_to do |format| format.html { redirect_to eventinterests_url, notice: 'Eventinterest was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @event_interest = EventInterest.find(params[:id])\n @event_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to event_interests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.de...
[ "0.80704147", "0.75139153", "0.743511", "0.7416739", "0.7384328", "0.72238696", "0.72238696", "0.7210827", "0.7034387", "0.7034387", "0.702601", "0.70212483", "0.70002776", "0.69684386", "0.6940719", "0.69236773", "0.69204783", "0.68932366", "0.68932366", "0.68932366", "0.688...
0.7751148
1
Use callbacks to share common setup or constraints between actions.
def set_eventinterest @eventinterest = Eventinterest.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163927", "0.6046165", "0.59465253", "0.59167755", "0.58904207", "0.58346355", "0.577713", "0.5703502", "0.5703502", "0.56531286", "0.56215113", "0.54224145", "0.5410795", "0.5410795", "0.5410795", "0.53924775", "0.5379919", "0.53580743", "0.53401667", "0.53397506", "0.533...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def eventinterest_params params.require(:eventinterest).permit(:isinterest, :user_id, :events_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 /fantasy_players GET /fantasy_players.json
def index @fantasy_players = FantasyPlayer.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n player = Player.all\n render json: players, status: 200\n end", "def index\n @players = Player.all\n render json: @players, status: 200\n end", "def index\n @players = Player.all\n render json: @players\n end", "def show\n @team = Team.find(params[:team_id])\n @player =...
[ "0.76091397", "0.7530982", "0.74527204", "0.7359775", "0.7333973", "0.7275735", "0.7219038", "0.71818036", "0.71559155", "0.71443516", "0.7123106", "0.7118635", "0.7105937", "0.7105937", "0.7105937", "0.7105937", "0.7105937", "0.709734", "0.7075563", "0.70476687", "0.70268095...
0.7201186
7
GET /fantasy_players/1 GET /fantasy_players/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @team = Team.find(params[:team_id])\n @player = @team.players.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @player }\n end\n end", "def index\n player = Player.all\n render json: players, status: 200\n end", ...
[ "0.7389259", "0.7389208", "0.7374817", "0.73298615", "0.7297435", "0.7257542", "0.7250481", "0.7250481", "0.7250481", "0.7250481", "0.7250481", "0.7191598", "0.7180427", "0.7172236", "0.717068", "0.7164944", "0.69943285", "0.6953005", "0.6947138", "0.6937913", "0.6922101", ...
0.0
-1
POST /fantasy_players POST /fantasy_players.json
def create @fantasy_player = FantasyPlayer.new(fantasy_player_params) # raise @fantasy_player.to_yaml respond_to do |format| if @fantasy_player.save Pusher['dashboard'].trigger('refresh_dashboard', { message: 'refreshing dashboard' }) fantasy_draft = FantasyDraft.find(@fantasy_player.fantasy_draft_id) fantasy_draft.player_id = nil fantasy_draft.save format.html { redirect_to fantasy_league_fantasy_draft_manager_path(@fantasy_player.fantasy_league_id, @fantasy_player.fantasy_draft_id), notice: 'Fantasy player was successfully created.' } format.json { render :show, status: :created, location: @fantasy_player } else format.html { render :new } format.json { render json: @fantasy_player.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @fantasy_team_player = FantasyTeamPlayer.create(team_id: @team.id, player_id: params[:player_id])\n unless @fantasy_team_player.new_record?\n render json: @fantasy_team_player, status: :ok, include: [:player]\n else\n render json: error_messages_on_create, status: :unprocessable_ent...
[ "0.76632375", "0.7262531", "0.71538466", "0.7113027", "0.7100474", "0.70951414", "0.70940614", "0.7029797", "0.7010312", "0.69802636", "0.6943458", "0.68993413", "0.68968", "0.68903315", "0.6873749", "0.6871685", "0.68645376", "0.68645376", "0.68645376", "0.68645376", "0.6834...
0.6743857
35
PATCH/PUT /fantasy_players/1 PATCH/PUT /fantasy_players/1.json
def update respond_to do |format| if @fantasy_player.update(fantasy_player_params) Pusher['dashboard'].trigger('refresh_dashboard', { message: 'refreshing dashboard' }) format.html { redirect_to fantasy_league_fantasy_draft_manager_path(@fantasy_player.fantasy_league_id, @fantasy_player.fantasy_draft_id), notice: 'Fantasy player was successfully updated.' } format.json { render :show, status: :ok, location: @fantasy_player } else format.html { render :edit } format.json { render json: @fantasy_player.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @player.update(player_params)\n render json: @player, status: 200\n end", "def update\n @player.update!(player_params) # anticipated possible exceptions rescued in BaseController\n render json: @player, status: 200\n end", "def update\n @player = Player.find(params[:id])\...
[ "0.7154198", "0.7100933", "0.70257366", "0.6917303", "0.6832961", "0.68318737", "0.6795171", "0.6795087", "0.6795087", "0.6795087", "0.6795087", "0.6795087", "0.6795087", "0.6781598", "0.67471886", "0.6724036", "0.6724036", "0.6724036", "0.6724036", "0.67079973", "0.6700316",...
0.6598748
28
DELETE /fantasy_players/1 DELETE /fantasy_players/1.json
def destroy @fantasy_player.destroy Pusher['dashboard'].trigger('refresh_dashboard', { message: 'refreshing dashboard' }) respond_to do |format| format.html { redirect_to fantasy_league_fantasy_draft_manager_path(@fantasy_player.fantasy_league_id, @fantasy_player.fantasy_draft_id), notice: 'Fantasy player was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @client_player = ClientPlayer.find(params[:id])\n @client_player.destroy\n\n respond_to do |format|\n format.html { redirect_to client_players_url }\n format.json { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respo...
[ "0.7425047", "0.73567504", "0.73567504", "0.73566735", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7326525", "0.7326525", "0.7326525", "0.7322771", "0.7267264", "0.7267066", "0.7266039", "0.72520286", "0.72147137"...
0.68512523
82
Use callbacks to share common setup or constraints between actions.
def set_fantasy_player @fantasy_player = FantasyPlayer.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 fantasy_player_params params.require(:fantasy_player).permit(:fantasy_league_id, :fantasy_team_id, :fantasy_draft_id, :player_id, :price) 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.6978086", "0.6780264", "0.6742658", "0.6738813", "0.67338693", "0.65908474", "0.6501793", "0.6495506", "0.64796513", "0.64755446", "0.6454826", "0.6437561", "0.6377127", "0.63722163", "0.6364058", "0.63178706", "0.62979764", "0.62968165", "0.62913024", "0.6289789", "0.6289...
0.0
-1
Update properties of this object
def update!(**args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @blob_generation = args[:blob_generation] if args.key?(:blob_generation) @blob_id = args[:blob_id] if args.key?(:blob_id) @download_read_handle = args[:download_read_handle] if args.key?(:download_read_handle) @read_token = args[:read_token] if args.key?(:read_token) @upload_metadata_container = args[:upload_metadata_container] if args.key?(:upload_metadata_container) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @blob_ref = args[:blob_ref] if args.key?(:blob_ref) @blobstore2_info = args[:blobstore2_info] if args.key?(:blobstore2_info) @cosmo_binary_reference = args[:cosmo_binary_reference] if args.key?(:cosmo_binary_reference) @crc32c_hash = args[:crc32c_hash] if args.key?(:crc32c_hash) @inline = args[:inline] if args.key?(:inline) @length = args[:length] if args.key?(:length) @md5_hash = args[:md5_hash] if args.key?(:md5_hash) @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop) @path = args[:path] if args.key?(:path) @reference_type = args[:reference_type] if args.key?(:reference_type) @sha1_hash = args[:sha1_hash] if args.key?(:sha1_hash) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @best_guess = args[:best_guess] if args.key?(:best_guess) @from_bytes = args[:from_bytes] if args.key?(:from_bytes) @from_file_name = args[:from_file_name] if args.key?(:from_file_name) @from_header = args[:from_header] if args.key?(:from_header) @from_url_path = args[:from_url_path] if args.key?(:from_url_path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @checksums_location = args[:checksums_location] if args.key?(:checksums_location) @chunk_size_bytes = args[:chunk_size_bytes] if args.key?(:chunk_size_bytes) @object_location = args[:object_location] if args.key?(:object_location) @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes) @object_version = args[:object_version] if args.key?(:object_version) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @object_location = args[:object_location] if args.key?(:object_location) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @checksums_info = args[:checksums_info] if args.key?(:checksums_info) @object_info = args[:object_info] if args.key?(:object_info) @object_version = args[:object_version] if args.key?(:object_version) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @object_version = args[:object_version] if args.key?(:object_version) @original_object = args[:original_object] if args.key?(:original_object) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes) @object_version = args[:object_version] if args.key?(:object_version) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.5973787
59
Update properties of this object
def update!(**args) @allow_gzip_compression = args[:allow_gzip_compression] if args.key?(:allow_gzip_compression) @ignore_range = args[:ignore_range] if args.key?(:ignore_range) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @algorithm = args[:algorithm] if args.key?(:algorithm) @bigstore_object_ref = args[:bigstore_object_ref] if args.key?(:bigstore_object_ref) @blob_ref = args[:blob_ref] if args.key?(:blob_ref) @blobstore2_info = args[:blobstore2_info] if args.key?(:blobstore2_info) @composite_media = args[:composite_media] if args.key?(:composite_media) @content_type = args[:content_type] if args.key?(:content_type) @content_type_info = args[:content_type_info] if args.key?(:content_type_info) @cosmo_binary_reference = args[:cosmo_binary_reference] if args.key?(:cosmo_binary_reference) @crc32c_hash = args[:crc32c_hash] if args.key?(:crc32c_hash) @diff_checksums_response = args[:diff_checksums_response] if args.key?(:diff_checksums_response) @diff_download_response = args[:diff_download_response] if args.key?(:diff_download_response) @diff_upload_request = args[:diff_upload_request] if args.key?(:diff_upload_request) @diff_upload_response = args[:diff_upload_response] if args.key?(:diff_upload_response) @diff_version_response = args[:diff_version_response] if args.key?(:diff_version_response) @download_parameters = args[:download_parameters] if args.key?(:download_parameters) @filename = args[:filename] if args.key?(:filename) @hash_prop = args[:hash_prop] if args.key?(:hash_prop) @hash_verified = args[:hash_verified] if args.key?(:hash_verified) @inline = args[:inline] if args.key?(:inline) @is_potential_retry = args[:is_potential_retry] if args.key?(:is_potential_retry) @length = args[:length] if args.key?(:length) @md5_hash = args[:md5_hash] if args.key?(:md5_hash) @media_id = args[:media_id] if args.key?(:media_id) @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop) @path = args[:path] if args.key?(:path) @reference_type = args[:reference_type] if args.key?(:reference_type) @sha1_hash = args[:sha1_hash] if args.key?(:sha1_hash) @sha256_hash = args[:sha256_hash] if args.key?(:sha256_hash) @timestamp = args[:timestamp] if args.key?(:timestamp) @token = args[:token] if args.key?(:token) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @bucket_name = args[:bucket_name] if args.key?(:bucket_name) @generation = args[:generation] if args.key?(:generation) @object_name = args[:object_name] if args.key?(:object_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @create_time = args[:create_time] if args.key?(:create_time) @expire_time = args[:expire_time] if args.key?(:expire_time) @id = args[:id] if args.key?(:id) @name = args[:name] if args.key?(:name) @report_type_id = args[:report_type_id] if args.key?(:report_type_id) @system_managed = args[:system_managed] if args.key?(:system_managed) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @jobs = args[:jobs] if args.key?(:jobs) @next_page_token = args[:next_page_token] if args.key?(:next_page_token) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @next_page_token = args[:next_page_token] if args.key?(:next_page_token) @report_types = args[:report_types] if args.key?(:report_types) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @next_page_token = args[:next_page_token] if args.key?(:next_page_token) @reports = args[:reports] if args.key?(:reports) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @create_time = args[:create_time] if args.key?(:create_time) @download_url = args[:download_url] if args.key?(:download_url) @end_time = args[:end_time] if args.key?(:end_time) @id = args[:id] if args.key?(:id) @job_expire_time = args[:job_expire_time] if args.key?(:job_expire_time) @job_id = args[:job_id] if args.key?(:job_id) @start_time = args[:start_time] if args.key?(:start_time) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Update properties of this object
def update!(**args) @deprecate_time = args[:deprecate_time] if args.key?(:deprecate_time) @id = args[:id] if args.key?(:id) @name = args[:name] if args.key?(:name) @system_managed = args[:system_managed] if args.key?(:system_managed) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n ...
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328...
0.0
-1
Metodo que incluye la libreria del actioncable y se conecta al canal demo y la cual es el encargado de mandar a todos los conectados la publicacion que realiza un usuario y responde con una action desde el controllador
def send_to_action_cable data = {message: to_html,action:"new_post"} self.user.friend_ids.each do |friend_id| #"posts_#{friend_id}" hace el broacating a todos los amigos del usuarios #quien realiza la publicacion ActionCable.server.broadcast "posts_#{friend_id}", data end self.user.user_ids.each do |friend_id| ActionCable.server.broadcast "posts_#{friend_id}", data end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def curator_actions(user)\n can_act_as_logged_in_user(user)\n can_curate\n can_update_metadata\n end", "def activar\n # flash[:notice] = \"klkkkk\"\n \n session[:cliente_id] = \"desktop\" # SETEADO MANUAL ADMINISTRATIVAMENTE OK TED.\n session[:tipo_cliente] = \"123\" # SETEADO MANUAL ADMIN...
[ "0.5792495", "0.57833564", "0.5744827", "0.56624395", "0.5635397", "0.56341416", "0.5529034", "0.5501633", "0.54921734", "0.54668206", "0.54336053", "0.5421039", "0.5418851", "0.537546", "0.5374013", "0.5373845", "0.5350416", "0.5323263", "0.53216326", "0.53087735", "0.530590...
0.50530076
79
GET /gnodes/1 GET /gnodes/1.json
def show @gnode = Gnode.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @gnode } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_nodes\n JSON.parse(Net::HTTP.get(URI(\"#{__cluster_url}/_nodes/process\")))\n end", "def nodes\r\n params = {\r\n method: :get,\r\n url: '/project/nodes',\r\n params: { prjUUID: @uuid }\r\n }\r\n @session.request(**params).perform!['nodes']\r\n ...
[ "0.6999959", "0.6914701", "0.67783946", "0.6659386", "0.66576815", "0.6574512", "0.6488312", "0.64699525", "0.6384202", "0.6309582", "0.63084364", "0.62858725", "0.6282642", "0.6282642", "0.6282642", "0.6282642", "0.6282642", "0.6282112", "0.61778694", "0.6170559", "0.615136"...
0.7236844
0
GET /gnodes/new GET /gnodes/new.json
def new @gnode = Gnode.new respond_to do |format| format.html # new.html.erb format.json { render json: @gnode } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "d...
[ "0.7503664", "0.7503664", "0.7503664", "0.7503664", "0.7460648", "0.73053044", "0.7286441", "0.7272244", "0.72317314", "0.72179854", "0.71523064", "0.7116745", "0.71138334", "0.7103245", "0.70497763", "0.68550664", "0.6844446", "0.6828655", "0.6821503", "0.6779349", "0.677821...
0.7926474
0
POST /gnodes POST /gnodes.json
def create @gnode = Gnode.new(params[:gnode]) respond_to do |format| if @gnode.save format.html { redirect_to @gnode, notice: 'Gnode was successfully created.' } format.json { render json: @gnode, status: :created, location: @gnode } else format.html { render action: "new" } format.json { render json: @gnode.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_missing(method, *args, &block)\n data = { method: method, parameters: args }\n request.post(path: nodes_path, data: data, auth_token: auth_token)\n end", "def create\n megam_rest.post_node(to_hash)\n end", "def create_node_with_props data\n headers = {\n 'Accept' => 'app...
[ "0.6819252", "0.65203476", "0.63891584", "0.63803405", "0.6365424", "0.6167253", "0.60946095", "0.6025852", "0.593734", "0.5933848", "0.5909308", "0.5904701", "0.58926255", "0.58926255", "0.58926255", "0.58653724", "0.5832633", "0.58268434", "0.5824329", "0.58236784", "0.5795...
0.7106958
0
PUT /gnodes/1 PUT /gnodes/1.json
def update @gnode = Gnode.find(params[:id]) respond_to do |format| if @gnode.update_attributes(params[:gnode]) format.html { redirect_to @gnode, notice: 'Gnode was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @gnode.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @node = Node.find(params[:id])\n @json = Node.all.to_gmaps4rails\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n @nodes = Node.where(:user_id => current_user[:id])\n @nodes.each do |node|\n node.jobnumber = nil\n node.vehicle_id = nil...
[ "0.6442687", "0.6403066", "0.63474804", "0.63474804", "0.63474804", "0.63303804", "0.6327922", "0.6256871", "0.6239784", "0.623553", "0.623553", "0.623553", "0.62133646", "0.61938864", "0.6187117", "0.6185669", "0.61847305", "0.6160426", "0.6123705", "0.60719126", "0.6069259"...
0.69552726
0
DELETE /gnodes/1 DELETE /gnodes/1.json
def destroy @gnode = Gnode.find(params[:id]) @gnode.destroy respond_to do |format| format.html { redirect_to gnodes_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n node = @job.nodes.find(params[:id])\n @job.nodes.delete(node)\n\n respond_to do |format|\n format.html { redirect_to job_url(@job) }\n format.xml { head :ok }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend"...
[ "0.68975353", "0.6881464", "0.67785126", "0.6765078", "0.67585284", "0.6736974", "0.67335826", "0.6718847", "0.6718847", "0.6718847", "0.6699355", "0.6696454", "0.66497666", "0.6615126", "0.6563885", "0.6537905", "0.65225035", "0.65114945", "0.65114945", "0.65114945", "0.6511...
0.75663936
0
The operating system is derived from the Darwin kernel version when present, otherwise pulled from the comment.
def os darwin = detect_product(DARWIN) version = if darwin UserAgent::OperatingSystems::Darwin::WATCH_OS[darwin.version.to_s] else match = detect_comment_match(/watchOS\s(?<version>[\.\d]+)/) match.named_captures['version'] if match end [WATCH_OS, version].compact.join(' ') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sys_uname_osname\n uname = `uname`\n if uname.include? 'Darwin' # macOS\n :macos\n elsif uname.include? 'Linux'\n :linux\n elsif uname.include? 'MINGW'\n :windows\n elsif uname.include? 'OpenBSD'\n :openbsd\n end\n end", "def ...
[ "0.7746464", "0.77171475", "0.7708016", "0.7650055", "0.75772154", "0.7566651", "0.75614023", "0.75310904", "0.75310904", "0.7484535", "0.7466924", "0.7443228", "0.7433102", "0.7416258", "0.73817044", "0.7377747", "0.7364486", "0.7358462", "0.72604036", "0.724797", "0.724657"...
0.7046675
41
Sinatra uses caller_locations for the file name in Tilt (unlike Rails/Rack) So here we are only grabbing the file name and name of directory it is in
def create_filename_for_metric(file) return file unless defined?(::Sinatra) && defined?(::Sinatra::Base) file.split('/')[-2..-1].join('/') rescue NoMethodError file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caller_files\n caller_locations.\n map { |file,line| file }\n end", "def find_file(path)\n\t\t\tcaller_path = caller_locations(4..4).first.path\n\n\t\t\t## It now never causes `LoadError`, but returning `nil`, as I want\n\t\t\t## https://github.com/jeremyevans/tilt/issues/2\n\t\t\tcaller_dir =...
[ "0.67720985", "0.6450147", "0.64347374", "0.63042325", "0.63042325", "0.6288789", "0.6281273", "0.6262194", "0.61561275", "0.61107826", "0.6066449", "0.6037355", "0.6036283", "0.60210586", "0.60029703", "0.5998585", "0.59810364", "0.59595376", "0.59490246", "0.58945495", "0.5...
0.0
-1
GET /events/1 GET /events/1.json
def show @event = Event.find(params[:id]) @ticket = @event.tickets.new 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
Check if all time slot ids exist times: array of time slot id
def validate_time_slot_ids times empty_times if times.size == 0 times.each do |id| time_slot = TimeSlot.find(id) end true rescue ActiveRecord::RecordNotFound r = {times: 'Record Not Found'} return not_found r end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_time_slots times\n time_models = []\n times.each do |time|\n t = TimeSlot.new(from: time[:from], to: time[:to], opinion_poll: @opinion_poll)\n\n bad_request t.errors.messages and return unless t.valid?\n time_models.append t\n end\n time_models\n end", "def get_time_slot_...
[ "0.66781074", "0.65845853", "0.6560357", "0.6447423", "0.63985753", "0.6378263", "0.63464206", "0.62637347", "0.6225948", "0.6207943", "0.61952233", "0.61527413", "0.6099937", "0.6064067", "0.6043473", "0.6039101", "0.60314065", "0.60021514", "0.59750915", "0.59750915", "0.59...
0.7683565
0
Exception when array times is empty.
def empty_times r = {times: 'should not be empty'} return not_found r end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def must_choose_at_least_one_time\n \tif compact_times_available.size <= 0\n \t\tself.errors[:base] << \"Must choose at least one time slot\"\n \tend\n end", "def test_empty_0\n # Changes: had to rewrite arrays as @cls\n # assert_equal true, [].empty?\n # assert_equal false, [1].empty?\n # assert...
[ "0.614483", "0.6060145", "0.6060145", "0.5903699", "0.58698183", "0.5848611", "0.5832767", "0.5687147", "0.568666", "0.55943704", "0.5593099", "0.55908155", "0.5562388", "0.55398685", "0.54875576", "0.5483156", "0.5477802", "0.54491466", "0.5438058", "0.5428361", "0.54014957"...
0.67978966
0
Authenticates user via api key The api key should be handed by request header "xaccesstoken" or get/post parameter "api_key" if the authentication fails, renders error message
def authenticate! api_key = request.headers["x-access-token"] || params.delete(:api_key) if api_key.nil? self.current_advertiser = self.current_publisher = nil else self.current_advertiser = Trac::Advertiser.find_by(advertiser_api_key: api_key) logger.info "Advertiser [#{current_advertiser.name}] logged in." if current_advertiser self.current_publisher = current_advertiser.nil? ? Trac::Publisher.find_by(publisher_api_key: api_key) : nil logger.info "Publisher [#{current_publisher.name}] logged in." if current_publisher end render status: :unauthorized, json: { message: "Wrong API token!" } if current_advertiser.nil? && current_publisher.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_authenticate\n unless params[:api_key] == \"oz\" || api_user\n render :json => {:error => \"API key not found\"}, :status => :unauthorized\n end\n end", "def authenticate\n @apikey = request.headers[:apikey]\n if @apikey==nil || @apikey!= APIKEY\n json_response={\n ...
[ "0.7944754", "0.7858201", "0.7823399", "0.76797473", "0.74314576", "0.7402341", "0.73600787", "0.7352987", "0.73324823", "0.7315078", "0.72946626", "0.7286719", "0.72200686", "0.72186196", "0.7139922", "0.7112355", "0.710506", "0.7060924", "0.70552266", "0.6992541", "0.696045...
0.6911132
26
Returns the resource from the created instance variable
def resource instance_variable_get(:"@#{resource_name}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource\n\t\t\t\tinstance_variable_get(\"@#{resource_name}\")\n\t\t\tend", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"...
[ "0.7880105", "0.7842488", "0.78156567", "0.7742631", "0.7742631", "0.7742631", "0.7726993", "0.7726993", "0.76276875", "0.76276875", "0.76276875", "0.76276875", "0.7468592", "0.7436348", "0.72905236", "0.7194489", "0.7149006", "0.70893526", "0.7079484", "0.70715827", "0.69233...
0.7751867
4
Returns the allowed parameters for searching Override this method in each API controller to permit additional parameters to search on
def query_params {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_custom_search_params; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def allowed_query_params\n %w[include fields filter sort page]\n end", "def search_params\n return {} unless params[:q]\n params.require(:q).permit!\n end", "def authorize_params\n supe...
[ "0.7116617", "0.7066794", "0.70283854", "0.6910947", "0.6677572", "0.6677378", "0.6674495", "0.65911496", "0.65735656", "0.6535017", "0.6516017", "0.6495849", "0.6493942", "0.64545274", "0.64497447", "0.6444509", "0.6444509", "0.64414024", "0.6433928", "0.63995445", "0.638673...
0.0
-1
The resource class based on the controller
def resource_class @resource_class ||= resource_class_name.constantize end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_class\n @resource_class ||= self.controller_name.singularize.classify.constantize\n end", "def resource_class\n name = controller.controller_name\n return \"active\" if name == \"resources\"\n end", "def resource_klass\n resource_klass_name.constantize\n end", "def resource_cl...
[ "0.8618411", "0.8433249", "0.82288253", "0.81042385", "0.80970544", "0.80970544", "0.80970544", "0.80751187", "0.8063445", "0.8029621", "0.8029621", "0.8029621", "0.8021062", "0.8001003", "0.79841983", "0.7955573", "0.791964", "0.7886186", "0.78640455", "0.78640455", "0.78595...
0.7984989
14
The singular name for the resource class based on the controller
def resource_name @resource_name ||= self.controller_name.singularize end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_name\n name.to_s.chomp('Controller').demodulize.singularize\n end", "def get_resource_name\n \tself.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource...
[ "0.861274", "0.85466033", "0.85093474", "0.85093474", "0.8507382", "0.8507382", "0.84701234", "0.84701234", "0.84701234", "0.8435745", "0.8435745", "0.8416853", "0.84051806", "0.83983785", "0.8360254", "0.83439785", "0.8292862", "0.8240594", "0.8230048", "0.81918824", "0.8179...
0.8278734
19
Use callbacks to share common setup or constraints between actions.
def set_resource(resource_variable = nil) resource_variable ||= resource_class.find(params[:id]) instance_variable_set(:"@#{resource_name}", resource_variable) 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
Deprecated metrics not used anymore
def generateDelayToIntegrationByMergeScenario(projectName, localClone, pathOutput) prefixProjectName = formatProjectName(projectName) integrationLine = [] integrationLineAuthorDateList = [] integrationLineCommitDateList = [] File.open(localClone+pathOutput+prefixProjectName+"_CommitList.csv", 'r') do |f1| while line = f1.gets f1.each_line do |line| leftAuthorsList = [] rightAuthorsList = [] campos = line.split(",")#.length mergeCommitID = campos[0].gsub("\r","").gsub("\n","") isConflicting = campos[1].gsub("\r","").gsub("\n","") leftCommits = campos[10].split("@@") rightCommits = campos[11].split("@@") leftDelayIntegration = 0 rightDelayIntegration = 0 arithmeticMeanDelayIntegration = 0 geometricMeanDelayIntegration = 0 deltaIntegration = 0 if leftCommits.include?("\n") leftCommits.delete("\n") end if rightCommits.include?("\n") rightCommits.delete("\n") end # Metric startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{leftCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") leftDelayIntegration = (endDate - startDate).to_i startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{rightCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") rightDelayIntegration = (endDate - startDate).to_i leftDelayLessThanZero = false if (leftDelayIntegration==0) leftDelayIntegration = 1 end rightDelayLessThanZero = false if (rightDelayIntegration==0) rightDelayIntegration = 1 end if leftDelayIntegration > rightDelayIntegration deltaIntegration = leftDelayIntegration - rightDelayIntegration elsif rightDelayIntegration > leftDelayIntegration deltaIntegration = rightDelayIntegration - leftDelayIntegration else deltaIntegration = 0 end if (rightDelayIntegration <0) leftDelayLessThanZero = true end if((leftDelayIntegration * rightDelayIntegration) <0) if(leftDelayIntegration <0) leftDelayIntegration = 1 else rightDelayIntegration = 1 end end arithmeticMeanDelayIntegration = (Float(leftDelayIntegration + rightDelayIntegration)/2).round(2) geometricMeanDelayIntegration = Math.sqrt(Float(leftDelayIntegration*rightDelayIntegration)).round(2) linha = mergeCommitID+","+isConflicting+","+leftDelayIntegration.to_s+","+rightDelayIntegration.to_s+","+arithmeticMeanDelayIntegration.to_s+","+geometricMeanDelayIntegration.to_s+","+deltaIntegration.to_s integrationLine.push(linha.gsub("\n", "")) File.open(localClone+pathOutput+prefixProjectName+"_DelayDeltaIntegrationList.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, leftDelayIntegration, rightDelayIntegration, arithmeticMeanDelayIntegration, geometricMeanDelayIntegration, deltaIntegration" integrationLine.each do |dado| file.puts "#{dado}" end end # exploring more data - extra internal test startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{leftCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") leftDelayIntegration = (endDate - startDate).to_i startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{rightCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") rightDelayIntegration = (endDate - startDate).to_i if leftDelayIntegration > rightDelayIntegration deltaIntegration = leftDelayIntegration - rightDelayIntegration elsif rightDelayIntegration > leftDelayIntegration deltaIntegration = rightDelayIntegration - leftDelayIntegration else deltaIntegration = 0 end if leftDelayIntegration * rightDelayIntegration < 0 if leftDelayIntegration < 0 leftDelayIntegration = leftDelayIntegration * -1 else rightDelayIntegration = rightDelayIntegration * -1 end end arithmeticMeanDelayIntegration = (Float(leftDelayIntegration + rightDelayIntegration)/2).round(2) geometricMeanDelayIntegration = Math.sqrt(Float(leftDelayIntegration*rightDelayIntegration)).round(2) linha = mergeCommitID+","+isConflicting+","+leftDelayIntegration.to_s+","+rightDelayIntegration.to_s+","+arithmeticMeanDelayIntegration.to_s+","+geometricMeanDelayIntegration.to_s+","+deltaIntegration.to_s integrationLineCommitDateList.push(linha.gsub("\n", "")) File.open(localClone+pathOutput+prefixProjectName+"_DelayDeltaIntegrationCommitDatesList.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, leftDelayIntegration, rightDelayIntegration, arithmeticMeanDelayIntegration, geometricMeanDelayIntegration, deltaIntegration" integrationLineCommitDateList.each do |dado| file.puts "#{dado}" end end # exploring more data - extra test startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{leftCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") leftDelayIntegration = (endDate - startDate).to_i startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{rightCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") rightDelayIntegration = (endDate - startDate).to_i if leftDelayIntegration > rightDelayIntegration deltaIntegration = leftDelayIntegration - rightDelayIntegration elsif rightDelayIntegration > leftDelayIntegration deltaIntegration = rightDelayIntegration - leftDelayIntegration else deltaIntegration = 0 end if leftDelayIntegration * rightDelayIntegration < 0 if leftDelayIntegration < 0 leftDelayIntegration = leftDelayIntegration * -1 else rightDelayIntegration = rightDelayIntegration * -1 end end arithmeticMeanDelayIntegration = (Float(leftDelayIntegration + rightDelayIntegration)/2).round(2) geometricMeanDelayIntegration = Math.sqrt(Float(leftDelayIntegration*rightDelayIntegration)).round(2) linha = mergeCommitID+","+isConflicting+","+leftDelayIntegration.to_s+","+rightDelayIntegration.to_s+","+arithmeticMeanDelayIntegration.to_s+","+geometricMeanDelayIntegration.to_s+","+deltaIntegration.to_s integrationLineAuthorDateList.push(linha.gsub("\n", "")) File.open(localClone+pathOutput+prefixProjectName+"_DelayDeltaIntegrationAuthorDatesList.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, leftDelayIntegration, rightDelayIntegration, arithmeticMeanDelayIntegration, geometricMeanDelayIntegration, deltaIntegration" integrationLineAuthorDateList.each do |dado| file.puts "#{dado}" end end end #f1eachline end #while end #Fileopen puts "end running generateDelayToIntegrationByMergeScenario from #{prefixProjectName} project" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def additional_metrics\n []\n end", "def setup_metrics\n end", "def setup_metrics\n end", "def setup_metrics\n end", "def cpu_metrics\n super\n end", "def metrics\n @metrics ||= collect_metrics\n end", "def custom_metrics\n @custom_metrics ||= {}\n end", "def metr...
[ "0.725618", "0.71900743", "0.71900743", "0.71900743", "0.69524914", "0.6940736", "0.69379634", "0.69339013", "0.67721003", "0.65621305", "0.65298617", "0.64481145", "0.6427784", "0.64030856", "0.6345231", "0.6332598", "0.6320169", "0.62699753", "0.6227215", "0.6115263", "0.61...
0.0
-1
method Changed Files and Lines
def getNumberOfChangedFilesAndChangedLines (projectName, localClone, pathInput, pathOutput) prefixProjectName = formatProjectName(projectName) filesList = [] dataList = [] countTemp = 0 #_ParentsFiles File.open(localClone+pathOutput+prefixProjectName+"_CommitList.csv", 'r') do |fileMerges| while line = fileMerges.gets fileMerges.each_line do |line| camposMerge = line.split(",") File.open(localClone+pathInput+prefixProjectName+"_MergeScenarioList.csv", 'r') do |fileTEMP| while lineTEMP = fileTEMP.gets fileTEMP.each_line do |lineTEMP| camposParents = lineTEMP.split(",") if (camposMerge[0].eql? camposParents[0]) data = camposMerge[0].gsub("\"", "").gsub("\n","")+","+camposMerge[1].gsub("\"", "").gsub("\n","")+","+camposMerge[10].gsub("\"", "").gsub("\n","")+","+camposMerge[11].gsub("\"", "").gsub("\n","")+","+camposParents[4].gsub("\"", "").gsub("\n","")+","+camposParents[6].gsub("\"", "").gsub("\n","") dataList.push(data) countTemp +=1 end end end end end end end File.open(localClone+pathOutput+prefixProjectName+"_CommitListAndFilesList.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, listLeftCommits, listRightCommits, leftFiles, rightFiles" dataList.each do |dado| file.puts "#{dado}" end end projectsList = [] File.open(localClone+pathOutput+prefixProjectName+"_CommitListAndFilesList.csv", 'r') do |f1| while line = f1.gets f1.each_line do |line| campos = line.split(",")#.length mergeCommitID = campos[0].gsub("\r","").gsub("\n","") isConflicting = campos[1].gsub("\r","").gsub("\n","") leftCommits = campos[2].split("@@") rightCommits = campos[3].split("@@") leftFiles = campos[4][1..campos[4].length-2].split("@") if !campos[5].include?("\n") rightFiles = campos[5][1..campos[5].length-2].split("@") else rightFiles = campos[5][1..campos[5].length-3].split("@") end #leftFiles=[] countLeftLines =0 countRightLines=0 #rightFiles arithmeticMeanChangedFiles = 0 geometricMeanChangedFiles = 0 if leftCommits.include?("\n") leftCommits.delete("\n") end if rightCommits.include?("\n") rightCommits.delete("\n") end leftCommits.each do |commit| data = %x(git --no-pager log -1 --stat #{commit}) listInfo = data.split("\n") leftFiles.each do |f| listInfo.each do |item| if item.include?(f+" ") and item.include?("|") and (!f.include?(".bmp") and !f.include?(".dib") and !f.include?(".jpg") and !f.include?(".jpeg") and !f.include?(".jpe") and !f.include?(".jfif") and !f.include?(".gif") and !f.include?(".tif") and !f.include?(".tiff") and !f.include?(".png") and !f.strip.eql?("Gemfile.lock")) tmpItem = item.split("|") countLeftLines += tmpItem[1][/\d+/].to_i end end end end rightCommits.each do |commit| data = %x(git --no-pager log -1 --stat #{commit}) listInfo = data.split("\n") rightFiles.each do |f| listInfo.each do |item| if item.include?(f+" ") and item.include?("|") and (!f.include?(".bmp") and !f.include?(".dib") and !f.include?(".jpg") and !f.include?(".jpeg") and !f.include?(".jpe") and !f.include?(".jfif") and !f.include?(".gif") and !f.include?(".tif") and !f.include?(".tiff") and !f.include?(".png") and !f.strip.eql?("Gemfile.lock")) tmpItem = item.split("|") countRightLines += tmpItem[1][/\d+/].to_i end end end end if (countLeftLines == 0) countLeftLines = 1 end if (countRightLines == 0) countRightLines = 1 end arithmeticMeanChangedLines = (Float(countLeftLines + countRightLines)/2).round(2) geometricMeanChangedLines = Math.sqrt(Float(countLeftLines*countRightLines)).round(2) dados = mergeCommitID+","+isConflicting+","+"#{countLeftLines}"+","+"#{countRightLines}"+","+"#{arithmeticMeanChangedLines}"+","+"#{geometricMeanChangedLines}" projectsList.push(dados.gsub("\"", "")) end end end File.open(localClone+pathOutput+prefixProjectName+"_NumberOfChangedLines.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, countLeftLines, countRightLines, arithmeticMeanChangedLines, geometricMeanChangedLines" projectsList.each do |dado| file.puts "#{dado}" end end projectsList = [] projectsFilesList = [] File.open(localClone+pathOutput+prefixProjectName+"_CommitListAndFilesList.csv", 'r') do |f1| while line = f1.gets f1.each_line do |line| campos = line.split(",")#.length mergeCommitID = campos[0].gsub("\r","").gsub("\n","") isConflicting = campos[1].gsub("\r","").gsub("\n","") leftFiles = campos[4].split("@") rightFiles = campos[5].split("@") countLeftFiles = leftFiles.length countRightFiles = rightFiles.length arithmeticMeanChangedFiles = 0 geometricMeanChangedFiles = 0 arithmeticMeanChangedFiles = (Float(countLeftFiles + countRightFiles)/2).round(2) geometricMeanChangedFiles = Math.sqrt(Float(countLeftFiles*countRightFiles)).round(2) dados = mergeCommitID+","+isConflicting+","+"#{countLeftFiles}"+","+"#{countRightFiles}"+","+"#{arithmeticMeanChangedFiles}"+","+"#{geometricMeanChangedFiles}" projectsFilesList.push(dados.gsub("\"", "")) end end end File.open(localClone+pathOutput+prefixProjectName+"_NumberOfChangedFiles.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, countLeftFiles, countRightFiles, arithmeticMeanChangedFiles, geometricMeanChangedFiles" projectsFilesList.each do |dado| file.puts "#{dado}" end end puts "end running getNumberOfChangedFilesAndChangedLines from #{prefixProjectName} project" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modified_files; end", "def on_change(modified, added, deleted)\n # Modifications and additions are treated the same.\n (modified + added).uniq.each do |path|\n if file = Ichiban::ProjectFile.from_abs(path)\n begin\n @loader.change(file) # Tell the Loader that this file ha...
[ "0.7013519", "0.6924939", "0.68323964", "0.68219936", "0.67926556", "0.6636241", "0.6588556", "0.6538642", "0.64429504", "0.64199746", "0.6405246", "0.63697565", "0.63362575", "0.63362575", "0.6287588", "0.62289083", "0.6203389", "0.6201734", "0.619699", "0.6153621", "0.61291...
0.0
-1
Generate a single CSV file (one for each project) with all grouped metrics for statistical analysis. It can be used to evaluate individual projects that compose the aggregated sample.
def generateCVSToStatisticAnalysis (projectName, localClone, pathInput,pathOutput) prefixProjectName = formatProjectName(projectName) listSlices = [] listConflictsAndFiles = [] listNumberOfCommits = [] listNumberOfAuthors = [] listDelayDeltaIntegration = [] listMinimumLifeTime = [] listNmberOfChangedFiles = [] listNumberOfChangedLines = [] listContributionConclusionDelay = [] listPackages = [] File.open(localClone+pathOutput+prefixProjectName+"_CommitList.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathInput+prefixProjectName+".csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","") isConflicting = "0" if camposMainMerge[1].gsub("\"","").eql?("true") isConflicting = "1" end existsCommonSlice = camposAuxMerge[2].gsub("\"","") totalCommonSlices = camposAuxMerge[3].gsub("\"","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices listSlices.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_Slices.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices" listSlices.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_Slices.csv", 'r') do |mainMerges| #while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") dados="" if camposMainMerge[1].gsub("\"","").gsub("\n","").eql?("0") mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = "0" conflictsNumber = "0" dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber listConflictsAndFiles.push(dados) elsif camposMainMerge[1].gsub("\"","").gsub("\n","").eql?("1") File.open(localClone+pathInput+prefixProjectName+"_MergeScenarioList.csv", 'r') do |auxMerges| # while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") #conflictingFilesNumber = camposAuxMerge[1].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposAuxMerge[2].to_s.split("@").length.to_s #.gsub("\"","").gsub("\n","") conflictsNumber = camposAuxMerge[8].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber listConflictsAndFiles.push(dados) end end #each_line # end #while end # File.open end# elsif end #each_line # end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_ConflictingFilesAndConflicts.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber" listConflictsAndFiles.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_ConflictingFilesAndConflicts.csv", 'r') do |mainMerges| #while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_CommitList.csv", 'r') do |auxMerges| # while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposAuxMerge[8].gsub("\"","").gsub("\n","")#8 numberOfCommitsGeoAverage = camposAuxMerge[9].gsub("\"","").gsub("\n","")#8#9 dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage listNumberOfCommits.push(dados) end end #each_line # end #while end # File.open end #each_line # end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfCommits.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage" listNumberOfCommits.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfCommits.csv", 'r') do |mainMerges| #while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_AuthorList.csv", 'r') do |auxMerges| # while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposAuxMerge[6].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage listNumberOfAuthors.push(dados) end end #each_line # end #while end # File.open end #each_line # end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfAuhtors.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage" listNumberOfAuthors.each do |dado| file.puts "#{dado}" end end # Deprecated - generate csv with delay and delta integration - metrics not used anymore File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfAuhtors.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_DelayDeltaIntegrationList.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposAuxMerge[4].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") deltaIntegration = camposAuxMerge[6].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration listDelayDeltaIntegration.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_DelayAndDeltaIntegration.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration" listDelayDeltaIntegration.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_DelayAndDeltaIntegration.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_LifetimeAuthorDateList.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposAuxMerge[4].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage listMinimumLifeTime.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_MinimumLifeTime.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage" listMinimumLifeTime.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_MinimumLifeTime.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_NumberOfChangedFiles.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposMainMerge[13].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposMainMerge[14].gsub("\"","").gsub("\n","") numberOfChangedFilesArithAverage = camposAuxMerge[4].gsub("\"","").gsub("\n","") numberOfChangedFilesGeoAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage listNmberOfChangedFiles.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfChangedFiles.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage, numberOfChangedFilesArithAverage, numberOfChangedFilesGeoAverage" listNmberOfChangedFiles.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfChangedFiles.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_NumberOfChangedLines.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposMainMerge[13].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposMainMerge[14].gsub("\"","").gsub("\n","") numberOfChangedFilesArithAverage = camposMainMerge[15].gsub("\"","").gsub("\n","") numberOfChangedFilesGeoAverage = camposMainMerge[16].gsub("\"","").gsub("\n","") numberOfChangedLinesArithAverage = camposAuxMerge[4].gsub("\"","").gsub("\n","") numberOfChangedLinesGeoAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage+","+numberOfChangedLinesArithAverage+","+numberOfChangedLinesGeoAverage listNumberOfChangedLines.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfChangedLines.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage, numberOfChangedFilesArithAverage, numberOfChangedFilesGeoAverage, numberOfChangedLinesArithAverage, numberOfChangedLinesGeoAverage" listNumberOfChangedLines.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfChangedLines.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_ContributionConclusionDelayList.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposMainMerge[13].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposMainMerge[14].gsub("\"","").gsub("\n","") numberOfChangedFilesArithAverage = camposMainMerge[15].gsub("\"","").gsub("\n","") numberOfChangedFilesGeoAverage = camposMainMerge[16].gsub("\"","").gsub("\n","") numberOfChangedLinesArithAverage = camposMainMerge[17].gsub("\"","").gsub("\n","") numberOfChangedLinesGeoAverage = camposMainMerge[18].gsub("\"","").gsub("\n","") contributionConclusionDelay = camposAuxMerge[4].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage+","+numberOfChangedLinesArithAverage+","+numberOfChangedLinesGeoAverage+","+contributionConclusionDelay listContributionConclusionDelay.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_ContributionConclusionDelay.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage, numberOfChangedFilesArithAverage, numberOfChangedFilesGeoAverage, numberOfChangedLinesArithAverage, numberOfChangedLinesGeoAverage, contributionConclusionDelay" listContributionConclusionDelay.each do |dado| file.puts "#{dado}" end end #aqui inderir a última variável desejada, precisar alterar de acordo com a última File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_ContributionConclusionDelay.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathInput+prefixProjectName+"_Packages.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposMainMerge[13].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposMainMerge[14].gsub("\"","").gsub("\n","") numberOfChangedFilesArithAverage = camposMainMerge[15].gsub("\"","").gsub("\n","") numberOfChangedFilesGeoAverage = camposMainMerge[16].gsub("\"","").gsub("\n","") numberOfChangedLinesArithAverage = camposMainMerge[17].gsub("\"","").gsub("\n","") numberOfChangedLinesGeoAverage = camposMainMerge[18].gsub("\"","").gsub("\n","") contributionConclusionDelay = camposMainMerge[19].gsub("\"","").gsub("\n","") #metricas de package adicionadas existsCommonPackages = camposAuxMerge[2].gsub("\"","").gsub("\n","") totalCommonPackages = camposAuxMerge[3].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage+","+numberOfChangedLinesArithAverage+","+numberOfChangedLinesGeoAverage+","+contributionConclusionDelay+","+existsCommonPackages+","+totalCommonPackages listPackages.push(dados) #puts "dados = #{dados}" end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+prefixProjectName+"_AllVariables.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage, numberOfChangedFilesArithAverage, numberOfChangedFilesGeoAverage, numberOfChangedLinesArithAverage, numberOfChangedLinesGeoAverage, contributionConclusionDelay, existsCommonPackages, totalCommonPackages" listPackages.each do |dado| file.puts "#{dado}" #puts "#{dado}" end end puts "end running generateCVSToStatisticAnalysis from #{prefixProjectName} project" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genCsvSummary()\n csv = [] ;\n to_a.each{|analyzer|\n csv.push(analyzer.genCsvRowSummary()) ;\n }\n return csv ;\n end", "def generate_csv\n @project = Project.find(params[:id])\n \n content_type = if request.user_agent =~ /windows/i\n ' application/vnd.ms-excel '\n...
[ "0.6441021", "0.62983656", "0.61877155", "0.6161644", "0.6152706", "0.61481494", "0.61361086", "0.5933046", "0.5900733", "0.5875254", "0.5866604", "0.58657247", "0.5827197", "0.5797892", "0.57410026", "0.5737299", "0.57358277", "0.5703527", "0.56919885", "0.5667934", "0.56667...
0.5439848
44
Method declaration Generate a single CSV file (for the aggregated sample.) with all grouped metrics for statistical analysis.
def generateCVSToStatisticAnalysisAggregatedSample(projectName, localClone, pathInput, pathOutput) #Dir.chdir localClone prefixProjectName = formatProjectName(projectName) projectsList = [] #projectName = "netguru" File.open(localClone+pathOutput+prefixProjectName+"_AllVariables.csv", "r") do |text| #indexLine = 0 text.gets #ler o cabeçalho text.each_line do |line| lista = line.split(",") mergeCommitID = lista[0] #puts "mergeCommitID = #{mergeCommitID}" isConflicting = lista[1] existsCommonSlice = lista[2] totalCommonSlices = lista[3] #puts "totalCommonSlices = #{totalCommonSlices}" conflictingFilesNumber = lista[4] conflictsNumber = lista[5] numberOfCommitsArithAverage = lista[6] numberOfCommitsGeoAverage = lista[7] numberOfAuthorsArithAverage = lista[8] numberOfAuthorsGeoAverage = lista[9] delayIntegrationArithAverage = lista[10] delayIntegrationGeoAverage = lista[11] deltaIntegration = lista[12] minimumLifeTimeArithAverage = lista[13] minimumLifeTimeGeoAverage = lista[14] numberOfChangedFilesArithAverage = lista[15] numberOfChangedFilesGeoAverage = lista[16] numberOfChangedLinesArithAverage = lista[17] numberOfChangedLinesGeoAverage = lista[18] contributionConclusionDelay = lista[19] existsCommonPackages = lista[20] totalCommonPackages = lista[21] #puts "existsCommonPackages = #{existsCommonPackages}" #puts "totalCommonPackages = #{totalCommonPackages}" mergeCommitID = lista[0].gsub("\r","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage+","+numberOfChangedLinesArithAverage+","+numberOfChangedLinesGeoAverage+","+contributionConclusionDelay+","+existsCommonPackages+","+totalCommonPackages projectsList.push(dados.gsub("\n", "")) end end File.open(localClone+pathOutput+"allProjects_AllVariables.csv", 'a') do |file| if (File.size(localClone+pathOutput+"allProjects_AllVariables.csv") == 0) file.puts "mergeCommitID,isConflicting,existsCommonSlice,totalCommonSlices,conflictingFilesNumber,conflictsNumber,numberOfCommitsArithAverage,numberOfCommitsGeoAverage,numberOfAuthorsArithAverage,numberOfAuthorsGeoAverage,delayIntegrationArithAverage,delayIntegrationGeoAverage,deltaIntegration,minimumLifeTimeArithAverage,minimumLifeTimeGeoAverage,numberOfChangedFilesArithAverage,numberOfChangedFilesGeoAverage,numberOfChangedLinesArithAverage,numberOfChangedLinesGeoAverage,contributionConclusionDelay,existsCommonPackages,totalCommonPackages" end projectsList.each do |dado| file.puts "#{dado}" end end puts "end running generateCVSToStatisticAnalysisAggregatedSample from #{prefixProjectName} project" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genCsvSummary()\n csv = [] ;\n to_a.each{|analyzer|\n csv.push(analyzer.genCsvRowSummary()) ;\n }\n return csv ;\n end", "def to_csv\n initialize_generator\n csv_report_generator.records = pull_join\n csv_report_generator.generate_report\n end", "def to_csv\n CSV.generate(\"\...
[ "0.72291785", "0.6831418", "0.67760617", "0.67500573", "0.6663427", "0.6526661", "0.65180373", "0.65158856", "0.64576584", "0.6456997", "0.63644844", "0.6331803", "0.63055557", "0.6278788", "0.6270818", "0.6241609", "0.6241609", "0.62223476", "0.6218263", "0.62179446", "0.618...
0.0
-1
eds doc: to backup rds instance
def backup(options = {}) my_aws = { region: ENV['AWS_REGION'], access_method: 'api_key', access_key: ENV['AWS_API_KEY'], secret_key: ENV['AWS_SECRET_KEY'] } conn = ::Skejuler::Aws::Connector.new(my_aws) rds = conn.rds # Aws RDS Client library rds.describe_db_instances instance_id = options.fetch(:instance_id) puts instance_id # do something on it end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def system_backup\n\n\n end", "def backup \n begin\n check_if_db_exists\n is_allowed = @conn.exec(\"select datallowconn from pg_catalog.pg_database where datname='#{@options[:database]}'\")[0]['datallowconn']\n if is_allowed == 'f'\n # unquiece temporarily\n set_dataallowcon_to t...
[ "0.66211927", "0.66163284", "0.6572172", "0.65284425", "0.64936274", "0.62824166", "0.6253166", "0.6248349", "0.6241493", "0.6227637", "0.6188735", "0.5982258", "0.5980549", "0.59729415", "0.59644675", "0.5957096", "0.59501845", "0.59445065", "0.59313476", "0.59268725", "0.58...
0.7133587
0
Complete the solve function below.
def solve(meal_cost, tip_percent, tax_percent) tip_cost = meal_cost * (tip_percent / 100.0) tax_cost = meal_cost * (tax_percent / 100.0) return (meal_cost + tip_cost + tax_cost).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
Reset log for a new trip
def resetLog @currSpeed = 0 @totalDistance = 0 @travelLog = "" @numChanges = 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_log_data\n without_logging { update_all(log_data: nil) }\n end", "def log_reset\n @log_device.truncate(0) if defined? @log_device\n self\n end", "def reset_log_data\n self.class.without_logging { update_column(:log_data, nil) }\n end", "def clear_log\n request(...
[ "0.7399419", "0.7079062", "0.6743656", "0.6721781", "0.64943117", "0.6250224", "0.62394255", "0.62362605", "0.6232578", "0.621043", "0.6170892", "0.61264724", "0.61006695", "0.6086368", "0.60309345", "0.60214394", "0.59615815", "0.59437287", "0.5937464", "0.5870847", "0.58708...
0.74601626
0
Drive forward a certain distance
def drive(distance) raise ArgumentError.new("Distance must be a positive number") if distance < 0 @totalDistance += distance @travelLog += "#{@numChanges}. Drive #{distance} miles at speed #{@currSpeed}mph.\n" @numChanges += 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_by_route(forward = true)\n return unless exist_train_route?\n depart_from_station\n\n train_start_speed_kmh = 5\n train_regular_speed_kmh = 60\n\n move train_start_speed_kmh\n move train_regular_speed_kmh\n move train_start_speed_kmh\n\n arrive_to_station forward\n brake\n en...
[ "0.68540305", "0.68006766", "0.66392756", "0.66114444", "0.65006983", "0.6486461", "0.64681435", "0.6400334", "0.6395105", "0.63660645", "0.6356904", "0.6326759", "0.6281664", "0.62072724", "0.6190248", "0.6180159", "0.6134518", "0.61256254", "0.6107313", "0.6066707", "0.6050...
0.6767001
2
Get total distance in the last trip
def getTotalDistance return @totalDistance end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_calculator\n @trips.each do |trip|\n @total_distance += trip.distance.to_f\n end\n end", "def total_distance\n distances = self.rides.map { |ride| ride.distance }\n distances.inject(:+).to_f\n end", "def total_distance\n rides.reduce(0) {|total, ride| total + ride.distanc...
[ "0.7748273", "0.7583998", "0.7574253", "0.7574253", "0.75377786", "0.73986554", "0.7331795", "0.72896045", "0.72813493", "0.7273556", "0.7194791", "0.70927024", "0.7089133", "0.70791894", "0.70554703", "0.70368886", "0.69736403", "0.6968977", "0.69570434", "0.6906272", "0.685...
0.75644654
4
add list Things to bring to fun day out
def create_list(name) path = "lists" params = { list: { name: name }} list = request(path, params, :post) list_id = list[:id] # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_list_for(day, hour, dayname, today)\n months = [_(:january), _(:february), _(:march), _(:april), _(:may), _(:june),\n _(:july), _(:august), _(:september), _(:october), _(:november), _(:december)]\n nobroad = \" #{_(:no_broadcast_on)}\"\n broad = \"#{_(:broadcast_on)}\"\n\n aday = D...
[ "0.59974456", "0.57232827", "0.5666081", "0.5531866", "0.55171186", "0.5437819", "0.54077137", "0.53978616", "0.53953034", "0.5359762", "0.5356192", "0.5349697", "0.52841043", "0.52736056", "0.5244733", "0.5213936", "0.51874477", "0.5178218", "0.5177939", "0.51646775", "0.515...
0.0
-1
rename list 1 Bring stuff
def rename_list(list_id, name) path = "lists/#{list_id}" params = { list: { name: name }} request(path, params, :put ) # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def renamed(item, oldName, newName)\n end", "def rename_submenu\n\t\tputs \"Enter new list name:\"\n\t\tchoice = get_choice\n\t\t@todo_list.rename_title choice\n\t\tprint_menu\n\tend", "def rename_pets(uncustomized_pets_ordered, pets_to_update)\n counter = 1 # Because the pets are ordered by admittance ...
[ "0.6592992", "0.6263636", "0.62197423", "0.62015516", "0.61688036", "0.61241317", "0.6103437", "0.606769", "0.606769", "0.60386324", "0.60321814", "0.60321814", "0.60057396", "0.5985535", "0.59683335", "0.5900342", "0.58735573", "0.5844665", "0.580964", "0.57396555", "0.57300...
0.71933025
0
TASK add list 1 task Buy some milk
def create_task(list_id, text) path = "lists/#{list_id}/tasks" params = {task: {text: text}} request(path, params, :post) # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_my_list(task)\n @my_list << task\n end", "def add(task)\n @list << task\n end", "def add_an_item\n item = Item.new\n item.description = \"Task number #{to_do_list.size+1}\"\n to_do_list << item\n end", "def backend_addTask(param) \n @Tasks.push(param) \n end", "def a...
[ "0.66103536", "0.6558703", "0.6495973", "0.6470691", "0.64175904", "0.6337446", "0.6209851", "0.62046725", "0.615628", "0.60582346", "0.605705", "0.605568", "0.60356414", "0.5991172", "0.5953119", "0.59485656", "0.59061915", "0.5891833", "0.58779305", "0.58248794", "0.5820802...
0.59316725
16
rename list 1 task 1 Buy some apples
def rename_task(list_id, task_id, text) path = "lists/#{list_id}/tasks/#{task_id}" params = {task: {text: text}} request(path, params, :put) # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def renamed(item, oldName, newName)\n end", "def rename_pets(uncustomized_pets_ordered, pets_to_update)\n counter = 1 # Because the pets are ordered by admittance date already, a counter can be used to properly number them\n uncustomized_pets_ordered.each do |pet|\n pet.name = \"#{pet.breed} #{cou...
[ "0.6326878", "0.62918496", "0.61123323", "0.5901944", "0.58919173", "0.58775043", "0.58026034", "0.5790262", "0.5778467", "0.57389337", "0.57389337", "0.5670252", "0.5670252", "0.561361", "0.56024164", "0.5599311", "0.5593268", "0.55859166", "0.5575229", "0.55732566", "0.5565...
0.7182696
0
check list 1 task 1 uncheck list 1 task 1
def complete_task(list_id, task_id, is_completed) path = "lists/#{list_id}/tasks/#{task_id}" if is_completed completed = 1 else completed = 0 end params = {task: {is_completed: completed}} request(path, params, :put) # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uncheck(id_string)\n set_done(id_string, false)\n #checking all other tasks with same name/description as the newly unchecked task which id is 'id_string'\n id = id_string.to_i\n @tasks.each { |project_name, project_tasks|\n project_tasks.each { |task|\n if task.id == id\n # pu...
[ "0.74488217", "0.6325061", "0.62209827", "0.60691065", "0.5955056", "0.5947984", "0.5934444", "0.59334666", "0.59239626", "0.5891228", "0.5891113", "0.58644843", "0.58197373", "0.5817437", "0.58088315", "0.571243", "0.5675918", "0.56555706", "0.56518376", "0.564893", "0.56436...
0.0
-1
delete list 1 task 1
def destroy_task(list_id, task_id) path = "lists/#{list_id}/tasks/#{task_id}" params = {} request(path, params, :delete) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy_multiple\n\t @list.delete(params[:id])\n\t redirect_to '/tasks'\n\tend", "def items_list_deletion(tasks_to_delete_list,log_file)\n tasks_to_delete_list.each do |task|\n copy_to_log_file(log_file,\"Task deletion\",to_do_list:to_do_list,id:task)\n remove_an_item(task)\n ...
[ "0.74499184", "0.74246424", "0.7383013", "0.7267619", "0.7146352", "0.71208733", "0.71060187", "0.7089439", "0.6990777", "0.697835", "0.6913286", "0.6911017", "0.690578", "0.68853194", "0.6857508", "0.68467265", "0.6822805", "0.6809336", "0.6747672", "0.6716759", "0.6700191",...
0.67304647
19
A toy... Tries to calculate the method name you want by camelizing it and doing a get.
def method_missing(name, *args) options = args.first options = {} unless options.kind_of?(Hash) method_name = toCamel(name) get(options.merge(:method => method_name)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def...
[ "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.7043137", "0.69305927", "0.6896975", "0.682905", "0.66783375", "0.6666171", "0.665963", "0.66383266", "0....
0.6356226
44
generate a namespace (event, user, etc) from the current class name
def namespace @intf_namespace ||= self.class.name.split('::').last.downcase end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name\n \"#{namespace.name || namespace.inspect}::#{namespace.instances[ self ]}\"\n end", "def namespace\n @namestack.join(\"::\")\n end", "def name\n (@name ||= namespace).to_s.underscore.symbolize\n end", "def namespace\n return self.name ? self.name.downcase.gsub(/[^0-9A-Za-z...
[ "0.7267048", "0.69762367", "0.6961653", "0.69429386", "0.6935046", "0.68862617", "0.6853532", "0.6763192", "0.6729886", "0.67071444", "0.67048514", "0.6654826", "0.66539484", "0.66459274", "0.66385376", "0.6631225", "0.65990484", "0.6581359", "0.6569421", "0.6554335", "0.6554...
0.63125545
55
a convention to represent rising camel not activesupports camelize!
def toCamel(name) parts = name.to_s.split('_') first = parts.shift parts.map! { |part| part.capitalize } first + parts.join end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def camelize!\n self.titleize!\n self.replace(self[0, 1].downcase + self[1..-1])\n end", "def camelize\n # From activesupport/lib/active_support/inflector.rb:178\n gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def camelize\n gsub /(?:^|_)(.)/ do $1.upcase! en...
[ "0.8226512", "0.8153958", "0.7974904", "0.79199505", "0.7825003", "0.7814171", "0.77695024", "0.77572227", "0.758923", "0.7560269", "0.7448349", "0.7446958", "0.7445759", "0.7402228", "0.7358273", "0.73501647", "0.7346693", "0.7329626", "0.7328764", "0.7298576", "0.7292509", ...
0.0
-1
this method only removes the tags. Other desired tags, such as , are not removed because they are needed for the desired display effect
def remove_unittitle_tags(input_string) # fcd1: for now, explicit strings. Later, can regex it unless input_string.blank? input_string.gsub!('<unittitle>','') input_string.gsub!('</unittitle>','') end input_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_html_tag(tag_name); end", "def strip_tags_delicately\n self.gsub(/<.[^<]*>/, ' ')\n end", "def destroy_tag(*tags)\n tags.each do |tag|\n gsub! Regexp.new(\"<\\s*#{tag}[^>]*>.*?<\\s*\\/#{tag}\\s*>\", Regexp::IGNORECASE + Regexp:: MULTILINE), ''\n end\n end", "def rem...
[ "0.7309747", "0.7159982", "0.6965915", "0.67619985", "0.67282856", "0.6688525", "0.6681025", "0.6650941", "0.6649583", "0.6649583", "0.6649583", "0.6601133", "0.6601133", "0.6601133", "0.6592865", "0.6579444", "0.6512471", "0.6510283", "0.6442032", "0.6421931", "0.63539386", ...
0.0
-1
Returns the correct type class for attributes when loading an object from Solr Catches malformed dates that will not parse into DateTime, see 198
def adapt_single_attribute_value(value, attribute_name) AttributeValueAdapter.call(value, attribute_name) || super rescue ArgumentError "#{value} is not a valid date" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtype\n self.datetime_type\n end", "def datetime_classes\n [DateTime, Time, defined?(FmRest::StringDateTime) && FmRest::StringDateTime].compact.freeze\n end", "def date_class\n ::DateTime\n end", "def initialize_to_correct_date_type(field_info, field)\n initialize_integer...
[ "0.6443332", "0.6438805", "0.63418806", "0.6202303", "0.6186884", "0.6171695", "0.6167017", "0.6141943", "0.6141943", "0.61230963", "0.6097015", "0.60705173", "0.60705173", "0.59868586", "0.59612453", "0.5900716", "0.5870122", "0.58305144", "0.5813819", "0.5812154", "0.580360...
0.0
-1
def show puts "youre in the show method" render text: "This is the show page" end
def show render json: User.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n render :text => \"hello\"\n end", "def show\n render 'show'\n end", "def show\n #render show\n end", "def show\n render:show\n end", "def show \n render :show\n end", "def show\n render :show\n end", "def show\n render :show\n end", "def show\n render :show\n...
[ "0.87506306", "0.85149854", "0.85148835", "0.84648776", "0.84031165", "0.83707637", "0.83707637", "0.83707637", "0.8303185", "0.8301614", "0.8301614", "0.8279566", "0.8256484", "0.8256484", "0.81957805", "0.8194934", "0.8170741", "0.81653905", "0.8146993", "0.8146993", "0.814...
0.0
-1
PUBLIC METHODS ============================================================ GET TEXT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def creation_title "Create Character" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text\n raise NotImplementedError\n end", "def text\n @text\n end", "def getText\n @text\n end", "def getText\n @text\n end", "def get_text\n return self.text\n end", "def text\n @text\n end", "def as_text\n @text\n end", "def...
[ "0.84308934", "0.83332705", "0.8332116", "0.8332116", "0.8326171", "0.83171135", "0.8269036", "0.8093497", "0.7808185", "0.7808185", "0.7808185", "0.7754313", "0.7742476", "0.7683616", "0.7660921", "0.7660921", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", ...
0.0
-1
Looks for a picture on wikipedia. DEPRECATED!
def image return @wiki_img if @wiki_img logger.info "finding picture for #{name}" Wikipedia.Configure do domain "en.wikipedia.org" path "w/api.php" end p = page if p && p.image_urls && p.image_urls.count > 0 @wiki_img = p.image_urls.last # last one is the one on the right self.picture = @wiki_img self.save @wiki_img else nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wikipedia_image_url(wikipedia_url)\n begin\n\n return nil if !wikipedia_url || wikipedia_url.empty?\n\n # Download the wikipedia page\n page = Nokogiri::HTML(open(wikipedia_url))\n\n # Get the image href:\n link = page.css( @settings.image_selector ).first\n return if !link...
[ "0.753484", "0.67072594", "0.6664706", "0.61969364", "0.61592805", "0.6136746", "0.60186845", "0.59577787", "0.59326977", "0.5921311", "0.59144896", "0.5886908", "0.5886163", "0.5875616", "0.5860324", "0.5838341", "0.5806073", "0.5794669", "0.57904017", "0.57646304", "0.57451...
0.7751928
0
Returns the picture of the artist. Will try to find a picture on Last.fm, if none is found then a default picture will be returned. The picture is saved to the database so searching will only occur the first time this method is called.
def picture s = super return s if s.to_s != "" # try to find image if name.to_s != "" pic = nil begin key = Stoffi::Application::OA_CRED[:lastfm][:id] q = CGI.escapeHTML(e(name)).gsub(/\s/, "%20") url_base = "ws.audioscrobbler.com" url_path = "/2.0?method=artist.info&format=json&api_key=#{key}&artist=#{q}" logger.info "fetching artist image for #{name} from http://#{url_base}#{url_path}" http = Net::HTTP.new(url_base) res, data = http.get(url_path, nil) feed = JSON.parse(data) logger.debug "searching for image of size: large" feed['artist']['image'].each do |img| pic = img['#text'] break if img['size'] == 'large' end pic = Artist.default_pic if pic.to_s == "" rescue => err logger.error "could not retrieve artist image: " + err.to_s pic = Artist.default_pic end if pic update_attribute(:picture, pic) return pic end end return Artist.default_pic end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getimage\n if @artist.images.empty?\n @image = \"image1.jpg\"\n else\n @image = @artist.images.first[\"url\"]\n end\n end", "def photo\n\t\ts = picture\n\t\treturn s if s.to_s != \"\"\n\t\t\n\t\t#i = image\n\t\treturn Artist.default_pic\n\t\t\n\t\tupdate_attribute(:picture, i)\n\t\tsave\n...
[ "0.72009856", "0.6701507", "0.6673577", "0.6354272", "0.6321607", "0.6314307", "0.61985624", "0.61710733", "0.61705285", "0.6152946", "0.61218643", "0.611136", "0.6041111", "0.60319763", "0.59998405", "0.59935224", "0.5972438", "0.5958812", "0.5931603", "0.59305495", "0.59065...
0.8277047
0
Same as picture. DEPRECATED!
def photo s = picture return s if s.to_s != "" #i = image return Artist.default_pic update_attribute(:picture, i) save return i end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image; end", "def image\n end", "def image\n end", "def image\n\n end", "def edit_real_picture\n end", "def image\n end", "def image\n end", "def images; end", "def photo_format; end", "def thumbnail_image\n end", "def add_picture(picture)\n end", "def picture_list\n ...
[ "0.7845124", "0.75073165", "0.75073165", "0.75027025", "0.74182576", "0.7282804", "0.7282804", "0.71828026", "0.7148916", "0.70810246", "0.70332307", "0.7020206", "0.69046867", "0.6881222", "0.68536514", "0.6759911", "0.6749912", "0.67240894", "0.6690387", "0.6671684", "0.663...
0.0
-1
Whether or not the artist has a Twitter account.
def twitter?; twitter.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twitter?\n provider_name == 'Twitter'\n end", "def twitter?\n self.twitter_token && self.twitter_secret\n end", "def connected_to_twitter?\n twitter_token && twitter_secret\n end", "def twitter?\n self.provider == 'twitter'\n end", "def twitter?\n false\n end", "def twitte...
[ "0.82345706", "0.81928027", "0.8162784", "0.79879415", "0.78655124", "0.77469885", "0.7708659", "0.7660502", "0.76420337", "0.73533493", "0.7204052", "0.70858", "0.70653516", "0.70464224", "0.687312", "0.6819952", "0.6815421", "0.6772624", "0.6765938", "0.6765408", "0.6745825...
0.70900244
11
Whether or not the artist has a Facebook page or account.
def facebook?; facebook.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook?\n type == 'Facebook'\n end", "def facebook?\n self.kind == 'facebook'\n end", "def has_facebook_profile?\n fb_userid.present?\n end", "def facebook?\n provider_name == 'Facebook'\n end", "def facebook_profile?\n @network = current_user.network ||...
[ "0.7816081", "0.76158774", "0.75706494", "0.7467802", "0.7382725", "0.7331456", "0.72570485", "0.7246724", "0.7241436", "0.7119931", "0.7053106", "0.695168", "0.6920767", "0.6907983", "0.6857834", "0.6851738", "0.68331015", "0.6802571", "0.6790064", "0.6769842", "0.6755371", ...
0.6400498
35
Whether or not the artist has a Google+ account.
def googleplus?; googleplus.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def google?\n @domain.include?(:Google)\n end", "def google?\n provider_name == 'Google'\n end", "def google_signed_in?\n\t\t!access_token.nil? and !access_token_expired?\n\tend", "def google?\n ['google_oauth2', 'google'].include?(self.provider)\n end", "def omniauth?\n provider?...
[ "0.69267607", "0.68586606", "0.68016315", "0.6693224", "0.66651857", "0.6491516", "0.6469338", "0.63785905", "0.6259904", "0.625609", "0.6246889", "0.61783224", "0.61536753", "0.6108226", "0.6099364", "0.6013839", "0.59991777", "0.5962692", "0.59493005", "0.59474915", "0.5946...
0.67202014
3
Whether or not the artist has a MySpace account.
def myspace?; myspace.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def have_account?\n false\n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def logged_in?\n\t\t!current_account.nil?\n\tend", "def personal_account?\n account_type == 'personal'\n end", "def current_account?(account)\n\t\taccount == current_account\n\tend", "def current_accou...
[ "0.67976964", "0.65869355", "0.6425016", "0.64203155", "0.6399306", "0.6378119", "0.6352559", "0.6352559", "0.6352559", "0.6346407", "0.63049984", "0.6292797", "0.6292797", "0.62825245", "0.62496865", "0.6227121", "0.6224383", "0.6218546", "0.6198762", "0.6196197", "0.6167344...
0.0
-1
Whether or not the artist has a YouTube channel or account.
def youtube?; youtube.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def youtube_profile?\n @network = current_user.network ||= Network.new\n !(@network.youtube.nil? || @network.youtube.blank?)\n end", "def channel?\n self.channel_referent_id > 0\n end", "def can_create_playlist?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def is_channel_page?\n (chan...
[ "0.7261143", "0.6680515", "0.6515102", "0.6475191", "0.64641774", "0.6455055", "0.6426753", "0.6401424", "0.63345796", "0.62370646", "0.6187834", "0.6182416", "0.6173086", "0.6169877", "0.6149597", "0.61388993", "0.61136377", "0.61076677", "0.60579914", "0.6057299", "0.605314...
0.6320596
9
Whether or not the artist has a SoundCloud account.
def soundcloud?; soundcloud.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticated?\n !account.nil?\n end", "def have_account?\n false\n end", "def exists?\n username && api_key\n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def requested_account_authorized?\n session[:_bookingsync_account_id].blank? ||\n session[:_book...
[ "0.6580212", "0.6580122", "0.6562841", "0.64347655", "0.6365917", "0.6338749", "0.6310865", "0.62977666", "0.6275363", "0.62323636", "0.6208647", "0.62073606", "0.6184435", "0.61780274", "0.61722827", "0.6164392", "0.6163724", "0.61619776", "0.6153361", "0.61397606", "0.61254...
0.59287435
54
Whether or not the artist has a Spotify presence.
def spotify?; spotify.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def artist?\n end", "def has_track_with_id(spotify_id)\n self.tracks.exists?(spotify_id: spotify_id)\n end", "def speaker?\n !self.speaker_on.empty?\n end", "def has_song?(song)\n songs.include?(song)\n end", "def has_essay?\n essay != nil\n end", "def exists?...
[ "0.6704451", "0.6697281", "0.66919917", "0.66657716", "0.66538143", "0.64946294", "0.64104366", "0.6219673", "0.6211889", "0.61940783", "0.6171543", "0.61488086", "0.60517704", "0.6046949", "0.6045938", "0.6020353", "0.5998667", "0.59777397", "0.5945749", "0.5937926", "0.5919...
0.60533273
12
Whether or not the artist has a Last.fm presence.
def lastfm?; lastfm.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def synced_with_lastfm?\n lastfm_username.present?\n end", "def artist?\n end", "def lastfm_user?(user)\n lastfm_users.any? { |lastfm| lastfm.user_id == user.try(:id) }\n end", "def speaker?\n !self.speaker_on.empty?\n end", "def is_music?\n @status\n end", "def following? subject\n h...
[ "0.74193984", "0.6500434", "0.6453162", "0.641817", "0.6268934", "0.61428946", "0.6078084", "0.6071122", "0.60555345", "0.6053814", "0.60133976", "0.5993804", "0.5990403", "0.59785444", "0.5969268", "0.5959378", "0.5919845", "0.5888771", "0.5870201", "0.586676", "0.58446467",...
0.6694979
1
Whether or not the artist has a website.
def website?; website.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_website?\n !url.blank?\n end", "def is_displayed_on_site?\n feed.feed_type.name == \"Article\"\n end", "def show_links?\n edata = extra_data\n bitvalue = edata[\"m_search_engines\"].to_i\n is_a_search_link_set = [1,2,4,8,16].map do |a| \n (bitvalue & a) > 0 ? 1 : nil \n end.com...
[ "0.78435975", "0.6993461", "0.6976083", "0.6928762", "0.6921482", "0.6893517", "0.6882417", "0.66944975", "0.6683662", "0.6626746", "0.6567063", "0.6538847", "0.65360755", "0.652172", "0.64843476", "0.64735204", "0.645805", "0.6445146", "0.63952225", "0.6357893", "0.6357893",...
0.7231332
1
The URL to the artist's Twitter account.
def twitter_url; "https://twitter.com/#{twitter}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url\n \"http://twitter.com/#{self.username}/statuses/#{self.twitter_id}\"\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end", "def...
[ "0.7565765", "0.75593746", "0.7546104", "0.7427597", "0.7349594", "0.73262626", "0.71758527", "0.7172174", "0.7111333", "0.6972876", "0.69531876", "0.6834006", "0.67090166", "0.66411895", "0.6608745", "0.64482653", "0.6444345", "0.6439055", "0.64155185", "0.63727593", "0.6354...
0.79917204
0
The URL to the artist's Facebook page or account.
def facebook_url; "https://facebook.com/#{facebook}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def auth_url\n MiniFB.oauth_url(@app_id, @redirect_to,\n :scope => 'user_about_me') # See MiniFB.scopes\n end", "d...
[ "0.8186199", "0.7000176", "0.6912926", "0.6892157", "0.675054", "0.6731198", "0.6724468", "0.67072654", "0.6682942", "0.6672041", "0.6643282", "0.6627645", "0.65963805", "0.656821", "0.65167904", "0.6470973", "0.6467474", "0.64137995", "0.63689274", "0.6354642", "0.6353523", ...
0.71161056
1
The URL to the artist's Google+ account.
def googleplus_url; "https://plus.google.com/#{googleplus}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def og_url\n \"http://gaymerconnect.com/users/#{url}\"\n end", "def authenticate_url\n \"https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/urlshortener&response_type=code&client_id=#{ENV['GOOGL_CLIENT_ID']}&redirect_uri=#{ENV['GOOGL_REDIRECT_URI']}&access_type=offline&inclu...
[ "0.642339", "0.6344962", "0.6344814", "0.6262271", "0.62545645", "0.62320673", "0.62320673", "0.6183196", "0.6114626", "0.6114615", "0.6109006", "0.6095217", "0.6092586", "0.60878253", "0.60865486", "0.6032656", "0.6017477", "0.5982421", "0.5949635", "0.5935535", "0.59268236"...
0.74959797
0
The URL to the artist's MySpace account.
def myspace_url; "https://myspace.com/#{myspace}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def my_account_url\n get_institution_or_default(:eshelf_url) + '/account'\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def spotify_url; \"http://open.spoti...
[ "0.696291", "0.6773452", "0.657059", "0.6504948", "0.634028", "0.6255836", "0.6252541", "0.61759347", "0.6134905", "0.6131673", "0.605028", "0.60061556", "0.59966105", "0.5991381", "0.59790176", "0.5929904", "0.5924964", "0.5893371", "0.58563805", "0.5807878", "0.5791183", ...
0.7400994
0
The URL to the artist's YouTube channel or account.
def youtube_url; "https://youtube.com/user/#{youtube}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def youtube_url\n \"https://www.youtube.com/watch?v=#{@data['youtubeID']}\" if @data['youtubeID']\n end", "def youtube_url\n return \"https://www.youtube.com/results?search_query=#{CGI.escape(self.name)}\"\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def youtube_embed_u...
[ "0.7158124", "0.71342033", "0.6498359", "0.6339778", "0.62844515", "0.62076956", "0.6019845", "0.60163605", "0.60078895", "0.59888846", "0.5982293", "0.59743637", "0.5963959", "0.5920635", "0.5920635", "0.5897243", "0.58970475", "0.5891887", "0.58897555", "0.5883948", "0.5824...
0.72266465
0
The URL to the artist's SoundCloud account.
def soundcloud_url; "https://soundcloud.com/#{soundcloud}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def my_account_url\n get_institution_or_default(:eshelf_url) + '/account'\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audiosc...
[ "0.6697832", "0.6523755", "0.6417824", "0.63073164", "0.62918776", "0.62814075", "0.6279145", "0.6275267", "0.62289333", "0.6222981", "0.62201273", "0.61858714", "0.6184742", "0.61826706", "0.6141412", "0.61046547", "0.6071862", "0.6046681", "0.6014983", "0.60091907", "0.6001...
0.72950274
0
The URL to the artist's Spotify page.
def spotify_url; "http://open.spotify.com/artist/#{spotify}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def facebook_url(arti...
[ "0.68538266", "0.6753186", "0.670799", "0.66023207", "0.6378011", "0.63615906", "0.6310249", "0.6296764", "0.6231621", "0.6230158", "0.6230117", "0.62004477", "0.6188648", "0.6186068", "0.61844915", "0.6182972", "0.61539024", "0.6133382", "0.6095266", "0.60726565", "0.6064099...
0.81512576
0
The URL to the artist's Last.fm page.
def lastfm_url; "https://last.fm/music/#{lastfm}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def spotify_url; \"http://open.spotify.com/artist/#{spoti...
[ "0.7354311", "0.6980205", "0.6637502", "0.6589523", "0.64349556", "0.6252034", "0.6225566", "0.61806107", "0.61777157", "0.6173043", "0.61364245", "0.61364245", "0.61261564", "0.6113582", "0.6098971", "0.60434854", "0.60308224", "0.60205996", "0.60141516", "0.5992478", "0.599...
0.8237019
0
The URL to the artist's website.
def website_url; website end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def url\n uri.to_s\n end", "def url\n uri.to_s\n end", "def url\n @url.to_s\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t ...
[ "0.7183266", "0.71815664", "0.70814884", "0.7076081", "0.70367026", "0.7023664", "0.7004261", "0.69639754", "0.6952045", "0.6952045", "0.69425035", "0.69425035", "0.69038045", "0.6883503", "0.6857721", "0.6799725", "0.6796599", "0.6753872", "0.66756517", "0.6670224", "0.66702...
0.6901612
13
Whether or not the artist has any links to external properties.
def any_places? twitter? or facebook? or googleplus? or myspace? or youtube? or soundcloud? or spotify? or lastfm? or website? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_links?\n edata = extra_data\n bitvalue = edata[\"m_search_engines\"].to_i\n is_a_search_link_set = [1,2,4,8,16].map do |a| \n (bitvalue & a) > 0 ? 1 : nil \n end.compact.size > 0\n is_a_search_link_set || (edata[\"artist\"] &&\n !edata[\"artist\"][\"name\"]....
[ "0.7019437", "0.6804309", "0.6650235", "0.6331638", "0.63202626", "0.62568706", "0.62467545", "0.62467545", "0.6218376", "0.621109", "0.62056124", "0.6190444", "0.61818326", "0.6166803", "0.61518073", "0.6150202", "0.612403", "0.6122944", "0.6101623", "0.606288", "0.60435456"...
0.0
-1
The URL for the streaming of the artist. NOT IMPLEMENTED YET
def stream_url "http://www.google.com" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def streaming_endpoint\n encoded_url = URI.encode(\"#{SITE_URL}#{STREAM_URL}\".strip)\n URI.parse(encoded_url)\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=...
[ "0.7382917", "0.71609527", "0.71308386", "0.7042859", "0.6936072", "0.67046183", "0.66134655", "0.66025156", "0.6545525", "0.6524978", "0.6522201", "0.648554", "0.64835656", "0.6435491", "0.64323115", "0.6432228", "0.64292574", "0.6423609", "0.64230716", "0.64230716", "0.6401...
0.7149358
2
Description of the artist. Will fetch the information from Wikipedia. DEPRECATED! TODO: We should create a resource called "external_source" with all twitter/facebook/wikipedia/etc urls.
def info return "" p = localized_page return "" unless p && p.content logger.debug "parsing page #{p.title}" # extract the top-most section (the one before any ToC) c = WikiCloth::Parser.new({ :data => WikiParser::sanitize(p.content) }) c = c.sections.first l = I18n.locale ret = WikiParser.new({ :data => c }).to_html #I18n.locale = l return ret end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def biography artist\n url = \"http://developer.echonest.com/api/v4/artist/biographies?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\nend", "def description\n\t\ts = \"#{title}, a song \"\n\t\ts+= \"by #{artist.name} \" if artist\n\t\ts+= \"on Stoffi\"\n\tend", "def artist_name\n if artist_n...
[ "0.713922", "0.7042694", "0.69483167", "0.6712117", "0.6679223", "0.6636209", "0.6632982", "0.65864205", "0.64998525", "0.64984953", "0.64162904", "0.641354", "0.6406691", "0.64031464", "0.6357529", "0.6349998", "0.6274402", "0.6274402", "0.6274402", "0.6274402", "0.6272282",...
0.0
-1
The URL to the artist on Wikipedia. DEPRECATED!
def wikipedia_link p = localized_page base = "https://#{langtag(I18n.locale)}.wikipedia.org" return base unless p && p.title "#{base}/wiki/#{p.title}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wikipedia\n uri = nil\n @artist_data[\"relations\"].each do |rel|\n if rel[\"type\"] == \"wikipedia\"\n uri = rel[\"url\"][\"resource\"]\n end\n end\n return uri\n end", "def wikimedia_url(metadata)\n links = metadata.split(\"\\n\")\n @url = ''\n links.each do |meta|\n ...
[ "0.7347838", "0.71356297", "0.70432323", "0.6865283", "0.6863208", "0.683811", "0.66920805", "0.6576479", "0.6498456", "0.6448711", "0.6418263", "0.6374906", "0.637116", "0.6325014", "0.6290413", "0.6200087", "0.6172314", "0.6169388", "0.61571443", "0.6154253", "0.6091112", ...
0.6917309
3
Whether the artist is unknown.
def unknown? return name.to_s == "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unknown?\n false\n end", "def artist?\n end", "def empty?\n @artists.empty?\n end", "def unknown?\n status == 'Unknown'\n end", "def unknow\r\n return false unless unknow?\r\n @unknow.shift\r\n end", "def unknown?\n @value.nil?\n end", "def unknown?; fa...
[ "0.7624217", "0.7250223", "0.7027815", "0.6800006", "0.67919683", "0.6752339", "0.6735627", "0.6735627", "0.66862553", "0.6485469", "0.6372836", "0.63648164", "0.62932646", "0.6274074", "0.6255854", "0.6246771", "0.6219317", "0.618793", "0.61641854", "0.61253756", "0.6112488"...
0.70410854
2
The string to display to users for representing the resource.
def display name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_human_name\n resource_class.model_name.human\n end", "def readable\n resource.nil? ? name.humanize : \"#{name.humanize}: #{resource.name}\"\n end", "def display_resource(user)\n \"User #{user.email}\"\n end", "def pretty_resource_name\n Heroics.pretty_name(resource_name)\n ...
[ "0.729786", "0.70247763", "0.69972306", "0.6969162", "0.6936868", "0.6882295", "0.6855878", "0.6852109", "0.6843258", "0.6839116", "0.68339336", "0.6831978", "0.6814645", "0.6814645", "0.6814645", "0.6798404", "0.67734694", "0.6764966", "0.67486507", "0.6746355", "0.6698679",...
0.0
-1
All donations which are either pending of successful.
def donated donations.where("status != 'returned' AND status != 'failed' AND status != 'revoked'") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pending\n\t\tdonations.where(\"donations.status = 'pending' AND created_at < ?\", Donation.revoke_time)\n\tend", "def due_payments\n Payments.where(is_paid: false)\n \n end", "def total_donations\n donations.successful.sum(:amount)\n end", "def related_assigned_donations\n scope = Donation.wher...
[ "0.6915463", "0.65655845", "0.6478861", "0.62345284", "0.6152475", "0.61394465", "0.6063721", "0.6054466", "0.6026284", "0.6021158", "0.5989165", "0.5956796", "0.59322196", "0.59241366", "0.59241366", "0.59241366", "0.59241366", "0.59241366", "0.59001696", "0.58854645", "0.58...
0.7606987
1
The amount of charity that donations to the artist has generated.
def charity_sum donated.sum("amount * (charity_percentage / 100)").to_f.round(2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def charity_sum\n\t\tdonations.sum(\"amount * (charity_percentage / 100)\").to_f.round(2)\n\tend", "def charity\n\t\tamount * (charity_percentage.to_f / 100)\n\tend", "def donated_sum\n\t\tdonated.sum(\"amount * (artist_percentage / 100)\").to_f.round(2)\n\tend", "def donated\n \tdonations.sum(&:amount)\n ...
[ "0.7724582", "0.72123253", "0.7109921", "0.7063724", "0.696419", "0.68980926", "0.6851055", "0.666505", "0.65168226", "0.6430071", "0.64178455", "0.63789487", "0.6363996", "0.6353925", "0.62362283", "0.6218141", "0.6201065", "0.61954063", "0.61674947", "0.61355335", "0.613094...
0.7591172
1
The amount that has been donated to the artist (including pending donations).
def donated_sum donated.sum("amount * (artist_percentage / 100)").to_f.round(2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def donated\n \tdonations.sum(&:amount)\n end", "def donated_amount\n self.fees.purchased.sum(:amount).to_f\n end", "def donated_sum\n\t\tdonated.sum(:amount).to_f.round(2)\n\tend", "def total_donations\n donations.successful.sum(:amount)\n end", "def total_debt\n self.amount\n end", "def d...
[ "0.774016", "0.76883286", "0.7391061", "0.723301", "0.7097296", "0.7018243", "0.69927704", "0.69313425", "0.69001365", "0.67402846", "0.67274684", "0.6723825", "0.6723054", "0.6719791", "0.6711063", "0.6704326", "0.66622376", "0.662921", "0.6617625", "0.6613892", "0.65767926"...
0.82415795
0