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
Returns the 'Playlist' string
def asset_name 'Playlist' end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def kind\n :playlist\n end", "def playlist_type(param = 'appending')\n \"playlistType=#{param}\"\n end", "def to_s_simple\n \"playlist_id = #{self.metadata['playlist_id']} name = #{self.metadata['name']}\"\n end", "def playlist\n connection.write(\"playlist\")\n end", "...
[ "0.7769256", "0.7511337", "0.716636", "0.71456915", "0.7067444", "0.70411927", "0.70406973", "0.69367576", "0.69367576", "0.69367576", "0.69367576", "0.68977726", "0.68762976", "0.68485683", "0.6761624", "0.6658867", "0.6627057", "0.659727", "0.65888923", "0.6588151", "0.6577...
0.7247489
2
Returns the :playlist symbol
def kind :playlist end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def playlist_title;\treturn @json_data['playlist_title'];\tend", "def playlist_type(param = 'appending')\n \"playlistType=#{param}\"\n end", "def asset_name\n 'Playlist'\n end", "def playlist\n split_and_hash(send_request('playlistinfo'))\n end", "def playlist\n {\n name: name,\...
[ "0.6533269", "0.6445231", "0.6371098", "0.636223", "0.6331652", "0.62998223", "0.62998223", "0.62998223", "0.62998223", "0.62288254", "0.61499643", "0.611391", "0.603867", "0.5969295", "0.58574283", "0.5848771", "0.58455724", "0.58409345", "0.5828652", "0.5827043", "0.5784855...
0.7206415
0
GET /test_plans GET /test_plans.json
def index @test_plans = @project.test_plans end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plans(params = {})\n scope 'default'\n get('plans/', params)\n end", "def index\n @plans = Plan.all\n\n render json: @plans\n end", "def show\n @test_plan = TestPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @...
[ "0.77129453", "0.7556928", "0.7409739", "0.72444975", "0.72322667", "0.7230262", "0.72023284", "0.7084367", "0.70489573", "0.70125383", "0.6973324", "0.6963977", "0.6942771", "0.69186413", "0.69186413", "0.68885374", "0.68815374", "0.68602306", "0.6856868", "0.6856295", "0.67...
0.7651612
1
GET /test_plans/1 GET /test_plans/1.json
def show if params[:format] == 'xml' send_file @test_plan.jmx.path, :type => 'application/xml', :disposition => 'attachment' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @test_plan = TestPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_plan }\n end\n end", "def index\n @plans = Plan.all\n\n render json: @plans\n end", "def index\n @test_plans = @project.test_plans\n end"...
[ "0.7583407", "0.74746144", "0.7407685", "0.73822874", "0.72686875", "0.7243158", "0.71824914", "0.71771884", "0.7097799", "0.7075062", "0.70280284", "0.7005215", "0.6896074", "0.68352014", "0.68352014", "0.6814769", "0.67838526", "0.6722526", "0.66975766", "0.66516554", "0.66...
0.0
-1
POST /test_plans POST /test_plans.json
def create @test_plan = TestPlan.new(test_plan_params) @test_plan.project_id = @project.id respond_to do |format| if @test_plan.save format.html { redirect_to project_test_plans_path(@project), flash: {success: 'LoadTest plan was successfully created.'} } format.json { render :show, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create(attrs, user = @@default_user)\n attrs = { project_token: @project_token }.merge(attrs)\n @attributes = send_request('test_plans', :post) do |req|\n req.body = {\n test_plan: attrs.except(:project_token),\n token: attrs[:project_token],\n auth_token: user.auth_...
[ "0.72156084", "0.6930153", "0.6881365", "0.68809974", "0.68022156", "0.67888165", "0.6654397", "0.6547377", "0.65232277", "0.64733386", "0.64733386", "0.6400173", "0.6375207", "0.6326883", "0.63257027", "0.62953", "0.627664", "0.62696576", "0.6252172", "0.62512684", "0.625104...
0.70802665
1
PATCH/PUT /test_plans/1 PATCH/PUT /test_plans/1.json
def update update_args = {} if params[:reupload].blank? properties_array = Array.new property_names = params[:test_plan]['property_name'] property_values = params[:test_plan]['property_value'] count = 0 property_names.each_with_index.each do |name, index| if(!name.strip.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @test_plan = TestPlan.find(params[:id])\n\n respond_to do |format|\n if @test_plan.update_attributes(params[:test_plan])\n format.html { redirect_to @test_plan, notice: 'Test plan was successfully updated.' }\n format.json { head :no_content }\n else\n format.html ...
[ "0.7114928", "0.69938445", "0.6718093", "0.6709605", "0.67088044", "0.6662126", "0.6528211", "0.6528211", "0.647367", "0.6397944", "0.6397944", "0.6397944", "0.6397944", "0.6397944", "0.6385031", "0.6382235", "0.63624555", "0.6347829", "0.63051945", "0.6297877", "0.62690663",...
0.6720938
2
Use callbacks to share common setup or constraints between actions.
def set_test_plan @test_plan = TestPlan.where(project_id: @project.id).find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def test_plan_params params.require(:test_plan).permit(:project_id, :status, :jmx, :properties, :property_name, :property_value) 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
Create a new syncer.
def initialize settings self.settings = settings self.name = settings[:name] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_syncer\n message = \"#{self.class.name}#create_syncer is not implemented\"\n\n raise NotImplementedError.new(message)\n end", "def create_syncer\n if @get || @set\n accessor = BlockAccessor.new(@get, @set)\n elsif @accessor\n accessor = @accessor\n ...
[ "0.7617702", "0.6624623", "0.6602604", "0.62631595", "0.61512107", "0.55162287", "0.55082613", "0.54234076", "0.5319838", "0.5262616", "0.5262616", "0.5236391", "0.5235643", "0.52315134", "0.5152933", "0.5112253", "0.508847", "0.5055593", "0.5014452", "0.49924952", "0.4962985...
0.0
-1
Run this syncer, performing validation, setting up, sycning, and cleaning up.
def run validate setup before_sync sync after_sync rescue => e on_error(e) raise e end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform\n return if @exit\n\n args, opts = @arguments, @options\n [:to, :from, :to_safe, :exclude, :schemas].each do |opt|\n opts[opt] ||= config[opt.to_s]\n end\n map_deprecations(args, opts)\n\n if opts[:init]\n setup(db_config_file(args[0]) || config_file || \".pg...
[ "0.66764313", "0.66514415", "0.6509035", "0.63420063", "0.6317414", "0.6303287", "0.62672627", "0.61942273", "0.6141056", "0.61012226", "0.6082637", "0.6051846", "0.60227895", "0.5839331", "0.583335", "0.5826889", "0.5826889", "0.5826889", "0.57954603", "0.5791783", "0.576955...
0.7855763
0
Run after a successful sync.
def after_sync end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sync_complete()\n LOGGER.debug(\"#{self.name} sync completed\")\n @synced = true\n end", "def finish_sync(sync)\n sync.finish!\n end", "def after_sync\n super()\n Wukong::Deploy.vayacondios_client.announce(vayacondios_topic, {\n success: success?,\n ...
[ "0.74741447", "0.7310119", "0.70167816", "0.69105655", "0.6775641", "0.6775641", "0.6775641", "0.6700168", "0.6694529", "0.66265213", "0.65336853", "0.65336853", "0.6525627", "0.6446181", "0.6415853", "0.6400201", "0.6377328", "0.63150805", "0.63148504", "0.61786896", "0.6163...
0.8041928
0
New users from oauth need to select a username
def select_username redirect_to home_path unless current_user.username.blank? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twitter\n default_oauth_callback do |auth|\n # username may already be taken, user will have to enter another one\n if User.exists? username: auth.info.nickname\n redirect_to controller: '/registrations', action: 'twitter_screen_name_clash'\n else\n default_oauth_fail\n end...
[ "0.6270597", "0.62398016", "0.6213661", "0.6197259", "0.6147175", "0.6115188", "0.61134183", "0.60929984", "0.6077136", "0.60706687", "0.60626423", "0.6052033", "0.6052033", "0.6052033", "0.6052033", "0.60301554", "0.6026278", "0.60251784", "0.6021451", "0.6016391", "0.599801...
0.58046436
80
method to get existing node from the index or create one
def get_or_create_node(conn, index, value) # look for node in the index r = conn.get("/db/data/index/node/#{index}/name/#{CGI.escape(value)}") node = (JSON.parse(r.body).first || {})['self'] if r.status == 200 unless node # no indexed node found, so create a new one r = conn.post("/db/data/node", JSON.u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_or_create_node(conn, index, value)\n # look for node in the index\n r = conn.get(\"/db/data/index/node/#{index}/name/#{CGI.escape(value)}\")\n node = (JSON.parse(r.body).first || {})['self'] if r.status == 200\n unless node\n # no indexed node found, so create a new one\n r = conn.post(\"/db/data...
[ "0.8570569", "0.83197516", "0.7673152", "0.6746784", "0.662351", "0.6618165", "0.6573537", "0.654418", "0.6428472", "0.6404172", "0.63919085", "0.6388773", "0.62395287", "0.62395287", "0.6197465", "0.61633146", "0.61404157", "0.6136686", "0.613356", "0.6049216", "0.601203", ...
0.85709345
0
not sure why but adding new attributes to invitation, make has_one failed to render the correct serializer
def invitation InvitationSerializer.new(object.invitation, { :scope => scope, :root => false }) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @invitation = Invitation.new(params[:invitation])\n @title = \"Editing #{@invitation.guest.name}\"\n\n respond_to do |format|\n if @invitation.save\n format.html { redirect_to @invitation, success: 'Invitation was successfully created.' }\n format.json { render json: @invit...
[ "0.6775644", "0.6649831", "0.6606056", "0.6425943", "0.6403129", "0.63890463", "0.6364732", "0.6363653", "0.6344459", "0.63326776", "0.6327949", "0.6327949", "0.6316248", "0.6316248", "0.6286637", "0.6272231", "0.6263303", "0.6263303", "0.6263303", "0.6263303", "0.6263303", ...
0.7693143
0
New UserFolderSettingFormat Since: 1.1.7
def folder_settings ActiveModel::ArraySerializer.new(object.user_folder_settings, root: false, each_serializer: Api::Mobile::V2::UserFolderSettingSerializer, scope: scope ) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def folder_data\n @folder_data ||= Unan::folder_data + \"user/#{id}\"\n end", "def userfolder\n # \"public/upload/user_id_\" + self.user_id.to_s\n User.find_by_id( self.user_id ).userfolder\n end", "def script_settings_files_def\n {\n 'adjust_permissions.dirs' => {\n :uid => sftp_user_uid,\...
[ "0.57908195", "0.5778276", "0.57742983", "0.5535304", "0.5436422", "0.5431835", "0.54308367", "0.53484267", "0.5346189", "0.5309091", "0.5309091", "0.5309091", "0.5309091", "0.5309091", "0.5309091", "0.5309091", "0.5309091", "0.5309091", "0.5309091", "0.5225998", "0.5201646",...
0.7293664
0
Time Complexity: O(n) Space Complexity: O(n)
def add(key, value) @root = add_helper(@root, key, value) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\...
[ "0.6914348", "0.6609048", "0.6416534", "0.63194925", "0.62016535", "0.61871785", "0.60697335", "0.6059072", "0.6053246", "0.6047552", "0.6037029", "0.5990324", "0.5985229", "0.5983502", "0.59483737", "0.5907289", "0.58986485", "0.5894127", "0.589302", "0.5891029", "0.5862035"...
0.0
-1
Time Complexity: O(log n) Space Complexity: O(log n)
def find(key) return find_helper(@root, key) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\...
[ "0.69397587", "0.6612388", "0.6288231", "0.6221434", "0.617622", "0.61702883", "0.6141151", "0.6111735", "0.60828644", "0.6056079", "0.60265434", "0.59999096", "0.5956583", "0.59535867", "0.595115", "0.59448546", "0.5937593", "0.59367085", "0.5918616", "0.5901173", "0.5899637...
0.0
-1
Time Complexity: O(n) Space Complexity: O(n)
def inorder return inorder_helper(@root, []) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\...
[ "0.6913408", "0.66091037", "0.641673", "0.6319513", "0.6202019", "0.61864734", "0.60694766", "0.60592884", "0.6053155", "0.60475945", "0.6036812", "0.59895784", "0.5985419", "0.5983618", "0.59474975", "0.5906981", "0.5898838", "0.589395", "0.5892168", "0.5890709", "0.58606046...
0.0
-1
Time Complexity: O(n) Space Complexity: O(n)
def preorder return preorder_helper(@root, []) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\...
[ "0.6914348", "0.6609048", "0.6416534", "0.63194925", "0.62016535", "0.61871785", "0.60697335", "0.6059072", "0.6053246", "0.6047552", "0.6037029", "0.5990324", "0.5985229", "0.5983502", "0.59483737", "0.5907289", "0.58986485", "0.5894127", "0.589302", "0.5891029", "0.5862035"...
0.0
-1
Time Complexity: O(n) Space Complexity: O(n)
def postorder return postorder_helper(@root, []) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\...
[ "0.6914348", "0.6609048", "0.6416534", "0.63194925", "0.62016535", "0.61871785", "0.60697335", "0.6059072", "0.6053246", "0.6047552", "0.6037029", "0.5990324", "0.5985229", "0.5983502", "0.59483737", "0.5907289", "0.58986485", "0.5894127", "0.589302", "0.5891029", "0.5862035"...
0.0
-1
Time Complexity: O(n) Space Complexity: O(n)
def height return height_helper(@root, 0, 1) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend", "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\...
[ "0.6913453", "0.66090345", "0.64166", "0.63189584", "0.62014014", "0.61861414", "0.6069007", "0.60577476", "0.60532296", "0.60477674", "0.60366225", "0.59894204", "0.5984942", "0.59832925", "0.59479386", "0.59072447", "0.58985424", "0.58935916", "0.58928126", "0.5890426", "0....
0.0
-1
def delete(key) return nil if self.find(key).nil? end Optional Method Time Complexity: Space Complexity:
def bfs raise NotImplementedError end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete(key); end", "def delete(key); end", "def delete(key); end", "def delete(key); end", "def delete(key); end", "def delete key\n rv = self[key]\n self.removeField key\n return rv\n end", "def delete(key)\n\n end", "def remove(key); end", "def del(key)\n position = find(key)\...
[ "0.7802038", "0.7802038", "0.7802038", "0.7802038", "0.7802038", "0.7610371", "0.7507188", "0.7436676", "0.73984253", "0.7364301", "0.73527646", "0.7304198", "0.7303748", "0.72757787", "0.72452754", "0.72452754", "0.71940887", "0.71940887", "0.7165496", "0.71566254", "0.71563...
0.0
-1
billing time data about the subscription
def next_billing_date paypal_recurring_details[:next_billing_date] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def billing\n @data[:billing]\n end", "def start_time_millis\n @subscription_purchase.start_time_millis\n end", "def purchase_time_millis\n @purchase.purchase_time_millis\n end", "def first_billing_at\n time = Time.now\n time = time.advance(:days => trial_period) if ...
[ "0.67691875", "0.6346849", "0.63288045", "0.63209677", "0.6210255", "0.6184007", "0.61210334", "0.6116798", "0.6068537", "0.5959995", "0.59570813", "0.5941316", "0.5925444", "0.59187436", "0.5878926", "0.58220214", "0.576379", "0.5750563", "0.5719973", "0.5708741", "0.5702197...
0.5820352
16
to be called from subscription transaction only
def start_checkout(return_url, cancel_url, email) raise "already activated" if activated? paypal.start_checkout(return_url, cancel_url, email, plan.price_with_tax, human_description) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subscribed; end", "def on_subscription_success\n end", "def subscriptions; end", "def subscriptions; end", "def subscriptions; end", "def within_transaction; end", "def within_transaction; end", "def receive_transaction\n end", "def receive_transaction\n end", "def subscribe!\n ...
[ "0.7404285", "0.71339107", "0.70766073", "0.70766073", "0.70766073", "0.68823105", "0.68823105", "0.68257064", "0.68257064", "0.676034", "0.6745575", "0.65532035", "0.6552187", "0.6533463", "0.64762306", "0.63852507", "0.62338465", "0.6225642", "0.61942863", "0.6185767", "0.6...
0.0
-1
Return true if is_prod
def prod? is_prod end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def needs_prod_set\n\t\treturn false\n\tend", "def cap? ; prod_type == 'cap' end", "def product?\n self.level == \"product\" && !self.products.blank?\n end", "def product?\n [2, 3].map { |i| TYPES[i] }.include? self.ctype\n end", "def is_prod(latex, step)\n\tlatex[step+1..step+4].join == \"prod\"\n...
[ "0.7698302", "0.74167305", "0.72102785", "0.7161896", "0.7078044", "0.6785123", "0.67554724", "0.6652805", "0.6652805", "0.65217495", "0.65184236", "0.6517859", "0.6469336", "0.6451682", "0.64378077", "0.64212424", "0.6418677", "0.63785565", "0.63284814", "0.6318603", "0.6300...
0.8979407
0
Update vm password in database
def reset_password(password) self.termpassword = password save end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_with_password(params, *options); end", "def change_password!(password)\n json = JSON.generate(:changePassword => { :adminPass => password })\n @compute.connection.req('POST', \"/servers/#{@id}/action\", :data => json)\n @adminPass = password\n end", "def update_password(db, domain_...
[ "0.7468225", "0.71770406", "0.70611364", "0.6998914", "0.6960564", "0.6944289", "0.69370294", "0.6926446", "0.6925914", "0.69180924", "0.69103163", "0.6898243", "0.68887675", "0.6869665", "0.6865355", "0.6865355", "0.6865355", "0.6865355", "0.6865355", "0.6865355", "0.6865355...
0.0
-1
Update status field with time build And send alert mail to users
def setup_complete if status <= 1 project.users.each do |u| if u.is_recv_vms || u.id == user.id VmMailer.vm_ready(u, project, user, commit, uris, htlogin, htpassword).deliver end end end self.status = (Time.zone.now - created_at).to_i generate_hiera w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def status(build)\n @build = build\n\n mail to: @build.owner_email, subject: \"#{build.name} #{build.status_text}\"\n end", "def send_status_update(message, time = nil)\n @message = Message.new\n\t\t@message.name = \"Application Status Update Notification\"\n\t\t@message.email = current_user.email\n\t\...
[ "0.7405497", "0.7387928", "0.6747572", "0.6706075", "0.662003", "0.65701616", "0.65311134", "0.65159667", "0.64909166", "0.6481377", "0.6472811", "0.63705105", "0.6353241", "0.6345857", "0.63287497", "0.63271755", "0.6281095", "0.6269408", "0.62441427", "0.623196", "0.6195003...
0.6174768
22
Set uris by default with project endpoints
def init_defaulturis # init name if empty if !name || name.empty? self.name = vm_name save end project.endpoints.each do |endpoint| absolute = (endpoint.prefix.length > 0) ? "#{endpoint.prefix}-#{name}" : "#{name}" if !endpoint.aliases.nil? && !endpoint.aliases.empty? al...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setup_project_urls( project )\n # only run the setup once for the provided project\n return if @_project == project\n @_project = project\n # set up the base domain\n if project.domain =~ /^((https?):\\/\\/)?([^\\:\\s]+)(\\:(\\d+))?/\n default_url_options[:protocol] = $2 if $1\n defaul...
[ "0.74270946", "0.6754429", "0.6727134", "0.6684716", "0.66455644", "0.64958256", "0.6435384", "0.6426063", "0.64146256", "0.6379055", "0.6325653", "0.6307555", "0.63047636", "0.63047636", "0.63047636", "0.63047636", "0.62865365", "0.6285681", "0.62747914", "0.6266435", "0.626...
0.6507045
5
Get build time (=status if vm is running) builtime is > 0 if vm is running, else is negative
def buildtime return status if status != 0 ret = (Time.zone.now - created_at).to_i # more 10hours with setup status is equal to error status (ret > 36000) ? (1) : (-ret) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def building_time\n @process.instance_variable_get(:@building_time).total\n end", "def build_start_time\n @build_start_time ||= begin\n if !ENV['BUILD_ID'].nil?\n begin\n Time.strptime(ENV['BUILD_ID'], \"%Y-...
[ "0.6623859", "0.6370808", "0.62454075", "0.6114883", "0.609533", "0.6083362", "0.605875", "0.6025247", "0.5991985", "0.5919407", "0.5787032", "0.5755309", "0.57382905", "0.5652826", "0.55588984", "0.5551661", "0.5550961", "0.55459005", "0.55209327", "0.5508372", "0.5464664", ...
0.77153504
0
Create a new vm to openstack with current object attributes
def boot # Raise an exception if the limit of vms is reachable raise Exceptions::NextDeployException.new("Vms limit is reachable") if Vm.count > Rails.application.config.limit_vm osapi = Apiexternal::Osapi.new begin self.name = vm_name self.technos = project.technos if technos.size == 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_vm\n if new_resource.clone\n clone_vm\n else\n data = {\n vmid: vmid,\n bootdisk: 'virtio0',\n cores: INSTANCE_SIZE[new_resource.size]['cpu'],\n memory: INSTANCE_SIZE[new_resource.size]['memory'],\n ide2: \"#{new_resource.cdrom},media=cdrom\",\n numa: (new_resource....
[ "0.7621827", "0.7062082", "0.6893863", "0.6860964", "0.6851655", "0.6763876", "0.6691205", "0.66879505", "0.6583214", "0.65490264", "0.651497", "0.64416045", "0.64170206", "0.63718647", "0.6301508", "0.6259328", "0.61849695", "0.61481917", "0.61465067", "0.612853", "0.6127317...
0.60330987
34
Return unique vm title
def vm_name if !name || name.empty? "#{user.id}-#{project.name.gsub('.','-')}-#{Time.zone.now.to_i.to_s.sub(/^../,'')}".downcase else name end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def title\n (\"\\0\" * 256).tap do |buffer|\n WIN[:get_title].call(buffer, buffer.length - 1)\n end.gsub \"\\0\", ''\n end", "def title\n (\"\\0\" * 256).tap do |buffer|\n WIN[:get_title].call(buffer, buffer.length - 1)\n end.gsub \"\\0\", ''\n end", "def...
[ "0.68230337", "0.68230337", "0.6612193", "0.6584863", "0.6573118", "0.6573118", "0.6519286", "0.6515445", "0.6515445", "0.65076065", "0.6439144", "0.6428147", "0.6427116", "0.6426912", "0.6377119", "0.6371016", "0.6359949", "0.63515306", "0.63405323", "0.63335586", "0.6326452...
0.7420144
0
Stop and delete a vm from openstack
def delete_vm osapi = Apiexternal::Osapi.new begin osapi.delete_vm(nova_id) rescue Exceptions::NextDeployException => me me.log end # delete hiera and vcl files clear_vmfiles generate_host_all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy(state)\n return if state[:vm_name].nil?\n\n save_and_validate_parameters\n connect\n vm = get_vm(state[:vm_name])\n\n vm_obj = Com::Vmware::Vcenter::VM.new(vapi_config)\n\n # shut the machine down if it is running\n if vm.power_state.value == \"POWERED_O...
[ "0.7414247", "0.72898227", "0.72898227", "0.7137117", "0.7130386", "0.7090549", "0.70897174", "0.70459604", "0.70425755", "0.7035183", "0.7027739", "0.7020096", "0.6962756", "0.6955622", "0.6947169", "0.6921547", "0.690561", "0.6885412", "0.68850654", "0.68745285", "0.6865402...
0.7550669
0
We should override hashCode too, but it's not required and having issues with the result overflowing to a BigInteger
def equals(other) return false if not super(other) return self.opts == other.opts end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hash\n super ^ number.hash\n end", "def hash\n @hash ||= begin\n result = 17\n result = 31 * result + self.class.hash\n result = 31 * result + ord\n result.is_a?(Fixnum) ? result : result.hash\n end\n end", "def hash\n @hash ||= begin\n result = ...
[ "0.7007902", "0.6675113", "0.6675113", "0.66424304", "0.6583671", "0.65822285", "0.65381813", "0.65381813", "0.65381813", "0.65381813", "0.65381813", "0.65381813", "0.65381813", "0.65114015", "0.64500093", "0.6411715", "0.6382094", "0.6364326", "0.6341928", "0.6341928", "0.62...
0.0
-1
Attributes for delete forms
def delete_mentor_params params.require(:employee).permit(clients_attributes: %i[employee_id id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def link_to_remove_fields(name, f)\n f.hidden_field(:_destroy) + \"&nbsp;\".html_safe + ui_link_to_function('delete',name,\"remove_fields(this)\")\n end", "def link_to_remove_fields(name, f)\n f.hidden_field(:_destroy) + \"&nbsp;\".html_safe + ui_link_to_function('delete',name,\"remove_fields(this)\")\n ...
[ "0.6543749", "0.6543749", "0.6542211", "0.6525453", "0.6502401", "0.6476164", "0.64552134", "0.63878095", "0.6329462", "0.63124007", "0.63094413", "0.63094413", "0.6309233", "0.62706774", "0.62534285", "0.62482196", "0.6215694", "0.6202392", "0.6186824", "0.61696285", "0.6159...
0.0
-1
Loads info for creation/new pages
def info_for_forms #Info for page #Saving info if we are SA @is_super_admin = is_super? #Array of admins for SA @admins = User.admins_list(with_mentors: false) if @is_super_admin end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new_page_info\n args = Webby.site.args\n\n # TODO: maybe even get rid of this method altogether\n raise \"Usage: webby #{args.rake.first} 'path'\" if args.raw.empty?\n\n [args.page, args.title, args.dir]\n end", "def new\n @page = Page.new\n @pagelist = @club.all_pages\n \n ...
[ "0.69390076", "0.6697108", "0.66407204", "0.65204495", "0.6448637", "0.64452267", "0.63372386", "0.63283557", "0.63131267", "0.6281061", "0.62383235", "0.6223323", "0.62103945", "0.61785793", "0.6161154", "0.6156548", "0.6145693", "0.6145443", "0.6127531", "0.61090904", "0.60...
0.0
-1
Callback for checking existence of record
def check_exist_callback unless check_exist(params[:id], User) redirect_to show_path_resolver(current_user) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_record?(record)\n table.has_key?(lookup_key_for(record))\n end", "def exists?; end", "def exists?\n load!\n true\n rescue RecordNotFound\n false\n end", "def check_if_record_exists\n\tif MenuItem.exists?(:name =>self.name,:vendor_id=>self.vendor_id)\n\t\tputs\"This ...
[ "0.7434009", "0.7257726", "0.72577184", "0.72073436", "0.7200813", "0.7074304", "0.70382595", "0.7014897", "0.7008154", "0.69957596", "0.6981943", "0.694037", "0.69387025", "0.69296235", "0.69225156", "0.6903651", "0.687615", "0.6874707", "0.6861509", "0.68417776", "0.6835575...
0.6251862
79
Must be replaced for new organisation of options
def add_product(product_id) #current_item = line_items.where(product_id: product_id).first # if current_item # if (current_item.quantity == nil) # current_item.quantity = 0 # end # current_item.quantity = 1 # else # current_item = line_items.build(:product_id => product_id) #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_options; end", "def options() end", "def add_options; end", "def user_options; end", "def options(opt); end", "def options(opt); end", "def make_option_list\n end", "def make_option_list\n end", "def options(opt)\n end", "def option_type; end", "def options; end", "def options; e...
[ "0.8106137", "0.7942382", "0.7720382", "0.7634538", "0.75875336", "0.75855756", "0.7541408", "0.7541408", "0.75330746", "0.74997497", "0.7499096", "0.7499096", "0.7499096", "0.7499096", "0.7499096", "0.7499096", "0.7499096", "0.7499096", "0.7499096", "0.7499096", "0.7499096",...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_style @style = Style.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.6163754", "0.6045816", "0.5944853", "0.59169096", "0.58892167", "0.58342934", "0.5776148", "0.57057375", "0.57057375", "0.56534296", "0.56209534", "0.54244673", "0.54101455", "0.54101455", "0.54101455", "0.53951085", "0.5378493", "0.53563684", "0.53399915", "0.5338049", "0...
0.0
-1
Only allow a trusted parameter "white list" through.
def style_params params[:style] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.638045...
0.0
-1
Why must I rewrite the getter/setters?
def education_level=(value) write_attribute(:education_level, value) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getters; end", "def name\n return @name\nend\ndef age\n return @age\nend\n#setters, allows you to change or set something\ndef name=(name)\n @name = name\nend", "def setter_to_getter(node); end", "def attr_accessor_sybling(method)\n attr_reader?(method) ? to_attr_writer(method) : to_attr_reader...
[ "0.72383934", "0.70584476", "0.6521781", "0.62809986", "0.62651867", "0.6263856", "0.6201261", "0.6201261", "0.61953276", "0.61925906", "0.61731255", "0.613486", "0.61028075", "0.6066165", "0.59820944", "0.59607905", "0.59502554", "0.59407574", "0.5895028", "0.58705884", "0.5...
0.0
-1
attempts to get new dimensions for the current geometry string given these old dimensions.
def new_dimensions_for(orig_width, orig_height) new_width = orig_width new_height = orig_height case @flag when :percent scale_x = @width.zero? ? 100 : @width scale_y = @height.zero? ? @width : @height new_width = scale_x.to_f * (orig_width.to_f / 100.0) new_heig...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_dimensions_from_gm_geometry_string(arg)\n dimensions = {}\n return dimensions if arg.nil? or arg.empty?\n raise ArgumentError, \"argument is not a String\" unless arg.kind_of? String\n arg.match(GM_MATCHER) do |match|\n \n # grab parsed tokens\n requested_width ...
[ "0.57598215", "0.56968", "0.53580093", "0.53410894", "0.5263535", "0.52423966", "0.5242367", "0.521982", "0.50750923", "0.5036782", "0.49927014", "0.49593085", "0.492358", "0.49003926", "0.48645124", "0.4755297", "0.47549337", "0.47485587", "0.4717319", "0.47167656", "0.47153...
0.5539607
3
=> [0, 1, 1, 2, 3, 5, 8, 13, 21] recursive solution
def fibs_rec(i) return i if i <= 1 fibs_rec(i-2) + fibs_rec(i-1) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def recursive_solution\n\n end", "def factorials_rec(num)\n return [1] if num == 1\n return [] if num == 0\n prev_seq = factorials_rec(num-1)\n prev_seq << factorials(num)\n prev_seq\n\nend", "def recursive_terms(n)\n all_ns << n\n # if we get 1111\n # we have 1111 and should then get 211 and then 31 ...
[ "0.69069624", "0.68013775", "0.6785269", "0.6777965", "0.676532", "0.67435527", "0.67173034", "0.6681094", "0.6677036", "0.66253185", "0.66239643", "0.6610307", "0.6610276", "0.6609496", "0.65984184", "0.65861887", "0.65685976", "0.65638995", "0.6556631", "0.6517138", "0.6510...
0.0
-1
Author Mariam Ismail creates a new post and redirect to group/project path ARGS: post.content, post.group_id or post.project_id, post.is_group, post.user_id, post.username returns newly created post
def createPost @post = Post.new(params[:post]) @post.save if (@post.is_group == true) group_name = Group.find(@post.group_id).group_name @members = GroupUser.where(:group_id => @post.group_id) notification = Notification.create(:content=>"#{current_user.name} قام بنشر تعبير جديد بمج...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_post\n\t\tassignment_id = params[:assignment_id]\n\n\t\tassignment = Assignment.find(assignment_id)\n\t\tgroup_id = assignment.group_id\n\n\t\t\n\t\tpost = Post.create({\n\t\t\tcontent: params[:content],\n\t\t\tpublished_at: DateTime.now\n\t\t\t})\n\n\t\tassignment.posts << post\n\t\tassignment.save\n\n...
[ "0.6884324", "0.67535675", "0.664698", "0.664357", "0.66064173", "0.6549509", "0.65420634", "0.6531157", "0.6530911", "0.6500231", "0.6477236", "0.6464189", "0.64587504", "0.6444741", "0.6406453", "0.6398324", "0.6391937", "0.6388851", "0.63842994", "0.63841337", "0.6382402",...
0.69930744
0
Author Mariam Ismail deletes a post with its comments ARGS post_id returns nothing, deletes this post from the database
def destroyPost @group_id = params[:group_id] @post=Post.find(params[:post_id]) @post.comments.destroy_all @post.destroy if (@post.is_group == true) redirect_to(:controller => 'groups',:action => 'show', :id => params[:group_id]) else redirect_to(:controller =>'projects' ,:a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n\t\n\t\t#find the post in question\n\t\t@post = Post.find(params[:post_id])\n\t\t\n\t\t#locate the comment in question within the @post.comments collection\n\t\t@comment = @post.comments.find(params[:id])\n\t\t\n\t\t#remove comment from the database\n\t\t@comment.destroy\n\t\t\n\t\t#send user back to ...
[ "0.7665741", "0.7610636", "0.7605695", "0.7596376", "0.7510571", "0.7510571", "0.74970704", "0.74318707", "0.73999643", "0.731026", "0.72555465", "0.72530174", "0.72434944", "0.72160125", "0.71810246", "0.71758705", "0.71682155", "0.71584064", "0.71562237", "0.71524346", "0.7...
0.6597379
77
Use callbacks to share common setup or constraints between actions.
def find_user @user = User.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.6165094", "0.60450804", "0.5944413", "0.5915806", "0.58885634", "0.5835225", "0.5775847", "0.5700531", "0.5700531", "0.56543404", "0.56209993", "0.54238355", "0.5410386", "0.5410386", "0.5410386", "0.5394892", "0.5377769", "0.53559244", "0.5339896", "0.53388095", "0.533008...
0.0
-1
GET /topics GET /topics.json
def index if params[:topic_report] && params[:topic_report][:descending] == "false" @flag = true else @flag = false end @topic_report = TopicReport.new(params[:topic_report]) do |scope| if current_user.role.contributor? scope = scope.where(user_id: current_user.id) else scope = scope.w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list(options = {})\n body = options.has_key?(:query) ? options[:query] : {}\n\n response = @client.get \"/api/topics\", body, options\n\n return response\n end", "def all_topics\n topics = Feed.find(params[:feed_id]).topics\n render :json => topics\n end", "def get_topics\n...
[ "0.7767543", "0.77147746", "0.7671143", "0.7647962", "0.7647962", "0.760675", "0.75980437", "0.7460337", "0.7438048", "0.7438048", "0.7438048", "0.74189544", "0.73424435", "0.73084664", "0.7299537", "0.7273542", "0.7258947", "0.72557694", "0.72406065", "0.716417", "0.7159155"...
0.0
-1
GET /topics/1 GET /topics/1.json
def show @topic_locations = [] @all_locations = Location.joins(:topics).merge(Topic.published).to_gmaps4rails do |location, marker| marker.infowindow render_to_string(:partial => "/welcome/infowindow", :locals => { :topics => location.topics }) topic_belongs = false location.topics.each { |topic| to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetTopic id\n\n APICall(path: \"topics/#{id}.json\")\n\n end", "def get(*topics)\n # FIXME: implement this\n end", "def index\n @api_v1_topics = Api::V1::Topic.all\n end", "def show\n @topic = Topic.find(params[:id])\n render 'api/v1/topics/show'\n end", "def index\n @topi...
[ "0.7909809", "0.75292104", "0.7478317", "0.7475657", "0.73532486", "0.73532486", "0.73532486", "0.7337668", "0.7309439", "0.7309439", "0.7309439", "0.7309439", "0.72612584", "0.720829", "0.71966517", "0.718304", "0.71673316", "0.715215", "0.71505344", "0.71490216", "0.7118619...
0.0
-1
GET /topics/new GET /topics/new.json
def new @topic = Topic.new @topic.locations.build @topic.references.build respond_to do |format| format.html # new.html.erb format.json { render json: @topic } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "def new\n ...
[ "0.8178835", "0.814585", "0.8145038", "0.8145038", "0.8145038", "0.8145038", "0.8145038", "0.8027103", "0.80245805", "0.7718965", "0.7707659", "0.7646929", "0.76189756", "0.76167405", "0.7566753", "0.7532568", "0.75298107", "0.75165004", "0.74551016", "0.744887", "0.74332774"...
0.7507497
18
POST /topics POST /topics.json
def create @topic = Topic.new(params[:topic]) @topic.published = !(current_user.role.contributor?) @topic.user_id = current_user.id respond_to do |format| if @topic.save if params[:avatar] && params[:avatar][:avatar_img] @avatar = Avatar.create(:avatar_img => params[:avatar][:avatar_img], :to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CreateTopic params = {}\n \n APICall(path: 'topics.json',method: 'POST',payload: params.to_json)\n \n end", "def create\n @topic = current_user.topics.build(params[:topic])\n\n respond_to do |format|\n if @topic.save\n format.html { redirect_to @topic, notice: 'Top...
[ "0.76473415", "0.72208685", "0.7146817", "0.71042895", "0.6926286", "0.6912003", "0.6908543", "0.6899907", "0.6871648", "0.68515193", "0.6849926", "0.6835052", "0.6835052", "0.68130845", "0.679384", "0.6793603", "0.67922163", "0.6785243", "0.67566055", "0.6733644", "0.6729780...
0.60553914
99
PUT /topics/1 PUT /topics/1.json
def update input_locs = params[:topic][:locations_attributes].map{|x| x[:address]} unless params[:topic][:locations_attributes].nil? @topic = Topic.find(params[:id]) if input_locs @topic.locations.each do |l| if !input_locs.include?(l.address) l.delete end end end respond_to d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def UpdateTopic id,params = {}\n \n APICall(path: \"topics/#{id}.json\",method: 'PUT',payload: params.to_json)\n \n end", "def update\n topic = Topic.find(params[:id])\n if topic.update(params_topic)\n render json: topic, status: 200\n else\n render json...
[ "0.7648897", "0.74794006", "0.7388424", "0.7286184", "0.71849126", "0.7136357", "0.7123358", "0.7049051", "0.6927672", "0.69265693", "0.69265693", "0.69265693", "0.69265693", "0.69265693", "0.6921302", "0.69190764", "0.68668187", "0.68652874", "0.68580204", "0.684068", "0.680...
0.0
-1
DELETE /topics/1 DELETE /topics/1.json
def destroy @topic = Topic.find(params[:id]) @topic.locations.delete_all @topic.references.delete_all @topic.destroy respond_to do |format| format.html { redirect_to topics_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DeleteTopic id\n \n APICall(path: \"topics/#{id}.json\",method: 'DELETE')\n \n end", "def destroy\n @api_v1_topic.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_topics_url, notice: 'Topic was successfully destroyed.' }\n format.json { head :no_co...
[ "0.80882245", "0.77483875", "0.7718711", "0.7695118", "0.76939", "0.767325", "0.7624342", "0.76194614", "0.7606265", "0.7606265", "0.7606265", "0.7606265", "0.7606265", "0.7606265", "0.75579107", "0.7512912", "0.75068605", "0.75068605", "0.7487019", "0.74806774", "0.74514246"...
0.7463199
20
put into board class!
def remove!(jumped_pos) board[jumped_pos] = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def board\n end", "def board\n\n end", "def initialize board\n @board = board\n end", "def get_board()\n raise 'needs implementation'\n end", "def board\n game.board\n end", "def board; @board ||= match.board; end", "def board\r\r\n @board = true\r\r\n end", "def setup_board...
[ "0.8250092", "0.8114523", "0.7312298", "0.71932954", "0.71368414", "0.7094068", "0.7036181", "0.7023936", "0.69902354", "0.698453", "0.69620466", "0.6961889", "0.6961889", "0.6953389", "0.69518256", "0.6940953", "0.6928098", "0.69021827", "0.68978125", "0.6880602", "0.68772",...
0.0
-1
TODO: create a module to be mixed into model to perform same operation event.rb has same functionality which can be shared TODO: rename guid to UUID as guid is specifically Microsoft term
def generate_guid loop do @guid = SecureRandom.urlsafe_base64 break if !Venue.where(guid: guid).any? end self.guid = @guid end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qualified_event; end", "def qualified_event; end", "def create_events\n end", "def event_context\n {\n service: service,\n category: category,\n name: name,\n data: data,\n timestamp: Time.now.utc,\n uuid: SecureRandom.uuid\n ...
[ "0.622855", "0.622855", "0.6218898", "0.6206467", "0.61406505", "0.60449463", "0.6038013", "0.5855677", "0.5855677", "0.5855677", "0.58441514", "0.58333623", "0.5825772", "0.57527757", "0.5752384", "0.5737865", "0.5706493", "0.5706493", "0.5706493", "0.5706493", "0.5706493", ...
0.0
-1
The confirmation email, uses default right now
def confirm_email(user) @user = user @confirm_url = "http://www.yscalumni.org/confirm/" + user.confirmation_code mail(:to => user.email, :subject => "Welcome to yscalumni.org! Please confirm your email!") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_confirm\n end", "def send_confirm_email\n settings.fetch('send_mail',{}).fetch('confirm_email', true)\n end", "def confirm!\n welcome_email\n super\n end", "def confirm_email(confirmation)\n @confirmation = confirmation\n @account = confirmation.account\n \n mail :to => conf...
[ "0.78978854", "0.77205646", "0.76564693", "0.74671316", "0.7462944", "0.73517406", "0.73385835", "0.7337826", "0.7303693", "0.72967494", "0.7293692", "0.725834", "0.7232802", "0.71953356", "0.7190753", "0.7188749", "0.7106455", "0.7090494", "0.709034", "0.7075851", "0.7068204...
0.7143171
16
Anonymously send the alum the specified email
def send_to_alum(email) @email = email mail(:from => email.user_email, :to => email.alum_email, :subject => email.subject) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_email(email)\n email.deliver_now\n end", "def first_round_email(email)\n @greeting = \"Hi\"\n\n mail to: email, subject: \"Your ASES Application Decision\"\n end", "def issued\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "def spam\n @greeting = \"Hi\"\n\n ...
[ "0.7011999", "0.6946661", "0.680594", "0.66581225", "0.6632491", "0.66314685", "0.6609466", "0.6603575", "0.65875053", "0.6586981", "0.65866727", "0.6565615", "0.6543817", "0.6542818", "0.65373945", "0.6512475", "0.6463138", "0.64514875", "0.6450778", "0.6428915", "0.64277357...
0.758844
0
Notify the user that the email has been successfully sent
def send_to_user(email) @email = email mail(:to => email.user_email, :subject => 'Your email has been sent!') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def email_sent(to)\n puts green(\"Notification sent to: #{to}\")\n end", "def send_email\n # Send the email\n ResetPasswordMailer.with(user: @user)\n .reset_password.deliver_later\n\n # Notify the user that the email was sent\n flash[:success] = I...
[ "0.75953937", "0.75051945", "0.74581456", "0.7340183", "0.7320285", "0.7314747", "0.72476864", "0.7193359", "0.7179426", "0.71638304", "0.71589875", "0.71466583", "0.7138182", "0.71268237", "0.7125821", "0.7122055", "0.71089935", "0.7104209", "0.70929986", "0.70926636", "0.70...
0.6864385
51
Runs the XPath for the method name against the underlying XML DOM, returning nil if no element or attribute matching the method name is found in the children of the current location in the DOM.
def find_matches method_name matches = xpath method_name.as_xpath matches.any? ? matches : nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_missing(meth, *args, &block) # :nodoc:\n xpath = _xpath_for_element(meth.to_s, args.shift)\n return nil if xpath.empty?\n\n if block_given?\n xpath.each_with_index do |node, idx|\n @nodes.push(node)\n case block.arity\n when 1\n yield idx\n ...
[ "0.6035074", "0.59786314", "0.59786314", "0.5912553", "0.5912553", "0.58399916", "0.58073413", "0.58073413", "0.56360024", "0.5598863", "0.5552835", "0.55050915", "0.5452791", "0.5414395", "0.5391794", "0.53837645", "0.53492904", "0.53215677", "0.5311824", "0.5287799", "0.521...
0.7012691
0
Determines whether the given element contains any child elements or not. The choice of implementation is based on performance tests between using XPath and a Ruby iterator.
def has_children? @nokogiri.children.any? {|child| child.kind_of? Nokogiri::XML::Element } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_child_nodes()\n if @child_nodes.first_child.nil? then\n return false\n else\n return true\n end\n end", "def has_elements?(xpath_str)\n if NOKOGIRI\n element = @xml.xpath(xpath_str.to_s.upcase)\n return element != nil &&...
[ "0.6951226", "0.67996055", "0.67892426", "0.6678198", "0.6665581", "0.6460649", "0.6421758", "0.64098686", "0.6396094", "0.63650125", "0.63542", "0.63401216", "0.63279605", "0.631454", "0.6299777", "0.6293035", "0.6264532", "0.6257573", "0.62371206", "0.6235242", "0.62332076"...
0.7216675
0
The pretty_print method is from
def pretty_print(node = @root_node, prefix = '', is_left = true) pretty_print(node.right_node, "#{prefix}#{is_left ? '│ ' : ' '}", false) if node.right_node puts "#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}" pretty_print(node.left_node, "#{prefix}#{is_left ? ' ' : '│ '}", true) if node.left_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pretty \n @pretty = true \n end", "def pretty \n @pretty = true \n end", "def to_s\r\n pretty_output\r\n end", "def pretty_print\n puts `ruby -r pp -e 'pp(#{@template.inspect})'`\n end", "def pretty(object)\n PP.pp(object, out)\n end", "def to_pre...
[ "0.7847036", "0.7847036", "0.7725775", "0.7706416", "0.7648427", "0.7638032", "0.75686437", "0.74806213", "0.74723876", "0.7410893", "0.7405803", "0.7405803", "0.7403563", "0.7403563", "0.73841584", "0.7354977", "0.73519194", "0.73519194", "0.73508173", "0.7337094", "0.732715...
0.0
-1
`Node` instances are special because they contain an array of children, not a list of key/value pairs.
def visit_RootNode(node) node.each_child do |child| visit(child) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def children=(node_or_tags); end", "def children=(node_or_tags); end", "def children\n @children ||= {}.with_indifferent_access\n end", "def process_child_nodes(node); end", "def children\n node.children\n end", "def children\n @children ||= begin\n nodes =\n if comme...
[ "0.7120483", "0.7120483", "0.6753432", "0.6701413", "0.6656063", "0.6642022", "0.6342997", "0.6324439", "0.6301502", "0.6301502", "0.6285443", "0.62422454", "0.62321675", "0.6221374", "0.6213345", "0.6211512", "0.6211512", "0.61871624", "0.6134547", "0.6134547", "0.61149657",...
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_person @person = Person.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.6165094", "0.60450804", "0.5944413", "0.5915806", "0.58885634", "0.5835225", "0.5775847", "0.5700531", "0.5700531", "0.56543404", "0.56209993", "0.54238355", "0.5410386", "0.5410386", "0.5410386", "0.5394892", "0.5377769", "0.53559244", "0.5339896", "0.53388095", "0.533008...
0.0
-1
Only allow a trusted parameter "white list" through.
def person_params params.require(:person).permit(:first_name, :last_name, :dob, :job, :organisation) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", ...
[ "0.71207976", "0.705222", "0.69488335", "0.69021654", "0.67362636", "0.6717561", "0.6689192", "0.6678948", "0.66622657", "0.6555007", "0.6527569", "0.64588845", "0.64522904", "0.6450812", "0.6448551", "0.6434285", "0.6412147", "0.6412147", "0.6393719", "0.6381976", "0.6381976...
0.0
-1
Returns string to voice with values interpolated from object instances
def speak object_instance = object_instances.last Liquid::Template.parse(text_to_voice).render(object_instance.try(:attributes)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Voice.V1.CountryInstance #{values}>\"\n end", "def to_s\n '#<Twilio::REST::Voice>'\n end", "def to_s\n '<Twilio::REST::Voice::V1>';\n ...
[ "0.59879065", "0.5872255", "0.5866503", "0.5833698", "0.5791323", "0.5754606", "0.5754606", "0.5754606", "0.5754606", "0.5754606", "0.5754606", "0.5737711", "0.57177794", "0.5684388", "0.56806517", "0.566999", "0.5668987", "0.56670266", "0.5599935", "0.5594152", "0.55869913",...
0.690059
0
Fetches object instances with given query scope for the object.
def object_instances return [] if object_definition.blank? latest_version = ::AP::VoiceExtension::Voice::Config.instance.latest_version klazz = "::#{latest_version.upcase}::#{object_definition.name}".constantize query_scope = object_definition.query_scope objects = klazz.respond_to?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_objects\n @objects = scope.all\n instance_variable_set \"@#{object_name.pluralize}\", @objects\n end", "def get_objects(syncer, query, status)\n\t\traise \"getObjects: Not Implemented\"\n\t\t\n\t\t# object_list = []\n\t\t# #for each object that matches the query\n\t\t# # object = an active reco...
[ "0.61344486", "0.6101914", "0.60796064", "0.6052367", "0.59670556", "0.565791", "0.56232107", "0.5617018", "0.5606696", "0.55792904", "0.5553217", "0.5552302", "0.55431855", "0.5517119", "0.5508206", "0.55020344", "0.54801977", "0.5441075", "0.5421231", "0.5420459", "0.541792...
0.5633936
6
Create a URL for use with :emma_retrievalLink.
def make_retrieval_link(rid, base_url = nil) return if rid.blank? base_url = base_url[:base_url] if base_url.is_a?(Hash) base_url ||= Upload::BULK_BASE_URL # noinspection RubyMismatchedArgumentType File.join(base_url, 'download', rid).to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url\n Addressable::URI.new :scheme => 'http',\n :host => endpoint.host,\n :path => '/onca/xml',\n :query_values => parameters\n end", "def link() url; end", "def link() ...
[ "0.6670709", "0.6504965", "0.6504965", "0.64004844", "0.6390393", "0.63268036", "0.62425655", "0.6198791", "0.61853355", "0.61606294", "0.6095478", "0.60950893", "0.60579175", "0.60550517", "0.6046715", "0.6038396", "0.60368127", "0.6000163", "0.59782344", "0.5976486", "0.597...
0.615835
10
Generate a record to express structured EMMA data.
def make_emma_record(data, **) Search::Record::MetadataRecord.new(data) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def emma_record(refresh: false)\n @emma_record = nil if refresh\n @emma_record ||= make_emma_record(emma_metadata(refresh: refresh))\n end", "def toDataMetaForm\n result = <<DATAMETAFORM_HEADER\n/*\n Backspace codes specified as standard ASCII:\n http://www.december.com/html/spec/as...
[ "0.66880035", "0.6079023", "0.5989811", "0.59178793", "0.56400204", "0.5619362", "0.5498415", "0.549494", "0.5463227", "0.5404541", "0.5395902", "0.5357822", "0.53274786", "0.53274786", "0.52279526", "0.5206807", "0.5191779", "0.51706886", "0.51264083", "0.51264083", "0.51264...
0.7166015
0
Present :emma_data as a structured object (if it is present).
def emma_record(refresh: false) @emma_record = nil if refresh @emma_record ||= make_emma_record(emma_metadata(refresh: refresh)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modify_emma_data(data, allow_blank = true)\n if (new_metadata = parse_emma_data(data, allow_blank)).present?\n @emma_record = nil # Force regeneration.\n @emma_metadata = emma_metadata.merge(new_metadata)\n self[:emma_data] = @emma_metadata.to_json\n end\n self[:emma_d...
[ "0.6797445", "0.67475194", "0.673655", "0.60779977", "0.59149015", "0.58046633", "0.5790633", "0.5627056", "0.54253083", "0.53243273", "0.52533853", "0.52349675", "0.5225868", "0.5210263", "0.52025336", "0.52002335", "0.5194952", "0.5183064", "0.51700395", "0.5169664", "0.513...
0.5670971
7
Set the :emma_data field value (if not EMMA_DATA_HASH).
def set_emma_data(data, allow_blank = true) @emma_record = nil # Force regeneration. @emma_metadata = parse_emma_data(data, allow_blank) self[:emma_data] = case data when nil then data when String then data.dup else @emma_metadata.to_json ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modify_emma_data(data, allow_blank = true)\n if (new_metadata = parse_emma_data(data, allow_blank)).present?\n @emma_record = nil # Force regeneration.\n @emma_metadata = emma_metadata.merge(new_metadata)\n self[:emma_data] = @emma_metadata.to_json\n end\n self[:emma_d...
[ "0.72806334", "0.60075486", "0.57861954", "0.5731953", "0.5720053", "0.56311953", "0.56196046", "0.56042784", "0.55438393", "0.55420756", "0.54287225", "0.5408615", "0.53870136", "0.5358431", "0.52768415", "0.52218777", "0.52128357", "0.51846254", "0.5162104", "0.51618826", "...
0.7775212
0
Selectively modify the :emma_data field value (if not EMMA_DATA_HASH).
def modify_emma_data(data, allow_blank = true) if (new_metadata = parse_emma_data(data, allow_blank)).present? @emma_record = nil # Force regeneration. @emma_metadata = emma_metadata.merge(new_metadata) self[:emma_data] = @emma_metadata.to_json end self[:emma_data] en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_emma_data(data, allow_blank = true)\n @emma_record = nil # Force regeneration.\n @emma_metadata = parse_emma_data(data, allow_blank)\n self[:emma_data] =\n case data\n when nil then data\n when String then data.dup\n else @emma_metadata....
[ "0.7614208", "0.60764796", "0.56453574", "0.55162555", "0.52784616", "0.52227974", "0.52141166", "0.5172968", "0.5118628", "0.50924313", "0.5084392", "0.50777507", "0.506784", "0.5019831", "0.49511096", "0.4930951", "0.49289998", "0.49251816", "0.4915108", "0.48998126", "0.48...
0.8005791
0
GET /designs/:id/edit GET /designer/:id in routes.rb
def edit @design = Design.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edit\n @design_method = DesignMethod.find(params[:id])\n end", "def show\n @designer = Designer.find(params[:id])\n end", "def set_designer\n @designer = Designer.find(params[:id])\n end", "def update\n @designer = Designer.find(params[:id])\n\n respond_to do |format|\n if @des...
[ "0.73595726", "0.7221241", "0.7062516", "0.7052766", "0.6873676", "0.68171054", "0.6802339", "0.6787328", "0.6787328", "0.67052925", "0.6640227", "0.65226924", "0.65207845", "0.6476066", "0.6368515", "0.6366101", "0.6322947", "0.62144935", "0.6128493", "0.612557", "0.6116151"...
0.78984594
0
update client called when receiving any request
def update_connection connection # XXX why do we update the UUID here? this should never have an effect. @uuid = connection.request.path_info.match(UUID_PATTERN)[0] @body_content = nil @body_buffer = connection.request.body.read @environment = { :api_key => connec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateClients request\n @clients.each do |client|\n unless client == @lastClient\n client.socket.write request\n end\n end\n end", "def update_client\n\t\tif(request.method == \"OPTIONS\")\n\t\t\trespond({status: 0})\n\t\telsif request.method == \"POST\"\n\t\t\trespond(upd...
[ "0.7277293", "0.7199868", "0.71784544", "0.6861663", "0.67479473", "0.67479473", "0.66633576", "0.6576569", "0.655026", "0.6520174", "0.6420146", "0.64071226", "0.6406854", "0.63673556", "0.6366538", "0.63558954", "0.6354048", "0.62910074", "0.628525", "0.62151194", "0.621350...
0.0
-1
parse json data (environment data or payload)
def parse_body begin @body_content || JSON.parse( @body_buffer ) rescue => e @error = e.message false end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_data data\n JSON.parse(data.body)\n end", "def parse_payload(json)\n JSON.parse(json)\n end", "def parseJSON(data)\n return JSON.parse data.body.read\nend", "def parse_data(data)\n # Prevent abortive empty JSON.parse error\n data = '{}' if data.blank?\n\n return ...
[ "0.73930407", "0.71152824", "0.66933286", "0.6579408", "0.65078497", "0.65078497", "0.6282382", "0.6270007", "0.61941916", "0.617565", "0.6114019", "0.6079447", "0.6079172", "0.6022793", "0.6004888", "0.60018045", "0.599361", "0.59886616", "0.5969619", "0.59558475", "0.595381...
0.0
-1
pass request for client info to grouper
def info &block em_get( "/clients/#{uuid}" ) { |response| block.call( response ) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_group_client\n @group_client = GroupClient.find(params[:id])\n end", "def group_request (v1_requests_params)\n req = Request.find(v1_requests_params[:id])\n @group = Group.where(id: v1_requests_params[:group_id]).first\n user = User.find(req.reciever_id)\n ...
[ "0.60779107", "0.6020882", "0.58885455", "0.5788466", "0.5787276", "0.57705563", "0.57213", "0.57175505", "0.5702662", "0.5644961", "0.5635804", "0.5623435", "0.5598422", "0.5597992", "0.557552", "0.557552", "0.55458146", "0.553315", "0.55309623", "0.55291057", "0.5516378", ...
0.5493125
26
pass request for public key to grouper
def publickey hashid, &block em_get( "/clients/#{uuid}/#{hashid}/publickey" ) { |response| block.call( response ) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def public_key_params\n params[:public_key]\n end", "def public_key_params\n params[:public_key]\n end", "def public_key; end", "def public_key; end", "def public_key; end", "def public_key=(_); end", "def public_key=(_); end", "def public_key=(k)\n return self.authentication.p...
[ "0.7109398", "0.7109398", "0.70773166", "0.70773166", "0.70773166", "0.6922089", "0.6922089", "0.66422963", "0.66422963", "0.6628926", "0.6628926", "0.65735966", "0.6526484", "0.64622086", "0.6315445", "0.630875", "0.6306641", "0.629127", "0.6268868", "0.62673455", "0.6264059...
0.6314745
15
set environmente data for client
def update_environment &block # get environment data from request body # if data could not be parsed, return with error parsed_environment = parse_body unless parsed_environment block.call( { :status => 400 } ) return end @environment.merge!( parsed_environment ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def env=(environment); end", "def env=(environment); end", "def set_client_data\n @client_data = { controller: controller_name, action: action_name }\n end", "def set_remote_env(env); end", "def environment=(env)\n @environment = env\n end", "def default_environment=(env); end", "def set_env(pa...
[ "0.7142202", "0.7142202", "0.69436", "0.6635679", "0.6492667", "0.6362095", "0.63005686", "0.6269027", "0.62597096", "0.6245454", "0.6191451", "0.6139601", "0.6132392", "0.6110725", "0.61101013", "0.6102491", "0.6098054", "0.6096504", "0.6076724", "0.60679084", "0.60644716", ...
0.61050874
15
update the worldmap called after every environment update
def update_worldmap if data = (@environment["gps"] || @environment["network"]) worldmap_request "PUT", "/hoc", data.to_json end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_world\n update_fish\n update_eggs\n update_food\n update_bubbles\n end", "def reset_worldmap_position\n @modified_worldmap_position = nil\n end", "def update\n @creatures.each { |c| c.update(@map) }\n end", "def update\n @maps.values.each(&:update)\n @playe...
[ "0.70034784", "0.6654683", "0.6596897", "0.656989", "0.6355553", "0.6321088", "0.6273989", "0.6252732", "0.62490386", "0.61970353", "0.6195125", "0.6189703", "0.61656225", "0.61173576", "0.6099106", "0.60689795", "0.60531676", "0.60490894", "0.60409725", "0.603285", "0.594563...
0.77419746
0
log action in database called when an action terminates
def log_action action_name, api_key EM.next_tick do $db ||= EM::Mongo::Connection.new.db( Hoccer.config["database"] ) collection = $db.collection('api_stats') doc = { :api_key => api_key, :action => action_name, :timestamp => Time.now ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_action(action, user, record, model)\n begin\n # Create a new ActionLog Object\n event = ActionLog.new()\n \n # Add the user to this object\n event.user = user\n \n # Add the action to this object\n event.action = action\n \n # Save the model type and its...
[ "0.6437145", "0.6081735", "0.60781574", "0.6063857", "0.60413104", "0.5956071", "0.5922276", "0.5900542", "0.58721876", "0.580593", "0.5721341", "0.57121664", "0.56977654", "0.56966853", "0.56822526", "0.56638306", "0.56451344", "0.56130934", "0.5594109", "0.5585895", "0.5562...
0.59892833
5
whether waiting has been set for the current request
def waiting? @waiting end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def waiting?\n @waiting.set?\n end", "def waiting?\n @waiting\n end", "def waiting? #:nodoc:\n false|@waiting\n end", "def waiting?\n @status[:description] == :wait\n end", "def update_wait?\r\n # If waiting\r\n if @wait_count > 0\r\n # Reduce wait count\r\n ...
[ "0.8751111", "0.8530901", "0.83906114", "0.82712877", "0.7872588", "0.784389", "0.78112155", "0.7774951", "0.7762506", "0.7762506", "0.76381046", "0.737437", "0.7296239", "0.7292388", "0.72390634", "0.71506554", "0.7091824", "0.70822513", "0.7006991", "0.70020896", "0.6974571...
0.8645576
1
get the client's current group from the grouper before executing the block
def async_group &block em_get( "/clients/#{uuid}/group") do |response| group = Group.new( response[:content] ) block.call( group ) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def async_selected_group &block\n em_get(\"/clients/#{uuid}/selected_group\") do |response|\n group = Group.new( response[:content] )\n block.call( group )\n end\n end", "def grouped hash = nil, &block\n @grouped = block\n @current_group_hash = hash\n\n # ...
[ "0.72387487", "0.71354514", "0.71054685", "0.70125103", "0.68493766", "0.6791873", "0.67613477", "0.67613477", "0.6600295", "0.6570457", "0.65527385", "0.6427326", "0.641214", "0.6386336", "0.636958", "0.635192", "0.63353926", "0.6334625", "0.63084996", "0.62738395", "0.62383...
0.7173121
1
get the client's current selected group from the grouper before executing the block
def async_selected_group &block em_get("/clients/#{uuid}/selected_group") do |response| group = Group.new( response[:content] ) block.call( group ) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def current_group\n end", "def group; Group.get(self.group_id); end", "def async_group &block\n em_get( \"/clients/#{uuid}/group\") do |response|\n group = Group.new( response[:content] )\n block.call( group )\n end\n end", "def grouped hash = nil, &block\n @grouped ...
[ "0.6930948", "0.6810726", "0.6754393", "0.6586488", "0.6546835", "0.6546835", "0.64865", "0.64497536", "0.64081585", "0.63709724", "0.637097", "0.62216073", "0.619944", "0.6174549", "0.6164849", "0.60922974", "0.609201", "0.6086277", "0.6016718", "0.6016478", "0.6015071", "...
0.80159724
0
perform action name: onetoone or onetomany role: sender or receiver
def add_action name, role, waiting = false @waiting = waiting @action = Action.create( :name => name, :role => role, :payload => parse_body, :waiting => waiting?, :uuid => uuid, :api_key => environment[:api_key] ) # get the client'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute actor, target=[nil]\n def himher thing\n multiple = thing.count > 1 \n\n if multiple \n return \"them\"\n end\n\n case thing[0]\n when Player then \"him\"\n when ItemFacade then \"it\"\n else \"\"\n end\n end\n room_msg, self_msg, vict_msg = ...
[ "0.59106994", "0.58564323", "0.5817629", "0.57861525", "0.5758022", "0.57551146", "0.5734318", "0.573153", "0.5730703", "0.57130265", "0.5660248", "0.5638956", "0.5628739", "0.56093323", "0.5593256", "0.55747336", "0.55135274", "0.54963857", "0.5489817", "0.5478047", "0.54717...
0.50821155
94
terminate the client's current action called when the action's response is set
def update unless @action.nil? log_action( action.name, @environment[:api_key] ) @success.call( action ) if @success && @action @action = nil; end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def halt\n throw :halt, response\n end", "def terminate\n\t\tself.request( :terminate )\n\tend", "def event_terminate \n ScriptActionHandler::HandlerResult::terminate\n end", "def cancel\r\n # @todo Emit a warning for attempts to cancel an action after it's been\r\n # executed\r\n...
[ "0.6829154", "0.67822313", "0.6552207", "0.6518898", "0.6297593", "0.62582684", "0.6158408", "0.6153589", "0.61338353", "0.6093875", "0.60925406", "0.60427594", "0.6024283", "0.6018722", "0.5993383", "0.5993383", "0.59901536", "0.5945399", "0.59401476", "0.5931858", "0.591712...
0.0
-1
get information about current group (peek request)
def grouped hash = nil, &block @grouped = block @current_group_hash = hash # get current group from grouper and set response (unless the group hash is unchanged) async_group { |group| update_grouped( group ) } # wait for another client to update the group with an environm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_group\n send_request(FUNCTION_GET_GROUP, [], '', 4, 'k4')\n end", "def current_group\n end", "def group_info\n group_id_param = params[:group_id]\n\n if group_id_param.nil? || group_id_param.blank?\n render json: { error: 'group_id not specified.' }, status: :bad_request\n re...
[ "0.75371087", "0.7346642", "0.7346061", "0.71528196", "0.7142809", "0.71342444", "0.70719653", "0.69690585", "0.69403476", "0.69403476", "0.69294", "0.68275154", "0.6775477", "0.6763373", "0.67527694", "0.6737502", "0.6719487", "0.6702696", "0.668351", "0.6670446", "0.6655351...
0.0
-1
update group info for client (set response to / terminate peek request) called when the client peeks or a client in the same group updates its environment / signs off
def update_grouped group, forced = false # get sorted list of clients in group and calculate hash group_array = group.client_infos( uuid ) sorted_group = group_array.sort { |m,n| m[:id] <=> n[:id] } md5 = Digest::MD5.hexdigest( sorted_group.to_json ) # if group has changed or the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_environment &block\n\n # get environment data from request body\n # if data could not be parsed, return with error\n\n parsed_environment = parse_body\n\n unless parsed_environment\n block.call( { :status => 400 } )\n return\n end\n\n @environment.merge!( pa...
[ "0.65677696", "0.6365269", "0.61274666", "0.57510954", "0.56336665", "0.54754174", "0.54294044", "0.5425783", "0.5424261", "0.5393937", "0.5353899", "0.5311104", "0.5285245", "0.52803254", "0.52709883", "0.52507854", "0.52456754", "0.5238078", "0.52310264", "0.5228548", "0.51...
0.7184187
0
Taken from vagrantrackspace, added identity check This method finds a matching _thing_ in a collection of _things_. This works matching if the `name` is equal to an object, ID or NAME in the collection. Or, if `name` is a regexp, a partial match is chosen as well.
def find_matching(collection, name, primary_key = :id) # Handle identity - so you can pass object, object_name return name if collection.include? name collection.each do |single| # It's usually id, but are other possibilities like device if single.respond_to? primary_key retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_matching(collection, name)\n item = collection.find do |single|\n single.id == name ||\n single.name == name ||\n (name.is_a?(Regexp) && name =~ single.name)\n end\n\n # If it is not present in collection, it might be a non-standard image/flavor\...
[ "0.74981916", "0.6970345", "0.6569863", "0.64287263", "0.6373753", "0.6237141", "0.6122638", "0.6109001", "0.6106473", "0.59427387", "0.59190196", "0.5828056", "0.57684803", "0.5765951", "0.56936246", "0.5636345", "0.56349397", "0.56040084", "0.559959", "0.55745775", "0.55722...
0.7198845
1
GET /bicepstriceps2s GET /bicepstriceps2s.json
def index @bicepstriceps2s = Bicepstriceps2.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_bicepstriceps2\n @bicepstriceps2 = Bicepstriceps2.find(params[:id])\n end", "def create\n @bicepstriceps2 = Bicepstriceps2.new(bicepstriceps2_params)\n\n respond_to do |format|\n if @bicepstriceps2.save\n format.html { redirect_to @bicepstriceps2, notice: 'Bicepstriceps2 was suc...
[ "0.6419095", "0.6302647", "0.62523735", "0.6227939", "0.60817325", "0.57946396", "0.5691049", "0.5604524", "0.5515464", "0.5347418", "0.52686054", "0.5215903", "0.52123964", "0.52097887", "0.5201703", "0.5174745", "0.5157534", "0.51471716", "0.5101839", "0.509431", "0.5012304...
0.69286144
0
GET /bicepstriceps2s/1 GET /bicepstriceps2s/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @bicepstriceps2s = Bicepstriceps2.all\n end", "def set_bicepstriceps2\n @bicepstriceps2 = Bicepstriceps2.find(params[:id])\n end", "def create\n @bicepstriceps2 = Bicepstriceps2.new(bicepstriceps2_params)\n\n respond_to do |format|\n if @bicepstriceps2.save\n format.ht...
[ "0.68339264", "0.642721", "0.6169222", "0.6049716", "0.60064006", "0.59924936", "0.58785653", "0.5750464", "0.5631384", "0.5609597", "0.55817926", "0.5518713", "0.5493174", "0.5411394", "0.5402452", "0.535788", "0.52938426", "0.52899826", "0.52853465", "0.52794725", "0.526791...
0.0
-1
POST /bicepstriceps2s POST /bicepstriceps2s.json
def create @bicepstriceps2 = Bicepstriceps2.new(bicepstriceps2_params) respond_to do |format| if @bicepstriceps2.save format.html { redirect_to @bicepstriceps2, notice: 'Bicepstriceps2 was successfully created.' } format.json { render :show, status: :created, location: @bicepstriceps2 } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def bicepstriceps2_params\n params.require(:bicepstriceps2).permit(:exercise, :reps, :sets)\n end", "def create\n @bicepstricepshome2 = Bicepstricepshome2.new(bicepstricepshome2_params)\n\n respond_to do |format|\n if @bicepstricepshome2.save\n format.html { redirect_to @bicepstricepsho...
[ "0.62089324", "0.62053627", "0.61877483", "0.6173384", "0.6033241", "0.58646566", "0.5701503", "0.56732523", "0.532136", "0.53187877", "0.5289072", "0.5233239", "0.52234495", "0.52138704", "0.52005285", "0.5184179", "0.5146943", "0.50829124", "0.50668955", "0.50534886", "0.50...
0.73338103
0
PATCH/PUT /bicepstriceps2s/1 PATCH/PUT /bicepstriceps2s/1.json
def update respond_to do |format| if @bicepstriceps2.update(bicepstriceps2_params) format.html { redirect_to "/bicepstriceps2s"} format.json { render :show, status: :ok, location: @bicepstriceps2 } else format.html { render :edit } format.json { render json: @bicepstricep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @bicepstriceps1.update(bicepstriceps1_params)\n format.html { redirect_to \"/bicepstriceps1s\"}\n format.json { render :show, status: :ok, location: @bicepstriceps1 }\n else\n format.html { render :edit }\n format.json { render json:...
[ "0.6976642", "0.6399913", "0.6355502", "0.62413937", "0.6201899", "0.6131576", "0.6127122", "0.61167616", "0.6092024", "0.6089244", "0.6050791", "0.60482424", "0.6006125", "0.59964013", "0.5978827", "0.5978446", "0.59703237", "0.59668523", "0.5940294", "0.5930921", "0.5926515...
0.70431775
0
DELETE /bicepstriceps2s/1 DELETE /bicepstriceps2s/1.json
def destroy @bicepstriceps2.destroy respond_to do |format| format.html { redirect_to bicepstriceps2s_url, notice: 'Bicepstriceps2 was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @bicepstriceps1.destroy\n respond_to do |format|\n format.html { redirect_to bicepstriceps1s_url, notice: 'Bicepstriceps1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @bicepstricepshome2.destroy\n respond_to do |format|\n ...
[ "0.6934819", "0.6855779", "0.6655174", "0.66528195", "0.6648083", "0.6647453", "0.6614649", "0.6569009", "0.65670174", "0.6552479", "0.65518713", "0.6524094", "0.65235496", "0.651379", "0.64944947", "0.6491616", "0.64865303", "0.6461821", "0.6444039", "0.6441124", "0.64205074...
0.7013058
0
Use callbacks to share common setup or constraints between actions.
def set_bicepstriceps2 @bicepstriceps2 = Bicepstriceps2.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "def action_hook; end", "def run_actions; end", "def define_action_hook; end", "def actions; end", "def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_...
[ "0.6163163", "0.6045976", "0.5946146", "0.591683", "0.5890051", "0.58349305", "0.5776858", "0.5703237", "0.5703237", "0.5652805", "0.5621621", "0.54210985", "0.5411113", "0.5411113", "0.5411113", "0.5391541", "0.53794575", "0.5357573", "0.53402257", "0.53394014", "0.53321576"...
0.0
-1
Only allow a list of trusted parameters through.
def bicepstriceps2_params params.require(:bicepstriceps2).permit(:exercise, :reps, :sets) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def param_whitelist\n [:role, :title]\...
[ "0.69497335", "0.6812623", "0.6803639", "0.6795365", "0.67448795", "0.67399913", "0.6526815", "0.6518771", "0.64931697", "0.6430388", "0.6430388", "0.6430388", "0.63983387", "0.6356042", "0.63535863", "0.63464934", "0.63444513", "0.6337208", "0.6326454", "0.6326454", "0.63264...
0.0
-1
Waar de speler commando's invoert
def prompt() print "Geef commando > " end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_moola!\n # @todo\n end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def ingverb; end", "def waiver\n end", "def commands; end", "def whiny; end", "def suivre; end", "def what_is_ur_objective(sender_i...
[ "0.63425356", "0.6271883", "0.6271883", "0.6271883", "0.6271883", "0.6271883", "0.6271883", "0.612336", "0.6044019", "0.6013092", "0.6003009", "0.6001563", "0.5932648", "0.5867196", "0.5863434", "0.58131325", "0.5768202", "0.56969076", "0.569561", "0.5689339", "0.5684049", ...
0.0
-1
Geeft een lijst van commands bij het command help
def help() puts "Hier is een lijst handige commando's die je gaan helpen met je quest:" puts "ga (richting): Ga in de gespecificeerde richting" puts "open: open deuren, kisten, je hart, etc" puts "kijk: Krijg een beschrijving van de kamer waar je nu bent" puts "neem: Neem een item en stop het in je inventory" put...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def command_help\n display_possible_actions\n end", "def help\r\n end", "def help\r\n end", "def help\n end", "def help\n @@commands.each do |command| \n puts command[0]\n puts \" `#{command[1]}\"\n end \n end", "def help\n send_command \"--help\"\n end", "def do_help(...
[ "0.85337305", "0.82472265", "0.82472265", "0.82363355", "0.8203611", "0.8201906", "0.81931233", "0.81101906", "0.81101906", "0.81101906", "0.81101906", "0.81101906", "0.81101906", "0.81101906", "0.8090706", "0.80799305", "0.80799305", "0.80799305", "0.80664176", "0.80664176", ...
0.8103349
14
Maakt het scherm leeg
def clear require 'rbconfig' host_os = RbConfig::CONFIG['host_os'] case host_os when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ puts "hallo" system('cls') else puts('mac') system(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def schubert; end", "def zuruecksetzen()\n end", "def schumann; end", "def sichtbar_machen\n @sichtbar = true\n zeichnen()\n puts(self) \n end", "def suivre; end", "def sichtbar_machen()\n @dach.sichtbar_machen\n @gebaedekoerpe.sichtbar_machen\n @fenster.sichtbar_machen\n ...
[ "0.7558262", "0.755349", "0.7350158", "0.7004792", "0.6893013", "0.6810132", "0.67532676", "0.66636586", "0.660314", "0.6465136", "0.6449415", "0.6418752", "0.64096844", "0.6383942", "0.63324136", "0.6331207", "0.62541646", "0.6243445", "0.6184623", "0.61683273", "0.607276", ...
0.0
-1
Laat de speler's items zien
def inventory() puts "Je hebt de volgende items:" puts @inventory end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def item_titles\n legacy? ? items.pluck(:title) : ['Festlegung der Tagesordnung', 'Genehmigung von Protokollen'] + items.pluck(:title)\n end", "def get_items\r\n if(self.items.size > 0)\r\n x='items:'\r\n self.items.each_with_index {|val, index| x = x + \"\\n#{index}-#{val.get_name...
[ "0.63400733", "0.62039894", "0.6101544", "0.60308766", "0.60308766", "0.60308766", "0.60308766", "0.6005924", "0.5983045", "0.5870109", "0.5865145", "0.585333", "0.5803875", "0.5803875", "0.58037657", "0.58037657", "0.58037657", "0.58032566", "0.57969314", "0.577655", "0.5776...
0.0
-1
Dit zijn alle ruimte's in de dungeon
def schatkamer if @sleutel_aanwezig puts "Je bent in een kleine, ronde kamer" puts "Voor je, op de grond, staat een lege kist" puts "Wat ga je doen" elsif !@sleutel_aanwezig puts "Je bent in een kleine, ronde kamer" puts "Voor je staat een kleine, houten kist." puts "Hij lijkt niet op slot te zitten" pu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unsichtbar_machen\n @fuss.unsichtbar_machen\n @stiel.unsichtbar_machen\n @schirm.unsichtbar_machen\n @leuchtstrahl1.unsichtbar_machen\n @leuchtstrahl2.unsichtbar_machen\n @leuchtstrahl3.unsichtbar_machen\n @leuchtstrahl4.unsichtbar_machen\n end", "def battle\n # Runden auf 0 setzen, ...
[ "0.58988947", "0.5770669", "0.5755552", "0.57355595", "0.57328063", "0.5697198", "0.5650914", "0.56332624", "0.56328416", "0.5586319", "0.55683523", "0.55664", "0.553789", "0.55376047", "0.5534871", "0.55191576", "0.54937166", "0.5493114", "0.5483583", "0.54802185", "0.545974...
0.0
-1
Als de speler dood gaat, treedt deze functie in werking
def dood puts "Je bent dood. Was dat wat je net deed wel zo slim?" puts "Wil je het nog eens proberen?" while true prompt; volgende_zet = gets.chomp if volgende_zet == "ja" start() clear() elsif volgende_zet == "nee" Process.exit else puts "Ik snap niet wat je bedoelt. Gebruik het commando 'help' voor hulp." ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def suivre; end", "def zuruecksetzen()\n end", "def schubert; end", "def schumann; end", "def terpene; end", "def mi_carrera\n\n\tend", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def gounod; end", "def verdi; end", "def eplore\n end", "def probers; end"...
[ "0.7601139", "0.7374689", "0.6869135", "0.6831653", "0.6704841", "0.6472637", "0.6436437", "0.6436437", "0.6436437", "0.6436437", "0.6435567", "0.64101434", "0.63626814", "0.63130665", "0.6308598", "0.6304897", "0.6233152", "0.62193197", "0.61835676", "0.61800003", "0.6170969...
0.0
-1
Open a database with the given name and options.
def initialize(name, options = {}) @name = name @description = options[:description] || name @version = options[:version] || '' @size = options[:size] || 2 * 1024 * 1024 super(`window.openDatabase(#{name}, #{@version}, #{@description}, #{@size})`) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open(options)\n @db ||= options[:connection]\n return @db if @db\n\n if options[:path] && !File.exist?(options[:path])\n @db = SQLite3::Database.new(options[:path])\n setup\n end\n\n raise StoreException.new(\"Attempt to open missing database file #{options[:path]}\") unl...
[ "0.73484635", "0.72809124", "0.7253583", "0.7216239", "0.69539374", "0.6880862", "0.6854945", "0.681943", "0.68145776", "0.677149", "0.66617805", "0.66455877", "0.66225296", "0.6569418", "0.6567038", "0.6565997", "0.6558735", "0.6558735", "0.654058", "0.65261173", "0.65133387...
0.6283111
26
Start a transaction on the database.
def transaction(&block) raise ArgumentError, 'no block given' unless block `#@native.transaction(#{->(t) { block.call(Transaction.new(self, t)) }})` end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def start_transaction!\n fail DbMod::Exceptions::AlreadyInTransaction if @in_transaction\n @in_transaction = true\n\n query 'BEGIN'\n end", "def begin_db_transaction\n execute(\"BEGIN\")\n end", "def begin_db_transaction\n execute(\"BEGIN\")\n end", "def begi...
[ "0.84677124", "0.8168744", "0.8168744", "0.81293285", "0.8091472", "0.8032785", "0.7948239", "0.771435", "0.7562178", "0.7562178", "0.7472102", "0.7409595", "0.7397409", "0.7360718", "0.731309", "0.71922046", "0.71815395", "0.7167522", "0.7111012", "0.7097841", "0.70882386", ...
0.0
-1