text:
require('user_modules/script_runner').isTestApplicable({ { extendedPolicy = { "EXTERNAL_PROPRIETARY" } } })

--[[ Required Shared libraries ]]
local commonFunctions = require ('user_modules/shared_testcases/commonFunctions')
local commonSteps = require ('user_modules/shared_testcases/commonSteps')
local testCasesForPolicyTable = require ('user_modules/shared_testcases/testCasesForPolicyTable')
local commonPreconditions = require ('user_modules/shared_testcases/commonPreconditions')

--Heartbeat is supported after protocolversion 3
config.defaultProtocolVersion = 3

--[[ Local Variables ]]
local HBTime_max = 0
local HBTime_min = 0

--[[ General Precondition before ATF start ]]
commonSteps:DeleteLogsFileAndPolicyTable()
commonPreconditions:Connecttest_without_ExitBySDLDisconnect_WithoutOpenConnectionRegisterApp("connecttest_ConnectMobile.lua")
testCasesForPolicyTable:Precondition_updatePolicy_By_overwriting_preloaded_pt("files/ptu_heart_beat_timeout_ms_app_1234567.json")
commonPreconditions:BackupFile("smartDeviceLink.ini")
commonFunctions:write_parameter_to_smart_device_link_ini("HeartBeatTimeout", "7000")

--[[ General Settings for configuration ]]
Test = require('user_modules/connecttest_ConnectMobile')
require('cardinalities')
require('user_modules/AppTypes')
local mobile_session = require('mobile_session')
local events = require('events')
local constants = require('protocol_handler/ford_protocol_constants')

--[[ Local Functions ]]
local function DelayedExp(time)
  local event = events.Event()
  event.matches = function(self, e) return self == e end
  EXPECT_EVENT(event, "Delayed event")
  :Timeout(time+1000)
  RUN_AFTER(function()
      RAISE_EVENT(event, event)
      end, time)
end

function Test:Precondition_ConnectMobile_FirstLifeCycle()
  self:connectMobile()
end

function Test:Precondition_StartSession()
  self.mobileSession = mobile_session.MobileSession(self, self.mobileConnection)
  self.mobileSession.sendHeartbeatToSDL = false
  self.mobileSession.ignoreSDLHeartBeatACK = true
  self.mobileSession:StartRPC()
end

function Test:Precondition_Register_App_With_heart_beat_timeout_ms_Param()
  local correlationId = self.mobileSession:SendRPC("RegisterAppInterface", config.application1.registerAppInterfaceParams)
  EXPECT_HMINOTIFICATION("BasicCommunication.OnAppRegistered")
  :Do(function(_,data)
      self.HMIAppID = data.params.application.appID
    end)
  self.mobileSession:ExpectResponse(correlationId, { success = true, resultCode = "SUCCESS" })
  self.mobileSession:ExpectNotification("OnHMIStatus", {hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN"})
end

--[[ Test ]]
function Test:TestStep_Get_HeartBeat_Time()
  local time_prev = 0
  local time_now = 0

  local eventHB = events.Event()
  eventHB.level = 3
  eventHB.matches = function(_, data)
    return data.frameType == 0 and
    (data.serviceType == 0) and
    (data.frameInfo == 0) --HeartBeat
  end

  self.mobileSession:ExpectEvent(eventHB, "Heartbeat")
  :ValidIf(function()
       print("HeartBeat received in "..atf_logger.formated_time(true))
      self.mobileSession:Send(
        { frameType = constants.FRAME_TYPE.CONTROL_FRAME,
          serviceType = constants.SERVICE_TYPE.CONTROL,
          frameInfo = constants.FRAME_INFO.HEARTBEAT_ACK
        })
      if time_now ~= 0 then
        time_prev = time_now
        time_now = timestamp()
        local diff = time_now - time_prev

        if(HBTime_max == 0) then
          HBTime_max = diff
          HBTime_min = diff
        else
          if HBTime_max < diff then HBTime_max = diff end
          if HBTime_min > diff then HBTime_min = diff end
        end
      else
        time_now = timestamp()
      end
      return true

      end):Times(AnyNumber())
    DelayedExp(60000)

  end

function Test:TestStep_Check_HB_Time()
  if ( (HBTime_min < 3850) or (HBTime_max > 4200) ) then
    self:FailTestCase("Wrong HearBeat time! Expected: 4000ms, Actual: ["..HBTime_min.." ; "..HBTime_max.."]ms ")
  else
    print("HearBeat is in range ["..HBTime_min.." ; "..HBTime_max.."]ms ")
  end
end

--[[ Postconditions ]]
commonFunctions:newTestCasesGroup("Postconditions")
testCasesForPolicyTable:Restore_preloaded_pt()

function Test.Postcondition_Restore_INI_file()
  commonPreconditions:RestoreFile("smartDeviceLink.ini")
end

function Test.Postcondition_StopSDL()
  StopSDL()
end

return Test


text:
import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core";
import { NativeScriptRouterModule } from "@nativescript/angular";
import { NativeScriptCommonModule } from "@nativescript/angular";
import { LabelExamplesComponent } from "./label-examples.component";
import { LabelUsageComponent } from "./usage/usage.component";
import { TitleAndNavButtonModule } from "../../directives/title-and-nav-button.module";

export const routerConfig = [
    {
        path: "",
        component: LabelExamplesComponent
    },
    {
        path: "usage",
        component: LabelUsageComponent,
        data: { title: "Usage" }
    }
];

@NgModule({
    schemas: [NO_ERRORS_SCHEMA],
    imports: [
        TitleAndNavButtonModule,
        NativeScriptCommonModule,
        NativeScriptRouterModule,
        NativeScriptRouterModule.forChild(routerConfig)
    ],
    declarations: [
        LabelExamplesComponent,
        LabelUsageComponent
    ]
})

export class LabelExamplesModule {
    constructor() { }
}

redpajama_set_name: RedPajamaGithub


text:
#include "SkCodec.h"
#include "SkImageInfo.h"

#include "gif_lib.h"

/*
 *
 * This class implements the decoding for gif images
 *
 */
class SkGifCodec : public SkCodec {
public:

    /*
     * Checks the start of the stream to see if the image is a gif
     */
    static bool IsGif(SkStream*);

    /*
     * Assumes IsGif was called and returned true
     * Creates a gif decoder
     * Reads enough of the stream to determine the image format
     */
    static SkCodec* NewFromStream(SkStream*);

protected:

    /*
     * Read enough of the stream to initialize the SkGifCodec.
     * Returns a bool representing success or failure.
     *
     * @param codecOut
     * If it returned true, and codecOut was not NULL,
     * codecOut will be set to a new SkGifCodec.
     *
     * @param gifOut
     * If it returned true, and codecOut was NULL,
     * gifOut must be non-NULL and gifOut will be set to a new
     * GifFileType pointer.
     *
     * @param stream
     * Deleted on failure.
     * codecOut will take ownership of it in the case where we created a codec.
     * Ownership is unchanged when we returned a gifOut.
     *
     */
    static bool ReadHeader(SkStream* stream, SkCodec** codecOut, GifFileType** gifOut);

    /*
     * Initiates the gif decode
     */
    Result onGetPixels(const SkImageInfo&, void*, size_t, const Options&,
            SkPMColor*, int32_t*) override;

    SkEncodedFormat onGetEncodedFormat() const override {
        return kGIF_SkEncodedFormat;
    }

    bool onRewind() override;

private:

    /*
     * This function cleans up the gif object after the decode completes
     * It is used in a SkAutoTCallIProc template
     */
    static void CloseGif(GifFileType* gif);

    /*
     * Frees any extension data used in the decode
     * Used in a SkAutoTCallVProc
     */
    static void FreeExtension(SavedImage* image);

    /*
     * Creates an instance of the decoder
     * Called only by NewFromStream
     *
     * @param srcInfo contains the source width and height
     * @param stream the stream of image data
     * @param gif pointer to library type that manages gif decode
     *            takes ownership
     */
    SkGifCodec(const SkImageInfo& srcInfo, SkStream* stream, GifFileType* gif);

    SkAutoTCallVProc<GifFileType, CloseGif> fGif; // owned

    typedef SkCodec INHERITED;
};


text:
package com.azure.resourcemanager.appcontainers.generated;

import com.azure.core.util.BinaryData;
import com.azure.resourcemanager.appcontainers.models.DiagnosticRendering;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public final class DiagnosticRenderingTests {
    @Test
    public void testDeserialize() {
        DiagnosticRendering model =
            BinaryData
                .fromString(
                    "{\"type\":1644045294,\"title\":\"lmywwtkgkxnyed\",\"description\":\"gyvudtjuewbc\",\"isVisible\":false}")
                .toObject(DiagnosticRendering.class);
        Assertions.assertEquals(1644045294, model.type());
        Assertions.assertEquals("lmywwtkgkxnyed", model.title());
        Assertions.assertEquals("gyvudtjuewbc", model.description());
        Assertions.assertEquals(false, model.isVisible());
    }

    @Test
    public void testSerialize() {
        DiagnosticRendering model =
            new DiagnosticRendering()
                .withType(1644045294)
                .withTitle("lmywwtkgkxnyed")
                .withDescription("gyvudtjuewbc")
                .withIsVisible(false);
        model = BinaryData.fromObject(model).toObject(DiagnosticRendering.class);
        Assertions.assertEquals(1644045294, model.type());
        Assertions.assertEquals("lmywwtkgkxnyed", model.title());
        Assertions.assertEquals("gyvudtjuewbc", model.description());
        Assertions.assertEquals(false, model.isVisible());
    }
}


text:
package com.siyeh.ig.imports;

import com.intellij.psi.*;
import com.intellij.psi.util.FileTypeUtils;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
import org.jetbrains.annotations.NotNull;

public class SingleClassImportInspection extends BaseInspection {

  @Override
  @NotNull
  public String getDisplayName() {
    return InspectionGadgetsBundle.message(
      "single.class.import.display.name");
  }

  @Override
  @NotNull
  public String buildErrorString(Object... infos) {
    return InspectionGadgetsBundle.message(
      "single.class.import.problem.descriptor");
  }

  @Override
  public boolean shouldInspect(PsiFile file) {
    return !FileTypeUtils.isInServerPageFile(file);
  }

  @Override
  public BaseInspectionVisitor buildVisitor() {
    return new PackageImportVisitor();
  }

  private static class PackageImportVisitor extends BaseInspectionVisitor {

    @Override
    public void visitClass(@NotNull PsiClass aClass) {
      // no call to super, so it doesn't drill down
      final PsiElement parent = aClass.getParent();
      if (!(parent instanceof PsiJavaFile)) {
        return;
      }
      final PsiJavaFile file = (PsiJavaFile)parent;
      if (!file.getClasses()[0].equals(aClass)) {
        return;
      }
      final PsiImportList importList = file.getImportList();
      if (importList == null) {
        return;
      }
      final PsiImportStatement[] importStatements =
        importList.getImportStatements();
      for (final PsiImportStatement importStatement : importStatements) {
        if (!importStatement.isOnDemand()) {
          registerError(importStatement);
        }
      }
    }
  }
}


text:
package scouter.client.counter.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;

import scouter.client.Images;
import scouter.client.group.view.CounterPastTimeGroupTotalView;
import scouter.client.model.GroupObject;
import scouter.client.util.ConsoleProxy;
import scouter.client.util.ImageUtil;
import scouter.client.util.TimeUtil;

public class OpenPastTimeGroupTotalViewAction extends Action {
	public final static String ID = OpenPastTimeGroupTotalViewAction.class.getName();

	private final IWorkbenchWindow window;
	private String grpName;
	private String objType;
	private String counter;

	public OpenPastTimeGroupTotalViewAction(IWorkbenchWindow window, String label, String counter, GroupObject grpObj) {
		this.window = window;
		this.counter = counter;
		this.grpName = grpObj.getName();
		this.objType = grpObj.getObjType();
		setText(label);
		setId(ID);
		setImageDescriptor(ImageUtil.getImageDescriptor(Images.sum));
	}

	public void run() {
		if (window != null) {
			try {
				window.getActivePage().showView(
						CounterPastTimeGroupTotalView.ID, grpName + "&" + objType + "&" + counter + "&" + TimeUtil.getCurrentTime(),
						IWorkbenchPage.VIEW_ACTIVATE);
			} catch (PartInitException e) {
				ConsoleProxy.error(e.toString());
			}
		}
	}
}


text:
title: PapljProgramStatement.getKProgram - aesi-intellij
---

[aesi-intellij](../../index.html) / [org.metaborg.paplj.psi](../index.html) / [PapljProgramStatement](index.html) / [getKProgram](.)

# getKProgram

`@NotNull abstract fun getKProgram(): @NotNull PsiElement`


text:
@interface ExpertMoreView : UIView

- (void) headerView;

@end


text:
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook

class TestCompareXLSXFiles(ExcelComparisonTest):
    """
    Test file created by XlsxWriter against a file created by Excel.

    """

    def setUp(self):
        self.maxDiff = None

        filename = 'hyperlink12.xlsx'

        test_dir = 'xlsxwriter/test/comparison/'
        self.got_filename = test_dir + '_test_' + filename
        self.exp_filename = test_dir + 'xlsx_files/' + filename

        self.ignore_files = []
        self.ignore_elements = {}

    def test_create_file(self):
        """Test the creation of a simple XlsxWriter file with hyperlinks. This example has link formatting."""

        workbook = Workbook(self.got_filename)

        worksheet = workbook.add_worksheet()
        format = workbook.add_format({'color': 'blue', 'underline': 1})

        worksheet.write_url('A1', 'mailto:jmcnamara@cpan.org', format)

        worksheet.write_url('A3', 'ftp://perl.org/', format)

        workbook.close()

        self.assertExcelEqual()

    def test_create_file_write(self):
        """Test the creation of a simple XlsxWriter file with hyperlinks. This example has link formatting and uses write()"""

        workbook = Workbook(self.got_filename)

        worksheet = workbook.add_worksheet()
        format = workbook.add_format({'color': 'blue', 'underline': 1})

        worksheet.write('A1', 'mailto:jmcnamara@cpan.org', format)

        worksheet.write('A3', 'ftp://perl.org/', format)

        workbook.close()

        self.assertExcelEqual()