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
Return the SOLR status stored in a persisted store
def restore_solr_status store = PStore.new('cluster_stauts.pstore') store.transaction(true) do @replicas_not_active = store['replicas_not_active'] || [] store['solr_cluster_status_rows'] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def communication_status_for_solr\n return status\n end", "def persist_solr_status\n cluster = clusterstatus\n rows = check_cluster(status: cluster)\n\n # store to disk the current status\n store = PStore.new('cluster_stauts.pstore')\n store.transaction do\n # only...
[ "0.70487684", "0.69396275", "0.6843845", "0.662813", "0.63035345", "0.62303793", "0.61950606", "0.61851287", "0.61703736", "0.61697435", "0.61697435", "0.61697435", "0.61697435", "0.61697435", "0.61697435", "0.61697435", "0.61697435", "0.61697435", "0.61697435", "0.61697435", ...
0.6948011
1
rep is the collection to be repaired
def repair_collection(rep) delete_failed_replica(collection: rep[:collection], shard: rep[:shard], replica: rep[:replica]) add_failed_replica(collection: rep[:collection], shard: rep[:shard], node: rep[:node]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_rep\n @rep = []\n end", "def set_rep\n @rep = Rep.find(params[:id])\n end", "def clear\n create_new_rep\n end", "def reset\n @collection = []\n end", "def initialize\n @collection={}\n end", "def set_rep\n @rep = Rep.find_by(official_id: params[:i...
[ "0.68848395", "0.6103959", "0.6004779", "0.5965022", "0.57975715", "0.57273716", "0.5700528", "0.559285", "0.55556965", "0.55219185", "0.5509818", "0.5500527", "0.54991144", "0.54991144", "0.54888266", "0.5464898", "0.54386145", "0.5437721", "0.54323864", "0.5409468", "0.5398...
0.7051049
0
Helper function for SOLR recovery
def delete_failed_replica(collection:, shard:, replica:) Utils.solr_request( connection, 'DELETEREPLICA', extra_params: { 'collection' => collection, 'shard' => shard, 'replica' => replica } ) rescue RSolr::Error::Http => _e false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def do_local_indexing(solr_doc); end", "def handle_solr_connect_error(exception)\n handle_connect_error(exception, 'blacklight.search.errors.connect.solr')\n end", "def reindex_everything(repo, query = '')\n i = 0\n repo.search(query) do |object|\n next if object.pid.start_with?('fedora-system:')\n ...
[ "0.5973622", "0.5670889", "0.5662792", "0.56617063", "0.56489766", "0.563436", "0.55729306", "0.5526309", "0.5503859", "0.5488377", "0.5427817", "0.54164946", "0.5407168", "0.53861994", "0.5367919", "0.5334885", "0.5289279", "0.52877784", "0.5287706", "0.5287193", "0.5273021"...
0.0
-1
Calls the commonteamyears API and returns a CommonTeamYears resource.
def common_team_years( league_id=NbaStats::Constants::LEAGUE_ID_NBA ) NbaStats::Resources::CommonTeamYears.new( get(COMMON_TEAM_YEARS_PATH, { :LeagueID => league_id }) ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end", "def get_team_years_participated_with_http_info(team_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_...
[ "0.6577913", "0.58785194", "0.560853", "0.5602101", "0.55911845", "0.5470054", "0.5380135", "0.5279995", "0.5207018", "0.50914663", "0.5061461", "0.5004564", "0.49760896", "0.496561", "0.49655196", "0.4962613", "0.49472257", "0.49322316", "0.49270594", "0.49130988", "0.490697...
0.73321354
0
instancelevel configuration provides access to the list of columns specifically meant for this action to use
def columns unless @columns self.columns = @core.columns._inheritable self.columns.exclude @core.columns.active_record_class.locking_column.to_sym end @columns end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def datasource_columns\n self.class.datasource_columns || { }\n end", "def showable_columns\n showable_attributes.keys\n end", "def attr_columns\n @attr_columns\n end", "def columns; self.class.columns; end", "def columns\n self.class.instance_variable...
[ "0.6223611", "0.6126215", "0.6123288", "0.6064126", "0.598701", "0.59695864", "0.59402424", "0.5934489", "0.5933053", "0.58864135", "0.5870466", "0.5868832", "0.5851431", "0.5851431", "0.5839606", "0.5829248", "0.58210826", "0.57863665", "0.5761846", "0.5749654", "0.5735375",...
0.5611848
32
GET /employees GET /employees.json
def index @employees = Employee.all if $empleado == "externo" @employees = Employee.where.not(provider_provider_id: nil, status: 'Eliminado').order(updated_at: :desc) elsif $empleado == "interno" @employees = Employee.where('"employees"."security_profiles_id" is not null and "employees"."provider_provider_id" is null and "employees"."status" != ? and "employees"."code_employee" != ?', "Eliminado", "1").order(updated_at: :desc) end respond_to do |format| if params[:search] format.html { @employees = @employees.search(params[:search]).order("created_at DESC")} format.json { @employees = @employees.search(params[:search]).order("created_at DESC")} else format.html { @employees = @employees.order('created_at DESC')} format.json { @employees = @employees.order('created_at DESC')} end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @employees = current_owner.employees.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "def employee(employee_id)\n get(\"employees/#{employee_id}\")\n end", "def show\n @employee = Employee.f...
[ "0.7535069", "0.75112057", "0.71336687", "0.7127723", "0.71141446", "0.7105878", "0.709149", "0.70518035", "0.70151436", "0.7006688", "0.69141585", "0.68869466", "0.6881494", "0.68640023", "0.67979705", "0.6782009", "0.67784446", "0.6741477", "0.6741477", "0.6741477", "0.6741...
0.0
-1
GET /employees/1 GET /employees/1.json
def show @motives_history = MotiveEmployee.where(employee_id: params[:id]).order("created_at DESC") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def employee(employee_id)\n get(\"employees/#{employee_id}\")\n end", "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "def show\n @employee = Employee.find(param...
[ "0.7565018", "0.7322213", "0.72986704", "0.7271539", "0.6958008", "0.6956239", "0.69158834", "0.68978494", "0.68464327", "0.6836187", "0.68093044", "0.6805657", "0.6783835", "0.67230374", "0.6701385", "0.6695722", "0.6695722", "0.66909385", "0.6649127", "0.6639676", "0.660042...
0.0
-1
POST /employees POST /employees.json
def create @employee = Employee.new(employee_params) @employee.user_created_id = current_user.id @employee.usuario_externo @employee.usuario = params[:employee][:usuario] @employee.previous_profile_security = params[:employee][:security_profiles_id] respond_to do |format| if @employee.save format.html { redirect_to employees_path, notice: I18n.t('.employees.controller.create') } format.json { render :show, status: :created, location: @employee } else format.html { render :new } format.json { render json: @employee.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @employee = Employee.new(params[:employee])\n\n respond_to do |format|\n if @employee.save\n format.html { redirect_to @employee, notice: 'Employee was successfully created.' }\n format.json { render json: @employee, status: :created, location: @employee }\n else\n ...
[ "0.7005552", "0.7005552", "0.6987667", "0.6984063", "0.6982717", "0.69513524", "0.69134194", "0.69134194", "0.69134194", "0.69134194", "0.69134194", "0.69134194", "0.6911076", "0.6869818", "0.685877", "0.68501806", "0.68501806", "0.6847765", "0.6773186", "0.6769727", "0.66196...
0.59303546
71
PATCH/PUT /employees/1 PATCH/PUT /employees/1.json
def update $usuario = params[:employee][:usuario] @employee.user_updated_id = current_user.id @employee.usuario = params[:employee][:usuario] if @employee.update(employee_params) if params[:employee][:type_profile] == 'Temporal' @employee.vencer_perfil end actualizar_previous_profile_security @employee.usuario = params[:employee][:usuario] $username = params[:employee][:usuario] if@employee.validate_username? actualizar_usuario if @employee.update_email? respond_to do |format| format.html { redirect_to employees_path,notice: I18n.t('employees.controller.update_email') } format.json { render :show, status: :ok, location: @employee } end else respond_to do |format| format.json { render :show, status: :ok, location: @employee } if $empleado == "interno" format.html { redirect_to employees_path, notice: I18n.t('employees.controller.update') } else format.html { redirect_to employees_path, notice: I18n.t('employees.controller.update_clinic') } end end end $usuario=nil else actualizar_usuario respond_to do |format| format.html { render :edit } format.json { render json: @employee.errors, status: :unprocessable_entity } end end else actualizar_usuario respond_to do |format| format.html { render :edit } format.json { render json: @employee.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n if @employee.update_attributes(params[:employee])\n format.html { redirect_to @employee, notice: 'Employee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { ren...
[ "0.6936151", "0.6936151", "0.69014025", "0.6896463", "0.68701035", "0.68622553", "0.68622553", "0.68622553", "0.6821713", "0.6804405", "0.6726761", "0.6687005", "0.66791105", "0.66791105", "0.66791105", "0.66791105", "0.66791105", "0.66791105", "0.66791105", "0.66791105", "0....
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_employee @employee = Employee.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 employee_params params.require(:employee).permit( :code_employee, :security_profiles_id, :provider_provider_id, :position_id, :second_name, :second_surname, :email, :first_name, :surname, :type_identification, :identification_document, :date_valid, :previous_profile_security, :type_profile ) 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.6981606", "0.6784227", "0.6746523", "0.67439264", "0.67361516", "0.6593381", "0.6506166", "0.64994407", "0.6483518", "0.64797056", "0.64578557", "0.6441216", "0.63811713", "0.63773805", "0.6366333", "0.63217646", "0.6301816", "0.63009787", "0.6294436", "0.62940663", "0.629...
0.0
-1
GET /events GET /events.json
def index @events = Event.getRecords(params[:page]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end", "def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end", "def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}...
[ "0.8337294", "0.82393", "0.7943906", "0.7928331", "0.77682066", "0.77408546", "0.76701826", "0.7665501", "0.76581633", "0.7642472", "0.76212007", "0.7615658", "0.7615658", "0.7612881", "0.75687", "0.7522498", "0.7488667", "0.74813455", "0.74698067", "0.7441679", "0.74408287",...
0.0
-1
GET /events/1 GET /events/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @event = Event.find(params[:id])\n render json: @event\n end", "def get(event_id)\n @client.request \"events/#{event_id}\"\n end", "def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @use...
[ "0.75029767", "0.74019474", "0.7361382", "0.7348975", "0.73475033", "0.7338018", "0.7317425", "0.72875094", "0.72813755", "0.7246173", "0.72317284", "0.7219172", "0.7219172", "0.7218839", "0.7218839", "0.721464", "0.7204848", "0.71989256", "0.7196662", "0.71925515", "0.719221...
0.0
-1
POST /events POST /events.json
def create if logged_in? @event = Event.new(event_params) else redirect_to login_path end respond_to do |format| if @event.save_sql(event_params) format.html { redirect_to @event, notice: 'Event was successfully created.' } format.json { render :show, status: :created, location: @event } else format.html { render :new } format.json { render json: @event.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_event event, data={}\n data[:event] = event\n post '/event', data\n end", "def create\n event = Event.new(event_params)\n event.save!\n render json: event\n end", "def create\n Rails.logger.debug(\"Received event #{params[:event]}\")\n head :ok\n end", "def crea...
[ "0.7714071", "0.7611226", "0.76028967", "0.7541319", "0.7444731", "0.73206913", "0.73138195", "0.728203", "0.7251226", "0.7235907", "0.7235907", "0.7215051", "0.71682763", "0.7150409", "0.7126664", "0.7118896", "0.7117831", "0.71162695", "0.70964044", "0.70907074", "0.7083036...
0.0
-1
PATCH/PUT /events/1 PATCH/PUT /events/1.json
def update if logged_in? respond_to do |format| if @event.update(event_params) format.html { redirect_to @event, notice: 'Event was successfully updated.' } format.json { render :show, status: :ok, location: @event } else format.html { render :edit } format.json { render json: @event.errors, status: :unprocessable_entity } end end else redirect_to login_path end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patch_event\n user_id = params[\"user_id\"]\n group_id = params[\"group_id\"]\n event_id = params[\"event_id\"]\n\n #TODO Handle 404 if event not found\n event = Event.find(event_id)\n\n json_body = JSON.parse(request.body.read)\n\n @@event_service.patch_event(j...
[ "0.75310594", "0.7373683", "0.71782124", "0.7173561", "0.7172287", "0.71437967", "0.7097386", "0.70842826", "0.70842826", "0.7059336", "0.70215064", "0.69903433", "0.6983788", "0.69784886", "0.69613445", "0.6955734", "0.6955734", "0.69530255", "0.6921967", "0.6921967", "0.692...
0.0
-1
DELETE /events/1 DELETE /events/1.json
def destroy if logged_in? @event.delete_sql else redirect_to login_path end respond_to do |format| format.html { redirect_to events_url, notice: 'Event was successfully deleted.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_...
[ "0.76929694", "0.7688217", "0.7688217", "0.7688217", "0.7681325", "0.7585923", "0.75685203", "0.7560765", "0.7541314", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0.75410026", "0....
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_event @event = Event.getDetails(params[:id]).first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.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 event_params params.require(:event).permit(:id, :storm_type, :begin_time, :end_time, :state_fips, :county_fips, :source, :forecast_office, :magnitude, :magnitude_type, :property_damage, :crop_damage, :narrative, :episode_id, locations_attributes: [:id, :event_id, :location_index, :loc_range, :azimuth, :location, :latitude, :longitude, :_destroy], fatalities_attributes: [:id, :event_id, :fatality_date, :age, :sex, :location, :_destroy]) 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
Uncomment to add module specific seed data to a project. def copy_migrations rake 'bcms_browserspree:install:migrations' end Uncomment to add module specific seed data to a project.
def add_seed_data_to_project copy_file "../bcms_spree.seeds.rb", "db/bcms_spree.seeds.rb" append_to_file "db/seeds.rb", "load File.expand_path('../bcms_spree.seeds.rb', __FILE__)\n" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_migrations\n rake \"sipity:install:migrations\"\n end", "def copy_migrations\n rake 'hyrax:install:migrations'\n end", "def copy_migrations\n # Can't get this any more DRY, because we need this order.\n better_migration_template \"create_searches.rb\"\n better_migration_template \...
[ "0.7310401", "0.68892735", "0.67977375", "0.67761034", "0.6683559", "0.66393435", "0.66240764", "0.65865004", "0.65076923", "0.6394765", "0.6194225", "0.6177379", "0.6143761", "0.6114297", "0.6071205", "0.60306686", "0.59889543", "0.59530514", "0.593803", "0.5923099", "0.5920...
0.74325013
0
Get the merged operations for the single atomic set.
def operations { "$set" => { path => documents } } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def operations\n return @operations\n end", "def operations\n return @operations\n end", "def operations\n return @operations\n end", "def operations\n return @operations\n end", "def operations\n ...
[ "0.61077726", "0.61077726", "0.61077726", "0.61077726", "0.61077726", "0.5893485", "0.5893485", "0.5798837", "0.57599974", "0.5749897", "0.55368334", "0.54990494", "0.54196405", "0.5392395", "0.5390663", "0.5379684", "0.5348656", "0.52814", "0.52399457", "0.51929945", "0.5176...
0.0
-1
Time Complexity: O(nlog(n)) Space Complexity: O(n)
def sorted_squared_array_n_nlogn(values) values.collect!{|val| val*val} merge_sort(values) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\...
[ "0.6908748", "0.67515385", "0.65887356", "0.636399", "0.6340195", "0.6331766", "0.6323186", "0.63183427", "0.6268381", "0.61978793", "0.61925733", "0.61575717", "0.6123444", "0.61049044", "0.60720426", "0.6058747", "0.60504854", "0.60436696", "0.60326046", "0.6018276", "0.601...
0.5890716
33
Time Complexity: O(n) Space Complexity: O(n) [7, 3, 1, 4, 8, 12] 1st loop: first_i = 2 last_i = 1 len = 1 output = [1, 9, 16, 49, 64, 144]
def sorted_squared_array_n_n(values) len = values.size - 1 first_i = 0 last_i = len output = Array.new(len+1) while(len > -1) if(values[first_i].abs > values[last_i].abs) output[len] = values[first_i] * values[first_i] first_i += 1 else output[len] = values[last_i] * values[last_i] last_i -= 1 end len -= 1 end output end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def repeated_number_ranges(numbers)\n result = []\n sub_arr = []\n i = 0 \n while i < numbers.length \n if sub_arr.length == 0 && numbers[i] == numbers[i+1]\n sub_arr << i\n elsif sub_arr.length == 1 && numbers[i] != numbers[i+1]\n sub_arr << i\n result << sub_arr\n sub_arr = []\n ...
[ "0.6490445", "0.641536", "0.63993084", "0.6386597", "0.6272782", "0.6246372", "0.6238542", "0.621506", "0.6203235", "0.61977506", "0.61868864", "0.61516374", "0.61250013", "0.6107229", "0.61009324", "0.6092638", "0.60699546", "0.60584736", "0.6056246", "0.60474646", "0.602788...
0.0
-1
GET /ofx_transactions GET /ofx_transactions.json
def index if params[:account_id] @ofx_transactions = current_user .accounts.find(params[:account_id]).ofx_transactions .order("ofx_date DESC") else @ofx_transactions = current_user.ofx_transactions.order("ofx_id DESC") end @ofx_transactions = @ofx_transactions.all render json: @ofx_transactions, root: 'transactions' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transactions\n JSON.parse(response.body).fetch('transactions')\n end", "def index\n user_coin_transactions = get_user_coin_transactions\n if user_coin_transactions\n json_response(user_coin_transactions)\n else \n json_response({:status => false, :message =>...
[ "0.7218229", "0.7203398", "0.7195983", "0.6950043", "0.6939721", "0.6868393", "0.6813469", "0.6795678", "0.67946506", "0.67647994", "0.6745614", "0.6731449", "0.66836286", "0.66821164", "0.6660156", "0.6643397", "0.662056", "0.66052043", "0.66052043", "0.66052043", "0.6605204...
0.75884056
0
GET /ofx_transactions/1 GET /ofx_transactions/1.json
def show render json: @ofx_transaction end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n if params[:account_id]\n @ofx_transactions = current_user\n .accounts.find(params[:account_id]).ofx_transactions\n .order(\"ofx_date DESC\")\n else\n @ofx_transactions = current_user.ofx_transactions.order(\"ofx_id DESC\")\n end\n @ofx_transactions = @ofx_transacti...
[ "0.75815254", "0.70523643", "0.68950295", "0.6760788", "0.6722547", "0.66956615", "0.66766185", "0.6649064", "0.6632851", "0.66101223", "0.66101223", "0.66101223", "0.66060644", "0.6586595", "0.65818", "0.6566342", "0.6514055", "0.65039784", "0.64930636", "0.64930636", "0.649...
0.70362145
2
POST /ofx_transactions POST /ofx_transactions.json
def create @ofx_transaction = OfxTransaction.new(ofx_transaction_params) if @ofx_transaction.save render json: @ofx_transaction, status: :created, location: @ofx_transaction else render json: @ofx_transaction.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @transaction = Transaction.new(transaction_params)\n\n # Assigns the correct user_id in case the user puts another user's ID\n\n @transaction.user_id = User.find_by(api_key: params[:api_key]).id\n\n if @transaction.save\n\n @coin = Coin.find(@transaction.coin_id)...
[ "0.66208744", "0.66195077", "0.6521948", "0.6459448", "0.6389101", "0.632786", "0.61972123", "0.6178098", "0.615778", "0.615641", "0.614939", "0.61239713", "0.6090407", "0.607833", "0.60579", "0.60263383", "0.5978807", "0.5976952", "0.59669435", "0.59616816", "0.59547746", ...
0.75190467
0
PATCH/PUT /ofx_transactions/1 PATCH/PUT /ofx_transactions/1.json
def update @ofx_transaction = OfxTransaction.find(params[:id]) if @ofx_transaction.update(ofx_transaction_params) head :no_content else render json: @ofx_transaction.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end", "def update\n @transaction = Transaction.find(params[:id])\n\n respond_to do |format|\n if @transaction.update_attributes(params[:transaction])\n @transaction.account.update_transactions\n ...
[ "0.615993", "0.60754234", "0.60498315", "0.59946454", "0.5928427", "0.5854071", "0.58497924", "0.5846627", "0.58367676", "0.58088386", "0.5781671", "0.57812494", "0.5769429", "0.5765405", "0.57569015", "0.57462716", "0.57452387", "0.57436144", "0.5742923", "0.5736402", "0.573...
0.72750247
0
DELETE /ofx_transactions/1 DELETE /ofx_transactions/1.json
def destroy @ofx_transaction.destroy head :no_content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @transaction.destroy\n respond_to do |format|\n format.html { redirect_to txns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @payment_txn.destroy\n respond_to do |format|\n format.html { redirect_to payment_txns_url }\n format.json { head ...
[ "0.67407674", "0.6727651", "0.6669926", "0.66542125", "0.66542125", "0.66542125", "0.66542125", "0.66542125", "0.66542125", "0.66542125", "0.66542125", "0.6650458", "0.6650458", "0.6650458", "0.6650458", "0.6650458", "0.6650458", "0.6650458", "0.66492796", "0.66478497", "0.66...
0.750566
0
has_one :user has_many :attendees, embed: :ids
def attendee_ids activity = object attendees = [] activity.attendees.each do |attendee| if attendee.phone_verified attendees << attendee.id end end activity.attendee_ids = attendees end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def attendees\n EventAttendee.find_all_by_event_id(self.id) \n end", "def attendees\n link :attendees, :User, id\n end", "def create\n @users = User.all\n\n @event = current_user.events.build(event_params.except(:invites))\n\n respond_to do |format|\n if @event.save\n\n ...
[ "0.67043126", "0.6616685", "0.64738524", "0.6332715", "0.6315705", "0.63120276", "0.6185919", "0.6167932", "0.60945547", "0.59542733", "0.5894585", "0.5884852", "0.57370794", "0.5734636", "0.56534886", "0.5652253", "0.5629504", "0.5623935", "0.56064343", "0.5593901", "0.55838...
0.72312737
0
before_filter :require_user, only: [:portal, :wallet]
def share @event_portal = "#{SiteConfig.hhd_event_portal}/wx/event/portal?" + request.query_string # # request.headers['foo'] = 'bar' # url = request.original_url#"#{SiteConfig.hhd_event_portal}/wx/event/portal?" + request.original_url.split('?').last # # redirect_url = "#{SiteConfig.wx_auth_redirect_uri}?url=#{url}"#"#{wechat_auth_redirect_url}?url=#{request.original_url}" # # @wechat_auth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{SiteConfig.wx_app_id}&redirect_uri=#{Rack::Utils.escape(redirect_url)}&response_type=code&scope=snsapi_userinfo&state=yujian#wechat_redirect" # redirect_to @event_portal end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authorize\n redirect_to '/' unless current_user || current_dealer\n end", "def before_filter\n if current_user\n true\n end\n end", "def run_filters\n set_user\n authorize\n end", "def index\n @accounts = current_user.accounts\n @wallet = current_user.wallet\n authorize @a...
[ "0.7081696", "0.67280036", "0.6721117", "0.6678061", "0.6582973", "0.6554699", "0.6485435", "0.64673877", "0.64673877", "0.64556426", "0.6430786", "0.6430786", "0.6415206", "0.63978904", "0.63978904", "0.63978904", "0.63978904", "0.63978904", "0.63978904", "0.63978904", "0.63...
0.0
-1
Create Train ============ create_train(title = '[CREATE] Please choose Train type:')
def create_train(title = '[CREATE] Please choose Train type:') train_type = ask_choose_train_type(title) user_input_number = ask_enter('Train number') train = train_type.new(user_input_number) @trains << train puts "\n[SUCCESS] #{train} created!" rescue StandardError => e show_error_message(e) retry end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_train(train_type)\n Train.new(\n @train_types.find do |type|\n type.to_s.eql? \"#{train_type.fetch('type')}T\"\n end\n )\n end", "def create\n @train = Train.new(train_params)\n\n respond_to do |format|\n if @train.save\n format.html { redirect_to ...
[ "0.7280475", "0.7098647", "0.6876092", "0.6803925", "0.67013764", "0.66984266", "0.6691096", "0.6514935", "0.63261515", "0.62724483", "0.6212853", "0.61421", "0.61117035", "0.61117035", "0.61117035", "0.6069617", "0.60425925", "0.5968989", "0.59547096", "0.5943106", "0.594307...
0.86984
0
Create Route ============ create_route
def create_route return create_route_core unless Station.all.size < 2 show_info_for_action('new Route') show_info_you_need_at_least('2 Stations', Station.all.count) create_station_advanced create_route end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @route = Route.create(route_args)\n\n respond_to do |format|\n if @route.save\n format.html { redirect_to @route, notice: 'Route was successfully created.' }\n format.json { render :show, status: :created, location: @route }\n else\n format.html { render :new }\n ...
[ "0.74507827", "0.7308064", "0.71923226", "0.7185498", "0.7153832", "0.7151938", "0.71205956", "0.7105107", "0.7073394", "0.7073394", "0.70593625", "0.70357794", "0.6981973", "0.6955938", "0.69479734", "0.69388986", "0.6925472", "0.6884279", "0.6782944", "0.6756569", "0.674568...
0.7065918
10
Manage Stations in Route ======================== manage_stations_in_route
def manage_stations_in_route return manage_stations_in_route_core unless @routes.empty? show_info_for_action('managing Stations in Routes') create_route_advanced manage_stations_in_route end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_station_in_to_route\n if @routes.empty?\n routes_void\n else\n request = [\"Enter route name [#{@routes.keys.join(', ')}]: \"]\n route = getting(request, :approve_route_selection, :select_route)\n request = request_station\n station = getting(request, :approve_station_for_rou...
[ "0.7241897", "0.7018459", "0.6977456", "0.68895614", "0.66846687", "0.6535633", "0.6500823", "0.64900464", "0.64615583", "0.6434019", "0.61501455", "0.6010391", "0.59753203", "0.5936557", "0.5936557", "0.5936557", "0.5924395", "0.58670616", "0.58427304", "0.58207846", "0.5792...
0.8973254
0
Add Station to the Route ======================== add_station_to_route(route)
def add_station_to_route(route) available_stations = Station.all.reject { |item| route.stations.include?(item) } return add_station_to_route_core(available_stations, route) unless available_stations.empty? show_info_for_action('adding Station to Route') show_info_you_need_at_least('1 Station not assigned to Route', 0) create_station_advanced add_station_to_route(route) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_route(route)\n @stations[@index].departure(self) unless @current_station.nil?\n @stations = route.stations\n @index = 0\n @current_station = @stations[@index]\n @stations[@index].arrival(self)\n end", "def add_station_in_to_route\n if @routes.empty?\n routes_void\n else\n ...
[ "0.86435443", "0.830416", "0.795988", "0.78973323", "0.7522974", "0.7351218", "0.72590196", "0.715844", "0.708284", "0.6797466", "0.67725354", "0.67725354", "0.6644093", "0.6582613", "0.6548782", "0.64890444", "0.6095505", "0.6061501", "0.60401225", "0.6026877", "0.6026527", ...
0.89490867
0
Remove Station from Route ========================= remove_station_from_route(route)
def remove_station_from_route(route) available_stations = route.stations.select do |item| item != route.stations.first && item != route.stations.last end unless available_stations.empty? return remove_station_from_route_core(available_stations, route) end show_info_for_action('removing Station from Route') show_info_you_need_at_least('1 Station in Route', 0) add_station_to_route_advanced(route) manage_stations_in_route end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_station_in_route\n if @routes.empty?\n routes_void\n else\n request = [\"Enter route name [#{@routes.keys.join(', ')}]: \"]\n route = getting(request, :approve_route_selection, :select_route)\n request = [\"Enter station name [#{all_stations(route)}]: \"]\n station = getti...
[ "0.7631385", "0.73273814", "0.6574621", "0.6447304", "0.637968", "0.63133156", "0.62868553", "0.6141701", "0.61250263", "0.60754055", "0.60034144", "0.596825", "0.5944946", "0.58907425", "0.58786774", "0.5860926", "0.5795715", "0.57863164", "0.5763419", "0.57045305", "0.56950...
0.88588375
0
Assign Route to Train ===================== assign_route_to_train
def assign_route_to_train return assign_route_to_train_template('create_train') if @trains.empty? return assign_route_to_train_template('create_route') if @routes.empty? assign_route_to_train_core end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assign_route_to_train\n if @routes.empty? || @trains.empty?\n routes_or_trains_void\n else\n request = [\"Enter route name [#{@routes.keys.join(', ')}]: \"]\n route = getting(request, :approve_route_selection, :select_route)\n request = [\"Enter train number [#{@trains.keys.join(', ')...
[ "0.85937566", "0.8134673", "0.81033784", "0.7530123", "0.7160491", "0.69311213", "0.68638223", "0.66503245", "0.65423465", "0.65243775", "0.6521559", "0.64691204", "0.6463509", "0.6436088", "0.6339912", "0.6338411", "0.6338411", "0.6338411", "0.6338411", "0.6338411", "0.63384...
0.8352474
1
Add Carriage to Train add_carriage_to_train
def add_carriage_to_train return add_carriage_to_train_advanced if @trains.empty? user_input = ask_choose('Train', 'for adding Carriage', @trains) user_train = @trains[user_input - 1] add_carriage_to_train_core(user_train) rescue StandardError => e show_error_message(e) retry end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_carriage(carriage)\n raise 'Train is moving now!' if moving?\n\n @carriages << carriage\n end", "def add_train(train)\n @trains << train\n end", "def add_car_to_train\n train = grep_train\n return 'Some problem with train' unless train\n case train.type\n when :passenger\n ...
[ "0.7279024", "0.6624457", "0.65658385", "0.65516675", "0.624709", "0.6110263", "0.5611162", "0.5425526", "0.5309651", "0.529736", "0.52655", "0.5244527", "0.51230377", "0.5118166", "0.50860035", "0.5040627", "0.5030492", "0.50216615", "0.49922833", "0.4964475", "0.4964475", ...
0.8014166
0
Remove Carriage from Train remove_carriage_from_train
def remove_carriage_from_train return remove_carriage_from_train_template('create_train') if @trains.empty? user_input = ask_choose('Train', 'to remove Carriage', @trains) user_train = @trains[user_input - 1] if user_train.carriages.empty? return remove_carriage_from_train_template('create_carriage', user_train) end carriage = user_train.remove_carriage puts "\n[SUCCESS] #{carriage} was removed from #{user_train}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_characters\n @data = @data.gsub(/\\n/, ' ').gsub(/\\f/, ' ').gsub(/\\s+/, ' ')\n @data = @data.split(' ')\n end", "def remove_unwanted_chars(data)\n\n data = data.gsub(\"\\r\\n\", ' ')\n data = data.gsub(\"\\t\", ' ')\n data = data.gsub(\"\\n\", ' ')\n\n data.strip\n end", "def r...
[ "0.58680695", "0.57367754", "0.5713707", "0.5666662", "0.565646", "0.56456405", "0.56456405", "0.5614775", "0.5554543", "0.5528117", "0.5514015", "0.54719836", "0.546723", "0.54319763", "0.54239476", "0.5408986", "0.5395198", "0.53771555", "0.5342106", "0.5338313", "0.5331287...
0.6938145
0
Move Train on the Route (Next/Previous) move_train_by_route
def move_train_by_route return action_no_trains_on_route unless @trains.any?(&:route) available_trains_on_route = @trains.select(&:route) user_input = ask_choose('Train', 'on Route to move', available_trains_on_route) user_train = @trains[user_input - 1] show_current_station(user_train) user_input = ask_direction_to_move_train(user_train) move_train_on_user_input(user_input, user_train) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_train_forward_by_route\n if @routes.empty? || @trains.empty?\n routes_or_trains_void\n else\n request = [\"Enter train number [#{@trains.keys.join(', ')}]: \"]\n train = getting(request, :approve_train_for_assign, :select_train)\n train_moved_forward_by_route if train.move_train_...
[ "0.8474824", "0.8344474", "0.7870484", "0.7740322", "0.7705781", "0.73354584", "0.7318131", "0.7214537", "0.68395907", "0.6758619", "0.6731714", "0.64956814", "0.6460311", "0.6446717", "0.6376943", "0.6342478", "0.62716323", "0.62391686", "0.6213043", "0.6194561", "0.61744297...
0.86388725
0
Show List of Stations and Trains on the Stations print_stations_and_trains
def print_stations_and_trains show_all_trains_on_stations_header return show_empty_message_on_stations if Station.all.empty? Station.all.each do |station| show_name_of_station_header(station) show_empty_message_on_stations unless station.trains.any? station.each_train do |train| puts train train.each_carriage { |carriage| show_formatted_item(carriage) } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_trains_by_station\n if @stations.empty?\n stations_void\n else\n request = [\"Enter station name: [#{@stations.keys.join(', ')}]: \"]\n getting(request, :approve_station_selection, :show_train)\n end\n end", "def info\n puts \"All stations:\"\n @stations.each.with_index(1)...
[ "0.7872314", "0.7556445", "0.739666", "0.7262738", "0.7119718", "0.6901341", "0.68701035", "0.6791698", "0.66667217", "0.66284144", "0.66136885", "0.6588033", "0.65423113", "0.6496879", "0.6359489", "0.63427657", "0.6303971", "0.6298515", "0.62883395", "0.62810355", "0.618334...
0.81575006
0
Take Seat or Fill Volume in Carriage take_seat_volume_carriage
def take_seat_volume_carriage return take_seat_volume_carriage_template('create_train') if @trains.empty? user_input = ask_choose('Train', '', @trains) user_train = @trains[user_input - 1] if user_train.carriages.empty? take_seat_volume_carriage_template('create_carriage', user_train) else take_seat_volume_carriage_core(user_train) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def take_place_at_cargo_carriage\n puts \"\\tОставшееся свобоное место: #{carriage.available_volume}.\"\n puts(\"Нет свободного пространства\") || return if carriage.available_volume <= 0\n\n printf \"\\tСколько хотите занять? \"\n puts carriage.take_volume(gets.chomp.to_i) ? \"Успешно\" : \"не удалось...
[ "0.6199102", "0.56798756", "0.56665343", "0.54676247", "0.53826773", "0.5343138", "0.5329312", "0.52768785", "0.523545", "0.5182154", "0.51812726", "0.5141823", "0.5129154", "0.51196754", "0.51162136", "0.5100207", "0.50832975", "0.50831366", "0.5076297", "0.50609356", "0.503...
0.7001707
0
FILE: P6asherman.rb AUTHOR: HomieWippman DATE: 10/31/18 DESC: Version 1.0 Credit due to Jiin who helped me during office hours. It was awesome working with her and she showed me how to code the answers to the questions in a succinct manner, a skill I am continually trying to improve upon. Question 1: Conversion Function converts pounds to kilograms and vice versa.
def conversion kilos_to_pounds = 2.205 pounds_to_kilos = 0.454 puts "1. From kilograms to pounds" puts "2. From pounds to kilograms" print "Choose the conversion number (1 or 2) you want to make: " response = gets.chomp.to_i if response == 1 print "Enter a number of kilograms: " user_num = gets.chomp.to_i result = user_num * kilos_to_pounds user_from = "kilograms" user_to = "pounds" elsif response == 2 print "Enter a number of pounds: " user_num = gets.chomp.to_i result = user_num * pounds_to_kilos user_from = "pounds" user_to = "kilograms" end puts "There are #{result} #{user_to} in #{user_num} #{user_from}." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pounds_to_kilo(pounds)\n kilograms = pounds * 0.45\n return kilograms\nend", "def convert_by_flour_weight(ingredients)\n puts \"Please input a number for the amount of grams of flour to be used\"\n input = get_user_integer # validates integer for use in formula\n total_weight = 0\n flour = 0.0\n # par...
[ "0.672711", "0.6530248", "0.6464933", "0.6434713", "0.61923397", "0.6173736", "0.61551565", "0.6084496", "0.6082118", "0.60492104", "0.5889165", "0.5883962", "0.5881342", "0.5880134", "0.58340174", "0.58171445", "0.5797425", "0.5793516", "0.5784056", "0.57826024", "0.5775369"...
0.7088555
0
Question 2: Conversion Function uses a list to produce a ring of various desired outputs.
def rings my_list = [6, 5, 3, 1] 3.times do index = 0 my_list.length.times do print my_list[index].to_s + " " index += 1 end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def int_to_chess(number_list)\n # if its just one element return an array inside an array\n chess_notation = []\n number_list.each do |square|\n square_notation = []\n letter = num_to_letter(square[0])\n number = square[1]\n square_notation.push(letter, number)\n chess_n...
[ "0.6325136", "0.6027131", "0.59982234", "0.5740875", "0.57370657", "0.5687797", "0.56529105", "0.56529105", "0.5624763", "0.5619296", "0.55877405", "0.5553881", "0.55194825", "0.5506422", "0.54483485", "0.5444078", "0.5386163", "0.5376744", "0.5374875", "0.53580683", "0.53249...
0.49102262
85
Question 3: Scrambled Words Function takes a word given by the user and scrambles all of its letters, excluding the first and last letter of the word (which remain the same).
def scrambled_words print "Enter a word: " response = gets.chomp scrambled_version = response[0] + response[1..-2].chars.shuffle.join + response[-1] puts "Scrambled version: #{scrambled_version}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scramble_words(words)\n words.split(' ').map { |word| scramble(word) }.join(' ')\nend", "def scramble_words(chars = WordChars)\n\t\tgsub(/(#{chars})(#{chars}+)(?=#{chars})/) { $1 + $2.randomize }\n\tend", "def scramble_words(words)\n words.split.map do |word|\n scramble_word(word)\n end.join(' ')\nen...
[ "0.8334074", "0.8212374", "0.81796724", "0.79529095", "0.7860875", "0.77233595", "0.771574", "0.76793164", "0.7624685", "0.75777704", "0.74732417", "0.7469148", "0.74446523", "0.73855394", "0.72280604", "0.72181726", "0.7147648", "0.7116234", "0.71159095", "0.69903415", "0.69...
0.7798167
5
lookup name for type
def get_fqdn return @resource[:name] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_by_name(name)\n types[name]\n end", "def type_name_resolver; end", "def lookup(type, name)\n from_table(type, name)\n end", "def type_name\n @type_name ||= name.underscore\n end", "def input_name_from_type(type); end", "def type_name\n self['type_na...
[ "0.77799016", "0.7769826", "0.7698453", "0.75838965", "0.74783075", "0.747661", "0.7421527", "0.7386366", "0.735138", "0.7349654", "0.7319467", "0.7319467", "0.7319467", "0.7319467", "0.7319467", "0.7319467", "0.7319467", "0.7319467", "0.7319467", "0.7319467", "0.7319467", ...
0.0
-1
lookup recordd_type for type
def get_type return @resource[:record_type] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_rdata_type( rr )\n rdata_ary = []\n RDATA_OF_RR[rr[:type]].each{|rdata_type|\n rdata_ary << [rdata_type, rr[rdata_type]]\n }\n rdata_ary\n end", "def get_type(addr_results, type)\n addr_results.select { |comp| comp[\"types\"].index(type) != nil }.map { |comp| comp[\"long_name\"] ...
[ "0.6915067", "0.654833", "0.6462296", "0.64571726", "0.6453385", "0.6426402", "0.6416673", "0.6394568", "0.6394568", "0.6371689", "0.6371689", "0.63694906", "0.63680583", "0.6360481", "0.6343863", "0.63328403", "0.63251185", "0.62612414", "0.62434393", "0.622751", "0.61992097...
0.0
-1
create a new server
def create Puppet.debug "starting create #{self.class.to_s}" dns_service = get_dns_service(get_fqdn) dns_service.create_record(get_fqdn, get_type, get_ip) if dns_service != nil Puppet.debug "done with create #{self.class.to_s}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_server\n\n end", "def create_server\n\t\treturn Hglib::Server.new( self.path.to_s )\n\tend", "def create_server\n raise NotImplementedError, \"Implement #{__callee__} in #{self.class.to_s}\"\n end", "def create_server(connection, name, options={})\n raise \"Need to extend create_se...
[ "0.85050505", "0.7867388", "0.7758563", "0.7394046", "0.7391124", "0.7363186", "0.7359658", "0.7292057", "0.71969414", "0.7174527", "0.7163281", "0.70568705", "0.6932593", "0.6910102", "0.68873465", "0.6883154", "0.6865384", "0.68575436", "0.6855255", "0.6804074", "0.6766759"...
0.0
-1
destroy an existing server
def destroy Puppet.debug "starting with destroy #{self.class.to_s}" dns_service = get_dns_service(get_fqdn) if dns_service != nil dnsrecord = dns_service.get_record(get_fqdn, get_type) dns_service.remove_record(dnsrecord.hash_id) end Puppet.debug "done with destroy #{self.class.to_s}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n data = Storm::Base::SODServer.remote_call '/Server/destroy',\n :uniq_id => @uniq_id\n data[:destroyed]\n end", "def delete!\n server.delete(name)\n end", "def destroy_server(connection, server)\n server.destroy\n ...
[ "0.79000115", "0.7892371", "0.7857267", "0.7792657", "0.7761701", "0.76972073", "0.7646162", "0.7501964", "0.744149", "0.7423261", "0.73965895", "0.73920405", "0.7342122", "0.7331426", "0.733138", "0.72956145", "0.7294172", "0.7294172", "0.7294172", "0.7294172", "0.72907287",...
0.0
-1
check if a server exist
def exists? Puppet.debug "using provider action_record" Puppet.debug "starting exists? #{self.class.to_s}" Puppet.debug "check name => #{get_fqdn}" Puppet.debug "check type => #{get_type}" dns_service = get_dns_service(get_fqdn) return false if dns_service == nil return dns_service.record_exist?(get_fqdn, get_type) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exists_on_server?\n false\n end", "def server_exist?(server_name)\n compute = find_match(@compute.servers, server_name)\n Puppet.debug \"found server #{compute.name}\" if compute != nil\n Puppet.debug \"server not found : #{server_name}\" if compute == nil\n return (comput...
[ "0.83211243", "0.80273676", "0.79283136", "0.7916623", "0.78037846", "0.73045826", "0.717079", "0.71078616", "0.70042354", "0.6996859", "0.69947255", "0.6945836", "0.68640697", "0.68496335", "0.68496335", "0.68496335", "0.68451506", "0.6831342", "0.6786602", "0.677688", "0.67...
0.0
-1
def get_location_types location_types = LocationsHelper::LOCATION_TYPES index = location_types.index(ApplicationHelper::APP_CONTEXT) location_types.slice(index+1, location_types.lengthindex1) end
def get_location_type_by_employee_type(employee_type) POSITION_MAPPER[employee_type] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def location_type\n return @location_type\n end", "def index\n @locationtypes = Locationtype.all\n end", "def locations; end", "def resourceType\n 'Location'\n end", "def available_types\n # TODO pull this from DB or config\n [\n :kiosk,\n :ride,\n ...
[ "0.7285012", "0.6856818", "0.66896605", "0.6627473", "0.64581716", "0.6371816", "0.6316937", "0.62921", "0.6226568", "0.6150942", "0.611351", "0.6096483", "0.6082685", "0.60629666", "0.6060049", "0.6050122", "0.60485667", "0.6021481", "0.60206604", "0.59928703", "0.59848726",...
0.6354525
6
Who wrote this question?
def author User.find_by_id(@user_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def who_we_are\r\n end", "def most_interesting_man_in_the_world; end", "def informational?; end", "def what_is\n end", "def herebody_s; end", "def explain\n \n end", "def scientist; end", "def desc; end", "def who_am_i?\n \"#{self.class.name} (\\##{self.object_id}): #{self.to_s} \"\n end"...
[ "0.6886471", "0.6574786", "0.65003335", "0.64401186", "0.6310315", "0.60723674", "0.59746933", "0.59514916", "0.59290576", "0.5910795", "0.5910795", "0.59058744", "0.58651924", "0.5821768", "0.57878464", "0.57878464", "0.5740245", "0.57278234", "0.5726625", "0.57168853", "0.5...
0.0
-1
What replies are to this question
def replies Reply.find_by_question_id(@id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reply\n end", "def reply\n @reply\n end", "def get_reply\n @reply\n end", "def receive_replies(connection); end", "def replies\n Reply.find_by_question_id(self.id)\n end", "def prapor_quest; end", "def reply\n if acknowledged?\n replies.first\n else\n ...
[ "0.7053346", "0.7026669", "0.70140743", "0.69209474", "0.64736176", "0.63969636", "0.6235981", "0.62192047", "0.61507607", "0.6115937", "0.60911816", "0.6049361", "0.60207164", "0.6017693", "0.6017693", "0.5979061", "0.5968452", "0.59647906", "0.59605145", "0.5927425", "0.590...
0.6560523
4
Who follows this question
def followers QuestionFollower.followers_for_question_id(@id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def following\n return @following\n end", "def follower_username\n self.following_user.username\n end", "def answered_by\r\n answer_response.answerer\r\n end", "def following? hacker\n following.include? hacker\n end", "def following? hacker\n following.includ...
[ "0.6395609", "0.6341148", "0.631694", "0.6291779", "0.6291779", "0.6165735", "0.6123964", "0.61048794", "0.6075668", "0.5990591", "0.5990591", "0.5918323", "0.59132123", "0.5912152", "0.58983815", "0.58983815", "0.5893036", "0.5889681", "0.5884336", "0.5882762", "0.58767766",...
0.0
-1
say_that_thing_you_say, using a given character's catchphrase.
def say_that_thing_you_say "#{self.name} always says: #{self.catchphrase}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def say_that_thing_you_say\n \"#{self.name} always says: #{self.catchphrase}\"\n end", "def say_that_thing_you_say\n \"#{self.name} always says: #{self.catchphrase}\"\n end", "def catch_phrase(phrase)\n puts phrase #can be passed in as argument however.\nend", "def catch_phrase...
[ "0.6971025", "0.6919487", "0.68593484", "0.63920754", "0.63920754", "0.6308632", "0.62973064", "0.6189234", "0.61741877", "0.60887957", "0.6060606", "0.6054662", "0.60167617", "0.5987587", "0.5975714", "0.5965524", "0.59582746", "0.5893919", "0.5864873", "0.5859817", "0.58595...
0.67242074
3
returns hash for next two interviews, candidate details and questions
def info_and_interview_details details = {} details[:interview_schedules] = interviews.select{|interview| interview.interview_date > Date.current}.sort_by(&:interview_date).first(2).pluck(:description) details[:info] = [name, email] details[:questions] = questions.pluck(:question) details end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def competition_result_hash\n (\n person_id.hash ^\n (person_name.hash * 2) ^\n (place.hash * 3) ^\n (points.hash * 5) ^\n (team_id.hash * 7) ^\n (team_name.hash * 11)\n ).hash\n end", "def hash\n [sequence_number, corporate_number, process, correct, up...
[ "0.58854586", "0.582256", "0.57338786", "0.5545671", "0.5534404", "0.54774374", "0.53891265", "0.53866345", "0.5373376", "0.53650737", "0.5347283", "0.53299725", "0.53254575", "0.53029704", "0.53022647", "0.52840465", "0.52818215", "0.52803904", "0.52729803", "0.52725196", "0...
0.5680693
3
GET /sewage_farms GET /sewage_farms.json
def index @sewage_farms = SewageFarm.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def farms\n user = User.find(params[:id])\n\n @farms = []\n # Find which farms this user is authorized to access\n if (user.is_hog_owner?)\n @farms = user.owner.farms\n elsif user.is_barn_manager?\n @farms << user.owner.barn.location.farm\n elsif user.is_site_manager?\n @farms << u...
[ "0.7130239", "0.65915215", "0.6493926", "0.64490247", "0.64490247", "0.63844925", "0.6320052", "0.60818064", "0.606306", "0.59970397", "0.5977293", "0.59530264", "0.5819414", "0.57499176", "0.5722099", "0.5704056", "0.56741774", "0.5666898", "0.5636764", "0.5610792", "0.55786...
0.76180154
0
GET /sewage_farms/1 GET /sewage_farms/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @sewage_farms = SewageFarm.all\n end", "def farms\n user = User.find(params[:id])\n\n @farms = []\n # Find which farms this user is authorized to access\n if (user.is_hog_owner?)\n @farms = user.owner.farms\n elsif user.is_barn_manager?\n @farms << user.owner.barn.locatio...
[ "0.7427574", "0.67063177", "0.6556487", "0.6513118", "0.6513118", "0.6435051", "0.6384717", "0.6374829", "0.63711494", "0.63158923", "0.6252035", "0.62155867", "0.62133723", "0.61170775", "0.61153424", "0.6043681", "0.6037597", "0.6021908", "0.60005355", "0.5969965", "0.59637...
0.0
-1
POST /sewage_farms POST /sewage_farms.json
def create @sewage_farm = SewageFarm.new(sewage_farm_params) respond_to do |format| if @sewage_farm.save format.html { redirect_to @sewage_farm, notice: 'Sewage farm was successfully created.' } format.json { render action: 'show', status: :created, location: @sewage_farm } else format.html { render action: 'new' } format.json { render json: @sewage_farm.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @sewage_farms = SewageFarm.all\n end", "def create\n @farm = Farm.new(farm_params)\n\n if @farm.save\n render :show, status: :created, location: api_farm_url(@farm)\n else\n render json: @farm.errors, status: :unprocessable_entity\n end\n end", "def create\n @farmer = ...
[ "0.67898345", "0.61614835", "0.60824513", "0.6048799", "0.6027962", "0.5979735", "0.5975764", "0.5970147", "0.5970147", "0.59292704", "0.59271586", "0.5924448", "0.58733916", "0.5812037", "0.5796145", "0.5742351", "0.57337576", "0.571819", "0.56842005", "0.5674647", "0.565419...
0.71686035
0
PATCH/PUT /sewage_farms/1 PATCH/PUT /sewage_farms/1.json
def update respond_to do |format| if @sewage_farm.update(sewage_farm_params) format.html { redirect_to @sewage_farm, notice: 'Sewage farm was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @sewage_farm.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n if @farm.update(farm_params)\n render :show, status: :ok, location: api_farm_url(@farm)\n else\n render json: @farm.errors, status: :unprocessable_entity\n end\n end", "def update\n @spoofer = Spoofer.find(params[:id])\n\n respond_to do |format|\n if @spoofer.update_at...
[ "0.6482082", "0.64301825", "0.6419244", "0.6406759", "0.6406759", "0.6406759", "0.64017624", "0.6259931", "0.6248679", "0.62485236", "0.624458", "0.6227526", "0.6198232", "0.61918056", "0.60826856", "0.6066662", "0.6063319", "0.60608494", "0.6050673", "0.6047945", "0.6044106"...
0.710248
0
DELETE /sewage_farms/1 DELETE /sewage_farms/1.json
def destroy @sewage_farm.destroy respond_to do |format| format.html { redirect_to sewage_farms_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @farm = Farm.find(params[:id])\n @farm.destroy\n\n respond_to do |format|\n format.html { redirect_to farms_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @farm = Farm.find(params[:id])\n @farm.destroy\n\n respond_to do |format|\n format.h...
[ "0.69757545", "0.69757545", "0.69757545", "0.6944634", "0.69364554", "0.69046587", "0.6897896", "0.68871826", "0.68459153", "0.67770237", "0.6770223", "0.6757865", "0.6749977", "0.67436594", "0.6740193", "0.67328", "0.6705772", "0.67016256", "0.66951305", "0.66727144", "0.667...
0.76587015
0
Use callbacks to share common setup or constraints between actions.
def set_sewage_farm @sewage_farm = SewageFarm.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 sewage_farm_params params.require(:sewage_farm).permit(:name) 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
input: string of items separated by spaces (example: "carrots apples cereal pizza") steps: [fill in any steps here] define a method to create a list set the arrays to split the string create a new hash set default quantity = 1 print the list to the console [can you use one of your other methods here?] output: [what data type goes here, array or hash?] Method to add an item to a list input: item name and optional quantity steps:def method that takes two arguments name of item optional quantity output: return updated list Method to remove an item from the list input: our list an item to remove steps: delete key from the list output:updated list Method to update the quantity of an item input: steps: output: Method to print a list and make it look pretty input:our list for each item steps: output:
def list(items) split_list = items.split list_hash = Hash.new(1) split_list.each do |x| list_hash[x] = 1 end list_hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def createlist(str)\r\n# steps:\r\n# break the string into an array\r\n items = str.split\r\n item_list = {}\r\n\r\n\t# iterate through array and build hash\r\n items.each do |item|\r\n\r\n\t\t# iterate through array and build hash\r\n\t\t# set default quantity to 1\r\n \titem_list[item] = 1\r\n e...
[ "0.79825747", "0.7967328", "0.7580693", "0.7489564", "0.7426436", "0.7358357", "0.73501295", "0.7287313", "0.7258833", "0.7223251", "0.7209566", "0.7162287", "0.7156973", "0.71230614", "0.7120763", "0.7084393", "0.70781165", "0.70420873", "0.7035319", "0.70106816", "0.7003566...
0.0
-1
Bad sum => O(n^2)
def bad_two_sum?(arr, target_sum) (0...arr.length - 1).each do |i| (i + 1..arr.length - 1).each do |j| return true if arr[i] + arr[j] == target_sum end end false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sum_upon_sums(array)\n # Step 0: initialize variables => O(1)\n max = -1\n sum = 0\n\n # Step 1: Get Max and Sum => O(n)\n array.each do |num|\n max = num if num >= max\n sum += num\n end\n\n # Step 2: Get summation => O(1)\n summation = max * (max + 1) / 2\n\n # Step 3...
[ "0.7373117", "0.72670615", "0.72355545", "0.71203756", "0.7073186", "0.70575786", "0.70519984", "0.7010616", "0.69421214", "0.6925938", "0.6896369", "0.6892921", "0.68875", "0.68804836", "0.6863333", "0.6851068", "0.68493813", "0.6844047", "0.6808609", "0.67493117", "0.674149...
0.66871023
27
Okay two sum => O(nlog(n))
def okay_two_sum?(arr, target_sum) sorted_arr = merge_sort(arr) # O(n * log(n)) sorted_arr.each.with_index do |ele, i| # O(n * log(n)) diff = target_sum - ele next if diff == ele return true if !sorted_arr.my_bsearch(diff).nil? end false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bad_two_sum?(arr, target)\n arr.each_with_index do |num1, idx1| #O(n)\n arr.each_with_index do |num2, idx2| #O(n)\n return true if idx2 > idx1 && num1 + num2 == target #O(1)\n end\n end\n false\nend", "def two_sum(integers, target)\n # O(n)\n integers_with_index = integers...
[ "0.7345058", "0.7341081", "0.7316752", "0.731675", "0.72848356", "0.7172282", "0.7168532", "0.71443695", "0.7133457", "0.7111892", "0.70919913", "0.7074072", "0.70455444", "0.7030861", "0.7021675", "0.70046216", "0.6947679", "0.6941756", "0.69265974", "0.69100416", "0.6899873...
0.6571354
100
p okay_two_sum?(arr, 6) => should be true p okay_two_sum?(arr, 10) => should be false Hash Map Phase two_sum Time Complexity: O(n)
def two_sum?(arr, target_sum) hash = {} arr.each do |ele| diff = target_sum - ele return true if hash.has_key?(diff) # O(1), or constant time hash[ele] = 0 end false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def two_sum?(arr, target_sum) # O(N)\n hash = Hash.new(0)\n count = Hash.new(0)\n\n arr.each do |num|\n hash[num] = target_sum - num\n count[num] += 1\n end\n\n hash.each do |key, value|\n if hash.has_key?(value) \n if key == value \n if count[value] >...
[ "0.8440174", "0.84348816", "0.8399963", "0.8377519", "0.8371368", "0.833072", "0.83068204", "0.83036375", "0.82826596", "0.8270329", "0.8267729", "0.82436514", "0.82143015", "0.81952906", "0.8168682", "0.8142088", "0.8139913", "0.8131404", "0.8124533", "0.8124424", "0.8118387...
0.83128536
6
Register a new OAuth client app on the target instance
def create_app(name, redirect_uri, scopes = 'read', website = nil) perform_request_with_object(:post, '/api/v1/apps', { client_name: name, redirect_uris: redirect_uri, scopes: scopes, website: website }, Mastodon::App) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_client_app\n @client = Strava::OAuth::Client.new(\n client_id: ENV['STRAVA_CLIENT_ID'],\n client_secret: ENV['STRAVA_CLIENT_SECRET']\n )\n end", "def new_client_application\n OAuth2::Client.new(caller_service.client_id, caller_service.client_secret, :site => authorizator_servi...
[ "0.7039469", "0.69243544", "0.6599513", "0.6429125", "0.6429125", "0.62416893", "0.61975044", "0.6110501", "0.60634816", "0.60634816", "0.60552144", "0.6009817", "0.6001248", "0.5905054", "0.5883809", "0.5855184", "0.5839893", "0.58339864", "0.58001405", "0.5728862", "0.57137...
0.56922233
23
attr_accessible :goals_team_1, :goals_team_2 richtiger Gewinner => 2 Punkt richtige Tordifferenz => 3 Punkte richtiger Tipp => 4 Punkte
def points return 0 if match.invalid_result? return 4 if self.score == match.score return 3 if self.goals_diff == match.goals_diff return 2 if self.winner == match.winner return 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def team_params\n params.require(:team).permit(:leader, :email, :password, :password_confirmation, :phone, :cin, :contest, :date, :robot, :university, :payment_proof, :member1, :member2, :member3, :member4, :member5, :member6, :member7, :status, :active)\n end", "def team_params\n params.require(:team)....
[ "0.58911145", "0.5878859", "0.5786677", "0.56992686", "0.5690093", "0.5676308", "0.56449276", "0.5629898", "0.56144834", "0.5592983", "0.5590469", "0.5557714", "0.55444324", "0.548563", "0.5478264", "0.5478264", "0.5478264", "0.54612213", "0.546081", "0.5453643", "0.5445946",...
0.0
-1
Return the current face value of the die
def value() return @current_roll end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def face_values\n @face_values ||= self.class.face_values\n end", "def face_values\n @hand.map { |c| c.face }\n end", "def face_values\n @face_values ||= DEFAULT_FACE_VALUES\n end", "def face_to_value(face)\n conversion = {\n 'jack' => 11,\n 'queen' => 12,\n 'king' =>...
[ "0.6780397", "0.67563844", "0.6462938", "0.64236265", "0.62954605", "0.6152718", "0.61327577", "0.58887035", "0.5853363", "0.57604945", "0.5718644", "0.5632844", "0.5618776", "0.552747", "0.55257624", "0.54949266", "0.54780704", "0.54693365", "0.54569995", "0.5442858", "0.543...
0.55256855
15
Return a string to describe what kind of die this is.
def describe() return "d" + @faces.to_s() end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def die_mode\n DieMode::FOUR # All Kangaroos get the 4 value die\n end", "def die\n raw \"DIE\\r\\n\"\n end", "def death_message\n if info.death_message\n info.death_message\n else\n \"The last bit of spark fades from #{name}'s eye as #{pronoun} slumps to the ground.\"\n en...
[ "0.67215884", "0.62952495", "0.6249504", "0.6152759", "0.6079955", "0.6068809", "0.606807", "0.6005618", "0.5950315", "0.582857", "0.5750893", "0.573299", "0.5687766", "0.56648934", "0.5663224", "0.56540924", "0.56116086", "0.5562487", "0.55426794", "0.5512777", "0.550389", ...
0.5948275
9
For more information on this command refer to user manual or inline help in interactive mode.
def search(cmd) songs = select_songs_with cmd if songs.empty? failure('It matches not even one') else playlists[:focus] <= songs playlists[:search] <= songs success(songs: songs, response_type: :songs) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help\n end", "def command_help\n display_possible_actions\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.71017635", "0.7100769", "0.70592403", "0.7055412", "0.7055412", "0.7055412", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7039546", "0.7039546", "0.70352757", "0.6966352", "0.6932425", "0.69265807", "0.6910765", "0.6901026",...
0.0
-1
For more information on this command refer to user manual or inline help in interactive mode.
def show(cmd) if cmd.params.empty? if playing? #mostramos la cancion actual progress_bar = get_progress_bar_with_labels(playback_position, playback_length, 20, format_secs(playback_position), format_secs(playback_length)) return success(message: "#{current_song.to_s}\n#{c7(progress_bar)}", song: current_song) else return failure("Nothing to show yet. Try with 'play' first.") end # with parameters else list_to_show = cmd.params(:object).reduce([]) do |acc, p| acc + case p.value when :playlist then current_playlist.to_a when :current then playlists[:current].to_a when :history then playlists[:history].to_a when :queue then playlists[:queue].to_a when :focus then playlists[:focus].to_a when :search then playlists[:search].to_a when :song then return success(message: current_song.to_s, song: current_song) when :artist then return success(message: current_artist.to_s, artist: current_artist) when :album then return success(message: current_album.to_s, album: current_album) when :genre then return success(message: current_song.genres.map{|g| g.name}.join(", "), genres: current_song.genres) when :drives then Drive.all when :artists then Artist.all when :albums then Album.all when :genres then Genre.all when :library then whole_library.to_a when :recently_added then low_time, high_time = get_recently_added_criteria_limit Song.where({created_at: low_time..high_time}).to_a when :recently_played then low_time, high_time = get_recently_played_criteria_limit Song.where({last_played_at: low_time..high_time}).to_a when :most_played then Song.where("plays >= ?", get_most_played_criteria_limit).to_a when :less_played then Song.where("plays <= ?", get_less_played_criteria_limit).to_a when :populars then low_time, up_time, low_count = get_popular_criteria_limits Song.where("last_played_at between ? and ? and plays >= ?", low_time, up_time, low_count) else [] end end if list_to_show.empty? return failure("I checked and there is nothing there.") else playlists[:focus] <= list_to_show return success(list: list_to_show, response_type: :list) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command_help\n display_possible_actions\n end", "def help\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.7100696", "0.7100486", "0.7057814", "0.7053643", "0.7053643", "0.7053643", "0.705132", "0.705132", "0.705132", "0.705132", "0.705132", "0.705132", "0.705132", "0.7038149", "0.7038149", "0.7035728", "0.6966038", "0.6932684", "0.69255793", "0.69110787", "0.68999296", "0.68...
0.0
-1
For more information on this command refer to user manual or inline help in interactive mode.
def enqueue(cmd) songs = select_songs_with cmd if songs.empty? failure("No songs found with this criteria. Sorry, nothing was enqueued.") else playlists[:queue] << songs msg = "These songs were enqueued:\n" songs.each {|s,idx| msg << " #{s.to_s}\n"} success(message: msg, enqueued: songs) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help\n end", "def command_help\n display_possible_actions\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.71017635", "0.7100769", "0.70592403", "0.7055412", "0.7055412", "0.7055412", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7039546", "0.7039546", "0.70352757", "0.6966352", "0.6932425", "0.69265807", "0.6910765", "0.6901026",...
0.0
-1
For more information on this command refer to user manual or inline help in interactive mode.
def shuffle(cmd) if cmd.params.empty? if playlists[:current].shuffling? return success(message: "Everyday I'm shuffling!", shuffling: true) else return success(message: "No shuffling", shuffling: false) end else turn_on = cmd.params(:boolean).first.value turn_on ? playlists[:current].shuffle : playlists[:current].order return success(message: turn_on ? "Now we're shuffling!" : "Shuffle is now off") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help\n end", "def command_help\n display_possible_actions\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.71017635", "0.7100769", "0.70592403", "0.7055412", "0.7055412", "0.7055412", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7039546", "0.7039546", "0.70352757", "0.6966352", "0.6932425", "0.69265807", "0.6910765", "0.6901026",...
0.0
-1
For more information on this command refer to user manual or inline help in interactive mode.
def connect(cmd) path = cmd.params(:path).first name = cmd.params(:literal).first if path.nil? # with only literal parameter raise 'invalid parameter:missing parameters' if name.nil? # es una reconexion... drive = Drive.find_by(name: name.value) raise 'invalid name:the named drive doesnt exists' if drive.nil? if drive.connected failure("What you mean? Drive 'name.value' is connected.") else if drive.update_attributes({connected: true}) success(message: "Drive '#{name.value}' was reconnected.") else failure("Something went wrong and I couldnt reconnect drive '#{name.value}'. Try again later please.") end end else # with path and literal parameter raise 'invalid path:the directory is invalid' unless Dir.exist?(path.value) raise 'invalid name:name required' if name.nil? # es una creacion o actualizacion... # checamos si la unidad existe root_path = File.expand_path(path.value) drive = Drive.find_by(path: root_path) # la creamos si no existe... is_update = !drive.nil? drive = Drive.create!(name: name.value, path: root_path) unless is_update track_info = get_files_in_tree(root_path, file_types).each_with_object([]) do |filepath, acc| acc << extract_from_mp3(filepath, library_path: root_path) end # insertamos las nuevas y actualizamos las existentes updated = update_song(track_info) imported = insert_song(track_info) display "" # para insertar un salto de linea despues de las barras de progreso success(message: connect_response_msg(imported, updated), files_detected: track_info.size, files_imported: imported, files_updated: updated, drive_updated: is_update) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help\n end", "def command_help\n display_possible_actions\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.71017635", "0.7100769", "0.70592403", "0.7055412", "0.7055412", "0.7055412", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7039546", "0.7039546", "0.70352757", "0.6966352", "0.6932425", "0.69265807", "0.6910765", "0.6901026",...
0.0
-1
For more information on this command refer to user manual or inline help in interactive mode.
def disconnect(cmd) name = cmd.params(:literal).first.value drive = Drive.find_by(name: name) raise "Drive '#{name}' dont exist." if drive.nil? if drive.connected if drive.update(connected: false) success(message: "Drive '#{name}' is now disconnected.") else failure("I cant disconnect drive '#{name}', something weird happened. Maybe if you again later works.") end else failure("The drive '#{name}' is already disconnected.") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command_help\n display_possible_actions\n end", "def help\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.7100696", "0.7100486", "0.7057814", "0.7053643", "0.7053643", "0.7053643", "0.705132", "0.705132", "0.705132", "0.705132", "0.705132", "0.705132", "0.705132", "0.7038149", "0.7038149", "0.7035728", "0.6966038", "0.6932684", "0.69255793", "0.69110787", "0.68999296", "0.68...
0.0
-1
For more information on this command refer to user manual or inline help in interactive mode.
def ff(cmd) ff_in_secs = 10 unless cmd.params(:number).empty? ff_in_secs = cmd.params(:number).first.value end ff_in_player ff_in_secs return success(message: "Fast Forwarded by #{ff_in_secs} secs") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help\n end", "def command_help\n display_possible_actions\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.71017635", "0.7100769", "0.70592403", "0.7055412", "0.7055412", "0.7055412", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7039546", "0.7039546", "0.70352757", "0.6966352", "0.6932425", "0.69265807", "0.6910765", "0.6901026",...
0.0
-1
For more information on this command refer to user manual or inline help in interactive mode.
def fb(cmd) fb_in_secs = 10 unless cmd.params(:number).empty? fb_in_secs = cmd.params(:number).first.value end fb_in_player fb_in_secs return success(message: "Fast Backwarded by #{fb_in_secs} secs") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help\n end", "def command_help\n display_possible_actions\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.71017635", "0.7100769", "0.70592403", "0.7055412", "0.7055412", "0.7055412", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7039546", "0.7039546", "0.70352757", "0.6966352", "0.6932425", "0.69265807", "0.6910765", "0.6901026",...
0.0
-1
For more information on this command refer to user manual or inline help in interactive mode.
def repeat(cmd) repeat_in_player return success(message: "Repeating " + current_song.to_s) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def help\n end", "def command_help\n display_possible_actions\n end", "def help\n \n end", "def help; end", "def help; end", "def help; end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "def help\n end", "de...
[ "0.71017635", "0.7100769", "0.70592403", "0.7055412", "0.7055412", "0.7055412", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7052684", "0.7039546", "0.7039546", "0.70352757", "0.6966352", "0.6932425", "0.69265807", "0.6910765", "0.6901026",...
0.0
-1
GET /students/1 GET /students/1.json
def show @student = Student.find(params[:id]) session[:student_id] = @student.id redirect_to curriculums_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_student\n @student = Student.find(params[:std_id])\n render json: @student\n end", "def show\n student = Student.find(params[:id])\n render json: student\nend", "def show\n @student = User.find params[:id]\n respond_to do |format|\n format.html # index.html.erb\n format.jso...
[ "0.7990593", "0.771512", "0.7640297", "0.7617675", "0.7567241", "0.75564045", "0.75564045", "0.75564045", "0.75564045", "0.75564045", "0.75564045", "0.75564045", "0.75564045", "0.7495154", "0.7495154", "0.7489719", "0.74649316", "0.74649316", "0.74443895", "0.7441979", "0.744...
0.0
-1
GET /students/new GET /students/new.json
def new @student = Student.new respond_to do |format| format.html # new.html.erb format.json { render json: @student } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @student ...
[ "0.79333663", "0.79333663", "0.7850608", "0.7614127", "0.7548974", "0.75125027", "0.74463147", "0.7424611", "0.7406299", "0.7399139", "0.73621935", "0.7343533", "0.7329588", "0.73249674", "0.73132336", "0.7283329", "0.7281672", "0.7281672", "0.7272385", "0.72084963", "0.71743...
0.8022949
9
POST /students POST /students.json
def create @student = Student.new(params[:student]) #@student.account = params[:account] @student.password = [*'0'..'9'].sample(6).join @student.student_admin_id = session[:teacher_id] @student.student_picture = 'http://procket.oss-cn-hangzhou.aliyuncs.com/Picture/2014/07/07/BD7E9798-4DE6-408A-A75C-66199598AF72' respond_to do |format| if @student.save format.html { redirect_to students_path, alert: '学员增加成功!' } else format.html { render action: 'new' } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @student = Student.new(student_params)\n\n if @student.save\n render json: @student, status: :created\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "def create\n @student = current_user.students.create(student_params)\n\n respond_...
[ "0.7277736", "0.7135355", "0.71114737", "0.71114737", "0.70372117", "0.70311", "0.70311", "0.70311", "0.70311", "0.70311", "0.70311", "0.70311", "0.6981121", "0.6974331", "0.6952658", "0.6951065", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918", "0.6949918",...
0.0
-1
PUT /students/1 PUT /students/1.json
def update @student = Student.find(params[:id]) respond_to do |format| if @student.update_attributes(params[:student]) format.html { redirect_to students_path, notice: 'Student was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @student.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n if @student.update(student_params)\n render json: @student\n else\n render json: @student.errors, status: :unprocessable_entity\n end\n end", "def update\n begin\n student = Student.find(params[:id])\n student.update_attributes!(student_params)\n\n render json: ...
[ "0.7224749", "0.6994907", "0.69019437", "0.68976754", "0.688167", "0.688167", "0.6871342", "0.6871342", "0.6871342", "0.6871342", "0.6871342", "0.68621904", "0.68586385", "0.679477", "0.6747145", "0.66869766", "0.6664319", "0.66471314", "0.66471314", "0.66471314", "0.66471314...
0.6908403
2
DELETE /students/1 DELETE /students/1.json
def destroy @student = Student.find(params[:id]) @student.destroy respond_to do |format| format.html { redirect_to students_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @student.delete\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student = Student.find(params[:id])\n @student.destroy\n\n respond_to do |format|\n format.html { redirect_to studen...
[ "0.7819392", "0.7671556", "0.7663533", "0.7659178", "0.76213115", "0.76213115", "0.76213115", "0.76213115", "0.7596803", "0.75276846", "0.74747837", "0.74672514", "0.74659437", "0.74365073", "0.7429513", "0.74032545", "0.74029773", "0.7365554", "0.7349961", "0.73384535", "0.7...
0.765668
11
Create or update an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object already exists.
def create_or_replace_infra_segment_port(segment_id, port_id, segment_port, opts = {}) data, _status_code, _headers = create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port ...'\n end\n # verify the r...
[ "0.63142276", "0.63142276", "0.6296247", "0.6200296", "0.5938828", "0.5800965", "0.57588226", "0.57166344", "0.57128656", "0.5684736", "0.5684736", "0.55064523", "0.55033094", "0.54869914", "0.53996265", "0.53793895", "0.53778696", "0.53778696", "0.53582305", "0.5308961", "0....
0.6182762
5
Create or update an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object already exists.
def create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port" end # resource path local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(segment_port) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_infra_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_replace_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port_0 ...'\n end\n # verify t...
[ "0.6297722", "0.6203045", "0.6185203", "0.6185203", "0.593844", "0.5802011", "0.5759849", "0.57176924", "0.5711878", "0.5683879", "0.5683879", "0.55090135", "0.5502143", "0.5488267", "0.5396864", "0.53790706", "0.53790706", "0.5378983", "0.53603554", "0.53102225", "0.53102225...
0.63156843
1
Create or update an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object already exists.
def create_or_replace_infra_segment_port_0(segment_id, port_id, segment_port, opts = {}) data, _status_code, _headers = create_or_replace_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port ...'\n end\n # verify the r...
[ "0.6314877", "0.6314877", "0.6296702", "0.6185902", "0.6185902", "0.59384173", "0.5801795", "0.5759641", "0.57173425", "0.5712528", "0.56846625", "0.56846625", "0.5508963", "0.5503374", "0.54877603", "0.53998256", "0.5379781", "0.53787833", "0.53787833", "0.53613204", "0.5310...
0.62030196
3
Create or update an infra segment port Create an infra segment port if it does not exist based on the IDs, or update existing port information by replacing the port object already exists.
def create_or_replace_infra_segment_port_0_with_http_info(segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port_0 ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port_0" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port_0" end # resource path local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(segment_port) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_infra_segment_port_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_replace_infra_segment_port_with_http_info(segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_infra_segment_port ...'\n end\n # verify the r...
[ "0.6315461", "0.6315461", "0.62030077", "0.6185723", "0.6185723", "0.59380966", "0.58022404", "0.57600576", "0.5717797", "0.5712891", "0.5685392", "0.5685392", "0.55093277", "0.5502295", "0.54886186", "0.53995305", "0.5380435", "0.53796864", "0.53796864", "0.536109", "0.53111...
0.62972635
2
Create or update a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object already exists.
def create_or_replace_tier1_segment_port(tier_1_id, segment_id, port_id, segment_port, opts = {}) data, _status_code, _headers = create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # v...
[ "0.6807099", "0.6780732", "0.6731979", "0.6716243", "0.6121863", "0.6119443", "0.6098571", "0.606471", "0.5914401", "0.5914401", "0.57786715", "0.5771669", "0.5757381", "0.5733029", "0.5567031", "0.5414841", "0.5414841", "0.53321964", "0.53246", "0.53127", "0.5297191", "0.5...
0.67371035
3
Create or update a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object already exists.
def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(segment_port) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # v...
[ "0.677943", "0.67378527", "0.67378527", "0.6732966", "0.6714906", "0.6120353", "0.6117921", "0.60970664", "0.6065019", "0.59144646", "0.59144646", "0.5776928", "0.5773328", "0.5755662", "0.57313627", "0.5568646", "0.54169697", "0.54169697", "0.5329567", "0.53220457", "0.53101...
0.68058085
0
Create or update a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object already exists.
def create_or_replace_tier1_segment_port_0(tier_1_id, segment_id, port_id, segment_port, opts = {}) data, _status_code, _headers = create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # v...
[ "0.6807027", "0.6780671", "0.67381996", "0.67381996", "0.6716226", "0.61208564", "0.6118417", "0.6097679", "0.60649985", "0.5914247", "0.5914247", "0.5776747", "0.577435", "0.575543", "0.57312024", "0.5568976", "0.5417418", "0.5417418", "0.53302425", "0.53228134", "0.53107256...
0.6733438
4
Create or update a Tier1 segment port Create a Tier1 segment port if it does not exist based on the IDs, or update existing port information by replacing the port object already exists.
def create_or_replace_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0" end # verify the required parameter 'segment_port' is set if @api_client.config.client_side_validation && segment_port.nil? fail ArgumentError, "Missing the required parameter 'segment_port' when calling PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(segment_port) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SegmentPort') if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#create_or_replace_tier1_segment_port_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_replace_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, segment_port, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.create_or_replace_tier1_segment_port ...'\n end\n # v...
[ "0.6806934", "0.6780556", "0.67380273", "0.67380273", "0.67330813", "0.6120777", "0.61183405", "0.6097517", "0.606429", "0.5913655", "0.5913655", "0.57766277", "0.57759935", "0.5755315", "0.57309467", "0.5570166", "0.5418514", "0.5418514", "0.5330142", "0.5322586", "0.5310623...
0.67160916
5
Delete an infra segment port Delete an infra segment port by giving ID.
def delete_infra_segment_port(segment_id, port_id, opts = {}) delete_infra_segment_port_with_http_info(segment_id, port_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_infra_segment_port_0(segment_id, port_id, opts = {})\n delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts)\n nil\n end", "def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.log...
[ "0.7074243", "0.6735563", "0.66721976", "0.66721976", "0.61105806", "0.6070389", "0.5968329", "0.5923048", "0.58696437", "0.586616", "0.5863346", "0.5815285", "0.57676363", "0.57490015", "0.57490015", "0.5678719", "0.56556076", "0.5648746", "0.56439114", "0.56397724", "0.5639...
0.6831765
2
Delete an infra segment port Delete an infra segment port by giving ID.
def delete_infra_segment_port_with_http_info(segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_segment_port ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_segment_port" end # resource path local_var_path = '/infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#delete_infra_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_infra_segment_port_0(segment_id, port_id, opts = {})\n delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts)\n nil\n end", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\n...
[ "0.7074243", "0.6831765", "0.6831765", "0.6735563", "0.61105806", "0.6070389", "0.5968329", "0.5923048", "0.58696437", "0.586616", "0.5863346", "0.5815285", "0.57676363", "0.57490015", "0.57490015", "0.5678719", "0.56556076", "0.5648746", "0.56439114", "0.56397724", "0.563977...
0.66721976
5
Delete an infra segment port Delete an infra segment port by giving ID.
def delete_infra_segment_port_0(segment_id, port_id, opts = {}) delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\n end", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\n ...
[ "0.6831765", "0.6831765", "0.6735563", "0.66721976", "0.66721976", "0.61105806", "0.6070389", "0.5968329", "0.5923048", "0.58696437", "0.586616", "0.5863346", "0.5815285", "0.57676363", "0.57490015", "0.57490015", "0.5678719", "0.56556076", "0.5648746", "0.56439114", "0.56397...
0.7074243
0
Delete an infra segment port Delete an infra segment port by giving ID.
def delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_segment_port_0 ...' end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_infra_segment_port_0" end # resource path local_var_path = '/global-infra/segments/{segment-id}/ports/{port-id}'.sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#delete_infra_segment_port_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_infra_segment_port_0(segment_id, port_id, opts = {})\n delete_infra_segment_port_0_with_http_info(segment_id, port_id, opts)\n nil\n end", "def delete_infra_segment_port(segment_id, port_id, opts = {})\n delete_infra_segment_port_with_http_info(segment_id, port_id, opts)\n nil\n...
[ "0.7075241", "0.6832483", "0.6832483", "0.66730213", "0.66730213", "0.6113589", "0.60731876", "0.5967768", "0.59212357", "0.5872351", "0.58658534", "0.58631146", "0.58149624", "0.576782", "0.5748166", "0.5748166", "0.5678917", "0.565624", "0.5651686", "0.56463206", "0.5642525...
0.67366856
3
Delete a Tier1 segment port Delete a Tier1 segment port by giving ID.
def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {}) delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\...
[ "0.7070709", "0.68903226", "0.6863149", "0.68607795", "0.6020366", "0.59942603", "0.5964332", "0.57865524", "0.57865524", "0.5778673", "0.57757527", "0.57174796", "0.56877625", "0.5668357", "0.5668357", "0.5596112", "0.55751973", "0.5567225", "0.5560114", "0.55247974", "0.551...
0.6864064
3
Delete a Tier1 segment port Delete a Tier1 segment port by giving ID.
def delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port" end # resource path local_var_path = '/global-infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#delete_tier1_segment_port\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_with_http_info(tier_1...
[ "0.7070709", "0.6864064", "0.6864064", "0.6863149", "0.68607795", "0.6020366", "0.59942603", "0.5964332", "0.57865524", "0.57865524", "0.5778673", "0.57757527", "0.57174796", "0.56877625", "0.5668357", "0.5668357", "0.5596112", "0.55751973", "0.5567225", "0.5560114", "0.55247...
0.68903226
1
Delete a Tier1 segment port Delete a Tier1 segment port by giving ID.
def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {}) delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port ...'\n end\n # verify the required parameter 'tier_1...
[ "0.68903226", "0.6864064", "0.6864064", "0.6863149", "0.68607795", "0.6020366", "0.59942603", "0.5964332", "0.57865524", "0.57865524", "0.5778673", "0.57757527", "0.57174796", "0.56877625", "0.5668357", "0.5668357", "0.5596112", "0.55751973", "0.5567225", "0.5560114", "0.5524...
0.7070709
0
Delete a Tier1 segment port Delete a Tier1 segment port by giving ID.
def delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0 ...' end # verify the required parameter 'tier_1_id' is set if @api_client.config.client_side_validation && tier_1_id.nil? fail ArgumentError, "Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0" end # verify the required parameter 'segment_id' is set if @api_client.config.client_side_validation && segment_id.nil? fail ArgumentError, "Missing the required parameter 'segment_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0" end # verify the required parameter 'port_id' is set if @api_client.config.client_side_validation && port_id.nil? fail ArgumentError, "Missing the required parameter 'port_id' when calling PolicyNetworkingConnectivitySegmentsPortsApi.delete_tier1_segment_port_0" end # resource path local_var_path = '/infra/tier-1s/{tier-1-id}/segments/{segment-id}/ports/{port-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'segment-id' + '}', segment_id.to_s).sub('{' + 'port-id' + '}', port_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: PolicyNetworkingConnectivitySegmentsPortsApi#delete_tier1_segment_port_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tier1_segment_port_0(tier_1_id, segment_id, port_id, opts = {})\n delete_tier1_segment_port_0_with_http_info(tier_1_id, segment_id, port_id, opts)\n nil\n end", "def delete_tier1_segment_port_with_http_info(tier_1_id, segment_id, port_id, opts = {})\n if @api_client.config.debugging\...
[ "0.70703673", "0.6889911", "0.6863835", "0.6863835", "0.6860397", "0.601955", "0.5993323", "0.5965079", "0.57854825", "0.57854825", "0.57783455", "0.57770467", "0.57163936", "0.5689688", "0.5668261", "0.5668261", "0.5596353", "0.5576716", "0.5568955", "0.5560423", "0.5525402"...
0.6862636
4
Get infra segment port by ID Get detail information on an infra segment port by giving ID.
def get_infra_segment_port(segment_id, port_id, opts = {}) data, _status_code, _headers = get_infra_segment_port_with_http_info(segment_id, port_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_port(id)\n if port_valid?(id)\n @port[id]\n else\n raise RuntimeError, \"port (#{id}) does not exist for #{self}\"\n end\n end", "def get_infra_segment_port_with_http_info(segment_id, port_id, opts = {})\n if @api_client.config.debugging\n @api_clie...
[ "0.679937", "0.6429541", "0.6429541", "0.6380113", "0.61166555", "0.5807281", "0.5807281", "0.57703", "0.56931674", "0.56918156", "0.56918156", "0.5658188", "0.5658188", "0.5649823", "0.5649823", "0.5646096", "0.5618963", "0.5616427", "0.5542724", "0.5542724", "0.55405664", ...
0.65083134
2