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
Clicking on an item with x class should take us to y page
def navigate_click(classname, location) btn = find(classname) @emberHelper.ember_transition_click btn expect(current_path).to eq("/#{locale}/app/#{location}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def click_pager_item(index)\n pager_items[index - 1].click\n end", "def click(link); end", "def click_item_page\n add_to_cart_button_item_page.click\n end", "def onItemClick(parent, view, position, id)\n selectItem(position)\n end", "def navigate_click(classname, location)\n page.ass...
[ "0.69796246", "0.64464384", "0.6351783", "0.6230519", "0.6208322", "0.6160633", "0.6133306", "0.6114633", "0.6094316", "0.6003099", "0.599102", "0.59581274", "0.59375954", "0.59373885", "0.58929425", "0.58929425", "0.58929425", "0.58550346", "0.5839433", "0.5785057", "0.57694...
0.5886504
19
def join user, invite=nil if private? and not invite return nil else ClanMember.create(clan_id: id, user: user) end end Please do not chnage this is overriden method remove space from start and end of the string before savingto database
def name=(name) write_attribute(:name, name.try(:strip)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def join!(user)\n # It loads up all the user because in the case where the chat is saved but the chat_participations have not been saved,\n # this is the only way to ensure we don't have duplicates.\n return if self.chat_participations.map(&:user_id).include?(user.id)\n self.chat_participations.create!...
[ "0.61996776", "0.60027933", "0.5995404", "0.58978456", "0.58726716", "0.5857235", "0.57745343", "0.5766841", "0.5762479", "0.5746051", "0.5743181", "0.5708433", "0.57070357", "0.5702719", "0.565002", "0.56422156", "0.5638033", "0.5636886", "0.56287897", "0.5603159", "0.559797...
0.0
-1
return all contracts for a clan newest first
def get_contracts Contract.where(clan_id: id).order('start_date_time desc') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @employment_contracts = EmploymentContract.order(\"created_at desc\")\n end", "def index\n @contracts = Contract.all.first(50000)\n end", "def sort_contracts(how_many)\n return_array = []\n contracts_sorted = join_table_gas_simulation_contracts.sort_by(&:savings).reverse\n how_many...
[ "0.58834624", "0.5801333", "0.5739579", "0.56616473", "0.5656057", "0.55541444", "0.55098265", "0.55043143", "0.5476279", "0.5446749", "0.5417555", "0.5410505", "0.5337612", "0.53325564", "0.53202784", "0.53202426", "0.52933043", "0.526573", "0.52451736", "0.52451736", "0.524...
0.74952155
0
GET /dianosaurs GET /dianosaurs.json
def index @dianosaurs = Dianosaur.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "def index\n @dinos = Dino.where(query_params)\n render json: @dinos\n end", "def show\n dinosaurs = Dinosaur.filter_by_species(params[:species])\n\n if dinosaurs\n render json: dinosaurs\n else\n render j...
[ "0.65777904", "0.65596354", "0.6470492", "0.617811", "0.6157605", "0.613789", "0.6126394", "0.61251336", "0.61018944", "0.610158", "0.6087258", "0.60863346", "0.60516644", "0.603589", "0.60243237", "0.6007011", "0.6003411", "0.6001562", "0.6001041", "0.5988936", "0.5985258", ...
0.6803119
0
GET /dianosaurs/1 GET /dianosaurs/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @dinos = Dino.where(query_params)\n render json: @dinos\n end", "def index\n @denuncia = Denuncium.all\n\n render json: @denuncia\n end", "def show\n @uchronia = Uchronia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render ...
[ "0.6598212", "0.6565846", "0.6494683", "0.6470051", "0.64124167", "0.6409542", "0.63456607", "0.63095874", "0.63077646", "0.63058996", "0.62892926", "0.62767226", "0.6257876", "0.6252885", "0.62468827", "0.6244384", "0.62425673", "0.6239019", "0.623283", "0.62325054", "0.6221...
0.0
-1
POST /dianosaurs POST /dianosaurs.json
def create @dianosaur = Dianosaur.new(dianosaur_params) respond_to do |format| if @dianosaur.save format.html { redirect_to @dianosaur, notice: 'Dianosaur was successfully created.' } format.json { render :show, status: :created, location: @dianosaur } else format.html { render :new } format.json { render json: @dianosaur.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n neuron = Neuron.create! params\n render :json => neuron\n # @neuron = Neuron.new(params[:neuron])\n # \n # respond_to do |format|\n # if @neuron.save\n # format.html { redirect_to @neuron, notice: 'Neuron was successfully created.' }\n # format.json { render json: @ne...
[ "0.616665", "0.61308", "0.602781", "0.5998858", "0.5955735", "0.5935511", "0.5916064", "0.591441", "0.59037507", "0.5852463", "0.58503026", "0.58277565", "0.5826517", "0.5823598", "0.5815129", "0.5812158", "0.58114207", "0.580662", "0.5795816", "0.57928896", "0.5791833", "0...
0.63877773
0
PATCH/PUT /dianosaurs/1 PATCH/PUT /dianosaurs/1.json
def update respond_to do |format| if @dianosaur.update(dianosaur_params) format.html { redirect_to @dianosaur, notice: 'Dianosaur was successfully updated.' } format.json { render :show, status: :ok, location: @dianosaur } else format.html { render :edit } format.json { render json: @dianosaur.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @sivic_discipulo.update(sivic_discipulo_params_netested)\n format.html { redirect_to @sivic_discipulo, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n for...
[ "0.65240806", "0.6504909", "0.6405766", "0.63472193", "0.63209087", "0.6298435", "0.6297537", "0.62822706", "0.626692", "0.6262864", "0.6238612", "0.6233836", "0.6224269", "0.6200524", "0.61938566", "0.6176954", "0.6174561", "0.61668295", "0.61572844", "0.6154369", "0.6151771...
0.0
-1
DELETE /dianosaurs/1 DELETE /dianosaurs/1.json
def destroy @dianosaur.destroy respond_to do |format| format.html { redirect_to dianosaurs_url, notice: 'Dianosaur was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete\n client.delete(\"/#{id}\")\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @dinosaur = Dinosaur.find(params[:id])\n @dinosaur.destroy\n\n respond_to do |format|\n format.html { redirect_to dinosaurs_url }\n format.json { head :...
[ "0.7264388", "0.7014365", "0.6952717", "0.69443405", "0.6911502", "0.6852525", "0.6835401", "0.6822832", "0.68194366", "0.67999977", "0.67946404", "0.6794366", "0.6789622", "0.67777646", "0.6775682", "0.67647266", "0.67647266", "0.67647266", "0.67647266", "0.6756896", "0.6754...
0.6945403
3
Use callbacks to share common setup or constraints between actions.
def set_dianosaur @dianosaur = Dianosaur.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 dianosaur_params params.require(:dianosaur).permit(:name, :genus, :description, :period) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
GET /profile_diet_tags GET /profile_diet_tags.json
def index @profile_diet_tags = ProfileDietTag.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tags\n get('tags')\n end", "def profile_diet_tag_params\n params[:profile_diet_tag]\n end", "def get_tags_by_url\n url = Url.find_by(id: params[:id])\n tags = url.tags\n render json: {code: 200, tags: tags}\n end", "def tags\n @tags_with_count = Asset.tag_counts_on(...
[ "0.7142842", "0.68965954", "0.6883749", "0.6806724", "0.6692058", "0.6658526", "0.6566993", "0.65361464", "0.6491817", "0.64789355", "0.63980937", "0.63587475", "0.63569975", "0.63379407", "0.6311361", "0.6305095", "0.6297352", "0.62745374", "0.6233613", "0.61860204", "0.6181...
0.7445801
0
GET /profile_diet_tags/1 GET /profile_diet_tags/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @profile_diet_tags = ProfileDietTag.all\n end", "def tags\n get('tags')\n end", "def get_tags_by_url\n url = Url.find_by(id: params[:id])\n tags = url.tags\n render json: {code: 200, tags: tags}\n end", "def set_profile_diet_tag\n @profile_diet_tag = ProfileDi...
[ "0.7284194", "0.68466455", "0.683047", "0.6770027", "0.6747835", "0.6725521", "0.6708171", "0.63837165", "0.6369457", "0.6313448", "0.6308699", "0.62392014", "0.623756", "0.6227399", "0.6215166", "0.6186085", "0.6167213", "0.6162167", "0.61581844", "0.613525", "0.6118961", ...
0.0
-1
POST /profile_diet_tags POST /profile_diet_tags.json
def create @profile_diet_tag = ProfileDietTag.new(profile_diet_tag_params) respond_to do |format| if @profile_diet_tag.save format.html { redirect_to @profile_diet_tag, notice: 'Profile diet tag was successfully created.' } format.json { render :show, status: :created, location: @profile_diet_tag } else format.html { render :new } format.json { render json: @profile_diet_tag.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def profile_diet_tag_params\n params[:profile_diet_tag]\n end", "def set_profile_diet_tag\n @profile_diet_tag = ProfileDietTag.find(params[:id])\n end", "def tag!(params = {})\n self.post params, edge: :tags\n end", "def create\n create_tags = params[:create_tags]\n\t@good = Go...
[ "0.70521736", "0.66481566", "0.6553769", "0.6461527", "0.642987", "0.64071137", "0.6380477", "0.63663846", "0.632313", "0.63159275", "0.6286612", "0.626933", "0.61837506", "0.61769056", "0.61709404", "0.61588347", "0.6151251", "0.6146749", "0.61093503", "0.61013556", "0.60987...
0.73827595
0
PATCH/PUT /profile_diet_tags/1 PATCH/PUT /profile_diet_tags/1.json
def update respond_to do |format| if @profile_diet_tag.update(profile_diet_tag_params) format.html { redirect_to @profile_diet_tag, notice: 'Profile diet tag was successfully updated.' } format.json { render :show, status: :ok, location: @profile_diet_tag } else format.html { render :edit } format.json { render json: @profile_diet_tag.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n begin\n entity = Tagger::EntityTag.create_entity_tags(params)\n render json: { \"#{Tagger.tagged_resource}\": entity, tags: entity.tags }, status: 201\n rescue Exception => e\n render json: { error: \"Unprocessable entity\" }, status: 422\n e...
[ "0.6664996", "0.6643254", "0.66188973", "0.65276206", "0.649324", "0.6489285", "0.64805245", "0.6435596", "0.6403571", "0.6397", "0.63879144", "0.6385376", "0.6372976", "0.6372242", "0.63689464", "0.63621056", "0.632354", "0.63157797", "0.6311971", "0.6301702", "0.62908125", ...
0.71593434
0
DELETE /profile_diet_tags/1 DELETE /profile_diet_tags/1.json
def destroy @profile_diet_tag.destroy respond_to do |format| format.html { redirect_to profile_diet_tags_url, notice: 'Profile diet tag was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_tag tag\n delete \"tag/#{tag}\"\n end", "def destroy\n @taggable = current_user.taggables.find(params[:id])\n\n #destroy each tag in the taggable\n @taggable.tags.each do |tag|\n tag.destroy\n end\n\n @taggable.destroy\n\n respond_to do |format|\n format.html { redirect...
[ "0.69575983", "0.6917325", "0.68746173", "0.68551624", "0.68442327", "0.6834783", "0.6800929", "0.67851555", "0.6774468", "0.6736361", "0.67280346", "0.6727677", "0.67258817", "0.6720031", "0.6709845", "0.6705972", "0.66859263", "0.6683117", "0.6679981", "0.66774035", "0.6661...
0.7578931
0
Use callbacks to share common setup or constraints between actions.
def set_profile_diet_tag @profile_diet_tag = ProfileDietTag.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 profile_diet_tag_params params[:profile_diet_tag] 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
Use callbacks to share common setup or constraints between actions.
def set_account @account = Account.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 account_params params.require(:account).permit(:email, :encrypted_password, :salt, :last_sync_at) 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
before_filter :update_last_seen_at, :only => :show
def index respond_to do |format| format.html { redirect_to forum_path(params[:forum_id]) } format.xml do @topics = Topic.find_all_by_forum_id(params[:forum_id], :order => 'sticky desc, replied_at desc', :limit => 25) render :xml => @topics.to_xml end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def was_seen!\n update_attribute(:last_seen_at, Time.now) if valid? && (last_seen_at.nil? || last_seen_at < 1.hour.ago)\n end", "def was_seen!\n update_attribute(:last_seen_at, Time.now) if valid? && (last_seen_at.nil? || last_seen_at < 1.hour.ago)\n end", "def viewed_at\n updated_at\n end", "def...
[ "0.7009162", "0.7009162", "0.6892341", "0.68316686", "0.6828579", "0.6606349", "0.6562749", "0.64104813", "0.6406043", "0.63564503", "0.63564503", "0.63564503", "0.62944305", "0.62548494", "0.61858785", "0.6168058", "0.6138408", "0.6129267", "0.6103182", "0.6084197", "0.60668...
0.0
-1
Retrieves a list of the most active, unabused topics
def active options = {} options[:per_page] = 25 options[:select] = "topic.*, (SELECT COUNT(*) from post WHERE post.topic_id = topic.id AND #{Post.abusive_post_conditions} ) AS posts_count" options[:joins] = 'inner join forum on topic.forum_id = forum.id' options[:order] = 'posts_count desc, replied_at DESC' options[:conditions] = Topic.abusive_topic_conditions @topic_pages, @topics = paginate(:topic, options) @users = Sfcontact.find(:all, :select => 'distinct *', :conditions => ['sf_id in (?)', @topics.map { |t| t.posts.first }.collect(&:user_id).uniq]).index_by(&:id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def popular_topics\n topics = []\n results = repository.adapter.select('SELECT t.id, t.name, COUNT(*) count FROM topics t INNER JOIN messages m ON t.id = m.topic_id GROUP BY t.id ORDER BY COUNT(*) DESC')\n \n # Loop over aggregate results\n results.each do |result|\n topic = Topic.g...
[ "0.7807402", "0.7454949", "0.7272122", "0.7202532", "0.7202532", "0.7189076", "0.71268165", "0.7018799", "0.69083947", "0.6895069", "0.68866915", "0.6846084", "0.682053", "0.67861533", "0.67801267", "0.67687625", "0.67631", "0.67323065", "0.67304164", "0.671745", "0.6689151",...
0.0
-1
required instance methods for Contactable items
def email nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contact; end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def c...
[ "0.65783453", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.6225204", "0.61649895", "0.6127475", "0.6127475", "0.6068426", "0.6068426", "0.60682535", ...
0.0
-1
TODO: separate apply_changes! and import!
def import! return unless imported? or updated? Outgoing::Workcamp.transaction do import_changes.each do |change| change.apply(self) change.destroy end self.state = nil save! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_and_import\n transform_files\n import\n end", "def post_import\n end", "def import()\n # TODO\n end", "def import\n end", "def import\n end", "def import\n end", "def import\n end", "def before_import ; end", "def import!\n import_binary_files\n member_id...
[ "0.652848", "0.6454858", "0.6441292", "0.6432445", "0.6432445", "0.6432445", "0.6432445", "0.6399303", "0.6398597", "0.6259397", "0.62538636", "0.62201315", "0.59568655", "0.59442264", "0.58364415", "0.58067614", "0.5786837", "0.57164264", "0.5630557", "0.5605964", "0.5600712...
0.6985719
1
Use callbacks to share common setup or constraints between actions.
def set_manager_hour @manager_hour = ManagerHour.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a trusted parameter "white list" through.
def manager_hour_params params.fetch(:manager_hour, {}) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
puts " "4 + ""1 + " "2 + ""1 puts " "3 + ""2 + " "2 + ""2 puts " "2 + ""3 + " "2 + ""3 puts " "1 + ""4 + " "2 + ""4 puts " "0 + ""5 + " "2 + ""5 end pyramid
def pyramid(height) level = 1 height.times do puts " "*(height-level) + "#"*level + " "*2 + "#"*level level += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pyramid(height)\n height.times do |n|\n print ' ' * (height - n)\n puts '#' * (2 * n + 1)\n end\n\nend", "def pyramid(n)\n count = 1\n n.times do\n puts (\" \" * (n - count)) + (\"#\" * count)\n count += 1\n end\nend", "def wtf_pyramid\n\tputs \"*\" * 50\n\tputs\"Salut, Bienvenue dans ma s...
[ "0.86940897", "0.8581337", "0.8279244", "0.8246566", "0.8187696", "0.79911286", "0.79540455", "0.7868794", "0.78534204", "0.7844643", "0.77921313", "0.7789721", "0.7712014", "0.7622058", "0.7479663", "0.74607706", "0.7357109", "0.7329457", "0.72568244", "0.7231937", "0.718992...
0.87041426
0
def answer(four_colors) if four_colors == correct p 'Winner!' else p 'Try again, or press q to quit' end end
def random_colors color_array = [] 4.times {color_array.push @colors.sample} color_array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def boolean_answers_person(player, player_result, right_result, dsp_result)\n # condition matching the player result with right result\n if player_result == right_result\n system(\"clear\")\n view_current\n puts \"You picked: \\n#{dsp_result}\"\n puts Paint[\"Woo! Correct!\" + \" \\u{2705...
[ "0.7306587", "0.7223264", "0.7190962", "0.71755385", "0.7027915", "0.7003653", "0.68658197", "0.6850116", "0.6820052", "0.6810048", "0.6801524", "0.6763937", "0.673099", "0.66904426", "0.6686171", "0.6658542", "0.66372967", "0.6617681", "0.6617028", "0.6604415", "0.65925765",...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_photo @photo = Photo.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a trusted parameter "white list" through.
def photo_params params.require(:photo).permit(:data) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
TODO: and numeric digits that occur more than once in the input string. TODO: The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.
def duplicate_count(text) # create an array with properly formatted elements letters = text.downcase.split('') # make the hash deafult to 0 so that += will work correctly stats = Hash.new(0) # iterate over the array and count number of times each letter occur letters.each {|letter| stats[letter] += 1} # delete key-value pairs from the hash which occur only once stats.delete_if {|key, value| value == 1} # return the number of remaining key-value pairs return stats.values.count end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_number(str)\n\t\tif !str.nil? && !str.blank?\n\t\t\tchrs = ('a'..'z').to_a\n\t\t\tchrs << \" \"\n\t\t\tstr.split(\"\").each do |n|\n\t\t\t\treturn false if chrs.include? n\n\t\t\tend\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "def string_cleaner(str)\n\tnew_string = \"\"\n\tstr.eac...
[ "0.66625494", "0.6660337", "0.6615773", "0.65203", "0.650181", "0.64948505", "0.6468896", "0.645902", "0.64578456", "0.64225", "0.6405384", "0.63891083", "0.6350975", "0.6339652", "0.63254076", "0.6251905", "0.6247138", "0.62456745", "0.6244465", "0.62170213", "0.62088597", ...
0.0
-1
Keep the minimum value between memo and val, ignoring nil
def _happens(memo, val) memo.nil? ? val : (val.nil? ? memo : (memo < val ? memo : val)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def min\n self.reduce('lambda{|memo, item| memo < item ? memo : item }')\n end", "def minimum_value\n @minimum_value || store.min\n end", "def min_value\n if @head.nil?\n return nil\n else\n if head.left\n min_value = min_search(head.left).data\n else\n min_va...
[ "0.6684925", "0.6631327", "0.6519565", "0.6507411", "0.6507411", "0.6402685", "0.6324474", "0.632148", "0.62807685", "0.62409806", "0.62404114", "0.62130827", "0.6205839", "0.6169184", "0.615579", "0.6140642", "0.60934997", "0.6087237", "0.60590863", "0.6050531", "0.60339797"...
0.61674887
14
Set up the scene
def initialize #Graphics.freeze @closing = false @savequit = false $mouse.change_cursor('Default') sys('open') # Vp @vp = Viewport.new(0,0,$game.width,$game.height) @vp.z = 3500 @snap = Sprite.new(@vp) @snap.z = -101 @snap.bitmap = $game.snapshot # Background @bg = Sprite.new(@vp) @bg.z = -100 #@bg.bitmap = Bitmap.new(640,480) #@bg.bitmap.fill(Color.new(0,0,0,180)) @bg.bitmap = $cache.menu_background("sample") #@bg.bitmap = $cache.menu_background("witch") @bg.opacity = 0 #@bg.y = 30 #@bg.do(seq(go("y",-50,150,:qio),go("y",20,150,:qio))) #self.do(delay(300)) @next_menu = $menu.menu_page $menu.menu_page = nil @menu = nil #Graphics.transition(20,'Graphics/Transitions/trans') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup(args)\n # Camera\n position = Engine3D::Vector.new 0.0, 0.0, 0.0, 1.0\n direction = Engine3D::Vector.new 0.0, 0.0,-1.0, 1.0\n args.state.camera = Engine3D::Camera.new position, direction\n \n # Renderer :\n args.state.renderer = Engine3D::Render.new 1280, 720, ...
[ "0.74931115", "0.7488075", "0.7136221", "0.71030194", "0.7034423", "0.697745", "0.6782637", "0.67093396", "0.6569276", "0.6569276", "0.6566926", "0.6549831", "0.6541761", "0.64757824", "0.63082474", "0.6305286", "0.6287176", "0.6256981", "0.62273306", "0.6183736", "0.61463267...
0.5757769
44
Send text messages to all participants with their assignment.
def notify_participants participants participants.each do |participant| send_message participant.to_participant_message, participant.phone_number puts "#{participant.name} has received a text message at #{participant.phone_number}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def broadcast_message(text)\n @users.each {|u| u.enqueue_message(text) }\n end", "def send_text_to_members(user)\n message = 'appointment hasa been scheduled'\n assignee = assigned_to.full_name\n service_name = service.name\n case progress\n when 'SCHEDULED'\n message = \"appo...
[ "0.6158091", "0.6051684", "0.58300364", "0.57916594", "0.5719044", "0.570903", "0.56697273", "0.56584173", "0.56578845", "0.5623198", "0.55914986", "0.5588978", "0.55024636", "0.55012864", "0.5483118", "0.54153556", "0.5413055", "0.5402287", "0.5394616", "0.53877956", "0.5369...
0.6919665
0
sends a backup message to a specified phone number with all assignments.
def send_backup_message participants, phone_number intro = "here are the secret santa assignments:\n" message = intro + participants.map(&:to_backup_message).join("\n") send_message message, phone_number puts "a backup of all assignments has been sent to #{phone_number}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def backup_request(client, filename, message)\n filename = \"BACKUP_#{filename}\"\n aFile = File.open(filename, 'w+')\n if aFile\n File.write(filename, message)\n puts \"Updated: #{filename}\"\n else\n client.puts \"ERROR: Unable to open file #{filename}\"\n end\n aFile.close\n ...
[ "0.5719056", "0.57009673", "0.5626111", "0.5570714", "0.5550205", "0.53960043", "0.53849936", "0.53594387", "0.5324955", "0.52405137", "0.52265096", "0.5200432", "0.51921225", "0.5185178", "0.51113886", "0.50760955", "0.50602907", "0.5048155", "0.50281817", "0.50161755", "0.5...
0.7917469
0
TODO Improve function. Avoid using global vars after it works. Specialize and simplify. (it's a prototoype so no pressure to have great code for now... just explore until it works the way I want, then improve.
def parse(parser,i=0,previous_level=0,parent=nil) if i < parser.headlines.count hl = parser.headlines[i] #str = hl.to_s.gsub('*','').gsub(' ','') str = hl.to_s level = hl.level if (level - previous_level == 1) && previous_level != 0 parent = parser.headlines[i-1] $last_parent[level] = parent elsif level == previous_level || level < previous_level parent = $last_parent[level] else parent = nil end #TODO Fix order hl.body_lines.shift #remove title $headlines << {:id => Digest::MD5.hexdigest(hl.to_s), :title => str, :body => hl.body_lines.join("\n"), :level => hl.level, :parent => Digest::MD5.hexdigest(parent.to_s), :tags => hl.tags} if parent unless $children[Digest::MD5.hexdigest(parent.to_s)] $children[Digest::MD5.hexdigest(parent.to_s)] = [] end $children[Digest::MD5.hexdigest(parent.to_s)] << {:title => str, :body => hl.body_lines.join("\n"), :parent => Digest::MD5.hexdigest(parent.to_s)} end parse(parser,i+1,level,parent) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probers; end", "def anchored; end", "def suivre; end", "def terpene; end", "def private; end", "def common\n \n end", "def intensifier; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def schubert; end", "def global; end", "def stderrs; end", "...
[ "0.57370806", "0.55737996", "0.5562205", "0.5500893", "0.54700345", "0.5440704", "0.5410965", "0.535144", "0.535144", "0.535144", "0.535144", "0.53456765", "0.53363", "0.5297218", "0.5167552", "0.5167552", "0.51637214", "0.50997955", "0.5094833", "0.50877243", "0.50777376", ...
0.0
-1
(re) init with given args and frame types
def init(arguments_type, frame_type) raise "Wrong argument type, expect Type not #{arguments_type.class}" unless arguments_type.is_a? Type raise "Wrong frame type, expect Type not #{frame_type.class}" unless frame_type.is_a? Type @arguments_type = arguments_type @frame_type = frame_type @binary = BinaryCode.new(0) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(*args); end", "def build(args={})\n klass = FRAME_TYPE_MAP[args[:type].to_i]\n if(klass == FrameType::Response)\n klass.new(:response => args[:data])\n elsif(klass == FrameType::Error)\n klass.new(:error => args[:data])\n elsif(klass == FrameType::Mess...
[ "0.67121077", "0.6652466", "0.6518489", "0.643161", "0.642996", "0.62745786", "0.6259297", "0.6256564", "0.6185408", "0.6180649", "0.6157157", "0.6140022", "0.6109725", "0.6101269", "0.60784936", "0.6067755", "0.6067755", "0.6067755", "0.6067755", "0.6067755", "0.6046578", ...
0.74155045
0
determine if method has a local variable or tmp (anonymous local) by given name
def has_local( name ) raise "has_local #{name}.#{name.class}" unless name.is_a? Symbol @frame_type.variable_index( name ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_local name\n raise \"has_local #{name}.#{name.class}\" unless name.is_a? Symbol\n index = self.locals.index_of(name)\n index = self.tmps.index_of(name) unless index\n index\n end", "def has_local name\n raise \"has_local #{name}.#{name.class}\" unless name.is_a? Symbol\n ...
[ "0.7665879", "0.70041084", "0.6953241", "0.68916005", "0.67192", "0.6613709", "0.6534072", "0.6519087", "0.6473429", "0.6448009", "0.63289285", "0.63084507", "0.61489034", "0.6125273", "0.6074033", "0.60447836", "0.6017613", "0.6014759", "0.5972813", "0.593316", "0.5914293", ...
0.7292292
1
GET /child_development_periods GET /child_development_periods.json
def index @child_development_periods = ChildDevelopmentPeriod.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_child_development_period\n @child_development_period = ChildDevelopmentPeriod.find(params[:id])\n end", "def index\n @child_developments = ChildDevelopment.all\n end", "def create\n @child_development_period = ChildDevelopmentPeriod.new(child_development_period_params)\n\n respond_to ...
[ "0.69758034", "0.640947", "0.6390286", "0.61557466", "0.6085102", "0.6001446", "0.59693027", "0.590505", "0.573719", "0.57259434", "0.5722979", "0.5598566", "0.55977863", "0.55829626", "0.55794066", "0.55002415", "0.5474265", "0.54159534", "0.5414544", "0.5394703", "0.5366093...
0.8194255
0
GET /child_development_periods/1 GET /child_development_periods/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @child_development_periods = ChildDevelopmentPeriod.all\n end", "def set_child_development_period\n @child_development_period = ChildDevelopmentPeriod.find(params[:id])\n end", "def create\n @child_development_period = ChildDevelopmentPeriod.new(child_development_period_params)\n\n ...
[ "0.7934444", "0.7211188", "0.65740633", "0.63557047", "0.633685", "0.60424984", "0.5898331", "0.5854599", "0.5839756", "0.57877547", "0.5761473", "0.5726164", "0.5636131", "0.5629196", "0.5533334", "0.5504973", "0.5401757", "0.53844196", "0.53558743", "0.53556937", "0.5343835...
0.0
-1
POST /child_development_periods POST /child_development_periods.json
def create @child_development_period = ChildDevelopmentPeriod.new(child_development_period_params) respond_to do |format| if @child_development_period.save format.html { redirect_to @child_development_period, notice: 'Child development period was successfully created.' } format.json { render :show, status: :created, location: @child_development_period } else format.html { render :new } format.json { render json: @child_development_period.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_child_development_period\n @child_development_period = ChildDevelopmentPeriod.find(params[:id])\n end", "def index\n @child_development_periods = ChildDevelopmentPeriod.all\n end", "def child_development_period_params\n params.require(:child_development_period).permit(:date_contol, :we...
[ "0.7117874", "0.70029455", "0.6716167", "0.63868314", "0.63679063", "0.63424206", "0.60324746", "0.58875847", "0.5619923", "0.5458914", "0.5419847", "0.5407736", "0.5393691", "0.53787434", "0.5371079", "0.53701997", "0.5340205", "0.52444357", "0.5240653", "0.5239106", "0.5228...
0.7651888
0
PATCH/PUT /child_development_periods/1 PATCH/PUT /child_development_periods/1.json
def update respond_to do |format| if @child_development_period.update(child_development_period_params) format.html { redirect_to @child_development_period, notice: 'Child development period was successfully updated.' } format.json { render :show, status: :ok, location: @child_development_period } else format.html { render :edit } format.json { render json: @child_development_period.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_child_development_period\n @child_development_period = ChildDevelopmentPeriod.find(params[:id])\n end", "def update\n respond_to do |format|\n if @child_development.update(child_development_params)\n format.html { redirect_to @child_development, notice: 'Child development was succe...
[ "0.67845225", "0.65882975", "0.5952047", "0.5906064", "0.5891917", "0.58800197", "0.5846184", "0.5816103", "0.57868135", "0.57868135", "0.5779291", "0.57763153", "0.57748663", "0.57711303", "0.5764872", "0.57530135", "0.569453", "0.569018", "0.5684128", "0.56793714", "0.56503...
0.7338058
0
DELETE /child_development_periods/1 DELETE /child_development_periods/1.json
def destroy @child_development_period.destroy respond_to do |format| format.html { redirect_to child_development_periods_url, notice: 'Child development period was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @child_development.destroy\n respond_to do |format|\n format.html { redirect_to child_developments_url, notice: 'Child development was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @time_period.destroy\n format.json { head :no_c...
[ "0.67801195", "0.6630352", "0.65738904", "0.630415", "0.6274035", "0.6260299", "0.6245592", "0.62078804", "0.62060404", "0.62027586", "0.6199362", "0.6194493", "0.6173129", "0.616686", "0.61606044", "0.61487687", "0.61401623", "0.61256933", "0.6103577", "0.6099403", "0.609662...
0.7515133
0
Use callbacks to share common setup or constraints between actions.
def set_child_development_period @child_development_period = ChildDevelopmentPeriod.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 child_development_period_params params.require(:child_development_period).permit(:date_contol, :weight, :size, :head_circunference, :child_id, :child_development_id, :medical_center_id, :doctor_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Update an existing LDAP identity source Update the configuration of an existing LDAP identity source. You may wish to verify the new configuration using the POST /aaa/ldapidentitysources?action=probe API before changing the configuration.
def create_or_update_ldap_identity_source(ldap_identity_source_id, ldap_identity_source, opts = {}) data, _status_code, _headers = create_or_update_ldap_identity_source_with_http_info(ldap_identity_source_id, ldap_identity_source, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_or_update_ldap_identity_source_with_http_info(ldap_identity_source_id, ldap_identity_source, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.create_or_update_ldap_identity_source ......
[ "0.62206554", "0.6021797", "0.5928674", "0.58621365", "0.58536536", "0.5799265", "0.5799265", "0.5796554", "0.57776475", "0.57416844", "0.5730712", "0.571053", "0.57081944", "0.5688139", "0.56732684", "0.5635068", "0.5635068", "0.56345046", "0.5632087", "0.5632087", "0.562647...
0.5492074
30
Update an existing LDAP identity source Update the configuration of an existing LDAP identity source. You may wish to verify the new configuration using the POST /aaa/ldapidentitysources?action&x3D;probe API before changing the configuration.
def create_or_update_ldap_identity_source_with_http_info(ldap_identity_source_id, ldap_identity_source, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.create_or_update_ldap_identity_source ...' end # verify the required parameter 'ldap_identity_source_id' is set if @api_client.config.client_side_validation && ldap_identity_source_id.nil? fail ArgumentError, "Missing the required parameter 'ldap_identity_source_id' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.create_or_update_ldap_identity_source" end # verify the required parameter 'ldap_identity_source' is set if @api_client.config.client_side_validation && ldap_identity_source.nil? fail ArgumentError, "Missing the required parameter 'ldap_identity_source' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.create_or_update_ldap_identity_source" end # resource path local_var_path = '/aaa/ldap-identity-sources/{ldap-identity-source-id}'.sub('{' + 'ldap-identity-source-id' + '}', ldap_identity_source_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(ldap_identity_source) 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 => 'LdapIdentitySource') if @api_client.config.debugging @api_client.config.logger.debug "API called: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#create_or_update_ldap_identity_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_d_b_source(project_name, source_name, optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'PUT'\n\t\targs[:path]['ProjectName'] = project_name\n\t\targs[:path]['SourceName'] = source_name\n\t\targs[:pattern] = '/projects/[ProjectName]/sources/[SourceName]'\n\t\targs[:query]['Action'] = '...
[ "0.59991425", "0.5871316", "0.5868173", "0.58411664", "0.58411664", "0.58009285", "0.5790004", "0.5766625", "0.57663774", "0.5713809", "0.5705056", "0.56901103", "0.5675639", "0.5654438", "0.5643843", "0.56350017", "0.56350017", "0.5630999", "0.5630999", "0.5622461", "0.56220...
0.6223852
0
Delete an LDAP identity source Delete an LDAP identity source. Users defined in that source will no longer be able to access NSX.
def delete_ldap_identity_source(ldap_identity_source_id, opts = {}) delete_ldap_identity_source_with_http_info(ldap_identity_source_id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_ldap_identity_source_with_http_info(ldap_identity_source_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.delete_ldap_identity_source ...'\n end\n # verify the required ...
[ "0.6723568", "0.6233082", "0.61297023", "0.59645885", "0.5926988", "0.5892196", "0.5750985", "0.57506543", "0.5746354", "0.57235134", "0.5718202", "0.5718202", "0.5718202", "0.5718202", "0.57054794", "0.57052445", "0.5684634", "0.5679185", "0.5638329", "0.5606411", "0.5597102...
0.70585525
0
Delete an LDAP identity source Delete an LDAP identity source. Users defined in that source will no longer be able to access NSX.
def delete_ldap_identity_source_with_http_info(ldap_identity_source_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.delete_ldap_identity_source ...' end # verify the required parameter 'ldap_identity_source_id' is set if @api_client.config.client_side_validation && ldap_identity_source_id.nil? fail ArgumentError, "Missing the required parameter 'ldap_identity_source_id' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.delete_ldap_identity_source" end # resource path local_var_path = '/aaa/ldap-identity-sources/{ldap-identity-source-id}'.sub('{' + 'ldap-identity-source-id' + '}', ldap_identity_source_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: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#delete_ldap_identity_source\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_ldap_identity_source(ldap_identity_source_id, opts = {})\n delete_ldap_identity_source_with_http_info(ldap_identity_source_id, opts)\n nil\n end", "def destroy\n return false if @label.to_s.empty?\n\n response = delete(\"/2.0/accounts/#{@account_id}/sources/#{@label}\")\n @...
[ "0.70582306", "0.6231639", "0.61289907", "0.596344", "0.5927216", "0.5892083", "0.575091", "0.5750589", "0.5746151", "0.5722867", "0.57174736", "0.57174736", "0.57174736", "0.57174736", "0.5705863", "0.57056266", "0.56840503", "0.5678719", "0.5637872", "0.56053716", "0.559638...
0.672373
1
Fetch the server certificate of an LDAP server Attempt to connect to an LDAP server and retrieve the server certificate it presents.
def fetch_identity_source_ldap_server_certificate_fetch_certificate(identity_source_ldap_server_endpoint, opts = {}) data, _status_code, _headers = fetch_identity_source_ldap_server_certificate_fetch_certificate_with_http_info(identity_source_ldap_server_endpoint, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ldap_server\n get_attribute_from_auth_source('host')\n end", "def server_cert_from_spec(spec)\n if spec[:server_certificate]\n spec[:server_certificate]\n elsif spec[:ssl_certificate_id]\n spec[:ssl_certificate_id]\n else\n nil\n end\n end", "def ldap_connect...
[ "0.62266874", "0.6185673", "0.6164346", "0.6135415", "0.61141545", "0.60927397", "0.60395366", "0.59357697", "0.5927438", "0.5907095", "0.59048176", "0.5898186", "0.5868905", "0.57577205", "0.5673497", "0.565986", "0.56488395", "0.5608903", "0.55968666", "0.5588238", "0.55717...
0.5811374
13
Fetch the server certificate of an LDAP server Attempt to connect to an LDAP server and retrieve the server certificate it presents.
def fetch_identity_source_ldap_server_certificate_fetch_certificate_with_http_info(identity_source_ldap_server_endpoint, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.fetch_identity_source_ldap_server_certificate_fetch_certificate ...' end # verify the required parameter 'identity_source_ldap_server_endpoint' is set if @api_client.config.client_side_validation && identity_source_ldap_server_endpoint.nil? fail ArgumentError, "Missing the required parameter 'identity_source_ldap_server_endpoint' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.fetch_identity_source_ldap_server_certificate_fetch_certificate" end # resource path local_var_path = '/aaa/ldap-identity-sources?action=fetch_certificate' # 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(identity_source_ldap_server_endpoint) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PeerCertificateChain') if @api_client.config.debugging @api_client.config.logger.debug "API called: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#fetch_identity_source_ldap_server_certificate_fetch_certificate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ldap_server\n get_attribute_from_auth_source('host')\n end", "def server_cert_from_spec(spec)\n if spec[:server_certificate]\n spec[:server_certificate]\n elsif spec[:ssl_certificate_id]\n spec[:ssl_certificate_id]\n else\n nil\n end\n end", "def ldap_connect...
[ "0.62266874", "0.6185673", "0.6164346", "0.6135415", "0.61141545", "0.60927397", "0.60395366", "0.59357697", "0.5907095", "0.59048176", "0.5898186", "0.5868905", "0.5811374", "0.57577205", "0.5673497", "0.565986", "0.56488395", "0.5608903", "0.55968666", "0.5588238", "0.55717...
0.5927438
8
List LDAP identity sources Return a list of all configured LDAP identity sources.
def list_ldap_identity_sources(opts = {}) data, _status_code, _headers = list_ldap_identity_sources_with_http_info(opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_ldap_identity_sources_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.list_ldap_identity_sources ...'\n end\n if @api_client.config.client_side_validation && !...
[ "0.63612556", "0.622355", "0.593756", "0.58011377", "0.5699125", "0.5532021", "0.5532021", "0.55220413", "0.5519219", "0.54380757", "0.54123676", "0.53952926", "0.5388987", "0.5300855", "0.52596927", "0.52528185", "0.522744", "0.52056587", "0.5184532", "0.5147061", "0.5123818...
0.84067184
0
List LDAP identity sources Return a list of all configured LDAP identity sources.
def list_ldap_identity_sources_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.list_ldap_identity_sources ...' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.list_ldap_identity_sources, must be smaller than or equal to 1000.' end if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.list_ldap_identity_sources, must be greater than or equal to 0.' end # resource path local_var_path = '/aaa/ldap-identity-sources' # query parameters query_params = {} query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil? query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil? # 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(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'LdapIdentitySourceListResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#list_ldap_identity_sources\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_ldap_identity_sources(opts = {})\n data, _status_code, _headers = list_ldap_identity_sources_with_http_info(opts)\n data\n end", "def get_authentication_sources(opts = {})\n data, _status_code, _headers = get_authentication_sources_with_http_info(opts)\n data\n end", "def lis...
[ "0.84067184", "0.622355", "0.593756", "0.58011377", "0.5699125", "0.5532021", "0.5532021", "0.55220413", "0.5519219", "0.54380757", "0.54123676", "0.53952926", "0.5388987", "0.5300855", "0.52596927", "0.52528185", "0.522744", "0.52056587", "0.5184532", "0.5147061", "0.5123818...
0.63612556
1
Test the configuration of an existing LDAP identity source Attempt to connect to an existing LDAP identity source and report any errors encountered.
def probe_configured_ldap_identity_source_probe(ldap_identity_source_id, opts = {}) data, _status_code, _headers = probe_configured_ldap_identity_source_probe_with_http_info(ldap_identity_source_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_connection\n ldap_con = initialize_ldap_con(self.account, self.account_password)\n ldap_con.open { }\n rescue Net::LDAP::LdapError => text\n raise \"LdapError: %s\" % text\n end", "def test_connection\n\t\tldap_con = initialize_ldap_con(self.account, self.encrypted_password)\n\t\tldap_con.ope...
[ "0.66293675", "0.64491415", "0.5752266", "0.572403", "0.56161594", "0.554347", "0.5311181", "0.525187", "0.5211923", "0.5192988", "0.5178791", "0.5158011", "0.5128041", "0.51246667", "0.50987667", "0.50920224", "0.50909466", "0.5079398", "0.50651455", "0.5054469", "0.5025407"...
0.49810985
22
Test the configuration of an existing LDAP identity source Attempt to connect to an existing LDAP identity source and report any errors encountered.
def probe_configured_ldap_identity_source_probe_with_http_info(ldap_identity_source_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.probe_configured_ldap_identity_source_probe ...' end # verify the required parameter 'ldap_identity_source_id' is set if @api_client.config.client_side_validation && ldap_identity_source_id.nil? fail ArgumentError, "Missing the required parameter 'ldap_identity_source_id' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.probe_configured_ldap_identity_source_probe" end # resource path local_var_path = '/aaa/ldap-identity-sources/{ldap-identity-source-id}?action=probe'.sub('{' + 'ldap-identity-source-id' + '}', ldap_identity_source_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(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'LdapIdentitySourceProbeResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#probe_configured_ldap_identity_source_probe\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_connection\n ldap_con = initialize_ldap_con(self.account, self.account_password)\n ldap_con.open { }\n rescue Net::LDAP::LdapError => text\n raise \"LdapError: %s\" % text\n end", "def test_connection\n\t\tldap_con = initialize_ldap_con(self.account, self.encrypted_password)\n\t\tldap_con.ope...
[ "0.66293675", "0.64491415", "0.5752266", "0.572403", "0.56161594", "0.554347", "0.5311181", "0.5211923", "0.5192988", "0.5178791", "0.5158011", "0.5128041", "0.51246667", "0.50987667", "0.50920224", "0.50909466", "0.5079398", "0.50651455", "0.5054469", "0.5025407", "0.4999919...
0.525187
7
Test an LDAP server Attempt to connect to an LDAP server and ensure that the server can be contacted using the given URL and authentication credentials.
def probe_identity_source_ldap_server_probe_ldap_server(identity_source_ldap_server, opts = {}) data, _status_code, _headers = probe_identity_source_ldap_server_probe_ldap_server_with_http_info(identity_source_ldap_server, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_connection\n ldap_con = initialize_ldap_con(self.account, self.account_password)\n ldap_con.open { }\n rescue Net::LDAP::LdapError => text\n raise \"LdapError: %s\" % text\n end", "def connect_to_ldap\r\n begin\r\n @ldap = Net::LDAP.new(:host => @ldap_host,\r\n ...
[ "0.7332496", "0.716179", "0.7016753", "0.6997815", "0.6774702", "0.67350805", "0.6553843", "0.6403802", "0.6242816", "0.6238672", "0.6194347", "0.60718524", "0.6027174", "0.6009716", "0.6002841", "0.5976526", "0.59697014", "0.58843267", "0.58474225", "0.5833461", "0.58297074"...
0.0
-1
Test an LDAP server Attempt to connect to an LDAP server and ensure that the server can be contacted using the given URL and authentication credentials.
def probe_identity_source_ldap_server_probe_ldap_server_with_http_info(identity_source_ldap_server, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.probe_identity_source_ldap_server_probe_ldap_server ...' end # verify the required parameter 'identity_source_ldap_server' is set if @api_client.config.client_side_validation && identity_source_ldap_server.nil? fail ArgumentError, "Missing the required parameter 'identity_source_ldap_server' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.probe_identity_source_ldap_server_probe_ldap_server" end # resource path local_var_path = '/aaa/ldap-identity-sources?action=probe_ldap_server' # 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(identity_source_ldap_server) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'IdentitySourceLdapServerProbeResult') if @api_client.config.debugging @api_client.config.logger.debug "API called: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#probe_identity_source_ldap_server_probe_ldap_server\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_connection\n ldap_con = initialize_ldap_con(self.account, self.account_password)\n ldap_con.open { }\n rescue Net::LDAP::LdapError => text\n raise \"LdapError: %s\" % text\n end", "def connect_to_ldap\r\n begin\r\n @ldap = Net::LDAP.new(:host => @ldap_host,\r\n ...
[ "0.73327774", "0.71625626", "0.701722", "0.6998361", "0.6775667", "0.67354745", "0.65543354", "0.64039254", "0.6243879", "0.62393695", "0.6194514", "0.6072402", "0.6027921", "0.60106206", "0.60029", "0.5978302", "0.59705025", "0.5884109", "0.58482414", "0.58342403", "0.582987...
0.0
-1
Probe an LDAP identity source Verify that the configuration of an LDAP identity source is correct before actually creating the source.
def probe_unconfigured_ldap_identity_source_probe_identity_source(ldap_identity_source, opts = {}) data, _status_code, _headers = probe_unconfigured_ldap_identity_source_probe_identity_source_with_http_info(ldap_identity_source, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probe_unconfigured_ldap_identity_source_probe_identity_source_with_http_info(ldap_identity_source, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.probe_unconfigured_ldap_identity_source_pr...
[ "0.68749434", "0.6635697", "0.6583088", "0.6053089", "0.5782503", "0.55669475", "0.5522772", "0.5063628", "0.5029683", "0.4997031", "0.4904828", "0.48154947", "0.4751302", "0.47235876", "0.46993345", "0.46986765", "0.4696389", "0.46951333", "0.46795785", "0.46706608", "0.4652...
0.64369255
3
Probe an LDAP identity source Verify that the configuration of an LDAP identity source is correct before actually creating the source.
def probe_unconfigured_ldap_identity_source_probe_identity_source_with_http_info(ldap_identity_source, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.probe_unconfigured_ldap_identity_source_probe_identity_source ...' end # verify the required parameter 'ldap_identity_source' is set if @api_client.config.client_side_validation && ldap_identity_source.nil? fail ArgumentError, "Missing the required parameter 'ldap_identity_source' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.probe_unconfigured_ldap_identity_source_probe_identity_source" end # resource path local_var_path = '/aaa/ldap-identity-sources?action=probe_identity_source' # 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(ldap_identity_source) auth_names = ['BasicAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'LdapIdentitySourceProbeResults') if @api_client.config.debugging @api_client.config.logger.debug "API called: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#probe_unconfigured_ldap_identity_source_probe_identity_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probe_configured_ldap_identity_source_probe_with_http_info(ldap_identity_source_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.probe_configured_ldap_identity_source_probe ...'\n e...
[ "0.6635697", "0.6583088", "0.64369255", "0.6053089", "0.5782503", "0.55669475", "0.5522772", "0.5063628", "0.5029683", "0.4997031", "0.4904828", "0.48154947", "0.4751302", "0.47235876", "0.46993345", "0.46986765", "0.4696389", "0.46951333", "0.46795785", "0.46706608", "0.4652...
0.68749434
0
Read a single LDAP identity source Return details about one LDAP identity source
def read_ldap_identity_source(ldap_identity_source_id, opts = {}) data, _status_code, _headers = read_ldap_identity_source_with_http_info(ldap_identity_source_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_ldap_identity_source_with_http_info(ldap_identity_source_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.read_ldap_identity_source ...'\n end\n # verify the required para...
[ "0.6929651", "0.6626802", "0.61915314", "0.59994817", "0.599063", "0.588267", "0.585672", "0.58158505", "0.56406635", "0.5612808", "0.5599504", "0.5595735", "0.55811137", "0.5580492", "0.55786854", "0.5471295", "0.5376232", "0.53758705", "0.53758705", "0.53758705", "0.5375870...
0.6827542
1
Read a single LDAP identity source Return details about one LDAP identity source
def read_ldap_identity_source_with_http_info(ldap_identity_source_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.read_ldap_identity_source ...' end # verify the required parameter 'ldap_identity_source_id' is set if @api_client.config.client_side_validation && ldap_identity_source_id.nil? fail ArgumentError, "Missing the required parameter 'ldap_identity_source_id' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.read_ldap_identity_source" end # resource path local_var_path = '/aaa/ldap-identity-sources/{ldap-identity-source-id}'.sub('{' + 'ldap-identity-source-id' + '}', ldap_identity_source_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(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'LdapIdentitySource') if @api_client.config.debugging @api_client.config.logger.debug "API called: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#read_ldap_identity_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_ldap_identity_source(ldap_identity_source_id, opts = {})\n data, _status_code, _headers = read_ldap_identity_source_with_http_info(ldap_identity_source_id, opts)\n data\n end", "def show\n @ldap_auth_header = Irm::LdapAuthHeader.list_all.find(params[:id])\n puts @ldap_auth_header.ldap...
[ "0.6827542", "0.6626802", "0.61915314", "0.59994817", "0.599063", "0.588267", "0.585672", "0.58158505", "0.56406635", "0.5612808", "0.5599504", "0.5595735", "0.55811137", "0.5580492", "0.55786854", "0.5471295", "0.5376232", "0.53758705", "0.53758705", "0.53758705", "0.5375870...
0.6929651
0
Search the LDAP identity source Search the LDAP identity source for users and groups that match the given filter_value. In most cases, the LDAP source performs a caseinsensitive search.
def search_ldap_identity_source(ldap_identity_source_id, opts = {}) data, _status_code, _headers = search_ldap_identity_source_with_http_info(ldap_identity_source_id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(basedn, scope, deref, filter)\n #raise LDAP::ResultError::UnwillingToPerform, \"Bad base DN\" unless basedn == BASEDN\n #raise LDAP::ResultError::UnwillingToPerform, \"Bad filter\" unless filter[0..1] == [:eq, \"uid\"]\n uid = filter[3]\n @@pool.borrow do |sql|\n q = \"select login_id,p...
[ "0.6211908", "0.5757533", "0.5701406", "0.5689939", "0.5651422", "0.5638755", "0.5631808", "0.55178046", "0.5498491", "0.5498253", "0.5439008", "0.5393417", "0.53746533", "0.5328625", "0.52728313", "0.5264735", "0.5264735", "0.52619094", "0.52588075", "0.5253779", "0.5244372"...
0.5224638
22
Search the LDAP identity source Search the LDAP identity source for users and groups that match the given filter_value. In most cases, the LDAP source performs a caseinsensitive search.
def search_ldap_identity_source_with_http_info(ldap_identity_source_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.search_ldap_identity_source ...' end # verify the required parameter 'ldap_identity_source_id' is set if @api_client.config.client_side_validation && ldap_identity_source_id.nil? fail ArgumentError, "Missing the required parameter 'ldap_identity_source_id' when calling SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi.search_ldap_identity_source" end # resource path local_var_path = '/aaa/ldap-identity-sources/{ldap-identity-source-id}/search'.sub('{' + 'ldap-identity-source-id' + '}', ldap_identity_source_id.to_s) # query parameters query_params = {} query_params[:'filter_value'] = opts[:'filter_value'] if !opts[:'filter_value'].nil? # 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(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'LdapIdentitySourceSearchResultList') if @api_client.config.debugging @api_client.config.logger.debug "API called: SystemAdministrationSettingsUserManagementLDAPIdentitySourcesApi#search_ldap_identity_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(basedn, scope, deref, filter)\n #raise LDAP::ResultError::UnwillingToPerform, \"Bad base DN\" unless basedn == BASEDN\n #raise LDAP::ResultError::UnwillingToPerform, \"Bad filter\" unless filter[0..1] == [:eq, \"uid\"]\n uid = filter[3]\n @@pool.borrow do |sql|\n q = \"select login_id,p...
[ "0.6211908", "0.5757533", "0.5701406", "0.5689939", "0.5651422", "0.5638755", "0.5631808", "0.55178046", "0.5498253", "0.5439008", "0.5393417", "0.53746533", "0.5328625", "0.52728313", "0.5264735", "0.5264735", "0.52619094", "0.52588075", "0.5253779", "0.5244372", "0.5232043"...
0.5498491
8
Gets recommended topics for the user based on the topics he have visited
def recommended_topics(limit = 10) visited_topics.joins(:topic).where('topics.language = ?', I18n.locale).group('topic_id').order("visits DESC, updated_at DESC").limit(limit).map(&:topic).map { |t| t.find_related_tags.limit(2) }.flatten.uniq[0...limit] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_suggested_topics(assignment_id)\n team_id = TeamsUser.team_id(assignment_id, session[:user].id)\n teams_users = TeamsUser.where(team_id: team_id)\n teams_users_array = Array.new\n teams_users.each do |teams_user|\n teams_users_array << teams_user.user_id\n end\n @suggested_topics = S...
[ "0.69905466", "0.69010246", "0.6765958", "0.67455447", "0.66843027", "0.6620959", "0.65781856", "0.65252274", "0.6485533", "0.645811", "0.6428915", "0.6315805", "0.6315805", "0.6312051", "0.63070834", "0.62557745", "0.62521315", "0.62454796", "0.62250453", "0.6214372", "0.621...
0.72970647
0
Get if is a new user or not
def new_user? self.created_at > 1.month.ago end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new?\n @user\n end", "def new?(user)\n not read? and user != sender\n end", "def create?\n @user != nil\n end", "def create?\n user.present?\n end", "def create?\n user.present?\n end", "def create?\n user.present?\n end", "def create?\n\t\t!@user.nil?\n\tend", "def create...
[ "0.76083463", "0.7112065", "0.710109", "0.7097605", "0.7097605", "0.7097605", "0.70500624", "0.69911754", "0.6977029", "0.693427", "0.686162", "0.68191147", "0.68150294", "0.67663866", "0.67612106", "0.6751757", "0.670841", "0.6693662", "0.668555", "0.667204", "0.667204", "...
0.7170557
1
Get if the user already thanked the topic specified
def already_thanked?(topic) notification = Notification.thanked_by(self.id, topic.id) !notification.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def own_topic?(topic)\n topic.read_attribute(:user_id) == self.id\n end", "def thanked_by?(user)\n result = self.notifications.where(:sender_id => user.id)\n !result.empty?\n end", "def owned_topic\n unless current_user.id == @topic.user_id\n flash[:alert] = \"Opps! You don't have permis...
[ "0.7276717", "0.70956945", "0.6707058", "0.644437", "0.64084655", "0.64084655", "0.63783264", "0.63043135", "0.6234976", "0.62336546", "0.62186545", "0.62170166", "0.61582786", "0.611688", "0.60926855", "0.6092574", "0.6067959", "0.60553133", "0.60386765", "0.6030413", "0.602...
0.8361982
0
Get if the user already welcomed the user specified
def already_welcomed?(user) notification = Notification.welcomed_by(self.id, user.id) !notification.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def thanked_by?(user)\n result = self.notifications.where(:sender_id => user.id)\n !result.empty?\n end", "def participates?(user)\n author == user || receiver == user\n end", "def mentioned?(user)\n @mentions.include?(user)\n end", "def invite?\r\n admin? or (user.id != user_record.i...
[ "0.69823694", "0.68208206", "0.66220576", "0.6607415", "0.6586578", "0.6553506", "0.6491558", "0.645393", "0.64099234", "0.640093", "0.63703245", "0.63408333", "0.6307273", "0.6306157", "0.6305431", "0.62882847", "0.6269986", "0.6244351", "0.62284493", "0.62214047", "0.621731...
0.7975654
0
Adds a subscription for the user to the given topic
def subscribe_to(topic) StreamUser.create(:user => self, :stream_message => topic.stream_messages.last, :source => 'followed') if topic.stream_messages.last subscriptions << Subscription.new(:topic => topic) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscribe!(topic)\n subscriptions.create!( :topic_id => topic.id )\n end", "def subscribe_to_topic(tokens, topic)\n make_topic_mgmt_request(tokens, topic, \"batchAdd\")\n end", "def subscribe_author\n self.subscriptions.create user_id: self.user.id\n end", "def subscribe(_topic, *...
[ "0.81512696", "0.7070888", "0.7040874", "0.70373267", "0.67486745", "0.66825444", "0.663919", "0.6626898", "0.6621064", "0.66059786", "0.6599181", "0.6571987", "0.65571517", "0.6556943", "0.65291584", "0.64855635", "0.6478466", "0.645491", "0.64543647", "0.6447197", "0.638413...
0.8117725
1
Removes subscriptions for this user to the given topic
def unsubscribe_from(topic) subscriptions.find_by_topic_id(topic.id).try(:destroy) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsubscribe_from_topic(tokens, topic)\n make_topic_mgmt_request(tokens, topic, \"batchRemove\")\n end", "def destroy\n topic = Topic.find params[:id]\n user_topic = current_user.user_topics.find_by!(topic_id: topic.id)\n user_topic.destroy\n\n respond_to do |format|\n ...
[ "0.78070605", "0.7528983", "0.7261029", "0.69946027", "0.6703463", "0.66892874", "0.65922135", "0.6569172", "0.65643096", "0.6481982", "0.641013", "0.6405847", "0.6399709", "0.63749194", "0.6328091", "0.6282876", "0.6281427", "0.62758833", "0.62713367", "0.6254413", "0.623343...
0.82400113
0
Finds subscription to the given topic
def subscription_for(topic) subscriptions.where(:topic_id => topic.id).first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_topic(topic)\n @subscription_group.topics.find(topic) || raise(Errors::TopicNotFoundError, topic)\n end", "def find_topic\n @topic = current_user.topics.find(params[:topic_id])\n end", "def find_topic\n @topic = current_user.topics.find(params[:topic_id])\n end", "def subscribe!(...
[ "0.7928342", "0.7137102", "0.7137102", "0.70296943", "0.7007277", "0.6946221", "0.69441426", "0.68553925", "0.67524695", "0.6596232", "0.6556846", "0.65511703", "0.6510501", "0.6493501", "0.64616305", "0.6346345", "0.6336999", "0.6325711", "0.63208884", "0.63087606", "0.62803...
0.83120275
0
if a user is destroyed change the ownership of its topics to admin
def change_topics_owner self.topics.each do |topic| topic.user = User.where(:is_admin => true).first topic.save! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n# @topic = current_user.topics.find(params[:id])\n @topic = Topic.find(params[:id])\n\n if @topic.owner != current_user\n flash[:notice] = \"You are not OWNER. No Permission!\"\n redirect_to topics_path\n else\n @topic.destroy\n respond_to do |format|\n format.ht...
[ "0.7436648", "0.6806079", "0.6798248", "0.6742251", "0.66281784", "0.6439939", "0.6408619", "0.6371251", "0.63659513", "0.6353874", "0.6349523", "0.6303384", "0.62920004", "0.628072", "0.62624013", "0.6248637", "0.6245208", "0.6244804", "0.6215825", "0.6210043", "0.6186702", ...
0.71738094
1
send notification to participate in a topic
def notify_about_topic!(topic) with_user_locale do UserMailer.topic_match_notification(self, topic).deliver! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topic(channel, str)\n sendmsg \"TOPIC #{channel} :#{str}\"\n end", "def topic(chan, topic)\n sep = $config['plugins/topic/separator', '|']\n chan.server.cmd('TOPIC', chan.name, topic.join(\" #{sep} \"))\n end", "def topic(channel, topic = nil)\n topic = \":#{topic}\" if topic\n send_ms...
[ "0.699971", "0.66226083", "0.6611411", "0.65195584", "0.6487083", "0.6380094", "0.6282782", "0.62392765", "0.6177437", "0.61726207", "0.6136041", "0.61165684", "0.6105603", "0.60867095", "0.60844904", "0.6061362", "0.60434234", "0.60432816", "0.603741", "0.60295355", "0.60226...
0.6643092
1
sends notification for password reset
def notify_password_reset! with_user_locale do reset_single_access_token! UserMailer.password_reset(self).deliver! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_reset_password_instructions\n end", "def send_password_reset_email\n UserNotifier.lost_password(self).deliver_now\n end", "def send_reset_password_instructions()\n generate_reset_password_token! if should_generate_reset_token?\n send_devise_notification(:reset_password_instructions)\n ...
[ "0.82343835", "0.8202745", "0.81396025", "0.8117338", "0.80392057", "0.80153745", "0.7939113", "0.7922726", "0.7920734", "0.7897149", "0.78947204", "0.78713644", "0.78605664", "0.7859448", "0.78477854", "0.78443426", "0.7843522", "0.78365093", "0.7835566", "0.78352946", "0.78...
0.77386653
54
sends notification for sign up confirmation
def notify_sign_up_confirmation! UserMailer.sign_up_confirmation(self).deliver! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_signup_notification\n deliver_activation_email(:signup, :subject => (MaSA[:activation_subject] || \"Please Activate Your Account\") )\n end", "def signup_email\n MnoEnterprise::SystemNotificationMailer.registration_instructions(params.require(:user).require(:email)).deliver_late...
[ "0.8001082", "0.7680669", "0.75045353", "0.750069", "0.74309945", "0.74296886", "0.7428404", "0.7413921", "0.7397638", "0.7385989", "0.73800105", "0.7302603", "0.724891", "0.72397524", "0.7225533", "0.71696067", "0.71642977", "0.71474373", "0.7144565", "0.71250105", "0.712501...
0.7901955
1
sends notification for private message
def notify_private_message!(sender) with_user_locale do UserMailer.private_message_notification(self, sender).deliver! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private_message!\n @private_message = true\n end", "def private_message!\n @private_message = true\n end", "def send_notification\n\n\n end", "def send_new_message_notification\n message = self.message\n # Don't notify the message sender themselves\n return if message.sender_i...
[ "0.70331144", "0.70331144", "0.6963134", "0.6799917", "0.6770256", "0.6685632", "0.6612268", "0.6534004", "0.65101403", "0.64105463", "0.63560504", "0.6347512", "0.63412607", "0.6320071", "0.6310779", "0.6296572", "0.6293065", "0.62656647", "0.6242622", "0.62294364", "0.62201...
0.6795448
4
sets a prize badge or level or whatever reward model for the matter
def set_reward(reward) self.send("current_#{reward.class.to_s.underscore}=",reward) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_prize\n @prize = Prize.find(params[:id])\n @goal = Goal.find(params[:goal_id])\n end", "def set_prize\n @prize = Prize.find(params[:id])\n end", "def set_reward\n @product = current_user.products.find(params[:product_id])\n @reward = @product.rewards.find(params[:id])\n ...
[ "0.64748794", "0.61611515", "0.61373854", "0.60631955", "0.60559595", "0.59019715", "0.5872867", "0.5845035", "0.5845035", "0.5845035", "0.58322287", "0.5792951", "0.57748586", "0.57345194", "0.57338107", "0.5708214", "0.5664037", "0.5664037", "0.5664037", "0.5657174", "0.561...
0.60505587
5
Resets single access token for user
def reset_single_access_token! update_attribute(:single_access_token, User.encrypt_token(Time.now.to_i, "password reset--")) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset\n session.delete(:access_token)\n session.delete(:refresh_token)\n redirect('/auth/gowalla')\n end", "def reset_auth_token!\n reset_auth_token\n save(:validate => false)\n end", "def reset_token\r\n authentication_token true\r\n end", "def reset_authentication_token!\n ...
[ "0.7779253", "0.7520163", "0.7363187", "0.73345065", "0.7310071", "0.728621", "0.72823536", "0.7277697", "0.72747725", "0.7239439", "0.72380817", "0.72291934", "0.7217942", "0.7217228", "0.7105236", "0.70980066", "0.70633", "0.7039718", "0.69984984", "0.6968136", "0.69253993"...
0.8090825
0
Compares passed password with the one encrypted in the database
def authenticate!(psw) User.encrypt_token(psw, password_salt) == encrypted_password end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matching_password?(pass)\n self.password_hash == encrypt_password(pass)\n end", "def password_compare(password, user_id)\n password_digest = db.execute(\"SELECT password_digest FROM users WHERE user_id=?\", user_id)[0][0]\n if BCrypt::Password.new(password_digest) == password\n return true\n...
[ "0.81973064", "0.8186958", "0.81193477", "0.8045274", "0.79478693", "0.78901684", "0.78633374", "0.7793813", "0.778", "0.76952785", "0.768267", "0.7624168", "0.75777113", "0.7572018", "0.7538334", "0.7532243", "0.749292", "0.74659896", "0.7433297", "0.74236596", "0.7398034", ...
0.71865535
64
Scopes a block to the user's profile locale
def with_user_locale raise "No block given" unless block_given? begin tmp_locale = I18n.locale I18n.locale = profile.language yield ensure I18n.locale = tmp_locale end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def locale(locale, &block)\n scope :locale => locale, &block\n end", "def l_scope(*sections, &block)\r\n ArkanisDevelopment::SimpleLocalization::Language.with_app_scope(*sections, &block)\r\n end", "def scope(&block)\n Videojuicer.enter_scope local_config\n block_out = block.call(Vide...
[ "0.6205569", "0.57523596", "0.5596278", "0.5557078", "0.5486455", "0.53251946", "0.52780575", "0.52779925", "0.52670324", "0.52548236", "0.5240761", "0.5231338", "0.5229526", "0.52157927", "0.5202352", "0.5182616", "0.5159665", "0.51307464", "0.5128995", "0.51274276", "0.5125...
0.58253735
1
The name of the field.
def name @gapi.name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def field_name\n @field.name\n end", "def field_name\r\n @field_name ||= begin\r\n %r/(\\w+)Field$/.match(name)[1]\r\n rescue\r\n %r/(\\w+)$/.match(name)[1]\r\n end\r\n end", "def name(value = nil)\n if value\n field_type.name(value)\n else\n ...
[ "0.8847835", "0.838569", "0.8138121", "0.8100964", "0.80348366", "0.7827843", "0.7800643", "0.77403957", "0.75374365", "0.7532276", "0.7502172", "0.73982644", "0.73238385", "0.7297759", "0.72744876", "0.7261315", "0.7189371", "0.7185839", "0.7185839", "0.7181642", "0.71790195...
0.0
-1
Updates the name of the field.
def name= new_name @gapi.update! name: String(new_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_field_name\n self.field = field_name\n end", "def field_name= new_field_name\n frozen_check!\n @gapi.field_name = new_field_name\n end", "def new_name(new_name)\n @name = new_name\n end", "def name_setter(new_name)\n @name = new_name\n end...
[ "0.85042167", "0.7981409", "0.7337001", "0.7323985", "0.72800684", "0.7256678", "0.7232134", "0.7095701", "0.7082548", "0.70709884", "0.70659924", "0.7044868", "0.7044868", "0.7011498", "0.7011498", "0.7011498", "0.7011498", "0.7011498", "0.7011498", "0.7011498", "0.7011498",...
0.7228612
7
The data type of the field.
def type @gapi.type end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_data_type\n get_field_config['type']\n end", "def data_type\n if @data_type\n @data_type\n else\n (@is_string ? String : nil)\n end\n end", "def data_type\n return @data_type\n end", "def type\n field[:type]\n end", "def ...
[ "0.8430979", "0.8326582", "0.82934535", "0.7998151", "0.7971986", "0.7819991", "0.7798819", "0.77840173", "0.7498337", "0.7476232", "0.74703187", "0.74572486", "0.7451391", "0.73127764", "0.7276509", "0.72640145", "0.7225995", "0.7205526", "0.7149492", "0.71407396", "0.713618...
0.0
-1
Updates the data type of the field.
def type= new_type @gapi.update! type: verify_type(new_type) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_type=(value)\n @data_type = value\n end", "def field_type=(value)\n super(value.to_s)\n end", "def update_value_type\n write_attribute :value_type, EavEntry.get_value_type(@value)\n end", "def type=(val)\n\n dtype = val\n #return self if @chars...
[ "0.71815324", "0.6864695", "0.6838144", "0.66620445", "0.6641485", "0.6482189", "0.6478726", "0.6369581", "0.628206", "0.6202365", "0.6202365", "0.6120037", "0.6118188", "0.60513866", "0.60496414", "0.6040707", "0.6029401", "0.6021026", "0.59497344", "0.59194624", "0.5914514"...
0.6427022
7
Checks if the type of the field is `NULLABLE`.
def nullable? mode == "NULLABLE" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def null?(field_info, field)\n field_info[\"notnull\"] == 1 && self.send(field).blank?\n end", "def nullable?\n @nullable\n end", "def nullable?\n @nullable\n end", "def nullable?\n @nullable\n end", "def null?(record)\n type.nullable? && record[:header][:field_nulls][positi...
[ "0.7116849", "0.7033838", "0.7033838", "0.7033838", "0.6741239", "0.67272633", "0.65234756", "0.64722276", "0.6397258", "0.6397258", "0.6327046", "0.6263092", "0.6189515", "0.60874486", "0.60874486", "0.6068387", "0.60558814", "0.60558814", "0.60491836", "0.6020958", "0.59833...
0.7666801
0
Checks if the type of the field is `REQUIRED`.
def required? mode == "REQUIRED" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_required(resource_type)\n result = false\n is_required = property.is_required\n if is_required and value.blank?\n result = true\n errors.add(:value, \"of the field cannot be blank\")\n end\n result\n end", "def required?\n true\n end", "def required(type, name, tag, opt...
[ "0.7840421", "0.7228461", "0.72031933", "0.72031933", "0.7189", "0.71667135", "0.7153553", "0.71464217", "0.71172744", "0.7088425", "0.7073207", "0.7073207", "0.70698524", "0.70698524", "0.70698524", "0.70698524", "0.7026312", "0.7025041", "0.7024866", "0.7022123", "0.7016607...
0.6663567
43
Checks if the type of the field is `REPEATED`.
def repeated? mode == "REPEATED" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def must_recreate\n @args[:___recreate___]\n end", "def validate_task(task, instance, options)\n return true unless options[:task] == \"retire_now\" && instance.retired?\n task.error(\"#{instance.name} is already retired\")\n false\n end", "def temporary?\n !new_record? && valid_un...
[ "0.56279904", "0.55290604", "0.5352991", "0.5344293", "0.5280932", "0.51619273", "0.51452637", "0.5143574", "0.51344734", "0.51068354", "0.5084741", "0.5069809", "0.50224143", "0.5022201", "0.4972323", "0.4969593", "0.49602592", "0.49500215", "0.49348223", "0.4924736", "0.491...
0.6251948
0
The description of the field.
def description @gapi.description end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def description\n field[:description]\n end", "def description\n fields['description']\n end", "def get_description\n get_field_config['description']\n end", "def description\n return @description\n end", "def description\n return @descriptio...
[ "0.91365427", "0.8243952", "0.82154214", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", "0.7922153", ...
0.0
-1
Updates the description of the field.
def description= new_description @gapi.update! description: new_description end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(description) # :nodoc:\n @description = description\n self\n end", "def update(description) # :nodoc:\n @description = description\n self\n end", "def description=(value)\n @description = value\n end", "def description=(value)\n ...
[ "0.7363507", "0.7363507", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", "0.73502105", ...
0.76463753
0
The mode of the field.
def mode @gapi.mode end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mode\n @mode\n end", "def mode\n options[:mode]\n end", "def mode; end", "def mode; end", "def mode; end", "def mode; end", "def mode() @mode ||= detect_mode end", "def get_mode()\n end", "def mode\n Initialize() if @_mode == nil\n\n @_mode\n end", "def mode=...
[ "0.82831115", "0.7741382", "0.75799763", "0.75799763", "0.75799763", "0.75799763", "0.75516474", "0.7516442", "0.7502006", "0.7390442", "0.73488104", "0.7315261", "0.72717655", "0.7258919", "0.7197753", "0.70861113", "0.7072776", "0.704463", "0.70438856", "0.70396066", "0.703...
0.68950915
32
Updates the mode of the field.
def mode= new_mode @gapi.update! mode: verify_mode(new_mode) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mode=(new_mode)\n handle_old_mode\n @mode = new_mode\n handle_new_mode\n end", "def set_mode(new)\n @mode = new\n end", "def set_Mode(value)\n set_input(\"Mode\", value)\n end", "def set_Mode(value)\n set_input(\"Mode\", value)\n end", "def set_...
[ "0.74436414", "0.7338009", "0.72996503", "0.72996503", "0.72854596", "0.71889395", "0.71225977", "0.71225977", "0.6927123", "0.68225056", "0.6785598", "0.6779125", "0.67547053", "0.6741139", "0.6693237", "0.66868323", "0.6656586", "0.6616257", "0.66143656", "0.6610173", "0.64...
0.7462092
0
The policy tag list for the field. Policy tag identifiers are of the form `projects//locations//taxonomies//policyTags/`. At most 1 policy tag is currently allowed.
def policy_tags names = @gapi.policy_tags&.names names.to_a if names && !names.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_policy_tags\n policy_tags = []\n if @policy_tags_enabled\n if @node.respond_to?('policy_group') && !@node.policy_group.nil?\n policy_tags << \"#{@scope_prefix}policy_group:#{@node.policy_group}\"\n end\n if @node.respond_to?('policy_name') && !@node.policy_name.nil?\n po...
[ "0.686827", "0.64193606", "0.6193602", "0.6193602", "0.60909736", "0.6085833", "0.60737056", "0.606432", "0.6043317", "0.6029182", "0.6021539", "0.6021539", "0.601281", "0.59840417", "0.59713894", "0.5930394", "0.5914106", "0.5884815", "0.5884815", "0.5884815", "0.58509874", ...
0.7704126
0
Updates the policy tag list for the field.
def policy_tags= new_policy_tags # If new_policy_tags is nil, send an empty array. # Sending a nil value for policy_tags results in no change. new_policy_tags = Array(new_policy_tags) policy_tag_list = Google::Apis::BigqueryV2::TableFieldSchema::PolicyTags.new names: new_policy_tags @gapi.update! policy_tags: policy_tag_list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_tags=(values)\n self.tag_list = values\n end", "def tag_list= value\n self.tags = value.split(',').map(&:strip)\n end", "def tag_list= value\n self.tags = value.split(',').map(&:strip)\n end", "def update_tags\n if self.tags.any?\n self.tags.each do |tag|\n tag.update(o...
[ "0.55922896", "0.539742", "0.539742", "0.53874755", "0.535781", "0.5308555", "0.5232926", "0.5229278", "0.5211289", "0.5194023", "0.51815975", "0.5173509", "0.5172196", "0.51485544", "0.5132083", "0.5130251", "0.51200163", "0.51054484", "0.50936425", "0.509348", "0.50623614",...
0.68708473
0
The default value of a field using a SQL expression. It can only be set for top level fields (columns). Default value for the entire struct or array is set using a struct or array expression. The valid SQL expressions are: Literals for all data types, including STRUCT and ARRAY. The following functions: `CURRENT_TIMESTAMP` `CURRENT_TIME` `CURRENT_DATE` `CURRENT_DATETIME` `GENERATE_UUID` `RAND` `SESSION_USER` `ST_GEOPOINT` Struct or array composed with the above allowed functions, for example: "[CURRENT_DATE(), DATE '20200101'"]
def default_value_expression @gapi.default_value_expression end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_definition_default_sql(sql, column)\n sql << \" DEFAULT #{literal(column[:default])}\" if column.include?(:default)\n end", "def default_value_expression= default_value_expression\n @gapi.update! default_value_expression: default_value_expression\n end", "def default_valu...
[ "0.67377514", "0.6483813", "0.6316746", "0.6221594", "0.6145545", "0.6050926", "0.600729", "0.599084", "0.59106916", "0.5907113", "0.588262", "0.58748096", "0.58539283", "0.5853167", "0.5814387", "0.57894194", "0.5741978", "0.5655963", "0.5608236", "0.56039613", "0.56001836",...
0.65507853
1
Updates the default value expression of the field.
def default_value_expression= default_value_expression @gapi.update! default_value_expression: default_value_expression end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_value_expression\n @gapi.default_value_expression\n end", "def attribute_default(field)\n return unless field.has_default?\n val = field.default\n case\n when val.is_a?(Proc) && (val.arity == 0)\n self.instance_exec(&val)\n when val.is_a?(UnboundMet...
[ "0.7305109", "0.67668134", "0.6487752", "0.64311534", "0.6340553", "0.63329947", "0.63080865", "0.6295609", "0.62812674", "0.62658536", "0.625919", "0.6181035", "0.6158315", "0.6101479", "0.6034576", "0.59987116", "0.5988971", "0.5962693", "0.59526", "0.5948998", "0.59461987"...
0.7989715
0
Checks if the type of the field is `STRING`.
def string? type == "STRING" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def string?\n data_type == String\n end", "def is_string?(); @type == GRT_STRING; end", "def is_string\n return @is_string\n end", "def value?(value) value.is_a?(String) end", "def is_strtype?(); @type == GRT_STRTYPE; end", "def valid_string?(field, param)\n true\n end", "def st...
[ "0.766883", "0.7502291", "0.7177248", "0.7105687", "0.7097787", "0.69959325", "0.69954354", "0.6947247", "0.6862597", "0.6823381", "0.6794733", "0.6788983", "0.6743994", "0.6729507", "0.66976947", "0.6691452", "0.66257066", "0.6589806", "0.6552939", "0.6374711", "0.636748", ...
0.8085952
0
Checks if the type of the field is `INTEGER`.
def integer? type == "INTEGER" || type == "INT64" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def should_be_integer?(field_info, field)\n field_info[\"type\"] == \"INTEGER\"\n end", "def validate_integer_type(field)\n if field.is_a?(Integer)\n return true\n else\n return false\n end\n end", "def integer?(field)\n self.send(field).is_a? Integer\n end", "def check_integer(fi...
[ "0.8816761", "0.79230464", "0.7527394", "0.7145677", "0.70655954", "0.68046695", "0.68038917", "0.6634229", "0.6520246", "0.65108705", "0.6387364", "0.6367998", "0.6316398", "0.6302311", "0.62349486", "0.62349486", "0.6187975", "0.6181883", "0.6145409", "0.60884315", "0.60779...
0.7569757
2
Checks if the type of the field is `FLOAT`.
def float? type == "FLOAT" || type == "FLOAT64" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def should_be_float?(field_info, field)\n field_info[\"type\"] == \"REAL\"\n end", "def float?(field)\n self.send(field).is_a? Float\n end", "def float?\n !!Float(self)\n rescue ArgumentError, TypeError\n false\n end", "def is_float?\n\t\tFloat(self) != nil rescue false\n\tend...
[ "0.85790896", "0.8445893", "0.78699714", "0.77761734", "0.77434534", "0.76264244", "0.7608694", "0.74386245", "0.7383327", "0.734307", "0.7325684", "0.7205356", "0.7172576", "0.71485484", "0.7016743", "0.700799", "0.6999478", "0.69910985", "0.69802356", "0.6971501", "0.696626...
0.8395093
2
Checks if the type of the field is `NUMERIC`.
def numeric? type == "NUMERIC" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_be_numeric?\n type == :numeric\n end", "def is_numeric?\n self.data_type == 'number'\n end", "def is_numeric?\n data_type == 'number'\n end", "def force_numeric?(column)\n (column.nil? || [:integer, :float, :decimal].include?(column.type))\n end", "def is_numeric?\n b...
[ "0.8123423", "0.81146765", "0.80457455", "0.7489456", "0.74260485", "0.736178", "0.7325247", "0.71158636", "0.7065441", "0.70591086", "0.7019456", "0.70072466", "0.6976461", "0.6957395", "0.69145", "0.6912553", "0.6883778", "0.6883057", "0.68391424", "0.6837754", "0.6830816",...
0.8336803
0
Checks if the type of the field is `BIGNUMERIC`.
def bignumeric? type == "BIGNUMERIC" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def numeric?\n type == \"NUMERIC\"\n end", "def type_literal_generic_bigdecimal(column)\n type_literal_generic_numeric(column)\n end", "def is_numeric?\n self.data_type == 'number'\n end", "def is_numeric?\n data_type == 'number'\n end", "def can_be_numeric?\n type ...
[ "0.6738808", "0.6559789", "0.6464305", "0.6322639", "0.6197289", "0.61915845", "0.61214185", "0.60701454", "0.60350496", "0.602095", "0.5962229", "0.59568995", "0.58549404", "0.5850209", "0.5802794", "0.579359", "0.5774934", "0.5733052", "0.5723241", "0.57167006", "0.5706896"...
0.80970097
0
Checks if the type of the field is `BOOLEAN`.
def boolean? type == "BOOLEAN" || type == "BOOL" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_boolean_type(field)\n if field.is_a?(TrueClass) || field.is_a?(FalseClass)\n return true\n else\n return false\n end\n end", "def boolean?\n @type == :boolean\n end", "def boolean?(column)\n column.type == :boolean\n end", "def boolean_type\n 'B...
[ "0.8182188", "0.7985818", "0.790566", "0.76356053", "0.7247902", "0.7122026", "0.7076148", "0.7015558", "0.69802076", "0.69467354", "0.69068044", "0.6845731", "0.68139756", "0.6801363", "0.67474", "0.6743324", "0.673224", "0.6679746", "0.6620197", "0.6601278", "0.65994644", ...
0.8220208
0
Checks if the type of the field is `BYTES`.
def bytes? type == "BYTES" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bytes?(object)\n object.kind_of?(Fixnum) && object >= 0x00 && object <= 0xFF\n end", "def binary?\n t = @type.downcase\n !!((t =~ /binary/) || (t =~ /blob/))\n end", "def as_many_bytes_as?(other)\n type_id.abs >= other.type_id.abs # TODO: use possible_byte_sizes\n end", "def byt...
[ "0.65713304", "0.6396643", "0.6071401", "0.6001402", "0.5939501", "0.59050196", "0.5901824", "0.5715024", "0.56709874", "0.5662601", "0.5643503", "0.5616308", "0.56033313", "0.5599911", "0.55633765", "0.55584276", "0.5554243", "0.55297375", "0.55066544", "0.5505588", "0.54903...
0.807143
0