query
stringlengths
7
6.41k
document
stringlengths
12
28.8k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Clear screen down from current position
def clear_screen_down CSI + 'J' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_screen\n CLEAR_SCREEN\n end", "def clear\n @window.clear\n @position = [0, 0]\n end", "def clear_screen_up\n CSI + '1J'\n end", "def clear\n\t\t@screen.fill_rect 0, 0, @width, @height, @color_bg\n\tend", "def clear_screen\r\n system('clear') || system('cls')\...
[ "0.7746426", "0.7688686", "0.7439731", "0.7245802", "0.7208296", "0.7168396", "0.71608454", "0.71162194", "0.71142524", "0.7113112", "0.70973295", "0.7090092", "0.70654875", "0.70654875", "0.70444864", "0.70103174", "0.70102483", "0.69253427", "0.69056857", "0.6890207", "0.68...
0.77937084
0
Clear screen up from current position
def clear_screen_up CSI + '1J' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_screen_down\n CSI + 'J'\n end", "def clear\n @window.clear\n @position = [0, 0]\n end", "def clear_screen\n CLEAR_SCREEN\n end", "def reset_screen!\n clear_screen!\n move_to_home!\n end", "def moveUp\n if @y > 1\n call Screen.setColor(false)\n ...
[ "0.728793", "0.7153778", "0.6964245", "0.6857059", "0.68191063", "0.66101307", "0.6607203", "0.65882593", "0.6580574", "0.6580574", "0.6566172", "0.6565531", "0.6564108", "0.65624714", "0.6554776", "0.6537539", "0.652797", "0.6516941", "0.64791864", "0.6444048", "0.64434516",...
0.76238954
0
Before any kind of save, do this. The logic here can be visualized as a 2D grid. On xAxis we have types of input used to build the fragment: Parent Fragement, Input Report, Input URL. On yAxis we have types of scrape expressions used to scrape the input: hpricot, hpricotenumerable, string, gsub, sub, and regexp. This l...
def do_save_logic(record) # After validation, # I either scrape a record.parent.frgtxt or a record.rpt.uurl or record.inputurl case when record.valid? == false record.frgtxt = "<b>The Data In This Fragment Is Invalid.</b>" # 1st branch (the most common) is for when user specifies parent.frgtx...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def process_case(exp)\n obj = exp.shift \n \n with_temporary_variable do |tmp|\n @local_variables_need_no_initialization.add(tmp)\n asgn = want_expression do\n \"#{tmp}=#{process(obj)}\"\n end\n\n new_exp = current_exp = []\n\n while not exp.empty?\n _when = exp.shi...
[ "0.48347938", "0.48276886", "0.4444766", "0.44391984", "0.43331027", "0.43143275", "0.4303309", "0.4268245", "0.42612424", "0.4260773", "0.42321828", "0.4219076", "0.4210599", "0.42043746", "0.41977602", "0.4195675", "0.4179385", "0.41793522", "0.4173791", "0.41629496", "0.41...
0.58538395
0
get_my_hp_elem() Returns Hpricotenumerable from inputs: (HTML, HpricotScrapeExpression)
def get_my_hp_enum(h,scrapeexpr) # Match something like this: "body div.gb2>a[@href*='google.com'],[3,8]" rgxp = /(.*)?(\,)(\[)(\d+)(,)(\d+)(\])$/ # Parse scrapeexpr into 3 pieces. # 1. Hpricot expression # 2. Enumerable starting index # 3. Enumerable size ma = rgxp.match(scrapeexpr).to_a ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_my_hp_elem(u)\n h0 = Hpricot(get_my_html_from_open_uri(u))\n # remove crap\n # (h0/\"script\").remove\n return h0\n end", "def get_my_hp_elem(u)\n h0 = Hpricot(get_my_html_from_open_uri(u))\n # remove crap\n # (h0/\"script\").remove\n return h0\n end", "def get_my_hp_elem(u)\n...
[ "0.678988", "0.678988", "0.678988", "0.591931", "0.5733432", "0.5729707", "0.56760275", "0.56451494", "0.5495085", "0.5422006", "0.5422006", "0.5422006", "0.5422006", "0.5408324", "0.53891015", "0.53686917", "0.53199613", "0.53146476", "0.52946514", "0.5257954", "0.5218767", ...
0.6866231
0
regexp_enumerable(record) Allows user to specify a fragment name and then glue the fragment text to the end of the currently selected parent's text.
def glue_fragment_to_parent(record) # Assume the user passed in the fragment name via the scrape expression. frgname = record.scrapeexpr # Get the text I want to apply glue to. myfrg = Frgmnt.find_by_name(frgname) if myfrg myfrgtxt = Frgmnt.find_by_name(frgname).frgtxt else myfrgtxt ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def regexp_enumerable(record)\n # Assume the parent's fragment text was passed in.\n parent = (record.parent.frgtxt || \"\")\n # copy the scrape expression into a simple variable so I can study it.\n s = record.scrapeexpr\n # Use a regexp to parse s\n # Try to match something like this:\n # s ...
[ "0.6856485", "0.51729727", "0.5032547", "0.50147146", "0.49927005", "0.49567473", "0.49232754", "0.48608738", "0.48434526", "0.48299286", "0.47889456", "0.47838208", "0.47534582", "0.47494546", "0.4727117", "0.472661", "0.47205865", "0.47191557", "0.4712252", "0.46742958", "0...
0.5789262
1
Removes a given type of weapon. As a list of weapon types is not available the number of weapons decreases by 1
def discardWeapon(w) if @nWeapons > 0 @nWeapons -= 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discardWeapon(w)\n if @weapons.length != 0\n position = @weapons.index(w.type)\n if position != nil\n @weapons.delete_at(position)\n else\n raise \"WARNING! No weapon type match at Damage.discardWeapon()\"\n end\n end\n end", "def removeWeapon(w)\n ...
[ "0.72654", "0.7049067", "0.689794", "0.6829643", "0.6690653", "0.6433471", "0.6312176", "0.6305171", "0.6275169", "0.6193958", "0.6079101", "0.5993461", "0.5976264", "0.5969194", "0.5942829", "0.59365475", "0.5925366", "0.5879349", "0.58571994", "0.5812652", "0.58016145", "...
0.7374171
0
PUT /complaints/1 PUT /complaints/1.json
def update @complaint = Complaint.find(params[:id]) respond_to do |format| if @complaint.update_attributes(params[:complaint]) format.html { redirect_to complaints_path} flash[:success] = 'Complaint was successfully updated.' format.json { head :no_content } else for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @complaint = Complaint.find(params[:id])\n\n if @complaint.update_attributes(params[:complaint])\n head :no_content\n else\n render json: @complaint.errors, status: :unprocessable_entity\n end\n end", "def update\n @complaint = Complaint.find(params[:id])\n respond_to do...
[ "0.7088916", "0.6515173", "0.64223486", "0.64223486", "0.61709195", "0.60525835", "0.5981288", "0.59781665", "0.5972368", "0.5951272", "0.59006536", "0.58733934", "0.5856713", "0.5856713", "0.5856713", "0.58495015", "0.5846599", "0.5776827", "0.57630247", "0.575177", "0.57396...
0.662938
1
DELETE /complaints/1 DELETE /complaints/1.json
def destroy @complaint = Complaint.find(params[:id]) @complaint.destroy respond_to do |format| format.html { redirect_to complaints_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @complaint = Complaint.find(params[:id])\n @complaint.destroy\n\n respond_to do |format|\n format.html { redirect_to complaints_url }\n format.json { head :ok }\n end\n end", "def destroy\n @complaint = Complaint.find(params[:id])\n @complaint.destroy\n\n respond_to ...
[ "0.7272488", "0.7125744", "0.7106868", "0.7077669", "0.7021609", "0.69466203", "0.69466203", "0.6945288", "0.6818925", "0.67661715", "0.67596", "0.66644204", "0.6568255", "0.6520036", "0.65041167", "0.6499428", "0.6480473", "0.6438031", "0.6417006", "0.64067024", "0.6406604",...
0.7269257
1
where fileName is the name of the file as a string sepRegex is pattern used to replace file delimination reorder is array of indices at which info appears to acquire below desired format LastName FirstName Gender(Male/Female) DOB(MM/DD/YYYY) FavoriteColor
def read_file(master_list, fileName, sepRegex, reorder) File.foreach("codetest_files/input_files/"+fileName) do |x| newS = x.gsub(/\n/, "").split(sepRegex) newO = { "LastName": newS[0], "FirstName": newS[1], "Gender": newS[reorder[0]][0] == "M" ? "Male" : "Female", "DOB": newS[reorder[1]].gsub(/-/, "/"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gender_and_date_formater\n reorder_info.each do |element| \n if element[2] == \"M\"\n element[2] = \"Male\"\n elsif element[2] == \"F\"\n element[2] = \"Female\"\n end\n if element[3].include?(\"-\")\n element[3].gsub!(/-/, '/')\n end\n end\nend", "def remove_initial_and_forma...
[ "0.5733574", "0.5230208", "0.51984566", "0.51077336", "0.51012653", "0.5097846", "0.49863207", "0.49838063", "0.4980147", "0.49252304", "0.4915743", "0.49124637", "0.4905337", "0.4896422", "0.48656526", "0.48555514", "0.484071", "0.4833222", "0.48029855", "0.47979018", "0.479...
0.5924998
0
GET /euclid_user_messages/1 GET /euclid_user_messages/1.json
def show @euclid_user_message = EuclidUserMessage.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @euclid_user_message } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @euclid_user_message = EuclidUserMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @euclid_user_message }\n end\n end", "def get_messages\n \tuser = User.find(params[:user_id]);\n \tif user\n \t\tmessages = Message.where(message_type...
[ "0.7038695", "0.6595458", "0.6554351", "0.6466178", "0.64551866", "0.64514166", "0.6394321", "0.63527983", "0.63107145", "0.6241473", "0.6232145", "0.6220743", "0.62139547", "0.6188234", "0.61871314", "0.61665106", "0.61461127", "0.6105047", "0.6089142", "0.608798", "0.607812...
0.7595325
0
GET /euclid_user_messages/new GET /euclid_user_messages/new.json
def new @euclid_user_message = EuclidUserMessage.new respond_to do |format| format.html # new.html.erb format.json { render json: @euclid_user_message } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @message = current_user.messages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "def new\n @message = Message.new\n @users = User.all\n\n respond_to do |format|\n format.html # new.html.erb\n forma...
[ "0.81636244", "0.7951787", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.75908995", "0.7587206", ...
0.8070157
1
POST /euclid_user_messages POST /euclid_user_messages.json
def create @euclid_user_message = EuclidUserMessage.new(params[:euclid_user_message]) respond_to do |format| if @euclid_user_message.save format.html { redirect_to @euclid_user_message, notice: 'Euclid user message was successfully created.' } format.json { render json: @euclid_user_messa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @euclid_user_message = EuclidUserMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @euclid_user_message }\n end\n end", "def create\n @message = Message.new(message_params) \n if params.has_key?(:message) and params[:message].has_...
[ "0.6870613", "0.6675839", "0.66601694", "0.64994276", "0.64764136", "0.62988216", "0.6228504", "0.6204809", "0.6167373", "0.6167373", "0.6118277", "0.61156094", "0.60525435", "0.6051376", "0.60362315", "0.6033928", "0.60300285", "0.60247934", "0.6010059", "0.6010059", "0.5967...
0.7363281
0
PUT /euclid_user_messages/1 PUT /euclid_user_messages/1.json
def update @euclid_user_message = EuclidUserMessage.find(params[:id]) respond_to do |format| if @euclid_user_message.update_attributes(params[:euclid_user_message]) format.html { redirect_to @euclid_user_message, notice: 'Euclid user message was successfully updated.' } format.json { head...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n if @user_message.update(user_message_params)\n render :show, status: :ok, location: @user_message\n else\n render json: @user_message.errors, status: :unprocessable_entity\n end\n end", "def update\n if params.has_key?(:message) and params[:message].has_key?(:users)\n @mu...
[ "0.69447726", "0.68689424", "0.6720953", "0.6704909", "0.65836406", "0.6525003", "0.6508128", "0.64660555", "0.64637053", "0.6392494", "0.6378961", "0.6373587", "0.6369964", "0.6340624", "0.6314008", "0.6266807", "0.62611794", "0.6243853", "0.61941916", "0.61912614", "0.61912...
0.7355863
0
DELETE /euclid_user_messages/1 DELETE /euclid_user_messages/1.json
def destroy @euclid_user_message = EuclidUserMessage.find(params[:id]) @euclid_user_message.destroy respond_to do |format| format.html { redirect_to euclid_user_messages_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @user = User.find(params[:user_id])\n @message = @user.messages.find(params[:id])\n @message.destroy\n\n respond_to do |format|\n format.html { redirect_to user_messages_path(@users) }\n format.json { head :no_content }\n end\n end", "def destroy\n @v1_message = V...
[ "0.71662277", "0.7016125", "0.7004674", "0.7004674", "0.69936615", "0.69603336", "0.69159275", "0.6887966", "0.68671024", "0.6864137", "0.68608075", "0.6858138", "0.68361974", "0.68204427", "0.68204427", "0.6810408", "0.68073314", "0.6797975", "0.67862785", "0.67857206", "0.6...
0.7841828
0
dividir todas celulas da linha pelo valor do pivot
def divide_line_by(i,pivot, m) for j in 1..m[0].size-1 m[i][j] /= pivot.to_f end print "Dividir L#{i} por #{pivot}".italic.blue m end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_pivot(col, m)\n aux = 999999\n row = 0\n num_cols = m[0].size\n init = m[0][0] == 'z' ? 1:2\n for i in init..m.size-1\n div = (m[i][col] != 0) ? (m[i][num_cols-1] / m[i][col]) : -1\n if div < aux && div >= 0\n aux = div\n row = i \n end\n end\n m[row][0] = 'X' ...
[ "0.62037826", "0.5523992", "0.5454446", "0.5431267", "0.5418514", "0.53544766", "0.5351532", "0.5287594", "0.52518183", "0.52465975", "0.5242701", "0.5234359", "0.52124417", "0.52031046", "0.52013606", "0.51996213", "0.5199592", "0.5191483", "0.51877767", "0.5173441", "0.5159...
0.676729
0
sets whether the keys in returned hashes should be symbols.
def symbolize_keys=(bool) @key_style = bool ? :sym : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys_to_sym clean: false\n self.inject({}){|memo,(k,v)| memo[clean ? k.to_s.to_clean_sym : k.to_s.to_sym] = (v.is_a?(Hash) || v.is_a?(Array) ? v.keys_to_sym(clean:clean) : v); memo}\n end", "def symbolize_keys; end", "def to_sym!\n self.keys.each do |key| \n self[key.to_sym] = self.de...
[ "0.66636413", "0.6442897", "0.6432321", "0.63902086", "0.62762463", "0.6222383", "0.6205643", "0.62015325", "0.6182028", "0.6182028", "0.6181905", "0.6156889", "0.6150966", "0.61502886", "0.61453396", "0.61389655", "0.6121051", "0.60897624", "0.6075208", "0.6074361", "0.60659...
0.66883296
0
Gets a base url for the associated UAA from the target server by inspecting the links returned from its info endpoint.
def discover_uaa info = server links = info['links'] || info[:links] uaa = links && (links['uaa'] || links[:uaa]) uaa || target end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base\n\t\t\t\tif @api\n\t\t\t\t\treturn @api.base_url\n\t\t\t\telse\n\t\t\t\t\treturn 'http://masterserver.hon.s2games.com/'\n\t\t\t\tend\n\t\t\tend", "def base_url\n base_href || url\n end", "def human_url\n return self.alternate_link\n end", "def get_url\n URI.parse(\"#{@serv...
[ "0.6384935", "0.62692595", "0.62588143", "0.6254399", "0.6253218", "0.6224601", "0.61903024", "0.6189438", "0.6144827", "0.6144064", "0.6088908", "0.6001103", "0.59872913", "0.5965688", "0.5965688", "0.5940333", "0.593252", "0.593252", "0.59311044", "0.5922484", "0.5916538", ...
0.6980025
0
Gets the key from the server that is used to validate token signatures. If the server is configured to use a symetric key, the caller must authenticate by providing a a +client_id+ and +client_secret+. If the server is configured to sign with a private key, this call will retrieve the public key and +client_id+ must be...
def validation_key(client_id = nil, client_secret = nil) hdrs = client_id && client_secret ? { "authorization" => Http.basic_auth(client_id, client_secret)} : {} json_get(target, "/token_key", key_style, hdrs) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def client_key\n @client_key ||= CredentialCache.cache(cache_key(:client_key)) do\n hmac(salted_password, 'Client Key')\n end\n end", "def server_key\n @server_key ||= CredentialCache.cache(cache_key(:server_key)) do\n hmac(salted_password, 'Server Key')\n end\n...
[ "0.6955284", "0.6883397", "0.62166476", "0.61807233", "0.6079994", "0.60688126", "0.60408586", "0.602027", "0.60118246", "0.60118246", "0.59974504", "0.59940374", "0.59940374", "0.5975567", "0.5972861", "0.5972756", "0.5952899", "0.59386086", "0.5936055", "0.5936055", "0.5887...
0.6902439
1
Gets all currently valid token verification keys. If the server has had its signing key changed, then +/token_key+ will return a verification key that does not match a JWT token issued before the change. To validate the signature of these tokens, refer to the +kid+ header of the JWT token. The +validation_keys_hash+ me...
def validation_keys_hash(client_id = nil, client_secret = nil) hdrs = client_id && client_secret ? { "authorization" => Http.basic_auth(client_id, client_secret)} : {} response = json_get(target, "/token_keys", key_style, hdrs) keys_map = {} response['keys'].each do |key| keys_map[key['k...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys\n # Lock for thread safety\n # Only one thread can write to the hash at a time and prevent partial keys from being returned.\n @thread_lock.synchronize do\n if @keys.nil?\n @keys = {}\n @user_keys.each_pair do |name, rsa_keys|\n ...
[ "0.5656677", "0.5623", "0.56132764", "0.53875834", "0.52702427", "0.52023655", "0.518926", "0.5110235", "0.50901335", "0.5071697", "0.50699335", "0.50391555", "0.49875754", "0.4969211", "0.49475792", "0.492626", "0.4887054", "0.4887054", "0.4875346", "0.48267266", "0.48175764...
0.61892825
0
Gets information about the given password, including a strength score and an indication of what strength is required.
def password_strength(password) json_parse_reply(key_style, *request(target, :post, '/password/score', Util.encode_form(password: password), "content-type" => Http::FORM_UTF8, "accept" => Http::JSON_UTF8)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_strength\n minimum_length = 8\n # Regex matches at least one lower case letter, one uppercase and one digit\n complexity_regex = /\\A(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/\n # When a user is updated but not its password, the password param is nil\n if password.present? &&\n (password....
[ "0.7347762", "0.7187966", "0.708025", "0.6876846", "0.6641978", "0.6633113", "0.6625497", "0.65612787", "0.6492926", "0.6492926", "0.64579725", "0.6449746", "0.6449746", "0.64484465", "0.64484465", "0.64360785", "0.63905", "0.6382206", "0.63801533", "0.6330554", "0.6320726", ...
0.77847385
0
should accept a recipe instance as an argument, as well as a date and rating, and create a new recipe card for this user and the given recipe
def add_recipe_card(date, rating, recipe_obj) RecipeCard.new(date, rating, self, recipe_obj) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_recipe_card(date, recipe, rating)\n RecipeCard.new(date, self, recipe, rating)\n end", "def add_recipe_card(recipe, date, rating)\n RecipeCard.new(self, recipe, DateTime.now, rating)\n end", "def add_recipe_card(recipe, date, rating)\n RecipeCard.new(recipe, self, date, rating)\n end", "d...
[ "0.82964146", "0.81818", "0.81740814", "0.81740814", "0.8165204", "0.81257904", "0.8072637", "0.8018206", "0.80175525", "0.80175525", "0.8004935", "0.7931506", "0.79297215", "0.7499457", "0.6861785", "0.6841887", "0.6819467", "0.67810684", "0.6704969", "0.66996855", "0.669716...
0.8241518
1
All property annotations as a hash keyed by name.
def property_annotations trait[:PROPERTIES] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_h\n annotations_hash.dup\n end", "def all_property_hash\n hash = {}\n items = @all_properties\n for prop in items\n hash[prop] = {}\n end\n return hash\n end", "def property_names\n properties.symbolize_keys.keys\n end", "def property_map\n self.class....
[ "0.69019943", "0.6803914", "0.6680808", "0.6655088", "0.66055083", "0.65712315", "0.6341862", "0.6324598", "0.62956315", "0.6291952", "0.6276274", "0.6270883", "0.62450945", "0.62373525", "0.61781037", "0.61642814", "0.61627054", "0.6133452", "0.61213064", "0.60748154", "0.60...
0.6880953
1
Returns the value of attribute required_properties. source://hashie//lib/hashie/dash.rb62
def required_properties; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def required_properties(entity)\n requireds = entity[:children]\n .select { |ch| ch[:required] == true }\n .map { |ch| ch[:name].to_s }\n pre_req = entity[:required].is_a?(Array) ? entity[:required] : []\n { required: requireds | pre_req }\n ...
[ "0.6672369", "0.63661414", "0.6270796", "0.6226242", "0.6226242", "0.6224614", "0.60639954", "0.6022129", "0.6002525", "0.6001743", "0.5999211", "0.59428275", "0.5896092", "0.58735543", "0.58735543", "0.58735543", "0.58735543", "0.58735543", "0.58735543", "0.58735543", "0.587...
0.7197363
0
Returns the specific key coercion for the specified key, if one exists. source://hashie//lib/hashie/extensions/coercion.rb96
def key_coercion(key); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_key(key)\n return key if Symbol === key \n String === key ? key.to_sym : key\n end", "def convert_key(key)\n if regular_key?(key)\n key\n elsif (converted_key = __convert(key)) && regular_key?(converted_key)\n converted_key\n e...
[ "0.6935086", "0.6788864", "0.6321458", "0.6321458", "0.6321458", "0.63065046", "0.624439", "0.6204699", "0.62046623", "0.6197223", "0.6145537", "0.61293405", "0.61293405", "0.6110632", "0.6075272", "0.60209155", "0.5879795", "0.58778566", "0.5874302", "0.5748149", "0.5747184"...
0.7857064
0
Returns a hash of any existing key coercions. source://hashie//lib/hashie/extensions/coercion.rb90
def key_coercions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_coercion(key); end", "def key_coercions=(_arg0); end", "def symbolize_hash_keys(hash); end", "def symbolify_keys( hash )\n\t\t\tnewhash = {}\n\n\t\t\thash.each do |key,val|\n\t\t\t\tkeysym = key.to_s.dup.untaint.to_sym\n\n\t\t\t\tif val.is_a?( Hash )\n\t\t\t\t\tnewhash[ keysym ] = symbolify_keys( val...
[ "0.6893385", "0.6692202", "0.64443475", "0.62448156", "0.62448156", "0.62448156", "0.62448156", "0.61901456", "0.617897", "0.6140913", "0.6121052", "0.61119854", "0.61084986", "0.60877705", "0.6086108", "0.6067661", "0.6061371", "0.6042151", "0.6037695", "0.6019716", "0.59862...
0.73345196
0
Return all value coercions that have the :strict rule as false. source://hashie//lib/hashie/extensions/coercion.rb146
def lenient_value_coercions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strict_value_coercions; end", "def disable_strict!\n @strict = false\n end", "def strict?\n @strict || false\n end", "def enable_strict!\n @strict = true\n end", "def strict; end", "def suggested_strictness; end", "def strict?; @strict; end", "def strict \n @lenient...
[ "0.72008276", "0.6270937", "0.5668231", "0.56277746", "0.56272167", "0.5540896", "0.55228657", "0.55070674", "0.55070674", "0.54969054", "0.5411867", "0.5382408", "0.5342255", "0.53054065", "0.5217796", "0.5185687", "0.5171967", "0.5167444", "0.5135681", "0.50528866", "0.5009...
0.6934788
1
Return all value coercions that have the :strict rule as true. source://hashie//lib/hashie/extensions/coercion.rb141
def strict_value_coercions; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lenient_value_coercions; end", "def enable_strict!\n @strict = true\n end", "def disable_strict!\n @strict = false\n end", "def value_coercion(value); end", "def strict; end", "def suggested_strictness; end", "def strict?; @strict; end", "def strict?\n @strict\n end", "d...
[ "0.6916204", "0.5867584", "0.58172673", "0.5713055", "0.56020975", "0.557952", "0.5508781", "0.5494325", "0.5489274", "0.5432695", "0.5213006", "0.5185578", "0.5185578", "0.515926", "0.5111804", "0.51116", "0.50576", "0.50212765", "0.50122684", "0.49522772", "0.49134278", "...
0.7333419
0
Fetch the value coercion, if any, for the specified object. source://hashie//lib/hashie/extensions/coercion.rb151
def value_coercion(value); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coerce(object)\n self.class.coerce(object)\n end", "def coerce(value)\n Coercion[value.class].public_send(coercion_method, value)\n end", "def coerce(object)\n self.class.coerce(object)\n end", "def coerce(value)\n value\n end", "def strict_value_coer...
[ "0.6520276", "0.6508676", "0.64047116", "0.62479216", "0.62360084", "0.6183502", "0.6147591", "0.6139853", "0.6108782", "0.60088384", "0.59078276", "0.5779885", "0.57680637", "0.5747347", "0.57155514", "0.5670802", "0.566391", "0.56617993", "0.5651247", "0.5631322", "0.562168...
0.72282594
0
Sets the attribute key_coercions
def key_coercions=(_arg0); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def key_coercions; end", "def coerce_key(*attrs); end", "def assoc(key)\n super(convert_key(key))\n end", "def coerce_keys(*attrs); end", "def key_coercion(key); end", "def set_key_statement\n super\n end", "def attributize_keys\n keys.each do |key|\n self[key.parameterize.under...
[ "0.7070905", "0.63299257", "0.59826386", "0.5964819", "0.58939826", "0.5582008", "0.55258703", "0.5440674", "0.54173785", "0.54173785", "0.54173785", "0.53948605", "0.53798187", "0.5364554", "0.5331438", "0.5331438", "0.53130305", "0.5308725", "0.5307983", "0.5255244", "0.522...
0.74019885
0
Returns the value of attribute values_for_properties. source://hashie//lib/hashie/extensions/dash/predefined_values.rb25
def values_for_properties; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def value\n if allows_nil? && properties.values.all?(&:nil?)\n nil\n else\n Hash[properties.map { |key, value| [key, value.value] }]\n end\n end", "def value\n @property_hash[:value]\n end", "def multi_value_extended_properties\n return @multi_valu...
[ "0.6738265", "0.6712486", "0.65843016", "0.65843016", "0.65843016", "0.63943636", "0.63943636", "0.63943636", "0.63227946", "0.6270101", "0.6262504", "0.61806065", "0.61639315", "0.61482215", "0.61064017", "0.61010337", "0.60887265", "0.603635", "0.5976454", "0.59759694", "0....
0.7328608
0
Returns the value of attribute translations_hash. source://hashie//lib/hashie/extensions/dash/property_translation.rb49
def translations_hash; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def translations\n\t\t\tvalues(\"http://scta.info/property/hasTranslation\")\n\t\tend", "def translations\n @translations ||= {}\n end", "def translate_property_value(key)\n return resource_translation_matrix.fetch(key) if resource_translation_matrix &&\n ...
[ "0.6967752", "0.66212136", "0.66060406", "0.6489066", "0.6230516", "0.6218525", "0.61338997", "0.6050432", "0.60353965", "0.60021734", "0.5927799", "0.59274054", "0.58946586", "0.5856608", "0.5853518", "0.58324885", "0.5831791", "0.57972777", "0.5796274", "0.57294565", "0.572...
0.7537
0
Injects indifferent access into a duplicate of the hash provided. See inject! source://hashie//lib/hashie/extensions/indifferent_access.rb71
def inject(hash); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def with_indifferent_access!\n @hash = @hash.with_indifferent_access \n self\n end", "def indifferent_access(params)\n params = indifferent_hash.merge(params)\n params.each do |key, value|\n next unless value.is_a?(Hash)\n params[key] = indifferent_access(value)\n end\n...
[ "0.78713846", "0.6965683", "0.69650793", "0.64043176", "0.6351677", "0.6291893", "0.6291893", "0.6291893", "0.62705916", "0.6264663", "0.6190236", "0.6179541", "0.6088041", "0.60489464", "0.59617794", "0.5905649", "0.5856502", "0.5841938", "0.5833969", "0.58101225", "0.579170...
0.7038152
1
Checks whether this class disables warnings for conflicting keys/methods
def disable_warnings?(method_key = T.unsafe(nil)); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disabled_warnings; end", "def handle_deprecations\n DEPRECATED_KEYS.each do |old, new|\n next unless @options.key?(old)\n\n lock_config.errors[old] = \"is deprecated, use `#{new}: #{@options[old]}` instead.\"\n end\n end", "def warning?\n false\n end", "def _w...
[ "0.69285953", "0.65089357", "0.6488484", "0.63719124", "0.635338", "0.6342992", "0.6301408", "0.6254765", "0.6247276", "0.619983", "0.619983", "0.619983", "0.6191067", "0.61856496", "0.61724716", "0.60879517", "0.60717875", "0.60717875", "0.60717875", "0.60717875", "0.6071787...
0.73975265
0
Converts the key when necessary to access the correct Mash key.
def convert_key(key); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def convert_key(key)\n if regular_key?(key)\n key\n elsif (converted_key = __convert(key)) && regular_key?(converted_key)\n converted_key\n else\n key\n end\n end", "def convert_key(key)\n case key\n when '$'\n 'text...
[ "0.7739782", "0.74814785", "0.72546476", "0.7217763", "0.7206015", "0.7174875", "0.7142854", "0.7037848", "0.6961347", "0.69534105", "0.69342995", "0.692497", "0.6893456", "0.6794073", "0.66900605", "0.66822064", "0.6673311", "0.66174984", "0.66174984", "0.6589736", "0.658400...
0.81009257
1
Stringify all keys recursively within nested hashes and arrays.
def stringify_keys_recursively!(object); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deep_stringify_keys!\n deep_transform_keys!(&:to_s)\n end", "def deep_stringify_keys!\n deep_transform_keys!(&:to_s)\n end", "def deep_stringify_keys!\n deep_transform_keys!(&:to_s)\n end", "def deep_stringify_keys!\n deep_transform_keys! { |key| key.to_s }\n end", "def deep_stringi...
[ "0.79473525", "0.78824455", "0.78824455", "0.7713284", "0.769614", "0.76384825", "0.7597271", "0.7434045", "0.7430469", "0.7409481", "0.72258264", "0.7213962", "0.7150313", "0.712252", "0.70484704", "0.70093805", "0.69396615", "0.6939398", "0.68674636", "0.66501296", "0.66501...
0.8120609
0
Symbolize all keys recursively within nested hashes and arrays.
def symbolize_keys_recursively!(object); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursively_symbolize_keys!(modify_nested_arrays = false)\n replace recursively_symbolize_keys(modify_nested_arrays)\n end", "def deep_symbolize_keys!\n deep_transform_keys!{ |key| key.to_sym rescue key }\n end", "def recursively_symbolize_keys\n recursively_transform_keys { |key| key.to...
[ "0.8068538", "0.8034695", "0.8028553", "0.7996077", "0.79952645", "0.79952645", "0.79688203", "0.79688203", "0.79688203", "0.7797531", "0.77808785", "0.7701259", "0.76565844", "0.76483744", "0.75077355", "0.7435315", "0.7368714", "0.7345293", "0.7341915", "0.7341915", "0.7306...
0.8313075
0
play nice with ActiveSupport Arrayextract_options!
def extractable_options?; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_options(*args)\n args = args.dup\n index = args.rindex { |e| e.is_a?(Hash) } || args.length\n args[-1] = args[index] || {}\n args[index] = nil if index < args.length - 1\n args\n end", "def extractable_options?; true end", "def extract( options )\n \n ...
[ "0.70190865", "0.68780595", "0.6799412", "0.677979", "0.64545125", "0.6416804", "0.6301329", "0.62520665", "0.6240774", "0.6185682", "0.6130404", "0.60649383", "0.60555935", "0.60227454", "0.6006725", "0.5983966", "0.5983966", "0.59573793", "0.59557617", "0.5931449", "0.58876...
0.7218699
0
Creates a new anonymous subclass with key conflict warnings disabled. You may pass an array of method symbols to restrict the disabled warnings to. Hashie::Mash.quiet.new(hash) all warnings disabled. Hashie::Mash.quiet(:zip).new(hash) only zip warning is disabled. source://hashie//lib/hashie/mash.rb111
def quiet(*method_keys); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize( name, opthash={} )\n\t\topthash = symbolify_keys( opthash )\n\t\tself.log.debug \"Symbolified keys: %p\" % [ opthash ]\n\t\toptions = DEFAULT_OPTIONS.merge( opthash )\n\t\t\n\t\tself.log.debug \"Merged options are: %p\" % [ options ]\n\t\treturn super( name, options )\n\tend", "def initialize(ini...
[ "0.5479926", "0.5478762", "0.5478762", "0.53820056", "0.51871634", "0.5147316", "0.5020484", "0.49276704", "0.49245498", "0.48795938", "0.48564988", "0.4836947", "0.4809145", "0.47971332", "0.47855943", "0.47492945", "0.47440606", "0.47407472", "0.47377893", "0.47354347", "0....
0.60472804
0
Return everything that matches the query. source://hashie//lib/hashie/rash.rb88
def all(query); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(query)\n @all.each_with_object([]) do |record, matches|\n matches << record if ((record['866']['t'] == query) || (record['866']['s'] == query))\n end\n end", "def hash_query hash\n\t\t\tx = []\n\t\t\thash.each {|l,m| Array(m).each {|a| x << \"#{l}=#{a}\"}}\n\t\t\t\"?#{x.join(\"&\")}\"\n\t\...
[ "0.64663243", "0.63403904", "0.6127134", "0.60130817", "0.5942023", "0.5912412", "0.5883398", "0.58450645", "0.58390486", "0.58308995", "0.5820947", "0.5820947", "0.5816055", "0.5784923", "0.5761035", "0.5724475", "0.57159007", "0.56825733", "0.56767803", "0.56726843", "0.566...
0.6396271
1
Returns the value of attribute optimize_every. source://hashie//lib/hashie/rash.rb24
def optimize_every; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize_every=(_arg0); end", "def optimize\n operand\n end", "def optimize\n operand\n end", "def calc_karps_algo_values\n 🛑 ::RuntimeError.new(\"| c{CurrencyMatrix}-> m{calc_karps_algo_values} already has warm cache |\") unless @cached_stats[:karp_val...
[ "0.6394006", "0.5660411", "0.56503737", "0.5523166", "0.5341777", "0.5102555", "0.5063269", "0.5017602", "0.49976364", "0.4967902", "0.49169385", "0.49120387", "0.4907279", "0.48892045", "0.48579153", "0.48253977", "0.4816677", "0.47792974", "0.47728062", "0.47728062", "0.476...
0.7012267
0
Sets the attribute optimize_every
def optimize_every=(_arg0); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimize_every; end", "def optimize=(value)\n set_attr(:optimize, value ? 2 : 1)\n @optimize = value\n end", "def force_aggressive=(val)\n if val > 15\n @force_aggressive = 15\n elsif val < 0\n @force_aggressive = 0\n else\n @force_aggressive = val\n end\n end", "...
[ "0.7563658", "0.6675704", "0.56046975", "0.53397506", "0.53397423", "0.51975673", "0.51679045", "0.513183", "0.5111294", "0.5107526", "0.5001039", "0.5000207", "0.49944985", "0.48551488", "0.48467094", "0.48250547", "0.48189378", "0.48156503", "0.48156503", "0.4780804", "0.47...
0.7351933
1
Describes a method by where it was defined.
def method_information(bound_method); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_method_info\n end", "def method_description(method)\n call(\"System.methodDescription\", method)\n end", "def extract_method_details; end", "def get_method_description(class_name, method_name = nil)\n ApipieDSL.debug(\"Getting #{class_name}##{method_name} documentation\")\n ...
[ "0.67109054", "0.666929", "0.66410416", "0.6608892", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.65430236", "0.6542334", "0.6474805", "0.6408321", "0.6389696", "0....
0.694034
0
Duplicates a value or returns the value when it is not duplicable
def safe_dup(value); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def non_duplicated_values(values)\n # Write your code here\n values.uniq!\nend", "def non_duplicated_values(values)\n values.find_all do |e|\n if values.count(e) > 1\n values.delete(e)\n end\n end\n values\nend", "def find_first_dup(num_arr)\r\n set = []\r\n num_arr.each do |value|\r\n ...
[ "0.67155904", "0.6489264", "0.6366179", "0.6336252", "0.62998325", "0.6240868", "0.6237337", "0.62038696", "0.6192069", "0.6176745", "0.61717343", "0.61436445", "0.61436445", "0.6133643", "0.60970163", "0.6076015", "0.60626453", "0.606216", "0.60576904", "0.6055113", "0.60121...
0.6996734
0
GET /provider_payments GET /provider_payments.json
def index @provider_payments = ProviderPayment.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @payment_provider = PaymentProvider.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @payment_provider }\n end\n end", "def index\n @payment_providers = PaymentProvider.all\n end", "def index\n @payment_methods = @...
[ "0.7120997", "0.6878837", "0.68563545", "0.6848495", "0.68086153", "0.67786694", "0.67654455", "0.66107047", "0.65376663", "0.65018183", "0.6379173", "0.63365674", "0.6335731", "0.63272804", "0.632286", "0.632286", "0.63179725", "0.63043517", "0.62780064", "0.6272278", "0.622...
0.71490675
0
PATCH/PUT /provider_payments/1 PATCH/PUT /provider_payments/1.json
def update respond_to do |format| if @provider_payment.update(provider_payment_params) format.html { redirect_to provider_path(@provider_payment.provider), notice: 'Provider payment was successfully updated.' } format.json { render :show, status: :ok, location: @provider_payment } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @payment_provider = PaymentProvider.find(params[:id])\n\n respond_to do |format|\n if @payment_provider.update_attributes(params[:payment_provider])\n format.html { redirect_to @payment_provider, notice: 'Payment provider was successfully updated.' }\n format.json { head :no_c...
[ "0.7029313", "0.6916533", "0.65077025", "0.64197224", "0.63929623", "0.6390315", "0.6358495", "0.6314104", "0.630737", "0.6254437", "0.6230555", "0.62188554", "0.6216365", "0.62144613", "0.61919385", "0.6188595", "0.6188595", "0.6179424", "0.61768675", "0.6158222", "0.6141389...
0.69914734
1
Test simple KAR generation.
def test_simple_kar # Clear the key set keys = ActivatorKeys.new("blarg") keys.reset # Clear the identity id = ActivatorIdentity.new("blarg") id.reset set_dummy_identity(id) # Create the KAR. kar = ActivatorKAR.new("blarg") # Get the identity verified csr_path = id.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ki()\n\n breaker = CodebreakerKIRandom.new(\"Captain Random\")\n breaker.talking = false\n # Testen von vierstelligen codes\n game = play(Game.new(@setting_length,@setting_range, @setting_turns, @dummy_maker,breaker))\n \n # Mindestens 1 Zug und das Spiel muss beendet sein\n assert_t...
[ "0.58074486", "0.5794843", "0.57460636", "0.56321317", "0.5621478", "0.54914236", "0.541349", "0.5392072", "0.53909624", "0.5326323", "0.5306953", "0.5294849", "0.5290506", "0.5286406", "0.5282997", "0.52734774", "0.5267086", "0.5255199", "0.5236735", "0.52364826", "0.5233312...
0.67039144
0
Test KAR generation with parent identity.
def test_with_parent id = ActivatorIdentity.new("blarg") id.reset set_dummy_identity(id) keys = ActivatorKeys.new("blarg") keys.reset # Get the identity verified csr_path = id.get_csr_path cert_path = "/tmp/cert.pem" system("(cd /home/fdgonthier/teambox_ca && ./signit #{csr_pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_generation\n assert_equal '/parents/parent-id/child-id', @rs.generate(:controller => 'children', :action => 'show', :parent_id => 'parent-id', :id => 'child-id')\n end", "def kid_generator; end", "def kid_generator; end", "def kid_generator; end", "def test_simple_kar\n # Clear the key set\...
[ "0.64895946", "0.59579635", "0.59579635", "0.59579635", "0.58933794", "0.5779843", "0.5738736", "0.5670097", "0.5653926", "0.5653926", "0.55512357", "0.5427122", "0.5388007", "0.51934683", "0.51527286", "0.5128435", "0.51274824", "0.5109837", "0.5072281", "0.5037139", "0.4992...
0.7374039
0
Reloading RailsAdmin Config Automatically
def reload_rails_admin RailsAdmin::Config.reset load("#{Rails.root}/config/initializers/rails_admin.rb") Dir.foreach("#{Rails.root}/config/initializers/rails_admin") do |item| next if item == '.' or item == '..' load("#{Rails.root}/config/initializers/rails_admin/#{item}") end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reload_config\n @config = nil\n end", "def reload_config!\n @config = nil\n load_config!\n self\n end", "def reconfig(config)\n self.config = config\n end", "def update_all_config\n @admin.updateConfiguration\n end", "def reload_configuration!\n @con...
[ "0.704357", "0.69392", "0.6682528", "0.6651922", "0.6600198", "0.6600198", "0.65985596", "0.63916653", "0.6336533", "0.62729764", "0.6244442", "0.6168542", "0.61398053", "0.6131059", "0.6120846", "0.61173546", "0.61173546", "0.61173546", "0.61173546", "0.61173546", "0.6117354...
0.80982286
0
Making mocking up HTTP responses easy.
def mock_response(status_code, body_str='') response_class = Net::HTTPResponse::CODE_TO_OBJ[status_code.to_s] response = response_class.new('1.1', status_code.to_s, '') response.instance_eval("def body; #{body_str.inspect}; end") response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mas_net_http_response(status = :success, \n body = '', \n obj_stubs = {})\n response = Spec::Mocks::Mock.new(Net::HTTPResponse)\n response.stub!(:body).and_return(body)\n case status\n when :success || 200\n _create_http_response(response, \"200\", \"OK\...
[ "0.7466614", "0.74615353", "0.7166524", "0.71443605", "0.7137952", "0.7086507", "0.7025976", "0.6975634", "0.68822044", "0.6865369", "0.6736494", "0.6736494", "0.6722351", "0.67002517", "0.6657798", "0.66159123", "0.66159123", "0.6533883", "0.6495991", "0.6495991", "0.6486711...
0.78322405
0
DB open mode = :immediate or :deferred or :exclusive
def open( tran: false, mode: :immediate ) # tran = true transaction #DBlog::stoD( parse_caller( caller.first ) ) if $debug == true @db = SQLite3::Database.new( @DBfile ) @db.busy_timeout(1000) ecount = 0 roll = false begin roll = false if tran == true @db.transaction( m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open\n create_database\n end", "def open(opts)\n db = Database.new(opts)\n yield db if block_given?\n db\n end", "def open_db\n if Config.db =~ /^sqlite:\\/{3}(.+)$/\n dir = File.dirname($1)\n FileUtils.mkdir_p(dir) unless File.directory?(dir)\n end\n\n Se...
[ "0.6499185", "0.6468495", "0.62390596", "0.61797816", "0.6084476", "0.6080953", "0.6077818", "0.6069896", "0.6057297", "0.6053418", "0.6053418", "0.5984197", "0.59667516", "0.592768", "0.5920507", "0.59180194", "0.5891497", "0.5888187", "0.5888187", "0.5882343", "0.58789617",...
0.6940807
0
Returns an authorization division.
def get_authorization_division_with_http_info(division_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AuthorizationApi.get_authorization_division ..." end # verify the required parameter 'division_id' is set fail ArgumentError, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_authorization_division_with_http_info(division_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ObjectsApi.get_authorization_division ...\"\n end\n \n \n # verify the required parameter 'division_id' is set\n fail Argumen...
[ "0.66038865", "0.6277761", "0.6275038", "0.6238848", "0.6230237", "0.6230237", "0.6142216", "0.61095405", "0.6068307", "0.6042039", "0.59918636", "0.5965238", "0.5895538", "0.5849138", "0.58270276", "0.5797388", "0.57049316", "0.5636298", "0.56237316", "0.5588391", "0.5574190...
0.66963124
0
Retrieve the home division for the organization. Will not include object counts.
def get_authorization_divisions_home(opts = {}) data, _status_code, _headers = get_authorization_divisions_home_with_http_info(opts) return data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_authorization_divisions_home_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ObjectsApi.get_authorization_divisions_home ...\"\n end\n \n # resource path\n local_var_path = \"/api/v2/authorization/divisions/home\"....
[ "0.6005039", "0.58939666", "0.58679086", "0.5841622", "0.5807187", "0.573727", "0.5685813", "0.5685126", "0.5650971", "0.55664223", "0.553545", "0.55044264", "0.54846036", "0.54833704", "0.5447008", "0.54000205", "0.5389161", "0.53682536", "0.53111935", "0.5296811", "0.529304...
0.6609563
1
Returns which divisions the current user has the given permission in. This route is deprecated, use authorization/divisionspermitted/paged/me instead.
def get_authorization_divisionspermitted_me(permission, opts = {}) data, _status_code, _headers = get_authorization_divisionspermitted_me_with_http_info(permission, opts) return data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_authorization_divisionspermitted_paged_me(permission, opts = {})\n data, _status_code, _headers = get_authorization_divisionspermitted_paged_me_with_http_info(permission, opts)\n return data\n end", "def get_authorization_divisionspermitted_paged_me_with_http_info(permission, opts = {})\n ...
[ "0.6509501", "0.6435642", "0.6210755", "0.59575856", "0.5808805", "0.5804043", "0.5668085", "0.55075204", "0.54645926", "0.5390839", "0.53629726", "0.53474796", "0.53223825", "0.5317012", "0.53157395", "0.53108966", "0.5297406", "0.5290272", "0.52898455", "0.52840364", "0.528...
0.645593
1
Get an org role to default role comparison Compares any organization role to a default role id and show differences
def get_authorization_role_comparedefault_right_role_id_with_http_info(left_role_id, right_role_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: AuthorizationApi.get_authorization_role_comparedefault_right_role_id ..." end # verify the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_roles\n if self.user_type == \"admin\"\n self.role_ids = 1\n elsif self.user_type == \"student\"\n self.role_ids = 10\n end\n end", "def role?(role_to_compare)\n self.role.to_s == role_to_compare.to_s\n end", "def role_for(cdmp)\n case cdmp.role\n when 'http://credit.n...
[ "0.5810915", "0.5761489", "0.57061946", "0.56979746", "0.5663171", "0.5649507", "0.55801916", "0.5513682", "0.54742396", "0.5428138", "0.5404659", "0.53965867", "0.53679323", "0.5348236", "0.53428787", "0.5335718", "0.5329591", "0.5308295", "0.5300613", "0.5298003", "0.529731...
0.6130224
0
Get the count of roles granted to a list of subjects
def get_authorization_subjects_rolecounts(opts = {}) data, _status_code, _headers = get_authorization_subjects_rolecounts_with_http_info(opts) return data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_subjects\n Subject.count(:id)\n end", "def get_num_roles\n get_roles.size\n end", "def roles_count_total\n count = roles.to_a.count\n sub_circles.each do |sc|\n count += sc.roles_count_total\n end\n count\n end", "def is_subject_in_role\n @subject = @client.subj...
[ "0.7585425", "0.6831951", "0.6777211", "0.65973186", "0.65711844", "0.6338441", "0.62387776", "0.62101847", "0.6171309", "0.6124888", "0.60980743", "0.6090379", "0.6013668", "0.59697825", "0.59670997", "0.5906638", "0.5906638", "0.5809243", "0.58084506", "0.5806637", "0.57954...
0.7086804
1
Bulkremove grants from a subject.
def post_authorization_subject_bulkremove(subject_id, body, opts = {}) post_authorization_subject_bulkremove_with_http_info(subject_id, body, opts) return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def revoke_all_permissions\n update_column(:admin, nil)\n UserPermission.where(user_id: id).each(&:destroy)\n end", "def delete_perms!\n perms.destroy_all\n end", "def remove (*perms)\n perms = perms.map(&:to_s)\n delete(*proxy_target.select{|a|perms.include?(a.permission.name)})\n end"...
[ "0.60346884", "0.6002708", "0.5987839", "0.5869781", "0.5746784", "0.57187593", "0.5707898", "0.5635004", "0.56249934", "0.55947244", "0.55826545", "0.55569845", "0.5554646", "0.552425", "0.551762", "0.5489119", "0.54645383", "0.54547656", "0.54426485", "0.5420974", "0.539807...
0.635239
0
Create the Vagrantfile for the NodeSet.
def create_vagrantfile output << bold(color("localhost$", :green)) << " cd #{@vagrant_path}\n" FileUtils.mkdir_p(@vagrant_path) File.open(File.expand_path(File.join(@vagrant_path, "Vagrantfile")), 'w') do |f| f.write('Vagrant.configure("2") do |c|' + "\n") nodes.each do |k,v| ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_vagrantfile\n output << bold(color(\"localhost$\", :green)) << \" cd #{@vagrant_path}\\n\"\n FileUtils.mkdir_p(@vagrant_path)\n File.open(File.expand_path(File.join(@vagrant_path, \"Vagrantfile\")), 'w') do |f|\n f.write('Vagrant.configure(\"2\") do |c|' + \"\\n\")\n nodes.e...
[ "0.80685204", "0.72820765", "0.6873046", "0.6738601", "0.6607494", "0.6443382", "0.63602406", "0.6330274", "0.6207157", "0.61921155", "0.61913955", "0.61798674", "0.6171096", "0.6150304", "0.60705733", "0.6026914", "0.5934388", "0.59090936", "0.5896704", "0.5891982", "0.58421...
0.8050141
1
Here we get vagrant to drop the ssh_config its using so we can monopolize it for transfers and custom stuff. We drop it into a single file, and since its indexed based on our own node names its quite ideal.
def ssh_config ssh_config_path = File.expand_path(File.join(@vagrant_path, "ssh_config")) begin File.unlink(ssh_config_path) rescue Errno::ENOENT end self.nodes.each do |k,v| Dir.chdir(@vagrant_path) do result = systemu("vagrant ssh-config #{k} >> #{ssh_config_pat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ssh_config\n ssh_config_path = File.expand_path(File.join(@vagrant_path, \"ssh_config\"))\n begin\n File.unlink(ssh_config_path)\n rescue Errno::ENOENT\n end\n self.nodes.each do |k,v|\n Dir.chdir(@vagrant_path) do\n systemu(\"vagrant ssh-config #{k} >> #{ssh_con...
[ "0.7891537", "0.6360405", "0.6305405", "0.6269809", "0.61552614", "0.6121416", "0.61208135", "0.6083232", "0.60086364", "0.5980818", "0.5956555", "0.59543645", "0.5934145", "0.59126705", "0.5896204", "0.5866824", "0.5858578", "0.58147717", "0.58072466", "0.579147", "0.5757479...
0.78132814
1
Execute vagrant command in vagrant_path
def vagrant(args) Dir.chdir(@vagrant_path) do system("vagrant #{args}") end nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def continue\n exec(\"vagrant #{ARGV[0]}\")\nend", "def vagrant_provision\n if @env\n puts \"Running vagrant provision.\"\n @env.cli(\"provision\") && FileUtils.touch('.vagrant_last_provisioned')\n else\n puts \"Setting up vagrant environment.\"\n setup_vagrant && FileUtils.touch('.vagrant_last_pr...
[ "0.7519667", "0.7451488", "0.74247247", "0.712876", "0.6748042", "0.66231793", "0.66231793", "0.66201323", "0.65968114", "0.6591774", "0.654435", "0.6438935", "0.6402452", "0.6350196", "0.6308707", "0.6283208", "0.6265899", "0.6246797", "0.6246536", "0.62363994", "0.62146336"...
0.84270614
1
Returns a list of options that apply to all types of vagrant providers
def global_vagrant_options ['ip'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def provisioners(type, env)\n env[:machine].config.vm.provisioners.select do |provisioner|\n # Vagrant 1.7 changes provisioner.name to provisioner.type\n if provisioner.respond_to? :type\n provisioner.type.to_sym == type\n else\n provisioner.name.to_sym == ty...
[ "0.66682535", "0.63822144", "0.62023735", "0.61570376", "0.5939721", "0.59122103", "0.5889918", "0.58547235", "0.5852844", "0.58339983", "0.57238173", "0.5712645", "0.5676234", "0.56058496", "0.5601267", "0.5589892", "0.55673486", "0.55327487", "0.5522082", "0.5509594", "0.54...
0.64860195
1
Called via an AJAX method to load a widget into a profile page The widgets to be loaded are defined in the Configuration model class.
def load_profile_widget # get name of widget to load @widget_name = params[:name] user_id = params[:user_id] content_id = params[:content_id] # HTML widgets also pass a content_id which is used to identify content in the db if content_id @content = HtmlContent.find_by_content_id(content_id) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def widget\n @widget = \"#{params[:name].camelize}Widget\".constantize.new(current_user)\n respond_to do |format|\n format.js\n end\n end", "def load_widget_data\n if @current_template && @account\n # Build query of only the necessary ids, from the widgets \n unless @current...
[ "0.6751584", "0.66260964", "0.6378973", "0.6132199", "0.6132199", "0.6059614", "0.60586125", "0.60057604", "0.5935615", "0.58936155", "0.5889941", "0.58786356", "0.58746827", "0.58746827", "0.58652306", "0.5861837", "0.5859977", "0.5829573", "0.58131444", "0.5805273", "0.5757...
0.762455
0
It is often convenient to trigger a run after all files have been processed, which is what `autorun!` sets up for you. Requiring `xspec/autorun` does this automatically for you.
def autorun! at_exit do exit 1 unless run! end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fire!\n if @setup_file\n vmsg \"Running #{@setup_file} first\"\n load @setup_file\n else\n vmsg \"No setup file #{@setup_file} to run\"\n end\n if @options.run_separately\n @files.each { |file|\n _print_banner(file)\n load file\n Whitestone.run(_whitestone_o...
[ "0.65546453", "0.6070072", "0.60544014", "0.5977021", "0.597488", "0.59560716", "0.58911794", "0.5889872", "0.5888296", "0.58655864", "0.5816043", "0.57755786", "0.57296574", "0.57012635", "0.5696552", "0.5688706", "0.5688268", "0.5676069", "0.5673564", "0.56626356", "0.56592...
0.62106663
1
Array of DO::Server defined in our tasks
def servers @_servers ||= [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def servers\n servers_for\n end", "def servers\n configuration.servers\n end", "def all_servers\n Infrataster::Server.defined_servers.map { |i| server(i.name) }\nend", "def servers\n @config['servers'].map { |server| server.split(/:/) }\n end", "def all_server_hosts\n [server_host...
[ "0.7069095", "0.70000976", "0.6968752", "0.69290847", "0.6864695", "0.67903763", "0.67548144", "0.67383486", "0.6737676", "0.6729125", "0.66525334", "0.6636436", "0.65997607", "0.6586979", "0.65475863", "0.6532578", "0.652448", "0.6507781", "0.6473653", "0.64463514", "0.63861...
0.74881315
1
Returns the current server
def current_server @_current_server end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_server\n get_general['server']\n end", "def server\n servers[0]\n end", "def current_server\n drb = Thread.current['DRb']\n server = (drb && drb['server']) ? drb['server'] : @primary_server\n raise DRbServerNotFound unless server\n return server\n end", "def curre...
[ "0.8290399", "0.80755013", "0.8053987", "0.792721", "0.78624916", "0.7746225", "0.7610571", "0.7610571", "0.75330627", "0.7500591", "0.7447766", "0.73946637", "0.7392553", "0.7373715", "0.7298167", "0.7298167", "0.72376955", "0.7180148", "0.7154964", "0.70967656", "0.7088182"...
0.8978579
1
Install in your DO_PATH a remote task === Examples You can install/update task with rake plugin:configuration plugin "configuration", "
def plugin(name, repo) desc "install #{name} plugin" local("plugin:#{name}" => :setup) do log "\e[36m## Installing plugin %s\e[0m" % name Dir.mkdir(DO_PATH) unless File.exist?(DO_PATH) sh "curl --location --progress-bar #{repo} > #{File.join(DO_PATH, '%s.rake' % name)}" end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plugin(name, repo)\n desc \"install #{name} plugin\"\n namespace :plugin do\n task(name => 'setup') do\n log \"\\e[36m## Installing plugin %s\\e[0m\" % name\n Dir.mkdir(DO_PATH) unless File.exist?(DO_PATH)\n path = File.join(DO_PATH, '%s.rake' % name)\n sh :...
[ "0.72853726", "0.6600198", "0.6557056", "0.65475863", "0.6532954", "0.62974006", "0.61410373", "0.60430104", "0.59637755", "0.5963575", "0.5963575", "0.5928617", "0.592753", "0.5896712", "0.5893584", "0.5878032", "0.5865218", "0.58644134", "0.5855978", "0.58546245", "0.582963...
0.6755239
1
Log text under current_server if available
def log(text="", new_line=true) if current_server current_server.log(text, new_line) else text += "\n" if new_line && text[-1] != ?\n print(text) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log(text=\"\", new_line=true)\n current_server ? current_server.log(text, new_line) : super(text, new_line)\n end", "def log(message); logger.info(message); end", "def _log(text)\n\t\topen($location+\"/logs/class.log\", 'a') { |f| f.puts(\"[\"+DateTime.now.strftime('%Y-%m-%d %H:%M:%S')+\"] \"+text+...
[ "0.7437334", "0.60696906", "0.6068295", "0.6052691", "0.6044265", "0.6044002", "0.60040265", "0.59499985", "0.59143746", "0.5883539", "0.58665794", "0.5808498", "0.57997626", "0.5798581", "0.5794195", "0.5794195", "0.5794195", "0.578803", "0.57843107", "0.5775791", "0.5768549...
0.7027695
1
To check company roles for previleges
def role_company if current_user.company.roles.collect {|x| x.id}.include?(params[:role_id].to_i) return true else redirect_to admin_roles_path end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_user_role \t \n redirect_to root_path unless current_user.roles.first.name == \"empleado\" or current_user.roles.first.name == \"supervisor\"or current_user.roles.first.name == \"admin\" \n end", "def check_role\n redirect_to root_path unless current_user && current_user.evo_team?\n end", "...
[ "0.6846923", "0.65234345", "0.6475683", "0.6444058", "0.63270867", "0.63270867", "0.63197017", "0.628891", "0.6282236", "0.6244125", "0.62414473", "0.62169987", "0.6120344", "0.6029141", "0.59965986", "0.59907484", "0.5985104", "0.5973049", "0.59721977", "0.59681225", "0.5916...
0.67541367
1
GET /counties/new GET /counties/new.xml
def new @county = County.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @county } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @county = County.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @county }\n end\n end", "def new\n @countries = Countries.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @countries }...
[ "0.63464636", "0.6141042", "0.60698307", "0.6063556", "0.5878847", "0.581695", "0.58033884", "0.5780103", "0.57787186", "0.5764937", "0.5748091", "0.5747234", "0.5731654", "0.5729598", "0.57293797", "0.57292956", "0.57292956", "0.5721838", "0.5718468", "0.57142746", "0.570244...
0.68008053
0
POST /counties POST /counties.xml
def create @county = County.new(params[:county]) respond_to do |format| if @county.save flash[:notice] = 'County was successfully created.' format.html { redirect_to(@county) } format.xml { render :xml => @county, :status => :created, :location => @county } else for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def counties\n @retailer = Retailer.find(params[:retailer_id])\n @counties = Spree::County.find_all_by_state_id(@retailer.physical_address.state_id)\n end", "def create\n @county = County.new(params[:county])\n\n respond_to do |format|\n if @county.save\n format.html { redire...
[ "0.60179836", "0.5965717", "0.5740262", "0.5628242", "0.5547819", "0.54523295", "0.5396117", "0.53048956", "0.52119154", "0.51622224", "0.5143736", "0.5093363", "0.5034413", "0.501669", "0.4963026", "0.4959443", "0.4953157", "0.4953075", "0.49269065", "0.49239063", "0.4880443...
0.6144903
0
PUT /counties/1 PUT /counties/1.xml
def update @county = County.find(params[:id]) respond_to do |format| if @county.update_attributes(params[:county]) flash[:notice] = 'County was successfully updated.' format.html { redirect_to(@county) } format.xml { head :ok } else format.html { render :action => "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @county = County.find(params[:id])\n\n respond_to do |format|\n if @county.update_attributes(params[:county])\n format.html { redirect_to @county, notice: 'County was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: ...
[ "0.5898938", "0.5876884", "0.57380694", "0.561145", "0.5536016", "0.54822856", "0.5468542", "0.5468542", "0.5468542", "0.5405714", "0.534793", "0.5282741", "0.525097", "0.52062786", "0.520014", "0.5186815", "0.5169634", "0.5143588", "0.51093537", "0.51050013", "0.50832903", ...
0.61539173
0
DELETE /counties/1 DELETE /counties/1.xml
def destroy @county = County.find(params[:id]) @county.destroy respond_to do |format| format.html { redirect_to(counties_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @counties = County.all\n @county = County.find(params[:id])\n @county.destroy\n end", "def destroy\n @county = County.find(params[:id])\n @county.destroy\n\n respond_to do |format|\n format.html { redirect_to counties_url }\n format.json { head :no_content }\n end\n ...
[ "0.67548275", "0.66082436", "0.6104723", "0.6053569", "0.6034732", "0.60260516", "0.60220706", "0.6000089", "0.59930974", "0.598156", "0.5980034", "0.595421", "0.5948588", "0.5942453", "0.59189594", "0.5874989", "0.5856723", "0.5834611", "0.5832842", "0.5825823", "0.581293", ...
0.71707827
0
POST /parte_laboratorios POST /parte_laboratorios.json
def create @parte_laboratorio = ParteLaboratorio.new(parte_laboratorio_params) respond_to do |format| if @parte_laboratorio.save format.html {redirect_to @parte_laboratorio, notice: 'Parte laboratorio creado correctamente.'} format.json {render :show, status: :created, location: @parte_la...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def laboratorio_params\n params.require(:laboratorio).permit(:laboratorio_id, :nome, :localizacao, :descricao, :responsavel_id)\n end", "def laboratorio_params\n params.require(:laboratorio).permit(:nome, :localizacao, :descricao, :responsavel_id)\n end", "def create\n @laboratorio = Laborat...
[ "0.7296365", "0.7288592", "0.71845555", "0.7143174", "0.70791304", "0.705296", "0.70420027", "0.7017948", "0.6957564", "0.6903484", "0.68805254", "0.68034935", "0.67989194", "0.67162585", "0.655351", "0.65369374", "0.64998883", "0.6440752", "0.6347215", "0.632043", "0.6315163...
0.74203956
0
PATCH/PUT /parte_laboratorios/1 PATCH/PUT /parte_laboratorios/1.json
def update respond_to do |format| if @parte_laboratorio.update(parte_laboratorio_params) format.html {redirect_to @parte_laboratorio, notice: 'Parte laboratorio actualizado correctamente.'} format.json {render :show, status: :ok, location: @parte_laboratorio} else format.html {re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @laboratorio.update(laboratorio_params)\n format.html { redirect_to \"/laboratorios\", notice: 'Laboratorio actualizado con éxito.' }\n format.json { render :show, status: :ok, location: @laboratorio }\n else\n format.html { render :edit }\...
[ "0.6777435", "0.673634", "0.6680292", "0.66780365", "0.6571541", "0.6528114", "0.6469814", "0.62824994", "0.6271734", "0.6260667", "0.62476295", "0.62476295", "0.62476295", "0.62476295", "0.6181015", "0.61728495", "0.61664957", "0.6145909", "0.61401105", "0.6132926", "0.61318...
0.69729894
0
DELETE /parte_laboratorios/1 DELETE /parte_laboratorios/1.json
def destroy @parte_laboratorio.destroy respond_to do |format| format.html {redirect_to parte_laboratorios_url, notice: 'Parte laboratorio eliminado correctamente.'} format.json {head :no_content} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n \n @laboratorio.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end", "def destroy\n laboratory_id = params[:id]\n\n begin\n @laboratory = Laboratory.find(laboratory_id)\n\n ...
[ "0.7536059", "0.7261681", "0.71827036", "0.7178593", "0.71012557", "0.7054599", "0.70151746", "0.70135695", "0.70029783", "0.69506586", "0.69309336", "0.6922311", "0.6922108", "0.6919533", "0.69151324", "0.69131273", "0.6885289", "0.68798256", "0.68783194", "0.6861933", "0.68...
0.7541582
0
NOTE: for the convert_from_foo methods below... openstackcompute gives Hash for 'flavors' but OpenStack::Compute::Flavor for 'flavor' hence the use of 'send' to deal with both cases and save duplication
def convert_from_flavor(flavor) op = (flavor.class == Hash)? :fetch : :send hwp = HardwareProfile.new(flavor.send(op, :id).to_s) do architecture 'x86_64' memory flavor.send(op, :ram).to_i storage flavor.send(op, :disk).to_i cpu flavor.send(op, :vcpus)....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_flavor\n if attributes[:flavor_id]\n flavor = @service.flavors.get(attributes[:flavor_id])\n flavor.nil? and Fog::Errors::Error.new(\"Unrecognized flavor in #{self.class}##{__method__}\")\n attributes[:cpu] = flavor.cpu\n attributes[:ram] = flavor.ra...
[ "0.66171277", "0.6080747", "0.5863159", "0.57808274", "0.5619931", "0.5464602", "0.5439425", "0.53751916", "0.5331977", "0.5325427", "0.53164995", "0.5316277", "0.52487224", "0.5238007", "0.5215561", "0.5211092", "0.518826", "0.5173716", "0.51697546", "0.5151131", "0.5123113"...
0.660832
1
GET /quantile_settings/1 GET /quantile_settings/1.json
def show @quantile_setting = QuantileSetting.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @quantile_setting } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @quantile_setting = QuantileSetting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quantile_setting }\n end\n end", "def create\n @quantile_setting = QuantileSetting.new(params[:quantile_setting])\n\n respond_to do |format|\n if ...
[ "0.6596627", "0.600839", "0.59745467", "0.59049743", "0.5671011", "0.5646111", "0.55791575", "0.55791575", "0.55594754", "0.5375236", "0.5333105", "0.5329644", "0.5304014", "0.52989215", "0.5295785", "0.5263235", "0.5262835", "0.52541476", "0.5204509", "0.5184224", "0.5180918...
0.72986156
0
GET /quantile_settings/new GET /quantile_settings/new.json
def new @quantile_setting = QuantileSetting.new respond_to do |format| format.html # new.html.erb format.json { render json: @quantile_setting } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @quantile_setting = QuantileSetting.new(params[:quantile_setting])\n\n respond_to do |format|\n if @quantile_setting.save\n format.html { redirect_to quantile_settings_path, notice: 'Quantile setting was successfully created.' }\n format.json { render json: @quantile_setting, ...
[ "0.75612074", "0.6996718", "0.643337", "0.6128356", "0.61251664", "0.61104757", "0.60604775", "0.6006409", "0.59676534", "0.5962309", "0.59533846", "0.59124565", "0.58464867", "0.58267146", "0.580428", "0.58007294", "0.5797853", "0.57909614", "0.5780019", "0.57412773", "0.571...
0.8149839
0
POST /quantile_settings POST /quantile_settings.json
def create @quantile_setting = QuantileSetting.new(params[:quantile_setting]) respond_to do |format| if @quantile_setting.save format.html { redirect_to quantile_settings_path, notice: 'Quantile setting was successfully created.' } format.json { render json: @quantile_setting, status: :cr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @quantile_setting = QuantileSetting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quantile_setting }\n end\n end", "def update\n @quantile_setting = QuantileSetting.find(params[:id])\n\n respond_to do |format|\n if @quantile_set...
[ "0.63756776", "0.59945965", "0.577618", "0.57160974", "0.55211985", "0.54382956", "0.543478", "0.5393258", "0.5374552", "0.5344037", "0.53400415", "0.5322921", "0.5302094", "0.53016", "0.5264525", "0.52380294", "0.5142131", "0.5116386", "0.51160765", "0.50989205", "0.5090592"...
0.71077263
0
PUT /quantile_settings/1 PUT /quantile_settings/1.json
def update @quantile_setting = QuantileSetting.find(params[:id]) respond_to do |format| if @quantile_setting.update_attributes(params[:quantile_setting]) format.html { redirect_to quantile_settings_path, notice: 'Quantile setting was successfully updated.' } format.json { head :no_content...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @quantile_setting = QuantileSetting.new(params[:quantile_setting])\n\n respond_to do |format|\n if @quantile_setting.save\n format.html { redirect_to quantile_settings_path, notice: 'Quantile setting was successfully created.' }\n format.json { render json: @quantile_setting, ...
[ "0.6585245", "0.62032", "0.61069757", "0.59493464", "0.58764917", "0.583794", "0.57632744", "0.57272476", "0.57010734", "0.5660648", "0.56441545", "0.56441545", "0.5508703", "0.5495471", "0.54605836", "0.54447347", "0.54427606", "0.54251313", "0.5417415", "0.5417415", "0.5413...
0.7384463
0
DELETE /quantile_settings/1 DELETE /quantile_settings/1.json
def destroy @quantile_setting = QuantileSetting.find(params[:id]) @quantile_setting.destroy respond_to do |format| format.html { redirect_to quantile_settings_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @quantile_period = QuantilePeriod.find(params[:id])\n @quantile_period.destroy\n\n respond_to do |format|\n format.html { redirect_to quantile_periods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @throughput_metric.destroy\n respond_to do |forma...
[ "0.62478", "0.6210751", "0.60562205", "0.60316736", "0.5957259", "0.5927744", "0.5918093", "0.5894288", "0.58872676", "0.5882776", "0.58752334", "0.5853178", "0.58201927", "0.5806759", "0.58061165", "0.57918155", "0.57898694", "0.5789295", "0.5765716", "0.5754181", "0.5752163...
0.76078224
0
Call this method to regenerate the map list
def refresh_list clear_elements Game.instance.database.each_pair do |_, map| next unless Models::Map === map add_entry :map, name: "#{map.id} - #{map.name}", map_id: map.id, map: map, enabled: true end self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_map\n end", "def generate_initial_map\n for _ in 0...@height\n temp = []\n for _ in 0...@width\n temp.push(@WALL)\n end\n @map.push(temp)\n end\n end", "def set_map\n # Sets locations on the map\n @map = [\n ['...
[ "0.7341242", "0.6384696", "0.6307734", "0.61629575", "0.6094596", "0.60637987", "0.60416704", "0.6039363", "0.6023304", "0.6019625", "0.60043955", "0.599397", "0.59785277", "0.5976487", "0.5952087", "0.5929665", "0.5910033", "0.5903961", "0.5900312", "0.58672154", "0.5847514"...
0.75004584
0
Pick the best node from each of the candidate nodes a sequence_id, and return an array [best_node, best_noded_read.direction, best_noded_read] or [] if no probe could be found
def pick_best_node_for_read_id(sequence_id, nodes) best_node = nodes.min do |n1, n2| r1 = n1.short_reads.find{|r| r.read_id == sequence_id} r2 = n2.short_reads.find{|r| r.read_id == sequence_id} r1.start_coord <=> r2.start_coord end if best_node best_noded...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_probes_from_read_to_node(graph, read_to_node, probe_sequence_ids)\n return probe_sequence_ids.collect do |sequence_id|\n nodes = read_to_node[sequence_id].collect{|node_id| graph.nodes[node_id]}\n pick_best_node_for_read_id(sequence_id, nodes)\n end\n end", "def look...
[ "0.66374403", "0.5312707", "0.52724504", "0.52359265", "0.5148897", "0.5090312", "0.50668824", "0.49966592", "0.49121547", "0.48974118", "0.48951876", "0.48632154", "0.48377594", "0.48083752", "0.47962272", "0.4746786", "0.47190574", "0.4714482", "0.4707538", "0.46876454", "0...
0.81572527
0
Pick the best nodes from each of the probe sequences, and return an array for each probe sequence: ( [best_node, best_noded_read.direction, best_noded_read] or [] if no probe could be found )
def find_probes_from_read_to_node(graph, read_to_node, probe_sequence_ids) return probe_sequence_ids.collect do |sequence_id| nodes = read_to_node[sequence_id].collect{|node_id| graph.nodes[node_id]} pick_best_node_for_read_id(sequence_id, nodes) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pick_best_node_for_read_id(sequence_id, nodes)\n best_node = nodes.min do |n1, n2|\n r1 = n1.short_reads.find{|r| r.read_id == sequence_id}\n r2 = n2.short_reads.find{|r| r.read_id == sequence_id}\n r1.start_coord <=> r2.start_coord\n end\n if best_node\n ...
[ "0.6993834", "0.6259077", "0.6071199", "0.5287576", "0.52286744", "0.506277", "0.49874952", "0.48321852", "0.47722837", "0.47121048", "0.46397462", "0.46353668", "0.46282652", "0.46057335", "0.45958564", "0.45939153", "0.4593512", "0.45853037", "0.4549032", "0.4533098", "0.45...
0.71155673
0
TRAC 195 Controllers Users_Controller Company_Pending Will redirect a user if thye try to get into an employee that is marked as 'company pending'
def company_pending if (!User.find_by_id_and_company_pending(params[:id], 1).blank?) flash[:error] = t("controllers.user_dont_touch") redirect_to root_url end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def company_active\n\t id = params[:company_id]\n\t id ||= params[:id]\n\t comp = Company.find(id)\n\t unless comp.state <= COMPANY_STATE[:active]\n\t redirect_to company_blocked_path comp\n\t end\n\t end", "def company_required\n redirect_to root_path(:subdomain => false) u...
[ "0.63884354", "0.632771", "0.6276062", "0.62682885", "0.62466455", "0.61996436", "0.6192389", "0.61484915", "0.6138546", "0.6119443", "0.60984725", "0.603754", "0.6009608", "0.5982918", "0.5946617", "0.5942626", "0.5940848", "0.5928129", "0.5926519", "0.59007627", "0.58695257...
0.714079
0
displays job info and boats assigned and not assigned to job on the job show page:
def show @job = Job.find(params[:id]) @boats_assigned = @job.boats @boats = Boat.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_job_details(job)\n @scraper.scrape_details(job)\n job.print_info\n job\n end", "def display_jobs(jobs)\n\n clear_screen\n\n @last_results = jobs\n\n choices = []\n choices << {name: 'Return to Menu'.colorize(:magenta), value: 'menu'}\n choices << {name: 'Exit'.colorize(:red), va...
[ "0.72604936", "0.71815485", "0.7132857", "0.7031735", "0.6827583", "0.6819707", "0.6796678", "0.6751397", "0.67103964", "0.6693727", "0.66835105", "0.6662354", "0.6641156", "0.6641156", "0.6592075", "0.6583779", "0.6566598", "0.6530834", "0.65292525", "0.6528207", "0.6516035"...
0.72310174
1
GET /discussions GET /discussions.json
def index @discussions = Discussion.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def discussions(**params)\n client.model(:get, \"/live/#{read_attribute(:id)}/discussions\", params)\n end", "def index\n @discussions = @issue.discussions.all\n end", "def index\n @discussions = @project.discussions\n\n respond_to do |format|\n format.html\n format.api\n end...
[ "0.8178684", "0.7574891", "0.7510708", "0.7504164", "0.7442654", "0.7403548", "0.7198004", "0.717403", "0.70452297", "0.70417637", "0.702059", "0.69400394", "0.69400394", "0.69400394", "0.6928606", "0.68670267", "0.6846973", "0.6844735", "0.67892504", "0.6740084", "0.66796476...
0.7578467
1
POST /sites POST /sites.xml
def create @site = Site.new(params[:site]) respond_to do |format| if @site.save format.html { redirect_to(root_url, :notice => 'Site was successfully created.') } format.xml { render :xml => @site, :status => :created, :location => @site } else format.html { render :action ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml {...
[ "0.5978451", "0.5947534", "0.5918166", "0.5917577", "0.5917577", "0.5917577", "0.58742225", "0.5870496", "0.58653045", "0.583874", "0.5787494", "0.5760929", "0.5747632", "0.56452173", "0.56402236", "0.56133217", "0.56035477", "0.55850303", "0.55655754", "0.552844", "0.5522499...
0.6000249
0
Similar to the duplicate items check for wish list, except look for duplicates in the user's primary vouch list.
def no_duplicate_items_in_vouch_list vouch_list = wish_list.user.vouch_list_primary return if vouch_list.nil? if vouch_list.vouch_items.find_by_business_id(self.business_id).present? errors.add(:vouch_list, "already contains item \"#{self.business.name}\".") end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_wishlist(item)\n #Query wish lists to see if the criteria matches\n @wish_list = search_wishlist(item)\n @notify_list = Array.new\n @wish_list.each do |wish_list_item|\n if @notify_list.size == 0\n @notify_list.push wish_list_item\n else \n @inList = false\n #Ch...
[ "0.7152136", "0.6560088", "0.6392453", "0.63383776", "0.6119731", "0.5980118", "0.5880861", "0.58103824", "0.5797064", "0.5742578", "0.5742578", "0.5715806", "0.571303", "0.5675945", "0.5599092", "0.5581976", "0.55746233", "0.5543616", "0.55093277", "0.5490568", "0.54881495",...
0.8011406
0
POST /jobapps POST /jobapps.json
def create @jobapp = Jobapp.new(jobapp_params) if @jobapp.save flash[:success] = "Jobapp was successfully created." redirect_to action: "index" else @jobapps = Jobapp.all render :new, locals: {jobapp: @jobapp,jobapps: @jobapps} end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @job_application = JobApplication.new(job_application_params)\n @job_application.user_id = current_user.id\n\n respond_to do |format|\n if @job_application.save\n format.html { redirect_to job_applications_url }\n format.json { render :show, status: :created, location: @job...
[ "0.6527155", "0.651267", "0.6466711", "0.64220345", "0.6409537", "0.6354675", "0.63347703", "0.6320728", "0.63134015", "0.6294227", "0.6290041", "0.61692536", "0.61238366", "0.60399127", "0.6025359", "0.6023682", "0.59810203", "0.59803915", "0.59331834", "0.59118307", "0.5886...
0.6768979
0
GET /contribucions GET /contribucions.json
def index @contribucions = getAllContribucioUrl end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_contribucion\n @contribucion = Contribucion.find(params[:id])\n end", "def index\n user = User.find_by(id: params[:user_id])\n return respond_with contributions: [], status: :not_found if user.nil?\n contributions = user.contributions\n respond_with contributions: contributions, sta...
[ "0.6436797", "0.60228103", "0.5951753", "0.58131784", "0.5802869", "0.5714168", "0.56952816", "0.5673539", "0.55963844", "0.55244106", "0.5498828", "0.5498709", "0.5492161", "0.549077", "0.54737717", "0.5466487", "0.54622036", "0.5459412", "0.54593486", "0.5455143", "0.544565...
0.7118568
0
GET /contribucions/askPage GET /contribucions/askPage.json
def askPage @contribucions = getAllContribucioAsk render :partial => 'index', :locals => { :contribucions => @contribucions } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ask\n @view = VIEWS[:ask]\n @contributions = Contribution.where(url: '')\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @contributions }\n end\n end", "def index\n @ideas = current_user.ideas.page(params[\"page\"])\n\n respond_to do |format|...
[ "0.69153386", "0.6189414", "0.5877521", "0.5723763", "0.5685902", "0.5658228", "0.5647118", "0.56462836", "0.5640575", "0.5586643", "0.555529", "0.55520916", "0.5528658", "0.5517975", "0.55028564", "0.5500918", "0.5492191", "0.5487664", "0.5480656", "0.5473964", "0.5460716", ...
0.7257367
0
GET /contribucions/newPage GET /contribucions/newPage.json
def newPage @contribucions = getAllContribucio render :partial => 'index', :locals => { :contribucions => @contribucions } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @page = current_site.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end", "def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end...
[ "0.7461507", "0.7279668", "0.7279668", "0.7279668", "0.7279668", "0.7279668", "0.7243876", "0.7241042", "0.72133857", "0.7092861", "0.703641", "0.69687396", "0.6956359", "0.6928053", "0.68924254", "0.68717116", "0.68582225", "0.67916226", "0.6766548", "0.6764839", "0.67385256...
0.7359499
1
PATCH/PUT /contribucions/1 PATCH/PUT /contribucions/1.json
def update respond_to do |format| if @contribucion.update(contribucion_params) format.html { redirect_to @contribucion, notice: 'Contribucion was successfully updated.' } format.json { render :show, status: :ok, location: @contribucion } else format.html { render :edit } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_contribucion\n @contribucion = Contribucion.find(params[:id])\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n @colaboration = Colaboration.find(params[:id])\n @colaboration.user_id=current_user.id\n\n respond_to do |format|\n if @colaboratio...
[ "0.6228769", "0.58562845", "0.58285534", "0.58243835", "0.5809376", "0.5806396", "0.5798898", "0.5794354", "0.57890964", "0.5785297", "0.5785297", "0.5780501", "0.57804143", "0.5778057", "0.5773783", "0.57610995", "0.5745531", "0.571601", "0.569585", "0.5690614", "0.5687548",...
0.69840425
0
DELETE /contribucions/1 DELETE /contribucions/1.json
def destroy @contribucion.destroy respond_to do |format| format.html { redirect_to contribucions_url, notice: 'Contribucion was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @colaboration = Colaboration.find(params[:id])\n @colaboration.destroy\n\n respond_to do |format|\n format.html { redirect_to colaborations_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @cont...
[ "0.65115374", "0.6447853", "0.644546", "0.642908", "0.6409992", "0.64087814", "0.63752705", "0.6343667", "0.63366455", "0.63300073", "0.6317634", "0.63122636", "0.6306343", "0.63057953", "0.62906957", "0.62852544", "0.62803537", "0.6272747", "0.6272747", "0.6269272", "0.62664...
0.74925876
0
The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. Must be contained by the `range`.
def selection_range attributes.fetch(:selectionRange) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def selection_range_provider\n attributes.fetch(:selectionRangeProvider)\n end", "def m_range\r\n end", "def range\n @range ||= set_range\n end", "def range\n DEFAULT_RANGE\n end", "def range\n DEFAULT_RANGE\n end", "def range\n DEFAULT_RANGE\n ...
[ "0.6433822", "0.63910395", "0.6323904", "0.6091244", "0.6091244", "0.6091244", "0.60332483", "0.5999272", "0.5999272", "0.5999272", "0.59818375", "0.5923879", "0.58393544", "0.58071434", "0.57951915", "0.57865435", "0.575139", "0.575139", "0.575139", "0.575139", "0.5710691", ...
0.672998
0
Returns an array. The first element is whether the limit was crossed and in which direction, the second element whether the usage is currently above that limit.
def checkLimit(limit, lastUsage, currentUsage) rc = [] if limit && lastUsage <= limit && currentUsage > limit rc.push :crossed_upwards elsif limit && lastUsage > limit && currentUsage <= limit rc.push :crossed_downwards else rc.push :not_crossed end rc.push limit && currentUsa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limits?\n out=@linker.call(\"account\",\"limits\")\n if(out[\"status\"].to_sym == :success)\n return out[\"usage\"]\n else\n return nil\n end\n end", "def limits_in_array\n @limits.strip.split(ITEM_SEPARATOR).map { |i| i.to_i }\n end", "def limit_reached?\n ...
[ "0.5863319", "0.57764655", "0.5768101", "0.56275874", "0.5606127", "0.560228", "0.5579619", "0.5556781", "0.5464264", "0.5461329", "0.54612124", "0.5445098", "0.5414123", "0.5408102", "0.5401055", "0.5391691", "0.5382192", "0.53588974", "0.53566915", "0.53352", "0.5333034", ...
0.7569217
0
Read the alerts that libtorrent has pending, and store them in the correct member variable. Torrentspecific alerts are stored
def processNewAlerts @session.alerts.each{ |alert| if alert.is_a? Libtorrent::TorrentAlert if alert.handle.valid? && alert.handle.has_metadata addToHashList @torrentAlerts, alert.handle.name, alert end else @globalAlerts.push alert # For now since nothing is rea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def alerts\n @alerts ||= []\n end", "def get_notice_list\n # @status, @msg, @data = EtcValidator.get_noitce_list\n @status, @msg, @data = EtcManager.get_notice_list #if @status\n end", "def alerts\n return @alerts\n end", "def alerts\n slurp_stream(\"alert\") do |d...
[ "0.58311486", "0.5456411", "0.5298588", "0.5126388", "0.50831497", "0.5053701", "0.503443", "0.5031201", "0.49913675", "0.4923846", "0.49119884", "0.49117053", "0.49117053", "0.48409417", "0.48256493", "0.48197034", "0.479328", "0.4785711", "0.47682148", "0.4741507", "0.47337...
0.6282197
0
Load a torrent and add it to the session. Filename should be the basename of the torrent file. Returns true on success, false if the torrent was already added. If the torrent was already added and a block is passed, the torrent info of the existing torrent is passed to the block. Probably throws exceptions also.
def loadAndAddTorrent(path, filename) begin torrentInfo = Libtorrent::TorrentInfo::load(path) # Make sure the torrent doesn't already exist in the session or libtorrent # will abort() handle = @session.find_torrent(torrentInfo.info_hash) if ! handle.valid? handle = @session.ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_torrent(torrent)\n return false unless torrent.torrent_data\n\n response = remote_request(\"torrent-add\", {:metainfo => torrent.torrent_data})\n \n if response.success? \n torrent.update_from_transmission(response.torrent_added)\n torrent.save\n return true\n end\n\n retur...
[ "0.6839494", "0.59409934", "0.57130057", "0.5077683", "0.50519764", "0.48228046", "0.46941033", "0.46722943", "0.45978492", "0.45938367", "0.45467582", "0.45442083", "0.45211095", "0.44922408", "0.44756132", "0.44725433", "0.44553047", "0.4437774", "0.44285187", "0.44111413", ...
0.824141
0
Returns true if the passed path is under the data dir path. That is, ensure that the path is something we downloaded as a torrent. This is usually used for access control.
def pathIsUnderDataDir(path) absDataDir = Pathname.new($config.dataDir).realpath.to_s absRequestedFile = Pathname.new(path).realpath.to_s absRequestedFile =~ /^#{absDataDir}/ end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_data?(path)\n @local_data.has_key?(path.to_s)\n end", "def dir_exists?(path)\n begin\n @meta_data = @client.stat(path)\n if (@meta_data[\"type\"] == \"DIRECTORY\")\n return true\n else\n return false\n end\n rescue\n ...
[ "0.7083309", "0.70224065", "0.68070483", "0.6799063", "0.673707", "0.6722388", "0.67011714", "0.66258353", "0.6583245", "0.6569885", "0.6530429", "0.6525001", "0.6494988", "0.6491752", "0.6478716", "0.64436954", "0.64417523", "0.64417523", "0.6423201", "0.6417204", "0.6390353...
0.7957606
0
WhitelistUpdateWorker updates all of the api sourced whitelist entities belonging to the specified share. It is intentionally incapable of enrolling new APIs in the whitelisting process, it merely ensures that the whitelist is up to date with the latest in game state. WhitelistUpdateWorker does NOT respect cachedUntil
def perform(share_id) #Retrieve the IDs for each whitelist api connection wac_ids = WhitelistApiConnection.where("share_id = ?", share_id).pluck("id") #Retrieve all of the APIs with active pulls on this share from the database. apis = Api.joins(:whitelist_api_connections).where("share_id = ?", share_id).uniq ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_whitelist_address\n service_response = ClientManagement::UpdateWhitelistAddress.new(params).perform\n render_api_response(service_response)\n end", "def update!(**args)\n @enable_rpc_whitelist = args[:enable_rpc_whitelist] if args.key?(:enable_rpc_whitelist)\n end", "def updat...
[ "0.58657205", "0.56043816", "0.55107963", "0.53965116", "0.5394945", "0.52839404", "0.5155706", "0.5147883", "0.49675775", "0.49555993", "0.4904961", "0.4904961", "0.4900702", "0.4846366", "0.48354256", "0.48317015", "0.48227176", "0.4818562", "0.4808736", "0.4807573", "0.480...
0.5887209
0