id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
34383946_24 | {
"fields": [
{
"declarator": "DEFAULT = Profiles.defaultProfile()",
"modifier": "private static",
"original_string": "private static ValidationProfile DEFAULT = Profiles.defaultProfile();",
"type": "ValidationProfile",
"var_name": "DEFAULT"
},
{
"declarator": "PDFA_1B ... | {
"body": "@Test(expected = NoSuchElementException.class)\n public final void testGetValidationProfileByIdNoElement() {\n ProfileDirectory dir = Profiles.directoryFromProfiles(DEFAULT_ALONE);\n dir.getValidationProfileById(PDFAFlavour.PDFA_2_A.getId());\n }",
"class_method_signature": "ProfileDi... | {
"fields": [
{
"declarator": "PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\"",
"modifier": "private final static",
"original_string": "private final static String PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\";",
"type": "String",
"var_name": "PROFILE_R... | {
"body": "@Override\n public ValidationProfile getValidationProfileById(String profileID) {\n if (profileID == null)\n throw new IllegalArgumentException(\n \"Parameter profileID cannot be null\");\n PDFAFlavour flavour = this.flavourDir.getItem(profileID);\n if ... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_25 | {
"fields": [
{
"declarator": "DEFAULT = Profiles.defaultProfile()",
"modifier": "private static",
"original_string": "private static ValidationProfile DEFAULT = Profiles.defaultProfile();",
"type": "ValidationProfile",
"var_name": "DEFAULT"
},
{
"declarator": "PDFA_1B ... | {
"body": "@Test\n public final void testGetValidationProfileByFlavour() {\n ProfileDirectory dir = Profiles.directoryFromProfiles(DEFAULT_ALONE);\n assertTrue(dir.getValidationProfileByFlavour(DEFAULT.getPDFAFlavour())\n .getPDFAFlavour() == PDFAFlavour.NO_FLAVOUR);\n dir = Pro... | {
"fields": [
{
"declarator": "PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\"",
"modifier": "private final static",
"original_string": "private final static String PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\";",
"type": "String",
"var_name": "PROFILE_R... | {
"body": "@Override\n public ValidationProfile getValidationProfileByFlavour(PDFAFlavour flavour) {\n if (flavour == null)\n throw new IllegalArgumentException(\n \"Parameter flavour cannot be null\");\n ValidationProfile profile = this.profileDir.getItem(flavour);\n ... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_33 | {
"fields": [
{
"declarator": "DEFAULT_RULE_ID_STRING = \"RuleId [specification=\" + Specification.NO_STANDARD.toString() + \", clause=clause, testNumber=0]\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_RULE_ID_STRING = \"RuleId [specification=\"... | {
"body": "@Test\n public final void testToString() {\n assertTrue(Profiles.defaultRuleId().toString()\n .equals(DEFAULT_RULE_ID_STRING));\n }",
"class_method_signature": "RuleIdImplTest.testToString()",
"constructor": false,
"full_signature": "@Test public final void testToString()"... | {
"fields": [
{
"declarator": "DEFAULT = new RuleIdImpl()",
"modifier": "private static final",
"original_string": "private static final RuleIdImpl DEFAULT = new RuleIdImpl();",
"type": "RuleIdImpl",
"var_name": "DEFAULT"
},
{
"declarator": "specification",
"modif... | {
"body": "@Override\n public final String toString() {\n return \"RuleId [specification=\" + this.specification.toString()\n + \", clause=\" + this.clause + \", testNumber=\" + this.testNumber\n + \"]\";\n }",
"class_method_signature": "RuleIdImpl.toString()",
"construc... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_13 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionSibSfx() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.sibFiles(\"\", custSfx); //$NON-NLS-1$\n\t\tFileOutputMapper toTest = FileOutputMappers.verSibFiles(\"\", custSfx); //$NON-NLS-1$\n\t\tFile toVersion = new File(tmpRoot.toF... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_0 | {
"fields": [],
"file": "core/src/test/java/org/verapdf/component/AuditDurationImplTest.java",
"identifier": "AuditDurationImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testDefaultInstance() {\n\t\tAuditDuration defaultInstance = AuditDurationImpl.defaultInstance();\n\t\tassertTrue(defaultInstance == AuditDurationImpl.defaultInstance());\n\t}",
"class_method_signature": "AuditDurationImplTest.testDefaultInstance()",
"constructor": false,
"full_s... | {
"fields": [
{
"declarator": "defaultInstance = new AuditDurationImpl()",
"modifier": "private static final",
"original_string": "private static final AuditDuration defaultInstance = new AuditDurationImpl();",
"type": "AuditDuration",
"var_name": "defaultInstance"
},
{
... | {
"body": "static AuditDuration defaultInstance() {\n\t\treturn defaultInstance;\n\t}",
"class_method_signature": "AuditDurationImpl.defaultInstance()",
"constructor": false,
"full_signature": "static AuditDuration defaultInstance()",
"identifier": "defaultInstance",
"invocations": [],
"modifiers": "stati... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_29 | {
"fields": [
{
"declarator": "DEFAULT_REFERENCE_STRING = \"Reference [specification=specification, clause=clause]\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_REFERENCE_STRING = \"Reference [specification=specification, clause=clause]\";",
... | {
"body": "@Test\n\tpublic final void testFromValues() {\n\t\t// Get an equivalent to the default instance\n\t\tReference reference = Profiles.referenceFromValues(\"specification\", \"clause\");\n\t\tReference defaultInstance = Profiles.defaultReference();\n\t\t// Equivalent is NOT the same object as default instance... | {
"fields": [
{
"declarator": "DEFAULT = new ReferenceImpl()",
"modifier": "private final static",
"original_string": "private final static ReferenceImpl DEFAULT = new ReferenceImpl();",
"type": "ReferenceImpl",
"var_name": "DEFAULT"
},
{
"declarator": "specification",
... | {
"body": "static Reference fromValues(final String specification,\n final String clause) {\n return new ReferenceImpl(specification, clause);\n }",
"class_method_signature": "ReferenceImpl.fromValues(final String specification,\n final String clause)",
"constructor": false,
"ful... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_34 | {
"fields": [
{
"declarator": "DEFAULT_RULE_ID_STRING = \"RuleId [specification=\" + Specification.NO_STANDARD.toString() + \", clause=clause, testNumber=0]\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_RULE_ID_STRING = \"RuleId [specification=\"... | {
"body": "@Test\n public final void testFromValues() {\n // Get an equivalent to the default instance\n RuleId ruleId = Profiles.ruleIdFromValues(Specification.NO_STANDARD, \"clause\", 0);\n RuleId defaultInstance = Profiles.defaultRuleId();\n // Equivalent is NOT the same object as de... | {
"fields": [
{
"declarator": "DEFAULT = new RuleIdImpl()",
"modifier": "private static final",
"original_string": "private static final RuleIdImpl DEFAULT = new RuleIdImpl();",
"type": "RuleIdImpl",
"var_name": "DEFAULT"
},
{
"declarator": "specification",
"modif... | {
"body": "static RuleId fromValues(final Specification specifcation,\n final String clause, final int testNumber) {\n return new RuleIdImpl(specifcation, clause, testNumber);\n }",
"class_method_signature": "RuleIdImpl.fromValues(final Specification specifcation,\n final String clau... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_22 | {
"fields": [
{
"declarator": "DEFAULT = Profiles.defaultProfile()",
"modifier": "private static",
"original_string": "private static ValidationProfile DEFAULT = Profiles.defaultProfile();",
"type": "ValidationProfile",
"var_name": "DEFAULT"
},
{
"declarator": "PDFA_1B ... | {
"body": "@Test\n public final void testGetPDFAFlavours() {\n ProfileDirectory dir = Profiles.directoryFromProfiles(DEFAULT_ALONE);\n assertTrue(dir.getPDFAFlavours().size() == 1);\n dir = Profiles.directoryFromProfiles(PDFA_1B_ALONE);\n assertTrue(dir.getPDFAFlavours().size() == 1);\n... | {
"fields": [
{
"declarator": "PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\"",
"modifier": "private final static",
"original_string": "private final static String PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\";",
"type": "String",
"var_name": "PROFILE_R... | {
"body": "@Override\n public Set<PDFAFlavour> getPDFAFlavours() {\n return this.profileDir.getKeys();\n }",
"class_method_signature": "ProfileDirectoryImpl.getPDFAFlavours()",
"constructor": false,
"full_signature": "@Override public Set<PDFAFlavour> getPDFAFlavours()",
"identifier": "getPDFAFla... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_18 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionSubSfx() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.subFold(custSubFld, \"\", custSfx); //$NON-NLS-1$\n\t\tFileOutputMapper toTest = FileOutputMappers.verSubFold(custSubFld, \"\", custSfx); //$NON-NLS-1$\n\t\tFile toVersion ... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_38 | {
"fields": [
{
"declarator": "DEFAULT_VARIABLE_STRING = \"Variable [name=name, object=object, defaultValue=defaultValue, value=value]\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_VARIABLE_STRING = \"Variable [name=name, object=object, defaultVa... | {
"body": "@Test\n public final void testToString() {\n assertTrue(Profiles.defaultVariable().toString()\n .equals(DEFAULT_VARIABLE_STRING));\n }",
"class_method_signature": "VariableImplTest.testToString()",
"constructor": false,
"full_signature": "@Test public final void testToStri... | {
"fields": [
{
"declarator": "DEFAULT = new VariableImpl()",
"modifier": "private final static",
"original_string": "private final static VariableImpl DEFAULT = new VariableImpl();",
"type": "VariableImpl",
"var_name": "DEFAULT"
},
{
"declarator": "name",
"modifi... | {
"body": "@Override\n public String toString() {\n return \"Variable [name=\" + this.name + \", object=\" + this.object\n + \", defaultValue=\" + this.defaultValue + \", value=\"\n + this.value + \"]\";\n }",
"class_method_signature": "VariableImpl.toString()",
"constru... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_7 | {
"fields": [
{
"declarator": "NAME = \"verapdf-test\"",
"modifier": "private static",
"original_string": "private static String NAME = \"verapdf-test\";",
"type": "String",
"var_name": "NAME"
}
],
"file": "core/src/test/java/org/verapdf/ReleaseDetailsTest.java",
"identifie... | {
"body": "@Test\n\tpublic final void testToString() throws ParseException {\n\t\tReleaseDetails instance = ReleaseDetails.byId(NAME);\n\t\tString dateFormat = \"yyyy-MM-dd\";\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(dateFormat);\n\t\tDate date = formatter.parse(\"2011-07-31\");\n\t\tassertEquals(\"Rele... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ReleaseDetails.class.getCanonicalName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ReleaseDetails.class.getCanonicalName());",
"type": "Logger",
"var_name": ... | {
"body": "@Override\n\tpublic String toString() {\n\t\treturn \"ReleaseDetails [id=\" + this.id + \", version=\" + this.version + \", buildDate=\" + this.buildDate + \"]\"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$\n\t}",
"class_method_signature": "ReleaseDetails.toString()",
"constructor": false,
... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_14 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionSibExt() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.sibFiles(\"\", custExt); //$NON-NLS-1$\n\t\tFileOutputMapper toTest = FileOutputMappers.verSibFiles(\"\", custExt); //$NON-NLS-1$\n\t\tFile toVersion = new File(tmpRoot.toF... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_15 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionSibPrfxExt() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.sibFiles(custPrfx, custExt);\n\t\tFileOutputMapper toTest = FileOutputMappers.verSibFiles(custPrfx, custExt);\n\t\tFile toVersion = new File(tmpRoot.toFile(), origNm);\... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_6 | {
"fields": [
{
"declarator": "NAME = \"verapdf-test\"",
"modifier": "private static",
"original_string": "private static String NAME = \"verapdf-test\";",
"type": "String",
"var_name": "NAME"
}
],
"file": "core/src/test/java/org/verapdf/ReleaseDetailsTest.java",
"identifie... | {
"body": "@Test\n\tpublic final void testGetBuildDate() throws ParseException {\n\t\tReleaseDetails instance = ReleaseDetails.byId(NAME);\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\tDate date = formatter.parse(\"2011-07-31\");\n\t\tassertTrue(instance.getBuildDate().equals(date));\n\... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ReleaseDetails.class.getCanonicalName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ReleaseDetails.class.getCanonicalName());",
"type": "Logger",
"var_name": ... | {
"body": "public Date getBuildDate() {\n\t\treturn new Date(this.buildDate.getTime());\n\t}",
"class_method_signature": "ReleaseDetails.getBuildDate()",
"constructor": false,
"full_signature": "public Date getBuildDate()",
"identifier": "getBuildDate",
"invocations": [
"getTime"
],
"modifiers": "pu... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_39 | {
"fields": [
{
"declarator": "DEFAULT_VARIABLE_STRING = \"Variable [name=name, object=object, defaultValue=defaultValue, value=value]\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_VARIABLE_STRING = \"Variable [name=name, object=object, defaultVa... | {
"body": "@Test\n public final void testFromValues() {\n // Get an equivalent to the default instance\n Variable variable = Profiles.variableFromValues(\"name\", \"object\",\n \"defaultValue\", \"value\");\n Variable defaultInstance = Profiles.defaultVariable();\n // Equ... | {
"fields": [
{
"declarator": "DEFAULT = new VariableImpl()",
"modifier": "private final static",
"original_string": "private final static VariableImpl DEFAULT = new VariableImpl();",
"type": "VariableImpl",
"var_name": "DEFAULT"
},
{
"declarator": "name",
"modifi... | {
"body": "static VariableImpl fromValues(final String name, final String object,\n final String defaultValue, final String value) {\n return new VariableImpl(name, object, defaultValue, value);\n }",
"class_method_signature": "VariableImpl.fromValues(final String name, final String object,\n ... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_19 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionExt() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.subFold(custSubFld, \"\", custExt); //$NON-NLS-1$\n\t\tFileOutputMapper toTest = FileOutputMappers.verSubFold(custSubFld, \"\", custExt); //$NON-NLS-1$\n\t\tFile toVersion = n... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_23 | {
"fields": [
{
"declarator": "DEFAULT = Profiles.defaultProfile()",
"modifier": "private static",
"original_string": "private static ValidationProfile DEFAULT = Profiles.defaultProfile();",
"type": "ValidationProfile",
"var_name": "DEFAULT"
},
{
"declarator": "PDFA_1B ... | {
"body": "@Test\n public final void testGetValidationProfileById() {\n ProfileDirectory dir = Profiles.directoryFromProfiles(DEFAULT_ALONE);\n assertTrue(dir.getValidationProfileById(\n DEFAULT.getPDFAFlavour().getId()).getPDFAFlavour() == PDFAFlavour.NO_FLAVOUR);\n dir = Profi... | {
"fields": [
{
"declarator": "PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\"",
"modifier": "private final static",
"original_string": "private final static String PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\";",
"type": "String",
"var_name": "PROFILE_R... | {
"body": "@Override\n public ValidationProfile getValidationProfileById(String profileID) {\n if (profileID == null)\n throw new IllegalArgumentException(\n \"Parameter profileID cannot be null\");\n PDFAFlavour flavour = this.flavourDir.getItem(profileID);\n if ... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_35 | {
"fields": [
{
"declarator": "DEFAULT_RULE_ID_STRING = \"RuleId [specification=\" + Specification.NO_STANDARD.toString() + \", clause=clause, testNumber=0]\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_RULE_ID_STRING = \"RuleId [specification=\"... | {
"body": "@Test\n public final void testFromRuleId() {\n // Get an equivalent to the default instance\n RuleId ruleId = RuleIdImpl.fromRuleId(RuleIdImpl.defaultInstance());\n RuleId defaultInstance = Profiles.defaultRuleId();\n // Equivalent is NOT the same object as default instance\n... | {
"fields": [
{
"declarator": "DEFAULT = new RuleIdImpl()",
"modifier": "private static final",
"original_string": "private static final RuleIdImpl DEFAULT = new RuleIdImpl();",
"type": "RuleIdImpl",
"var_name": "DEFAULT"
},
{
"declarator": "specification",
"modif... | {
"body": "static RuleId fromRuleId(final RuleId toConvert) {\n return fromValues(toConvert.getSpecification(), toConvert.getClause(),\n toConvert.getTestNumber());\n }",
"class_method_signature": "RuleIdImpl.fromRuleId(final RuleId toConvert)",
"constructor": false,
"full_signature": "... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_9 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetdefaultInstance() {\n\t\tFileOutputMapper defaultInstance = RelativeDirectoryMapper.defaultInstance();\n\t\tassertTrue(defaultInstance == RelativeDirectoryMapper.defaultInstance());\n\t}",
"class_method_signature": "RelativeDirectoryMapperTest.testGetdefaultInstance()",
"con... | {
"fields": [
{
"declarator": "defaultRelativePath = \".\"",
"modifier": "static final",
"original_string": "static final String defaultRelativePath = \".\";",
"type": "String",
"var_name": "defaultRelativePath"
},
{
"declarator": "defaultInstance = new RelativeDirector... | {
"body": "static final RelativeDirectoryMapper defaultInstance() {\n\t\treturn defaultInstance;\n\t}",
"class_method_signature": "RelativeDirectoryMapper.defaultInstance()",
"constructor": false,
"full_signature": "static final RelativeDirectoryMapper defaultInstance()",
"identifier": "defaultInstance",
"i... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_20 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionPfxExt() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.subFold(custSubFld, custPrfx, custExt);\n\t\tFileOutputMapper toTest = FileOutputMappers.verSubFold(custSubFld, custPrfx, custExt);\n\t\tFile toVersion = new File(tmpRoot.t... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_36 | {
"fields": [
{
"declarator": "DEFAULT_PROFILE_STRING = \"ValidationProfile [flavour=\"\n\t\t\t+ PDFAFlavour.NO_FLAVOUR.toString() + \", details=\" + ProfileDetailsImpl.defaultInstance()\n\t\t\t+ \", hash=hash, rules=[], variables=[]]\"",
"modifier": "private final static",
"original_string": "p... | {
"body": "@Test\n\tpublic final void testToString() {\n\t\tassertTrue(ValidationProfileImpl.defaultInstance().toString().equals(DEFAULT_PROFILE_STRING));\n\t}",
"class_method_signature": "ValidationProfileImplTest.testToString()",
"constructor": false,
"full_signature": "@Test public final void testToString()"... | {
"fields": [
{
"declarator": "objectRuleMap",
"modifier": "private",
"original_string": "private Map<String, Set<Rule>> objectRuleMap;",
"type": "Map<String, Set<Rule>>",
"var_name": "objectRuleMap"
},
{
"declarator": "objectVariableMap",
"modifier": "private",
... | {
"body": "@Override\n public String toString() {\n return \"ValidationProfile [flavour=\" + this.flavour + \", details=\"\n + this.details + \", hash=\" + this.hash + \", rules=\"\n + this.rules + \", variables=\" + this.variables + \"]\";\n }",
"class_method_signature": ... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_16 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionSub() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.subFold(custSubFld, \"\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tFileOutputMapper toTest = FileOutputMappers.verSubFold(custSubFld, \"\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_41 | {
"fields": [
{
"declarator": "resourceBase = \"/org/verapdf/policy/\"",
"modifier": "private static final",
"original_string": "private static final String resourceBase = \"/org/verapdf/policy/\";",
"type": "String",
"var_name": "resourceBase"
},
{
"declarator": "basic... | {
"body": "@Test\n\tpublic void testProcessSchematron() throws IOException, TransformerException {\n\n\t\tFile tempResult = File.createTempFile(\"veraPDF\", \"unitTest\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tassertTrue(tempResult.length() == 0);\n\t\ttry (InputStream is = SchematronPipelineTest.class.getResourceAsStream... | {
"fields": [
{
"declarator": "LOGGER = Logger\n\t\t\t.getLogger(SchematronPipeline.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger\n\t\t\t.getLogger(SchematronPipeline.class.getName());",
"type": "Logger",
"var_n... | {
"body": "public static void processSchematron(InputStream schematronSource, OutputStream xslDest)\n\t\t\tthrows TransformerException, IOException {\n\t\tFile isoDsdResult = createTempFileResult(cachedIsoDsdXsl.newTransformer(), new StreamSource(schematronSource),\n\t\t\t\t\"IsoDsd\"); //$NON-NLS-1$\n\t\tFile isoExp... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_5 | {
"fields": [
{
"declarator": "NAME = \"verapdf-test\"",
"modifier": "private static",
"original_string": "private static String NAME = \"verapdf-test\";",
"type": "String",
"var_name": "NAME"
}
],
"file": "core/src/test/java/org/verapdf/ReleaseDetailsTest.java",
"identifie... | {
"body": "@Test\n\tpublic final void testGetVersion() {\n\t\tReleaseDetails instance = ReleaseDetails.byId(NAME);\n\t\tassertTrue(\"0.0.0-TEST\".equals(instance.getVersion()));\n\t}",
"class_method_signature": "ReleaseDetailsTest.testGetVersion()",
"constructor": false,
"full_signature": "@Test public final vo... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ReleaseDetails.class.getCanonicalName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ReleaseDetails.class.getCanonicalName());",
"type": "Logger",
"var_name": ... | {
"body": "public String getVersion() {\n\t\treturn this.version;\n\t}",
"class_method_signature": "ReleaseDetails.getVersion()",
"constructor": false,
"full_signature": "public String getVersion()",
"identifier": "getVersion",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "S... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_4 | {
"fields": [],
"file": "core/src/test/java/org/verapdf/component/AuditDurationImplTest.java",
"identifier": "AuditDurationImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetStringDuration() {\n\t\tlong second = 1000;\n\t\tlong minute = 60 * second;\n\t\tlong hour = 60 * minute;\n\t\tassertEquals(\"00:00:00.000\", AuditDurationImpl.getStringDuration(0));\n\t\tassertEquals(\"01:23:45.678\", AuditDurationImpl.getStringDuration(hour + 23 * minute + 45 ... | {
"fields": [
{
"declarator": "defaultInstance = new AuditDurationImpl()",
"modifier": "private static final",
"original_string": "private static final AuditDuration defaultInstance = new AuditDurationImpl();",
"type": "AuditDuration",
"var_name": "defaultInstance"
},
{
... | {
"body": "public static String getStringDuration(final long difference) {\n\t\tlong hours = difference / (minInHour * secInMin * msInSec);\n\t\tlong minutes = difference / (secInMin * msInSec) % minInHour;\n\t\tlong seconds = difference / msInSec % secInMin;\n\t\tlong millis = difference % msInSec;\n\n\t\ttry (Forma... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_40 | {
"fields": [
{
"declarator": "DEFAULT_VARIABLE_STRING = \"Variable [name=name, object=object, defaultValue=defaultValue, value=value]\"",
"modifier": "private final static",
"original_string": "private final static String DEFAULT_VARIABLE_STRING = \"Variable [name=name, object=object, defaultVa... | {
"body": "@Test\n public final void testFromVariable() {\n // Get an equivalent to the default instance\n Variable variable = VariableImpl.fromVariable(VariableImpl.defaultInstance());\n Variable defaultInstance = Profiles.defaultVariable();\n // Equivalent is NOT the same object as de... | {
"fields": [
{
"declarator": "DEFAULT = new VariableImpl()",
"modifier": "private final static",
"original_string": "private final static VariableImpl DEFAULT = new VariableImpl();",
"type": "VariableImpl",
"var_name": "DEFAULT"
},
{
"declarator": "name",
"modifi... | {
"body": "static VariableImpl fromVariable(final Variable toConvert) {\n return new VariableImpl(toConvert.getName(), toConvert.getObject(),\n toConvert.getDefaultValue(), toConvert.getValue());\n }",
"class_method_signature": "VariableImpl.fromVariable(final Variable toConvert)",
"const... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_17 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionSubPrfx() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.subFold(custSubFld, custPrfx, \"\"); //$NON-NLS-1$\n\t\tFileOutputMapper toTest = FileOutputMappers.verSubFold(custSubFld, custPrfx, \"\"); //$NON-NLS-1$\n\t\tFile toVersi... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_37 | {
"fields": [
{
"declarator": "DEFAULT_PROFILE_STRING = \"ValidationProfile [flavour=\"\n\t\t\t+ PDFAFlavour.NO_FLAVOUR.toString() + \", details=\" + ProfileDetailsImpl.defaultInstance()\n\t\t\t+ \", hash=hash, rules=[], variables=[]]\"",
"modifier": "private final static",
"original_string": "p... | {
"body": "@Test\n\tpublic final void testFromValues() {\n\t\t// Get an equivalent to the default instance\n\t\tValidationProfile rule = Profiles.profileFromValues(PDFAFlavour.NO_FLAVOUR,\n\t\t\t\tProfileDetailsImpl.defaultInstance(), \"hash\", Collections.<Rule>emptySet(),\n\t\t\t\tCollections.<Variable>emptySet());... | {
"fields": [
{
"declarator": "objectRuleMap",
"modifier": "private",
"original_string": "private Map<String, Set<Rule>> objectRuleMap;",
"type": "Map<String, Set<Rule>>",
"var_name": "objectRuleMap"
},
{
"declarator": "objectVariableMap",
"modifier": "private",
... | {
"body": "static ValidationProfile fromValues(final PDFAFlavour flavour,\n final ProfileDetails details, final String hash,\n final Set<Rule> rules, final Set<Variable> variables) {\n return new ValidationProfileImpl(flavour, details, hash, rules,\n variables);\n }",
... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_21 | {
"fields": [
{
"declarator": "DEFAULT = Profiles.defaultProfile()",
"modifier": "private static",
"original_string": "private static ValidationProfile DEFAULT = Profiles.defaultProfile();",
"type": "ValidationProfile",
"var_name": "DEFAULT"
},
{
"declarator": "PDFA_1B ... | {
"body": "@Test\n public final void testGetValidationProfileIds() {\n ProfileDirectory dir = Profiles\n .directoryFromProfiles(DEFAULT_ALONE);\n assertTrue(dir.getValidationProfileIds().size() == 1);\n dir = Profiles.directoryFromProfiles(PDFA_1B_ALONE);\n assertTrue(dir... | {
"fields": [
{
"declarator": "PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\"",
"modifier": "private final static",
"original_string": "private final static String PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\";",
"type": "String",
"var_name": "PROFILE_R... | {
"body": "@Override\n public Set<String> getValidationProfileIds() {\n return Collections.unmodifiableSet(this.flavourDir.getKeys());\n }",
"class_method_signature": "ProfileDirectoryImpl.getValidationProfileIds()",
"constructor": false,
"full_signature": "@Override public Set<String> getValidatio... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_8 | {
"fields": [
{
"declarator": "NAME = \"verapdf-test\"",
"modifier": "private static",
"original_string": "private static String NAME = \"verapdf-test\";",
"type": "String",
"var_name": "NAME"
}
],
"file": "core/src/test/java/org/verapdf/ReleaseDetailsTest.java",
"identifie... | {
"body": "@Test\n\tpublic final void testGetDefaultInstance() {\n\t\tReleaseDetails instance = ReleaseDetails.defaultInstance();\n\t\tReleaseDetails secondInstance = ReleaseDetails.defaultInstance();\n\t\tassertTrue(instance == secondInstance);\n\t}",
"class_method_signature": "ReleaseDetailsTest.testGetDefaultIns... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ReleaseDetails.class.getCanonicalName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ReleaseDetails.class.getCanonicalName());",
"type": "Logger",
"var_name": ... | {
"body": "public static ReleaseDetails defaultInstance() {\n\t\treturn DEFAULT;\n\t}",
"class_method_signature": "ReleaseDetails.defaultInstance()",
"constructor": false,
"full_signature": "public static ReleaseDetails defaultInstance()",
"identifier": "defaultInstance",
"invocations": [],
"modifiers": "... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_10 | {
"fields": [
{
"declarator": "name = \"name\"",
"modifier": "static final",
"original_string": "static final String name = \"name\";",
"type": "String",
"var_name": "name"
},
{
"declarator": "ext = \".ext\"",
"modifier": "static final",
"original_string": "... | {
"body": "@Test\n\tpublic void testHasExt() {\n\t\tassertTrue(FileUtils.hasExt(name + ext, \"ext\")); //$NON-NLS-1$\n\t\tassertFalse(FileUtils.hasExt(name + ext, \"EXT\")); //$NON-NLS-1$\n\t\tassertTrue(FileUtils.hasExtNoCase(name + ext, \"EXT\")); //$NON-NLS-1$\n\t\tassertTrue(FileUtils.hasExt(name + ext, ext));\n\... | {
"fields": [
{
"declarator": "dot = \".\"",
"modifier": "private static final",
"original_string": "private static final String dot = \".\";",
"type": "String",
"var_name": "dot"
},
{
"declarator": "extensionRegEx = \"\\\\.(?=[^\\\\.]+$)\"",
"modifier": "private ... | {
"body": "public static boolean hasExt(final String fileName, final String ext) {\n\t\tfinal String fullExt = ext.startsWith(dot) ? ext : dot + ext;\n\t\treturn fileName.endsWith(fullExt);\n\t}",
"class_method_signature": "FileUtils.hasExt(final String fileName, final String ext)",
"constructor": false,
"full_... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_3 | {
"fields": [],
"file": "core/src/test/java/org/verapdf/component/AuditDurationImplTest.java",
"identifier": "AuditDurationImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected=IllegalArgumentException.class)\n\tpublic void testFromValuesHorseBeforeCart() {\n\t\tAuditDurationImpl.fromValues(250000, 200000);\n\t}",
"class_method_signature": "AuditDurationImplTest.testFromValuesHorseBeforeCart()",
"constructor": false,
"full_signature": "@Test(expected=IllegalA... | {
"fields": [
{
"declarator": "defaultInstance = new AuditDurationImpl()",
"modifier": "private static final",
"original_string": "private static final AuditDuration defaultInstance = new AuditDurationImpl();",
"type": "AuditDuration",
"var_name": "defaultInstance"
},
{
... | {
"body": "static AuditDuration fromValues(final long start, final long finish) {\n\t\tif (start < 0 || finish < 0) {\n\t\t\tthrow new IllegalArgumentException(\"start:\" + start + \" and finish:\" + finish + \" must be >= 0\"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n\t\t}\n\t\tif (start > finish) {\n\t\t\tthrow ... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_26 | {
"fields": [
{
"declarator": "DEFAULT = Profiles.defaultProfile()",
"modifier": "private static",
"original_string": "private static ValidationProfile DEFAULT = Profiles.defaultProfile();",
"type": "ValidationProfile",
"var_name": "DEFAULT"
},
{
"declarator": "PDFA_1B ... | {
"body": "@Test(expected = NoSuchElementException.class)\n public final void testGetValidationProfileByFlavourNoElement() {\n ProfileDirectory dir = Profiles.directoryFromProfiles(DEFAULT_ALONE);\n dir.getValidationProfileByFlavour(PDFAFlavour.PDFA_1_A);\n }",
"class_method_signature": "Profile... | {
"fields": [
{
"declarator": "PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\"",
"modifier": "private final static",
"original_string": "private final static String PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\";",
"type": "String",
"var_name": "PROFILE_R... | {
"body": "@Override\n public ValidationProfile getValidationProfileByFlavour(PDFAFlavour flavour) {\n if (flavour == null)\n throw new IllegalArgumentException(\n \"Parameter flavour cannot be null\");\n ValidationProfile profile = this.profileDir.getItem(flavour);\n ... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_30 | {
"fields": [
{
"declarator": "DEFAULT_RULE_STRING = \"Rule [id=\"\n + Profiles.defaultRuleId()\n + \", object=object, deferred=null, description=description, test=test, error=\" + ErrorDetailsImpl.defaultInstance() + \", references=[]]\"",
"modifier": "private static final",
... | {
"body": "@Test\n public final void testToString() {\n assertTrue(Profiles.defaultRule().toString()\n .equals(DEFAULT_RULE_STRING));\n }",
"class_method_signature": "RuleImplTest.testToString()",
"constructor": false,
"full_signature": "@Test public final void testToString()",
"id... | {
"fields": [
{
"declarator": "DEFAULT = new RuleImpl()",
"modifier": "private final static",
"original_string": "private final static RuleImpl DEFAULT = new RuleImpl();",
"type": "RuleImpl",
"var_name": "DEFAULT"
},
{
"declarator": "id",
"modifier": "@XmlElement\... | {
"body": "@Override\n public String toString() {\n return \"Rule [id=\" + this.id + \", object=\" + this.object + \", deferred=\" + this.deferred\n + \", description=\" + this.description + \", test=\" + this.test\n + \", error=\" + this.error + \", references=\" + this.refere... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_31 | {
"fields": [
{
"declarator": "DEFAULT_RULE_STRING = \"Rule [id=\"\n + Profiles.defaultRuleId()\n + \", object=object, deferred=null, description=description, test=test, error=\" + ErrorDetailsImpl.defaultInstance() + \", references=[]]\"",
"modifier": "private static final",
... | {
"body": "@Test\n public final void testFromValues() {\n // Get an equivalent to the default instance\n RuleImpl rule = RuleImpl\n .fromValues(Profiles.defaultRuleId(), \"object\", null,\n \"description\", \"test\", ErrorDetailsImpl.defaultInstance(), Collection... | {
"fields": [
{
"declarator": "DEFAULT = new RuleImpl()",
"modifier": "private final static",
"original_string": "private final static RuleImpl DEFAULT = new RuleImpl();",
"type": "RuleImpl",
"var_name": "DEFAULT"
},
{
"declarator": "id",
"modifier": "@XmlElement\... | {
"body": "static RuleImpl fromValues(final RuleId id, final String object, final Boolean deferred,\n final String description, final String test,\n final ErrorDetails error, final List<Reference> references) {\n return new RuleImpl(RuleIdImpl.fromRuleId(id), object, deferred, description... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_27 | {
"fields": [
{
"declarator": "DEFAULT = Profiles.defaultProfile()",
"modifier": "private static",
"original_string": "private static ValidationProfile DEFAULT = Profiles.defaultProfile();",
"type": "ValidationProfile",
"var_name": "DEFAULT"
},
{
"declarator": "PDFA_1B ... | {
"body": "@Test\n public final void testGetValidationProfiles() {\n ProfileDirectory dir = Profiles.directoryFromProfiles(DEFAULT_ALONE);\n assertTrue(dir.getValidationProfiles().contains(DEFAULT));\n dir = Profiles.directoryFromProfiles(PDFA_1B_ALONE);\n assertTrue(dir.getValidationPr... | {
"fields": [
{
"declarator": "PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\"",
"modifier": "private final static",
"original_string": "private final static String PROFILE_RESOURCE_ROOT = \"org/verapdf/pdfa/validation/PDFA-\";",
"type": "String",
"var_name": "PROFILE_R... | {
"body": "@Override\n public Set<ValidationProfile> getValidationProfiles() {\n return Collections.unmodifiableSet(new HashSet<>(this.profileDir\n .getItems()));\n }",
"class_method_signature": "ProfileDirectoryImpl.getValidationProfiles()",
"constructor": false,
"full_signature": "... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_2 | {
"fields": [],
"file": "core/src/test/java/org/verapdf/component/AuditDurationImplTest.java",
"identifier": "AuditDurationImplTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected=IllegalArgumentException.class)\n\tpublic void testFromValuesSubZeroFinish() {\n\t\tAuditDurationImpl.fromValues(0, -15);\n\t}",
"class_method_signature": "AuditDurationImplTest.testFromValuesSubZeroFinish()",
"constructor": false,
"full_signature": "@Test(expected=IllegalArgumentExcep... | {
"fields": [
{
"declarator": "defaultInstance = new AuditDurationImpl()",
"modifier": "private static final",
"original_string": "private static final AuditDuration defaultInstance = new AuditDurationImpl();",
"type": "AuditDuration",
"var_name": "defaultInstance"
},
{
... | {
"body": "static AuditDuration fromValues(final long start, final long finish) {\n\t\tif (start < 0 || finish < 0) {\n\t\t\tthrow new IllegalArgumentException(\"start:\" + start + \" and finish:\" + finish + \" must be >= 0\"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n\t\t}\n\t\tif (start > finish) {\n\t\t\tthrow ... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
34383946_11 | {
"fields": [
{
"declarator": "tmpRoot",
"modifier": "private static",
"original_string": "private static Path tmpRoot;",
"type": "Path",
"var_name": "tmpRoot"
},
{
"declarator": "custPrfx = \"custPrfx_\"",
"modifier": "private static final",
"original_strin... | {
"body": "@Test\n\tpublic void testGetVersionSib() throws IOException, VeraPDFException {\n\t\tFileOutputMapper toCompare = FileOutputMappers.sibFiles(\"\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tFileOutputMapper toTest = FileOutputMappers.verSibFiles(\"\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tFile toVersion = n... | {
"fields": [
{
"declarator": "verPrefixOpen = \"_(\"",
"modifier": "private final static",
"original_string": "private final static String verPrefixOpen = \"_(\";",
"type": "String",
"var_name": "verPrefixOpen"
},
{
"declarator": "verPrefixClose = \")\"",
"modifi... | {
"body": "@Override\n\tpublic File mapFile(final File orig) throws VeraPDFException {\n\t\treturn version(this.mapper.mapFile(orig));\n\t}",
"class_method_signature": "VersioningMapper.mapFile(final File orig)",
"constructor": false,
"full_signature": "@Override public File mapFile(final File orig)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 39,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 34383946,
"size": 8430,
"stargazer_count": 160,
"stars": null,
"updates": null,
"url": "https://github.com/veraPDF/veraPDF-library"
} |
22815625_26 | {
"fields": [
{
"declarator": "iirdesigner = new ButterworthIIRDesigner()",
"modifier": "",
"original_string": "ButterworthIIRDesigner iirdesigner = new ButterworthIIRDesigner();",
"type": "ButterworthIIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/... | {
"body": "@Test\n\tpublic void testCalculateNaturalFrequency() {\n\n\t\t//lowpass\n\t\tdouble[] result = iirdesigner.calculateNaturalFrequency(FilterType.LOWPASS, 7, new double[] {10}, new double[] {20}, 5, 40, true);\n\t\tassertEquals(10.359023354921998, result[0], 1e-4);\n\n\t\t//digital lowpass\n\t\tresult = iird... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/ButterworthIIRDesigner.java",
"identifier": "ButterworthIIRDesigner",
"interfaces": "",
"methods": [
{
"class_method_signature": "ButterworthIIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)",
... | {
"body": "@Override\n\tprotected double[] calculateNaturalFrequency(FilterType type, int filterOrder, double[] wp, double[] ws, double gpass, double gstop, boolean analog) {\n\n\t\tdouble[] passb;\n\t\tdouble[] stopb;\n\t\tif (!analog) {\n\t\t\tpassb = prewarpFrequencies(wp);\n\t\t\tstopb = prewarpFrequencies(ws);\n... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_71 | {
"fields": [
{
"declarator": "TEST_SAMPLE_COUNT = 4",
"modifier": "public static final",
"original_string": "public static final int TEST_SAMPLE_COUNT = 4;",
"type": "int",
"var_name": "TEST_SAMPLE_COUNT"
},
{
"declarator": "source",
"modifier": "private",
... | {
"body": "@Test\n\tpublic void testAddSamples() {\n\n\t\tsource.addSamples(new double[] {1.0});\n\t\tsource.addSamples(new double[] {1.1});\n\t\tsource.addSamples(new double[] {1.2});\n\t\tsource.addSamples(new double[] {1.3});\n\n\t\tsource.addSamples(new double[] {1.4});\n\t\tsource.addSamples(new double[] {1.5});... | {
"fields": [
{
"declarator": "nextInsertPos = 0",
"modifier": "protected",
"original_string": "protected int nextInsertPos = 0;",
"type": "int",
"var_name": "nextInsertPos"
},
{
"declarator": "full",
"modifier": "protected",
"original_string": "protected bo... | {
"body": "public void addSamples(double[] newSamples) {\n\n\t\tfor (int i = 0; i < newSamples.length; i++) {\n\t\t\tsamples[nextInsertPos] = newSamples[i];\n\t\t\tincrNextInsertPos();\n\t\t}\n\n\t}",
"class_method_signature": "RoundBufferSampleSource.addSamples(double[] newSamples)",
"constructor": false,
"ful... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_67 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/domain/signal/filter/fft/FFTFilterEngineForExportTest.java",
"identifier": "FFTFilterEngineForExportTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testFiltering() {\n\n\t\tint channelCount = 2;\n\t\tint sampleCount = 100;\n\n\t\tdouble[][] originalSamples = new double[channelCount][sampleCount];\n\n\t\tfor (int channel = 0; channel < channelCount; channel++)\n\t\t\tfor (int i = 0; i < sampleCount; i++)\n\t\t\t\toriginalSamples[ch... | {
"fields": [
{
"declarator": "fftSampleFilter",
"modifier": "private",
"original_string": "private FFTSampleFilter fftSampleFilter;",
"type": "FFTSampleFilter",
"var_name": "fftSampleFilter"
},
{
"declarator": "overlapBuffer",
"modifier": "private",
"origin... | {
"body": "@Override\n\tpublic void getSamples(double[] target, int signalOffset, int count, int arrayOffset) {\n\n\t\tdouble[] samples = new double[count];\n\t\tsource.getSamples(samples, signalOffset, count, 0);\n\n\t\tFourierTransform fourierTransform = new FourierTransform(fftSampleFilter.getWindowType(), fftSamp... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_30 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/InitialStateCalculatorTest.java",
"identifier": "InitialStateCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCalculateSubtrahendForZIN() {\n\n\t\t//coefficients 1\n\t\tInitialStateCalculator calculator = new InitialStateCalculator(getSampleFilterCoefficients1());\n\t\tRealMatrix actual = calculator.calculateSubtrahendForZIN();\n\n\t\tRealMatrix expected = new Array2DRowRealMatrix(new doub... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "private",
"original_string": "private double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "private",
"original_string": "private... | {
"body": "protected RealMatrix calculateSubtrahendForZIN() {\n\t\tint matrixSize = numberOfCoefficients - 1;\n\t\tdouble[][] subtrahendData = new double[matrixSize][matrixSize];\n\n\t\t/* first column are the a coefficients (omitting the first one)\n\t\t * multiplied by -1.\n\t\t */\n\t\tfor (int i = 0; i < matrixSi... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_6 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterCoefficientsTest.java",
"identifier": "FilterCoefficientsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testBilinearTransform() throws BadFilterParametersException {\n\n\t\tdouble[] b;\n\t\tdouble[] a;\n\t\tFilterCoefficients coeffs;\n\t\tdouble[] pythonB;\n\t\tdouble[] pythonA;\n\n\t\t//test 1\n\t\tb = new double[] {5.0, 6.0, 7.0};\n\t\ta = new double[] {1.0, 2.0, 3.0, 4.0};\n\t\tcoeffs... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "private",
"original_string": "private double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "private",
"original_string": "private... | {
"body": "protected void bilinearTransform(double samplingFrequency) throws BadFilterParametersException {\n\n\t\tint D = aCoefficients.length - 1;\n\t\tint N = bCoefficients.length - 1 ;\n\t\tint M = Math.max(D, N);\n\t\tint Dp = M;\n\t\tint Np = M;\n\n\t\tdouble[] bprime = new double[Np + 1];\n\t\tdouble[] aprime ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_47 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/fft/WindowFunctionTest.java",
"identifier": "WindowFunctionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testApplyWindow() {\n\n\t\t//generate bartlett window\n\t\tWindowFunction windowFunction = new WindowFunction(WindowType.BARTLETT);\n\t\twindowFunction.calculateWeights(10);\n\n\t\tdouble[] windowWeights = new double[] {\n\t\t\t0, 0.22222222, 0.44444444, 0.66666667, 0.88888889,\n\t\t\t... | {
"fields": [
{
"declarator": "windowType = WindowType.RECTANGULAR",
"modifier": "protected",
"original_string": "protected WindowType windowType = WindowType.RECTANGULAR;",
"type": "WindowType",
"var_name": "windowType"
},
{
"declarator": "windowParameter = 0",
"... | {
"body": "public double[] applyWindow(double[] data) {\n\t\tcalculateWeights(data.length);\n\t\tdouble[] windowedData = new double[data.length];\n\t\tfor (int i = 0; i < data.length; ++i) {\n\t\t\twindowedData[i] = windowWeights[i] * data[i];\n\t\t}\n\t\treturn windowedData;\n\t}",
"class_method_signature": "Windo... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_10 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/SpecialMathTest.java",
"identifier": "SpecialMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testEvaluatePolynomial() {\n\n\t\tassertEquals(evaluatePolynomial(5, new double[] {3, 0, 1 }), 76.0, 0.00001);\n\t\tassertEquals(evaluatePolynomial(0.13, new double[] {0.7, -6.6, 4.1, 0.3, -3.43, -1}), -1.43368133549, 0.000001);\n\n\t}",
"class_method_signature": "SpecialMathTest.tes... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(SpecialMath.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(SpecialMath.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator"... | {
"body": "public static double evaluatePolynomial(double x, double[] coefficients) {\n\n\t\tdouble value = 0.0;\n\n\t\tfor (int i = 0; i < coefficients.length; i++)\n\t\t\tvalue = value * x + coefficients[i];\n\n\t\treturn value;\n\n\t}",
"class_method_signature": "SpecialMath.evaluatePolynomial(double x, double[]... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_51 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/fft/FourierTransformTest.java",
"identifier": "FourierTransformTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testInverseFFT() {\n\t\tFourierTransform transform = new FourierTransform();\n\t\tdouble[] signal = new double[] {1,4,2,-1,7,4,5,2};\n\t\tComplex[] actualFFT = transform.forwardFFT(signal);\n\n\t\tdouble[] signalAfterInverseFFT = transform.inverseFFT(actualFFT);\n\t\tassertArrayEquals(... | {
"fields": [
{
"declarator": "windowFunction = new WindowFunction(WindowType.RECTANGULAR)",
"modifier": "private",
"original_string": "private WindowFunction windowFunction = new WindowFunction(WindowType.RECTANGULAR);",
"type": "WindowFunction",
"var_name": "windowFunction"
}
... | {
"body": "public double[] inverseFFT(Complex[] fft) {\n\t\tFastFourierTransformer transformer = new FastFourierTransformer();\n\t\tComplex[] complexSignal = transformer.inversetransform(fft);\n\n\t\tdouble[] signal = new double[complexSignal.length];\n\t\tfor (int i = 0; i < complexSignal.length; i++) {\n\t\t\tsigna... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_50 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/fft/FourierTransformTest.java",
"identifier": "FourierTransformTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testForwardFFTNotPowerOf2() {\n\t\tFourierTransform transform = new FourierTransform();\n\t\tdouble[] signal = new double[] {1, 8, 3, -5, 4};\n\n\t\t//these expectedFFT data was obtained from python using the following code:\n\t\t//from numpy import *\n\t\t//a = array((1, 8, 3, -5, ... | {
"fields": [
{
"declarator": "windowFunction = new WindowFunction(WindowType.RECTANGULAR)",
"modifier": "private",
"original_string": "private WindowFunction windowFunction = new WindowFunction(WindowType.RECTANGULAR);",
"type": "WindowFunction",
"var_name": "windowFunction"
}
... | {
"body": "public Complex[] forwardFFT(double[] signal) {\n\t\tFastFourierTransformer transformer = new FastFourierTransformer();\n\t\tdouble[] windowedSignal = windowFunction.applyWindow(signal);\n\t\tdouble[] paddedSignal = padWithZeroIfNecessary(windowedSignal);\n\t\treturn transformer.transform(paddedSignal);\n\n... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_11 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/SpecialMathTest.java",
"identifier": "SpecialMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCalculateCompleteEllipticIntegralOfTheFirstKind() {\n\n\t\tassertEquals(1.8540746773013719, calculateCompleteEllipticIntegralOfTheFirstKind(0.5), 1e-16);\n\t\tassertEquals(1.5707963267948966, calculateCompleteEllipticIntegralOfTheFirstKind(getMachineEpsilon()), 1e-16);\n\n\t}",
"... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(SpecialMath.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(SpecialMath.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator"... | {
"body": "public static double calculateCompleteEllipticIntegralOfTheFirstKind(double m) {\n\n\t\tdouble P[] =\n\t\t{\n\t\t\t1.37982864606273237150E-4,\n\t\t\t2.28025724005875567385E-3,\n\t\t\t7.97404013220415179367E-3,\n\t\t\t9.85821379021226008714E-3,\n\t\t\t6.87489687449949877925E-3,\n\t\t\t6.18901033637687613229... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_46 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/fft/WindowFunctionTest.java",
"identifier": "WindowFunctionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCalculateWeightsHamming() {\n\n\t\tWindowFunction windowFunction = new WindowFunction(WindowType.HAMMING);\n\t\twindowFunction.calculateWeights(20);\n\n\t\tdouble[] windowWeights = new double[] {\n\t\t\t0.08 , 0.10492407, 0.17699537, 0.28840385, 0.42707668,\n\t\t\t0.577986... | {
"fields": [
{
"declarator": "windowType = WindowType.RECTANGULAR",
"modifier": "protected",
"original_string": "protected WindowType windowType = WindowType.RECTANGULAR;",
"type": "WindowType",
"var_name": "windowType"
},
{
"declarator": "windowParameter = 0",
"... | {
"body": "protected void calculateWeights(int length) {\n\t\tif (windowWeights != null && windowWeights.length == length) {\n\t\t\treturn;\n\t\t}\n\t\twindowWeights = new double[length];\n\t\tdouble n = length;\n\t\tswitch (windowType) {\n\t\tcase BARTLETT:\n\t\t\tfor (int i = 0; i < length; ++i) {\n\t\t\t\twindowWe... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_7 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/ComplexPolynomialTest.java",
"identifier": "ComplexPolynomialTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetDegree() {\n\t\t//test1\n\t\tComplex[] coefficients = new Complex[] {new Complex(1.0, 0.5), new Complex(0.0, 3.0)};\n\t\tComplexPolynomial polynomial = new ComplexPolynomial(coefficients);\n\n\t\tassertEquals(1, polynomial.getDegree());\n\n\t\t//test2\n\t\tcoefficients = new Com... | {
"fields": [
{
"declarator": "coefficients",
"modifier": "private",
"original_string": "private Complex[] coefficients;",
"type": "Complex[]",
"var_name": "coefficients"
}
],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/math/ComplexPolynomial.java",
"identif... | {
"body": "public int getDegree() {\n\t\treturn coefficients.length - 1;\n\t}",
"class_method_signature": "ComplexPolynomial.getDegree()",
"constructor": false,
"full_signature": "public int getDegree()",
"identifier": "getDegree",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return"... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_31 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/InitialStateCalculatorTest.java",
"identifier": "InitialStateCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetInitialState() {\n\n\t\t//coefficients 1\n\t\tInitialStateCalculator calculator = new InitialStateCalculator(getSampleFilterCoefficients1());\n\t\tdouble[] actual = calculator.getInitialState();\n\n\t\tdouble[] expected = new double[] {0.99958345, -1.68782358, 0.73058189};\n\n\... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "private",
"original_string": "private double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "private",
"original_string": "private... | {
"body": "public double[] getInitialState() {\n\t\treturn initialState;\n\t}",
"class_method_signature": "InitialStateCalculator.getInitialState()",
"constructor": false,
"full_signature": "public double[] getInitialState()",
"identifier": "getInitialState",
"invocations": [],
"modifiers": "public",
"p... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_66 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/domain/signal/filter/export/IIRMultichannelSingleFilterForExportTest.java",
"identifier": "IIRMultichannelSingleFilterForExportTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetSamples() throws BadFilterParametersException, IOException {\n\n\t\t TimeDomainSampleFilter timeDomainFilter = new TimeDomainSampleFilter(FilterType.HIGHPASS,\n\t\t\t\t\tApproximationFunctionType.BUTTERWORTH,\n\t\t\t\t\tnew double[] {5.0, 0.0}, new double[] {1.5, 0.0}, 3.0, 10.0... | {
"fields": [
{
"declarator": "temporaryFile1 = new File(\"exportsub1.bin.tmp\")",
"modifier": "private",
"original_string": "private File temporaryFile1 = new File(\"exportsub1.bin.tmp\");",
"type": "File",
"var_name": "temporaryFile1"
},
{
"declarator": "temporaryFile... | {
"body": "@Override\n\tpublic void getSamples(int channel, double[] target, int signalOffset, int count, int arrayOffset) {\n\t\tsuper.getSamples(channel, target, signalOffset, count, arrayOffset);\n\n\t\tif (signalOffset + count == this.getSampleCount(channel) && filteringDone) {\n\t\t\t//after writing the last sam... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_70 | {
"fields": [
{
"declarator": "TEST_CHANNEL_COUNT = 4",
"modifier": "public static final",
"original_string": "public static final int TEST_CHANNEL_COUNT = 4;",
"type": "int",
"var_name": "TEST_CHANNEL_COUNT"
},
{
"declarator": "TEST_SAMPLE_COUNT = 10",
"modifier"... | {
"body": "@Test\n\tpublic void testGetSamples() {\n\n\t\tdouble[] target = new double[TEST_SAMPLE_COUNT];\n\t\ttheSource.getSamples(0 , target, 0, TEST_SAMPLE_COUNT, 0);\n\t\tfor (int i = 0; i < TEST_SAMPLE_COUNT; i++) {\n\t\t\tassertEquals(0.0, target[i], 0.1);\n\t\t}\n\t\ttheSource.addSamples(new float[] {1.0F, 2.... | {
"fields": [
{
"declarator": "listenerList = new EventListenerList()",
"modifier": "private",
"original_string": "private EventListenerList listenerList = new EventListenerList();",
"type": "EventListenerList",
"var_name": "listenerList"
},
{
"declarator": "nextInsertP... | {
"body": "synchronized double[][] getSamples() {\n\t\treturn this.samples;\n\t}",
"class_method_signature": "RoundBufferMultichannelSampleSource.getSamples()",
"constructor": false,
"full_signature": "synchronized double[][] getSamples()",
"identifier": "getSamples",
"invocations": [],
"modifiers": "sync... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_27 | {
"fields": [
{
"declarator": "iirdesigner = new ButterworthIIRDesigner()",
"modifier": "",
"original_string": "ButterworthIIRDesigner iirdesigner = new ButterworthIIRDesigner();",
"type": "ButterworthIIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/... | {
"body": "@Test\n\tpublic void testCalculateFilterOrder() throws BadFilterParametersException {\n\n\t\t//lowpass\n\t\tint filterOrder = iirdesigner.calculateFilterOrder(FilterType.LOWPASS, new double[] {10, 0.0}, new double[] {20, 0.0}, 5, 40, true);\n\t\tassertEquals(7, filterOrder);\n\n\t\t//digital lowpass\n\t\tf... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/ButterworthIIRDesigner.java",
"identifier": "ButterworthIIRDesigner",
"interfaces": "",
"methods": [
{
"class_method_signature": "ButterworthIIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)",
... | {
"body": "@Override\n\tprotected int calculateFilterOrder(FilterType type, double[] wp, double[] ws, double gpass, double gstop, boolean analog) throws BadFilterParametersException {\n\n\t\tdouble[] passb;\n\t\tdouble[] stopb;\n\t\tif (!analog) {\n\t\t\tpassb = prewarpFrequencies(wp);\n\t\t\tstopb = prewarpFrequenci... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_0 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterCoefficientsTest.java",
"identifier": "FilterCoefficientsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetFilterOrder() {\n\t\tFilterCoefficients coeffs = new FilterCoefficients(\n\t\t\tnew double[] {0.01875398, 0.0937699, 0.18753981, 0.18753981, 0.0937699, 0.01875398},\n\t\t\tnew double[] {1.0, -1.13877891, 1.08854509, -0.46710982, 0.1315193});\n\n\t\tassertEquals(5, coeffs.getFilt... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "private",
"original_string": "private double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "private",
"original_string": "private... | {
"body": "public int getFilterOrder() {\n\t\treturn Math.max(aCoefficients.length - 1, bCoefficients.length - 1);\n\t}",
"class_method_signature": "FilterCoefficients.getFilterOrder()",
"constructor": false,
"full_signature": "public int getFilterOrder()",
"identifier": "getFilterOrder",
"invocations": [
... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_41 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/ArrayOperationsTest.java",
"identifier": "ArrayOperationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testConvolve() {\n\n\t\tdouble[] array1;\n\t\tdouble[] array2;\n\n\t\t//test data set 1\n\t\tarray1 = new double[] {1, 1, 1};\n\t\tarray2 = new double[] {1, 2, 3};\n\n\t\tassertArrayEquals(ArrayOperations.convolve(array1, array2), new double[] {1, 3, 6, 5, 3}, 0.01);\n\n\t\t//test data... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/ArrayOperations.java",
"identifier": "ArrayOperations",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArrayOperations.padArrayWithZerosToSize(double[] array, int newSize)",
"constructor": false,
"full_signature... | {
"body": "public static double[] convolve(double[] array1, double[] array2) {\n\n\t\tint n = array1.length + array2.length - 1;\n\t\tdouble[] result = new double[n];\n\t\tdouble[] f = padArrayWithZerosToSize(array1, n);\n\t\tdouble[] g = padArrayWithZerosToSize(array2, n);\n\n\t\tint i;\n\t\tint fpos, gpos;\n\n\t\tf... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_16 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/SpecialMathTest.java",
"identifier": "SpecialMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testIsEven() {\n\t\tassertTrue(isEven(2));\n\t\tassertFalse(isEven(5));\n\t}",
"class_method_signature": "SpecialMathTest.testIsEven()",
"constructor": false,
"full_signature": "@Test public void testIsEven()",
"identifier": "testIsEven",
"invocations": [
"assertTrue",
... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(SpecialMath.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(SpecialMath.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator"... | {
"body": "public static boolean isEven(int x) {\n\t\tif (x % 2 == 0)\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"class_method_signature": "SpecialMath.isEven(int x)",
"constructor": false,
"full_signature": "public static boolean isEven(int x)",
"identifier": "isEven",
"invocations": [],
"modifiers": ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_57 | {
"fields": [
{
"declarator": "TEST_CHANNEL_COUNT = 7",
"modifier": "public static final",
"original_string": "public static final int TEST_CHANNEL_COUNT = 7;",
"type": "int",
"var_name": "TEST_CHANNEL_COUNT"
},
{
"declarator": "TEST_SAMPLE_COUNT = 10",
"modifier"... | {
"body": "@Test\n\tpublic void testAddFilterForSpecifiedChannels() {\n\t\tTimeDomainSampleFilter definition = new TimeDomainSampleFilter(FilterType.LOWPASS, ApproximationFunctionType.BUTTERWORTH,\n\t\t\t\tnew double[] {20, 0}, new double[] {30, 8}, 5.0, 20.0);\n\t\tdefinition.setSamplingFrequency(128.0);\n\t\tAbstra... | {
"fields": [
{
"declarator": "originalSource",
"modifier": "protected",
"original_string": "protected OriginalMultichannelSampleSource originalSource;",
"type": "OriginalMultichannelSampleSource",
"var_name": "originalSource"
},
{
"declarator": "logger = Logger.getLogg... | {
"body": "public void addFilter(SinglechannelSampleFilterEngine filter) {\n\t\tint cnt = chains.size();\n\t\tLinkedList<SinglechannelSampleFilterEngine> chain;\n\t\tfor (int i=0; i<cnt; i++) {\n\t\t\tchain = chains.get(i);\n\t\t\tchain.add(filter);\n\t\t}\n\t}",
"class_method_signature": "MultichannelSampleFilter.... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_20 | {
"fields": [
{
"declarator": "iirdesigner = new Chebyshev2IIRDesigner()",
"modifier": "",
"original_string": "Chebyshev2IIRDesigner iirdesigner = new Chebyshev2IIRDesigner();",
"type": "Chebyshev2IIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/org/... | {
"body": "@Test\n\tpublic void testCalculateChebyshev2Prototype() {\n\n\t\tFilterZerosPolesGain zpk1 = iirdesigner.calculatePrototype(3, 3);\n\t\tComplex[] zeros = new Complex[] {new Complex(0.0, -1.15470054), new Complex(0.0, 1.15470054)};\n\t\tComplex[] poles = new Complex[] {new Complex(-0.17737632,-1.07757832), ... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/Chebyshev2IIRDesigner.java",
"identifier": "Chebyshev2IIRDesigner",
"interfaces": "",
"methods": [
{
"class_method_signature": "Chebyshev2IIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)",
"c... | {
"body": "@Override\n\tprotected FilterZerosPolesGain calculatePrototype(int filterOrder, double gpass, double gstop) {\n\t\treturn calculatePrototype(filterOrder, gstop);\n\t}",
"class_method_signature": "Chebyshev2IIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_61 | {
"fields": [
{
"declarator": "engine",
"modifier": "private",
"original_string": "private OnlineIIRSinglechannelSampleFilter engine;",
"type": "OnlineIIRSinglechannelSampleFilter",
"var_name": "engine"
}
],
"file": "svarog/src/test/java/org/signalml/domain/signal/filter/iir/... | {
"body": "@Test\n\tpublic void testCalculateNewFilteredSamples() {\n\n\t\tcoefficients = new FilterCoefficients(new double[] {1.0, 0.0, 0.0},\n\t\t\t\t\t\t\t\t\t\t\t new double[] {1.0, 0.0, 0.0});\n\n\t\tengine = getEngine(source, coefficients);\n\n\t\t//adding whole at once\n\t\tdouble[] samples = new double[TEST_... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(OnlineIIRSinglechannelSampleFilter.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(OnlineIIRSinglechannelSampleFilter.class);",
"type": "Logger",
"var_n... | {
"body": "protected double[] calculateNewFilteredSamples(double[] unfilteredSamplesCache,\n\t\t\tdouble[] filteredSamplesCache, int newSamples) {\n\t\treturn calculateNewFilteredSamples(bCoefficients, aCoefficients, filterOrder, unfilteredSamplesCache, filteredSamplesCache, newSamples);\n\t}",
"class_method_signat... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_36 | {
"fields": [
{
"declarator": "iirdesigner = new EllipticIIRDesigner()",
"modifier": "",
"original_string": "EllipticIIRDesigner iirdesigner = new EllipticIIRDesigner();",
"type": "EllipticIIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/org/signalml... | {
"body": "@Test\n\tpublic void testCalculateNaturalFrequency() throws BadFilterParametersException {\n\n\t\tdouble[] wn;\n\n\t\t//test 1\n\t\twn = iirdesigner.calculateNaturalFrequency(FilterType.BANDPASS, 7, new double[] {0.6, 0.7}, new double[] {0.55, 0.8}, 0.5, 100, true);\n\t\tassertEquals(new double[] {0.6, 0.7... | {
"fields": [
{
"declarator": "EPSILON = 2e-16",
"modifier": "private static final",
"original_string": "private static final double EPSILON = 2e-16;",
"type": "double",
"var_name": "EPSILON"
}
],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/EllipticIIRDesigner... | {
"body": "@Override\n\tprotected double[] calculateNaturalFrequency(FilterType type, int filterOrder, double[] wp, double[] ws, double gpass, double gstop, boolean analog) throws BadFilterParametersException {\n\n\t\tif (type.isBandstop()) {\n\n\t\t\tdouble[] passb;\n\t\t\tdouble[] stopb;\n\t\t\tif (!analog) {\n\t\t... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_37 | {
"fields": [
{
"declarator": "iirdesigner = new EllipticIIRDesigner()",
"modifier": "",
"original_string": "EllipticIIRDesigner iirdesigner = new EllipticIIRDesigner();",
"type": "EllipticIIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/org/signalml... | {
"body": "@Test\n\tpublic void testCalculateFilterOrder() throws BadFilterParametersException {\n\n\t\tint filterOrder;\n\n\t\t//digital lowpass\n\t\tfilterOrder = iirdesigner.calculateFilterOrder(FilterType.LOWPASS, 0.4, 0.7, 3, 40, false);\n\t\tassertEquals(3, filterOrder);\n\n\t\t//digital highpass\n\t\tfilterOrd... | {
"fields": [
{
"declarator": "EPSILON = 2e-16",
"modifier": "private static final",
"original_string": "private static final double EPSILON = 2e-16;",
"type": "double",
"var_name": "EPSILON"
}
],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/EllipticIIRDesigner... | {
"body": "@Override\n\tprotected int calculateFilterOrder(FilterType type, double[] wp, double[] ws, double gpass, double gstop, boolean analog) throws BadFilterParametersException {\n\n\t\tdouble[] passb;\n\t\tdouble[] stopb;\n\t\tif (!analog) {\n\t\t\tpassb = prewarpFrequencies(wp);\n\t\t\tstopb = prewarpFrequenci... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_60 | {
"fields": [
{
"declarator": "engine",
"modifier": "private",
"original_string": "private OnlineIIRSinglechannelSampleFilter engine;",
"type": "OnlineIIRSinglechannelSampleFilter",
"var_name": "engine"
}
],
"file": "svarog/src/test/java/org/signalml/domain/signal/filter/iir/... | {
"body": "@Test\n\tpublic void testGetFilteredSamplesCache() {\n\n\t\tcoefficients = new FilterCoefficients(new double[] {1.0, 0.0, 0.0, 0.0},\n\t\t\t\t\t\t\t\t\t\t\t new double[] {1.0, 0.0, 0.0, 0.0});\n\n\t\tengine = getEngine(source, coefficients);\n\n\t\tdouble[] fCache = engine.getFilteredSamplesCache(source.g... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(OnlineIIRSinglechannelSampleFilter.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(OnlineIIRSinglechannelSampleFilter.class);",
"type": "Logger",
"var_n... | {
"body": "protected double[] getFilteredSamplesCache(int newSamples) {\n\t\tint filteredCacheSize = newSamples + filterOrder;\n\t\tint zeroPaddingSize = 0;\n\t\tdouble[] filteredSamplesCache = new double[filteredCacheSize];\n\n\t\tif (filtered == null) {\n\t\t\tfiltered = new RoundBufferSampleSource(source.getSample... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_76 | {
"fields": [
{
"declarator": "file",
"modifier": "private",
"original_string": "private File file;",
"type": "File",
"var_name": "file"
},
{
"declarator": "descriptor = new SignalExportDescriptor()",
"modifier": "private",
"original_string": "private Signal... | {
"body": "@Test\n\tpublic void testGetSamples2() throws IOException {\n\n\t\tdouble[][] samples = new double[][]{\n\t\t\t\t{1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0},\n\t\t\t\t{11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0}};\n\t\tDoubleArraySampleSource originalSampleSource = new DoubleArraySampleSource(samples, 2, 7);\n\t\tRe... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/domain/signal/raw/ReversedMultichannelSampleProcessor.java",
"identifier": "ReversedMultichannelSampleProcessor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ReversedMultichannelSampleProcessor.ReversedMultichannelSampleProce... | {
"body": "@Override\n\tpublic void getSamples(int channel, double[] target, int signalOffset, int count, int arrayOffset) {\n\t\tint newSignalOffset = source.getSampleCount(channel) - signalOffset - count;\n\n\t\tdouble[] temporaryTarget = new double[count];\n\t\tsource.getSamples(channel, temporaryTarget, newSignal... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_21 | {
"fields": [
{
"declarator": "iirdesigner = new Chebyshev2IIRDesigner()",
"modifier": "",
"original_string": "Chebyshev2IIRDesigner iirdesigner = new Chebyshev2IIRDesigner();",
"type": "Chebyshev2IIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/org/... | {
"body": "@Test\n\tpublic void testCalculateNaturalFrequency() throws BadFilterParametersException {\n\n\t\tdouble[] wna;\n\t\tdouble wn;\n\n\t\t//digital lowpass\n\t\twn = iirdesigner.calculateNaturalFrequency(FilterType.LOWPASS, 7, 0.6, 0.9, 0.5, 100.0, false);\n\t\tassertEquals(0.86590513063084507, wn, 1e-8);\n\n... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/Chebyshev2IIRDesigner.java",
"identifier": "Chebyshev2IIRDesigner",
"interfaces": "",
"methods": [
{
"class_method_signature": "Chebyshev2IIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)",
"c... | {
"body": "@Override\n\tprotected double[] calculateNaturalFrequency(FilterType type, int filterOrder, double[] wp, double[] ws, double gpass, double gstop, boolean analog) {\n\n\t\tdouble[] passb;\n\t\tdouble[] stopb;\n\t\tif (!analog) {\n\t\t\tpassb = prewarpFrequencies(wp);\n\t\t\tstopb = prewarpFrequencies(ws);\n... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_56 | {
"fields": [
{
"declarator": "TEST_CHANNEL_COUNT = 7",
"modifier": "public static final",
"original_string": "public static final int TEST_CHANNEL_COUNT = 7;",
"type": "int",
"var_name": "TEST_CHANNEL_COUNT"
},
{
"declarator": "TEST_SAMPLE_COUNT = 10",
"modifier"... | {
"body": "@Test\n\tpublic void testAddFilterAllChannels() {\n\t\tTimeDomainSampleFilter definition = new TimeDomainSampleFilter(FilterType.LOWPASS, ApproximationFunctionType.BUTTERWORTH,\n\t\t\t\tnew double[] {20, 0}, new double[] {40, 0}, 3.0, 20.0);\n\t\tdefinition.setSamplingFrequency(128.0);\n\t\tAbstractIIRSing... | {
"fields": [
{
"declarator": "originalSource",
"modifier": "protected",
"original_string": "protected OriginalMultichannelSampleSource originalSource;",
"type": "OriginalMultichannelSampleSource",
"var_name": "originalSource"
},
{
"declarator": "logger = Logger.getLogg... | {
"body": "public void addFilter(SinglechannelSampleFilterEngine filter) {\n\t\tint cnt = chains.size();\n\t\tLinkedList<SinglechannelSampleFilterEngine> chain;\n\t\tfor (int i=0; i<cnt; i++) {\n\t\t\tchain = chains.get(i);\n\t\t\tchain.add(filter);\n\t\t}\n\t}",
"class_method_signature": "MultichannelSampleFilter.... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_17 | {
"fields": [
{
"declarator": "iirdesigner = new Chebyshev1IIRDesigner()",
"modifier": "",
"original_string": "Chebyshev1IIRDesigner iirdesigner = new Chebyshev1IIRDesigner();",
"type": "Chebyshev1IIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/org/... | {
"body": "@Test\n\tpublic void testCalculateChebyshev1Prototype() {\n\n\t\tFilterZerosPolesGain zpk1 = iirdesigner.calculatePrototype(3, 3);\n\t\tComplex[] zeros = new Complex[0];\n\t\tComplex[] poles = new Complex[] {new Complex(-0.14931010, 9.03814429e-01), new Complex(-0.29862021, 6.39042136e-17),\n\t\t\t\t\tnew ... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/Chebyshev1IIRDesigner.java",
"identifier": "Chebyshev1IIRDesigner",
"interfaces": "",
"methods": [
{
"class_method_signature": "Chebyshev1IIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)",
"c... | {
"body": "@Override\n\tprotected FilterZerosPolesGain calculatePrototype(int filterOrder, double gpass, double gstop) {\n\t\treturn calculatePrototype(filterOrder, gpass);\n\t}",
"class_method_signature": "Chebyshev1IIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)",
"constructor": fals... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_40 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/ArrayOperationsTest.java",
"identifier": "ArrayOperationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testPadWithZeros() {\n\n\t\tdouble[] array;\n\t\tdouble[] paddedArray;\n\n\t\tarray = new double[] {};\n\t\tpaddedArray = ArrayOperations.padArrayWithZerosToSize(array, 0);\n\t\tassertEquals(0, paddedArray.length);\n\n\t\tpaddedArray = ArrayOperations.padArrayWithZerosToSize(array, 2);... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/ArrayOperations.java",
"identifier": "ArrayOperations",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArrayOperations.padArrayWithZerosToSize(double[] array, int newSize)",
"constructor": false,
"full_signature... | {
"body": "public static double[] padArrayWithZerosToSize(double[] array, int newSize) {\n\n\t\tassert(newSize >= array.length);\n\n\t\tdouble[] paddedArray = new double[newSize];\n\n\t\tSystem.arraycopy(array, 0, paddedArray, 0, array.length);\n\n\t\tfor (int i = array.length; i < paddedArray.length; i++) {\n\t\t\tp... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_1 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterCoefficientsTest.java",
"identifier": "FilterCoefficientsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testNormalize() throws BadFilterParametersException {\n\n\t\tFilterCoefficients coeffs = new FilterCoefficients(new double[] {0.1, 0.2, 0.3}, new double[] {0.7, 0.5, 0.3});\n\t\tcoeffs.normalize();\n\t\tassertEquals(new double[] {0.14285714, 0.28571429, 0.42857143}, coeffs.getBCoeffici... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "private",
"original_string": "private double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "private",
"original_string": "private... | {
"body": "protected void normalize() throws BadFilterParametersException {\n\n\t\tint i;\n\n\t\t//finding the first non zero A Coefficient\n\t\ti = 0;\n\t\twhile (i < aCoefficients.length && aCoefficients[i] == 0)\n\t\t\ti++;\n\n\t\tint firstNonZero = i;\n\n\t\t//deleting zero coefficients padding from aCoefficients... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_55 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/app/worker/signal/SynchronizeTagsWithTriggerWorkerTest.java",
"identifier": "SynchronizeTagsWithTriggerWorkerTest",
"interfaces": "",
"superclass": "extends AbstractSynchronizationTest"
} | {
"body": "@Test\n\tpublic void testRemoveExcessiveTags() throws InterruptedException, ExecutionException {\n\n\t\tStyledTagSet tagSet = parameters.getTagSet();\n\t\tInteger[] positions = new Integer[] { 1, 2 };\n\n\t\tTag[] remainingTags = new Tag[positions.length];\n\t\tfor (int i = 0; i < positions.length; i++)\n\... | {
"fields": [
{
"declarator": "parameters",
"modifier": "private",
"original_string": "private SynchronizeTagsWithTriggerParameters parameters;",
"type": "SynchronizeTagsWithTriggerParameters",
"var_name": "parameters"
},
{
"declarator": "positions",
"modifier": "... | {
"body": "protected void removeExcessiveTags() {\n\t\tfor (int i = tagSet.getChannelTagCount()-1; i >= positions.length ; i--) {\n\t\t\tTag tag = tagSet.getChannelTagAt(i);\n\t\t\ttagSet.removeTag(tag);\n\t\t}\n\t}",
"class_method_signature": "SynchronizeTagsWithTriggerWorker.removeExcessiveTags()",
"constructor... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_14 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/SpecialMathTest.java",
"identifier": "SpecialMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCombinationsTest() {\n\n\t\tassertEquals(10, combinations(5, 3));\n\t\tassertEquals(6, combinations(4, 2));\n\t\tassertEquals(220, combinations(12, 3));\n\n\t}",
"class_method_signature": "SpecialMathTest.testCombinationsTest()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(SpecialMath.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(SpecialMath.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator"... | {
"body": "public static int combinations(int n, int k) {\n\n\t\tif (!((0 <= k) && (k <= n)))\n\t\t\tthrow new IllegalArgumentException(\"The input arguments should fulfill 0<=k<=n\");\n\n\t\tint numerator = 1;\n\t\tfor (int i = n; i > k; i--)\n\t\t\tnumerator *= i;\n\n\t\treturn numerator / factorial(n - k);\n\n\t}"... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_43 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/ArrayOperationsTest.java",
"identifier": "ArrayOperationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testTrimArrayToSize() {\n\n\t\tdouble[] array = new double[] {1, 2, 3, 4, 5, 6};\n\t\tassertArrayEquals(ArrayOperations.trimArrayToSize(array, 4), new double[] {1, 2, 3, 4}, 0.001);\n\n\t}",
"class_method_signature": "ArrayOperationsTest.testTrimArrayToSize()",
"constructor": false... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/ArrayOperations.java",
"identifier": "ArrayOperations",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArrayOperations.padArrayWithZerosToSize(double[] array, int newSize)",
"constructor": false,
"full_signature... | {
"body": "public static double[] trimArrayToSize(double[] array, int size) {\n\n\t\tassert(array.length >= size);\n\n\t\tdouble[] trimmedArray = new double[size];\n\t\tSystem.arraycopy(array, 0, trimmedArray, 0, size);\n\t\treturn trimmedArray;\n\n\t}",
"class_method_signature": "ArrayOperations.trimArrayToSize(do... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_38 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterTimeDomainResponseCalculatorTest.java",
"identifier": "FilterTimeDomainResponseCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetStepResponse() {\n\n\t\tcheckStepResponse(\n\t\t\tnew double[] {0.34,0.12, 0.6, 0.33},\n\t\t\tnew double[] {1, 0.4, 0.01, 0.02},\n\t\t\t128.0,\n\t\t\tnew double[] { 0.3400, 0.3240, 0.9270, 1.0092,\n\t\t\t\t\t\t\t0.9706, 0.9731, 0.9709, 0.9725,\n\t\t\t\t\t\t\t0.9718, 0.9721, 0.9... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/FilterTimeDomainResponseCalculator.java",
"identifier": "FilterTimeDomainResponseCalculator",
"interfaces": "",
"methods": [
{
"class_method_signature": "FilterTimeDomainResponseCalculator.FilterTimeDomainResponseCalculator(... | {
"body": "public FilterTimeDomainResponse getStepResponse(int numberOfPoints) {\n\n\t\tdouble[] excitation = generateStepExcitation(numberOfPoints);\n\t\tdouble[] stepResponseAmplitudes = AbstractIIRSinglechannelSampleFilter.filter(filterCoefficients.getBCoefficients(), filterCoefficients.getACoefficients(), excitat... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_2 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterCoefficientsTest.java",
"identifier": "FilterCoefficientsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testTransformLowpassToLowpass() throws BadFilterParametersException {\n\n\t\tdouble[] b = new double[] {0.06264858};\n\t\tdouble[] a = new double[] {1.00000000, 0.57450003, 1.41502514, 0.54893711,\n\t\t\t\t\t\t\t\t 0.40796631, 0.06264858\n\t\t\t\t\t\t\t\t };\n\t\tFilterCoefficients ... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "private",
"original_string": "private double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "private",
"original_string": "private... | {
"body": "protected void transformLowpassToLowpass(double w0) throws BadFilterParametersException {\n\n\t\tint numberOfCoeffs = getNumberOfCoefficients();\n\t\tdouble[] powers = new double[numberOfCoeffs];\n\t\tint i;\n\n\t\tfor (i = 0; i < numberOfCoeffs; i++)\n\t\t\tpowers[i] = Math.pow(w0, numberOfCoeffs - 1 - i)... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_59 | {
"fields": [
{
"declarator": "engine",
"modifier": "private",
"original_string": "private OnlineIIRSinglechannelSampleFilter engine;",
"type": "OnlineIIRSinglechannelSampleFilter",
"var_name": "engine"
}
],
"file": "svarog/src/test/java/org/signalml/domain/signal/filter/iir/... | {
"body": "@Test\n\tpublic void testGetUnfilteredSamplesCache() {\n\n\t\tcoefficients = new FilterCoefficients(new double[] {1.0,0.0,0.0,0.0}, new double[] {1.0,0.0,0.0,0.0});\n\t\tengine = getEngine(source, coefficients);\n\n\t\t//testing empty then full\n\t\tfloat[] samples = new float[TEST_SAMPLE_COUNT];\n\t\tfor ... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(OnlineIIRSinglechannelSampleFilter.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(OnlineIIRSinglechannelSampleFilter.class);",
"type": "Logger",
"var_n... | {
"body": "protected double[] getUnfilteredSamplesCache(int newSamples) {\n\t\tint unfilteredSamplesNeeded = newSamples + filterOrder;\n\t\tint zeroPaddingSize = 0;\n\t\tdouble[] unfilteredSamplesCache = new double[unfilteredSamplesNeeded];\n\n\t\tif (unfilteredSamplesNeeded > source.getSampleCount()) {\n\t\t\tzeroPa... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_18 | {
"fields": [
{
"declarator": "iirdesigner = new Chebyshev1IIRDesigner()",
"modifier": "",
"original_string": "Chebyshev1IIRDesigner iirdesigner = new Chebyshev1IIRDesigner();",
"type": "Chebyshev1IIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/org/... | {
"body": "@Test\n\tpublic void testCalculateNaturalFrequency() {\n\n\t\tdouble[] wn = iirdesigner.calculateNaturalFrequency(FilterType.BANDPASS, 10, new double[] {0.6, 0.7}, new double[] {0.55, 0.8}, 0.5, 100, true);\n\t\tassertEquals(new double[] {0.6, 0.7}, wn, 1e-16);\n\n\t\twn = iirdesigner.calculateNaturalFrequ... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/Chebyshev1IIRDesigner.java",
"identifier": "Chebyshev1IIRDesigner",
"interfaces": "",
"methods": [
{
"class_method_signature": "Chebyshev1IIRDesigner.calculatePrototype(int filterOrder, double gpass, double gstop)",
"c... | {
"body": "@Override\n\tprotected double[] calculateNaturalFrequency(FilterType type, int filterOrder, double[] wp, double[] ws, double gpass, double gstop, boolean analog) {\n\n\t\tif (type.isBandstop()) {\n\n\t\t\tdouble[] passb;\n\t\t\tdouble[] stopb;\n\t\t\tif (!analog) {\n\t\t\t\tpassb = prewarpFrequencies(wp);\... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_34 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/IIRDesignerTest.java",
"identifier": "IIRDesignerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testDesignDigitalFilter() throws BadFilterParametersException {\n\n\t\tdouble[] pythonB;\n\t\tdouble[] pythonA;\n\t\tFilterCoefficients coeffs;\n\n\t\tpythonB = new double[] {0.50611529, -3.542807 , 10.62842101, -17.71403501,\n\t\t\t\t\t\t\t\t17.71403501, -10.62842101, 3.542807 ,... | {
"fields": [
{
"declarator": "enableLogger = true",
"modifier": "protected static",
"original_string": "protected static boolean enableLogger = true;",
"type": "boolean",
"var_name": "enableLogger"
}
],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/IIRDesigner.... | {
"body": "public static FilterCoefficients designDigitalFilter(ApproximationFunctionType approximationFunctionType, FilterType type, double[] passbandEdgeFrequencies, double[] stopbandEdgeFrequencies, double passbandRipple, double stopbandAttenuation, double samplingFrequency) throws BadFilterParametersException {\n... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_63 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/domain/signal/filter/iir/IIRFilterEngineTest.java",
"identifier": "IIRFilterEngineTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testFilter() {\n\t\t/*\n\t\t * Tests if filtering the whole signal at once using the IIRFilter class\n\t\t * gives same results as filtering two adjacent parts of the signal\n\t\t * (the IIRFilter should remember its state between filtering).\n\t\t */\n\n\t\tdouble[] bCoefficients = ne... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "protected",
"original_string": "protected double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "protected",
"original_string": "p... | {
"body": "public double[] filter(double[] input) {\n\t\t/**\n\t\t * The filter function is implemented as a direct II transposed structure.\n\t\t * It is implemented as the lfilter function in the Scipy library.\n\t\t * Compare with Scipy source code: scipy/signal/lfilter.c#@NAME@_filt\n\t\t */\n\n\t\tint bi, ai, zi... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_75 | {
"fields": [
{
"declarator": "file",
"modifier": "private",
"original_string": "private File file;",
"type": "File",
"var_name": "file"
},
{
"declarator": "descriptor = new SignalExportDescriptor()",
"modifier": "private",
"original_string": "private Signal... | {
"body": "@Test\n\tpublic void testGetSamples() throws IOException {\n\n\t\tfile = new File(\"reversed_test.bin\");\n\t\tdouble[][] samples = new double[][]{\n\t\t\t\t{1.0, 2.0, 3.0, 4.0},\n\t\t\t\t{5.0, 6.0, 7.0, 8.0}};\n\t\tDoubleArraySampleSource originalSampleSource = new DoubleArraySampleSource(samples, 2, 4);\... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/domain/signal/raw/ReversedMultichannelSampleProcessor.java",
"identifier": "ReversedMultichannelSampleProcessor",
"interfaces": "",
"methods": [
{
"class_method_signature": "ReversedMultichannelSampleProcessor.ReversedMultichannelSampleProce... | {
"body": "@Override\n\tpublic void getSamples(int channel, double[] target, int signalOffset, int count, int arrayOffset) {\n\t\tint newSignalOffset = source.getSampleCount(channel) - signalOffset - count;\n\n\t\tdouble[] temporaryTarget = new double[count];\n\t\tsource.getSamples(channel, temporaryTarget, newSignal... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_22 | {
"fields": [
{
"declarator": "iirdesigner = new Chebyshev1IIRDesigner()",
"modifier": "",
"original_string": "Chebyshev1IIRDesigner iirdesigner = new Chebyshev1IIRDesigner();",
"type": "Chebyshev1IIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/org/... | {
"body": "@Test\n\tpublic void testCalculateFilterOrder() throws BadFilterParametersException {\n\n\t\tint filterOrder;\n\n\t\t//digital lowpass\n\t\tfilterOrder = iirdesigner.calculateFilterOrder(FilterType.LOWPASS, 0.4, 0.7, 3, 40, false);\n\t\tassertEquals(4, filterOrder);\n\n\t\t//digital highpass\n\t\tfilterOrd... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/ChebyshevIIRDesigner.java",
"identifier": "ChebyshevIIRDesigner",
"interfaces": "",
"methods": [
{
"class_method_signature": "ChebyshevIIRDesigner.calculateFilterOrder(FilterType type, double[] wp, double[] ws, double gpass,... | {
"body": "@Override\n\tprotected int calculateFilterOrder(FilterType type, double[] wp, double[] ws, double gpass, double gstop, boolean analog) throws BadFilterParametersException {\n\n\t\tdouble[] passb;\n\t\tdouble[] stopb;\n\t\tif (!analog) {\n\t\t\tpassb = prewarpFrequencies(wp);\n\t\t\tstopb = prewarpFrequenci... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_23 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterZerosPolesGainTest.java",
"identifier": "FilterZerosPolesGainTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testConvertToABCoefficients() {\n\n\t\t//test 1\n\t\tComplex[] zeros = new Complex[0];\n\t\tComplex[] poles = new Complex[] {new Complex(-0.08517040, 0.94648443),\n\t\t\t\t\tnew Complex(-0.20561953, 0.39204669), new Complex(-0.20561953, -0.39204669),\n\t\t\t\t\tnew Complex(-0.08517040,... | {
"fields": [
{
"declarator": "zeros",
"modifier": "",
"original_string": "Complex[] zeros;",
"type": "Complex[]",
"var_name": "zeros"
},
{
"declarator": "poles",
"modifier": "",
"original_string": "Complex[] poles;",
"type": "Complex[]",
"var_na... | {
"body": "protected FilterCoefficients convertToBACoefficients() {\n\n\t\tComplexPolynomial numeratorPoly;\n\t\tComplexPolynomial denominatorPoly;\n\t\tComplex[] complexNumeratorCoeffs;\n\t\tComplex[] complexDenominatorCoeffs;\n\t\tdouble[] realNumeratorCoeffs;\n\t\tdouble[] realDenominatorCoeffs;\n\n\t\tif (getZero... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_74 | {
"fields": [
{
"declarator": "samplingInterval = 1.0/samplingFrequency",
"modifier": "private",
"original_string": "private double samplingInterval = 1.0/samplingFrequency;",
"type": "double",
"var_name": "samplingInterval"
}
],
"file": "svarog/src/test/java/org/signalml/dom... | {
"body": "@Test\n\tpublic void testTwoTagsGrouped() {\n\t\tStyledTagSet tagSet = getTagSet();\n\t\ttagSet.addTag(new Tag(averagedTagStyle, 1.0, 0.1));\n\t\ttagSet.addTag(new Tag(averagedTagStyle, 2.0, 0.1));\n\t\ttagSet.addTag(new Tag(otherTagStyle, 1.0, 1.0));\n\t\ttagSet.addTag(new Tag(otherTagStyle, 3.0, 1.0));\n... | {
"fields": [
{
"declarator": "segmentLength",
"modifier": "private",
"original_string": "private int segmentLength;",
"type": "int",
"var_name": "segmentLength"
},
{
"declarator": "offsets",
"modifier": "private",
"original_string": "private int[] offsets;"... | {
"body": "@Override\n\tpublic int getSegmentCount() {\n\t\treturn offsets.length;\n\t}",
"class_method_signature": "MarkerSegmentedSampleSource.getSegmentCount()",
"constructor": false,
"full_signature": "@Override public int getSegmentCount()",
"identifier": "getSegmentCount",
"invocations": [],
"modifi... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_62 | {
"fields": [
{
"declarator": "engine",
"modifier": "private",
"original_string": "private OnlineIIRSinglechannelSampleFilter engine;",
"type": "OnlineIIRSinglechannelSampleFilter",
"var_name": "engine"
}
],
"file": "svarog/src/test/java/org/signalml/domain/signal/filter/iir/... | {
"body": "@Test\n\tpublic void testFilterUsingCache() {\n\t\t//test1\n\t\tdouble[] bCoefficients = new double[] {0.6, 0.22};\n\t\tdouble[] aCoefficients = new double[] {1, 0.3, 0.4};\n\t\tdouble[] input = new double[] {1, 2, 3, 4, 5, 6, 7, 8};\n\t\tdouble[] filtered = OnlineIIRSinglechannelSampleFilter.filterUsingC... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(OnlineIIRSinglechannelSampleFilter.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(OnlineIIRSinglechannelSampleFilter.class);",
"type": "Logger",
"var_n... | {
"body": "public static double[] filterUsingCache(double[] bCoefficients, double[] aCoefficients, double[] input) {\n\n\t\tint filterOrder = Math.max(aCoefficients.length - 1, bCoefficients.length - 1);\n\t\tint cacheSize = filterOrder + input.length;\n\t\tdouble[] unfilteredSamplesCache = new double[cacheSize];\n\t... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_35 | {
"fields": [
{
"declarator": "iirdesigner = new EllipticIIRDesigner()",
"modifier": "",
"original_string": "EllipticIIRDesigner iirdesigner = new EllipticIIRDesigner();",
"type": "EllipticIIRDesigner",
"var_name": "iirdesigner"
}
],
"file": "svarog/src/test/java/org/signalml... | {
"body": "@Test\n\tpublic void testCalculatePrototype() throws BadFilterParametersException {\n\n\t\t//filterOrder=1\n\t\tFilterZerosPolesGain zpk1 = iirdesigner.calculatePrototype(1, 2, 3);\n\t\tFilterZerosPolesGain zpk2 = new FilterZerosPolesGain(new Complex[0], new Complex[] {new Complex(-1.3075602715790791, 0.0)... | {
"fields": [
{
"declarator": "EPSILON = 2e-16",
"modifier": "private static final",
"original_string": "private static final double EPSILON = 2e-16;",
"type": "double",
"var_name": "EPSILON"
}
],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/EllipticIIRDesigner... | {
"body": "@Override\n\tprotected FilterZerosPolesGain calculatePrototype(int filterOrder, double gpass, double stopbandRipple) throws BadFilterParametersException {\n\n\t\tComplex[] zeros;\n\t\tComplex[] poles;\n\t\tdouble gain;\n\n\t\tif (filterOrder == 1) {\n\t\t\tpoles = new Complex[] {new Complex(-Math.sqrt(1.0 ... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_19 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/TransferFunctionTest.java",
"identifier": "TransferFunctionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCalculateTransferFunction() {\n\t\tdouble[] bCoefficients = new double[] {0.2, 0.11};\n\t\tdouble[] aCoefficients = new double[] {1.0, 0.5};\n\t\tFilterCoefficients coefficients = new FilterCoefficients(bCoefficients, aCoefficients);\n\t\tTransferFunction transferFunction = new Tra... | {
"fields": [
{
"declarator": "filterCoefficients",
"modifier": "protected",
"original_string": "protected FilterCoefficients filterCoefficients;",
"type": "FilterCoefficients",
"var_name": "filterCoefficients"
},
{
"declarator": "frequencies",
"modifier": "protec... | {
"body": "protected void calculateTransferFunction() {\n\n\t\tdouble[] numeratorCoefficients = ArrayOperations.reverse(filterCoefficients.getBCoefficients());\n\t\tdouble[] denominatorCoefficients = ArrayOperations.reverse(filterCoefficients.getACoefficients());\n\n\t\tComplexPolynomial numerator = new ComplexPolyno... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_58 | {
"fields": [
{
"declarator": "TEST_CHANNEL_COUNT = 7",
"modifier": "public static final",
"original_string": "public static final int TEST_CHANNEL_COUNT = 7;",
"type": "int",
"var_name": "TEST_CHANNEL_COUNT"
},
{
"declarator": "TEST_SAMPLE_COUNT = 10",
"modifier"... | {
"body": "@Test\n\tpublic void testApplyMontage() throws MontageMismatchException {\n\t\tint i;\n\n\t\tSourceMontage sMontage = new SourceMontage(TEST_CHANNEL_COUNT);\n\t\tMontage montage = new Montage(sMontage);\n\t\tfor (i = 0; i < TEST_CHANNEL_COUNT; i++)\n\t\t\tmontage.addMontageChannel(i, i);\n\n\t\t//no filter... | {
"fields": [
{
"declarator": "originalSource",
"modifier": "protected",
"original_string": "protected OriginalMultichannelSampleSource originalSource;",
"type": "OriginalMultichannelSampleSource",
"var_name": "originalSource"
},
{
"declarator": "logger = Logger.getLogg... | {
"body": "protected synchronized void applyMontage(Montage montage) throws MontageMismatchException {\n\n\t\ttry {\n\t\t\tsemaphore.acquire();\n\n\t\t\treinitFilterChains();\n\t\t\tif (!montage.isFilteringEnabled()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\timportTimeDomainFiltersFromMontage(montage);\n\t\t\timportFFTSam... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_3 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterCoefficientsTest.java",
"identifier": "FilterCoefficientsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testTransformLowpassToHighpass() throws BadFilterParametersException {\n\n\t\tdouble[] b = new double[] {0.06264858};\n\t\tdouble[] a = new double[] {1.00000000, 0.57450003, 1.41502514, 0.54893711,\n\t\t\t\t\t\t\t\t 0.40796631, 0.06264858\n\t\t\t\t\t\t\t\t };\n\t\tFilterCoefficients... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "private",
"original_string": "private double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "private",
"original_string": "private... | {
"body": "protected void transformLowpassToHighpass(double w0) throws BadFilterParametersException {\n\n\t\tint numberOfCoeffs = getNumberOfCoefficients();\n\t\tdouble[] powers = new double[numberOfCoeffs];\n\t\tint i;\n\n\t\tfor (i = 0; i < numberOfCoeffs; i++) {\n\n\t\t\tif (w0 != 1)\n\t\t\t\tpowers[i] = Math.pow(... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_39 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterTimeDomainResponseCalculatorTest.java",
"identifier": "FilterTimeDomainResponseCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetImpulseResponse() {\n\n\t\tcheckImpulseResponse(new double[] {0.34,0.12, 0.6, 0.33},\n\t\t\t\t\t\t\t new double[] {1, 0.4, 0.01, 0.02},\n\t\t\t\t\t\t\t 128.0,\n\t\t\t\t\t\t\t new double[] {0.3400, -0.0160, 0.6030, 0.0822,\n\t\t\t\t\t\t\t\t\t\t -0.0386, 0.0025, -0.0023, 0.0017,... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/FilterTimeDomainResponseCalculator.java",
"identifier": "FilterTimeDomainResponseCalculator",
"interfaces": "",
"methods": [
{
"class_method_signature": "FilterTimeDomainResponseCalculator.FilterTimeDomainResponseCalculator(... | {
"body": "public FilterTimeDomainResponse getImpulseResponse(int numberOfPoints) {\n\n\t\tdouble[] excitation = generateImpulseExcitation(numberOfPoints);\n\t\tdouble[] impulseResponseAmplitudes = AbstractIIRSinglechannelSampleFilter.filter(filterCoefficients.getBCoefficients(), filterCoefficients.getACoefficients()... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_42 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/ArrayOperationsTest.java",
"identifier": "ArrayOperationsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testReverse() {\n\t\tdouble[] array = new double[] {1, 2, 3, 4, 5};\n\n\t\tassertArrayEquals(ArrayOperations.reverse(array), new double[] {5, 4, 3, 2, 1}, 0.001);\n\t}",
"class_method_signature": "ArrayOperationsTest.testReverse()",
"constructor": false,
"full_signature": "@Test ... | {
"fields": [],
"file": "svarog/src/main/java/org/signalml/math/ArrayOperations.java",
"identifier": "ArrayOperations",
"interfaces": "",
"methods": [
{
"class_method_signature": "ArrayOperations.padArrayWithZerosToSize(double[] array, int newSize)",
"constructor": false,
"full_signature... | {
"body": "public static double[] reverse(double[] array) {\n\n\t\tdouble[] newArray = new double[array.length];\n\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tnewArray[i] = array[array.length - 1 - i];\n\t\t}\n\n\t\treturn newArray;\n\n\t}",
"class_method_signature": "ArrayOperations.reverse(double[] array... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_15 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/SpecialMathTest.java",
"identifier": "SpecialMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testIsOdd() {\n\t\tassertTrue(isOdd(3));\n\t\tassertFalse(isOdd(12));\n\t}",
"class_method_signature": "SpecialMathTest.testIsOdd()",
"constructor": false,
"full_signature": "@Test public void testIsOdd()",
"identifier": "testIsOdd",
"invocations": [
"assertTrue",
"is... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(SpecialMath.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(SpecialMath.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator"... | {
"body": "public static boolean isOdd(int x) {\n\t\tif (x % 2 == 1)\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"class_method_signature": "SpecialMath.isOdd(int x)",
"constructor": false,
"full_signature": "public static boolean isOdd(int x)",
"identifier": "isOdd",
"invocations": [],
"modifiers": "pub... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_54 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/fft/FourierTransformTest.java",
"identifier": "FourierTransformTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCalculatePowerSpectrum() {\n\t\tdouble[] signal = new double[] {\n\t\t\t\t1.2945659058474952, -0.3345509351321665, 5.686547339065295, -8.251057190829304, 6.782008754863941, -9.134070114429775, -12.259336118683912, 13.486409636503414,\n\t\t\t\t1.8258866901508277, 0.4308346756427337,... | {
"fields": [
{
"declarator": "windowFunction = new WindowFunction(WindowType.RECTANGULAR)",
"modifier": "private",
"original_string": "private WindowFunction windowFunction = new WindowFunction(WindowType.RECTANGULAR);",
"type": "WindowFunction",
"var_name": "windowFunction"
}
... | {
"body": "public double[] calculatePowerSpectrum(double[] samples) {\n\n\t\tComplex[] fftTransformedData = forwardFFT(samples);\n\t\tint dataLength = samples.length;\n\t\tint size = dataLength/2;\n\n\t\tdouble[] powerSpectrum = new double[size];\n\t\tpowerSpectrum[0] = square(fftTransformedData[0].getReal()) + squar... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_49 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/fft/FourierTransformTest.java",
"identifier": "FourierTransformTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetPowerOfTwoSize() {\n\t\tint actual = FourierTransform.getPowerOfTwoSize(13);\n\t\tassertEquals(16, actual);\n\n\t\tassertEquals(256, FourierTransform.getPowerOfTwoSize(256));\n\t}",
"class_method_signature": "FourierTransformTest.testGetPowerOfTwoSize()",
"constructor": fals... | {
"fields": [
{
"declarator": "windowFunction = new WindowFunction(WindowType.RECTANGULAR)",
"modifier": "private",
"original_string": "private WindowFunction windowFunction = new WindowFunction(WindowType.RECTANGULAR);",
"type": "WindowFunction",
"var_name": "windowFunction"
}
... | {
"body": "public static int getPowerOfTwoSize(int initialSize) {\n\t\tdouble log_of_initialSize_to_base_2 = Math.log(initialSize) / Math.log(2);\n\t\treturn (int) Math.pow(2, Math.ceil(log_of_initialSize_to_base_2));\n\t}",
"class_method_signature": "FourierTransform.getPowerOfTwoSize(int initialSize)",
"constru... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_32 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/InitialStateCalculatorTest.java",
"identifier": "InitialStateCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGrowSignal() {\n\t\tdouble[] signal = new double[20]; //1, 2, 3, ...., 20\n\t\tfor (int i = 0; i < 20; i++) {\n\t\t\tsignal[i] = i + 1;\n\t\t}\n\n\t\tInitialStateCalculator calculator = new InitialStateCalculator(getSampleFilterCoefficients1());\n\t\tdouble[] grownSignal = calculat... | {
"fields": [
{
"declarator": "bCoefficients",
"modifier": "private",
"original_string": "private double[] bCoefficients;",
"type": "double[]",
"var_name": "bCoefficients"
},
{
"declarator": "aCoefficients",
"modifier": "private",
"original_string": "private... | {
"body": "public double[] growSignal(double[] signal) {\n\t\treturn growSignal(signal, false);\n\t}",
"class_method_signature": "InitialStateCalculator.growSignal(double[] signal)",
"constructor": false,
"full_signature": "public double[] growSignal(double[] signal)",
"identifier": "growSignal",
"invocatio... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_65 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/domain/signal/filter/iir/helper/TrimSignalSampleSourceTest.java",
"identifier": "TrimSignalSampleSourceTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetSamples() {\n\n\t\tdouble[][] samples = new double[][]\n\t\t\t\t{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}};\n\t\tDoubleArraySampleSource multichannelSampleSource = new DoubleArraySampleSource(samples, samples.length, samples[0].length);\n\t\tChannelSelectorSampleSource ch... | {
"fields": [
{
"declarator": "startIndex",
"modifier": "private",
"original_string": "private int startIndex;",
"type": "int",
"var_name": "startIndex"
},
{
"declarator": "endIndex",
"modifier": "private",
"original_string": "private int endIndex;",
"... | {
"body": "@Override\n\tpublic void getSamples(double[] target, int signalOffset, int count, int arrayOffset) {\n\t\tint realOffset = startIndex + signalOffset;\n\t\tsource.getSamples(target, realOffset, count, arrayOffset);\n\t}",
"class_method_signature": "TrimSignalSampleSource.getSamples(double[] target, int si... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_73 | {
"fields": [
{
"declarator": "samplingInterval = 1.0/samplingFrequency",
"modifier": "private",
"original_string": "private double samplingInterval = 1.0/samplingFrequency;",
"type": "double",
"var_name": "samplingInterval"
}
],
"file": "svarog/src/test/java/org/signalml/dom... | {
"body": "@Test\n\tpublic void testGetSamplesWithZeroTags() {\n\n\t\tMarkerSegmentedSampleSource markerSampleSource = new MarkerSegmentedSampleSource(\n\t\t\t\tgetSampleSource(), getTagSet(), getMarkerStyleNames(), 0.0, 1.0, null);\n\n\t\tassertEquals(0, markerSampleSource.getSegmentCount());\n\t}",
"class_method_... | {
"fields": [
{
"declarator": "segmentLength",
"modifier": "private",
"original_string": "private int segmentLength;",
"type": "int",
"var_name": "segmentLength"
},
{
"declarator": "offsets",
"modifier": "private",
"original_string": "private int[] offsets;"... | {
"body": "@Override\n\tpublic int getSegmentCount() {\n\t\treturn offsets.length;\n\t}",
"class_method_signature": "MarkerSegmentedSampleSource.getSegmentCount()",
"constructor": false,
"full_signature": "@Override public int getSegmentCount()",
"identifier": "getSegmentCount",
"invocations": [],
"modifi... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_8 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/ComplexPolynomialTest.java",
"identifier": "ComplexPolynomialTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testEvaluate() {\n\t\tComplexPolynomial polynomial = new ComplexPolynomial(new double[] {0.2, 0.11});\n\t\tComplex exponent = (new Complex(0, -0.5)).exp();\n\t\tassertEquals(new Complex(0.87758256189037276, -0.47942553860420301), exponent, new Complex(1e-6, 1e-6));\n\t\tComplex value =... | {
"fields": [
{
"declarator": "coefficients",
"modifier": "private",
"original_string": "private Complex[] coefficients;",
"type": "Complex[]",
"var_name": "coefficients"
}
],
"file": "svarog/src/main/java/org/signalml/math/iirdesigner/math/ComplexPolynomial.java",
"identif... | {
"body": "public Complex evaluate(Complex argument) {\n\t\tComplex value;\n\t\tvalue = coefficients[0];\n\n\t\tfor (int i = 1; i < coefficients.length; i++)\n\t\t\tvalue = value.multiply(argument).add(coefficients[i]);\n\n\t\treturn value;\n\t}",
"class_method_signature": "ComplexPolynomial.evaluate(Complex argume... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_24 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/FilterZerosPolesGainTest.java",
"identifier": "FilterZerosPolesGainTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testConvertToABCoefficients2() {\n\n\t\t//test 1\n\t\tComplex[] zeros = new Complex[0];\n\t\tComplex[] poles = new Complex[] {new Complex(0.4, 0.2), new Complex(0.5, 0.3)};\n\t\tdouble gain = 1.0;\n\n\t\tFilterZerosPolesGain zpk1 = new FilterZerosPolesGain(zeros, poles, gain);\n\n\t\td... | {
"fields": [
{
"declarator": "zeros",
"modifier": "",
"original_string": "Complex[] zeros;",
"type": "Complex[]",
"var_name": "zeros"
},
{
"declarator": "poles",
"modifier": "",
"original_string": "Complex[] poles;",
"type": "Complex[]",
"var_na... | {
"body": "protected FilterCoefficients convertToBACoefficients() {\n\n\t\tComplexPolynomial numeratorPoly;\n\t\tComplexPolynomial denominatorPoly;\n\t\tComplex[] complexNumeratorCoeffs;\n\t\tComplex[] complexDenominatorCoeffs;\n\t\tdouble[] realNumeratorCoeffs;\n\t\tdouble[] realDenominatorCoeffs;\n\n\t\tif (getZero... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_53 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/fft/FourierTransformTest.java",
"identifier": "FourierTransformTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testGetFrequencies() {\n\t\tdouble[] signal = new double[8];\n\t\tdouble[] expectedFrequencies = new double[] {0, 18.05, 36.1, 54.15};\n\t\tdouble[] actualFrequencies = FourierTransform.getFrequencies(signal, 144.4);\n\n\t\tassertArrayEquals(expectedFrequencies, actualFrequencies, 1e-5... | {
"fields": [
{
"declarator": "windowFunction = new WindowFunction(WindowType.RECTANGULAR)",
"modifier": "private",
"original_string": "private WindowFunction windowFunction = new WindowFunction(WindowType.RECTANGULAR);",
"type": "WindowFunction",
"var_name": "windowFunction"
}
... | {
"body": "public static double[] getFrequencies(double[] signal, double samplingFrequency) {\n\t\tint size = getPowerOfTwoSize(signal.length);\n\n\t\t// the other half of frequencies are the same (mirrored)\n\t\tdouble[] frequencies = new double[size / 2];\n\n\t\tfor (int i = 0; i < frequencies.length; i++) {\n\t\t\... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_12 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/iirdesigner/math/SpecialMathTest.java",
"identifier": "SpecialMathTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCalculateJacobianEllipticFunctions() {\n\n\t\tdouble result[] = calculateJacobianEllipticFunctionsValues(0.5, 0.7);\n\t\tassertEquals(4, result.length);\n\t\tassertEquals(0.46729200535903359, result[0], 1e-16);//sn\n\t\tassertEquals(0.8841030379585475, result[1], 1e-16);//cn\n\t\ta... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(SpecialMath.class)",
"modifier": "protected static final",
"original_string": "protected static final Logger logger = Logger.getLogger(SpecialMath.class);",
"type": "Logger",
"var_name": "logger"
},
{
"declarator"... | {
"body": "public static double[] calculateJacobianEllipticFunctionsValues(double u, double m) {\n\n\t\tdouble ai, b, phi, t, twon;\n\t\tdouble sn, cn, ph, dn;\n\t\tdouble[] a = new double[9];\n\t\tdouble[] c = new double[9];\n\t\tint i;\n\n\t\t// Check for special cases\n\t\tif (m < 0.0 || m > 1.0 || Double.isNaN(m)... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
22815625_45 | {
"fields": [],
"file": "svarog/src/test/java/org/signalml/math/fft/WindowFunctionTest.java",
"identifier": "WindowFunctionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testCalculateWeightsHanning() {\n\n\t\tWindowFunction windowFunction = new WindowFunction(WindowType.HANN);\n\t\twindowFunction.calculateWeights(20);\n\n\t\tdouble[] windowWeights = new double[] {\n\t\t\t0, 0.02709138, 0.10542975, 0.22652592, 0.37725726,\n\t\t\t0.54128967, 0.700847... | {
"fields": [
{
"declarator": "windowType = WindowType.RECTANGULAR",
"modifier": "protected",
"original_string": "protected WindowType windowType = WindowType.RECTANGULAR;",
"type": "WindowType",
"var_name": "windowType"
},
{
"declarator": "windowParameter = 0",
"... | {
"body": "protected void calculateWeights(int length) {\n\t\tif (windowWeights != null && windowWeights.length == length) {\n\t\t\treturn;\n\t\t}\n\t\twindowWeights = new double[length];\n\t\tdouble n = length;\n\t\tswitch (windowType) {\n\t\tcase BARTLETT:\n\t\t\tfor (int i = 0; i < length; ++i) {\n\t\t\t\twindowWe... | {
"created": null,
"fork": null,
"fork_count": 6,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 22815625,
"size": 24710,
"stargazer_count": 15,
"stars": null,
"updates": null,
"url": "https://github.com/BrainTech/svarog"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.