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
Internal function to execute the merge on one key provided by _rh_merge if refuse_discordance is true, then result[key] can't be updated if stricly not of same type.
def _do_rh_merge(result, key, data, refuse_discordance = false) value = data[key] return if _rh_merge_do_add_key(result, key, value) return if _rh_merge_recursive(result, key, data) return if refuse_discordance return unless _rh_struct_changing_ok?(result, key, data) return unless _rh_merge...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _rh_merge(result, data)\n return _rh_merge_choose_data(result, data) unless data.is_a?(Hash)\n\n data.each do |key, _value|\n next if [:__struct_changing, :__protected].include?(key)\n\n _do_rh_merge(result, key, data)\n end\n [:__struct_changing, :__protected].each do |key|\n # Refu...
[ "0.66566783", "0.6546197", "0.5866346", "0.56332564", "0.53934026", "0.53718096", "0.53412914", "0.53256875", "0.5317653", "0.52883005", "0.52566755", "0.5231188", "0.5226204", "0.52182066", "0.51989967", "0.5190673", "0.51871425", "0.51842844", "0.51671237", "0.51543087", "0...
0.8479817
0
Created On: 08/11/2014 Purpose: To get operating system statistics report ++
def get_access_operating_system(device_access) total_device_count = device_access.count computer_count = device_access.where(:access_operating_system=>"Computer").count computer_count_percent = ((computer_count.to_f * 100) / total_device_count).round(2) mobile_count = device_access.where(:access_operating_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stats\n _get(\"/system/stats\") { |json| json }\n end", "def device_operating_system_summary\n return @device_operating_system_summary\n end", "def io_stats\n @vm[:netrx] = 0\n @vm[:nettx] = 0\n @vm[:diskrdbytes] = 0\n @vm[:diskwrbytes] = 0\...
[ "0.6882971", "0.68804306", "0.68587166", "0.68384486", "0.6808128", "0.65560126", "0.6497229", "0.6483706", "0.6420413", "0.6406048", "0.6335443", "0.63300586", "0.6326804", "0.6307538", "0.6275302", "0.62235785", "0.62192965", "0.61828184", "0.6137653", "0.6125858", "0.61115...
0.623746
15
Created On: 08/11/2014 Purpose: To get browser statistics report ++
def get_access_browser(overall_device_access) device_access = overall_device_access.where(access_operating_system: "Computer") total_device_count = device_access.count chrome_count = device_access.where(:access_browser => "Chrome").count chrome_count_percent = ((chrome_count.to_f * 100) / total_device...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def html_report_stats\n @report << '<div id=\"title\"> General Statistics</div>'\n stat_tab = Ruport::Data::Table(%w[Stat Value])\n stat_tab << ['Number of servers Seen', @num_servers]\n stat_tab << ['Number of clients Seen', @num_clients]\n @num_by_cipher.each do |cipher, num|\n stat_tab << ['...
[ "0.6890602", "0.6672983", "0.64488024", "0.64312273", "0.62585163", "0.618761", "0.618761", "0.6166706", "0.6129158", "0.61225843", "0.6115214", "0.60773706", "0.6054409", "0.5993558", "0.5993558", "0.5973039", "0.5967543", "0.59601164", "0.5958867", "0.5958867", "0.5945499",...
0.61475533
8
Created On: 08/11/2014 Purpose: To get country statistics report ++
def get_country_statistics_report(country_list, device_access) @country_hash = {} country_list.each do |country| country_count = device_access.where(:access_country => country).count @country_hash[country] = country_count end country_stat = @country_hash.sort_by {|_key, value| value}.revers...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country; end", "def country; end", "def country; end", "def countries_geo_entity_stats\n countries.present? ? GeoEntityStat.where(geo_entity_id: countries.map(&:id)) : geo_entity_stats\n end", "def country_details(region, input)\n country = @countries[input - 1]\n\n Table.display_as_summary(c...
[ "0.6671692", "0.6671692", "0.6671692", "0.66341335", "0.66064835", "0.6473873", "0.64499825", "0.63868284", "0.6376618", "0.6353003", "0.6335491", "0.63140094", "0.62906873", "0.62640035", "0.62503564", "0.6236346", "0.6235966", "0.62233686", "0.62133247", "0.61735654", "0.61...
0.73234856
0
Created On: 08/11/2014 Purpose: To get city statistics report ++
def get_city_statistics_report(city_list, device_access) @city_hash = {} city_list.each do |city| city_count = device_access.where(:access_city => city).count @city_hash[city] = city_count end city_stat = @city_hash.sort_by {|_key, value| value}.reverse hash = Hash[*city_stat.flatten] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def report_data\n House.cities.each_with_object([]) do |city, report|\n sum_house_daylights = House.sum_house_daylights(city)\n item = {\n name: city,\n daylight: average_house_daylights(sum_house_daylights).round(1).to_s,\n }\n report << item\n end\n end", "def get_n...
[ "0.70277655", "0.6519229", "0.64871705", "0.6361573", "0.6277916", "0.6140002", "0.61096627", "0.61096627", "0.61081153", "0.61061937", "0.61061937", "0.61061937", "0.61061937", "0.60661817", "0.60499763", "0.6043724", "0.5992022", "0.5991582", "0.59725887", "0.59559923", "0....
0.73081815
0
Created On: 21/11/2014 Purpose: To get country name for listen song ++
def get_country(device_access_id) DeviceAccess.find(device_access_id).access_country end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country_name\n cc = carmen_country\n\n cc ? \"#{cc.name}\" : ''\n end", "def get_country_name_lib country_code\n country = Carmen::Country.coded(country_code)\n if country\n country.name\n else\n \"N/A\"\n end\n end", "def country_name\n country = ISO3166::Country[country_c...
[ "0.7214127", "0.720626", "0.70597464", "0.7027749", "0.7016789", "0.6992105", "0.6971549", "0.6963176", "0.69252384", "0.684945", "0.6767812", "0.6767812", "0.6767812", "0.6766055", "0.6739447", "0.6689148", "0.66586477", "0.6643237", "0.66182166", "0.6593655", "0.65789783", ...
0.0
-1
Created On: 21/11/2014 Purpose: To get count of listen for a particaular country ++
def get_listen_count(device_access_id,listen_medias) listen_medias.where(:device_access_id => device_access_id).count rescue nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_population_of_uk(collection_of_countries)\n total_population = 0\n for country in collection_of_countries\n total_population += country[:population]\n end\n return total_population\nend", "def count_population(country)\n population = 0\n for country in country\n population += country[:popul...
[ "0.6421422", "0.629735", "0.6288689", "0.6136678", "0.60464084", "0.59708214", "0.59680533", "0.59680533", "0.5947769", "0.58873403", "0.5849091", "0.5822298", "0.5814649", "0.5788905", "0.57696223", "0.57113224", "0.5710575", "0.56750715", "0.5668011", "0.5668011", "0.566801...
0.0
-1
Created On: 20/12/2014 Purpose: To get song by id ++
def find_media_by_id(message_id) UploadedMedium.find(message_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def songs\n Song.find_by_album(@id)\n end", "def current_song\n Song.find(params[:id])\n end", "def set_song\n @song = Song.find(params[:id])\n end", "def set_song\n @song = Song.find(params[:id])\n end", "def set_song\n @song = Song.find(params[:id])\n end", "def get_artist(id)\n @...
[ "0.73457235", "0.6991399", "0.6824254", "0.6824254", "0.6824254", "0.678731", "0.6772796", "0.67342347", "0.6730125", "0.6723889", "0.67143404", "0.66962284", "0.66962284", "0.66962284", "0.66962284", "0.66962284", "0.66962284", "0.66962284", "0.66962284", "0.66962284", "0.66...
0.0
-1
Created On: 05/01/2014 Purpose: To get listen media count country vice ++
def play_count_country_vice(country_lists,device_accesses,listen_medias,sorted_array = []) @device_accesses = device_accesses @listen_medias = listen_medias country_lists.each do |country_name| id_lists = @device_accesses.where(:access_country => country_name).map(&:id) add_count=[] id_lis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_media\n general_data['nb_media']\n end", "def media_object_count\n @media_object_count ||= MediaObject.where(\"collection_ssim\" => name).count\n end", "def get_listen_count(device_access_id,listen_medias)\n listen_medias.where(:device_access_id => device_access_id).count rescue nil\n ...
[ "0.6876442", "0.63025284", "0.628603", "0.6176559", "0.61061996", "0.6085936", "0.6083711", "0.6083323", "0.6051409", "0.6039257", "0.5981409", "0.5979366", "0.59754515", "0.5953041", "0.59466374", "0.5913393", "0.59101397", "0.58907956", "0.5866429", "0.5863772", "0.58630204...
0.6455097
1
Created On: 05/01/2014 Purpose: To get state from city ++
def get_city_state(city) DeviceAccess.where(access_city: city).last.access_state rescue nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state(city)\n city = append_country(city)\n request = Request.new(:query => city, :output => \"json\")\n response = JSON.parse(request.execute!)\n if response[\"Status\"][\"code\"] == 200\n response[\"Placemark\"][0][\"AddressDetails\"][\"Country\"][\"AdministrativeArea\"][\"Administ...
[ "0.78866184", "0.7468075", "0.7364859", "0.7095594", "0.70820695", "0.69557536", "0.69557536", "0.694709", "0.69435513", "0.6941228", "0.6898114", "0.6890261", "0.6890261", "0.6845333", "0.6845333", "0.68107957", "0.68089175", "0.68089175", "0.6795827", "0.67792064", "0.67670...
0.75993824
1
Performs a GET request to _uri_ using _request_headers_, and yields the response as the status code, headers and body.
def get(uri, request_headers) raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(uri, request_headers)\n request('get', uri, request_headers) do |response_status_code, response_headers, response_body|\n yield response_status_code, response_headers, response_body\n end\n end", "def get(uri, request_headers)\n request('get', uri, request_headers)\n ...
[ "0.8128832", "0.7283325", "0.7272881", "0.7233882", "0.6944454", "0.68937844", "0.67199636", "0.67113477", "0.66166735", "0.6604979", "0.6603799", "0.6600014", "0.65047157", "0.65047157", "0.6456498", "0.6437246", "0.6387827", "0.63743985", "0.63442594", "0.6340831", "0.63261...
0.67944586
6
Performs a DELETE request to _uri_ using _request_headers_, and yields the response as the status code, headers and body.
def delete(uri, request_headers) raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(uri, request_headers)\n request('delete', uri, request_headers) do |response_status_code, response_headers, response_body|\n yield response_status_code, response_headers, response_body\n end\n end", "def delete(uri, request_headers)\n request('delete', uri, request_h...
[ "0.84675074", "0.75101465", "0.72348315", "0.72215664", "0.71293646", "0.70354813", "0.70114565", "0.69902164", "0.69068295", "0.6894834", "0.68893176", "0.68887526", "0.6877825", "0.6868859", "0.67808986", "0.6766005", "0.67232084", "0.67232084", "0.67203397", "0.67067575", ...
0.7330648
2
Performs a POST request to _uri_ using _request_headers_ and _body_, and yields the response as the status code, headers and body.
def post(uri, request_headers, body) raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def post(uri, request_headers, body)\n request('post', uri, request_headers, body) do |response_status_code, response_headers, response_body|\n yield response_status_code, response_headers, response_body\n end\n end", "def post(uri, request_headers, body)\n request('post', uri,...
[ "0.80565345", "0.7182403", "0.7010327", "0.6918774", "0.67139757", "0.66820157", "0.6675218", "0.65462756", "0.65375584", "0.64841384", "0.6434788", "0.6405759", "0.6327829", "0.6323234", "0.62895983", "0.6263509", "0.6226", "0.620429", "0.6193551", "0.6170154", "0.6164982", ...
0.6462328
10
Performs a PUT request to _uri_ using _request_headers_ and _body_, and yields the response as the status code, headers and body.
def put(uri, request_headers, body) raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def put(uri, request_headers, body)\n request('put', uri, request_headers, body) do |response_status_code, response_headers, response_body|\n yield response_status_code, response_headers, response_body\n end\n end", "def put(uri, request_headers, body)\n request('put', uri, req...
[ "0.8164694", "0.7322047", "0.7021131", "0.6972987", "0.6937349", "0.6726393", "0.6649403", "0.66086787", "0.65919816", "0.65412843", "0.6510794", "0.6457573", "0.6450972", "0.6409057", "0.6383077", "0.6381225", "0.6372494", "0.632024", "0.6271922", "0.6230719", "0.619325", ...
0.7125491
2
GET /username_cookies/1 GET /username_cookies/1.json
def show @username_cookie = UsernameCookie.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @username_cookie } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_cookies\n if cookies.signed[:name].present? && cookies.signed[:email].present?\n render json: { allow: true, name: cookies.signed[:name], email: cookies.signed[:email] }\n else\n render json: { allow: false }\n end\n end", "def new\n @username_cookie = UsernameCookie.new\n\n res...
[ "0.666682", "0.661203", "0.65926945", "0.6536844", "0.64701635", "0.64571476", "0.64571476", "0.64571476", "0.64571476", "0.64571476", "0.64571476", "0.64571476", "0.63908243", "0.6372121", "0.63702923", "0.6334846", "0.6296664", "0.6284103", "0.62789625", "0.6268361", "0.622...
0.71412313
0
GET /username_cookies/new GET /username_cookies/new.json
def new @username_cookie = UsernameCookie.new respond_to do |format| format.html # new.html.erb format.json { render json: @username_cookie } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @username_cookie = UsernameCookie.new(params[:username_cookie])\n\n respond_to do |format|\n if @username_cookie.save\n format.html { redirect_to @username_cookie, notice: 'Username cookie was successfully created.' }\n format.json { render json: @username_cookie, status: :cre...
[ "0.7236221", "0.7074697", "0.6533255", "0.6389992", "0.63502216", "0.6290688", "0.62468415", "0.62126946", "0.60776377", "0.605743", "0.60219675", "0.6008606", "0.6006027", "0.5994231", "0.597861", "0.5970128", "0.59373", "0.5927919", "0.59244573", "0.5918984", "0.5918651", ...
0.7941485
0
POST /username_cookies POST /username_cookies.json
def create @username_cookie = UsernameCookie.new(params[:username_cookie]) respond_to do |format| if @username_cookie.save format.html { redirect_to @username_cookie, notice: 'Username cookie was successfully created.' } format.json { render json: @username_cookie, status: :created, locat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_cookies(username, password)\r\n\t\tcookies.signed[:username] = { \r\n\t \t\tvalue: username,\r\n\t \t\texpires: 1.weeks.from_now }\r\n\t \tcookies.signed[:pwd] = {\r\n\t \t\tvalue: password,\r\n\t \t\texpires: 1.weeks.from_now }\r\n\tend", "def create\n \tcookies.signed[:username] = params[:session][...
[ "0.70282894", "0.6747255", "0.6416628", "0.63507915", "0.6194151", "0.614814", "0.6139925", "0.6095302", "0.6072791", "0.6068868", "0.60643744", "0.6019987", "0.5963435", "0.5963435", "0.5963435", "0.5963435", "0.5963435", "0.5963435", "0.5963435", "0.5956143", "0.59257454", ...
0.7165247
0
PUT /username_cookies/1 PUT /username_cookies/1.json
def update @username_cookie = UsernameCookie.find(params[:id]) respond_to do |format| if @username_cookie.update_attributes(params[:username_cookie]) format.html { redirect_to @username_cookie, notice: 'Username cookie was successfully updated.' } format.json { head :no_content } el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @username_cookie = UsernameCookie.new(params[:username_cookie])\n\n respond_to do |format|\n if @username_cookie.save\n format.html { redirect_to @username_cookie, notice: 'Username cookie was successfully created.' }\n format.json { render json: @username_cookie, status: :cre...
[ "0.62237877", "0.59685695", "0.58763754", "0.5856852", "0.58295923", "0.58131045", "0.57982934", "0.57786036", "0.57616216", "0.5760699", "0.57233286", "0.5719673", "0.57148725", "0.5692965", "0.5687843", "0.5682418", "0.5679484", "0.5643379", "0.5640627", "0.56324404", "0.56...
0.6980895
0
DELETE /username_cookies/1 DELETE /username_cookies/1.json
def destroy @username_cookie = UsernameCookie.find(params[:id]) @username_cookie.destroy respond_to do |format| format.html { redirect_to username_cookies_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_cookie name, path\r\n command 'deleteCookie', name, path\r\n end", "def delete_cookie name\n @response.delete_cookie name\n end", "def delete_cookie(name); end", "def delete_cookie(cookies)\n cookies.delete('token')\n @user.update(token: '')\n end",...
[ "0.7660538", "0.74207956", "0.73470616", "0.70989513", "0.7055573", "0.6955128", "0.6723728", "0.66885024", "0.6678918", "0.6662511", "0.6649223", "0.66455483", "0.66165936", "0.6593298", "0.6543894", "0.64898294", "0.6472694", "0.6472694", "0.6472011", "0.6471079", "0.646460...
0.76348335
1
Used when the relay's internal integrity is in doubt
def severe_error(note ="", excpt) if @controller and @controller.class < ApplicationController @controller.expires_now @controller.head :internal_server_error, x_error_details: 'Something is wrong with this relay. Try again later.' end _log_exception ERROR,note,excpt end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def transact; end", "def transient?; end", "def secure_subresource_integrity_context?; end", "def secure_subresource_integrity_context?; end", "def private; end", "def awaken!\n\t\traise 'Not implemented'\n\tend", "def internal?; end", "def within_transaction; end", "def within_transaction; end", ...
[ "0.5725947", "0.56816244", "0.5655014", "0.5654379", "0.55838937", "0.5581538", "0.5505918", "0.5470222", "0.5470222", "0.54588896", "0.54393655", "0.5422585", "0.53821224", "0.53698504", "0.53698504", "0.5353097", "0.5353097", "0.5349499", "0.5347944", "0.53330284", "0.53330...
0.0
-1
This is used to log general nonZAX exceptions
def report(note, excpt) # handle non-ZAX errors, such as encoding, etc. @controller.expires_now @controller.head @response_code, x_error_details: 'Your request can not be completed.' _log_exception WARN,note,excpt end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_error(exception); end", "def log_exception(excp, meth = nil)\n error = warning = nil\n case excp\n when Shrine::FileNotFound then warning = 'FILE_NOT_FOUND'\n when Shrine::InvalidFile then warning = 'INVALID_FILE'\n when Shrine::AttachmentChanged then warning = 'ATTACHMENT...
[ "0.6862617", "0.64270955", "0.63653624", "0.6356976", "0.6216813", "0.61696357", "0.61442095", "0.61240125", "0.60818774", "0.60569966", "0.60310954", "0.6013101", "0.5984913", "0.5930575", "0.5920844", "0.59019554", "0.5900062", "0.58938634", "0.58938634", "0.58938634", "0.5...
0.0
-1
This is used to log RbNaCl errors
def NaCl_error(e) e1 = e.is_a?(RbNaCl::BadAuthenticatorError) ? 'The authenticator was forged or otherwise corrupt' : '' e2 = e.is_a?(RbNaCl::BadSignatureError) ? 'The signature was forged or otherwise corrupt' : '' error "#{ERROR} Decryption error for packet:\n"\ "#{e1}#{e2} "\ "#{@co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def error_log\n end", "def error_log\n end", "def error_log\n end", "def log_error(exception); end", "def log_error(error)\n ::NewRelic::Agent.logger.error(\"Error establishing connection with New Relic Service at #{control.server}:\",\n error)\n end", "def...
[ "0.6994573", "0.6994573", "0.6994573", "0.68446594", "0.6687502", "0.6538153", "0.6520196", "0.6485055", "0.6316911", "0.6283917", "0.6283917", "0.6283917", "0.6283917", "0.62757564", "0.6260574", "0.62498915", "0.6241743", "0.6168145", "0.61626107", "0.615455", "0.6125709", ...
0.66336143
5
=== Exception loging functions ===
def _log_exception(icon, note, excpt) warn "#{icon} #{note}:\n#{EXPT} \xE2\x94\x8C#{excpt} \xE2\x94\x90" warn excpt.backtrace[0..7].reduce("") { |s,x| s += "#{EXPT} \xE2\x94\x9C#{x}\n" } + "#{EXPT} \xE2\x94\x94#{BAR*25}\xE2\x94\x98" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_error(exception); end", "def exceptions; end", "def exception_handler; end", "def catch_exceptions; end", "def error_log\n end", "def error_log\n end", "def error_log\n end", "def log_exception(excp, meth = nil)\n error = warning = nil\n case excp\n when Shrine...
[ "0.83688235", "0.7384164", "0.7289811", "0.7277182", "0.72172743", "0.72172743", "0.72172743", "0.71197516", "0.7119515", "0.7119449", "0.7061525", "0.70557153", "0.70557153", "0.70557153", "0.70557153", "0.70557153", "0.69271815", "0.69201183", "0.68651503", "0.6862359", "0....
0.6842256
21
method gets data contractor
def get_contractor_data @hash_contractor = {} @hash_contractor[:name] = @driver.find_element(:css, '.oH1Huge').text @hash_contractor[:job] = @driver.find_element(:css, '.oH2High').text @hash_contractor[:description] = @driver.find_element(:css, 'p.notranslate[itemprop="description"]').tex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contract; end", "def contract; end", "def contract; Contract.get(self.contract_id); end", "def get_data()\t\n\tend", "def get_contract\n if self.complete? and not self.passed_out?\n bid = self.get_current_call(Bid)\n double = self.get_current_call(Double)\n redouble = self.get...
[ "0.6980366", "0.6980366", "0.6633981", "0.64182204", "0.63452804", "0.6218668", "0.61748636", "0.6157236", "0.6120974", "0.6112577", "0.6112577", "0.6112577", "0.6112577", "0.6112577", "0.6112577", "0.6112577", "0.6112577", "0.6112577", "0.6112577", "0.6112577", "0.6112577", ...
0.5559329
49
method compare contractor data hashes
def compare_contractor_data(contractor) message_good = "Each attribute value is equal to the corresponding attributes of a freelancer #{contractor[:name]} on a profile page:\n#{contractor}" message_bad = "Freelancer attribute values ​​not equal to the corresponding attributes in the shared page. Expected:\n#{co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_same_hashes\r\n\t\ts = \"Addr1<Addr2(100):Addr3<Addr4(500)\"\r\n\t\ttb = Block.new(0,0,s,0.0,\"90a2\")\r\n\t\ttb.set_calculated_hash(\"90a2\")\r\n\t\t\r\n\t\tassert_equal(1, tb.compare_current_hash)\r\n\tend", "def test_different_hashes\r\n\t\ts = \"Addr1<Addr2(100):Addr3<Addr4(500)\"\r\n\t\ttb = Block....
[ "0.6754163", "0.666868", "0.65692586", "0.65692586", "0.65692586", "0.65692586", "0.65692586", "0.65692586", "0.65692586", "0.63513196", "0.63345236", "0.6251595", "0.6182625", "0.61696875", "0.61654735", "0.6145629", "0.6126361", "0.6124191", "0.6124191", "0.6124191", "0.612...
0.6989397
0
method checks contractor data by keyword
def check_contractor_by_keyword(keyword) match = @hash_contractor.find do |pair| pair.last.downcase.include? keyword.downcase end (match == nil) ? (puts "#{@hash_contractor[:name]} dont have a #{keyword}") : (puts "The #{keyword} was include in #{match}, #{@hash_contractor[:name]}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_keyword(candidate, keyword)\n puts \"\\n#{candidate[:name]}\\nAttributes containing '#{keyword}': \"\n candidate.each { |k, v| puts k if v.to_s.include?(keyword) }\n puts \"Attributes not containing '#{keyword}':\"\n candidate.each { |k, v| puts k unless v.to_s.include?(keyword)}\n end", ...
[ "0.5875342", "0.5729285", "0.5527747", "0.5392854", "0.53882164", "0.53882164", "0.53565216", "0.53565216", "0.53465486", "0.5319063", "0.5317044", "0.5288998", "0.52725273", "0.52521265", "0.5246642", "0.52169985", "0.52038676", "0.5198129", "0.5151281", "0.5122915", "0.5121...
0.7204914
0
List the sales orders under this account
def index @sales_orders = @customer.sales_orders end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @sales_orders = SalesOrder.all\n end", "def sales\n @orders = Order.where(seller: current_user.id).order(\"created_at DESC\")\n end", "def list_orders\n Order.list(@current_user)\n end", "def orders\n params = { command: 'account_orders' }\n get('/json.php', params)\...
[ "0.752036", "0.718857", "0.71228445", "0.6865054", "0.6795823", "0.67306465", "0.66761994", "0.6625378", "0.66157407", "0.66115594", "0.66115594", "0.6540638", "0.6540638", "0.652416", "0.65212643", "0.65206635", "0.6518269", "0.6511002", "0.6503947", "0.6503932", "0.6443859"...
0.7583141
0
Contact people under current account.
def contacts @contact = @customer.contact_people.find_by_id params[:id] # Delete contact if @contact && params[:method] == "delete" @store_user.my_account_log(@contact,"Delete Contact #{@contact.name}") @contact.destroy @customer.update_ax( :contacts => [@contact] ) redi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def contactus\r\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", "def contact\n end", ...
[ "0.6687541", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6655019", "0.6622191", "0.6622191", "0.6593828", "0.6524484", "0.6339413", "0.6286772", "...
0.6122399
26
Contact profile Only "Email" of customer account(AX.Customer) is changeable.
def profile if request.post? @customer.update_attributes :email => params[:customer][:email], :phone => params[:customer][:phone] @store_user.my_account_log(@customer,"Update Profile Email: #{@customer.email} Phone: #{@customer.phone}") @customer.update_ax end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def personal_profile\n RubyRedtail::Query.run(\"contacts/#{@id}/personalprofile\", @api_hash, \"GET\")\n end", "def email; default_profile.try :email; end", "def update_profile_email\n user_profile.update_attribute(:email, email) if saved_change_to_email?\n end", "def customer_profile...
[ "0.6796298", "0.6526886", "0.6511111", "0.63874984", "0.6371345", "0.6347491", "0.62825084", "0.6266809", "0.604923", "0.6016393", "0.6011583", "0.6005552", "0.6003028", "0.5976328", "0.5940195", "0.5912079", "0.59075475", "0.58509773", "0.58488977", "0.5844784", "0.5844245",...
0.71256965
0
Order History TODO: Find out the completed orders of current customer account.
def order_history @orders = @customer.close_orders end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recent_orders()\n\t\twith_auth nil do |options|\n\t\t\tself.class.get(\"/api/v1/orders\", options)\n \tend\n\tend", "def order_history(limit = 10)\n plain_orders = Fyb.private.getorderhistory(limit: limit).perform.parse\n error = plain_orders['error']\n\n fail Exception, error unless error ...
[ "0.67846155", "0.66428006", "0.6506397", "0.6493447", "0.64623666", "0.63281834", "0.63238096", "0.62117016", "0.61890954", "0.6144186", "0.61402255", "0.61331505", "0.60950536", "0.6086065", "0.60834295", "0.60790026", "0.60756993", "0.60676146", "0.6056458", "0.6043835", "0...
0.78379375
0
Open Orders TODO: Find out the processing orders of current customer account.
def open_orders # store_user = StoreUser.find_by_erp_account_number "CU 0101388" # store_user.order_users.find(:first).orders.find(:first) # ERP::ThreadPool.new(@options[:threads], time_blocks).start do |pair| # sleep(1 * rand) # result = search_by_modified_date( pair.first, pair.last ) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_orders\n orders.open\n end", "def open_orders(options)\n request :account, :get, 'openOrders', options\n end", "def open_orders\n OpenOrderParser.parse_collection(post(\"open_orders\"))\n end", "def open_orders\n OpenOrderParser.parse_collection(post(\"mo...
[ "0.80987334", "0.77585447", "0.7751193", "0.7675796", "0.73043394", "0.67345554", "0.65871435", "0.64006597", "0.6287636", "0.6246477", "0.6228287", "0.62208235", "0.61404765", "0.6113854", "0.6083525", "0.6080662", "0.60653496", "0.6055265", "0.60369486", "0.59895504", "0.59...
0.65643936
7
Delete sales line of an open order via given id
def delete_sales_line sales_line = ERP::SalesLine.find( params[:id], :include => "sales_order" ) @store_user.my_account_log(sales_line,"Delete Sales Line: #{sales_line.invent_trans_id} (#{sales_line.item_id})") if @customer.open_orders.collect{|order| order.id}.include?( sales_line.sales_order.id ) && sa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_sales_invoice!(id)\n delete(\"sales_invoices/#{id}\")\n end", "def delete\n LineItem.delete_for_order(order_id)\n CreditCardTransaction.remove_references_to_order(order_id)\n super\n end", "def delete_sales_entry_from_sales_order\n @sales_order = SalesOrder.find_by_id params...
[ "0.7191335", "0.7036305", "0.70347667", "0.70268524", "0.7011492", "0.6572518", "0.6530496", "0.6511341", "0.6409515", "0.6324507", "0.632261", "0.625593", "0.62545407", "0.6243178", "0.6235454", "0.62074715", "0.6194714", "0.61884665", "0.6162448", "0.615727", "0.6145458", ...
0.8255487
0
Update product quantity of sales line with given id
def update_sales_line_qty sales_line = ERP::SalesLine.find params[:id] result = sales_line.update_sales_qty( params[:value].to_i ) @store_user.my_account_log(sales_line,"Update Sales Line Qty: #{sales_line.invent_trans_id} (#{sales_line.item_id}), returns #{result}") render :text => result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_product_qty\n @order = Spree::Order.find_by_id(params[:order_id])\n @line_item = Spree::LineItem.find_by_id(params[:line_item_id])\n request_to_update_qty = params[:quantity].to_i\n # code to find the order_total\n if @order.market_place.present?\n case @order.mark...
[ "0.7286502", "0.72142226", "0.7144943", "0.7038057", "0.6993245", "0.697177", "0.6956866", "0.69196177", "0.68746245", "0.68467855", "0.6830455", "0.68247193", "0.68189305", "0.6801956", "0.6786757", "0.6782704", "0.6778026", "0.67523664", "0.6694163", "0.6694044", "0.6693155...
0.77470005
0
Move sales line with given id to another open order
def move_sales_line =begin sales_line = ERP::SalesLine.find params[:id] @original_order_id = sales_line.erp_sales_order_id sales_line.update_attribute :erp_sales_order_id, params[:target] mark_as_unsync [@original_order_id, params[:target]] =end @sales_line = ERP::SalesLine.find params[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_sales_line( sales_line_id, target_order_id )\r\n sales_line = self.sales_lines.find sales_line_id\r\n target_order = self.customer.sales_orders.find target_order_id\r\n\r\n moving_qty = sales_line.remain_sales_physical\r\n if moving_qty.zero?\r\n self.errors.add :sales_lines, \"This sales...
[ "0.7951165", "0.6301795", "0.62164396", "0.62020606", "0.6030135", "0.6030135", "0.60238665", "0.60203403", "0.5993305", "0.5978917", "0.5947596", "0.5893678", "0.5888943", "0.5830033", "0.5809828", "0.57957757", "0.5781215", "0.5753478", "0.5739659", "0.5739659", "0.5689915"...
0.75429773
1
Commit changes of sales order with given id to AX server.
def commit_order order = @customer.open_orders.find params[:id] unless !order.commit headers['Content-Type'] = 'text/plain' render :text => "Failed to connect with AX server." end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commit_orders\r\n orders = @customer.open_orders.find_all_by_synchronized( false )\r\n sales_id = \"\"\r\n orders.each do |o| sales_id += \"'#{o.sales_id}', \" end \r\n @store_user.my_account_log(@customer,\"Commit Sales Order Updates: #{sales_id}\")\r\n\r\n if orders.empty? || ERP::SalesOrde...
[ "0.706133", "0.61689913", "0.58067054", "0.58067054", "0.5658508", "0.55772775", "0.5566188", "0.5561589", "0.5535155", "0.5535155", "0.5525487", "0.55223143", "0.54974896", "0.54317796", "0.53934306", "0.5352393", "0.5285899", "0.52817357", "0.52787346", "0.52727956", "0.526...
0.7198284
0
Commit all changed orders under customer's account
def commit_orders orders = @customer.open_orders.find_all_by_synchronized( false ) sales_id = "" orders.each do |o| sales_id += "'#{o.sales_id}', " end @store_user.my_account_log(@customer,"Commit Sales Order Updates: #{sales_id}") if orders.empty? || ERP::SalesOrder.commit_orders( orders...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def commit\r\n self.class.commit_orders [self]\r\n end", "def submit_order!\n @customer_order.transaction do\n cache_addresses!\n mark_deliveries_as_pending!\n cache_billing_address! unless @customer_order.anon_billing_address?\n update_subtotal_items!\n as...
[ "0.6986604", "0.6477692", "0.6333579", "0.6221034", "0.6045331", "0.603372", "0.59519094", "0.5916829", "0.5779564", "0.5764588", "0.57638794", "0.5753903", "0.5660284", "0.56332177", "0.56252193", "0.5624888", "0.561535", "0.558923", "0.558393", "0.5488663", "0.54863745", ...
0.8004923
0
Return address's JSON for filling address form in "MyAccount / OpenOrders" (while editing a billing / shipping address)
def get_address_json address = @customer.addresses.find( params[:id] ) render :text => address.attributes.to_json end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_address(options)\n address = options[:billing_address]\n\n post = {}\n post['Address 1'] = address[:address1] unless empty?(address[:address1])\n post['Address 2'] = address[:address2] unless empty?(address[:address2])\n post['City'] = address[:city] unless empty?(address...
[ "0.7202232", "0.71755147", "0.7173584", "0.7112513", "0.7093242", "0.6926755", "0.6901112", "0.68754226", "0.6872379", "0.68548584", "0.68484205", "0.6846325", "0.67974365", "0.67877334", "0.6725801", "0.6724113", "0.66894776", "0.6676635", "0.6675103", "0.6662099", "0.661562...
0.75897086
0
Update delivery mode id of sales order with given id
def update_delivery_mode sales_order = @customer.open_orders.find_by_id( params[:id] ) sales_order.delivery_mode_id = params[:delivery_mode_id] render :text => sales_order.save end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_delivery_order\n @delivery_order = DeliveryOrder.find(params[:id])\n end", "def set_order\n @order = Order.find(params[:id])\n @delivery = Delivery.find(@order.delivery_id)\n end", "def update\n @sales_order = SalesOrder.find(params[:id])\n\n # update delivery_status(includes...
[ "0.70056903", "0.664061", "0.6504144", "0.64623064", "0.63080394", "0.63080394", "0.63080394", "0.63080394", "0.63080394", "0.63080394", "0.63080394", "0.6276239", "0.62408423", "0.6236928", "0.6202967", "0.6189267", "0.61659944", "0.61258143", "0.6118086", "0.6083522", "0.60...
0.8249441
0
Initialize ERPCustomer and ERPContactPerson via logined user's email.
def init_user #logger.info session.inspect @store_user = session[:web_user] @store_user.request_path = request.path + "?" + request.query_string @customer = ERP::Customer.find_by_account_num @store_user.erp_account_number if @customer.nil? render :partial => "unaccessible", :layout...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def after_initialize\n if self.new_record?\n self.author_email_address = 'test@test.com'\n end\n end", "def initialize_email\n require File.expand_path('../../appenders/email', __FILE__)\n end", "def after_initialize\n if new_record?\n self.email ||= \"jakub.hozak@gmail....
[ "0.6232575", "0.61504364", "0.61116004", "0.5989782", "0.59440607", "0.58635557", "0.56136346", "0.5609897", "0.55926967", "0.55457896", "0.55336964", "0.55041265", "0.5500439", "0.54990166", "0.549587", "0.54816705", "0.5475785", "0.54365516", "0.54329795", "0.54312396", "0....
0.642711
0
Get specified contact person using given name.
def get_contact @contact = @customer.contact_people.find_by_name params[:id] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_contact(name)\n contacts = {\n \"Mike Dane\" => \"(02) 9876 0402\",\n \"Tom Sanchez\" => \"(02) 9872 6432\",\n \"Karen Posner\" => \"(02) 9476 5488\",\n \"Ryan Terry\" => \"(08) 7776 5532\",\n \"Chris Freeman\" => \"(05) 9666 8412\"\n }\n\n for contact in contact...
[ "0.7287245", "0.70697236", "0.6979043", "0.68891877", "0.6626884", "0.66163087", "0.66163087", "0.64621943", "0.64332324", "0.6355308", "0.6355308", "0.6336558", "0.63358283", "0.62979287", "0.62979287", "0.62979287", "0.62979287", "0.62979287", "0.6218429", "0.61829454", "0....
0.74601007
0
Access only for AJAX request.
def access_only_for_ajax unless request.xhr? render :text => "Here is an Ajax Service, regular request without security token are denied." return false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def xhr?; end", "def xhr_script; end", "def non_xhr_javascript_response?; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def requ...
[ "0.7402831", "0.69913656", "0.68071014", "0.66760033", "0.66760033", "0.66760033", "0.66760033", "0.66760033", "0.66760033", "0.66760033", "0.66760033", "0.66760033", "0.66760033", "0.66760033", "0.6653148", "0.6467593", "0.6456133", "0.6437094", "0.64356965", "0.629644", "0....
0.6583006
15
Mark the sales order(s) with given id(s) as unsynchronized. This method MUST be called after updating anything about these orders ( ERPAddresses, SalesLines, etc. ).
def mark_as_unsync(order_ids) order_ids = [order_ids] unless order_ids.is_a?(Array) @customer.sales_orders.update_all "synchronized = false", ["id in (?)", order_ids] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_ids\n self.task_id = @task_number\n self.order_id = @order_number\n end", "def move_sales_line\r\n=begin\r\n sales_line = ERP::SalesLine.find params[:id]\r\n @original_order_id = sales_line.erp_sales_order_id\r\n sales_line.update_attribute :erp_sales_order_id, params[:target]\r\n \...
[ "0.5774726", "0.56881034", "0.5487312", "0.5487312", "0.547677", "0.5456823", "0.5411922", "0.5388102", "0.5331965", "0.52381945", "0.51438457", "0.51162374", "0.5106291", "0.5096775", "0.5087578", "0.5081171", "0.5075133", "0.5058175", "0.5012792", "0.5012114", "0.49914965",...
0.74006194
0
After signed in My Account, start a backend process to synchronize customer's account including orders. Note: Unsaved changes from last login are discarded.
def synchronize_customer_account return false unless session[:web_user] && request.post? unless (cust_id = session[:web_user].erp_account_number).blank? customer = ERP::Customer.find_by_account_num(cust_id) || ERP::Customer.new(:account_num => cust_id) customer.synchronize(true) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run\n handle_service do\n @order.save!\n # create an activity register\n ::Activity.new_activity(@user, :created, @order, nil)\n ::JobActivation.perform_later(@order, @user)\n end\n\n @order\n end", "def submit_order!\n @customer_order.transaction do\n ...
[ "0.595816", "0.5875038", "0.58296734", "0.5761117", "0.5729202", "0.5722417", "0.5673489", "0.5649308", "0.56413364", "0.5612919", "0.5594063", "0.5539273", "0.5491705", "0.54705316", "0.5467064", "0.54059744", "0.53117275", "0.52932996", "0.52900213", "0.5281833", "0.5268900...
0.6340605
0
Obtener los gastos del pedido
def order_expenses total_expenses_per_subsection = {} total_expenses_per_subsection.default = 0.0 details = self.order_details details.each do |detail| total_expenses_per_subsection[detail.subsection] += detail.last_value.amount end total_expenses_per_subsection end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def seleccionarCromosomas()\n #p \"--- Empieza el torneo:\"\n seleccion = []\n @tamMatingPool.times do\n competidor1 = @poblacion[Random.rand(@tamPoblacion)]\n competidor2 = @poblacion[Random.rand(@tamPoblacion)]\n evaluarCromosoma(competidor1)\n eva...
[ "0.6171888", "0.6007692", "0.5996773", "0.59466803", "0.59261495", "0.5922203", "0.58206743", "0.57493687", "0.57386327", "0.563453", "0.55999255", "0.55995333", "0.55964905", "0.5578748", "0.55403274", "0.55248624", "0.5522956", "0.5521221", "0.5499267", "0.54951817", "0.549...
0.0
-1
Public: Returns the MIME type for the file. Examples ImageFile.new('example.png') => 'image/png' ImageFile.new('example.svg') => 'image/svg+xml' Returns a String representation of the MIME type.
def filetype `file --mime-type -b #{@file_path}`.chomp end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def mimetype\n mtype = MIME::Types.of(@filename).first\n if (mtype)\n mimetype = MIME::Type.simplified(mtype)\n end\n mimetype\n end", "def mime_type\n MIME_TYPES[@file_type]\n end", "def mime_type\n ::Mime::Type.lookup(image.mime_type)\n end", "def mime_type\n ...
[ "0.7961362", "0.7944223", "0.7868649", "0.77883315", "0.7780258", "0.7764791", "0.7764791", "0.7764791", "0.7695291", "0.7667072", "0.7619885", "0.7605528", "0.75919974", "0.7589919", "0.7582616", "0.75706893", "0.75662553", "0.75644946", "0.75519556", "0.75504404", "0.754675...
0.78429806
3
Public: Formats a datauri based HTML IMG tag for the file. Returns the entire IMG tag as a String.
def as_img_tag() "<img src='#{self.encode}' />" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def data_uri(image)\n mime_type = image.svg? ? 'image/svg+xml' : image.mime_type\n \"'data:#{mime_type};base64,#{Base64.encode64(image.blob).gsub(/\\r?\\n/, '')}'\"\n end", "def to_data_uri\n \"url(data:image/svg+xml;base64,#{to_base64});\"\n end", "def data_uri\n data = Base64.encode...
[ "0.655535", "0.6232312", "0.6125246", "0.6061649", "0.59991056", "0.5890778", "0.58529246", "0.58281356", "0.5805518", "0.5791674", "0.57703424", "0.5752037", "0.5677066", "0.5651576", "0.56212115", "0.5584148", "0.55580264", "0.55569035", "0.55525017", "0.5548703", "0.554722...
0.6632851
0
Public: Formats a CSS background image rule for the file, and wraps it in a class definition. klass The name of the class to use for the CSS rule. Optional. If ommitted, the default will the basename of the file path. Returns the class wrapped CSS background rule as a String.
def as_css_background_with_class(klass=nil) klass=File.basename(@file_path).tr('.','_') unless klass ".#{klass} {\n #{self.as_css_background}\n}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_css_background()\n \"background: url(#{self.encode}) no-repeat;\"\n end", "def class_file klass_name\n name = klass_name.split('::').last\n File.join class_path(klass_name), \"cdesc-#{name}.ri\"\n end", "def file_linker(klass = nil)\n klass ? @file_linker = klass : get_inherited_at...
[ "0.51849985", "0.50258887", "0.49501657", "0.4906297", "0.48422053", "0.47846317", "0.47634044", "0.47355697", "0.4717101", "0.47041813", "0.46950427", "0.46693936", "0.46611258", "0.46506253", "0.46431187", "0.46363416", "0.45550895", "0.4537252", "0.45228663", "0.45189008", ...
0.82585263
0
Public: Formats a CSS background image rule for the file. Returns the CSS background rule as a String.
def as_css_background() "background: url(#{self.encode}) no-repeat;" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def custom_background\n css = \"\"\n css += \"background-color: #{self.background_color};\" unless self.background_color.blank?\n if self.background_image_file_name.blank?\n css += \"background-image: none; \"\n else\n css += \"background-image: url('#{self.background_image.url(\"original\", ...
[ "0.6116016", "0.6110001", "0.5880279", "0.56555027", "0.55505973", "0.54491764", "0.51739293", "0.505619", "0.48845205", "0.48193994", "0.4815815", "0.48022708", "0.47672442", "0.4752824", "0.47404608", "0.4730031", "0.47261375", "0.47046033", "0.4703655", "0.4641412", "0.463...
0.66690105
0
Public: Encodes file into a CSS string representation. Returns the Base64 encoded String with filetype information embedded.
def encode() "data:#{self.filetype};base64," + self.raw_encode end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base64_encode\n Base64.encode64(file_contents)\n end", "def encode_attachment(file_path:, file_type: nil)\n # try to find file_type\n if file_type.nil?\n content_types = MIME::Types.type_for(file_path)\n file_type = content_types.first.content_type if content_types.any?\n end...
[ "0.62018394", "0.60733205", "0.6025695", "0.5805515", "0.55570173", "0.53412", "0.53347754", "0.52877456", "0.5252136", "0.52432954", "0.5236314", "0.52030176", "0.5185328", "0.51304704", "0.51236224", "0.5106166", "0.5062003", "0.5047567", "0.5035784", "0.502976", "0.5002851...
0.6224828
0
Public: file into its raw Base64 string representation. Returns the Base64 encoded String.
def raw_encode() return Base64.encode64(File.read @file_path).delete("\n") if RUBY_VERSION < "1.9.0" Base64.strict_encode64(File.read @file_path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def base64\n binary = open { |io| io.read }\n result = Base64.strict_encode64(binary)\n binary.clear # deallocate string\n result\n end", "def base64\n binary = open { |io| io.read }\n result = Base64.encode64(binary).chomp\n binary.clear # de...
[ "0.8243077", "0.8152603", "0.8091158", "0.77152807", "0.75076354", "0.73864985", "0.7129103", "0.70412093", "0.6953615", "0.6900227", "0.67988527", "0.6794249", "0.67909104", "0.6775498", "0.67481357", "0.67096156", "0.66520727", "0.6636371", "0.66254175", "0.6582562", "0.658...
0.83455765
0
Protected: is the file of an image format we support? Returns a Boolean representing image format validity.
def valid_image_format? VALID_FILE_MIMETYPES.include? self.filetype end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def valid?\n image_resource? && supported_format?\n end", "def valid_file?\n if @image.size.zero?\n errors.add_to_base(\"Please enter an image filename\")\n return false\n end\n unless @image.content_type =~ /^image/\n errors.add(:image, \"is not a recognized format\")\n return f...
[ "0.833717", "0.80348176", "0.7844336", "0.77031714", "0.76832324", "0.76832324", "0.767027", "0.75332147", "0.75325483", "0.75274813", "0.73949313", "0.73759717", "0.7371084", "0.73615336", "0.7313972", "0.7296801", "0.7254463", "0.7242669", "0.7222223", "0.72180223", "0.7197...
0.876727
0
Add an element to the back of the queue.
def enqueue(value) @count += 1 new_element = RubyDS::StackQueue::Element.new(value) # If this is the first element, just assign the head and tail. if @head.nil? @head = new_element @tail = @head # Add the element as a new tail. else @tail.next = new_element @tail = @tai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enqueue(element)\n # check if queue is full \n raise ArgumentError, \"Queue is full\" if (@back + 1) % MAX_BUFFER == @front \n # check if queue is empty\n # empty queue\n if @front < 0\n @front = @back = 0\n # overflow to wrap around\n elsif @back == MAX_BUFFER - 1 # raise block will ...
[ "0.7357119", "0.73463136", "0.7239424", "0.7110687", "0.7106543", "0.70823455", "0.7080123", "0.70234406", "0.7020333", "0.70193166", "0.70031816", "0.6946783", "0.6945872", "0.69430137", "0.6936727", "0.6934237", "0.69150364", "0.69095725", "0.69043934", "0.69043934", "0.687...
0.643976
75
Remove the element from the head of the queue and return its value.
def dequeue return nil if @head.nil? # Remove the head element and return the value. @count -= 1 old_node = @head @head = @head.next old_node.next = nil # We can also nullify the tail if the head is nil now. @tail = nil if @head.nil? old_node.value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pop()\n head = @head\n if head == nil then\n return nil\n end\n @head = head.prev\n return head.val\n end", "def pop\n if @queue.empty?\n nil\n else\n tempArr = []\n while @queue.size > 1\n tempArr.push(@queue.remove)\n ...
[ "0.79602504", "0.7703563", "0.7699247", "0.76744", "0.76257205", "0.7612351", "0.7593301", "0.75242454", "0.7507495", "0.75018173", "0.7497829", "0.74805325", "0.74422175", "0.74391955", "0.7430774", "0.74054086", "0.7385139", "0.7366222", "0.7355573", "0.73520684", "0.732048...
0.765044
4
Clear out the entire queue.
def clear @count = 0 @head = nil @tail = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear\n queue.clear\n end", "def clear\n @queue.clear\n end", "def clear\n synchronize do\n @queue.clear\n end\n end", "def clear\n synchronize do\n @queue.clear\n end\n end", "def clear\n synchronize do\n ...
[ "0.8883973", "0.8872733", "0.8667855", "0.86299276", "0.86299276", "0.83086", "0.82932794", "0.81419545", "0.8133493", "0.81137276", "0.8069669", "0.8065869", "0.8046011", "0.8008904", "0.8008904", "0.78929603", "0.7851874", "0.78505355", "0.7633995", "0.75614", "0.7499195", ...
0.0
-1
Get the number of elements that is in the queue.
def count @count end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def queue_count()\n @queue.length\n end", "def count\n\t\t@queue.length\n\tend", "def queue_length\n @queues.inject(0) do |length, (_, queue)|\n length + queue.length\n end\n end", "def size\n\n @queue.size\n end", "def length\n @queue.length\n end", "def queue_count\n...
[ "0.8229203", "0.8112534", "0.8011257", "0.7988428", "0.7940356", "0.7922506", "0.7897648", "0.78780395", "0.7871413", "0.7833983", "0.78334796", "0.77582604", "0.7656527", "0.7626194", "0.76113117", "0.75368536", "0.7505257", "0.74618125", "0.74428725", "0.73599106", "0.73059...
0.0
-1
Check whether this queue has any elements or not.
def empty? @count == 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def any?\n !@queue.empty?\n end", "def any?\n !@queue.empty?\n end", "def any?\n !@queue.empty?\n end", "def empty?\n @queue.empty?\n end", "def is_empty()\n @queue.count { _1 } == 0\n end", "def is_empty()\n @queue.size == 0\n end", "...
[ "0.8267314", "0.82446474", "0.8237614", "0.80328417", "0.8021648", "0.8019214", "0.8012361", "0.80030036", "0.80030036", "0.80030036", "0.79614896", "0.78630674", "0.7855992", "0.78139675", "0.758185", "0.7548092", "0.75063014", "0.7502703", "0.74777806", "0.74256307", "0.736...
0.0
-1
Get the value from the front of the queue.
def peek @head ? @head.value : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_front()\n if @queue.size > 0\n return @queue[0]\n end\n -1\n end", "def front()\n self.is_empty ? -1 : @queue[@front]\n end", "def peek()\n @queue.first\n end", "def peek \n self.queue_var[-1]\n end", "def peek\n\t\t@queue.first\n\tend", "def peek; @queue[-1] end"...
[ "0.8424925", "0.80432934", "0.798497", "0.79037225", "0.78644633", "0.7761924", "0.75996387", "0.75815016", "0.7550961", "0.75461745", "0.7521103", "0.73299253", "0.72913563", "0.7272172", "0.72375524", "0.7235174", "0.72348344", "0.72030675", "0.7198472", "0.71963775", "0.71...
0.7386244
11
An access token will allow you to make requests for the system. We support only one type of token: client_credentials. You can try this API with configuring client parameters in Console Tab below. Test OAuthClientId is b30359c21700fd6f2b91154adcb7b37bab3e7e0a33e22682e5dd149d7a6ac4df and OAuthClientSecret is 4bc4335faad...
def create_authentication(accept, content_type, body) # Prepare query url. _path_url = '/oauth/token' _query_builder = Configuration.get_base_uri _query_builder << _path_url _query_url = APIHelper.clean_url _query_builder ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def oauth_app_access_token(client_id, client_secret)\n self.oauth_access_token(client_id, client_secret, :type => 'client_cred')\n end", "def get_client_token\n request = Typhoeus::Request.new(\n TOKEN_ENDPOINT,\n method: :post,\n body: {\n 'grant_type' => \"client_credentials\",\n ...
[ "0.8234712", "0.79407114", "0.7793352", "0.77001613", "0.76731515", "0.75661206", "0.75511414", "0.7549023", "0.75379056", "0.75216854", "0.7497651", "0.73689955", "0.73288167", "0.73119366", "0.72915244", "0.72915244", "0.72915244", "0.7288346", "0.72859627", "0.7274727", "0...
0.0
-1
Finds objects by PID
def find(pid) digital_object_record = ::DigitalObjectRecord.find_by(pid: pid) if digital_object_record.nil? raise Hyacinth::Exceptions::DigitalObjectNotFoundError, "Couldn't find DigitalObject with pid #{pid}" end # Retry after Fedora timeouts / unreachable host fobj = nil ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_by_pid(pid)\n find(pid)\n rescue Hyacinth::Exceptions::DigitalObjectNotFoundError\n return nil\n end", "def find_by_pid(pid)\n @proc_table = Array.new\n ProcFetch.get_process(:processid => pid).each do |proc_attrs|\n @proc_table.push(ProcInfo.new(proc_attrs))...
[ "0.6867694", "0.68519914", "0.64181954", "0.60357606", "0.597268", "0.5891712", "0.5781331", "0.56871605", "0.5666202", "0.56644475", "0.56605536", "0.56494606", "0.5618857", "0.5618857", "0.56036776", "0.5569835", "0.5562159", "0.5543509", "0.5523924", "0.5511818", "0.550758...
0.6058934
3
Like self.find(), but returns nil when a DigitalObject isn't found instead of raising an error
def find_by_pid(pid) find(pid) rescue Hyacinth::Exceptions::DigitalObjectNotFoundError return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find(pid)\n digital_object_record = ::DigitalObjectRecord.find_by(pid: pid)\n\n if digital_object_record.nil?\n raise Hyacinth::Exceptions::DigitalObjectNotFoundError, \"Couldn't find DigitalObject with pid #{pid}\"\n end\n\n # Retry after Fedora timeouts / unreachable host\n fo...
[ "0.74274224", "0.6814657", "0.6559267", "0.6468734", "0.6432075", "0.63332105", "0.62680995", "0.6197517", "0.6134887", "0.6084389", "0.6084262", "0.60618645", "0.60472596", "0.6045599", "0.6045599", "0.6028982", "0.60053873", "0.5977807", "0.5976942", "0.5947629", "0.5902561...
0.75704217
0
GET /resource/sign_up def new super end POST /resource
def create u = User.only_deleted.where("email = ?", params[:user][:email]) if u.present? flash[:danger] = 'User Deleted. Please Contact Admin.' redirect_to new_user_session_path else # if valid_email(params[:user][:email]) == true super # end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sign_up(resource_name, resource)\n end", "def create\n build_resource(sign_up_params)\n\n resource.save\n render_resource(resource)\n end", "def sign_up(resource_name, resource)\n redirect_to users_url\n end", "def create\n build_resource(configure_sign_up_params)\n resource.save\n ...
[ "0.802381", "0.79407203", "0.7855574", "0.78512365", "0.7847869", "0.77352446", "0.76984376", "0.76961756", "0.76653403", "0.7656444", "0.7655498", "0.7641147", "0.7629752", "0.76207453", "0.76207453", "0.7601901", "0.7593272", "0.75696474", "0.7566873", "0.7546625", "0.75424...
0.0
-1
If you have extra params to permit, append them to the sanitizer. def configure_sign_up_params devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute]) end If you have extra params to permit, append them to the sanitizer. def configure_account_update_params devise_parameter_sanitizer.permit(:account_update, keys...
def after_update_path_for(resource) flash[:notice] = "Profile updated successfully" home_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:email,:password, :password_confirmation, :first_name, :last_name, :circonscription])\n devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name, :email, :password, :password_confirmation, :circonscript...
[ "0.8480727", "0.84463453", "0.8363743", "0.8343737", "0.8343737", "0.8343737", "0.8343737", "0.8343737", "0.8343737", "0.8343737", "0.8343737", "0.8343737", "0.8343737", "0.827618", "0.8251671", "0.81992054", "0.8192859", "0.81923246", "0.81831354", "0.8180352", "0.81715137",...
0.0
-1
maneuver states: hunt approach (spiral in until at optimal distance) circle_strafing target actions: lock on target
def best_target far_enough = competitors.select do |competitor| competitor.projected_position_at(current_tick_index).distance(self.sensors.position) >= RTanque::Bot::Turret::LENGTH end far_enough.sort_by do |competitor| competitor.projected_position_at(current_tick_index).distance(self.sensors.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_change_target\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n case @acts[1]\n # --------------------\n when 0 # Original Target\n self.area_flag = item_in_use.area?\n @target = @ori_target\n @target_array = @ori_targets.clone\n # -------------------\n ...
[ "0.62659484", "0.6260761", "0.6184533", "0.6147916", "0.6134955", "0.5949397", "0.594767", "0.5802363", "0.58006734", "0.5793714", "0.5793639", "0.5686621", "0.56531674", "0.55997545", "0.5597484", "0.55813307", "0.5577667", "0.5522517", "0.5430506", "0.5430269", "0.54198015"...
0.0
-1
======================= PURCHASE STUFF ===============================
def num_already_purchased(deal) active_purchases.map { |x| x.deal_id == deal.id ? x.num_bought : 0}.reduce(&:+) || 0 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def purging\n @purging = true\n end", "def purge\n end", "def purge\n\n\t\tend", "def after_destroy(purchase)\n if purchase.store_id\n shopping = Shopping.add(\n purchase.user_id,\n purchase.store_id,\n ShoppingSource::Purchase)\n shoppin...
[ "0.6630897", "0.6578031", "0.64721733", "0.63215905", "0.6205686", "0.5902519", "0.5775348", "0.5658996", "0.565274", "0.5625425", "0.5623658", "0.55969596", "0.55768245", "0.55275357", "0.55226743", "0.5505554", "0.54732543", "0.547143", "0.5424674", "0.5411068", "0.53894645...
0.0
-1
======================= COUPON STUFF ===============================
def active_coupons coupons.keep_if{|coupon| coupon.active?}.reverse end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def probers; end", "def cop_config; end", "def cp_c\n end", "def cop; end", "def cop; end", "def cop_name; end", "def cop_name; end", "def cop_names; end", "def all_cops?; end", "def cp_b\n end", "def cobasysprog\n end", "def suivre; end", "def conj\n pos 'CONJ'\n end", ...
[ "0.6257542", "0.6135828", "0.613582", "0.6103471", "0.6103471", "0.5938668", "0.5938668", "0.5913406", "0.58448386", "0.5795129", "0.5759166", "0.5713208", "0.55861413", "0.55729556", "0.55729556", "0.5542786", "0.5537785", "0.55359435", "0.55229557", "0.55112934", "0.550786"...
0.0
-1
======================= SUBSCRIPTION STUFF ===============================
def active_subscriptions subscriptions.select { |s| s.active? }.sort{|x,y| y.created_at <=> x.created_at} || [] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscriptions; end", "def subscriptions; end", "def subscriptions; end", "def subscribed; end", "def subscribe\n \nend", "def subscribe!\n # TODO: Implement\n end", "def on_subscription_success\n end", "def pubsub_adapter; end", "def service_subscriptions\n iq = connection.iq_sta...
[ "0.74308246", "0.74308246", "0.74308246", "0.713746", "0.71003705", "0.69718933", "0.69538194", "0.693153", "0.67855155", "0.6765999", "0.6667669", "0.6666002", "0.6617362", "0.65890414", "0.65773284", "0.655929", "0.6528993", "0.6445843", "0.64414495", "0.64260167", "0.63945...
0.0
-1
======================= CARD LINKS STUFF ===============================
def fulfilled_deal?(deal) if deal.card_linked? card_link_for(deal.id).try(:fulfilled?) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def card_homelink options={}\n homelink decorator, options\n end", "def get_cards\n @doc = Nokogiri::HTML(open(@url))\n card_links = @doc.css(\"div.snap-feat\")\n id = 0\n\n card_links.collect do |card|\n id += 1\n c = Cards::CreditCard.new(card.css(\"h3 a.detail-tog\").text)\n c.i...
[ "0.64916915", "0.6406079", "0.60592794", "0.60592794", "0.59337217", "0.59147525", "0.5896554", "0.5819199", "0.581119", "0.5795779", "0.5795779", "0.57876265", "0.5740186", "0.57041407", "0.5689508", "0.5683463", "0.5683463", "0.5661261", "0.5657326", "0.56467515", "0.562722...
0.0
-1
========================== SAVED DEAL STUFF ==================================
def category_active_for?(category) !!category_preferences.try(:any?) { |cp| cp.category_id == category.id } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_report_item(employee, record)\n if record.hours_worked != 0 \n amount_paid = 0\n case employee.job_group\n when \"A\"\n amount_paid += record.hours_worked * 30\n when \"B\"\n amount_paid += record.hours_worked * 20\n end\n current_date = record.date\n case current_date.day...
[ "0.5839521", "0.57344776", "0.5588279", "0.5581184", "0.5471951", "0.53904265", "0.5389306", "0.53693074", "0.5362871", "0.53023636", "0.5295318", "0.5295076", "0.52892804", "0.5279958", "0.5279958", "0.5272267", "0.5252071", "0.52325547", "0.52265126", "0.5207843", "0.518919...
0.0
-1
Overrides the parent method to ensure the current ping node is destroyed
def inherit(node) ping.remove super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def on_node_destroy( node )\n\t\t\tself.log.debug \"unhandled on_node_destroy for %p\" % [ node ]\n\t\tend", "def delete_ping\n delete 'ping'\n end", "def teardown\n response = Vanagon::Utilities.http_request(\n \"#{@pooler}/vm/#{@target}\",\n \"DELETE\",\n nil,\n ...
[ "0.6354683", "0.633756", "0.6294712", "0.6251677", "0.62298685", "0.618085", "0.6174263", "0.61154544", "0.6078201", "0.6063464", "0.6055601", "0.605479", "0.5984734", "0.5982262", "0.5982262", "0.5952237", "0.5900358", "0.5863139", "0.5787076", "0.5766752", "0.57618076", "...
0.6927966
0
Ping node accessor If a ping node exists it will be returned. Otherwise a new node will be created and returned
def ping p = find_first 'ns:ping', :ns => self.class.registered_ns unless p (self << (p = XMPPNode.new('ping', self.document))) p.namespace = self.class.registered_ns end p end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ping\n response = connection.get(get_ping_url)\n if response.success?\n PingResponse.new(response.body)\n end\n end", "def pingnode(address, interface=nil)\n out = interface ? `ping -I #{interface} -c 5 #{address}` : `ping -c 5 #{address}`\n if $? != 0\n # Ping command...
[ "0.6521571", "0.6185138", "0.61219424", "0.6079024", "0.6055741", "0.6040929", "0.6020641", "0.5991688", "0.5990256", "0.5943572", "0.59406835", "0.59399575", "0.58999497", "0.5873468", "0.5872066", "0.58527225", "0.58280146", "0.58013415", "0.57956356", "0.57860965", "0.5722...
0.7059382
0
GET /boat_types GET /boat_types.json
def index @boat_types = params[:ids].blank? ? BoatType.active : BoatType.where(id: params[:ids]) if params[:ids].blank? @boat_types = BoatType.active #parameter_filter_data = BoatParameterType.filter_data #option_filter_data = BoatOptionType.filter_data # @filter_data = parameter_filter...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end", "def index\n @bet_types = Bet::Type.all\n end", "def index\n @kind_of_boats = KindOfBoat.all\n end", "def index\n @bs_types = BsType.all\n end", "def index\n @bagtypes = Bagtype.all\n\n respond_to do |for...
[ "0.7141829", "0.7024058", "0.685896", "0.6825305", "0.6786215", "0.6741766", "0.6609532", "0.64806306", "0.6408396", "0.6390036", "0.6381461", "0.6358417", "0.6297997", "0.6288923", "0.6232363", "0.6232077", "0.6203449", "0.6180284", "0.6166267", "0.6157862", "0.6138943", "...
0.61379623
21
GET /boat_types/1 GET /boat_types/1.json
def show @title = @header = @boat_type.catalog_name #@data = is_control? ? {boat_type: @boat_type.hash_view(current_site, cur_locale.to_s), trademarks: @trademarks, boat_series: @boat_series} : {boat_type: @boat_type} respond_to do |format| format.html format.json { render json: @data} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @bet_types = Bet::Type.all\n end", "def index\n @kind_of_boats = KindOfBoat.all\n end", "def index\n @bagtypes = Bagtype.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bagtypes }\n end\n end", "def index\n @bs_types = BsT...
[ "0.68144935", "0.6812647", "0.6690859", "0.6667126", "0.66632307", "0.65838933", "0.6528449", "0.65258443", "0.64698774", "0.64322037", "0.6415081", "0.63811886", "0.6324647", "0.6309668", "0.6308188", "0.6288893", "0.62323195", "0.62296927", "0.61586994", "0.61488205", "0.61...
0.5753815
71
POST /boat_types POST /boat_types.json
def create @boat_type = BoatType.new(boat_type_params) respond_to do |format| if @boat_type.save format.html { redirect_to edit_boat_type_path(@boat_type)} format.json { render json: @boat_type.hash_view('control'), status: :created, location: @boat_type } else format.html { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pet_types\r\n BnetApi::make_request('/wow/data/pet/types')\r\n end", "def boat_type_params\n params.require(:boat_type).permit(:ru_name, :en_name, :design_category, :copy_params_table_from_id, :boat_series_id, :body_type, :ru_description, :en_description, :ru_slogan, :en_slogan, :cnf_data_fi...
[ "0.6612902", "0.65330064", "0.6479013", "0.63873273", "0.63754666", "0.629241", "0.6270711", "0.6210799", "0.618794", "0.614453", "0.6124388", "0.61091834", "0.60448927", "0.6033925", "0.60282665", "0.59335744", "0.59335744", "0.5928024", "0.5919358", "0.5919358", "0.58681124...
0.6875857
0
PATCH/PUT /boat_types/1 PATCH/PUT /boat_types/1.json
def update prms = @boat_type.is_modification? ? modification_params : boat_type_params respond_to do |format| if @boat_type.update(prms) format.html { redirect_to edit_boat_type_path(@boat_type), notice: 'Тип лодки успешно обновлён' } format.json { render json: @boat_type.hash_view('contro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @kind_of_boat.update(kind_of_boat_params)\n format.html { redirect_to @kind_of_boat, notice: 'Kind of boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @kind_of_boat }\n else\n format.html { render :edit...
[ "0.69488794", "0.67846626", "0.6779809", "0.67107934", "0.6644783", "0.65858734", "0.65858734", "0.65858734", "0.65431744", "0.6492222", "0.6469287", "0.64582306", "0.64381003", "0.6426274", "0.6350214", "0.6291226", "0.6237887", "0.6204577", "0.6184031", "0.6162096", "0.6146...
0.7168352
0
DELETE /boat_types/1 DELETE /boat_types/1.json
def destroy if !@boat_type.is_modification? @boat_type.destroy respond_to do |format| format.html { redirect_to manage_boat_types_url, notice: 'Тип лодки был успешно удалён' } format.json { head :no_content } end else respond_to do |format| if @boat_type.boat_type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @bagtype = Bagtype.find(params[:id])\n @bagtype.destroy\n\n respond_to do |format|\n format.html { redirect_to bagtypes_url }\n format.json { head :ok }\n end\n end", "def destroy\n @bs_type.destroy\n respond_to do |format|\n format.html { redirect_to bs_types_url,...
[ "0.71177554", "0.7064494", "0.69310373", "0.69107395", "0.6897441", "0.68961865", "0.6882408", "0.6837989", "0.6821159", "0.6790682", "0.6788256", "0.67847127", "0.6774259", "0.6676323", "0.6658198", "0.66345865", "0.66345865", "0.66345865", "0.6620957", "0.66179925", "0.6615...
0.7007574
2
Use callbacks to share common setup or constraints between actions.
def set_boat_type #boat_type = #redirect_to boat_type.boat_type and return if boat_type.is_modification? @boat_type = BoatType.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.6162554", "0.60452986", "0.5945278", "0.59169763", "0.58877826", "0.5834763", "0.5775349", "0.5704972", "0.5704972", "0.56543803", "0.5621491", "0.5427202", "0.54093206", "0.54093206", "0.54093206", "0.53975695", "0.53776276", "0.53562194", "0.5340594", "0.5337824", "0.532...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def boat_type_params params.require(:boat_type).permit(:ru_name, :en_name, :design_category, :copy_params_table_from_id, :boat_series_id, :body_type, :ru_description, :en_description, :ru_slogan, :en_slogan, :cnf_data_file_url, :base_cost, :is_deprecated, :is_active, :trademark_id, :use_on_ru, :use_on_en) 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
enables mass assignment of players attributes Determine is current player made winning move return true if this is the case else return false
def winner?(curr_player_moves) WINNING_MOVES.each { |winning_moves| return true if winning_moves & curr_player_moves == winning_moves } return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_player_move?(player, move)\n if possible_plays.include?(move)\n player.move = move\n true\n else\n false\n end\n end", "def set_computer_moves?(player)\n if player.is_computer?\n move = possible_plays.sample\n player.move = move\n true\n else...
[ "0.6679295", "0.6618854", "0.661398", "0.6547951", "0.65041393", "0.6427369", "0.63887286", "0.63825715", "0.6337874", "0.6328532", "0.63208014", "0.6313209", "0.6313209", "0.6276137", "0.6244411", "0.6239199", "0.62288225", "0.6227944", "0.620031", "0.6160615", "0.61495996",...
0.6409368
6
Determine available moves receive p1 moves and p2 moves return array of available moves
def open_squares(p1_moves, p2_moves) avail_moves = Array.new SQUARES.each { |n| avail_moves << n unless p1_moves.include?(n) || p2_moves.include?(n) } return avail_moves end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def moves_available\n # return what moves are available to this piec\n end", "def moves\n available_moves = []\n\n deltas.each do |delta|\n next_move = self.position.zip_sum(delta)\n break unless on_board?(next_move)\n break unless empty_square?(next_move)\n available_moves << next_...
[ "0.72172505", "0.6733831", "0.6693919", "0.6663384", "0.64564115", "0.64156556", "0.64130557", "0.64099115", "0.6341616", "0.6334819", "0.6317007", "0.6278047", "0.6267057", "0.62636286", "0.6245892", "0.6237971", "0.62254995", "0.62038827", "0.61890054", "0.6182633", "0.6149...
0.7014443
1
return true if game is draw (no remaining winning moves available), else return false. Improve by taking into account whose turn it is.
def draw?(p1_moves, p2_moves) avail_moves = open_squares(p1_moves, p2_moves) return true if winner?(p1_moves | avail_moves) == false && winner?(p2_moves | avail_moves) == false return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def drawn?\n # Conditions:\n # 1. No move available\n # 2. And no one wins\n if !move_available? && !win?\n mark_drawn!\n\n return true\n end\n\n false\n end", "def draw?\n !board.include?(0) && winner.nil?\n end", "def draw?\n incomplete_board = !full?\n is_game_won = wo...
[ "0.83163685", "0.8150325", "0.8088796", "0.79780215", "0.79609954", "0.79577595", "0.7927683", "0.7927683", "0.7917684", "0.79171044", "0.7915534", "0.7912967", "0.79019505", "0.7896192", "0.7896192", "0.7893902", "0.7893047", "0.78823435", "0.78822887", "0.7877937", "0.78774...
0.7751086
64
say hi to everyone
def say_hi if @names.nil? puts "..." elsif @names.respond_to?("each") @names.each do |name| puts "Hello #{name}" end else puts "Hello #{@names}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sayHi\n\t\tputs(greet)\n\tend", "def say_hi\n\t\tputs 'saying hi'\n\tend", "def say_hi\n \tputs \"hello user\" #you must call the method by calling. out its name \"say_hi\"\n end", "def greet\n self.say \"Hello, I am #{@config[:nick]}. I am the resident uber-bot. To learn more, type '.abou...
[ "0.7880603", "0.7646402", "0.75421375", "0.7364657", "0.7333217", "0.73037755", "0.72600377", "0.7242886", "0.7207713", "0.7162793", "0.71617854", "0.7118497", "0.7084572", "0.70705736", "0.70638174", "0.70421696", "0.70306635", "0.70202744", "0.7011164", "0.6994244", "0.6905...
0.6521121
85
say goodbye to everyone
def say_bye if @names.nil? puts "..." elsif @names.respond_to?("join") puts "Goodbye #{names.join(", ")}" else puts "Goodbye #{names}" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def say_goodbye\n\t\tgoodbye = \"Thanks for playing the Virtual Crazy\" +\n\t\t\t\t\"8-Ball game!\\n\\n\"\n\tend", "def goodbye \n puts \"Don't leave hungry!\"\n end", "def say_goodbye\r\n\t\tgoodbye = \"Thanks for playing the Virtual Crazy 8-Ball game! \\n\\n\" +\r\n\t\t\"Student: T. J. Flesher \\n\\...
[ "0.8133046", "0.8027566", "0.7981967", "0.7876905", "0.7831334", "0.7809996", "0.7757461", "0.76850945", "0.7676737", "0.76580435", "0.7650922", "0.76216084", "0.7606529", "0.7585609", "0.7548504", "0.75484043", "0.75321233", "0.75267005", "0.74788994", "0.7462179", "0.745560...
0.7564058
14
Get the value of key, if not found, returns nil.
def get key @redis.get key end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(key)\n position = find(key)\n if position != nil\n @values[position]\n else\n nil\n end\n end", "def find(key)\n # TODO(himanshujaju) - possible improvement by not checking for contains.\n if contains?(key)\n return @key_data[key].value\n end\n\n return nil\n end"...
[ "0.82378495", "0.80678195", "0.78649604", "0.78294224", "0.7683201", "0.7641144", "0.7635554", "0.76105917", "0.7595014", "0.75944793", "0.7527879", "0.74942994", "0.7448325", "0.7434273", "0.73828065", "0.7349438", "0.7348137", "0.73427093", "0.73376626", "0.73178023", "0.73...
0.0
-1
Set key to hold the value and set key to timeout after the a given expiration time(in seconds).
def set key, value, exp @redis.setex key, exp, value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set(key, value, expires_in = 0)\n\n end", "def setex(key, ttl, value); end", "def setex(key, ttl, value); end", "def set key, value, expiration\n backend.set key.to_s, serialize(value), expiration rescue nil\n end", "def expire(key, seconds, **kwargs); end", "def []=(key, value)\n v = Tim...
[ "0.7437024", "0.7267534", "0.7267534", "0.71853137", "0.71056145", "0.7064739", "0.6906304", "0.6899647", "0.68369937", "0.67862463", "0.67700803", "0.67484677", "0.6729623", "0.6716706", "0.6664775", "0.665613", "0.66462934", "0.66319704", "0.6624713", "0.6591006", "0.653887...
0.5866262
67
end of play method
def exit_jukebox puts "Goodbye" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def play; end", "def play\n \n end", "def play \n end", "def play\n end", "def play\n end", "def play\n end", "def play\n end", "def play\n\tend", "def play\n end", "def after_play\n\n end", "def get_play() \n # \n end", "def play\n self\n end", "def play\n #call...
[ "0.8445035", "0.8348472", "0.82470936", "0.8150902", "0.8150902", "0.8150902", "0.8150902", "0.81472355", "0.8138188", "0.7579214", "0.75363344", "0.73412687", "0.7304116", "0.7091379", "0.7061106", "0.7026526", "0.7026526", "0.6999948", "0.6960647", "0.6960647", "0.6960647",...
0.0
-1
takes first optional argument as array of column names second optional argument as array of data arrays
def initialize cols=nil, *args, &block @chash = [] # hash of column info, not used @_skip_columns = {} # internal, which columns not to calc width of since user has specified @separ = @columns = @numbering = nil @y = '|' @x = '+' @use_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_column_data_array\n\ttable_id = create_table_id('../data/census_column_metadata.csv')\n\tcolumn_id = create_column_id('../data/census_column_metadata.csv')\n\t\n\t[title_processor,table_id,column_id].transpose\n\nend", "def bound_variable_arg(arg, conn)\n case arg\n when ArrayRow\n ...
[ "0.6135704", "0.61350346", "0.6114321", "0.5990158", "0.5811916", "0.5702721", "0.5654487", "0.5623366", "0.5587993", "0.5566014", "0.55366254", "0.5523478", "0.55062604", "0.5484118", "0.54664457", "0.544343", "0.5434125", "0.54301643", "0.54062504", "0.5404279", "0.5353882"...
0.0
-1
set columns names . NOTE that we are not clearing chash here. In case, someone changes table and columns.
def columns=(array) #$log.debug "tabular got columns #{array.count} #{array.inspect} " if $log @columns = array @columns.each_with_index { |e,i| #@chash[i] = ColumnInfo.new(c, c.to_s.length) c = get_column(i) c.name = e c.width = e.to_s.length #@chash[i] = c ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def columns= columns\n columns.each { |c| c.table = self }\n @columns = columns\n end", "def columns(table_name, name = nil) end", "def initialize_columns\n @columns = []\n valid_table = table.alias('valid_taxon_names')\n\n @columns.push({ header: 'ro', projected: rank_over(ta...
[ "0.68806785", "0.6714919", "0.66101706", "0.6537603", "0.65074956", "0.6458233", "0.6431775", "0.6431775", "0.6371532", "0.6305882", "0.6231081", "0.6224894", "0.61524403", "0.61167276", "0.61036533", "0.6091803", "0.6084889", "0.60723287", "0.60540897", "0.6042492", "0.60394...
0.67733675
1
set data as an array of arrays
def data=(list) #puts "got data: #{list.size} " if !$log #puts list if !$log @list = list end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_data_array(data_set)\n case\n when data_set.is_a?(Daru::DataFrame)\n return ArgumentError unless data_set.index.is_a?(Daru::Index)\n data_set.access_row_tuples_by_indexs(*data_set.index.to_a)\n when data_set.is_a?(Daru::Vector)\n rows = []\n ...
[ "0.68242866", "0.6756915", "0.66845435", "0.6625737", "0.64005864", "0.6362649", "0.6320675", "0.6297889", "0.6229435", "0.6210775", "0.6188046", "0.61304575", "0.6110629", "0.61034673", "0.6095829", "0.60781205", "0.6006571", "0.6002479", "0.5990009", "0.5987814", "0.5964601...
0.0
-1
add a row of data
def add array #$log.debug "tabular got add #{array.count} #{array.inspect} " if $log @list ||= [] @list << array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add(row)\n @data << row\n end", "def add_row(row)\n size = row.size\n raise ArgumentError.new(\"Given a row of data with #{size} entries, but there are only #{@table_columns.size} columns in the table\") unless size == @table_columns.size\n @data << row\n end", "def addrow(data, o...
[ "0.85498613", "0.7993887", "0.7834648", "0.7552865", "0.747617", "0.74530756", "0.7377337", "0.72740483", "0.7259757", "0.7140334", "0.7078779", "0.7056619", "0.6937684", "0.69340885", "0.69019437", "0.6847979", "0.6814924", "0.6814072", "0.67863846", "0.6785863", "0.6769066"...
0.6086264
54
retrieve the column info structure for the given offset. The offset pertains to the visible offset not actual offset in data model. These two differ when we move a column.
def get_column index return @chash[index] if @chash[index] # create a new entry since none present c = ColumnInfo.new c.index = index @chash[index] = c return c end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_column\n @col_offset\n end", "def column_for_position(position); end", "def column_for_position(position); end", "def column_for_position(position); end", "def _calculate_column_offsets\n total = 0\n coffsets = []\n ctr = 0\n ## ix will have gaps in between for hidde...
[ "0.62186426", "0.59655404", "0.59655404", "0.59655404", "0.5828985", "0.57704616", "0.5598626", "0.5578441", "0.5573682", "0.55598956", "0.54008937", "0.5389818", "0.538439", "0.53585845", "0.5340063", "0.53385663", "0.5331531", "0.5317543", "0.530272", "0.5270082", "0.521746...
0.49867812
45
set width of a given column, any data beyond this will be truncated at display time.
def column_width colindex, width=:NONE if width == :NONE #return @cw[colindex] return get_column(colindex).width end @_skip_columns[colindex] = true ## don't calculate col width for this. get_column(colindex).width = width self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_width=(value)\n @column_width = value\n end", "def change_column_width(column_index, width_in_chars = RubyXL::ColumnRange::DEFAULT_WIDTH)\n change_column_width_raw(column_index, ((width_in_chars + (5.0 / RubyXL::Font::MAX_DIGIT_WIDTH)) * 256).to_i / 256.0)\n end", "def ...
[ "0.80435437", "0.76471424", "0.7587935", "0.7513679", "0.73899555", "0.7049284", "0.6824156", "0.6741879", "0.671783", "0.6681531", "0.6662315", "0.66044116", "0.65847903", "0.6490916", "0.64883727", "0.64860964", "0.64860964", "0.64860964", "0.64485145", "0.63773966", "0.631...
0.70229214
6
set alignment of given column offset
def column_align colindex, lrc=:NONE if lrc == :NONE return get_column(colindex).align #return @calign[colindex] end raise ArgumentError, "wrong alignment value sent" if ![:right, :left, :center].include? lrc get_column(colindex).align = lrc self end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def align_column colindex, lrc\n raise ArgumentError, \"wrong alignment value sent\" if ![:right, :left, :center].include? lrc\n @calign[colindex] ||= lrc\n if @chash[colindex].nil?\n @chash[colindex] = ColumnInfo.new(\"\", nil, lrc)\n else\n @chash[colindex].align = lrc\n en...
[ "0.6934832", "0.67424357", "0.6686975", "0.6625456", "0.6587735", "0.6587735", "0.6460359", "0.6460359", "0.6433331", "0.63598865", "0.62720424", "0.62634814", "0.62217283", "0.6138361", "0.611345", "0.60497516", "0.6049009", "0.6045546", "0.6045546", "0.6001273", "0.5967639"...
0.6835414
1
return an array of visible columns names
def visible_column_names visible = [] @chash.each_with_index do |c, ix| if !c.hidden if block_given? yield c.name, ix else visible << c.name end end end return visible unless block_given? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_columns_visible\n if columns_visible\n return JSON.parse columns_visible\n else\n return []\n end\n end", "def get_columns_visible\n columns_visible ? JSON.parse(columns_visible) : []\n end", "def get_visible_columns\n return @visible_columns_cache unless @visible_columns_c...
[ "0.79247165", "0.7845815", "0.78433377", "0.7817416", "0.765696", "0.7655768", "0.75953966", "0.7585849", "0.7460832", "0.72860515", "0.72471976", "0.72181123", "0.7210697", "0.7187838", "0.717872", "0.7132154", "0.70969605", "0.70618695", "0.70578426", "0.7038825", "0.703694...
0.8338983
0
returns the count of visible columns based on column names. NOTE: what if no column names gives ???
def column_count visible_column_names().count end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ncols\n @colnames.length\n end", "def count_columns\n fields.size\n end", "def column_count\r\n assert_exists\r\n arr_cells = cells\r\n return arr_cells.length\r\n end", "def columns_count\n @columns.size\n end", "def columns_count\n @values.empty? ? 0 :...
[ "0.73080254", "0.7107904", "0.6898772", "0.6886108", "0.6841604", "0.6790589", "0.67589843", "0.6656489", "0.65630984", "0.6552611", "0.6425674", "0.63371474", "0.6336136", "0.619328", "0.61428595", "0.61328506", "0.6115696", "0.61093533", "0.6105659", "0.6075087", "0.6045279...
0.85858935
0
yields nonhidden columns (ColumnInfo) and the offset/index This is the order in which columns are to be printed
def each_column @chash.each_with_index { |c, i| next if c.hidden yield c,i if block_given? } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visible_column_names\n visible = []\n @chash.each_with_index do |c, ix|\n if !c.hidden\n if block_given?\n yield c.name, ix \n else\n visible << c.name\n end\n end\n end\n return visible unless block_given?\n end", "def _ca...
[ "0.66282904", "0.64667326", "0.6226126", "0.6144539", "0.6144539", "0.6144539", "0.6051335", "0.604972", "0.60314804", "0.5972126", "0.5948847", "0.59092015", "0.58611375", "0.58564484", "0.585576", "0.58543706", "0.58256406", "0.58035064", "0.57957774", "0.5789821", "0.57829...
0.6988101
0
for the given row, return visible columns as an array
def visible_columns(row) visible = [] row.each_with_index do |e, ix| hid = @chash[ix].hidden if !hid if block_given? yield e, ix else visible << e end end end return visible if !block_given? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_columns_visible\n if columns_visible\n return JSON.parse columns_visible\n else\n return []\n end\n end", "def get_columns_visible\n columns_visible ? JSON.parse(columns_visible) : []\n end", "def get_array_by_col()\n\t\tprepare(@dim_i,@dim_j)\n\t\ttmpTab = Array.new\n\t\tfor j ...
[ "0.6800079", "0.67770416", "0.64326525", "0.63399136", "0.6281308", "0.6272814", "0.62722653", "0.6207757", "0.6197278", "0.61805534", "0.6173692", "0.61454064", "0.6128624", "0.61245334", "0.61191356", "0.6100184", "0.60742474", "0.60221314", "0.60187423", "0.599238", "0.598...
0.8342887
0
Now returns an array with formatted data
def render raise "tabular:: list is nil " unless @list $log.debug " render list:: #{@list.size} " #$log.debug " render list:1: #{@list} " raise "tabular:: columns is nil " unless @columns buffer = [] @separ = nil _guess_col_widths rows = @list.size.to_s.length #@r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def format data\n data\n end", "def to_ary\n [\"#{id}: #{description}\", @raw_data]\n end", "def parse_raw_data\n data_slices.to_a\n end", "def convert(data_array, format)\n formated_text_and_coordinates=[]\n for i in 0 ... format.items.size\n formated_text_current = form...
[ "0.70158577", "0.69932467", "0.6614158", "0.64066076", "0.6406329", "0.63066924", "0.6252737", "0.62265384", "0.6216922", "0.62026376", "0.61905193", "0.6176119", "0.61705196", "0.61339253", "0.6120145", "0.6102318", "0.60958934", "0.6079461", "0.60642844", "0.60520196", "0.6...
0.0
-1
use this for printing out on terminal NOTE: Do not name this to_s as it will print the entire content in many places in debug statements
def to_string render().join "\n" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n Printer.instance.print(self)\n end", "def print\n puts to_s\n end", "def to_s\r\n pretty_output\r\n end", "def to_s\n render().join \"\\n\"\n end", "def to_s\r\n self.each do |r|\r\n puts r.each { |p| p }.join(\" \")\r\n end\r\n end", "def print_temp\n prin...
[ "0.7424938", "0.7352448", "0.7339749", "0.7282939", "0.72734314", "0.72063947", "0.7173819", "0.70856524", "0.70621943", "0.6977064", "0.6933766", "0.6931118", "0.69023156", "0.6887039", "0.68830633", "0.68762255", "0.6872572", "0.68509907", "0.682394", "0.68021905", "0.67966...
0.70152366
9
This refers to a separator line after the heading and not a field separator. Badly named !
def separator return @separ if @separ str = "" if @numbering str = "-"*(rows+1)+@x end each_column { | c, ix| v = c.width next if v == 0 ## hidden column str << "-" * (v+1) + @x } @separ = str.chop end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def separator; end", "def lsep\n \"==================================================================================\"\n end", "def line_divider \n puts @header.light_blue\n end", "def separator\n nil\n end", "def separator(type); end", "def sep; end", "def sep; end", "def de...
[ "0.7266506", "0.7061372", "0.70447874", "0.6834164", "0.6719125", "0.66833764", "0.66833764", "0.6677838", "0.66188836", "0.66188836", "0.6590353", "0.6590353", "0.6590353", "0.65376014", "0.6436418", "0.6436418", "0.6331948", "0.6315255", "0.62589073", "0.6207433", "0.619758...
0.60345525
26
This calculates and stores the offset at which each column starts. Used when going to next column or doing a find for a string in the table.
def _calculate_column_offsets total = 0 coffsets = [] ctr = 0 ## ix will have gaps in between for hidden fields each_column { | c, ix| v = c.width coffsets[ctr] = total ctr += 1 total += v + 2 ## blank space plus separator } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_column\n @col_offset\n end", "def column\n old_pos - start_of_current_line_pos\n end", "def column\n old_pos - start_of_current_line_pos\n end", "def column_index(col)\n col.each_codepoint.reduce(0) do |sum, n|\n break sum - 1 if n < A_CODEPOINT # reached a number\n\n ...
[ "0.72847974", "0.69097686", "0.69097686", "0.63683105", "0.6299307", "0.622816", "0.6216673", "0.6216673", "0.6216673", "0.6213201", "0.612637", "0.6073526", "0.60015225", "0.59757733", "0.5975064", "0.59747994", "0.5966612", "0.5953448", "0.59420145", "0.59420145", "0.590761...
0.79618025
0