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
Convert object to string
def to_s id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n object.to_s\n end", "def to_s\n @object.to_s\n end", "def serialize(object)\n object.to_s\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s\n @string || @object.to_s('F')\n end", "def to_s_safe(obj)\n if obj.respond_to?(:to_...
[ "0.86652863", "0.8627003", "0.84286654", "0.8230664", "0.8230664", "0.77413636", "0.76580167", "0.76192427", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023", "0.7565023"...
0.0
-1
The comparison operator for sorting values
def <=>(other) to_s <=> other.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare(x, y); end", "def <=>(other)\n self.comparison_criteria <=> other.comparison_criteria\n end", "def compare(attr, statable)\r\n a = self.send(attr)\r\n\tb = statable.send(attr)\r\n#\treturn 0 if a.nil? || b.nil?\r\n\t\r\n\torder = StatSummary::STATS[attr][:order]\r\n\tif order == 1\r\n\t retu...
[ "0.68448925", "0.68341535", "0.68100697", "0.67759424", "0.67698383", "0.6708117", "0.6656816", "0.66501224", "0.6640268", "0.66264266", "0.6611789", "0.6611789", "0.6604208", "0.6593306", "0.6593306", "0.6593306", "0.65614855", "0.65461737", "0.65446377", "0.652237", "0.6508...
0.0
-1
Check whether objects are identical to each other
def eql?(other) self.class == other.class && self == other end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def object_equal(obj1, obj2)\n vars1 = obj1.instance_variables\n vars2 = obj2.instance_variables\n return false unless vars1.length == vars2.length\n # if they don't have exactly the same instance_variables names then return false\n return false unless vars1.map(&:to_s).sort.to_s == vars2.map(&:to_s).sort.to_...
[ "0.7192201", "0.7009408", "0.6974962", "0.6902903", "0.6882747", "0.6881419", "0.68759584", "0.68759584", "0.6864566", "0.68439716", "0.67608976", "0.67577326", "0.67577326", "0.674206", "0.6719728", "0.670374", "0.6687354", "0.6684728", "0.66736174", "0.66651946", "0.6664926...
0.0
-1
Generate a hash value for this object
def hash [self.class, to_s].hash end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash\n @hash || @hash = (value.hash * -1)\n end", "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n ...
[ "0.779179", "0.779179", "0.779179", "0.779179", "0.779179", "0.779179", "0.779179", "0.7725012", "0.7700632", "0.7700632", "0.7588217", "0.74741197", "0.7443239", "0.74276406", "0.740216", "0.7382884", "0.7369049", "0.7363316", "0.72556597", "0.72437376", "0.7189056", "0.71...
0.0
-1
API call in Ruby
def calculate_stocks stocks = stocks_owned .map { |stock| {ticker: stock[0], shares: stock[1]} } .sort_by { |stock| stock[:ticker] } # url = "https://cloud.iexapis.com/stable/stock/market/batch?types=quote,chart&range=1d&token=#pk_2d262b4b89114ceda9b7ada2d9e99bb9&symbols=" # sto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def raw_api(method,params=nil)\n debug(6,:var=>method,:msg=>\"method\")\n debug(6,:var=>params,:msg=>\"Parameters\")\n\n checkauth\n checkversion(1,1)\n params={} if params==nil\n obj=do_request(json_obj(method,params))\n return obj['result']\n end", "def call_api (action, argument = \"\")\...
[ "0.73926175", "0.7388564", "0.73189205", "0.73185706", "0.71449566", "0.7047161", "0.704323", "0.69944763", "0.6986029", "0.69634223", "0.6936273", "0.6936273", "0.6900803", "0.6877585", "0.6875016", "0.6789639", "0.6778155", "0.6778155", "0.6775344", "0.6772968", "0.676304",...
0.0
-1
TODO: currently no boundschecking on immediate moves values > 16bit 2'scompl cause compile error (this seemed like a fix that could be done later)
def move_immediate(dest, value) instrs = [] instrs << Instruction.movw(dest: Register.reg(dest), srcs: [Register.reg(value.to_i)]) #instrs << Instruction.movw(dest: target, srcs: [Register.reg(value.to_i & 0x00FF)]) # TODO ruby does not store FIXNUMS in 2's complement, instead unsigned with sign...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compile_legal_moves(square)\n (\"1\"..\"9\").each{|num| square.legal_moves << num if is_legal?(num, square) && !square.legal_moves.include?(num)}\n square.legal_moves\n end", "def test_005_bounded?()\n TestVals.each do |sVal|\n bs = BitString.new(sVal)\n assert(! bs.bounded?)\n ...
[ "0.52957135", "0.52460116", "0.52409023", "0.52213156", "0.5214741", "0.5170157", "0.5160376", "0.5129132", "0.51268065", "0.5113721", "0.5083725", "0.5080204", "0.5057862", "0.50524974", "0.50498223", "0.5042617", "0.5036881", "0.5031713", "0.5026716", "0.50262034", "0.50244...
0.6649114
0
TODO: currently no boundschecking on immediate adds/etc immediate can be (a) 12bit unsigned (b) flex operand just use (a) and a register otherwise (this seemed like a fix that could be done later)
def operand_immediate(value) instrs = [] src = Register.reg(Minic::LLVM::Register.alloc("i32")) #instrs << Instruction.mov(dest: src, srcs: [Register.reg(value.to_i)]) instrs += mov_instr(src, value.to_i) [instrs, src] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _reduce_17(val, _values)\n AST::IntegerEqual.new val.first, val.last \nend", "def star(reg)\n return opt(plus(reg))\nend", "def resolveADD\r\n newVal = @RegA + @RegB\r\n if(newVal == 0)\r\n @ZRBit = true\r\n @OFBit = false\r\n puts \"Zero bit true. Overflow bit false.\"\r\n elsif...
[ "0.5465397", "0.5442884", "0.5423485", "0.5417842", "0.52797174", "0.5245698", "0.524518", "0.5242819", "0.5228331", "0.5224861", "0.52232814", "0.5185857", "0.51821154", "0.5170468", "0.5166312", "0.5166312", "0.51584864", "0.5132365", "0.51317656", "0.51167506", "0.5114103"...
0.49765745
41
Copied from: Add this template directory to source_paths so that Thor actions like copy_file and template resolve against our source files. If this file was invoked remotely via HTTP, that means the files are not present locally. In that case, use `git clone` to download them to a local temporary dir.
def add_template_repository_to_source_path if __FILE__.match? %r{\Ahttps?://} require 'tmpdir' tempdir = Dir.mktmpdir 'jumpstart-' source_paths.unshift tempdir at_exit { FileUtils.remove_entry tempdir } git(clone: [ '--quiet', 'https://github.com/cj/jumpstart.git', tempdir, ]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_template_repository_to_source_path\n if __FILE__ =~ %r{\\Ahttps?://}\n source_paths.unshift(tempdir = Dir.mktmpdir(\"rails-template-\"))\n at_exit { FileUtils.remove_entry(tempdir) }\n git :clone => [\n \"--quiet\",\n TEMPLATE_REPO,\n tempdir\n ].map(&:shellescape).join(\" \")\n...
[ "0.82294726", "0.81781095", "0.8153518", "0.8065219", "0.8065219", "0.8060599", "0.8059711", "0.8059608", "0.80577177", "0.8049722", "0.80430406", "0.8027991", "0.80052125", "0.800192", "0.7997477", "0.79343146", "0.7909945", "0.7907977", "0.7897767", "0.7889096", "0.7885269"...
0.750032
30
well, the feeds are not dependant of the page ? nah... they are not persisted, so they are just a collections
def show @page = Page.find params[:id] @feeds = @key_master.feeds(@page.external_id)[0..9] rescue # API calls have their own damage control mechanism # this is only to avoid any quirky things with a messy page id redirect_to root_url end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def feed_items\n feed_item\n end", "def feed_for(name)\n find_articles(name) \n articles_to_list\n feed = @page.page_parts.where(name: 'feed').first\n process_with_filter(feed) \n end", "def article_feed\n \tArticle.all\n end", "def feed\n @articles = Article.feed...
[ "0.7173692", "0.70040405", "0.6922103", "0.6889469", "0.68176156", "0.6762886", "0.67577994", "0.67539346", "0.6663334", "0.6663334", "0.6663334", "0.6663334", "0.6663334", "0.6638705", "0.6620306", "0.6589011", "0.65878767", "0.65823174", "0.65751517", "0.6566834", "0.656031...
0.0
-1
we get an id or a name ? we let the Key Master see what he can do, and no matter what, we go back home
def create @key_master.to_page params['page'][:external_id] if params['page'][:external_id].present? redirect_to root_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_master_ready?\n # the API handler has everything it needs ?\n unless @key_master.got_keys?\n # a quickie :back mechanism\n session[:back] = request.url\n # go get what you need buddy !\n redirect_to @key_master.key_board\n end\n end", "def key\n @key.id2name\n end", ...
[ "0.62110966", "0.61872417", "0.60674846", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", "0.6003174", ...
0.0
-1
fetches a FB page by id or name only used to check page existence so far hence the method name
def lookup # gets a page (Hash) or a FB error page = @key_master.get_page(params[:name]) respond_to do |format| format.json do render json: page, status: (page.is_a?(Hash) ? :ok : :not_found) end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_page(name, options = {})\n fetch('/page/%s' % name, options)\n end", "def get_facebook_page(page_id)\n # Facebooker::Page.new(page_id)\n @graph = Koala::Facebook::API.new(fb_access_token)\n page_token = @graph.get_page_access_token(page_id)\n @page_graph = Koala::Facebook::API.new(page_...
[ "0.68581593", "0.6818053", "0.66173875", "0.647624", "0.63899046", "0.63766253", "0.61848235", "0.6108224", "0.604657", "0.59813744", "0.597948", "0.59569526", "0.5941112", "0.5927684", "0.58873445", "0.58356017", "0.58239716", "0.581749", "0.58130485", "0.5812527", "0.577460...
0.6388185
5
First add the counter, then retrieve.
def add_then_retrieve(key=nil) if key.class == String && block_given? return @j_del.java_method(:addThenRetrieve, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(key,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) })) end raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def counter\n @counter ||= Counter.find(:item_id => self.id, :item_class => 'Fileentity').first\n if @counter.nil? \n @counter = Counter.create(:item_id => self.id,\n :item_class => 'Fileentity',\n :item_counter_attribute => 'file_c...
[ "0.6968894", "0.68015856", "0.67530054", "0.6661613", "0.6480677", "0.64530665", "0.64162594", "0.640337", "0.640337", "0.6400387", "0.6387418", "0.6356943", "0.63454455", "0.6305886", "0.62539965", "0.62494546", "0.6247524", "0.6240996", "0.622304", "0.6198555", "0.6194131",...
0.0
-1
First add the counter by a increment, then retrieve.
def add_then_retrieve_by(key=nil,increment=nil) if key.class == String && increment.class == Fixnum && block_given? return @j_del.java_method(:addThenRetrieveBy, [Java::java.lang.String.java_class,Java::JavaLang::Long.java_class,Java::IoVertxCore::Handler.java_class]).call(key,increment,(Proc.new { |ar| y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def increment\n curr_value = counter\n self.counter = curr_value + 1\n save\n curr_value\n end", "def increment\n @counter = @counter + 1\n end", "def increment \n\t\t@counter = @counter + 1\n\tend", "def increment_counter(counter)\n\tcounter += 1\n\treturn counter\nend", "def incr\n ...
[ "0.7874844", "0.7310849", "0.7288306", "0.72766894", "0.7241821", "0.7088748", "0.7078888", "0.6993458", "0.68758774", "0.68612385", "0.6799514", "0.6721501", "0.6632886", "0.6623879", "0.66141963", "0.65685517", "0.6534818", "0.6521969", "0.6521566", "0.6488534", "0.6479719"...
0.0
-1
First retrieve the counter, then add.
def retrieve_then_add(key=nil) if key.class == String && block_given? return @j_del.java_method(:retrieveThenAdd, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(key,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) })) end raise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_count\n @count += 1\n end", "def increment_counter\n unless self.count.nil?\n self.count += 1\n else\n self.count = 1\n end\n end", "def incr_count\n @count ||= 0\n @count += 1\n end", "def incr\n add(1)\n end", "def increment\n curr_va...
[ "0.7617437", "0.75091803", "0.7328387", "0.7216821", "0.717169", "0.7158543", "0.7075809", "0.7045237", "0.7028438", "0.69932383", "0.6888167", "0.686741", "0.68222106", "0.6748912", "0.6733234", "0.67283106", "0.66863877", "0.6666621", "0.6635503", "0.6631899", "0.6606548", ...
0.0
-1
Reset the value of the counter with a certain key
def reset(key=nil) if key.class == String && block_given? return @j_del.java_method(:reset, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(key,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })) end raise ArgumentError, "Invalid arguments when calling reset(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset(value=0)\n @counter = value.to_i\n end", "def reset_counter; end", "def reset_counter!\n return if counter == 0\n sql(:execute, %(\n INSERT INTO knifeswitch_counters (name,counter)\n VALUES (?, 0)\n ON DUPLICATE KEY UPDATE counter=0\n ), namespace)\n end", ...
[ "0.74521786", "0.7383439", "0.70484054", "0.65855926", "0.6562778", "0.6560664", "0.6545219", "0.6524645", "0.6491723", "0.6491723", "0.64852643", "0.647795", "0.64496785", "0.63507915", "0.63352406", "0.6312552", "0.6284518", "0.6275814", "0.6275814", "0.62684536", "0.626845...
0.5500379
92
GET /instruments GET /instruments.json
def index res = Instrument if params[:search].present? res = res.where(title: /.*#{params[:search]}.*/i) end @instruments = res.order(updated_at: :desc).page(params[:page]).per(NUM_PER_PAGE) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instruments(expired: false, &blk)\n params = { expired: expired }\n if block_given?\n websocket.subscribe :getinstruments, params: params, &blk\n else\n http.get :getinstruments, params: params\n end\n end", "def funding_instruments(account_id, options = {})\n get(\"...
[ "0.6903781", "0.6594286", "0.634992", "0.6138871", "0.6138839", "0.61016804", "0.6038609", "0.6004643", "0.6004643", "0.6000906", "0.59960103", "0.5950157", "0.5949622", "0.5945555", "0.5934905", "0.5919434", "0.591288", "0.59011734", "0.5900397", "0.5883705", "0.58733165", ...
0.6604064
1
GET /instruments/1 GET /instruments/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @sims_instrument_configuration = SimsInstrumentConfiguration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sims_instrument_configuration }\n end\n end", "def show\n @instrument = current_user.portfolios.find(params[:port...
[ "0.6379716", "0.62483674", "0.6219469", "0.620443", "0.6167208", "0.6152309", "0.61138487", "0.6061778", "0.60485375", "0.60430634", "0.6038175", "0.6019712", "0.6016511", "0.598646", "0.5960774", "0.594696", "0.5942647", "0.59260166", "0.58962923", "0.58830553", "0.58658445"...
0.0
-1
POST /instruments POST /instruments.json
def create @instrument = Instrument.new(instrument_params) respond_to do |format| if @instrument.save format.html { redirect_to @instrument, notice: t('.success') } format.json { render :show, status: :created, location: @instrument } else format.html { render :new } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n p \"*******INST CREATE*********\"\n user = User.find_by(id: session[:user_id])\n instrument = user.instruments.build(instrument_params)\n if instrument.save\n render json: instrument, status: :created\n else\n render json: {error: \"Not Created\"}, status: :not_created\n en...
[ "0.6937109", "0.648474", "0.6298963", "0.6195316", "0.59901315", "0.5984999", "0.5935692", "0.5887145", "0.5827529", "0.5827529", "0.5823998", "0.5799382", "0.579529", "0.5793902", "0.57530296", "0.57209355", "0.5698928", "0.5685557", "0.56585056", "0.56108105", "0.5497114", ...
0.6881756
1
PATCH/PUT /instruments/1 PATCH/PUT /instruments/1.json
def update respond_to do |format| if @instrument.update(instrument_params) format.html { redirect_to @instrument, notice: t('.success') } format.json { render :show, status: :ok, location: @instrument } else format.html { render :edit } format.json { render json: @instrum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @instrument_patch.update(instrument_patch_params)\n format.html { redirect_to @instrument_patch, notice: 'Instrument patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n ...
[ "0.6877426", "0.6828545", "0.65734667", "0.6470603", "0.6398299", "0.63869494", "0.6329154", "0.63158876", "0.63149714", "0.6181329", "0.61052454", "0.6099112", "0.6072934", "0.60714257", "0.60447115", "0.60331434", "0.6023616", "0.6022825", "0.6019464", "0.6011128", "0.60007...
0.6734142
2
DELETE /instruments/1 DELETE /instruments/1.json
def destroy @instrument.destroy respond_to do |format| format.html { redirect_to instruments_url, notice: t('.success') } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @instrument.destroy\n respond_to do |format|\n format.html { redirect_to instruments_url, notice: 'Instrument was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @instrument = Instrument.find(params[:id])\n @instrument.destroy\n\n...
[ "0.7110271", "0.7074491", "0.688317", "0.6855857", "0.68240577", "0.6821809", "0.6780873", "0.6763529", "0.675275", "0.6701891", "0.6669194", "0.66490424", "0.66424394", "0.6635793", "0.6582943", "0.65648824", "0.65648824", "0.65648824", "0.65648824", "0.655445", "0.6533926",...
0.7270127
0
Use callbacks to share common setup or constraints between actions.
def set_instrument @instrument = Instrument.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 instrument_params params.require(:instrument).permit(:name, :location, :serial_number, :description, :maintainer, :available) 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 a link for a given rel. Pass force to get a link from the homepage when nothing has been fetched
def link_for_rel(rel, opts = {}) force = opts.delete(:force) if last_response? last_response.link_for(rel, opts) elsif force self._get('/') last_response.link_for(rel, opts) else nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rel_link(rel)\n host_meta[\"Link\"].detect{|l| l[\"rel\"]==rel}[\"href\"] if host_meta && host_meta[\"Link\"]\n end", "def rel\n @node[\"rel\"] || \"alternate\"\n end", "def link (rel, res, opts={})\n\n id, opts = if opts.is_a?(Hash)\n [ opts.delete(:id), opts ]\n else\n ...
[ "0.70585364", "0.6239373", "0.61857957", "0.61310774", "0.6113859", "0.6024182", "0.5951053", "0.59084255", "0.5883242", "0.58601797", "0.57325816", "0.5712049", "0.564756", "0.563897", "0.55077076", "0.5436125", "0.53400606", "0.53169197", "0.53138083", "0.5259921", "0.51885...
0.7625492
0
Fetches a link for a given rel if the rel doesn't start with a slash and there was a previous request to fetch a link from
def get_path_for(path) if path.respond_to?(:href) path = path.href elsif path =~ /^[^\/]/ if link = link_for_rel(path) path = link.href end end path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_for_rel(rel, opts = {})\n force = opts.delete(:force)\n if last_response?\n last_response.link_for(rel, opts)\n elsif force\n self._get('/')\n last_response.link_for(rel, opts)\n else\n nil\n end\n end", "def refute_link(rel, re...
[ "0.6519083", "0.65141684", "0.62075126", "0.5982269", "0.585259", "0.5689676", "0.567314", "0.55941737", "0.5584532", "0.5575506", "0.55281633", "0.5489994", "0.53659403", "0.5332582", "0.5328208", "0.5322437", "0.52623576", "0.52546316", "0.5199849", "0.51828825", "0.5168614...
0.44697237
83
GET /orders GET /orders.json
def index @orders = Order.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end", "def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\n end", "def index\n @orders = Order.all\n render json: @orders\n end", "def index\n @orders = Order.all\n ...
[ "0.83267236", "0.815406", "0.80041754", "0.7947603", "0.7846487", "0.7823147", "0.78028905", "0.76992875", "0.76980406", "0.7682792", "0.7682792", "0.7682792", "0.7682792", "0.76827645", "0.75880665", "0.7574349", "0.756171", "0.7531827", "0.74860185", "0.7432208", "0.7369724...
0.70640796
76
GET /orders/1 GET /orders/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getorders(args={})\n {\n :method=> \"GetOrders\"\n }.to_json\n end", "def index\n @orders = Order.all\n render json: @orders\n end", "def index\n @orders = Order.all\n render json: @orders, status: 200\n end", "def index\n @orders = Order.order(\"id\").all\n\n resp...
[ "0.7554187", "0.7488565", "0.7475228", "0.73777765", "0.73714006", "0.7341344", "0.73384553", "0.73168725", "0.73018956", "0.7291244", "0.7291244", "0.7291244", "0.7291244", "0.72911215", "0.7281374", "0.7266143", "0.72498786", "0.7228276", "0.7213504", "0.71842283", "0.71261...
0.0
-1
POST /orders POST /orders.json
def create @order = Order.new(order_params) # @order = current_cart.build_order(params[:order]) @order.ip_address = request.remote_ip if @order.save if @order.purchase if not Company.where(owner_email_id: current_admin.email)[0].license.nil? @company = Company.where(owner_ema...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def orders\n authenticated_post(\"orders\").body\n end", "def orders\n authenticated_post(\"auth/r/orders\").body\n end", "def create\n order = Order.create(order_params)\n render json: order\nend", "def submit_order()\n\tputs \"Submitting order\"\n\tdata = create_order()\n\tresponse = ...
[ "0.75886714", "0.7490972", "0.7488501", "0.74664384", "0.72739846", "0.7195349", "0.7063682", "0.69745994", "0.6910657", "0.68880194", "0.68747663", "0.685004", "0.6840204", "0.6838178", "0.6838178", "0.6838178", "0.6838178", "0.682244", "0.6790037", "0.67793274", "0.6779247"...
0.0
-1
PATCH/PUT /orders/1 PATCH/PUT /orders/1.json
def update respond_to do |format| if @order.update(order_params) format.html { redirect_to @order, notice: 'Order was successfully updated.' } format.json { render :show, status: :ok, location: @order } else format.html { render :edit } format.json { render json: @order.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @order = Order.find(params[:id])\n\n if @order.update(order_params)\n head :no_content\n else\n render json: @order.errors, status: :unprocessable_entity\n end\n end", "def update\n @order = Order.find(params[:id])\n\n if @order.update(order_params)\n head :no_conte...
[ "0.6803119", "0.6803119", "0.67749745", "0.6743427", "0.67353284", "0.6726928", "0.6723453", "0.6719653", "0.67047364", "0.6704673", "0.6704673", "0.6704673", "0.6704673", "0.6704673", "0.6704673", "0.6704673", "0.6704673", "0.6704673", "0.6704673", "0.6704673", "0.6704673", ...
0.0
-1
DELETE /orders/1 DELETE /orders/1.json
def destroy @order.destroy respond_to do |format| format.html { redirect_to orders_url, notice: 'Order was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @v1_order = V1::Order.find(params[:id])\n @v1_order.destroy\n\n head :no_content\n end", "def destroy\n @order1 = Order1.find(params[:id])\n @order1.destroy\n\n respond_to do |format|\n format.html { redirect_to order1s_url }\n format.json { head :no_content }\n end\...
[ "0.7592003", "0.7475092", "0.74298924", "0.7371978", "0.7371411", "0.7371187", "0.7357556", "0.7357556", "0.7357556", "0.7357556", "0.7357556", "0.7347606", "0.7347606", "0.7347606", "0.7347606", "0.7347606", "0.7347606", "0.7347606", "0.7347606", "0.7347606", "0.7347606", ...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_order @order = Order.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 order_params params.require(:order).permit(:new, :card_verification ,:card_number ,:cart_id, :ip_address, :first_name, :last_name, :card_brand, :card_expires_on) 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
for topnav to use nickname
def count_as_zheng(count) i = count.to_i i == 0 ? '〇' : '正' * (i / 5) + ['', *'丨丄上止正'.chars][i % 5] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_username(str_name)\r\n self.title = \"#{APP_CUPERATIVA_NAME} - Utente: #{str_name}\" \r\n #@lbl_username.text = \"#{@comment_init} - Utente: #{str_name}\" \r\n end", "def members_login\r\n\t@title = \"Members Login\"\r\n end", "def nickname\n @nick\n end", "def nickname\n @ni...
[ "0.63293767", "0.6252859", "0.6240289", "0.6228772", "0.6182586", "0.61420554", "0.61048985", "0.60773736", "0.6064153", "0.5997722", "0.5992888", "0.59764403", "0.59764403", "0.59764403", "0.59764403", "0.5917019", "0.59149295", "0.59105504", "0.58623695", "0.58572567", "0.5...
0.0
-1
cygwin rsync path must be adjusted to work
def adjust_rsync_path(path) path.gsub(/^(\w):/) { "/cygdrive/#{$1}" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync_cmd\n \"rsync --delete -avzhe '#{@ssh_path} -p #{@port}' #{cygdrive_path @log_dir} #{user_at_host}:#{@remote_log_parent_dir}\"\n end", "def rsync_with dir\n rsync_options = \"-avP --exclude '*svn*' --exclude '*swp' --exclude '*rbc'\" +\n \" --exclude '*.rej' --exclude '*.orig' --exclude 'l...
[ "0.78467035", "0.7268312", "0.69409037", "0.66458505", "0.66439927", "0.6617973", "0.6584979", "0.6420445", "0.6417664", "0.6317858", "0.6242475", "0.6238355", "0.6211799", "0.61932856", "0.61908746", "0.6172153", "0.6158254", "0.61401594", "0.60832846", "0.60714144", "0.6042...
0.67637664
3
Parses "Chef: x.y.z" from the chefsolo version output
def chef_version v = run_command('sudo chef-solo --version').stdout.split(':') v[0].strip == 'Chef' ? v[1].strip : '' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_version\n # The version string is usually in one of the following formats:\n #\n # * 4.1.8r1234\n # * 4.1.8r1234_OSE\n # * 4.1.8_MacPortsr1234\n #\n # Below accounts for all of these.\n\n # Note: We split this into multiple lines beca...
[ "0.637651", "0.63397455", "0.62393725", "0.5977187", "0.59727585", "0.5940485", "0.59254", "0.59246445", "0.5922264", "0.5917004", "0.5842839", "0.5753562", "0.57256037", "0.5725296", "0.56686395", "0.56662273", "0.56662273", "0.56635135", "0.55856454", "0.5575794", "0.557328...
0.59214586
9
Add a member to an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def add_ory_access_control_policy_role_members(flavor, id, opts = {}) data, _status_code, _headers = add_ory_access_control_policy_role_members_with_http_info(flavor, id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_subject(subject)\n res = subject.put(:add_role, :id => subject.id, :role_id => self.id, :client_id => CLIENT_ID)\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n return true\n else\n return false\n end\n end", "def add_right_to_personalgroup(right)\n self.right...
[ "0.59265083", "0.5901673", "0.5621462", "0.5428336", "0.54098266", "0.54047793", "0.53825176", "0.53791225", "0.53702164", "0.535245", "0.53133327", "0.527464", "0.52324575", "0.5230493", "0.51838803", "0.51615167", "0.51512545", "0.5136654", "0.50926733", "0.50830567", "0.50...
0.49707195
22
Add a member to an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def add_ory_access_control_policy_role_members_with_http_info(flavor, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.add_ory_access_control_policy_role_members ...' end # verify the required parameter 'flavor' is set if @api_client...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_subject(subject)\n res = subject.put(:add_role, :id => subject.id, :role_id => self.id, :client_id => CLIENT_ID)\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n return true\n else\n return false\n end\n end", "def add_right_to_personalgroup(right)\n self.right...
[ "0.59259415", "0.5901128", "0.5619288", "0.5429332", "0.5409142", "0.5404426", "0.53811705", "0.53790766", "0.5369718", "0.53515565", "0.53118306", "0.5273152", "0.5230884", "0.5230463", "0.51822805", "0.5160956", "0.5151544", "0.51353383", "0.50912815", "0.50823355", "0.5072...
0.0
-1
Delete an ORY Access Control Policy
def delete_ory_access_control_policy(flavor, id, opts = {}) delete_ory_access_control_policy_with_http_info(flavor, id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_policy\n\n group = $iam.groups[params[:name]]\n\n AWS.config(\n :access_key_id => ENV[\"S3_ACCESS_KEY\"], \n :secret_access_key => ENV[\"S3_SECRET_KEY\"])\n\n policy_name = 's3-read-write' \n\n $iam.client.delete_group_policy(\n :group_name => group.name,\n :policy_na...
[ "0.7145397", "0.68682003", "0.6667727", "0.6556461", "0.65342057", "0.65339375", "0.65195215", "0.65173155", "0.6486049", "0.64687896", "0.63821393", "0.6356792", "0.6342103", "0.63181597", "0.6311611", "0.62963337", "0.6293451", "0.62434196", "0.6227001", "0.62158424", "0.62...
0.63253814
13
Delete an ORY Access Control Policy
def delete_ory_access_control_policy_with_http_info(flavor, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.delete_ory_access_control_policy ...' end # verify the required parameter 'flavor' is set if @api_client.config.client_side_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_policy\n\n group = $iam.groups[params[:name]]\n\n AWS.config(\n :access_key_id => ENV[\"S3_ACCESS_KEY\"], \n :secret_access_key => ENV[\"S3_SECRET_KEY\"])\n\n policy_name = 's3-read-write' \n\n $iam.client.delete_group_policy(\n :group_name => group.name,\n :policy_na...
[ "0.7145397", "0.68682003", "0.6667727", "0.6556461", "0.65342057", "0.65339375", "0.65195215", "0.65173155", "0.6486049", "0.64687896", "0.63821393", "0.6356792", "0.6342103", "0.63253814", "0.63181597", "0.6311611", "0.62963337", "0.6293451", "0.62434196", "0.6227001", "0.62...
0.56945735
82
Delete an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def delete_ory_access_control_policy_role(flavor, id, opts = {}) delete_ory_access_control_policy_role_with_http_info(flavor, id, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @company = Company.find(params[:company_id])\n @role = Role.find(params[:role_id])\n @access_right = @role.access_rights.find(params[:id])\n @access_right.destroy\n redirect_to company_role_path(@company, @role)\n end", "def remove_from_subject(subject)\n res = subject.put(:remov...
[ "0.60565966", "0.5806093", "0.575707", "0.570102", "0.5699954", "0.5640317", "0.55765295", "0.5449834", "0.54331565", "0.54006845", "0.5375645", "0.53425676", "0.53347814", "0.53282195", "0.53237486", "0.53119713", "0.53095347", "0.5307086", "0.52548945", "0.5189122", "0.5183...
0.0
-1
Delete an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def delete_ory_access_control_policy_role_with_http_info(flavor, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.delete_ory_access_control_policy_role ...' end # verify the required parameter 'flavor' is set if @api_client.config.cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @company = Company.find(params[:company_id])\n @role = Role.find(params[:role_id])\n @access_right = @role.access_rights.find(params[:id])\n @access_right.destroy\n redirect_to company_role_path(@company, @role)\n end", "def remove_from_subject(subject)\n res = subject.put(:remov...
[ "0.6057038", "0.5808649", "0.57600546", "0.5703268", "0.57013404", "0.5643767", "0.5578882", "0.54500026", "0.5433957", "0.5402337", "0.53767014", "0.534515", "0.5335034", "0.53293324", "0.5325024", "0.53135043", "0.5310985", "0.5310886", "0.52592456", "0.5191475", "0.5185228...
0.0
-1
Get an ORY Access Control Policy
def get_ory_access_control_policy(flavor, id, opts = {}) data, _status_code, _headers = get_ory_access_control_policy_with_http_info(flavor, id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy\n self.permissions['policy'].to_sym\n end", "def policy\n @policy ||= init_policy\n end", "def current_policy\n @current_policy ||= ::AccessPolicy.new(User.find(current_user.id))\n end", "def your_project_access_type policy = nil, resource = nil\n unless policy.nil? or resou...
[ "0.67224336", "0.6636606", "0.66109705", "0.63573694", "0.6332826", "0.62693316", "0.62458616", "0.62005883", "0.6195818", "0.6155828", "0.615428", "0.6131759", "0.6070841", "0.60624737", "0.6053323", "0.60531276", "0.6040249", "0.602196", "0.59938836", "0.5976048", "0.597064...
0.6131555
12
Get an ORY Access Control Policy
def get_ory_access_control_policy_with_http_info(flavor, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.get_ory_access_control_policy ...' end # verify the required parameter 'flavor' is set if @api_client.config.client_side_valida...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def policy\n self.permissions['policy'].to_sym\n end", "def policy\n @policy ||= init_policy\n end", "def current_policy\n @current_policy ||= ::AccessPolicy.new(User.find(current_user.id))\n end", "def your_project_access_type policy = nil, resource = nil\n unless policy.nil? or resou...
[ "0.67224336", "0.6636606", "0.66109705", "0.63573694", "0.6332826", "0.62693316", "0.62458616", "0.62005883", "0.6195818", "0.6155828", "0.615428", "0.6131759", "0.6131555", "0.6070841", "0.60624737", "0.6053323", "0.60531276", "0.6040249", "0.602196", "0.59938836", "0.597604...
0.56873715
39
Get an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def get_ory_access_control_policy_role(flavor, id, opts = {}) data, _status_code, _headers = get_ory_access_control_policy_role_with_http_info(flavor, id, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_groups\n raise \"#{subject.inspect} should have a #{role_groups_list_meth} method\" if !subject.respond_to?(role_groups_list_meth)\n subj_role_groups = subject.send(role_groups_list_meth)\n return [] if subj_role_groups.blank?\n subj_role_groups.flatten\n end", "def roles...
[ "0.56853426", "0.5665339", "0.56056285", "0.5591217", "0.5528254", "0.55010396", "0.5490091", "0.54345757", "0.54345757", "0.5422211", "0.53877497", "0.5354799", "0.5352048", "0.52763796", "0.52561545", "0.5249686", "0.5242841", "0.5156274", "0.5134243", "0.5088868", "0.50348...
0.0
-1
Get an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def get_ory_access_control_policy_role_with_http_info(flavor, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.get_ory_access_control_policy_role ...' end # verify the required parameter 'flavor' is set if @api_client.config.client_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def role_groups\n raise \"#{subject.inspect} should have a #{role_groups_list_meth} method\" if !subject.respond_to?(role_groups_list_meth)\n subj_role_groups = subject.send(role_groups_list_meth)\n return [] if subj_role_groups.blank?\n subj_role_groups.flatten\n end", "def roles...
[ "0.56819934", "0.56649387", "0.5601056", "0.55936897", "0.55276746", "0.5498498", "0.54872954", "0.5434983", "0.5434983", "0.5419982", "0.5387262", "0.5352058", "0.53517693", "0.5278669", "0.5253331", "0.524954", "0.524004", "0.5156037", "0.5136152", "0.50898075", "0.50343454...
0.0
-1
List ORY Access Control Policies
def list_ory_access_control_policies(flavor, opts = {}) data, _status_code, _headers = list_ory_access_control_policies_with_http_info(flavor, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_policies\n nessus_rest_get('policies')['policies']\n end", "def list_policies\n http_get(:uri=>\"/policies\", :fields=>x_cookie)\n end", "def list(options = {})\n @raw = send_get_request(@conn_no_err, ['/v1/acl/policies'], options)\n raise Diplomat::AclNotFound if @raw.status...
[ "0.7015163", "0.69093597", "0.6844954", "0.68366814", "0.6767915", "0.6756855", "0.67276615", "0.6648644", "0.6580607", "0.65223217", "0.6513628", "0.64515775", "0.638401", "0.6368344", "0.63327456", "0.629348", "0.62891924", "0.6284618", "0.6282819", "0.6201374", "0.62000257...
0.67478216
6
List ORY Access Control Policies
def list_ory_access_control_policies_with_http_info(flavor, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.list_ory_access_control_policies ...' end # verify the required parameter 'flavor' is set if @api_client.config.client_side_vali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_policies\n nessus_rest_get('policies')['policies']\n end", "def list_policies\n http_get(:uri=>\"/policies\", :fields=>x_cookie)\n end", "def list(options = {})\n @raw = send_get_request(@conn_no_err, ['/v1/acl/policies'], options)\n raise Diplomat::AclNotFound if @raw.status...
[ "0.7015163", "0.69093597", "0.6844954", "0.68366814", "0.6767915", "0.6756855", "0.67478216", "0.67276615", "0.6648644", "0.6580607", "0.65223217", "0.6513628", "0.64515775", "0.638401", "0.6368344", "0.63327456", "0.629348", "0.62891924", "0.6284618", "0.6282819", "0.6201374...
0.60741067
29
List ORY Access Control Policy Roles Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def list_ory_access_control_policy_roles(flavor, opts = {}) data, _status_code, _headers = list_ory_access_control_policy_roles_with_http_info(flavor, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @all_subject_roles = AllSubjectRole.all\n end", "def list(options = {})\n @raw = send_get_request(@conn_no_err, ['/v1/acl/roles'], options)\n raise Diplomat::AclNotFound if @raw.status == 403\n\n parse_body\n end", "def list\n rolegroup_subject.rolegroup_list\n end...
[ "0.62575096", "0.62111586", "0.61710656", "0.6170191", "0.61065984", "0.6021152", "0.5973742", "0.5973742", "0.5970365", "0.591984", "0.5825047", "0.57721686", "0.576521", "0.5739089", "0.5722579", "0.57191825", "0.571652", "0.56888235", "0.56877553", "0.5685675", "0.5685222"...
0.54002386
42
List ORY Access Control Policy Roles Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def list_ory_access_control_policy_roles_with_http_info(flavor, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.list_ory_access_control_policy_roles ...' end # verify the required parameter 'flavor' is set if @api_client.config.client_s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @all_subject_roles = AllSubjectRole.all\n end", "def list(options = {})\n @raw = send_get_request(@conn_no_err, ['/v1/acl/roles'], options)\n raise Diplomat::AclNotFound if @raw.status == 403\n\n parse_body\n end", "def roles\n @roles = Role.order(\"name\")\n\t@rights = Rig...
[ "0.6261482", "0.621534", "0.61743623", "0.6174084", "0.6109117", "0.60247105", "0.59756887", "0.59756887", "0.5972296", "0.5922881", "0.5828209", "0.5778034", "0.57661283", "0.57434714", "0.572719", "0.5724579", "0.5723025", "0.5693173", "0.56912047", "0.56879413", "0.5687887...
0.0
-1
Remove a member from an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def remove_ory_access_control_policy_role_members(flavor, id, member, opts = {}) remove_ory_access_control_policy_role_members_with_http_info(flavor, id, member, opts) nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_subject(subject)\n res = subject.put(:remove_role, :id => subject.id, :role_id => self.id, :client_id => CLIENT_ID)\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n return true\n else\n return false\n end\n end", "def remove_role_assignments_from_group_members_...
[ "0.623569", "0.61206627", "0.5911451", "0.59004074", "0.5839639", "0.5785755", "0.57809526", "0.5757884", "0.5739892", "0.57342106", "0.57249546", "0.5703058", "0.56127006", "0.5540545", "0.5536524", "0.55346626", "0.5523184", "0.5506782", "0.5460642", "0.54437906", "0.544112...
0.61682403
1
Remove a member from an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def remove_ory_access_control_policy_role_members_with_http_info(flavor, id, member, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.remove_ory_access_control_policy_role_members ...' end # verify the required parameter 'flavor' is set ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_from_subject(subject)\n res = subject.put(:remove_role, :id => subject.id, :role_id => self.id, :client_id => CLIENT_ID)\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n return true\n else\n return false\n end\n end", "def remove_ory_access_control_policy_role_membe...
[ "0.62315977", "0.6166633", "0.61196333", "0.5909186", "0.5896931", "0.5835759", "0.57849014", "0.5778093", "0.57544935", "0.573662", "0.57288593", "0.57205343", "0.57005644", "0.5610293", "0.55369586", "0.55341154", "0.5529342", "0.55196756", "0.550428", "0.5457037", "0.54402...
0.0
-1
Upsert an ORY Access Control Policy
def upsert_ory_access_control_policy(flavor, opts = {}) data, _status_code, _headers = upsert_ory_access_control_policy_with_http_info(flavor, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(policy,exceptions)\n @options[:connection].put(\"/policies/#{@options[:path]}\", :payload => {:exceptions => exceptions, :policy => policy}) && true\n end", "def update!(**args)\n @policy = args[:policy] if args.key?(:policy)\n end", "def update!(**args)\n @policy = ...
[ "0.65478116", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.64937776", "0.6400286", "0.6400286", "0.615692", "0.6063348", "0.5991568", "0.5958031", "0.58790827", ...
0.6043029
18
Upsert an ORY Access Control Policy
def upsert_ory_access_control_policy_with_http_info(flavor, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.upsert_ory_access_control_policy ...' end # verify the required parameter 'flavor' is set if @api_client.config.client_side_vali...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(policy,exceptions)\n @options[:connection].put(\"/policies/#{@options[:path]}\", :payload => {:exceptions => exceptions, :policy => policy}) && true\n end", "def update!(**args)\n @policy = args[:policy] if args.key?(:policy)\n end", "def update!(**args)\n @policy = ...
[ "0.65478116", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.6544738", "0.64937776", "0.6400286", "0.6400286", "0.615692", "0.6063348", "0.6043029", "0.5991568", "0.5958031", ...
0.57924545
38
Upsert an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def upsert_ory_access_control_policy_role(flavor, opts = {}) data, _status_code, _headers = upsert_ory_access_control_policy_role_with_http_info(flavor, opts) data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_roles(roles)\n self.roles |= roles\n self.save!\n end", "def assign_roles\n roles_map.each do |role_obj|\n Authentication::Account.find_by_email(role_obj['email']).update_attributes(roles: role_obj['roles'])\n end\n end", "def add_to_subject(subject)\n res = subje...
[ "0.54785883", "0.54281837", "0.5308149", "0.52227014", "0.51083386", "0.5089287", "0.5089011", "0.49905193", "0.49720824", "0.49720824", "0.49584532", "0.49360305", "0.4921262", "0.49141815", "0.49064827", "0.4865942", "0.48313445", "0.4823507", "0.48026595", "0.47777644", "0...
0.43689433
87
Upsert an ORY Access Control Policy Role Roles group several subjects into one. Rules can be assigned to ORY Access Control Policy (OACP) by using the Role ID as subject in the OACP.
def upsert_ory_access_control_policy_role_with_http_info(flavor, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EnginesApi.upsert_ory_access_control_policy_role ...' end # verify the required parameter 'flavor' is set if @api_client.config.client...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_roles(roles)\n self.roles |= roles\n self.save!\n end", "def assign_roles\n roles_map.each do |role_obj|\n Authentication::Account.find_by_email(role_obj['email']).update_attributes(roles: role_obj['roles'])\n end\n end", "def add_to_subject(subject)\n res = subje...
[ "0.5478678", "0.5427877", "0.5308672", "0.522234", "0.51050436", "0.5091687", "0.5090444", "0.49914324", "0.4972203", "0.4972203", "0.4959197", "0.4935727", "0.49226752", "0.49152115", "0.49075904", "0.48657078", "0.48292753", "0.48227546", "0.48007837", "0.47772768", "0.4767...
0.0
-1
TODO: place your code here
def ... end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def refutal()\n end", "def probers; end", "def schubert; end", "def suivre; end", "def weber; end", "def relatorios\n end", "def custom; end", "def custom; end", "def retire\n\n end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end"...
[ "0.7249848", "0.66003394", "0.65070987", "0.6504969", "0.6279538", "0.62323844", "0.6227887", "0.61813426", "0.61813426", "0.61808765", "0.6117638", "0.6117638", "0.6117638", "0.6117638", "0.6117638", "0.6117638", "0.6117638", "0.6117638", "0.6117638", "0.6116798", "0.6050041...
0.0
-1
[Arrayof Numbers] > [Arrayof Numbers] Consumes an array and returns a sorted array using the bubble sort methodology
def bubble_sort(input_array) # Initialization of variables used for the while loop list_is_not_sorted = true iteration = 0 # Duplication of the input array to not destroy the input array output_array = input_array # While loop with early stopping function provided by checking if the list is sorted. whi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bubble_sort array\n\t(0...array.length-1).each do |i|\n\t\t(i+1...array.length).each do |j|\n\t\t\tif array[i]>array[j]\n\t\t\t\tarray[i]=array[i]+array[j]\n\t\t\t\tarray[j]=array[i]-array[j]\n\t\t\t\tarray[i]=array[i]-array[j]\n\t\t\tend\n\t\tend\n\tend\n\tarray\nend", "def bubble_sort(arr)\n\tbubble_sort_b...
[ "0.81604266", "0.80560887", "0.80151415", "0.79767126", "0.7945041", "0.7944894", "0.7936626", "0.7903915", "0.789226", "0.7878104", "0.78726983", "0.78683645", "0.78629297", "0.7835453", "0.78210825", "0.7811012", "0.7802042", "0.7792999", "0.7792788", "0.77910334", "0.77819...
0.0
-1
[Arrayof Numbers] > [pairof [Arrayof Numbers] Boolean] Consumes an array and returns a sorted array using the bubble sort methodology for one round Returns a pair with the sorted array in first position and a boolean informing if the array was alrady sorted in second position
def iterate_through_array(input_array) # Initialization of variable used for the checking of the array sorting list_is_not_sorted = false # Duplication of the input array to not destroy the input array output_array = input_array # Loop through a range representing the array indexes (0..output_array.leng...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bubble_sort(array)\n\t#outer loop keeps track if something was swapped or not\n\tloop do \n\t\tswapped = false\n\t\t#inner loop swaps numbers that aren't in order\n\t\t(array.length-1).times do |i|\n\t\t\t#take each pair of numbers and compare them. Swap if a > b. If so, swapped = true.\n \t\t\tif array[i] > ...
[ "0.79896986", "0.7907101", "0.78728104", "0.784566", "0.7820366", "0.78078467", "0.7765181", "0.7738586", "0.7731257", "0.7727251", "0.7725618", "0.7717432", "0.7713462", "0.76742536", "0.7672319", "0.7670306", "0.765873", "0.7654564", "0.76494884", "0.76460713", "0.7641616",...
0.0
-1
POST /users POST /users.json
def create if @launch = Launch.new(launch_params) respond_to do |format| @launch.save format.html { redirect_to launch_url , notice: 'User was successfully created.' } format.json { render :show, status: :created, location: launch_url } # else # format.html { render :new } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post_users(users)\n self.class.post('https://api.yesgraph.com/v0/users', {\n :body => users.to_json,\n :headers => @options,\n })\n end", "def CreateUser params = {}\n \n APICall(path: 'users.json',method: 'POST',payload: params.to_json)\n \n end", "def post b...
[ "0.77179813", "0.75206673", "0.73831296", "0.72405374", "0.719841", "0.7140812", "0.71038526", "0.7058827", "0.7041636", "0.70236504", "0.7003128", "0.70021695", "0.70021695", "0.70021695", "0.69936967", "0.6990463", "0.6980393", "0.6979075", "0.69788617", "0.69788617", "0.69...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_user @launch = Launch.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
:callseq: dependencies(scopes?) => artifacts dependencies(:scopes = [:runtime, :test, ...], :optional = true) => artifacts Returns list of required dependencies as specified by the POM. You can specify which scopes to use (e.g. "compile", "runtime"); use +nil+ for dependencies with unspecified scope. The default scopes...
def dependencies(options = {}) # backward compatibility options = { :scopes => options } if Array === options # support symbols, but don't fidget with nil options[:scopes] = (options[:scopes] || SCOPES_WE_USE).map { |s| s.to_s if s } # try to cache dependencies also @depends_for_sc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dependencies(pom_path, scopes = %w(compile runtime))\n maven = Naether::Maven.create_from_pom(pom_path)\n maven.dependencies(scopes)\n end", "def required_dependencies\n dependencies - optional_dependencies\n end", "def maven_dependencies\n deps = [ 'pom.xml' ]\n d...
[ "0.7387161", "0.67984056", "0.67033905", "0.6665674", "0.6569527", "0.6569527", "0.6569527", "0.6569527", "0.6528587", "0.6526524", "0.6431507", "0.638573", "0.6320531", "0.62663186", "0.62662053", "0.6265923", "0.625744", "0.6225511", "0.6196835", "0.6189985", "0.6188413", ...
0.8198037
0
:callseq: properties() => hash Returns properties available to this POM as hash. Includes explicit properties and pom.xxx/project.xxx properties for groupId, artifactId, version and packaging.
def properties() @properties ||= begin pom = %w(groupId artifactId version packaging).inject({}) { |hash, key| value = project[key] || (parent ? parent.project[key] : nil) hash[key] = hash["pom.#{key}"] = hash["project.#{key}"] = value_of(value) if value hash } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def properties\n map(element_type: :hash) { |v| v.properties }\n end", "def properties\n @properties ||= {}\n end", "def properties\n @properties ||= {}\n end", "def properties\n @properties ||= {}\n end", "def properties\n hash = {}\n Parser::PROPERTIES.each {...
[ "0.6917569", "0.68430185", "0.68413574", "0.68413574", "0.67524654", "0.6745139", "0.67282605", "0.66659397", "0.66239995", "0.65386176", "0.64675915", "0.63995177", "0.6365089", "0.63519007", "0.63156277", "0.63145596", "0.6298355", "0.6274084", "0.6233386", "0.6222841", "0....
0.8082257
0
:callseq: managed() => hash managed(hash) => hash The first form returns all the managed dependencies specified by this POM in dependencyManagement. The second form uses a single spec hash and expands it from the current/parent POM. Used to determine the version number if specified in dependencyManagement instead of de...
def managed(spec = nil) if spec managed.detect { |dep| [:group, :id, :type, :classifier].all? { |key| spec[key] == dep[key] } } || (parent ? parent.managed(spec) : nil) else @managed ||= begin managed = project['dependencyManagement'].first['dependencies'].first['dependen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dependencies_for(specification)\n root_name = Specification.root_name(specification.name)\n specification.all_dependencies.map do |dependency|\n if dependency.root_name == root_name\n dependency.dup.tap { |d| d.specific_version = specification.version }\n else\n depend...
[ "0.5792188", "0.567189", "0.5643099", "0.55665314", "0.5399706", "0.53923225", "0.5389741", "0.5364594", "0.536216", "0.5318055", "0.5305957", "0.5293283", "0.52908057", "0.5288766", "0.52518934", "0.5186188", "0.51708746", "0.51433223", "0.5114702", "0.5113829", "0.5111695",...
0.7031005
0
:callseq: value_of(element) => string value_of(element, true) => string Returns the normalized text value of an element from its XmlSimple value. The second form performs property substitution.
def value_of(element, substitute = nil) value = element.to_a.join.strip value = value.gsub(/\$\{([^}]+)\}/) { |key| Array(substitute[$1]).join.strip } if substitute value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_value(element)\n\t\t\tif ['input','select','textarea'].include? element.tag_name.downcase\n\t\t\t\telement.attribute('value')\n\t\t\telse\n\t\t\t\telement.text\n\t\t\tend\n\t\tend", "def get_value(element)\n element.value\n end", "def transform_property_value(value, value_type = nil, is_url: false)...
[ "0.593135", "0.5851333", "0.57612246", "0.56562674", "0.5488232", "0.5456957", "0.53936213", "0.53809917", "0.53369826", "0.5331087", "0.5327772", "0.5323997", "0.5323808", "0.52986383", "0.52949786", "0.5267264", "0.5267264", "0.52658886", "0.52581406", "0.5244047", "0.52335...
0.55379444
4
:callseq: pom_to_hash(element) => hash pom_to_hash(element, true) => hash Return the spec hash from an XmlSimple POM referencing element (e.g. project, parent, dependency). The second form performs property substitution.
def pom_to_hash(element, substitute = nil) hash = POM_TO_SPEC_MAP.inject({}) { |spec, pair| spec[pair.first] = value_of(element[pair.last], substitute) if element[pair.last] spec } {:scope => 'compile', :type => 'jar'}.merge(hash) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n element.hash\n end", "def get_hash(path=\"\")\n Element.get_hash(@element, path)\n end", "def get_hash(path='.')\n Element.get_hash(@element, path)\n end", "def pom\n return self if type == :pom\n Buildr.artifact(:group=>group, :id=>id, :version=>version, :type=>:...
[ "0.6212477", "0.5856982", "0.5752386", "0.56036955", "0.55751556", "0.55591136", "0.5538725", "0.55366623", "0.5434215", "0.5379333", "0.5379333", "0.52472514", "0.52463853", "0.5222501", "0.52003795", "0.51952213", "0.51874226", "0.5127784", "0.5108307", "0.50934386", "0.506...
0.7596104
0
Check if user is, publicly or privately, a member of an organization
def member?(*args) params = arguments(args, required: [:org_name, :user]).params org_name = arguments.org_name user = arguments.user response = if params.delete('public') get_request("/orgs/#{org_name}/public_members/#{user}", params) else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def organization_member?(org, username)\n boolean_request :get, \"/orgs/#{org}/members/#{username}\"\n end", "def member?\n client.organization_member? org_id, user.login\n end", "def member?\n client.organization_member? org_id, github_user.login\n end", "def organization_public_...
[ "0.8214054", "0.8144699", "0.80108976", "0.7888938", "0.7864697", "0.77634215", "0.7698617", "0.7414", "0.73250556", "0.72677964", "0.72103655", "0.7114851", "0.70476633", "0.6980163", "0.69541144", "0.6929597", "0.69130945", "0.69130945", "0.69098926", "0.6892802", "0.688304...
0.75616693
7
Remove a member Removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories.
def delete(*args) arguments(args, required: [:org_name, :user]) delete_request("/orgs/#{arguments.org_name}/members/#{arguments.user}", arguments.params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_member(_team, _user)\n # stub\n end", "def remove_member(user)\n members.delete user if has_member? user\n end", "def remove_user_team_member(team_id, user_id)\n delete(\"/user_teams/#{team_id}/members/#{user_id}\")\n end", "def remove_member(user)\n update_mem...
[ "0.8250886", "0.80757546", "0.8014108", "0.7879383", "0.78461057", "0.77488405", "0.7584194", "0.75517666", "0.7429395", "0.73982924", "0.73955154", "0.7369768", "0.7361242", "0.7303369", "0.726272", "0.72459763", "0.71591574", "0.698014", "0.6895765", "0.6859466", "0.6781226...
0.619234
45
Publicize a user's membership
def publicize(*args) arguments(args, required: [:org_name, :user]) put_request("/orgs/#{arguments.org_name}/public_members/#{arguments.user}", arguments.params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def publicize_membership(org, username)\n boolean_request :put, \"/orgs/#{org}/public_members/#{username}\"\n end", "def membership(user)\n memberships.find_by_user_id(user.id)\n end", "def index\n @memberships = @user.memberships\n end", "def show\n @members = User.with_membership(bud...
[ "0.7409023", "0.7076188", "0.66290754", "0.65113384", "0.64586157", "0.6416196", "0.63979596", "0.63465875", "0.6333254", "0.6320663", "0.6234253", "0.61955434", "0.61579496", "0.6153079", "0.6151285", "0.61368203", "0.61368203", "0.6124884", "0.61216635", "0.611324", "0.6112...
0.66778845
2
Conceal a user's membership
def conceal(*args) arguments(args, required: [:org_name, :user]) delete_request("/orgs/#{arguments.org_name}/public_members/#{arguments.user}", arguments.params) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def confirm\n user = User.find(params[:id])\n authorize user\n if user.state != \"active\"\n user.confirm\n user.make_user_a_member\n\n # assume this type of user just activated someone from somewhere else in the app\n flash['notice'] = \"Activation of #{user.name_and_login} complete.\...
[ "0.63942516", "0.6369843", "0.62508225", "0.6221055", "0.6196257", "0.61364275", "0.6088822", "0.60746956", "0.5981684", "0.5980507", "0.59624076", "0.59620976", "0.5944213", "0.58540034", "0.58469677", "0.5834892", "0.5809418", "0.57796264", "0.5749128", "0.5739677", "0.5726...
0.59815925
9
Determine if we should manage the IP address of this device based on which hotspot it belongs to.
def manage_ip? case type.hotspot when 'hsv1-mem' then true when 'hsv2-bam' then false else false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def management_ip_static_configured?\n !!running_config.match(%r{interface ManagementEthernet \\d+/\\d+.*?\\s+ip address\\s+\\d+.\\d+.\\d+.\\d+\\/\\d+})\n end", "def ip?\n return (proto == 'ip')\n end", "def management_ip_dhcp_configured?\n !!running_config.match(%r{interface ManagementE...
[ "0.6714203", "0.66981244", "0.6615979", "0.65959734", "0.65781665", "0.6500346", "0.64857745", "0.6429907", "0.6429907", "0.64125884", "0.6383647", "0.6373715", "0.63604414", "0.63102084", "0.628687", "0.62447083", "0.6194261", "0.6190672", "0.616046", "0.6155325", "0.6109878...
0.8125885
0
Determine which network this device should belong to based on the members membership level.
def membership_network network = try(:member).try(:membership_level).try(:network) # TODO: Do not hardcode default network network ||= '10.10.1.0/24' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def network\n lines, errs = networksetup(\"getairportnetwork #{options[:device_id]}\")\n lines.join('\\n') =~ /Current Wi-Fi Network: (.+)$/i\n $1\n end", "def network_label\n network == \"users\" ? \"\" : network\n end", "def network\n n = @head.fetch[0]\n raise \"Invalid netwo...
[ "0.65512776", "0.63091725", "0.6048086", "0.598633", "0.598633", "0.59801006", "0.5934652", "0.5919414", "0.59177727", "0.5914403", "0.59079385", "0.5833492", "0.5782318", "0.5758139", "0.57574075", "0.57320356", "0.5729325", "0.5718994", "0.56755954", "0.565439", "0.5628587"...
0.81640786
0
Renew a devices IP address.
def renew network = Network.new membership_network self.ip_address = network.next end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_kvm_ip(name)\n new_ip = (available_ips - used_ips).pop\n raise 'no ips available' unless new_ip\n update_network_interfaces(name, new_ip)\n new_ip\nend", "def release\n requires :ip\n raise Fog::Errors::Error.new('You can\\'t release a ip that is attached to a server') if attache...
[ "0.62030053", "0.5847423", "0.56409895", "0.5594243", "0.5535327", "0.550818", "0.54321283", "0.54321283", "0.54321283", "0.5430069", "0.5412546", "0.5412546", "0.530536", "0.52400625", "0.5169648", "0.5169648", "0.5149343", "0.5149343", "0.5134508", "0.5112007", "0.51096046"...
0.66287446
0
Release a device's IP address.
def release self.ip_address = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def release\n requires :ip\n raise Fog::Errors::Error.new('You can\\'t release a ip that is attached to a server') if attached?\n service.ip_release(\n :ipaddress => identity\n )\n end", "def release_address(public_ip)\n address = address(public_ip)\n\n ...
[ "0.73831683", "0.6990442", "0.6967518", "0.65902865", "0.65804166", "0.65804166", "0.6507768", "0.6507768", "0.6496655", "0.62786424", "0.5796419", "0.57519037", "0.5678639", "0.5598855", "0.55616504", "0.55616504", "0.5519402", "0.55065733", "0.55065733", "0.54815876", "0.54...
0.7406845
0
Update router with new device information If we have detected that the enabled field has changed, and only that just enable or disable the device in the router.
def update_router router = Router.new if @enabled_changed and not self.enabled router.disable self elsif @enabled_changed and self.enabled router.enable self else router.update self end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @wireless_router.update(wireless_router_params)\n format.html { redirect_to @wireless_router, notice: 'Wireless router was successfully updated.' }\n format.json { render :show, status: :ok, location: @wireless_router }\n else\n format.html...
[ "0.6421133", "0.60888726", "0.57820946", "0.5717107", "0.5652915", "0.55382156", "0.5476114", "0.5476053", "0.54341924", "0.53867525", "0.5372572", "0.5370168", "0.53592616", "0.5337492", "0.5329349", "0.5319854", "0.5305643", "0.52971226", "0.5289115", "0.52654433", "0.52654...
0.7251025
0
puts full_string Part 3
def word_counter(string) array = string.downcase.split(" ") word_count = array.count the_count = array.count("the") # option 1 for getting longest work # longest_word = "" # array.each do |x| # longest_word = x if longest_word.length < x.length # end # option 2 for getting longest word longest_w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def str3; end", "def str3; end", "def fragment(string); end", "def string_in_line(string, length)\r\n puts '-'*((length/2)-(string.length/2))+\" #{string} \"+'-'*((length/2)-(string.length/2))\r\n end", "def cutinfo(string)\n inf=/\\024/=~string1\n inf=inf+2\n trans=string1[inf..-1]\nend...
[ "0.61585414", "0.61585414", "0.6091218", "0.60129124", "0.59287745", "0.5746083", "0.5736081", "0.567579", "0.5545686", "0.5504173", "0.5465323", "0.5450819", "0.54410255", "0.54369336", "0.54356873", "0.5416751", "0.53938323", "0.5382392", "0.5380759", "0.537203", "0.5368814...
0.0
-1
GET /survey_reports GET /survey_reports.json
def index # @survey_report = SurveyReport.find(:all, :conditions=>"actions != 1", :order=>"id desc") # @survey_reports = @survey_report.paginate(page: params[:page], per_page: 20) #raise params.inspect if params[:subaction] == "update" start_from = params[:survey][:start_date] rescue "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @survey_report = SurveyReport.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @survey_report }\n end\n end", "def reports\n collection(\"reports\")\n end", "def my_reports\n @reports ||= Report.user(current_us...
[ "0.7308255", "0.71827626", "0.7019273", "0.692466", "0.6921429", "0.68981296", "0.6862276", "0.67886215", "0.67846084", "0.67846084", "0.6783187", "0.67433226", "0.6731845", "0.6694335", "0.6690587", "0.66546607", "0.6647843", "0.6624381", "0.6624381", "0.6624381", "0.6624381...
0.0
-1
GET /survey_reports/1 GET /survey_reports/1.json
def show @survey_report = SurveyReport.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @survey_report } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @survey_report = SurveyReport.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @survey_report }\n end\n end", "def report(id)\n get(\"reports/#{id}\")\n end", "def index\n @reports = Report.all\n\n respond_to do |format|\n ...
[ "0.7010446", "0.70009136", "0.6894247", "0.6797262", "0.6769538", "0.67630565", "0.67314446", "0.6705012", "0.66864514", "0.66864514", "0.66848713", "0.66612935", "0.6624641", "0.66234535", "0.65802383", "0.6562969", "0.65535325", "0.65535325", "0.65535325", "0.6545507", "0.6...
0.7638435
0
GET /survey_reports/new GET /survey_reports/new.json
def new @survey_report = SurveyReport.new respond_to do |format| format.html # new.html.erb format.json { render json: @survey_report } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @report = Report.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @report }\n end\n end", "def new\n @report = Report.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @report }\n end\n...
[ "0.7687205", "0.7687205", "0.7687205", "0.7687205", "0.75796807", "0.74911696", "0.74754536", "0.74754536", "0.74754536", "0.74754536", "0.74754536", "0.74502987", "0.7431378", "0.73970443", "0.73686683", "0.7328047", "0.7268045", "0.7153489", "0.7120576", "0.71154004", "0.71...
0.8173169
0
POST /survey_reports POST /survey_reports.json
def create #raise params.inspect location = params["location"].split("%") @code = params[:WaterSourceCode].split("/") @code1 = @code[3].split("-") @village = Admin::Village.where('village_name = ? ' , @code1[0]) @grampanchayat = Admin::Grampanchyat.where('gram_name = ?', @code1[0]) @habitati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n retval = @survey.create_report_mockup(params[:report_mockup])\n render_json_auto retval and return\n end", "def create\n @report = Report.new(report_params)\n\n respond_to do |format|\n if @report.save\n \n @report.test_suite.test_cases.each do |test_case|\n...
[ "0.7166262", "0.67433935", "0.6725686", "0.67244166", "0.66809046", "0.6437915", "0.6428982", "0.64146364", "0.64034605", "0.6398909", "0.6380394", "0.6368977", "0.6351569", "0.6351569", "0.6351569", "0.63447857", "0.63447857", "0.63446134", "0.63329446", "0.6319876", "0.6293...
0.0
-1
PUT /survey_reports/1 PUT /survey_reports/1.json
def update #raise params.inspect @survey_report = SurveyReport.find(params[:id]) respond_to do |format| if @survey_report.update_attributes(params[:survey_report]) #raise params[:survey_report][:source_location].inspect @code = @survey_report[:water_source_code].split("/") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @custom_report = CustomReport.find(params[:id])\n\n if @custom_report.update(params[:custom_report])\n head :no_content\n else\n render json: @custom_report.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @question_report.u...
[ "0.6581514", "0.6544022", "0.6518954", "0.64833814", "0.6483003", "0.6482555", "0.6482555", "0.6472659", "0.64463854", "0.643399", "0.6416733", "0.6415752", "0.6407661", "0.63939315", "0.63939315", "0.63939315", "0.63939315", "0.63784134", "0.6375693", "0.6371486", "0.633912"...
0.5915779
97
DELETE /survey_reports/1 DELETE /survey_reports/1.json
def destroy @survey_report = SurveyReport.find(params[:id]) @survey_report.destroy respond_to do |format| format.html { redirect_to survey_reports_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @report.destroy!\n render json: {status: :ok}\n end", "def destroy\n @report.destroy\n respond_to do |format|\n format.html { redirect_to reports_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @report.destroy\n respond_to do |format|\n ...
[ "0.752441", "0.7289684", "0.72890896", "0.72890896", "0.72890896", "0.727724", "0.72597367", "0.72597367", "0.72597367", "0.72597367", "0.72597367", "0.724649", "0.724649", "0.71475345", "0.7139078", "0.7139078", "0.7139078", "0.7139078", "0.7129171", "0.7123252", "0.71067625...
0.7947055
0
Allow initializing the list with a first node.
def initialize(first_node = nil) @head = first_node @last = first_node end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize\n @first_node = nil\n end", "def init1(firstNode = Node.new(data = nil))\r\n\t@head = firstNode\r\n\t@tail = nil\r\nend", "def init1(firstNode = Node.new(nil)) #may want to have firstNode = nil instead\t\t\t\r\n\t@head = firstNode\r\n\t@tail = nil\r\nend", "def initialize(fir...
[ "0.74716496", "0.7447933", "0.7229674", "0.7213169", "0.7208292", "0.71924436", "0.7153647", "0.71201813", "0.7057592", "0.70460916", "0.7019003", "0.6999305", "0.69681376", "0.69681376", "0.69681376", "0.6958165", "0.69518954", "0.69350976", "0.6933673", "0.69300365", "0.690...
0.7327983
2
To add the first node
def add_first_node(data) @head = Node.new(data, nil) @last = @head end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_first(data) \n @head = Node.new(data, @head)\n end", "def add_first(data)\n @head = Node.new(data, @head)\n end", "def add_first(data)\n @head = Node.new(data, @head)\n end", "def add_first(data)\n @head = Node.new(data, @head)\n end", "def add_first(data)\n new_node = Node.new(v...
[ "0.7926408", "0.79219276", "0.79219276", "0.79219276", "0.792144", "0.7885032", "0.78818446", "0.7862719", "0.7846746", "0.7845094", "0.7833032", "0.7806361", "0.7795272", "0.7762782", "0.7752282", "0.7716341", "0.7716341", "0.76599014", "0.762134", "0.7553592", "0.7344387", ...
0.80864996
0
Add a node to the end of the list
def add_node(data) # change tactics if we're adding the first node if @head.nil? add_first_node(data) else new_node = Node.new(data) # point the last node to our new one @last.next = new_node # set our new node as the official last node @last = new_node end puts "Added node with the v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append(value)\n #needs .last method\n #self.last\n last.next = Node.new(value)\n end", "def add_to_tail(node)\n if self.head == nil # if the list is empty, node becomes new head\n self.head = node\n else\n self.tail.next = node # otherwise, is the next node after the previous tail\n...
[ "0.7542088", "0.7504441", "0.74997103", "0.74995685", "0.74552387", "0.7435152", "0.7407528", "0.7361416", "0.7354183", "0.73438305", "0.7339588", "0.7315438", "0.73044443", "0.7274268", "0.7271947", "0.72699755", "0.72507364", "0.72507364", "0.72470564", "0.7234738", "0.7227...
0.0
-1
Remove the node at this position assuming there is one We'll crawl the list and save the prev
def remove_node(index) # Start at the head counter = 0 current_node = @head prev_node = nil # crawl to the index position while counter < index prev_node = current_node current_node = current_node.next counter += 1 end # Now perform removal (cutting out current_node) next_node = current_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove(idx)\n if idx.zero?\n return remove_first\n end\n\n iterate do |node, count|\n if count == idx - 1\n old_node = node.next_node\n node.next_node = node.next_node.next_node\n node.next_node.prev_node = node unless node.next_node.nil?\n\n return old_node\n ...
[ "0.7358252", "0.734795", "0.7249227", "0.7219136", "0.71887696", "0.7186918", "0.7165779", "0.71100897", "0.7105075", "0.70690227", "0.7029539", "0.701365", "0.7011173", "0.7003451", "0.7000712", "0.69447535", "0.69397837", "0.6912626", "0.6902515", "0.6842932", "0.6834035", ...
0.6843509
19
Return the node at that position, like in an array No error handling
def find_node(index) #start at the head counter = 0 current_node = @head # crawl to index position # outputs each node value for visibility while counter < index current_node = current_node.next counter += 1 end puts "Found node at index #{index} with value: #{current_node.data}" current_node...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def node_at(index)\n if index >= self.size\n puts \"index out of range.\"\n else\n each_with_index do |node, i|\n return node if index == i \n end\n end\n end", "def [](index)\n ret = get_node_at_index(index)\n return ret.value if ret != nil\n return ret\n end", "def ...
[ "0.76864016", "0.71954143", "0.717201", "0.7157281", "0.7049837", "0.69423103", "0.69014317", "0.69014317", "0.69013727", "0.6837717", "0.68135506", "0.6799387", "0.6760644", "0.67535764", "0.6750691", "0.6729421", "0.67254305", "0.6724927", "0.6704177", "0.6696443", "0.66906...
0.0
-1
crawls and prints the list
def print_list counter = 0 current_node = @head loop do puts "Node at index #{counter}: #{current_node.data}" break if current_node.next.nil? current_node = current_node.next counter += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scrape\n end", "def scrape\n Job.reset\n puts 'Enter a URL to scrape (or press enter for default):'\n url = gets.strip\n url = 'https://news.ycombinator.com/item?id=16052538' if url == ''\n puts \"Scraping...\\n\\n\"\n jobs_data = Scraper.scrape(url)\n jobs_data.each_with_index do |job_...
[ "0.66063327", "0.64660895", "0.64571875", "0.64515346", "0.6447391", "0.63621455", "0.63283885", "0.6321907", "0.6310805", "0.62900853", "0.62610424", "0.62598664", "0.62418723", "0.6182923", "0.6150196", "0.6145757", "0.6111089", "0.61075616", "0.6098683", "0.6092102", "0.60...
0.0
-1
Retrieve FC NIC information
def fc_views client.enumerate("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_FCView") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_nic_info\n info = {}\n os = Facter['kernel'].value\n # only support Linux right now\n return info if os != 'Linux'\n\n nic = nil\n result = `/sbin/ifconfig -a`\n result.split(\"\\n\").each do |line|\n if line =~ /^(\\w+\\S+)/\n nic = $1\n info[nic] = {}\n end\n ...
[ "0.74364984", "0.69898134", "0.69417554", "0.6592108", "0.65559524", "0.64958334", "0.634099", "0.6276218", "0.6206448", "0.61480117", "0.6128603", "0.60835856", "0.6019929", "0.6006014", "0.60041875", "0.6003962", "0.59991974", "0.5968878", "0.5944685", "0.59415114", "0.5860...
0.0
-1
Retrieve the list of RAID controllers See the DCIM Simple RAID Profile available at for a detailed explanation of the returned fields.
def controller_views client.enumerate("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_ControllerView") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getcontrollers\n @controllers = Eb::Permission.getcontrollers\n end", "def list\n all.each { |device| puts(device.pretty_name) }\n end", "def list\n response = @client.get('scanners')\n verify response,\n forbidden: 'You do not have permission to view the list'...
[ "0.6058095", "0.5524259", "0.5435533", "0.53652817", "0.5335611", "0.5313335", "0.5312614", "0.53052956", "0.5302855", "0.52850956", "0.5270833", "0.5242625", "0.5197794", "0.5162404", "0.5093715", "0.5091321", "0.5080625", "0.5080625", "0.5079609", "0.5050333", "0.5042835", ...
0.52131504
12
Retrieve the list of server enclosures See the DCIM Simple RAID Profile available at for a detailed explanation of the returned fields.
def enclosure_views client.enumerate("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_EnclosureView") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_enclaves(opts = {})\n data, _status_code, _headers = get_enclaves_with_http_info(opts)\n data\n end", "def index\n @egc_server_types = EgcServerType.all\n end", "def servers\n @servers.keys\n end", "def set_enclosures(enclosures = [])\n enclosureUris = []\n encl...
[ "0.6167833", "0.54049355", "0.5382759", "0.51899964", "0.51480246", "0.512349", "0.5034469", "0.4931057", "0.4884208", "0.48695225", "0.4849461", "0.48492238", "0.482075", "0.48117885", "0.48087388", "0.48087388", "0.47914243", "0.47914243", "0.47706723", "0.47702903", "0.476...
0.6194012
0
Retrieve the list of virtual disks, aka RAID volumes See the DCIM Simple RAID Profile available at for a detailed explanation of the returned fields.
def virtual_disk_views client.enumerate("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_VirtualDiskView") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_virtual_machine_disks\n request_path = '/services/disks'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.disks_from_xml(response)\n end", "def disks\n self.config.hardware.device.grep(RbVmomi::VIM::VirtualDisk)\...
[ "0.77516574", "0.7612963", "0.69802934", "0.69691527", "0.69328266", "0.6748402", "0.6700932", "0.6692241", "0.6609579", "0.6509598", "0.6420536", "0.63771045", "0.63606715", "0.63505155", "0.6331802", "0.6277364", "0.6242261", "0.6210807", "0.6191817", "0.61906576", "0.61161...
0.67551583
5
Retrieve the list of physical disks See the DCIM Simple RAID Profile available at for a detailed explanation of the returned fields.
def physical_disk_views client.enumerate("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_PhysicalDiskView") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disks\n return @disks unless @disks.empty?\n\n info_disks\n end", "def list_virtual_machine_disks\n request_path = '/services/disks'\n request = ManagementHttpRequest.new(:get, request_path, nil)\n response = request.call\n Serialization.disks_from_xml...
[ "0.7544866", "0.73527366", "0.723542", "0.7169336", "0.7168988", "0.6937229", "0.68287927", "0.681228", "0.66168636", "0.6572087", "0.64782804", "0.6440818", "0.63768995", "0.6265977", "0.6202045", "0.6180633", "0.6147537", "0.5987642", "0.59590447", "0.58895177", "0.5784872"...
0.67294437
8
Retrieve the list of firmware and driver versions installed on the server See the DCIM Software Inventory Profile available at for a detailed explanation of the returned fields.
def software_identities client.enumerate("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/root/DCIM/DCIM_SoftwareIdentity") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_firmware_files\n response = request(:get, \"/devmgr/v2/firmware/cfw-files/\")\n status(response, 200, 'Failed to get uploaded firmware file list')\n JSON.parse(response.body)\n end", "def get_firmware\n ensure_client && ensure_uri\n response = @client.rest_get(...
[ "0.6449433", "0.63030976", "0.6280069", "0.6211443", "0.6206213", "0.6175609", "0.6121046", "0.6121046", "0.6121046", "0.6087588", "0.6028349", "0.6003137", "0.5999546", "0.5950593", "0.5942612", "0.59017", "0.5886752", "0.58764344", "0.58527464", "0.5841021", "0.5834576", ...
0.5288688
75
Get server power state
def power_state retry_counter = 0 begin ret = client.enumerate("http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/DCIM_CSAssociatedPowerManagementService") raise(Error, "No power management enumerations found") if ret.empty? power_state = ret.first[:power_state] return :on i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def power_state\n response = client.exec(\"power status\")\n raise(ASM::Error, \"Invalid IPMI power status response: %s\" % response) unless response =~ /Chassis Power is\\s+(\\S+)/m\n\n state = $1.downcase\n raise(ASM::Error, \"Invalid IPMI power state %s; full response: %s\" % [state, respons...
[ "0.79006827", "0.7885943", "0.75758857", "0.7385897", "0.7343061", "0.73043334", "0.7095912", "0.6948532", "0.684763", "0.68261844", "0.67945683", "0.6602128", "0.6531032", "0.6531032", "0.6504393", "0.6368146", "0.63423467", "0.6297725", "0.6259303", "0.6210107", "0.61197126...
0.7442438
3
Convert a uri string into a WSMan ISO params hash
def parse_iso_uri(uri) uri = URI.parse(uri) {:share_type => parse_iso_scheme(uri.scheme), :ip_address => uri.host == "localhost" ? ASM::Util.get_preferred_ip(host) : uri.host, :share_name => File.dirname(uri.path), :image_name => File.basename(uri.path), :user_name => uri.user, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def query_string_to_hash query_string\n Hash[*query_string.scan(/(.+?)=(.*?)(?:&|$)/).flatten].each_value {|v|\n v.gsub!('+', ' ')\n v.gsub!(/%([0-9a-f]{2})/i) { [$1.hex].pack 'C' }\n }\nend", "def _extract_params(str)\n @uri_params = SipperUtil.parameterize_header(str)[1] \n end", "def get_...
[ "0.6392545", "0.6362289", "0.62549734", "0.62229395", "0.6195826", "0.5949753", "0.5924322", "0.5879523", "0.5873219", "0.5814251", "0.57723755", "0.57722884", "0.57722884", "0.5767736", "0.5762553", "0.57578176", "0.5732132", "0.57177913", "0.5698231", "0.5643716", "0.564009...
0.66361994
0
Check the deployment job status until it is complete or times out
def poll_deployment_job(job, options={}) options = {:timeout => 600}.merge(options) max_sleep_secs = 60 resp = ASM::Util.block_and_retry_until_ready(options[:timeout], RetryException, max_sleep_secs) do resp = get_deployment_job(job) unless %w[Success Failed].include?(resp[:job_status]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_for_completion\n until terminated? do\n Kernel.sleep(Gosen::DeploymentRun::POLLING_TIME)\n @deployment_resource.reload\n end\n raise Gosen::Error.new(\"Deployment error: #{@deployment_resource['output']}\") if @deployment_resource['status'] == 'error'\n end", "def _wait_u...
[ "0.76330775", "0.73122036", "0.71051586", "0.7075661", "0.6995626", "0.6993698", "0.6668247", "0.6660311", "0.66517425", "0.65945005", "0.65046793", "0.6477054", "0.6448677", "0.6405824", "0.6350893", "0.6332789", "0.6279904", "0.62796503", "0.62624353", "0.62013906", "0.6194...
0.70368975
4
Check the LC job status until it is complete or times out
def poll_lc_job(job, options={}) options = {:timeout => 900}.merge(options) max_sleep_secs = 60 resp = ASM::Util.block_and_retry_until_ready(options[:timeout], RetryException, max_sleep_secs) do resp = get_lc_job(job) unless resp[:percent_complete] == "100" || resp[:job_status] =~ /com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_until_complete\n tries = 0\n status = nil\n sleep 1\n while tries < 100\n status = self.status\n puts \"Waiting... status=\" + status[\"status\"]\n if status[\"status\"] != \"queued\" && status[\"status\"] != \"running\"\n break\n end\n sleep...
[ "0.75993574", "0.7201135", "0.7117293", "0.7071676", "0.7031054", "0.69765073", "0.69541365", "0.6802279", "0.6735431", "0.6729641", "0.66575545", "0.66190124", "0.65754414", "0.6517419", "0.65133685", "0.6502832", "0.6493852", "0.64462185", "0.638716", "0.630352", "0.6296103...
0.69675356
6
Execute a deployment ISO mount command and await job completion.
def run_deployment_job(options={}) timeout = options.delete(:timeout) || 5 * 60 method = options.delete(:method) || raise(ArgumentError, "Missing required method option") raise(ArgumentError, "Invalid method option") unless respond_to?(method) # LC must be ready for deployment jobs to succeed ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mountiso(vid, iso)\n perform_request(action: 'vserver-mountiso', vserverid: vid, iso: iso)\n end", "def mountiso(vid, iso)\n perform_request(:action => 'vserver-mountiso', :vserverid => vid, :iso => iso)\n end", "def mount_command(path)\n \"udisksctl mount --block-device #{path}\"\nend", ...
[ "0.62709355", "0.62299496", "0.6165657", "0.58096194", "0.5353567", "0.5288607", "0.5277912", "0.5263649", "0.5248297", "0.5237761", "0.52052116", "0.51948434", "0.5164781", "0.5161045", "0.5154669", "0.5113261", "0.5092527", "0.5089", "0.5072017", "0.50508654", "0.5041566", ...
0.46761706
86
Wait for LC to be ready to accept new jobs If the server currently has a network ISO attached, it will be disconnected as that will block LC from becoming ready. Then poll the LC until it reports a ready status.
def poll_for_lc_ready(options={}) options = {:timeout => 30 * 60}.merge(options) resp = remote_services_api_status return if resp[:lcstatus] == "0" # If ConnectNetworkISOImage has been executed, LC will be locked until the image is disconnected. resp = get_network_iso_image_connection_in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_until_ready\n # this method may be left unimplemented if that is applicable\n end", "def wait_for_ready\n sleep 0.1 until ready?\n end", "def wait\n\t\t\t\t@available.wait\n\t\t\tend", "def wait_connection; end", "def wait_connection; end", "def wait_until_ready!\n T...
[ "0.67325234", "0.65585387", "0.6534529", "0.6418359", "0.6418359", "0.63886255", "0.63772523", "0.63619363", "0.63064903", "0.62761605", "0.62689316", "0.6224226", "0.6195745", "0.6183113", "0.6169329", "0.6159283", "0.6150141", "0.6116595", "0.6113923", "0.61023194", "0.6091...
0.76246226
0
Get the FQDD of the first SATA Disk (SATADOM model) present on the node
def first_sata_disk disks_enum = physical_disk_views logger.info("disks enum from physical_disk_views is %s" % [disks_enum]) sata_disks = [] disks_enum.each do |x| slot = x[:slot] connector = x[:connector] sata_disks << "%s-%s" % [slot, connector] if x[:model] =~ /SATADOM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def dev_node\n disk_info = self.info\n return nil if disk_info.nil?\n return disk_info['system-entities'][0]['dev-entry']\n end", "def getDefaultDisk(hrn, domain = \"grid\")\n qs = <<DD_QS\nSELECT nodes.disk\n FROM nodes\n LEFT JOIN locations ON nodes.location_id = locations.id\n LEFT JOI...
[ "0.64878154", "0.6250079", "0.61388785", "0.5931496", "0.5883144", "0.5876491", "0.57491684", "0.56223816", "0.55079454", "0.5478741", "0.546694", "0.5458864", "0.54443", "0.54255444", "0.5416542", "0.53967667", "0.5395964", "0.53946674", "0.5347032", "0.53441334", "0.5313263...
0.7097484
0
Get the FQDD of the Boss controller if present on the node
def boss_controller disk_controllers = controller_views disk_controller = disk_controllers.find { |c| c[:product_name].include?("BOSS") } return nil unless disk_controller disk_controller[:fqdd] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def nbd_device\n sys_parts = lsblk('')\n nbds = []\n\n sys_parts.each do |p|\n m = p['name'].match(/nbd(\\d+)/)\n next unless m\n\n nbds << m[1].to_i\n end\n\n nbds_max.times do |i| # if nbds_max returns 0 block is skipped\n return...
[ "0.5411", "0.5137847", "0.5021956", "0.49967375", "0.49466178", "0.49205938", "0.4908184", "0.49013004", "0.4882672", "0.48183763", "0.47834525", "0.47509733", "0.4710703", "0.47051612", "0.4700884", "0.46827662", "0.4651764", "0.46471724", "0.46218225", "0.46131337", "0.4609...
0.725338
0