query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
grouping reads within 3bp
def classify(reads, within, support_reads, support_clip_length) read_groups = grouping_reads(reads, within, support_reads, support_reads) clips = [] # without SID reads non_clips = [] read_groups.each do |read_group| if read_group.all? { |read| read.type == :B || read.type == :F } clips ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def aggregate_by_chunks\n forward = []\n reverse = []\n chunks.each do |chunk|\n reads=get :chunks, chunk\n forward << (get :side, :left)\n reverse << (get :side, :right)\n end\n [forward,reverse]\n end", "de...
[ "0.5892725", "0.5431818", "0.5226034", "0.5220568", "0.52198684", "0.5217109", "0.5169959", "0.5167843", "0.5161022", "0.51447093", "0.50560325", "0.5041414", "0.50284237", "0.5023215", "0.50091875", "0.5001363", "0.49861762", "0.49721092", "0.49657053", "0.4946867", "0.49460...
0.0
-1
SHOW GIFTS (ALL OF THEM)
def index @occasion = Occasion.find params[:occasion_id] @gifts = Gift.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @gifts = Gift.all\n end", "def index\n @gifts = Gift.all\n end", "def show_cards(gamer, name)\n puts say(\"#{name} cards on hand list below:\")\n gamer.each do |card|\n puts \"[#{card[:suit]} #{card[:value]}]\"\n end\nend", "def index\n @greats = Great.all\n end", "def list(gi...
[ "0.6250682", "0.6250682", "0.5933409", "0.5730656", "0.5695451", "0.5672282", "0.5607185", "0.5605348", "0.55981165", "0.5590719", "0.55865747", "0.552246", "0.55006766", "0.5472943", "0.5466276", "0.54630524", "0.54356134", "0.54151255", "0.54119104", "0.53955984", "0.536245...
0.51356345
44
Cosine Algorithm Parallel Programming
def cosine_parallel @time1 = Time.now documents = [] read_threads = [] #file1 thread1 = Thread.new{ file1 = File.read(Rails.root.join('public/files/d1a7.allKeys')).split("\n") @doc1 = {} file1.each_with_index do |line,index| data = line.split(" ") @d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cosine\n\tcosine of 120 degrees is -.5\n\ta2 = c2 + b2 - 2bc cos A, (this is important to use)\n\tis it a triange? (a+b > c && a+c > b && b+c > a)\nend", "def compute_cosine_similarity current_items, next_items\n\t\t# find numerator by finding the number of the intersection of items\n\t\tnumerator = (current...
[ "0.6539883", "0.62205523", "0.6050239", "0.6026215", "0.5830315", "0.58276653", "0.5823511", "0.5720786", "0.5703123", "0.56708896", "0.56519073", "0.5609086", "0.56021714", "0.55950177", "0.556157", "0.5560613", "0.5558565", "0.55544657", "0.5549332", "0.5527408", "0.5444706...
0.5415417
22
Jaccard Algorithm Different Style Based Weights
def jaccard_weights documents = [] #file1 file1 = File.read(Rails.root.join('public/files/d1a7.allKeys')).split("\n") @doc1 = {} file1.each_with_index do |line,index| data = line.split(" ") @doc1[data[0]] = data[1] end #file2 file2 = File.read(Rails.root.join('p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def jaccard(a, b)\n a_i = a.map { |i| i > 0 }\n b_i = b.map { |i| i > 0 } \n n = (0 .. (a.size - 1)).map { |i| (a_i[i] && b_i[i]) ? 1 : 0 }.inject(:+)\n u = (0 .. (a.size - 1)).map { |i| (a_i[i] || b_i[i]) ? 1 : 0 }.inject(:+)\n return n.to_f / u\n #b = bray_curtis(a, b)\n #return 2.0*b/(1+b)\...
[ "0.6342322", "0.6130355", "0.60466033", "0.5828854", "0.5760382", "0.574708", "0.57406706", "0.567427", "0.56651515", "0.56614184", "0.5659489", "0.5659128", "0.5634074", "0.5627331", "0.5623365", "0.5609993", "0.5592416", "0.5589278", "0.55728936", "0.5560107", "0.5518534", ...
0.0
-1
Input: One positive integer Output: String of alternating 1s and 0s, always starting with 1. Rules: Length of output string should be the same length as the given integer EXAMPLES: puts stringy(6) == '101010' puts stringy(9) == '101010101' puts stringy(4) == '1010' puts stringy(7) == '1010101' DATA STRUCTURES: String. ...
def stringy(int, first_num = 1) first_num == 0 ? second_num = 1 : second_num = 0 arr = Array(1..int) arr.map! { |n| n.odd? ? first_num : second_num } arr.join end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stringy(num)\n (1..num).map { |idx| idx.odd? ? '1' : '0' }.join\nend", "def stringy(num)\n zero_array = []\n one_array = []\n\n (num / 2).times do\n zero_array << 0\n one_array << 1\n end\n\n if num.odd?\n one_array << 1\n end\n\n one_array.zip(zero_array).flatten.join(\"\")\nend", "def ...
[ "0.8056119", "0.8013325", "0.7950185", "0.7941354", "0.78987235", "0.7881369", "0.7856775", "0.7825854", "0.77852076", "0.77544796", "0.77400047", "0.7728872", "0.7723668", "0.77078587", "0.76523536", "0.76392674", "0.75692725", "0.75525147", "0.7541826", "0.7537947", "0.7536...
0.74481887
26
Truncates workflow history to a specified event id.
def truncate_history(events, replay_upto = nil) return nil if events.nil? || events.empty? # Just return the original array of events if replay_upto is not set # or if the number of events is less than replay_upto return events if replay_upto.nil? || events.last['eventId'] <= re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history_destroy\n SygiopsSupport::History.remove(self.class.to_s, id)\n end", "def delete(id)\n wf_event_id?(id)\n api.delete(id)\n end", "def remove_one_event(event)\n client.execute(\n :api_method => calendar.events.delete,\n :parameters => {:calendarId => calendar_id,...
[ "0.59569436", "0.57673436", "0.57319146", "0.5572424", "0.5377605", "0.5340605", "0.5297212", "0.52561545", "0.5229827", "0.52288395", "0.52250737", "0.52126753", "0.52042973", "0.5195279", "0.5190392", "0.51640564", "0.51517487", "0.51391983", "0.5133761", "0.5133761", "0.51...
0.62535805
0
Fetches the workflow history. Implementing classes must override this method.
def get_history(page_token = nil); end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_history\n events = []\n # Get the first page of the workflow history\n page = get_history_page\n page[\"events\"].each { |x| events << x }\n\n # Get the remaining pages of the workflow history\n until page[\"nextPageToken\"].nil?\n page = get...
[ "0.79188466", "0.71729994", "0.6796372", "0.67709154", "0.67709154", "0.66175115", "0.6576797", "0.65276223", "0.6437962", "0.6370919", "0.6361858", "0.6361858", "0.635552", "0.6276157", "0.62540066", "0.6249096", "0.62217766", "0.6214499", "0.620423", "0.620423", "0.620423",...
0.5833696
62
Fetches the workflow execution information used to fill in the [DecisionTask][] details. Implementing classes must override this method.
def get_execution_info; end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_execution_info\n execution = @swf.describe_workflow_execution(\n domain: @domain,\n execution: @execution\n )\n execution[\"executionInfo\"]\n end", "def complete_workflow\n return unless @completed && ! @unhandled_decision\n decision_...
[ "0.67873335", "0.5896714", "0.58335656", "0.5787808", "0.5626826", "0.55850065", "0.5569741", "0.5512858", "0.55122733", "0.5500673", "0.5449195", "0.53813446", "0.5378011", "0.5374619", "0.52582896", "0.524556", "0.524556", "0.524556", "0.524556", "0.524556", "0.5233718", ...
0.5689353
4
Get the complete workflow history.
def get_history events = [] # Get the first page of the workflow history page = get_history_page page["events"].each { |x| events << x } # Get the remaining pages of the workflow history until page["nextPageToken"].nil? page = get_history_page(pag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history\n return @history\n end", "def history\n return @history\n end", "def history\n History\n end", "def workflow_histories(starttime, endtime)\n histories = []\n json_data = get(url: \"#{@url}workflows/history/#{starttime}/#{endti...
[ "0.756697", "0.756697", "0.7429279", "0.73545676", "0.7333506", "0.72338104", "0.7197061", "0.7040067", "0.6998269", "0.6893131", "0.6893131", "0.68736064", "0.6853848", "0.6834516", "0.68326956", "0.67904043", "0.6766229", "0.6714078", "0.6697217", "0.6650437", "0.66215813",...
0.80921537
0
Fetches a page of workflow history.
def get_history_page(page_token = nil) # Generate the request options for the service call. Optionally merge # next_page_token to the hash if the page_token value is not nil. request_opts = { domain: @domain, execution: @execution, }.merge(page_token ? { n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_history\n events = []\n # Get the first page of the workflow history\n page = get_history_page\n page[\"events\"].each { |x| events << x }\n\n # Get the remaining pages of the workflow history\n until page[\"nextPageToken\"].nil?\n page = get...
[ "0.7129751", "0.6631989", "0.6461849", "0.6455108", "0.63648534", "0.62153774", "0.61041045", "0.6033934", "0.60187083", "0.5980928", "0.59669834", "0.595128", "0.59427184", "0.5933099", "0.59043455", "0.58887833", "0.58786684", "0.5838968", "0.58253014", "0.58097845", "0.580...
0.7023363
1
Call AWS Simple Workflow Service to get workflow execution information.
def get_execution_info execution = @swf.describe_workflow_execution( domain: @domain, execution: @execution ) execution["executionInfo"] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def workflow\n raise \"Could not read workflow from #{@osw_abs_path}\" if @workflow.nil?\n\n @workflow\n end", "def workflow\n raise \"Could not read workflow from #{@osw_abs_path}\" if @workflow.nil?\n\n @workflow\n end", "def workflow(repo, id, options = {})\...
[ "0.622884", "0.62286586", "0.6151991", "0.61050695", "0.6053466", "0.59236544", "0.58589566", "0.58376086", "0.5809645", "0.57378453", "0.56767994", "0.5665873", "0.559015", "0.5589806", "0.55697095", "0.55409735", "0.55234784", "0.54953957", "0.5479439", "0.5477707", "0.5471...
0.6674049
0
Performs a replay of workflow history.
def replay(replay_upto = nil) task = @task_provider.get_decision_task(replay_upto) @task_handler.handle_decision_task(task) unless task.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def replay\n ssh(self.join) unless @history.empty?\n end", "def replay\n ssh(self.join) unless @history.empty?\n end", "def replay\n Bumbleworks.dashboard.replay_at_error(@process_error)\n end", "def redo\n if(@history != nil)\n @history.redo\n end\n en...
[ "0.7363284", "0.7363284", "0.6784813", "0.64122456", "0.63793296", "0.6283137", "0.62207246", "0.62207246", "0.60889715", "0.5978888", "0.5823542", "0.5811414", "0.57515514", "0.5720211", "0.57172203", "0.5674513", "0.5561448", "0.55509925", "0.5534644", "0.551074", "0.548108...
0.5842258
10
Returns current hostname with protocol.
def current_host @current_host ||= "#{request.protocol}#{request.host_with_port}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hostname\n Socket.gethostname.split('.').first.strip\n end", "def hostname\n v = self.host\n v&.start_with?('[') && v.end_with?(']') ? v[1..-2] : v\n end", "def hostname\n @hostname ||= `hostname`.chomp\n end", "def hostname\n @hostname ||= `hostname`.strip\n end", ...
[ "0.80601585", "0.7787782", "0.7748825", "0.77346593", "0.77008146", "0.77008146", "0.75839245", "0.7471622", "0.7456056", "0.74479955", "0.7409518", "0.73545974", "0.7320668", "0.73039186", "0.7248496", "0.7234624", "0.7217208", "0.7161638", "0.7142682", "0.709825", "0.709291...
0.6436963
70
Returns the current url. Provide :params => true to include request params.
def current_url(options = {}) path = (options[:params] == true) ? request.fullpath : request.path "#{current_host}#{path}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_url\n request.env['REQUEST_URI']\n end", "def current_path\n url_for(params)\n end", "def current_url(overwrite={})\n url_for :only_path => false, :params => params.merge(overwrite)\n end", "def current_url(new_params)\n url_for params: params.permit!.merge(new_params) # allow all ...
[ "0.8035661", "0.7913411", "0.7906925", "0.7486342", "0.7347608", "0.7104877", "0.7093796", "0.70820427", "0.70820427", "0.7030214", "0.69898796", "0.6948224", "0.6947382", "0.69410676", "0.6921574", "0.68438613", "0.67866665", "0.67277884", "0.67233884", "0.671492", "0.670241...
0.83426046
0
attr_accessor will make getters and setters
def initialize(holder_name , balance , type) @holder_name =holder_name @balance = balance @type = type end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_attr_accessor(attr)\n attr_accessor(attr)\n end", "def attr_accessor(*args)\n attr_reader(*args)\n attr_writer(*args)\n end", "def attr_accessor(*fields)\n attr_reader *fields\n attr_writer *fields\n end", "def internal_attr_accessor(*syms)\n internal_attr_...
[ "0.7844514", "0.7725389", "0.7592618", "0.75770104", "0.7422154", "0.73628205", "0.73628205", "0.73628205", "0.73161733", "0.72891873", "0.7239376", "0.7229407", "0.7227146", "0.72231823", "0.7047946", "0.6976693", "0.69606656", "0.6910149", "0.69014704", "0.68878114", "0.685...
0.0
-1
this makes the css and js organized
def set_assets @custom_csses = [] @custom_javascripts = [] action_hash = {"create" => "new", "update" => "edit"} file_name = action_hash[action_name] ? action_hash[action_name] : action_name root = Rails.root.to_s @custom_csses << "compiled/application.css" # always include the layout css ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_styles_and_js\n base_dir = @generator.base_dir\n Dir.mkdir(\"#{base_dir}/js\")\n FileUtils.cp(\"#{Amy::BASE_DIR}/views/js/amy.min.js\", \"#{base_dir}/js/amy.js\")\n FileUtils.cp(\"#{Amy::BASE_DIR}/views/js/data.json\", \"#{base_dir}/data.json\") \n Dir.mkdir(\"#{base_dir}/sty...
[ "0.66808206", "0.6538104", "0.64379597", "0.64082944", "0.6322927", "0.6322927", "0.6322927", "0.62959355", "0.62899363", "0.6284328", "0.61014813", "0.6098827", "0.6098277", "0.6098277", "0.6098277", "0.6083771", "0.5978368", "0.5960869", "0.5953283", "0.5946002", "0.5916333...
0.6777108
0
Intializes adapter with given options.
def initialize(options = {}) @database = options[:database] @grid = ::Mongo::Grid.new(@database) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize *serializer_options \n @options = extract_va_options( serializer_options )\n end", "def adapter_options\n []\n end", "def adapter_options\n []\n end", "def initialize(app, adapter_options = {})\n super(app)\n @adapter_options = adapter_options\n end...
[ "0.64997673", "0.6453819", "0.63710433", "0.62462556", "0.62342966", "0.62342966", "0.61549294", "0.61549294", "0.6086779", "0.59448904", "0.5895794", "0.5889555", "0.5866329", "0.5851985", "0.58375186", "0.5812448", "0.5789959", "0.5771485", "0.57521576", "0.57384133", "0.57...
0.0
-1
Returns file metadata (filename, content type).
def metadata(id) id = self.to_id(id) io = self.grid.get(id) { filename: io.filename, content_type: io.content_type } rescue ::Mongo::GridFileNotFound nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def metadata\n metadata = {}\n @file.data.each { |key, value| metadata[key.to_sym] = value }\n\n metadata[:type] = @file.class.name.split('::')[1].downcase\n metadata[:url] = @file.url\n\n metadata[:slug] = slug\n\n metadata[:posted_at] = @file.date.to_time.to_i if @file.respond_to? :date\n me...
[ "0.8111492", "0.7615892", "0.72275114", "0.7171905", "0.716", "0.70519334", "0.70519334", "0.69111544", "0.6892529", "0.68800753", "0.6662306", "0.6639316", "0.6635013", "0.66218555", "0.6597431", "0.6592144", "0.6548905", "0.6546921", "0.65287155", "0.65287155", "0.65264785"...
0.68930256
8
Pushes the file into persistence store and returns it's id.
def push_file(source, original_filename, id = nil) data = self.read_from(source) self.grid.put(data, filename: original_filename, _id: id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def store\n File.store(uuid)\n end", "def save\n self.id = (10 + Random.rand(99))\n FileOperations.add(self)\n puts 'Successfully Added'\n end", "def push(filename)\n File.open(filename, 'r'){ |f| Uploader.new.store! f }\n end", "def store_file(uuid)\n Uploadcare::File....
[ "0.704333", "0.6682565", "0.6497344", "0.6467316", "0.6398607", "0.63189685", "0.6303842", "0.6213127", "0.62046254", "0.61990917", "0.6169544", "0.6148306", "0.612542", "0.60912484", "0.6041967", "0.6003664", "0.60005474", "0.59822994", "0.5975377", "0.59281254", "0.59281254...
0.61300606
12
Retreives the file from persistence store and returns it's content.
def get_file(id) id = self.to_id(id) self.grid.get(id).read end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def content\n file = Store::File.find_by(id: store_file_id)\n if !file\n raise \"No such file #{store_file_id}!\"\n end\n\n file.content\n end", "def get\n file\n end", "def file\n return @file\n end", "def file\n return @file\n ...
[ "0.7625612", "0.68960077", "0.66692644", "0.66692644", "0.66492945", "0.66367674", "0.66367674", "0.65486664", "0.65028566", "0.64044535", "0.63804626", "0.63468575", "0.6285478", "0.62461954", "0.6243571", "0.622223", "0.62094945", "0.6184127", "0.6184127", "0.6184127", "0.6...
0.6015565
30
Deletes the file from persistence store. Returns true if file was removed, otherwise return false.
def delete_file(id) id = self.to_id(id) self.grid.get(id) grid.delete(id) rescue ::Mongo::GridFileNotFound false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_file\n return false if !@file\n FileUtils.rm @file if File.file? @file\n return true\n end", "def delete\n begin\n uy_connection.delete(@path)\n true\n rescue Exception => e\n # If the file's not there, don't panic\n nil\n ...
[ "0.7911167", "0.75034523", "0.7448999", "0.7206974", "0.6921569", "0.6917168", "0.6868968", "0.6843656", "0.67874324", "0.67839783", "0.6722636", "0.66712415", "0.6650072", "0.66363055", "0.6530129", "0.6506961", "0.6504286", "0.6501424", "0.6482527", "0.6450914", "0.64081305...
0.5817827
64
Reads a content from source file or filename.
def read_from(source) return source.read if source.respond_to?(:read) return File.read(source.to_str) if source.respond_to?(:to_str) raise ArgumentError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read source=nil\n if source.respond_to? :read\n source.read\n elsif file = find(source) and File.file? file\n File.read file\n else\n source\n end\n end", "def read\n @contents ||= File.read @src_path if readable?\n end", "def source(file, context)\n File.read(file,...
[ "0.7945675", "0.77847373", "0.7544198", "0.73781914", "0.7314454", "0.72601235", "0.7256295", "0.7205485", "0.7175937", "0.7137155", "0.71036863", "0.69496", "0.6758896", "0.67411506", "0.67063516", "0.66955084", "0.66955084", "0.6682764", "0.66641974", "0.6650124", "0.664536...
0.7394522
3
Converts given string to BSON::ObjectId.
def to_id(id) id.kind_of?(BSON::ObjectId) ? id : BSON::ObjectId(id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_bson_id(id) BSON::ObjectId.from_string(id) end", "def deserialize(string)\n BSON::ObjectId.from_string(string)\n end", "def generate_id\n id = BSON::ObjectId.new\n document.using_object_ids? ? id : id.to_s\n end", "def normalize_object_id_strings(str, options)\n str = str...
[ "0.84747016", "0.79914826", "0.7225011", "0.69267035", "0.69267035", "0.67182004", "0.6711743", "0.6706247", "0.6496129", "0.6496129", "0.64661914", "0.63204575", "0.6291953", "0.62762254", "0.624595", "0.621836", "0.60590875", "0.6047279", "0.60339296", "0.60025865", "0.5974...
0.7386242
2
Being new to the organization they decide to test your skills. Your first test is to write an algorithm that encrypts the given string in the following steps. The first step of the encryption is a standard ROT13 cipher. This is a special case of the caesar cipher where the letter is encrypted with its key that is thirt...
def rot_cipher_helper(word) encrypted = [] alphabet = ("a".."z").to_a word.chars.each do |letter| ciphered_idx = alphabet.index(letter) + 13 encrypted << alphabet[ciphered_idx % 26] end output = encrypted.join("") result = [] output.chars.each do |letter| trick_idx = (alphabet.index(letter) + 1) * (-1) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def translate_to_cipher(sentence)\n # creates array alphabet including all letters a through z\n alphabet = ('a'..'z').to_a\n # creates a hash by merging alphabet and the rotated alphabet array,\n # in which each element of alphabet is the key\n # for the element at the same index in the rotated arr...
[ "0.7650128", "0.75822634", "0.751468", "0.7489705", "0.74411035", "0.7428278", "0.74028873", "0.7399321", "0.73410016", "0.7328502", "0.73284876", "0.73251575", "0.7307376", "0.72888243", "0.72860646", "0.7284798", "0.72805035", "0.7272326", "0.72575116", "0.72566307", "0.725...
0.0
-1
GET /lb30s/1 GET /lb30s/1.xml
def show @lb30 = Lb30.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @lb30 } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @lb202556 = Lb202556.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end", "def get_listings_xml(url)\n @client.get_content(url)\n end", "def new\n @lb30 = Lb30.new\n\n respond_to do |form...
[ "0.62508416", "0.61571676", "0.61442584", "0.6077874", "0.5865455", "0.5792525", "0.5665613", "0.5606739", "0.560284", "0.5554246", "0.55508566", "0.5546383", "0.5492744", "0.54617697", "0.5461331", "0.5411539", "0.53705806", "0.53561157", "0.53214025", "0.5317222", "0.530606...
0.68155324
0
GET /lb30s/new GET /lb30s/new.xml
def new @lb30 = Lb30.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @lb30 } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @lb202556 = Lb202556.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end", "def create\n @lb30 = Lb30.new(params[:lb30])\n\n respond_to do |format|\n if @lb30.save\n format.html { redirect_to(@lb30, :no...
[ "0.7382349", "0.7262286", "0.693001", "0.6629212", "0.662605", "0.6571862", "0.64935493", "0.6402583", "0.6387183", "0.6310364", "0.6302939", "0.62866867", "0.62849176", "0.62661374", "0.6253029", "0.62521994", "0.6250355", "0.62293744", "0.62036914", "0.62026286", "0.6189918...
0.7732899
0
POST /lb30s POST /lb30s.xml
def create @lb30 = Lb30.new(params[:lb30]) respond_to do |format| if @lb30.save format.html { redirect_to(@lb30, :notice => 'Lb30 was successfully created.') } format.xml { render :xml => @lb30, :status => :created, :location => @lb30 } else format.html { render :action => ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @lb202556 = Lb202556.new(params[:lb202556])\n\n respond_to do |format|\n if @lb202556.save\n format.html { redirect_to(@lb202556, :notice => 'Lb202556 was successfully created.') }\n format.xml { render :xml => @lb202556, :status => :created, :location => @lb202556 }\n e...
[ "0.6050457", "0.60181636", "0.5741973", "0.56832165", "0.53911555", "0.53242713", "0.52486885", "0.52451354", "0.5230067", "0.5191059", "0.51152045", "0.5096329", "0.5078863", "0.5067457", "0.5059651", "0.50536317", "0.49826407", "0.49744615", "0.49660534", "0.49625522", "0.4...
0.69150364
0
PUT /lb30s/1 PUT /lb30s/1.xml
def update @lb30 = Lb30.find(params[:id]) respond_to do |format| if @lb30.update_attributes(params[:lb30]) format.html { redirect_to(@lb30, :notice => 'Lb30 was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def create\n @lb30 = Lb30.new(params[:lb30])\n\n respond_to do |format|\n if @lb30.save\n format.html { redirect_to(@lb30, :n...
[ "0.61619365", "0.58264464", "0.5813822", "0.5722376", "0.57085866", "0.5688499", "0.5609466", "0.53797", "0.5377395", "0.536544", "0.52556694", "0.5219283", "0.5212145", "0.5132015", "0.50613993", "0.50502884", "0.50377107", "0.5029001", "0.49890834", "0.49797878", "0.4979325...
0.6554516
0
DELETE /lb30s/1 DELETE /lb30s/1.xml
def destroy @lb30 = Lb30.find(params[:id]) @lb30.destroy respond_to do |format| format.html { redirect_to(lb30s_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @lb202556 = Lb202556.find(params[:id])\n @lb202556.destroy\n\n respond_to do |format|\n format.html { redirect_to(lb202556s_url) }\n format.xml { head :ok }\n end\n end", "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_ge...
[ "0.6779019", "0.64652824", "0.635925", "0.63017386", "0.6230498", "0.62178886", "0.61280954", "0.6123351", "0.6117541", "0.6030109", "0.5995115", "0.5981675", "0.5956032", "0.59537333", "0.5939917", "0.5933917", "0.59331775", "0.5899548", "0.5880592", "0.58794516", "0.5828531...
0.70039356
0
Encodes parameters for passing them to GD execution platform. Core types are kept and complex types (arrays, structures, etc) are JSON encoded into key hash "gd_encoded_params" or "gd_encoded_hidden_params", depending on the 'hidden' method param. The two different keys are used because the params and hidden params are...
def encode_params(params, hidden = false) res = {} nested = {} core_types = [FalseClass, Fixnum, Float, NilClass, TrueClass, String] params.each do |k, v| if core_types.include?(v.class) res[k] = v else nested[k] = v end end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def encode_parameters(**prm)\n encode_parameters!(prm)\n end", "def normalize_encode_params(params); end", "def encode_with(coder_) # :nodoc:\n data_ = marshal_dump\n coder_['format'] = data_[0]\n if data_[1].kind_of?(::String)\n coder_['value'] = data_[1]\n coder_['...
[ "0.66814846", "0.63546354", "0.60645604", "0.582818", "0.58163875", "0.5694638", "0.5655644", "0.5580395", "0.5555308", "0.5548826", "0.55295503", "0.5513836", "0.5409439", "0.5403218", "0.5370932", "0.5318693", "0.5318693", "0.5300741", "0.52576035", "0.52428323", "0.5238555...
0.72745365
0
Decodes params as they came from the platform The "data" key is supposed to be json and it's parsed if this
def decode_params(params) key = ENCODED_PARAMS_KEY.to_s hidden_key = ENCODED_HIDDEN_PARAMS_KEY.to_s data_params = params[key] || '{}' hidden_data_params = params[hidden_key] || '{}' begin parsed_data_params = JSON.parse(data_params) parsed_hidden_data_params ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse(params)\n Marshal.load(Base64.decode64(params))\n end", "def normalize_encode_params(params); end", "def _parse_params(params)\n\n if params.is_a? Hash\n return_value = {}\n params.each do |key, value|\n return_value[key] = self._parse_params(value)\n ...
[ "0.6863123", "0.6322491", "0.6250228", "0.6153289", "0.61501807", "0.61098367", "0.6043729", "0.60105824", "0.5966004", "0.5955171", "0.59335315", "0.58866614", "0.58747506", "0.58512646", "0.5851008", "0.5807788", "0.5807473", "0.57470834", "0.5746995", "0.57462716", "0.5746...
0.6955481
0
TODO: Implement without using ActiveSupport
def sanitize_string(str, filter = /[^a-z_]/, replacement = '') str = ActiveSupport::Inflector.transliterate(str).downcase str.gsub(filter, replacement) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def schubert; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def from; end", "def from; end", "def from; end", "def from; end", "def probers; end", "def implementation; end", "def implementation; end", "def weber; end", "def ext; e...
[ "0.65889466", "0.58150846", "0.57462364", "0.57462364", "0.57462364", "0.57462364", "0.5618015", "0.5618015", "0.5618015", "0.5618015", "0.5599337", "0.55213183", "0.55213183", "0.5511667", "0.5489109", "0.5489109", "0.5380674", "0.53761244", "0.5352719", "0.5326208", "0.5326...
0.0
-1
TODO: Implement without using ActiveSupport
def humanize(str) ActiveSupport::Inflector.humanize(str) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def schubert; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def from; end", "def from; end", "def from; end", "def from; end", "def probers; end", "def implementation; end", "def implementation; end", "def weber; end", "def ext; e...
[ "0.65889466", "0.58150846", "0.57462364", "0.57462364", "0.57462364", "0.57462364", "0.5618015", "0.5618015", "0.5618015", "0.5618015", "0.5599337", "0.55213183", "0.55213183", "0.5511667", "0.5489109", "0.5489109", "0.5380674", "0.53761244", "0.5352719", "0.5326208", "0.5326...
0.0
-1
Recurscively changes the string keys of a hash to symbols.
def symbolize_keys_deep!(h) if Hash == h Hash[ h.map do |k, v| [k.respond_to?(:to_sym) ? k.to_sym : k, symbolize_keys_deep!(v)] end ] else h end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keys_to_symbols(hash)\n\t\thash.keys.inject({}) do |hsh, key|\n\t\t\thsh[key.to_sym] = hash[key]\n\t\t\thsh\n\t\tend\n\tend", "def symbolize_hash_keys(hash); end", "def symbolize_hash hash\n hash.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}\n end", "def symbolize_keys!(hash)\n m...
[ "0.77304953", "0.7707944", "0.7508347", "0.7491134", "0.74178123", "0.74160403", "0.73894584", "0.7380943", "0.7368864", "0.736879", "0.7359313", "0.72927094", "0.7275247", "0.7270237", "0.71998864", "0.7190316", "0.7177345", "0.71772695", "0.714066", "0.71100104", "0.7110010...
0.0
-1
Hash gives you uniq! for free, just fill the Hash until its length
def generate_with_hash_length @numberHash.clear while @numberHash.length < @count @numberHash[rand(@limit)] = nil end @numbers = @numberHash.keys end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uniq!() end", "def uniq() end", "def uniq\n hsh = {}\n if block_given?\n each{|v| hsh[yield(v)] = 1 }\n else\n each{|v| hsh[v] = 1 }\n end\n hsh.keys\n end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def hash() end", "def ...
[ "0.71845376", "0.71760696", "0.6974732", "0.6862362", "0.6862362", "0.6862362", "0.6862362", "0.6862362", "0.6862362", "0.6862362", "0.6786923", "0.6666566", "0.6666566", "0.6652011", "0.6631926", "0.66158736", "0.66004676", "0.65879667", "0.6561582", "0.653175", "0.6523126",...
0.66856927
11
benchmarks every method that contains "generate_"
def benchmark_generate generateMethods = self.methods.grep(/generate_/).sort bmbm(0) do |bench| generateMethods.each {|aMethodName| bench.report(aMethodName) {instance_eval(aMethodName)} } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_comprehensive\n\n end", "def generate; end", "def generate; end", "def gen\n @genFlag = true\n res = ln((@overrideFlag ? '@Override ' : '') + 'public '+ (@static ? 'static ' : '') + @type + ' ' + @name + '(' +\n @args.collect {|var| (var.className.nil? ? var.type : var.c...
[ "0.7630612", "0.7004422", "0.7004422", "0.686031", "0.666508", "0.6624801", "0.66192275", "0.6275858", "0.6257653", "0.6223521", "0.6151764", "0.6126083", "0.6125874", "0.6102387", "0.6052128", "0.60407454", "0.6033838", "0.6006325", "0.5985092", "0.5983485", "0.59713286", ...
0.86986107
0
Serialize all Venues w/camera for app.
def venues_as_json ::Venue.includes(:cameras).map do |v| Hash( id: v.id, drinkcommand_id: v.drinkcommand_id, name: v.name, cameras: cameras_as_json( v ) ) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n \"<Camera: #{ @model } (#{ @vendor })>\"\n end", "def json_serialize\n # A vcard does not have sub-components, so we're overriding this\n # method to remove that array element.\n properties = []\n\n children.each do |child|\n properties << child.j...
[ "0.55631346", "0.5502229", "0.5486542", "0.5406319", "0.5291402", "0.5220914", "0.50594234", "0.50594234", "0.504245", "0.50378317", "0.5014535", "0.49644378", "0.49558693", "0.49536046", "0.49163422", "0.4907038", "0.49015343", "0.4900916", "0.48493734", "0.48493734", "0.482...
0.5540406
1
Pass Bridge Pay config to mobile client
def bridgepay_config Hash( username: ::BridgePay.username, password: ::BridgePay.password, merchant_code: ::BridgePay.code, merchant_account: ::BridgePay.account ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config\n config_yml['PAYMENT']\n end", "def send_config(payload)\n json = JSON.dump(payload)\n parcel = EncodedParcel.new(json)\n request = Request.new(parcel)\n\n @client.send_config_payload(request)\n end", "def pg_sy_razorpay_config_params\n ...
[ "0.64668614", "0.6154957", "0.6052457", "0.5964282", "0.58947927", "0.577412", "0.5755517", "0.5752861", "0.57521087", "0.5731646", "0.57298946", "0.572545", "0.57180595", "0.5704322", "0.5675238", "0.5666929", "0.56661975", "0.5643364", "0.56180507", "0.55850387", "0.5567477...
0.776632
0
Pass AWS config to mobile client
def aws_config Hash( region: AwsSettings.instance.region, bucket: AwsSettings.instance.bucket, identity_id: AwsSettings.instance.identity_id, identity_pool_id: AwsSettings.instance.identity_pool_id, ).merge( StorageService.paths ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def config\n {\n :APP_NAME => APP_NAME,\n :APP_ENV => APP_ENV,\n :AWS_ACCESS_KEY_ID => AMI_ACCESS_KEY_ID,\n :AWS_SECRET_ACCESS_KEY => AMI_SECRET_ACCESS_KEY\n }\nend", "def update_aws_config\n Aws.config.update({\n access_key_id: @aws_access_key_id,\n secr...
[ "0.7248261", "0.68380976", "0.67589957", "0.6735196", "0.6643249", "0.6522801", "0.63595974", "0.6329397", "0.6271465", "0.6153346", "0.61270905", "0.6126409", "0.6126383", "0.61014163", "0.60718304", "0.60705173", "0.60596716", "0.6056986", "0.6056986", "0.6030735", "0.60120...
0.6457055
6
Render resource routes for iOS & Android app
def resource_routes Hash( self: api_v1_boot_path, auth: api_v1_auth_path, users: api_v1_users_path, charges: api_v1_charges_path(':user_id'), purchases: api_v1_purchases_path(':user_id'), credits: api_v1_credits_path(':user_id'), comps: api_v1_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def routes; end", "def custom_routes; end", "def anchored_routes; end", "def external_routes; end",...
[ "0.6208206", "0.6208206", "0.6208206", "0.6208206", "0.6208206", "0.6208206", "0.6208206", "0.6208206", "0.6208206", "0.6208206", "0.6208206", "0.614132", "0.6120992", "0.60930467", "0.60619086", "0.60619086", "0.59777784", "0.5956711", "0.5956711", "0.58760774", "0.58759373"...
0.602443
16
needs 1.8.2 or higher, as of now, formula is 1.8.7
def options [ ["--without-applications", "Don't build the ALPS applications."], ["--without-examples", "Don't build ALPS examples."], ["--without-python", "Don't build ALPS python extensions."], ["--without-tests", "Don't build ALPS tests."], ["--with-fortran", "Build ALPS Fortran Binaries (curren...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def verdi; end", "def berlioz; end", "def version_mismatch_detected\n end", "def target_version; end", "def formation; end", "def patch_version; end", "def palladius_version\n\t:TODO\nend", "def minor; end", "def minor; end", "def minor; end", "def original_result; end"...
[ "0.5641666", "0.5635573", "0.5611176", "0.5479803", "0.54724795", "0.546536", "0.5442312", "0.54218423", "0.5405431", "0.5405431", "0.5405431", "0.5400267", "0.539197", "0.53889644", "0.5388782", "0.53669", "0.53586257", "0.53582484", "0.53582484", "0.53582484", "0.53582484",...
0.0
-1
Creates a Repository with a give name, search path, and options.
def initialize(name, path, options={}) @name = name @path = path.chomp('/') @options = options end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_repository(name, options = {})\n opts = options.dup\n organization = opts.delete :organization\n opts.merge! :name => name\n if opts.include? :is_template\n opts = ensure_api_media_type(:template_repositories, opts)\n end\n\n if organization.nil?\n ...
[ "0.7820784", "0.76283526", "0.7503476", "0.7144654", "0.7099713", "0.70091826", "0.6905462", "0.67439693", "0.6681224", "0.6601782", "0.65118456", "0.65102977", "0.6470148", "0.6443137", "0.6335177", "0.6326203", "0.6322706", "0.63154316", "0.6314245", "0.62835705", "0.624988...
0.0
-1
Given a name, scan should an array with 0 or more Packages matching the name.
def scan(name) raise NotImplementedError, "Repositories must return an Array of matching packages." end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_package_by_name(name)\n @packages[name]\n end", "def find_package_set_by_name(name)\n @package_sets[name]\n end", "def find_package_set(name)\n each_package_set.find { |set| set.name == name }\n end", "def find_package_definition(name)\n ...
[ "0.7279575", "0.68651164", "0.6785805", "0.64887625", "0.6309488", "0.6222131", "0.61457866", "0.60707915", "0.59807724", "0.5870785", "0.5829816", "0.5824199", "0.58160144", "0.5772066", "0.5767523", "0.5729304", "0.5704966", "0.5664866", "0.5599937", "0.5580801", "0.5573651...
0.8201681
0
Returns all paths that should be tested by Qwandryscan.
def all_paths paths = Dir["#{@path}/*"] paths = paths.select(&matcher(options[:accept])) if options[:accept] paths = paths.reject(&matcher(options[:reject])) if options[:reject] paths end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def paths\n tree_path = File.join(File.dirname(__FILE__), 'rails_tree')\n [\"\", \"multitest\", \"results\"].inject([tree_path]) do |result, suffix|\n result << File.join(result[-1], suffix)\n end[1..3]\n end", "def search_paths\n # NOTE: Do not cache this list, specific generators\n ...
[ "0.68310565", "0.6757825", "0.6707289", "0.66037786", "0.659263", "0.659263", "0.659263", "0.659263", "0.659263", "0.6484622", "0.6484622", "0.6464677", "0.64125365", "0.64125365", "0.63655716", "0.6337897", "0.6332831", "0.6298124", "0.62963897", "0.6244379", "0.62432873", ...
0.66465133
3
Helper for assembling a new package which may be launched by the Launcher
def package(name, paths=[]) Package.new(name, paths, self) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def build\n @model.custom_package? ? custom_package : standard_package\n end", "def action_package(type)\n name = prompt('Name : ')\n dest = Automation::Converter.to_unix_path(prompt('Destination : '))\n require REQUIRE_MAP[type] % {name: name}\n\n raise Automation::ConsoleError.new(\...
[ "0.6580224", "0.65595454", "0.64599866", "0.64529765", "0.6448773", "0.64120775", "0.6377524", "0.6362039", "0.6359526", "0.6320349", "0.6272806", "0.6263821", "0.6260539", "0.62314427", "0.62312746", "0.62260866", "0.6223547", "0.62205905", "0.62168515", "0.6187946", "0.6166...
0.5884293
48
Helper for generating a predicate methods
def matcher(pattern) case pattern when Regexp then lambda{|p| p =~ pattern} when String then lambda{|p| File.fnmatch?(pattern, p)} when Proc then pattern else raise ArgumentError, "Expected a Regexp, String, or Proc" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def define_predicate_methods_for_attributes\n @attributes.each do |key, _|\n method_name = \"#{key}?\"\n\n next if self.class.method_defined?(method_name.to_sym)\n\n self.class.send :define_method, method_name do\n @attributes[key].present?\n end\n end\n end", "d...
[ "0.74933535", "0.738902", "0.7088784", "0.7029897", "0.69955134", "0.69955134", "0.66549927", "0.6575111", "0.654429", "0.6524472", "0.6451747", "0.630259", "0.63015866", "0.6296643", "0.62649953", "0.62540424", "0.62152827", "0.61989963", "0.6193364", "0.61271846", "0.609991...
0.0
-1
Inputs: A number, n Returns: A string representing the input, with commas inserted into the correct position. Prints: Nothing For example, commas(123) == "123" commas(1234) == "1,234" commas(12345) == "12,345" commas(1234567) == "1,234,567" Note 1 If it's too much, don't worry about handling negative numbers at first. ...
def commas(num) string_with_commas = num.abs.to_s.chars.reverse.each_slice(3).map { |part| part.join }.join(",").reverse if num < 0 string_with_commas.prepend("-") end string_with_commas end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def separate_comma(number)\n array = number.to_s.split('') #creates an array from number w/ digits\n number_commas = array.size/3.0 #how many commas\n if array.size < 4 #this is a 3 digit number\n return number.to_s #return number no comma needed\n elsif array.size%3 == 0\n n = -4\n (number_commas.to_...
[ "0.7914775", "0.7734793", "0.76843846", "0.7644233", "0.7623419", "0.7537886", "0.75365174", "0.7488864", "0.7472605", "0.74317116", "0.74306995", "0.74193853", "0.7419242", "0.740064", "0.7387045", "0.7383005", "0.73735166", "0.73546416", "0.7354255", "0.734489", "0.7339927"...
0.7971964
0
method for sending email, receives two parameters user for who can be sent and daily for the answer
def reply_send(user, daily) @user = user @daily = daily mail({ :to => @user.email, :subject => "Responda a Daily - #{daily.data} - #{daily.team.nome}" }) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rate_your_date\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def daily_email\n mail(to: 'john.henderson@stackedsports.com,ben@stackedsports.com', subject: 'Recruit Suite Daily Offer & Commit Tweets')\n end", "def daily_gratitude\n @greeting = \"Hi\"\n\n mail to: \"to@exampl...
[ "0.73812443", "0.7303781", "0.72624326", "0.72144955", "0.7156137", "0.71098375", "0.7090858", "0.70524526", "0.69807136", "0.6972147", "0.69678164", "0.69574636", "0.6957204", "0.69204044", "0.6886325", "0.6860068", "0.68592817", "0.6858906", "0.6852853", "0.68502784", "0.68...
0.7884096
0
method to create a daily to all the team and sends email to all requesting the answer parameter tipo M equals the daily morning and T equal daily afternoon
def enviar(tipo) team = Team.all team.each do |t| d = Daily.new d.tipo = tipo d.data = Time.now.to_date d.team = t d.save t.members.each do |m| RepliesMailer.reply_send(User.find(m.id),d).deliver_now end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def daily(email,id)\n @information = Information.find_by_id(id)\n mail to: email,\n subject: \"Ofintel::Mensaje de \" << @information.form.name.capitalize\n end", "def reminder(attendance_id, type)\n sendgrid_category \"Tea Time Reminder\"\n\n @attendance = Attendance.includes(:tea_time, :user).f...
[ "0.66087705", "0.6494665", "0.6427933", "0.64078385", "0.63448685", "0.63281924", "0.6282701", "0.6230465", "0.62258995", "0.6222045", "0.61588794", "0.6105694", "0.6083911", "0.6078475", "0.60735375", "0.6024808", "0.60028577", "0.59926295", "0.59838235", "0.59835523", "0.59...
0.7993754
0
Print out all the factors for each of the numbers 1 through 100.
def factor(number) i = 1 while i <= number puts i if number % i == 0 i += 1 end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_factors(number)\n current_number = 1\n while current_number <= number\n puts current_number if is_factor_of(number, current_number)\n current_number += 1\n end\n end", "def factors(num)\n (1..Math::sqrt(num)).each do |x|\n if num % x == 0\n puts x\n puts num/x\n end...
[ "0.8008659", "0.7696721", "0.72060037", "0.71675843", "0.71675843", "0.71675843", "0.71560967", "0.7112258", "0.7110621", "0.7098075", "0.70960766", "0.7048901", "0.7010995", "0.6996013", "0.6981839", "0.6971287", "0.6970758", "0.69660395", "0.6963552", "0.6957044", "0.694597...
0.69340545
21
Write a method `substrings` that will take a `String` and return an array containing each of its substrings. Example output: `substrings("cat") => ["c", "ca", "cat", "a", "at", "t"]`
def sub_strings(string) blank = [] idx = 0 while idx < string.length length = 1 while (idx + length) <= string.length blank << string.slice(idx, length) length += 1 end idx += 1 end return blank end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def substrings(string)\n results = []\n (0...string.size).each do |start_index|\n this_substring = string[start_index..-1]\n results.concat(substrings_at_start(this_substring))\n end\n results\nend", "def substrings(string)\n array = []\n\n string.length.times do |index|\n this_substring = string[...
[ "0.845123", "0.84395766", "0.8432752", "0.84203", "0.8378813", "0.83327776", "0.83327776", "0.83327776", "0.8330915", "0.8321054", "0.8294223", "0.8277713", "0.8255244", "0.82196915", "0.8204148", "0.8195521", "0.8193858", "0.81705767", "0.8150321", "0.8131164", "0.81140417",...
0.7229387
59
Sets the given settings object properties in the Messenger Profile settings The following settings keys are available to be set: persistent_menu, get_started, greeting, whitelisted_domains, account_linking_url, payment_settings, target_audience
def set(settings, access_token:) response = post '', body: settings.to_json, query: { access_token: access_token } raise_errors(response) true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_settings(settings)\n @bridge.update_settings(settings)\n end", "def settings=(value)\n @settings = value\n end", "def settings=(value)\n @settings = value\n end", "def settings=(new_settings)\n settings.merge!(new_settings)...
[ "0.67890275", "0.6691169", "0.6691169", "0.65136147", "0.6482773", "0.6468122", "0.63329184", "0.63329184", "0.6277403", "0.62550706", "0.6241647", "0.6131126", "0.60999227", "0.60161394", "0.5984624", "0.5953785", "0.59460527", "0.592924", "0.5892595", "0.58871984", "0.58871...
0.5793473
26
Unsets an array of settings keys in the Messenger Profile settings The following settings keys are available to be unset: persistent_menu, get_started, greeting, whitelisted_domains, account_linking_url, payment_settings, target_audience
def unset(fields = [], access_token:) response = delete '', body: { fields: fields }.to_json, query: { access_token: access_token } raise_errors(response) true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unset_settings(names)\n configure do |settings|\n names.each { |name| settings.unset!(name) }\n end\n end", "def reset!\n @setting_objects = @setting_templates.map { |k, _| [k, []] }.to_h\n @settings.values.each(&:reset!)\n end", "def reset\n (@settings||{}).each...
[ "0.6762995", "0.65941447", "0.6571018", "0.64556366", "0.6315356", "0.61658126", "0.59490705", "0.5928268", "0.58669704", "0.5827676", "0.57828283", "0.5777236", "0.57693344", "0.5757412", "0.5733247", "0.5728414", "0.5708139", "0.5698574", "0.56745446", "0.5656984", "0.56487...
0.0
-1
It's possible to have multiple accounts in the database with only differences in email case, for hysterical raisins. We need to bypass the validation checks to create users like this nowadays.
def test_login_email_password_duplicate # Attempt to log in as one user, it should work user = create(:user) _uppercase_user = build(:user, :email => user.email.upcase).tap { |u| u.save(:validate => false) } try_password_login user.email, "test" assert_template "changeset/history" assert_selec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unique_email_user\n if self.class.where(email: email).count > 0\n errors.add(:email, :taken)\n end\n end", "def test_user_email_has_email_format\n assert User.create(first_name: \"Ilan\", last_name: \"Man\", email: \"ilan@gmail.com\")\n u = User.new(first_name: \"Aliza\", last_name: \"Barke...
[ "0.6876156", "0.6796808", "0.6723073", "0.65368706", "0.65074396", "0.6480692", "0.64723307", "0.6403417", "0.6384205", "0.6378172", "0.6371076", "0.6331562", "0.63143694", "0.6314328", "0.63043255", "0.6299808", "0.62828726", "0.62748027", "0.6258783", "0.62547433", "0.62495...
0.64312613
7
When there are no duplicate emails, any variation of cases should work
def test_login_email_password user = create(:user) try_password_login user.email, "test" assert_template "changeset/history" assert_select "span.username", user.display_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_not_duplicate(email, users)\r\n return false if users.all.find {|user| user.email == email}\r\n return true\r\nend", "def checkDupe(email_arr)\n\t \tdupeArr = []\n\t \tcopy_arr = Array.new(email_arr)\n\t \temail_arr.each do |selected_obj|\n\t \t\tcopy_arr.each do |copied_obj| \n\t \t\...
[ "0.7317703", "0.72435606", "0.7224939", "0.693469", "0.6927253", "0.6798897", "0.67417216", "0.6657123", "0.65334547", "0.64965504", "0.6490633", "0.6457775", "0.64068675", "0.6395334", "0.6390562", "0.6371364", "0.63387346", "0.63001317", "0.61644155", "0.6101913", "0.610144...
0.0
-1
As above, it's possible to have multiple accounts in the database with only differences in display_name case, for hysterical raisins. We need to bypass the validation checks to create users like this nowadays.
def test_login_username_password_duplicate # Attempt to log in as one user, it should work user = create(:user) _uppercase_user = build(:user, :display_name => user.display_name.upcase).tap { |u| u.save(:validate => false) } try_password_login user.display_name, "test" assert_template "changeset/h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_display_name\n assert users(:aaron).display_name != users(:aaron).login\n assert_equal \"sam\", users(:sam).display_name\n # login overrules display_name when it is not present\n users(:aaron).update_attributes :display_name => ''\n assert_equal users(:aaron).login, users(:aaron).display_na...
[ "0.67750734", "0.6759602", "0.65682065", "0.6562228", "0.6533973", "0.65241045", "0.6466493", "0.6359788", "0.6337887", "0.6333536", "0.63208956", "0.6305603", "0.62737054", "0.62658054", "0.62586343", "0.62482554", "0.62476534", "0.6243153", "0.6241358", "0.6215463", "0.6212...
0.5870382
75
When there are no duplicate emails, any variation of cases should work
def test_login_username_password user = create(:user) try_password_login user.display_name, "test" assert_template "changeset/history" assert_select "span.username", user.display_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_not_duplicate(email, users)\r\n return false if users.all.find {|user| user.email == email}\r\n return true\r\nend", "def checkDupe(email_arr)\n\t \tdupeArr = []\n\t \tcopy_arr = Array.new(email_arr)\n\t \temail_arr.each do |selected_obj|\n\t \t\tcopy_arr.each do |copied_obj| \n\t \t\...
[ "0.73172706", "0.7244462", "0.7224867", "0.6934921", "0.6926974", "0.67983836", "0.67415303", "0.665768", "0.6533334", "0.64956415", "0.64901656", "0.6456894", "0.64063823", "0.63965195", "0.6389222", "0.63709426", "0.63371366", "0.6299979", "0.61635303", "0.61020434", "0.610...
0.0
-1
GET /access_codes GET /access_codes.json
def index #TODO: determine how/what we're going to serve to get the user's ticket classes and acess_code_types @access_codes = AccessCode.where(user_access_code_type: @user_access_code_types).order('created_at DESC') @access_code = AccessCode.new # access code types available to this user. @access_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @access_codes = AccessCode.all\n end", "def index\n @codes = Code.public_codes\n end", "def index\n @authorize_codes = AuthorizeCode.all\n end", "def strava_access_info(code)\n HTTParty.post(\n 'https://www.strava.com/oauth/token',\n body: {\n 'client_id': Rails.ap...
[ "0.75145596", "0.6860467", "0.66478735", "0.6635784", "0.6579987", "0.6518891", "0.64903873", "0.6391148", "0.62908953", "0.62617695", "0.62617695", "0.62617695", "0.62617695", "0.62180465", "0.6207259", "0.6164776", "0.6164776", "0.616058", "0.6156447", "0.6142642", "0.61318...
0.5629675
70
Use callbacks to share common setup or constraints between actions.
def set_access_code @access_code = AccessCode.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def access_code_params params.require(:access_code).permit(:access_code_type_id, :code) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n...
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076",...
0.0
-1
Shortcut if you don't need specific versions but tons of gems
def gems(*args) gems.each{|g| gem(g) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pluggable!\n abort \"update rubygems to >= 1.3.1\" unless Gem.respond_to? :find_files\n require_rubygems_version \">= 1.3.1\"\n end", "def gems; end", "def gems; end", "def gems; end", "def require_gems; end", "def gem(name, version = Gem::Requirement.default)\n @gems ||= {}\n @gems[nam...
[ "0.67175263", "0.6641643", "0.6641643", "0.6641643", "0.6621031", "0.65490764", "0.6538627", "0.6450942", "0.6413862", "0.6332679", "0.6332679", "0.6332679", "0.6332679", "0.6332679", "0.6332679", "0.63060975", "0.6299986", "0.62891537", "0.62881637", "0.6277968", "0.6203056"...
0.6570703
5
Discards the recorded file. Useful in automated testing when a test passes and the recorded file is no longer needed.
def discard FileUtils.rm options.output end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def forget\n File.delete(SAVE_FILE) if File.exist?(SAVE_FILE)\n @default_file = nil\n end", "def forget\n File.delete(SAVE_FILE) if File.exist?(SAVE_FILE)\n @default_file = nil\n end", "def cleanup\n begin\n File.delete(full_filename, full_filename + \".meta\")\n ...
[ "0.62726814", "0.62726814", "0.62516457", "0.6224954", "0.6145018", "0.60652626", "0.5994618", "0.5990415", "0.5987711", "0.5911683", "0.59107774", "0.5879015", "0.5844761", "0.578773", "0.5771128", "0.57510054", "0.5713174", "0.5713174", "0.5695831", "0.565576", "0.5626671",...
0.66845715
0
Launches the ffmpeg binary using a generated command based on the given options.
def start_ffmpeg raise Errors::DependencyNotFound, 'ffmpeg binary not found.' unless ffmpeg_exists? ScreenRecorder.logger.debug "Command: #{command}" process = build_command @log_file = File.new(options.log, 'w+') process.io.stdout = process.io.stderr = @log_file @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_command(options = {})\n options = Miniatura::Options.new(options)\n %Q(ffmpeg #{options.to_options} #{output_path} -i #{input_path})\n end", "def command_line(options = {})\n if options.empty? || options.keys == [:output_path]\n # when there are no clip options, the sour...
[ "0.7777983", "0.7295032", "0.72801906", "0.71275777", "0.7113577", "0.6977823", "0.65161526", "0.6508539", "0.6435605", "0.6377071", "0.63476413", "0.6245637", "0.6140769", "0.60453576", "0.59720534", "0.593481", "0.58869535", "0.58081007", "0.57933134", "0.5774951", "0.57749...
0.7298278
1
Sends 'q' to the ffmpeg binary to gracefully stop the process. Forcefully terminates it if it takes more than 5s.
def stop_ffmpeg @process.io.stdin.puts 'q' # Gracefully exit ffmpeg @process.io.stdin.close @log_file.close @process.poll_for_exit(PROCESS_TIMEOUT) @process.exit_code rescue ChildProcess::TimeoutError ScreenRecorder.logger.error 'FFmpeg failed to stop. Force killing it...' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kill_ffmpeg\n @process.puts 'q' # Gracefully exit ffmpeg\n elapsed = wait_for_io_eof(5)\n @process.close_write # Close IO\n elapsed\n rescue Errno::EPIPE\n # Gets last line from log file\n err_line = get_lines_from_log(:last, 2)\n raise FFMPEG::Error, err_line\n end", ...
[ "0.7619801", "0.64746666", "0.6156642", "0.59733385", "0.59362113", "0.58456814", "0.5840903", "0.57792175", "0.576141", "0.5736947", "0.5732251", "0.56545484", "0.5651015", "0.5624696", "0.5619414", "0.55935216", "0.55279326", "0.55057764", "0.5496139", "0.54815865", "0.5471...
0.7703944
0
Generates the command line arguments based on the given options.
def command cmd = "#{ScreenRecorder.ffmpeg_binary} -y " cmd << @options.parsed end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_create_cli_arguments(options)\n options.map do |key, value|\n # If value is false, option is not set\n next if value.to_s == \"false\"\n # If value is true, consider feature flag with no value\n opt = value.to_s == \"true\" ? [] : [value]\n ...
[ "0.76302683", "0.68657255", "0.6815903", "0.63743794", "0.63580334", "0.6333748", "0.6229726", "0.6221362", "0.6188791", "0.61875117", "0.6182967", "0.6180965", "0.6177983", "0.6134084", "0.6096848", "0.60814506", "0.60070705", "0.5986514", "0.5974798", "0.5972883", "0.596968...
0.0
-1
Returns true if ffmpeg binary is found.
def ffmpeg_exists? return !`which ffmpeg`.empty? if OS.linux? # "" if not found return !`where ffmpeg`.empty? if OS.windows? # If the user does not use ScreenRecorder.ffmpeg_binary=() to set the binary path, # ScreenRecorder.ffmpeg_binary returns 'ffmpeg' assuming it must be in ENV. However, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ffmpeg_exists?\n return !`which ffmpeg`.empty? if OS.linux? # \"\" if not found\n\n return !`where ffmpeg`.empty? if OS.windows?\n\n # If the user does not use FFMPEG#ffmpeg_binary=() to set the binary path,\n # FFMPEG#ffmpeg_binary returns 'ffmpeg' assuming it must be in ENV. However,\n ...
[ "0.82654375", "0.74101174", "0.6974114", "0.6131671", "0.6124445", "0.6054125", "0.604863", "0.60140103", "0.60091865", "0.6006997", "0.5953888", "0.5943636", "0.59138155", "0.5862563", "0.585461", "0.58543026", "0.5835248", "0.57698745", "0.57681334", "0.57562983", "0.574077...
0.83090645
0
Returns lines from the log file
def lines_from_log(position = :last, count = 2) f = File.open(options.log) lines = f.readlines lines = lines.last(count) if position == :last lines = lines.first(count) if position == :first f.close lines.join(' ') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_lines\n reg = Regexp.new('^\\[' + @date + ':\\d\\d:\\d\\d:\\d\\d\\].*\\n', Regexp::MULTILINE)\n if File.exists?(@@gzlogfile)\n require 'zlib'\n gzfile = open(@@gzlogfile)\n @gz = Zlib::GzipReader.new(gzfile)\n @gz.read.match(reg).to_s.split(\"\\...
[ "0.7606784", "0.7459662", "0.7265494", "0.7103775", "0.6928469", "0.68874127", "0.6794659", "0.674974", "0.67244893", "0.6721947", "0.6692084", "0.662775", "0.6624283", "0.6623912", "0.6615227", "0.6611067", "0.6611067", "0.6611067", "0.6563216", "0.6557132", "0.64861125", ...
0.7207388
3
Returns OS specific arguments for Childprocess.build
def build_command ChildProcess.posix_spawn = true # Support JRuby. if OS.windows? ChildProcess.build('cmd.exe', '/c', command) else ChildProcess.build('sh', '-c', command) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def collect_build_args\n build_flags = []\n\n build_flags << \"--HEAD\" if HEAD?\n build_flags << \"--universal\" if build_universal?\n build_flags << \"--build-bottle\" if build_bottle?\n build_flags << \"--build-from-source\" if build_from_source?\n\n build_flags\n ...
[ "0.70447695", "0.6590676", "0.6459154", "0.6440801", "0.6236041", "0.6160666", "0.6151779", "0.6080014", "0.6080014", "0.6080014", "0.6080014", "0.6080014", "0.6080014", "0.6080014", "0.60114586", "0.6010087", "0.5999095", "0.5999095", "0.597948", "0.5967244", "0.5899625", ...
0.64364475
4
Extract version number from the SQL script path name Version is text between last '/' and '_' File path must end with '.sql'
def version(path) path.gsub(%r{.*/}, '').gsub(/_.*\.sql/, '') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extractVersion(filename)\n firstUnderscoreInd = filename.index(\"_\")\n return nil unless !firstUnderscoreInd.nil? \n\n secondUnderscoreInd = filename.index(\"_\", firstUnderscoreInd + 1)\n return nil unless !secondUnderscoreInd.nil?\n return filename[firstUnderscoreInd + 1...secondUnderscoreInd...
[ "0.69265324", "0.67398214", "0.65922076", "0.6589995", "0.63714814", "0.63149893", "0.6291423", "0.62357634", "0.61895114", "0.6109379", "0.6066427", "0.6039101", "0.6012632", "0.59884346", "0.59119266", "0.5854193", "0.58371145", "0.58119625", "0.5704681", "0.5700487", "0.56...
0.794104
0
path to the site
def is_global? if self.global.blank? self.global = yes?('Is this section aimed to be used as global?') end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pathWebSite\n \"./website/\"\nend", "def site_path\n settings.site_path\n end", "def site_url(path)\n\t\tbase_url = \"http://fullridecentral.com\"\n\t\t\"#{base_url}#{path}\"\n\tend", "def url\n Config.site.url.chomp('/') + self.path\n end", "def site_url\n get_url(:site)\n ...
[ "0.8112752", "0.8052568", "0.78559875", "0.76878643", "0.74685574", "0.73113364", "0.7304178", "0.7176068", "0.7131744", "0.71310663", "0.7105632", "0.7087007", "0.69383603", "0.689672", "0.68811816", "0.6874282", "0.68590456", "0.685685", "0.68227243", "0.6815827", "0.678937...
0.0
-1
Instantiate a new Gini::Api::OAuth object and acquire token(s)
def initialize(api, opts) # Initialize client. max_redirect is required as oauth2 will otherwise redirect to location from header (localhost) # https://github.com/intridea/oauth2/blob/master/lib/oauth2/client.rb#L100 # Our code is encoded in the URL and has to be parsed from there. clien...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init\n init_oauth_access_token\n end", "def initialize(tokens_and_secrets = {})\n @oauth = KynetxAmApi::Oauth.new(tokens_and_secrets)\n end", "def init_oauth_access_token\n @oauth_access_token = OAuth2::AccessToken.new(\n User.new_oauth_client,\n read_attribute(:access_token),\n ...
[ "0.77843565", "0.74633795", "0.70827544", "0.70555025", "0.6924061", "0.6917971", "0.6911226", "0.68297166", "0.6819389", "0.68073815", "0.6779179", "0.67089313", "0.67043024", "0.66847664", "0.66837764", "0.66457665", "0.6637931", "0.66204536", "0.6616566", "0.66140515", "0....
0.63472944
38
Login with resource owner password credentials
def login_with_resource_owner_password_credentials(client, username, password) client.password.get_token(username, password) rescue OAuth2::Error => e fail_with_oauth_error( "Failed to acquire token with resource owner credentials (code=#{e.response.body})", e.response ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login(resource)\n login_as resource.user, scope: :user\n end", "def login\n username.set 'tomsmith'\n password.set 'SuperSecretPassword!'\n end", "def login\n @rforce.login( @login , @password )\n end", "def login\n client.login(\n params[:user],\n params[:password],\n...
[ "0.71956086", "0.68979704", "0.68858606", "0.688207", "0.6787075", "0.6683818", "0.6670341", "0.66125995", "0.6609248", "0.65897787", "0.6585135", "0.6570292", "0.6560691", "0.65360445", "0.6504288", "0.64971095", "0.64971095", "0.64875954", "0.64875954", "0.64875954", "0.648...
0.7279387
0
Exchange auth_code for a access token
def exchange_code_for_token(api, client, auth_code) client.auth_code.get_token(auth_code, redirect_uri: api.oauth_redirect) rescue OAuth2::Error => e fail_with_oauth_error( "Failed to exchange auth_code for token (code=#{e.response.status})", e.response ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exchange_code_with_access_token(code)\n response = @client.post(\"#{@base_url}/oauth/access_token\", access_token_params(code))\n data = JSON.parse(response.body)\n access_token = data[\"access_token\"]\n # binding.pry\n if(access_token)\n set_user_instagram_profile(data, access_token)\n ...
[ "0.77840793", "0.7755792", "0.7754282", "0.76936525", "0.76905847", "0.7551027", "0.75400126", "0.75288117", "0.7478946", "0.74444634", "0.73704153", "0.7323356", "0.7282609", "0.7254449", "0.7243252", "0.7218756", "0.7203443", "0.717221", "0.7137572", "0.70849484", "0.707622...
0.8185586
0
rebuild the base vagrant.nix configuration
def prepare! cleanup_hostname! cleanup_network! imports = '' # Find all /etc/nixos/vagrant-*.nix files machine.communicate.tap do |c| c.execute('find /etc/nixos -maxdepth 1 -type f -name "vagrant-*.nix"') do |type, data| imports << data end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_vagrant_config\n template = Souffle::Template.new('Vagrantfile.erb')\n temp_binding = OpenStruct.new\n temp_binding.version = Souffle::VERSION\n \n template.render(temp_binding)\n end", "def create_vagrantfile\n output << bold(color(\"localhost$\", :green)) << \" cd #{@vagrant_p...
[ "0.6890702", "0.6440733", "0.6396086", "0.6250392", "0.6210189", "0.61877483", "0.6184946", "0.615588", "0.6134328", "0.60837656", "0.6065452", "0.6017837", "0.6016306", "0.5982702", "0.5977534", "0.59605455", "0.5955149", "0.59543437", "0.5900816", "0.5886093", "0.5881833", ...
0.68805814
1
Send file to machine. Returns true if the uploaded file if different from any preexisting file, false if the file is indentical
def write_config(filename, conf) temp = Tempfile.new("vagrant") temp.binmode temp.write(CONFIG_HEADER + conf) temp.close changed = true machine.communicate.tap do |comm| source = "/tmp/#{filename}" target = "/etc/nixos/#{filename}" comm.uploa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_file(file, remotefile = File.basename(file))\n begin\n @ftp.putbinaryfile(file, remotefile)\n return true\n rescue Exception => e\n error_message(e)\n return false\n end\n end", "def send_file(src, dst)\n uploaded = false\n Net::SCP.start(@host, @user, passwor...
[ "0.70224315", "0.6943973", "0.6729384", "0.64382446", "0.6409563", "0.6369439", "0.62952286", "0.6278191", "0.6266097", "0.6247677", "0.6235396", "0.62282324", "0.62046546", "0.6202053", "0.6196252", "0.6188021", "0.61635375", "0.6152366", "0.6130356", "0.6118995", "0.6097514...
0.0
-1
Cleanup the hostname file if it hasn't been configured in the Vagrantfile.
def cleanup_hostname! return unless machine.config.vm.hostname.nil? machine.communicate.sudo("rm -f /etc/nixos/vagrant-hostname.nix") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_hostfile(config)\n open('hosts', 'w') do |f|\n f.puts <<-__EOF\n127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4\n::1 localhost localhost.localdomain localhost6 localhost6.localdomain6\n\n10.0.10.10 device-scanner1.local device-scanner1\n10.0.10.11 device-scanne...
[ "0.6584574", "0.62738216", "0.61875767", "0.6152437", "0.6076054", "0.60690695", "0.606666", "0.6006228", "0.6002979", "0.6001557", "0.59755254", "0.5966906", "0.5942912", "0.5894746", "0.5883216", "0.5871264", "0.58581966", "0.58332896", "0.5812867", "0.5782844", "0.5768052"...
0.81334585
0
Cleanup the network file if it hasn't been set in the Vagrantfile
def cleanup_network! # Abort if a private network has been defined machine.config.vm.networks.each do |cfg| return if cfg[0] == :private_network end machine.communicate.sudo("rm -f /etc/nixos/vagrant-network.nix") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def cleanup_hostname!\n return unless machine.config.vm.hostname.nil?\n machine.communicate.sudo(\"rm -f /etc/nixos/vagrant-hostname.nix\")\n end", "def cleanup\n case SubutaiConfig.provider\n when :hyper_v\n SubutaiDisk.hyperv_remove_disk\n end\n\n # cleanup vir...
[ "0.6252101", "0.6247091", "0.62012273", "0.60950124", "0.6052456", "0.60491484", "0.59736097", "0.5919751", "0.5884403", "0.58653253", "0.5864122", "0.5835876", "0.58109933", "0.5773456", "0.56308985", "0.55742604", "0.5566547", "0.5562988", "0.5560676", "0.5535589", "0.55344...
0.80067706
0
General translation key based on the klass of the association.
def association_klass_key(assoc, key) k = 'activerecord.associations.' k << assoc.klass.model_name.singular k << '.' k << key.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def association_key_name\n reflection.join_primary_key(klass)\n end", "def association_key_name\n reflection.join_primary_key(klass)\n end", "def derive_foreign_key\n result = super\n result = ActiveSupport::Inflector.pluralize(result) \\\n ...
[ "0.7179389", "0.7177014", "0.68672013", "0.686572", "0.68411636", "0.6762764", "0.6684993", "0.6632869", "0.65798795", "0.6546971", "0.6511845", "0.64926136", "0.6425172", "0.6401641", "0.63826495", "0.6320963", "0.63158375", "0.63051826", "0.62997717", "0.6285026", "0.626935...
0.7254545
0
Specific translation key based on the owner model and the name of the association.
def association_owner_key(assoc, key) k = 'activerecord.associations.models.' k << assoc.active_record.model_name.singular k << '.' k << assoc.name.to_s k << '.' k << key.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def keyName\n e = inherited_from || entity\n \"#{e.model.name}#{e.name}#{name.capitalize_first}\"\n end", "def derive_foreign_key\n result = super\n result = ActiveSupport::Inflector.pluralize(result) \\\n if collection? && connected_through_array?\n res...
[ "0.66330737", "0.64807993", "0.6453551", "0.6429536", "0.63335866", "0.63335866", "0.6313678", "0.63047385", "0.6233618", "0.6110192", "0.6089619", "0.6084648", "0.6078623", "0.6027163", "0.6019437", "0.599588", "0.5975245", "0.5963584", "0.5940511", "0.5914744", "0.587102", ...
0.6785783
0
utility logic Wraps the given error inside the given message, while preserving its original stack trace, and raises it.
def raise_error aMessage, aError = $! raise aError.class, "#{aMessage}:\n#{aError}", aError.backtrace end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error(message)\n raise Error, message, caller\n end", "def with_failure_message(msg, &block)\n begin\n yield\n rescue Exception => ex\n suffix = msg.kind_of?(Proc) ? msg.call() : msg.to_s\n newex = ex.class.new(ex.message + \"\\n#{suffix}\")\n newex.set_backtrace(ex.backtrace)\n...
[ "0.7015195", "0.6646874", "0.6619896", "0.65442157", "0.6506785", "0.6464256", "0.63904446", "0.63816786", "0.6364308", "0.6361313", "0.6350026", "0.62295455", "0.6225226", "0.6091703", "0.60721", "0.6053685", "0.59938365", "0.59932876", "0.59309816", "0.5909623", "0.5889475"...
0.68541205
1
Notify the user about some action being performed.
def notify aAction, aMessage printf "%12s %s\n", aAction, aMessage end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def notify(action)\n NotificationsHelper.notify(action: action, check_id: @check.id)\n end", "def notify\n end", "def act notification, options={}\n # ...or nothing\n end", "def notify(action)\n NotificationsHelper.notify(action: action, scan_id: @scan.id)\n end", "def process_ac...
[ "0.66512835", "0.65502024", "0.6546452", "0.6427917", "0.6371984", "0.6337073", "0.6182372", "0.61573076", "0.61472094", "0.60813695", "0.606691", "0.6066615", "0.60575795", "0.604937", "0.60253483", "0.602038", "0.6000959", "0.5968343", "0.5951868", "0.5951868", "0.595009", ...
0.6928627
0
Returns a hyperlink to the given URL of the given name and mousehover title.
def link aUrl, aName = nil, aTitle = nil aName ||= aUrl %{<a href="#{aUrl}"#{%{ title="#{aTitle}"} if aTitle}>#{aName}</a>} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hyperlink(url, class_name)\n hyper_a = @doc.at_css \"div[@class='row title #{class_name}']//a\"\n hyper_a['href'] = url\n end", "def hover_over_link(text)\n find(\"a\", text: text).hover\n end", "def handle_special_HYPERLINK(special)\n url = special.text\n gen_url url, url\n end", "...
[ "0.6676026", "0.6646737", "0.66273636", "0.6584111", "0.64131564", "0.6169629", "0.6165404", "0.6123135", "0.6095981", "0.6093957", "0.6092175", "0.6040784", "0.5992836", "0.5986895", "0.59267837", "0.592098", "0.59165895", "0.59163654", "0.5902877", "0.59013814", "0.5888146"...
0.68790424
0
Returns HTML for embedding an icon from the input/icons/ directory.
def icon aFileName, aAlt = nil, aTitle = nil aTitle ||= aAlt %{<img class="icon" src="icons/#{aFileName}" alt="#{aAlt}" title="#{aTitle}" />} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def icon\n content_tag(:span, \"\", class: \"icon\")\n end", "def icon\n tag.span(\"\", class: \"icon\")\n end", "def admin_icon(icon)\n icon = \"#{icon}.png\" unless icon.to_s.include?('.')\n tag(:img, nil, { :src => \"/images/admin_icons/#{icon}\", :class => 'icon' })\n end", ...
[ "0.670226", "0.6649151", "0.6427017", "0.64075303", "0.6382856", "0.6382856", "0.6363605", "0.6345904", "0.63397795", "0.6204316", "0.6124842", "0.6108378", "0.6081528", "0.6073371", "0.6064305", "0.6064305", "0.60629547", "0.6059738", "0.6053877", "0.6048062", "0.6046546", ...
0.61744684
10
Returns a safe file name that is composed of the given words and has the given file extension.
def make_file_name aExtension, *aWords #:nodoc: aWords.join(' ').to_file_name.ext(aExtension) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def proper_filename(file)\n file.gsub(/[^\\w]/,'_')\n end", "def processed_filename(filename, extension = nil)\n suffix = \"_#{model.filename_token}\"\n max_processed_filename_size = max_processed_filename_size(suffix)\n filename_without_suffix = filename.slice 0, max_...
[ "0.66934633", "0.66535133", "0.6454529", "0.64529526", "0.6433097", "0.6415566", "0.63323534", "0.6286419", "0.6262342", "0.6224727", "0.6210857", "0.6200535", "0.614744", "0.61329263", "0.6100828", "0.60736275", "0.607073", "0.6057006", "0.60508776", "0.6049477", "0.60494256...
0.8189373
0
Transforms this UTF8 string into HTML entities.
def to_html_entities unpack('U*').map! {|c| "&##{c};"}.join end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def escape_entities(str)\n CGI.escapeHTML(str).gsub(/[\\n\\r]/) {|c| '&#x' + c.unpack('h').first + ';'}\n end", "def convert_html_safe(str)\n return str.html_safe\n end", "def html_escape\n return to_s\n end", "def html_escape\n return to_s\n end", "def encode_html( str ...
[ "0.6941835", "0.66859895", "0.64850134", "0.64850134", "0.64444035", "0.6432338", "0.6432338", "0.6421787", "0.63905174", "0.6375732", "0.6342318", "0.6332261", "0.63291854", "0.6255026", "0.6235949", "0.6231118", "0.62163454", "0.6206096", "0.62022585", "0.6171983", "0.61524...
0.7328516
0
Transforms this string into a valid URI fragment. See
def to_uri_fragment # remove HTML tags from the input buf = gsub(/<.*?>/, '') # The first or only character must be a letter. buf.insert(0, 'a') unless buf[0,1] =~ /[[:alpha:]]/ # The remaining characters must be letters, digits, hyphens (-), # underscores (_), colons (:), or perio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uri_fragment\n url.to_uri_fragment\n end", "def to_fragment\n fragment = @uri.fragment\n fragment ? Wgit::Url.new(fragment) : nil\n end", "def fragment(string); end", "def fragment_set(fragment)\n rebuild_uri :fragment => fragment\n end", "def clean(uri)\n uri = URI.parse(...
[ "0.6783226", "0.6735082", "0.6545673", "0.6237487", "0.5960576", "0.59573996", "0.59391564", "0.59391564", "0.5927253", "0.5839292", "0.58035135", "0.5802238", "0.5781554", "0.577906", "0.5752535", "0.57295924", "0.57221025", "0.57104325", "0.5707025", "0.5632416", "0.5627103...
0.77560365
0
Passes this string through ERB and returns the result.
def thru_erb aBinding = Kernel.binding ERB.new(self).result(aBinding) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def eb(string)\n renderer = ERB.new(string)\n return renderer.result(binding)\n end", "def erb(content)\n ERB.new(content).result(binding)\nend", "def erb(vars = {})\n ERBResolve.new(vars).resolve(self)\n end", "def erb(vars = {})\n ERBResolve.new(vars).resolve(self)\n end", "def process_st...
[ "0.7208919", "0.6819483", "0.66106343", "0.66106343", "0.6436244", "0.6374393", "0.6340461", "0.6340461", "0.6340461", "0.61331314", "0.60602057", "0.602603", "0.6022182", "0.6015715", "0.6012962", "0.5980743", "0.5941015", "0.5923119", "0.59018934", "0.58815765", "0.5872994"...
0.63792336
5
Transforms this string into an escaped POSIX shell argument whilst preserving Unicode characters.
def shell_escape inspect.gsub(/\\(\d{3})/) { $1.to_i(8).chr } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def escape_shell_unix(str)\n str = str.to_s\n raise 'cannot escape control characters' if UNESCAPABLE_CHARS =~ str\n str.gsub(UNSAFE_CHARS_UNIX) { |x| \"\\\\#{x}\" }\n end", "def escape_shell_string(str)\n str = str.gsub(/\\\\/, \"\\\\\\\\\\\\\")\n str = str.gsub(/\"/, \"\\\\\\\"\")\n ...
[ "0.66459125", "0.6606275", "0.65936553", "0.6513575", "0.6470831", "0.634391", "0.63070637", "0.6288415", "0.6274598", "0.62725526", "0.62381536", "0.6178051", "0.6149439", "0.6125874", "0.60713524", "0.60000074", "0.5947532", "0.5942102", "0.59024954", "0.58751523", "0.58537...
0.6555978
3
Builds a table of contents from XHTML headings (, , etc.) found in this string and returns an array containing [toc, html] where: toc:: the generated table of contents html:: a modified version of this string which contains anchors for the hyperlinks in the table of contents (so that the TOC can link to the content in ...
def table_of_contents toc = '<ul>' prevDepth = 0 prevIndex = '' html = gsub %r{<h(\d)(.*?)>(.*?)</h\1>$}m do depth, atts, title = $1.to_i, $2, $3.strip # generate a LaTeX-style index (section number) for the heading depthDiff = (depth - prevDepth).abs index...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transform_toc( str, rs )\n\t\t\t@log.debug \" Transforming tables of contents\"\n\t\t\tstr.gsub(TOCRegexp){\n\t\t\t\tstart_level = 2 # default\n\t\t\t\tend_level = 6\n\n\t\t\t\tparam = $1\n\t\t\t\tif param then\n\t\t\t\t\tif param =~ TOCStartLevelRegexp then\n\t\t\t\t\t\tif !($1) and !($2) then\n\t\t\t\t\t\t\t...
[ "0.67860705", "0.63883775", "0.6367156", "0.63406163", "0.6334079", "0.61163145", "0.58798003", "0.582815", "0.5762376", "0.57608384", "0.5640502", "0.56395227", "0.5576294", "0.5504445", "0.54748225", "0.54716957", "0.54535174", "0.54508066", "0.5409715", "0.54023176", "0.54...
0.6706092
1
aName:: String that replaces the ambiguous '(erb)' identifier in stack traces, so that the user can better determine the source of an error. args:: Arguments for ERB::new
def initialize aName, *args # silence the code-only <% ... %> directive, just like PHP does args[0].gsub!(/^[ \t]*<%[^%=]((?!<%).)*?[^%]%>[ \t]*\r?\n/m) {|s| s.strip} args[3] = '@buffer' super(*args) @filename = aName end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def erb!(vars = {})\n ERBResolve.new(vars).resolve!(self)\n end", "def erb!(vars = {})\n ERBResolve.new(vars).resolve!(self)\n end", "def erb!(vars = {})\n ERBResolve.new(vars).resolve!(self)\n end", "def exception_renderer=(_arg0); end", "def bold_error(*args); end", "def load_erb(erb)\n ...
[ "0.56480336", "0.56480336", "0.56480336", "0.55795705", "0.5568302", "0.5496507", "0.5480956", "0.5480956", "0.54781204", "0.5477019", "0.54145694", "0.54145694", "0.5389615", "0.5331774", "0.53190696", "0.5258864", "0.5189465", "0.5184884", "0.5175613", "0.5163462", "0.51544...
0.5371472
13
Renders this template within a fresh object that is populated with the given instance variables.
def render_with aInstVars = {} context = Object.new.instance_eval do aInstVars.each_pair do |var, val| instance_variable_set var, val end binding end result(context) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(obj = Object.new, locals = {})\n output = template.result(obj.instance_eval {binding})\n end", "def render_with(**locals)\n render_with_template(locals: locals)\n end", "def render_to_string(template, variables={})\n assigns = variables.reverse_merge(self.class.class_name.un...
[ "0.6957112", "0.65652436", "0.647221", "0.6445222", "0.63346475", "0.6320176", "0.6253311", "0.62422436", "0.6219576", "0.6203173", "0.61890304", "0.61177826", "0.6113484", "0.60645306", "0.60612535", "0.6018865", "0.6018754", "0.6018754", "0.60113066", "0.5997331", "0.597270...
0.64120245
4
Registers a new Rake task for generating a HTML file and returns the path of the output file.
def generate_html_task aTask, aPage, aDeps, aRenderOpts = {} #:nodoc: dst = File.join('output', aPage.url) # register subdirs as task deps dst.split('/').inject do |base, ext| directory base aDeps << base File.join(base, ext) end file dst => aDeps + COMMON_DEPS do notify a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_file(task, &block)\n GenerateFileTask.define_task(task, &block)\n end", "def define_weave_task\n desc \"Weave chunks into HTML\" unless ::Rake.application.last_comment\n ::Rake::Task.define_task(\"codnar_weave\" => @output)\n ::Rake::FileTask.define_task(@output => R...
[ "0.6541753", "0.63326865", "0.5991717", "0.58827794", "0.5765591", "0.57637876", "0.5722171", "0.571173", "0.5700675", "0.56771517", "0.5652417", "0.5649772", "0.56354046", "0.5594565", "0.5582609", "0.5580985", "0.55369174", "0.55277336", "0.5516373", "0.5507344", "0.5491674...
0.7079374
0
Registers a new Rake task for generating a feed. aFile:: path of the output file relative to the output/ directory aItems:: array containing Chapter, Section, Listing, and Entry objects aName:: title of the feed aInfo:: description of the feed aSummarize:: summarize blog entries in the feed?
def feed aFile, aItems, aName, aInfo = nil, aSummarize = true dst = File.join('output', aFile) entries = [aItems].flatten.uniq feedObj = Feed.new(aFile, entries, aName, aInfo, aSummarize) FEEDS << feedObj file dst => COMMON_DEPS + entries.map {|e| e.input_file} do |t| notify :feed, t.name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_tool(file, clazz)\n name = File.basename(file).gsub(/.rb$/, '').gsub(/_task/, '')\n doc_file = File.expand_path(File.dirname(file) + \"/#{name}_documentation.rb\")\n content = clazz.new(name, Rake::application).to_rdoc\n\n File.open(doc_file, 'w') do |f|\n f.write content\n end\n\n CLEAN.add(doc_f...
[ "0.61879826", "0.61820567", "0.6175844", "0.61696196", "0.6057729", "0.60331964", "0.5989287", "0.5927831", "0.58518565", "0.58466053", "0.58170885", "0.5780133", "0.5769363", "0.5759145", "0.5753955", "0.5731767", "0.5728801", "0.572325", "0.57017535", "0.56988233", "0.56816...
0.80939937
0
Translates the given string and then formats (see Stringformat) the translation with the given placeholder arguments. If the translation is not available, then the given string will be used instead.
def [] aPhrase, *aArgs s = aPhrase.to_s if key? s super(s) else s end.to_s % aArgs end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def localize_with_args(args={}, replacement_string = '__i18n_missing__') \n I18n.translate(self, {:default => \"#{replacement_string}(#{self})\"}.merge(args))\n end", "def localized_format(key, translation_table = nil, placeholder_value)\n format_str = localized(key, translation_table)\n puts format_str...
[ "0.6917081", "0.6483449", "0.6205764", "0.6105185", "0.6084257", "0.60823435", "0.6016617", "0.59956044", "0.5940421", "0.58959764", "0.58653945", "0.5795312", "0.57663625", "0.5742256", "0.57390803", "0.572761", "0.572761", "0.56942487", "0.56942487", "0.56942487", "0.567134...
0.0
-1
Returns the template used to render objects of this class.
def template Kernel.const_get(template_name.upcase << '_TEMPLATE') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def template\n if object.respond_to?(:template)\n object.template\n else\n @template\n end\n end", "def template\n @__template\n end", "def template\n @template\n end", "def _template\n @template\n end", "def template\n @_re...
[ "0.8220734", "0.79353565", "0.7805962", "0.76836586", "0.7668621", "0.7539497", "0.7390607", "0.73813397", "0.72646934", "0.7174535", "0.71052253", "0.70502216", "0.69571507", "0.68675584", "0.68675584", "0.68419755", "0.68419755", "0.6793192", "0.67749417", "0.6771616", "0.6...
0.6906714
13
Returns the name of the instance variable for objects of this class. This variable is used in the template of this class.
def template_ivar "@#{template_name.downcase}".to_sym end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_variable_name; end", "def instance_variable_name_for(klass)\n klass.to_s.split('::').last.underscore\n end", "def instance_variable_name(name)\n \"@#{name.to_s}\".to_sym\n end", "def instance_variable_name\n if options.key?(:instance_variable_name)\n options[:...
[ "0.8186313", "0.7727251", "0.764855", "0.7640566", "0.74451554", "0.7408418", "0.7195294", "0.7177651", "0.71490663", "0.7090653", "0.7078395", "0.70461917", "0.70269364", "0.7017372", "0.7017372", "0.7015524", "0.6980867", "0.6980674", "0.69339097", "0.69339097", "0.69317496...
0.66696566
35
Path (relative to the output/ directory) to the HTML output file of this object.
def url make_file_name('html', name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_path; end", "def output_path\n File.join(Musako.destination_path, @url)\n end", "def output_path\n settings[:output]\n end", "def out_path\n @out_path ||= File.join out_base, node.file_name\n end", "def output_dir(options = {})\n options[:dir] = \"generate\"\n ...
[ "0.7647411", "0.75455", "0.75042796", "0.7099642", "0.7022668", "0.69529396", "0.69134957", "0.69116294", "0.68253106", "0.68032867", "0.6714963", "0.6654575", "0.6627577", "0.65837014", "0.6567232", "0.6566964", "0.6564289", "0.6532504", "0.6484634", "0.6484634", "0.6443532"...
0.63592947
26
Returns a URI fragment for this object.
def uri_fragment url.to_uri_fragment end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_fragment\n fragment = @uri.fragment\n fragment ? Wgit::Url.new(fragment) : nil\n end", "def uri\n self + \"\"\n end", "def uri\n self + \"\"\n end", "def uri\n uri_prefix + Digest::MD5.hexdigest(self.address)\n end", "def uri\n Util.join_uri(self.class.uri...
[ "0.76548874", "0.67738914", "0.67738914", "0.6704677", "0.66991985", "0.66487414", "0.6574737", "0.6502709", "0.64774996", "0.6443823", "0.6436417", "0.64006126", "0.63873756", "0.63783616", "0.636673", "0.63534254", "0.63235366", "0.63196474", "0.6281733", "0.6281733", "0.62...
0.80864245
0
Returns a URL to the parent page which takes you directly to this item inside the parent page.
def parent_url parent.url + '#' + self.uri_fragment end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parent\n page\n end", "def relative_url_parent\n note = self\n return note.get_parent().relative_url\n end", "def parent\n return @links[:parent]\n end", "def url\n [ @parent.url, @name ].join('/')\n end", "def parent_object\n # hack by sean to allow permal...
[ "0.78226185", "0.72741395", "0.72713304", "0.70932853", "0.6889819", "0.68476534", "0.6847304", "0.67895526", "0.67895526", "0.67895526", "0.67895526", "0.6753331", "0.6738767", "0.6738767", "0.6732728", "0.67090905", "0.66955924", "0.6587317", "0.65165323", "0.6500729", "0.6...
0.80759215
0
Transforms this object into HTML.
def to_html aOpts = {} aOpts[:@summarize] = true unless aOpts.key? :@summarize aOpts[template_ivar] = self template.render_with(aOpts) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_html\n end", "def to_html(*)\n self\n end", "def to_html\n build\n end", "def to_html; end", "def to_html\n @html ||= format_html\n end", "def to_s\n to_html\n end", "def to_html\n map { |x| x.output(\"\") }.join\n end", "def h obj; obj.to_s.htm...
[ "0.7577378", "0.7412115", "0.7380472", "0.7367659", "0.72465044", "0.723646", "0.70704997", "0.7049028", "0.6852193", "0.6852193", "0.6811522", "0.67802984", "0.6776242", "0.6776242", "0.6776242", "0.6776242", "0.67678857", "0.6687004", "0.6671034", "0.6667248", "0.6667248", ...
0.6036573
82