hexsha
stringlengths 40
40
| size
int64 8
1.04M
| content
stringlengths 8
1.04M
| avg_line_length
float64 2.24
100
| max_line_length
int64 4
1k
| alphanum_fraction
float64 0.25
0.97
|
---|---|---|---|---|---|
77e1c64b1701e577ee44103c4a426b3306445d9b
| 1,667 |
package ru.job4j.benchmark;
import java.util.concurrent.CountDownLatch;
/**
* Class ru.job4j.benchmark.
*
* @author edzabarov
* @since 20.06.2018
*/
public class DeadLock {
private final Object lock1 = new Object();
private final Object lock2 = new Object();
private CountDownLatch cdl = new CountDownLatch(2);
public static void main(String[] args) {
new DeadLock().go();
}
private void go() {
Thread deadThread1 = new Thread(new DeadThread1());
Thread deadThread2 = new Thread(new DeadThread2());
deadThread1.start();
deadThread2.start();
}
public class DeadThread1 implements Runnable {
@Override
public void run() {
synchronized (lock1) {
cdl.countDown();
try {
cdl.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("Yes!");
synchronized (lock2) {
System.out.println("NOT DEAD LOCK");
}
}
}
}
public class DeadThread2 implements Runnable {
@Override
public void run() {
synchronized (lock2) {
cdl.countDown();
try {
cdl.await();
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("DeadLock!");
synchronized (lock1) {
System.out.println("NOT DEAD LOCK");
}
}
}
}
}
| 25.646154 | 59 | 0.491902 |
27dc5ec4ee53b1c7175d0475791e0fd30a944af9
| 10,817 |
/*
* Janssen Project software is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
*
* Copyright (c) 2020, Janssen Project
*/
package io.jans.configapi.configuration;
import io.jans.as.common.service.common.ApplicationFactory;
import io.jans.as.model.config.Conf;
import io.jans.as.model.config.Constants;
import io.jans.as.model.config.StaticConfiguration;
import io.jans.as.model.config.WebKeysConfiguration;
import io.jans.as.model.configuration.AppConfiguration;
import io.jans.as.model.error.ErrorResponseFactory;
import io.jans.configapi.auth.AuthorizationService;
import io.jans.configapi.auth.OpenIdAuthorizationService;
import io.jans.configapi.auth.ConfigApiResourceProtectionService;
import io.jans.configapi.util.ApiConstants;
import io.jans.exception.ConfigurationException;
import io.jans.exception.OxIntializationException;
import io.jans.orm.PersistenceEntryManager;
import io.jans.orm.exception.BasePersistenceException;
import io.jans.orm.model.PersistenceConfiguration;
import io.jans.orm.service.PersistanceFactoryService;
import io.jans.orm.util.properties.FileConfiguration;
import io.jans.util.StringHelper;
import io.jans.util.security.PropertiesDecrypter;
import io.jans.util.security.StringEncrypter;
import io.quarkus.arc.AlternativePriority;
import org.apache.commons.lang.StringUtils;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.slf4j.Logger;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.inject.Named;
import java.io.File;
import java.util.List;
import java.util.Properties;
import org.eclipse.microprofile.config.inject.ConfigProperty;
@ApplicationScoped
@AlternativePriority(1)
public class ConfigurationFactory {
static {
if (System.getProperty("jans.base") != null) {
BASE_DIR = System.getProperty("jans.base");
} else if ((System.getProperty("catalina.base") != null) && (System.getProperty("catalina.base.ignore") == null)) {
BASE_DIR = System.getProperty("catalina.base");
} else if (System.getProperty("catalina.home") != null) {
BASE_DIR = System.getProperty("catalina.home");
} else if (System.getProperty("jboss.home.dir") != null) {
BASE_DIR = System.getProperty("jboss.home.dir");
} else {
BASE_DIR = null;
}
}
private static final String BASE_DIR;
private static final String DIR = BASE_DIR + File.separator + "conf" + File.separator;
private static final String BASE_PROPERTIES_FILE = DIR + Constants.BASE_PROPERTIES_FILE_NAME;
private static final String APP_PROPERTIES_FILE = DIR + Constants.LDAP_PROPERTIES_FILE_NAME;
private static final String SALT_FILE_NAME = Constants.SALT_FILE_NAME;
@Inject
Logger log;
@Inject
@Named(ApplicationFactory.PERSISTENCE_ENTRY_MANAGER_NAME)
Instance<PersistenceEntryManager> persistenceEntryManagerInstance;
@Inject
private PersistanceFactoryService persistanceFactoryService;
private AppConfiguration appConfiguration;
private StaticConfiguration staticConf;
private WebKeysConfiguration jwks;
private ErrorResponseFactory errorResponseFactory;
private PersistenceConfiguration persistenceConfiguration;
private FileConfiguration baseConfiguration;
private String cryptoConfigurationSalt;
private String saltFilePath;
@Inject
@ConfigProperty(name = "api.protection.type")
private static String API_PROTECTION_TYPE;
@Inject
@ConfigProperty(name = "api.client.id")
private static String API_CLIENT_ID;
@Inject
@ConfigProperty(name = "api.client.password")
private static String API_CLIENT_PASSWORD;
@Inject
ConfigApiResourceProtectionService configApiResourceProtectionService;
@Inject
private Instance<AuthorizationService> authorizationServiceInstance;
@Produces
@ApplicationScoped
public AppConfiguration getAppConfiguration() {
return appConfiguration;
}
@Produces
@ApplicationScoped
public PersistenceConfiguration getPersistenceConfiguration() {
return persistenceConfiguration;
}
public FileConfiguration getBaseConfiguration() {
return baseConfiguration;
}
public static String getAppPropertiesFile() {
return APP_PROPERTIES_FILE;
}
public static String getApiProtectionType() {
return API_PROTECTION_TYPE;
}
public static String getApiClientId() {
return API_CLIENT_ID;
}
public static String getApiClientPassword() {
return API_CLIENT_PASSWORD;
}
public void create() {
loadBaseConfiguration();
this.saltFilePath = confDir() + SALT_FILE_NAME;
this.persistenceConfiguration = persistanceFactoryService.loadPersistenceConfiguration(APP_PROPERTIES_FILE);
loadCryptoConfigurationSalt();
if (!createFromDb()) {
log.error("Failed to load configuration from persistence. Please fix it!!!.");
throw new ConfigurationException("Failed to load configuration from persistence.");
} else {
log.info("Configuration loaded successfully.");
}
createAuthorizationService();
}
private boolean createFromDb() {
log.info("Loading configuration from '{}' DB...", baseConfiguration.getString("persistence.type"));
try {
final Conf c = loadConfigurationFromDb();
if (c != null) {
init(c);
return true;
}
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
throw new ConfigurationException("Unable to find configuration in DB... ");
}
public String getConfigurationDn() {
return this.baseConfiguration.getString(Constants.SERVER_KEY_OF_CONFIGURATION_ENTRY);
}
private Conf loadConfigurationFromDb() {
final PersistenceEntryManager persistenceEntryManager = persistenceEntryManagerInstance.get();
try {
return persistenceEntryManager.find(Conf.class, getConfigurationDn());
} catch (BasePersistenceException ex) {
log.error(ex.getMessage());
return null;
}
}
private void loadBaseConfiguration() {
log.info("Loading base configuration " + BASE_PROPERTIES_FILE);
this.baseConfiguration = createFileConfiguration(BASE_PROPERTIES_FILE);
log.info("Loaded base configuration:" + baseConfiguration.getProperties());
}
private String confDir() {
final String confDir = this.baseConfiguration.getString("confDir", null);
if (StringUtils.isNotBlank(confDir)) {
return confDir;
}
return DIR;
}
private FileConfiguration createFileConfiguration(String fileName) {
try {
return new FileConfiguration(fileName);
} catch (Exception ex) {
log.error("Failed to load configuration from {}", fileName, ex);
throw new ConfigurationException("Failed to load configuration from " + fileName, ex);
}
}
private void init(Conf p_conf) {
initConfigurationConf(p_conf);
}
private void initConfigurationConf(Conf p_conf) {
if (p_conf.getDynamic() != null) {
appConfiguration = p_conf.getDynamic();
}
if (p_conf.getStatics() != null) {
staticConf = p_conf.getStatics();
}
if (p_conf.getWebKeys() != null) {
jwks = p_conf.getWebKeys();
}
if (p_conf.getErrors() != null) {
errorResponseFactory = new ErrorResponseFactory(p_conf.getErrors(), p_conf.getDynamic());
}
}
private void loadCryptoConfigurationSalt() {
try {
FileConfiguration cryptoConfiguration = createFileConfiguration(saltFilePath);
this.cryptoConfigurationSalt = cryptoConfiguration.getString("encodeSalt");
} catch (Exception ex) {
log.error("Failed to load configuration from {}", saltFilePath, ex);
throw new ConfigurationException("Failed to load configuration from " + saltFilePath, ex);
}
}
public String getCryptoConfigurationSalt() {
return cryptoConfigurationSalt;
}
public Properties getDecryptedConnectionProperties() throws OxIntializationException {
FileConfiguration persistenceConfig = persistenceConfiguration.getConfiguration();
Properties connectionProperties = persistenceConfig.getProperties();
if (connectionProperties == null || connectionProperties.isEmpty())
return connectionProperties;
return PropertiesDecrypter.decryptAllProperties(getStringEncrypter(), connectionProperties);
}
@Produces
@ApplicationScoped
public StaticConfiguration getStaticConf() {
return staticConf;
}
@Produces
@ApplicationScoped
public WebKeysConfiguration getJwks() {
return jwks;
}
@Produces
@ApplicationScoped
public ErrorResponseFactory getErrorResponseFactory() {
return errorResponseFactory;
}
@Produces
@ApplicationScoped
public StringEncrypter getStringEncrypter() throws OxIntializationException {
if (StringHelper.isEmpty(cryptoConfigurationSalt)) {
throw new OxIntializationException("Encode salt isn't defined");
}
try {
return StringEncrypter.instance(cryptoConfigurationSalt);
} catch (StringEncrypter.EncryptionException ex) {
throw new OxIntializationException("Failed to create StringEncrypter instance", ex);
}
}
@Produces
@ApplicationScoped
@Named("authorizationService")
private AuthorizationService createAuthorizationService() {
log.info("============= createAuthorizationService() - ConfigurationFactory.getApiProtectionType() = "
+ ConfigurationFactory.getApiProtectionType());
if (StringHelper.isEmpty(ConfigurationFactory.getApiProtectionType())) {
throw new ConfigurationException("API Protection Type not defined");
}
try {
// Verify resources available
configApiResourceProtectionService.verifyResources(ConfigurationFactory.getApiProtectionType());
return authorizationServiceInstance.select(OpenIdAuthorizationService.class).get();
} catch (Exception ex) {
log.error("Failed to create AuthorizationService instance", ex);
throw new ConfigurationException("Failed to create AuthorizationService instance", ex);
}
}
}
| 35.465574 | 124 | 0.698807 |
1e6b48c1a624000675c4a6fb5b3281456e25abb1
| 1,442 |
package com.kidscademy.atlas.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.kidscademy.atlas.R;
import js.log.Log;
import js.log.LogFactory;
public class MainActivity extends AppActivity {
private static final Log log = LogFactory.getLog(MainActivity.class);
public static void start(Activity activity) {
log.trace("start(Activity)");
Intent intent = new Intent(activity, MainActivity.class);
activity.startActivity(intent);
}
public MainActivity() {
super(R.layout.activity_main);
log.trace("MainActivity()");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
log.trace("onCreate(Bundle)");
super.onCreate(savedInstanceState);
setClickListener(R.id.action_forward);
setClickListener(R.id.main_picture);
setClickListener(R.id.action_we_play);
setClickListener(R.id.action_no_ads);
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.action_forward || id == R.id.main_picture) {
MenuActivity.start(this);
} else if (id == R.id.action_we_play) {
WePlayActivity.start(this);
} else if (id == R.id.action_no_ads) {
NoAdsActivity.start(this);
} else {
super.onClick(view);
}
}
}
| 28.27451 | 73 | 0.646325 |
77c6bcaebd3634d70f2c84f49115f4a611c142b3
| 2,217 |
// Copyright 2020 Goldman Sachs
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.finos.legend.sdlc.server.gitlab;
import io.dropwizard.Configuration;
import io.dropwizard.ConfiguredBundle;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import org.finos.legend.sdlc.server.gitlab.auth.GitLabWebFilter;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
import javax.servlet.FilterRegistration;
import java.util.EnumSet;
import java.util.Objects;
import java.util.function.Function;
public class GitLabBundle<C extends Configuration> implements ConfiguredBundle<C>
{
private final Function<? super C, ? extends GitLabConfiguration> configSupplier;
public GitLabBundle(Function<? super C, ? extends GitLabConfiguration> configSupplier)
{
this.configSupplier = Objects.requireNonNull(configSupplier);
}
@Override
public void initialize(Bootstrap<?> bootstrap)
{
}
@Override
public void run(C configuration, Environment environment)
{
GitLabConfiguration gitLabConfig = this.configSupplier.apply(configuration);
if (gitLabConfig == null)
{
throw new RuntimeException("Could not find GitLabConfiguration");
}
Filter filter = GitLabWebFilter.fromConfig(gitLabConfig);
GitLabServerHealthCheck healthCheck = GitLabServerHealthCheck.fromConfig(gitLabConfig);
FilterRegistration.Dynamic registration = environment.servlets().addFilter("GitLab", filter);
environment.healthChecks().register("gitLabServer", healthCheck);
registration.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), false, "*");
}
}
| 36.95 | 101 | 0.750564 |
420966a56606634e6a4d1af62e1dd2435b36d6d0
| 2,749 |
import java.io.*;
import java.awt.geom.Point2D;
import java.text.*;
import java.math.*;
import java.util.*;
public class Main implements Runnable {
final String problem = "A";
// final String filename = problem + "-sample";
// final String filename = problem + "-small-attempt0";
// final String filename= problem+"-small-attempt1";
final String filename= problem+"-large";
public void solve() throws Exception {
int N = iread();
long p = iread(), q = iread(), r = iread(), s = iread();
long[] a = new long[N];
for (int i = 0; i < N; i++)
a[i] = ((i * p + q) % r + s);
long[] A = new long[N + 1];
for (int i = 0; i < N; i++)
A[i + 1] = A[i] + a[i];
int j = 0;
long ans = A[N];
for (int i = 0; i < N; i++) {
long third = A[N] - A[i + 1];
while (j < i && A[i + 1] - A[j + 2] > A[j + 2])
j++;
{
long first = A[j + 1];
long second = A[i + 1] - A[j + 1];
ans = Math.min(ans, Math.max(first, Math.max(second, third)));
}
if (j < i) {
long first = A[j + 2];
long second = A[i + 1] - A[j + 2];
ans = Math.min(ans, Math.max(first, Math.max(second, third)));
}
}
double res = (A[N] - ans) * 1.0 / A[N];
out.write(df.format(res));
}
DecimalFormat df = new DecimalFormat("0.0000000000");
public void solve_gcj() throws Exception {
int tests = iread();
for (int test = 1; test <= tests; test++) {
out.write("Case #" + test + ": ");
solve();
out.write("\n");
}
}
public void run() {
try {
// in = new BufferedReader(new InputStreamReader(System.in));
// out = new BufferedWriter(new OutputStreamWriter(System.out));
in = new BufferedReader(new FileReader(filename + ".in"));
out = new BufferedWriter(new FileWriter(filename + ".out"));
solve_gcj();
out.flush();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
public int iread() throws Exception {
return Integer.parseInt(readword());
}
public double dread() throws Exception {
return Double.parseDouble(readword());
}
public long lread() throws Exception {
return Long.parseLong(readword());
}
BufferedReader in;
BufferedWriter out;
public String readword() throws IOException {
StringBuilder b = new StringBuilder();
int c;
c = in.read();
while (c >= 0 && c <= ' ')
c = in.read();
if (c < 0)
return "";
while (c > ' ') {
b.append((char) c);
c = in.read();
}
return b.toString();
}
public static void main(String[] args) {
try {
Locale.setDefault(Locale.US);
} catch (Exception e) {
}
new Thread(new Main()).start();
// new Thread(null, new Main(), "1", 1<<25).start();
}
}
| 24.327434 | 68 | 0.551837 |
1b0477f32d9fbccdac1d5151aeb58aebd5f14098
| 11,441 |
package br.com.talpi.util;
import java.text.MessageFormat;
import java.text.NumberFormat;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.slf4j.Logger;
import org.slf4j.helpers.MessageFormatter;
/**
* <h1>Human Time</h1>
*
* <p>Human Time: A class to show time for humans. It simply creates strings like "just now", "x minutes ago" and "x hours ago".</p>
*
* <h2>How to use</h2>
*
* <p>This was built to be used fluently and (preferably) as a {@link Singleton}. You can {@link Inject @Inject} it, or simply create a {@code new HumanTime()}
* or even a {@code HumanTime.instance()}
* After creating it,</p>
*
* @author Rafael Lins - g0dkar
*
*/
@Singleton
@Named("humanTime")
public class HumanTime {
@Inject
private Logger log;
/**
* The time thresholds. A time threshold is a number that denotes that after that and before the next threshold, use that time.
*
* Like "from 0 to 1500ms use {@code just now}"
*/
private List<HumanTimeThreshold> thresholds;
/**
* Which {@link ResourceBundle} should be used to check for i18n strings? (default = {@link #DEFAULT_BUNDLE_NAME})
*/
@Inject
private ResourceBundle resourceBundle;
private static final String DEFAULT_BUNDLE_NAME = "messages";
/**
* Which {@link Locale} should be used for l10n?
*/
@Inject
private Locale locale;
@PostConstruct
private void dependencyInjectionInit() {
if (log.isDebugEnabled()) { log.debug("Instantiated by Dependency Injection System. Doing post-construct stuff..."); }
withDefaultThresholds();
}
/**
* Same as {@code withLocale(}{@link Locale#getDefault()}{@code )}
* @return {@code this}
*/
public HumanTime withDefaultLocale() {
return withLocale(Locale.getDefault());
}
/**
* Sets which {@link Locale} should be used for L10N
* @param locale The {@link Locale} to use
* @return {@code this}
*/
public HumanTime withLocale(final Locale locale) {
this.locale = locale;
return this;
}
/**
* Same as {@code withDefaultResourceBundle(}{@link ResourceBundle#getBundle(String)}{@code )}
* @return {@code this}
*/
public HumanTime withDefaultResourceBundle() {
return withResourceBundle(locale == null ? ResourceBundle.getBundle(DEFAULT_BUNDLE_NAME) : ResourceBundle.getBundle(DEFAULT_BUNDLE_NAME, locale));
}
/**
* Sets which {@link ResourceBundle} should be used for I18N
* @param resourceBundle The {@link ResourceBundle} to use
* @return {@code this}
*/
public HumanTime withResourceBundle(final ResourceBundle resourceBundle) {
this.resourceBundle = resourceBundle;
return this;
}
/**
* <p>Sets a set of default {@link HumanTimeThreshold thresholds} following this pattern:</p>
* <p><strong>NOTE:</strong> By default, if these are not found in the current {@link #withResourceBundle(ResourceBundle) resource bundle}
* an <strong>english</strong> locale hardcoded values will be used.</p>
* <table border="1" cellpadding="3" summary="message.properties properties that this class uses">
* <tr><th>Elapsed Time</th><th>Time Unit</th><th>{@link ResourceBundle} key</th><th>Default Text</th></tr>
*
* <tr><td>{@link Long#MIN_VALUE The End of Time} to Now (future)</td><td>-</td><td>{@code humanTime.future}</td><td>the future!</td></tr>
*
* <tr><td>0 - 20 seconds</td><td>Seconds</td><td>{@code humanTime.justNow}</td><td>just now</td></tr>
* <tr><td>20 - 60 seconds</td><td>Seconds</td><td>{@code humanTime.someSecondsAgo}</td><td>a few seconds ago</td></tr>
*
* <tr><td>1 minute</td><td>Minutes</td><td>{@code humanTime.aMinuteAgo}</td><td>a minute ago</td></tr>
* <tr><td>2 - 60 minutes</td><td>Minutes</td><td>{@code humanTime.someMinutesAgo}</td><td>X minutes ago</td></tr>
*
* <tr><td>1 hour</td><td>Hours</td><td>{@code humanTime.anHourAgo}</td><td>an hour ago</td></tr>
* <tr><td>2 - 24 hours</td><td>Hours</td><td>{@code humanTime.someHoursAgo}</td><td>X hours ago</td></tr>
*
* <tr><td>1 day</td><td>Days</td><td>{@code humanTime.yesterday}</td><td>yesterday</td></tr>
* <tr><td>2 - 30 days</td><td>Days</td><td>{@code humanTime.someDaysAgo}</td><td>X days ago</td></tr>
*
* <tr><td>1 month (= 30 days)</td><td>Months</td><td>{@code humanTime.aMinuteAgo}</td><td>last month</td></tr>
* <tr><td>2 - 12 months</td><td>Months</td><td>{@code humanTime.someMinutesAgo}</td><td>X months ago</td></tr>
*
* <tr><td>1 year</td><td>Years</td><td>{@code humanTime.lastYear}</td><td>last year</td></tr>
* <tr><td>2+ years</td><td>Years</td><td>{@code humanTime.someYearsAgo}</td><td>X years ago</td></tr>
*
* <tr><td>{@link Long#MAX_VALUE The Big Bang}</td><td>Years</td><td>{@code humanTime.bigBang}</td><td>right after the Big Bang</td></tr>
* </table>
*/
public HumanTime withDefaultThresholds() {
final List<HumanTimeThreshold> thresholds = new ArrayList<HumanTimeThreshold>(14);
// Future!
thresholds.add(new HumanTimeThreshold(Long.MIN_VALUE, 0, "humanTime.future")); // Future! (timeDiff is negative)
// Seconds
thresholds.add(new HumanTimeThreshold(0, 1000, "humanTime.justNow")); // Right now
thresholds.add(new HumanTimeThreshold(20 * 1000, 1000, "humanTime.aFewSecondsAgo")); // 20 seconds since now
// Minutes
thresholds.add(new HumanTimeThreshold(60 * 1000, 60 * 1000, "humanTime.aMinuteAgo")); // 1 minute since now
thresholds.add(new HumanTimeThreshold(60 * 1000 * 2, 60 * 1000, "humanTime.someMinutesAgo")); // 2+ minutes since now
// Hours
thresholds.add(new HumanTimeThreshold(60 * 1000 * 60, 60 * 1000 * 60, "humanTime.anHourAgo")); // 1 hour since now
thresholds.add(new HumanTimeThreshold(60 * 1000 * 60 * 2, 60 * 1000 * 60, "humanTime.someHoursAgo")); // 2+ hours since now
// Days
thresholds.add(new HumanTimeThreshold(60 * 1000 * 60 * 30, 60 * 1000 * 60 * 24, "humanTime.yesterday")); // 1 day since now
thresholds.add(new HumanTimeThreshold(60 * 1000 * 60 * 24 * 2, 60 * 1000 * 60 * 24, "humanTime.someDaysAgo")); // 2+ days since now
// Months
thresholds.add(new HumanTimeThreshold(60 * 1000 * 60 * 24 * 30, 60 * 1000 * 60 * 24 * 30, "humanTime.lastMonth")); // 1 month since now
thresholds.add(new HumanTimeThreshold(60 * 1000 * 60 * 24 * 30 * 2, 60 * 1000 * 60 * 24 * 30, "humanTime.someMonthsAgo")); // 2+ months since now
// Years
thresholds.add(new HumanTimeThreshold(60 * 1000 * 60 * 24 * 30 * 12, 60 * 1000 * 60 * 24 * 30 * 12, "humanTime.lastYear")); // 1 year since now
thresholds.add(new HumanTimeThreshold(60 * 1000 * 60 * 24 * 30 * 12 * 2, 60 * 1000 * 60 * 24 * 30 * 12, "humanTime.someYearsAgo")); // 2+ years since now
// Ayla's time
thresholds.add(new HumanTimeThreshold(Long.MAX_VALUE, 1000, "humanTime.bigBang")); // Bazillion time since now
return withThresholds(thresholds);
}
/**
* Sets the {@link #thresholds}
* @param thresholds The {@link HumanTimeThreshold} list
* @return {@code this}
*/
public HumanTime withThresholds(final List<HumanTimeThreshold> thresholds) {
this.thresholds = thresholds;
return this;
}
/**
* Returns a human-readable time for {@code referenceTime} (it shows how long since that time).
*
* @param referenceTime The {@code Date} of the reference time
* @return A nice, human-readable time :)
* @see #humanTime(long)
*/
public String humanTime(final Date referenceTime) {
return humanTime(System.currentTimeMillis() - referenceTime.getTime());
}
/**
* Returns a human-readable time for {@code referenceTime} (it shows how long since that time).
*
* @param referenceTime The {@code Calendar} of the reference time
* @return A nice, human-readable time :)
* @see #humanTime(long)
*/
public String humanTime(final Calendar referenceTime) {
return humanTime(System.currentTimeMillis() - referenceTime.getTimeInMillis());
}
/**
* Returns a human-readable time for {@code referenceTime} (it shows how long since that time).
*
* @param referenceTime The {@code Calendar} of the reference time
* @return A nice, human-readable time :)
* @see #humanTime(long)
*/
public String humanTime(final Instant referenceTime) {
return humanTime(System.currentTimeMillis() - referenceTime.getEpochSecond() * 1000);
}
/**
* Returns a human-readable time for {@code timeDiff} milliseconds since now.
*
* @param timeDiff The number of milliseconds since the reference time
* @return A nice, human-readable time :)
* @see #humanTime(Date)
* @see #humanTime(Calendar)
*/
public String humanTime(final long timeDiff) {
if (thresholds == null || thresholds.isEmpty()) {
withDefaultThresholds();
}
HumanTimeThreshold current, next;
long timeInUnits = 0;
for (int i = 0, max = thresholds.size(); i < max; i++) {
// Is timeDiff within the current threshold bounds?
current = thresholds.get(i);
next = thresholds.get(i + 1);
if (timeDiff >= current.bound && timeDiff < next.bound) {
if (current.unit > 0) {
timeInUnits = (long) Math.floor(timeDiff / current.unit);
}
else {
timeInUnits = 0;
}
return message(current.text, timeInUnits);
}
}
return message(resourceBundle == null ? "some time ago" : "humanTime.unknown", 0);
}
/**
* Formats the Human Time message.
*
* @param message The message
* @param value The value
* @return The formatted message
*/
private String message(final String message, final long value) {
String text;
if (resourceBundle != null && resourceBundle.containsKey(message)) {
text = resourceBundle.getString(message);
}
else {
text = message;
}
return MessageFormatter.format(text, NumberFormat.getNumberInstance(locale == null ? Locale.getDefault() : locale).format(value)).getMessage();
}
/**
* Represents a Human Time Threshold. It basically tells when one of the texts starts (like after 120000 start using the "x minutes ago")
* and how its units should be counted (like, 1 minute = 60000 ms). By default it tries to find an {@code i18n} string and, if it isn't
* present, use the text as-is (replacing parameters using {@link MessageFormat}).
*
* Everything is {@code public final} because speed.
*
* @author Rafael Lins - g0dkar
*
*/
public static final class HumanTimeThreshold {
public final long bound; // Default: 0
public final long unit; // Default: 0
public final String text; // Default: "{}"
public HumanTimeThreshold(final long bound) {
this.bound = bound;
text = "{}";
unit = 0;
}
public HumanTimeThreshold(final long bound, final long unit) {
this.bound = bound;
this.unit = unit;
text = "{}";
}
public HumanTimeThreshold(final long bound, final String text) {
this.bound = bound;
this.text = text;
unit = 0;
}
public HumanTimeThreshold(final long bound, final long unit, final String text) {
this.bound = bound;
this.text = text;
this.unit = unit;
}
}
}
| 38.392617 | 160 | 0.662617 |
9b5ede0240a73e7ff33ffbb1a5f343ed5ef3ec1a
| 869 |
package me.ratsiel.json.abstracts;
/**
* The abstract class {@link JsonHandler} with generic type {@link T} is used to serialize and deserialize an object
*
* @param <T> the type parameter type of object which is going to be serialized or deserialized.
*/
public abstract class JsonHandler<T> {
/**
* Serialize {@link JsonValue} to object of type {@link T}
*
* @param jsonValue the json value can be a value like something {@link me.ratsiel.json.model.JsonObject} or {@link me.ratsiel.json.model.JsonArray}
* @return the t
*/
public abstract T serialize(JsonValue jsonValue);
/**
* Deserialize {@link T} to {@link JsonValue}
*
* @param value the value is an object of {@link T}
* @return the json value is the deserialized value of {@link T}
*/
public abstract JsonValue deserialize(T value);
}
| 32.185185 | 152 | 0.673188 |
6aa7be33438aa89ebf19560d88cc96f810025cf3
| 654 |
package com.robidium.demo.compiler.builder.variables;
import com.robidium.demo.compiler.builder.ScriptBuilder;
import org.w3c.dom.Element;
public class PreviousTarget implements Variable {
public static final String NAME = "prevTarget";
private Element prevTarget;
public PreviousTarget() {
prevTarget = ScriptBuilder.getDoc().createElement("Variable");
prevTarget.setAttribute("x:TypeArguments", "x:String");
prevTarget.setAttribute("Name", NAME);
}
@Override
public String getName() {
return NAME;
}
@Override
public Element getDomElement() {
return prevTarget;
}
}
| 24.222222 | 70 | 0.689602 |
a8ed339cba05fe772b9847192b758245b2cdc3fc
| 1,197 |
package ucacue.edu.ec.persistence.entity;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.Set;
@Getter
@Setter
@Entity
@Table(name = "cuenta")
public class Cuenta implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "cuenta_generator")
@SequenceGenerator(name = "cuenta_generator", sequenceName = "cuenta_id_seq", allocationSize = 1000)
@Column(name = "id_cuenta", updatable = false, nullable = false)
private long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_cliente", referencedColumnName = "id_cliente")
private Cliente cliente;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "id_tipo", referencedColumnName ="id_tipo")
private TipoCuenta tipocuenta;
@Column
private int estado;
@Column
private Date fechaCreacion;
@Column
private String descripcion;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "cuenta")
private Set<Transacion> transacions;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "cuenta")
private Set<Prestamo> prestamos;
}
| 24.428571 | 104 | 0.718463 |
dbf492453238f04ad1d98b1f77a540fc3dafbcbd
| 768 |
package life;
import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JButton;
/**
* An area the map will be on.
*
* @author U
*
*/
public class Painter extends JButton {
/**
*
*/
private static final long serialVersionUID = 1096749829834574644L;
private Cell cell = null;
public Painter(Cell cell) {
this.cell = cell;
}
@Override
protected void paintComponent(Graphics g) {
g.setColor(Color.GREEN);
// TODO Auto-generated method stub
super.paintComponent(g);
boolean[][] data = cell.getData();
for (int a = 0; a < data.length; a++) {
for (int b = 0; b < data[0].length; b++) {
if (data[a][b]) {
g.fillRect(a * 20, b * 20, 20, 20);
} else {
g.drawRect(a * 20, b * 20, 20, 20);
}
}
}
}
}
| 17.066667 | 67 | 0.605469 |
81f329deb1aaf78e3b092b09bd6188198e7c3b0c
| 2,368 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.eagle.security.hive;
import com.typesafe.config.Config;
import org.apache.eagle.datastream.ExecutionEnvironments;
import org.apache.eagle.datastream.storm.StormExecutionEnvironment;
import org.apache.eagle.security.hive.jobrunning.HiveJobRunningSourcedStormSpoutProvider;
import org.apache.eagle.security.hive.jobrunning.HiveQueryParserExecutor;
import org.apache.eagle.security.hive.jobrunning.JobConfigurationAdaptorExecutor;
import org.apache.eagle.security.hive.sensitivity.HiveResourceSensitivityDataJoinExecutor;
import org.apache.eagle.stream.application.TopologyExecutable;
import java.util.Arrays;
public class HiveJobRunningMonitoringTopology implements TopologyExecutable {
@Override
public void submit(String topology, Config config) {
StormExecutionEnvironment env = ExecutionEnvironments.getStorm(config);
String spoutName = "msgConsumer";
int parallelism = env.getConfig().getInt("envContextConfig.parallelismConfig." + spoutName);
env.fromSpout(new HiveJobRunningSourcedStormSpoutProvider().getSpout(env.getConfig(), parallelism))
.withOutputFields(4).nameAs(spoutName).groupBy(Arrays.asList(0))
.flatMap(new JobConfigurationAdaptorExecutor()).groupBy(Arrays.asList(0))
.flatMap(new HiveQueryParserExecutor()).groupBy(Arrays.asList(0))
.flatMap(new HiveResourceSensitivityDataJoinExecutor())
.alertWithConsumer("hiveAccessLogStream", "hiveAccessAlertByRunningJob");
env.execute();
}
}
| 48.326531 | 107 | 0.765625 |
238b5382dceb4b5b27a7532918e413c17aa1c882
| 184 |
public class Client {
public static void main(String[]args) {
Person john = new Person("Ma","John",25);
Employee emp = new Employee(john,50000);
emp.showDetail();
}
}
| 20.444444 | 44 | 0.641304 |
198919d6a2ee5a7d6497988781e1e3b25a9e91f3
| 3,810 |
package jif.types.label;
import java.util.List;
import java.util.Set;
import jif.translate.LabelToJavaExpr;
import jif.types.JifContext;
import jif.types.JifTypeSystem;
import jif.types.LabelSubstitution;
import jif.types.PathMap;
import jif.types.hierarchy.LabelEnv;
import jif.visit.LabelChecker;
import polyglot.main.Report;
import polyglot.types.SemanticException;
import polyglot.types.Type;
import polyglot.types.TypeObject;
import polyglot.types.TypeSystem;
import polyglot.util.InternalCompilerError;
import polyglot.util.Position;
import polyglot.util.SerialVersionUID;
/** An implementation of the <code>DynamicLabel</code> interface.
*/
public class DynamicLabel_c extends Label_c implements DynamicLabel {
private static final long serialVersionUID = SerialVersionUID.generate();
private final AccessPath path;
public DynamicLabel_c(AccessPath path, JifTypeSystem ts, Position pos,
LabelToJavaExpr trans) {
super(ts, pos, trans);
this.path = path;
if (path instanceof AccessPathConstant) {
throw new InternalCompilerError(
"Don't expect to get AccessPathConstants for dynamic labels");
}
setDescription(ts.accessPathDescrip(path, "label"));
}
@Override
public AccessPath path() {
return path;
}
@Override
public boolean isRuntimeRepresentable() {
return true;
}
@Override
public boolean isCovariant() {
return false;
}
@Override
public boolean isComparable() {
return true;
}
@Override
public boolean isCanonical() {
return true;
}
@Override
protected boolean isDisambiguatedImpl() {
return isCanonical();
}
@Override
public boolean isEnumerable() {
return true;
}
@Override
public boolean equalsImpl(TypeObject o) {
if (this == o) return true;
if (!(o instanceof DynamicLabel)) {
return false;
}
DynamicLabel that = (DynamicLabel) o;
return (this.path.equals(that.path()));
}
@Override
public int hashCode() {
return path.hashCode();
}
@Override
public String componentString(Set<Label> printedLabels) {
if (Report.should_report(Report.debug, 1)) {
return "<dynamic " + path + ">";
}
return "*" + path();
}
@Override
public boolean leq_(Label L, LabelEnv env, LabelEnv.SearchState state) {
// can be leq than L if L is also a dynamic label with an access path
// equivalent to this one.
if (L instanceof DynamicLabel) {
DynamicLabel that = (DynamicLabel) L;
// System.out.println("Checking if " + this + " <= " + L + " : " + env.equivalentAccessPaths(this.path, that.path()));
if (env.equivalentAccessPaths(this.path, that.path())) {
return true;
}
}
// can only be equal if the dynamic label is equal to this,
// or through use of the label env, both taken care of outside
// this method.
return false;
}
@Override
public List<Type> throwTypes(TypeSystem ts) {
return path.throwTypes(ts);
}
@Override
public Label subst(LabelSubstitution substitution)
throws SemanticException {
AccessPath newPath = substitution.substAccessPath(path);
if (newPath != path) {
JifTypeSystem ts = typeSystem();
Label newDL = ts.pathToLabel(this.position(), newPath);
return substitution.substLabel(newDL);
}
return substitution.substLabel(this);
}
@Override
public PathMap labelCheck(JifContext A, LabelChecker lc) {
return path.labelcheck(A, lc);
}
}
| 27.810219 | 129 | 0.635433 |
f82236a1b7c724b829828e18ddac5315b4c60715
| 1,140 |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.felix.atomos.utils.api;
import java.util.Map;
import org.apache.felix.atomos.utils.api.plugin.SubstratePlugin;
public interface LauncherBuilder
{
LauncherBuilder addPlugin(Class<? extends SubstratePlugin<?>> pluginClasses,
Map<String, Object> cfgMap);
<C> LauncherBuilder addPlugin(Class<? extends SubstratePlugin<C>> pluginClasses,
C cfg);
LauncherBuilder addPlugin(String pluginClassNames, Map<String, Object> cfgMap);
<C> LauncherBuilder addPlugin(SubstratePlugin<C> pluginClasses, C cfg);
Launcher build();
}
| 31.666667 | 84 | 0.742105 |
076693c46c56cd2d4728cdf44e1b66deaf0b036b
| 1,579 |
package com.core.shared;
import java.io.IOException;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.net.SocketException;
public class UDPConnection extends UnknownConnection
{
protected DatagramSocket socket;
public UDPConnection(int port)
{
super(new InetSocketAddress("127.0.0.1", port));
try
{
this.socket = new DatagramSocket(port);
this.socket.setReuseAddress(true);
}
catch (SocketException e)
{
e.printStackTrace();
}
}
public UDPConnection(String address, int port)
{
super(address, port);
try
{
this.socket = new DatagramSocket();
}
catch (SocketException e)
{
e.printStackTrace();
}
}
@Override
public boolean isValid()
{
return this.ip != null && this.socket != null && !this.socket.isClosed();
}
@Override
public boolean send(UnknownPacket packet)
{
if (!this.isValid())
return false;
try
{
this.socket.send(packet.packet);
}
catch (IOException e)
{
e.printStackTrace();
return false;
}
return true;
}
@Override
public UnknownPacket recv()
{
UnknownPacket unknown = null;
if (this.isValid())
{
unknown = new UnknownPacket(this);
try
{
this.socket.receive(unknown.packet);
}
catch (IOException e)
{
e.printStackTrace();
return null;
}
unknown.parse();
}
return unknown;
}
@Override
public void close()
{
this.send(new UnknownPacket(this));
synchronized (this.socket)
{
this.socket.close();
}
}
public DatagramSocket getSocket()
{
return this.socket;
}
}
| 15.330097 | 75 | 0.661178 |
8d22516082154bab20ebb28cce87567f6c04b8cb
| 1,050 |
package io.github.sbcloudrace.sbtranslator.enginesvc;
import io.github.sbcloudrace.sbtranslator.jaxb.http.ArrayOfUdpRelayInfo;
import io.github.sbcloudrace.sbtranslator.jaxb.http.UdpRelayInfo;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping
public class GetRebroadcasters {
@RequestMapping(value = "/getrebroadcasters", method = RequestMethod.GET, produces = MediaType.APPLICATION_XML_VALUE)
@ResponseBody
public ArrayOfUdpRelayInfo getRebroadcasters() {
ArrayOfUdpRelayInfo arrayOfUdpRelayInfo = new ArrayOfUdpRelayInfo();
UdpRelayInfo udpRelayInfo = new UdpRelayInfo();
udpRelayInfo.setHost("127.0.0.1");
udpRelayInfo.setPort(9999);
arrayOfUdpRelayInfo.getUdpRelayInfo().add(udpRelayInfo);
return arrayOfUdpRelayInfo;
}
}
| 40.384615 | 121 | 0.794286 |
cd75011d35e1c79fc6ffc30470c5d3de12cb0b32
| 477 |
package cn.com.jgyhw.account.mapper;
import cn.com.jgyhw.account.entity.MoneyAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* 流水账目 Mapper 接口
*
* Created by WangLei on 2019/11/23 0023 23:58
*/
public interface MoneyAccountMapper extends BaseMapper<MoneyAccount> {
/**
* 查询最新流水账目记录
*
* @param wxUserId 微信用户标识
* @return
*/
MoneyAccount selectNewMoneyAccount(@Param("wxUserId") Long wxUserId);
}
| 21.681818 | 70 | 0.748428 |
e0dfca18ed2d34b82f000e4b87c7baf14764672f
| 17,651 |
/**
*/
package edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.impl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.BusComponents.BusComponentsPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.BusComponents.impl.BusComponentsPackageImpl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.ComponentRepository.ComponentRepositoryPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.ComponentRepository.impl.ComponentRepositoryPackageImpl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.ElectronicComponents.ElectronicComponentsPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.ElectronicComponents.impl.ElectronicComponentsPackageImpl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.InterfaceRepository.InterfaceRepositoryPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.InterfaceRepository.impl.InterfaceRepositoryPackageImpl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.Arm;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.GripperPart;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.Housing;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.MechanicalComponentsFactory;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.MechanicalComponentsPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.MechanicalPart;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.Pushhead;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.Ramp;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.ReturnSpring;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.RubberBand;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.Table;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.ModuleRepository.ModuleRepositoryPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.ModuleRepository.impl.ModuleRepositoryPackageImpl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.StructureRepository.StructureRepositoryPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.StructureRepository.impl.StructureRepositoryPackageImpl;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.apsPackage;
import edu.kit.ipd.sdq.kamp4aps.model.aPS.impl.apsPackageImpl;
import edu.kit.ipd.sdq.kamp4aps.model.basic.BasicPackage;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.impl.EPackageImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class MechanicalComponentsPackageImpl extends EPackageImpl implements MechanicalComponentsPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass mechanicalPartEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass pushheadEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass housingEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass returnSpringEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass rubberBandEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass gripperPartEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass armEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass rampEClass = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private EClass tableEClass = null;
/**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
* <p>Note: the correct way to create the package is via the static
* factory method {@link #init init()}, which also performs
* initialization of the package, or returns the registered package,
* if one already exists.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
* @see edu.kit.ipd.sdq.kamp4aps.model.aPS.MechanicalComponents.MechanicalComponentsPackage#eNS_URI
* @see #init()
* @generated
*/
private MechanicalComponentsPackageImpl() {
super(eNS_URI, MechanicalComponentsFactory.eINSTANCE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private static boolean isInited = false;
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
* <p>This method is used to initialize {@link MechanicalComponentsPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
public static MechanicalComponentsPackage init() {
if (isInited) return (MechanicalComponentsPackage)EPackage.Registry.INSTANCE.getEPackage(MechanicalComponentsPackage.eNS_URI);
// Obtain or create and register package
MechanicalComponentsPackageImpl theMechanicalComponentsPackage = (MechanicalComponentsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof MechanicalComponentsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new MechanicalComponentsPackageImpl());
isInited = true;
// Initialize simple dependencies
BasicPackage.eINSTANCE.eClass();
// Obtain or create and register interdependencies
apsPackageImpl theapsPackage = (apsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(apsPackage.eNS_URI) instanceof apsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(apsPackage.eNS_URI) : apsPackage.eINSTANCE);
ComponentRepositoryPackageImpl theComponentRepositoryPackage = (ComponentRepositoryPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ComponentRepositoryPackage.eNS_URI) instanceof ComponentRepositoryPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ComponentRepositoryPackage.eNS_URI) : ComponentRepositoryPackage.eINSTANCE);
BusComponentsPackageImpl theBusComponentsPackage = (BusComponentsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(BusComponentsPackage.eNS_URI) instanceof BusComponentsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(BusComponentsPackage.eNS_URI) : BusComponentsPackage.eINSTANCE);
ElectronicComponentsPackageImpl theElectronicComponentsPackage = (ElectronicComponentsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ElectronicComponentsPackage.eNS_URI) instanceof ElectronicComponentsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ElectronicComponentsPackage.eNS_URI) : ElectronicComponentsPackage.eINSTANCE);
StructureRepositoryPackageImpl theStructureRepositoryPackage = (StructureRepositoryPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(StructureRepositoryPackage.eNS_URI) instanceof StructureRepositoryPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(StructureRepositoryPackage.eNS_URI) : StructureRepositoryPackage.eINSTANCE);
ModuleRepositoryPackageImpl theModuleRepositoryPackage = (ModuleRepositoryPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ModuleRepositoryPackage.eNS_URI) instanceof ModuleRepositoryPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ModuleRepositoryPackage.eNS_URI) : ModuleRepositoryPackage.eINSTANCE);
InterfaceRepositoryPackageImpl theInterfaceRepositoryPackage = (InterfaceRepositoryPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(InterfaceRepositoryPackage.eNS_URI) instanceof InterfaceRepositoryPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(InterfaceRepositoryPackage.eNS_URI) : InterfaceRepositoryPackage.eINSTANCE);
// Create package meta-data objects
theMechanicalComponentsPackage.createPackageContents();
theapsPackage.createPackageContents();
theComponentRepositoryPackage.createPackageContents();
theBusComponentsPackage.createPackageContents();
theElectronicComponentsPackage.createPackageContents();
theStructureRepositoryPackage.createPackageContents();
theModuleRepositoryPackage.createPackageContents();
theInterfaceRepositoryPackage.createPackageContents();
// Initialize created meta-data
theMechanicalComponentsPackage.initializePackageContents();
theapsPackage.initializePackageContents();
theComponentRepositoryPackage.initializePackageContents();
theBusComponentsPackage.initializePackageContents();
theElectronicComponentsPackage.initializePackageContents();
theStructureRepositoryPackage.initializePackageContents();
theModuleRepositoryPackage.initializePackageContents();
theInterfaceRepositoryPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
theMechanicalComponentsPackage.freeze();
// Update the registry and return the package
EPackage.Registry.INSTANCE.put(MechanicalComponentsPackage.eNS_URI, theMechanicalComponentsPackage);
return theMechanicalComponentsPackage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getMechanicalPart() {
return mechanicalPartEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getMechanicalPart_Screwing() {
return (EReference)mechanicalPartEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getPushhead() {
return pushheadEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getHousing() {
return housingEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getReturnSpring() {
return returnSpringEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getRubberBand() {
return rubberBandEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getGripperPart() {
return gripperPartEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getArm() {
return armEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getArm_MountedTo() {
return (EReference)armEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getRamp() {
return rampEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRamp_Screwing_base() {
return (EReference)rampEClass.getEStructuralFeatures().get(0);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRamp_Screwing_component() {
return (EReference)rampEClass.getEStructuralFeatures().get(1);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EReference getRamp_Physicalconnection() {
return (EReference)rampEClass.getEStructuralFeatures().get(2);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EClass getTable() {
return tableEClass;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MechanicalComponentsFactory getMechanicalComponentsFactory() {
return (MechanicalComponentsFactory)getEFactoryInstance();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isCreated = false;
/**
* Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void createPackageContents() {
if (isCreated) return;
isCreated = true;
// Create classes and their features
mechanicalPartEClass = createEClass(MECHANICAL_PART);
createEReference(mechanicalPartEClass, MECHANICAL_PART__SCREWING);
pushheadEClass = createEClass(PUSHHEAD);
housingEClass = createEClass(HOUSING);
returnSpringEClass = createEClass(RETURN_SPRING);
rubberBandEClass = createEClass(RUBBER_BAND);
gripperPartEClass = createEClass(GRIPPER_PART);
armEClass = createEClass(ARM);
createEReference(armEClass, ARM__MOUNTED_TO);
rampEClass = createEClass(RAMP);
createEReference(rampEClass, RAMP__SCREWING_BASE);
createEReference(rampEClass, RAMP__SCREWING_COMPONENT);
createEReference(rampEClass, RAMP__PHYSICALCONNECTION);
tableEClass = createEClass(TABLE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
if (isInitialized) return;
isInitialized = true;
// Initialize package
setName(eNAME);
setNsPrefix(eNS_PREFIX);
setNsURI(eNS_URI);
// Obtain other dependent packages
ComponentRepositoryPackage theComponentRepositoryPackage = (ComponentRepositoryPackage)EPackage.Registry.INSTANCE.getEPackage(ComponentRepositoryPackage.eNS_URI);
InterfaceRepositoryPackage theInterfaceRepositoryPackage = (InterfaceRepositoryPackage)EPackage.Registry.INSTANCE.getEPackage(InterfaceRepositoryPackage.eNS_URI);
StructureRepositoryPackage theStructureRepositoryPackage = (StructureRepositoryPackage)EPackage.Registry.INSTANCE.getEPackage(StructureRepositoryPackage.eNS_URI);
// Create type parameters
// Set bounds for type parameters
// Add supertypes to classes
mechanicalPartEClass.getESuperTypes().add(theComponentRepositoryPackage.getComponent());
pushheadEClass.getESuperTypes().add(this.getMechanicalPart());
housingEClass.getESuperTypes().add(this.getMechanicalPart());
returnSpringEClass.getESuperTypes().add(this.getMechanicalPart());
rubberBandEClass.getESuperTypes().add(this.getMechanicalPart());
gripperPartEClass.getESuperTypes().add(theComponentRepositoryPackage.getMechanicalAssembly());
armEClass.getESuperTypes().add(theComponentRepositoryPackage.getMechanicalAssembly());
rampEClass.getESuperTypes().add(theComponentRepositoryPackage.getMechanicalAssembly());
tableEClass.getESuperTypes().add(theComponentRepositoryPackage.getMechanicalAssembly());
// Initialize classes, features, and operations; add parameters
initEClass(mechanicalPartEClass, MechanicalPart.class, "MechanicalPart", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getMechanicalPart_Screwing(), theInterfaceRepositoryPackage.getScrewing(), null, "screwing", null, 1, 1, MechanicalPart.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(pushheadEClass, Pushhead.class, "Pushhead", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(housingEClass, Housing.class, "Housing", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(returnSpringEClass, ReturnSpring.class, "ReturnSpring", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(rubberBandEClass, RubberBand.class, "RubberBand", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(gripperPartEClass, GripperPart.class, "GripperPart", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEClass(armEClass, Arm.class, "Arm", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getArm_MountedTo(), theStructureRepositoryPackage.getCrane(), theStructureRepositoryPackage.getCrane_Arm(), "mountedTo", null, 1, 1, Arm.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(rampEClass, Ramp.class, "Ramp", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getRamp_Screwing_base(), theInterfaceRepositoryPackage.getScrewing(), null, "screwing_base", null, 1, 1, Ramp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRamp_Screwing_component(), theInterfaceRepositoryPackage.getScrewing(), null, "screwing_component", null, 1, 1, Ramp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getRamp_Physicalconnection(), theInterfaceRepositoryPackage.getPhysicalConnection(), null, "physicalconnection", null, 1, 1, Ramp.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(tableEClass, Table.class, "Table", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
}
} //MechanicalComponentsPackageImpl
| 38.623632 | 340 | 0.742168 |
3f9d9a08de7e54959347b1185ffc819736a8913b
| 482 |
package com.learn.myspring.beans.factory.annotation;
import java.lang.annotation.*;
/**
* Description:
* date: 2021/8/21 17:56
* Package: com.learn.myspring.beans.factory.annotation
*
* @author 李佳乐
* @email 18066550996@163.com
*/
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface Qualifier {
String value() default "";
}
| 21.909091 | 118 | 0.753112 |
f3fcadcd1c2d766c10612406c9c77780cf68d08b
| 3,817 |
/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra GraphQL Extension
* Copyright (C) 2018 Synacor, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software Foundation,
* version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
* ***** END LICENSE BLOCK *****
*/
package com.zimbra.graphql.repositories.impl;
import com.zimbra.common.service.ServiceException;
import com.zimbra.common.soap.Element;
import com.zimbra.cs.service.account.Auth;
import com.zimbra.graphql.models.RequestContext;
import com.zimbra.graphql.models.inputs.GQLAuthRequestInput;
import com.zimbra.graphql.repositories.IRepository;
import com.zimbra.graphql.utilities.XMLDocumentUtilities;
import com.zimbra.soap.account.message.AuthRequest;
import com.zimbra.soap.account.message.AuthResponse;
/**
* The ZXMLAuthRepository class.<br>
* Contains XML document based data access methods for auth.
*
* @author Zimbra API Team
* @package com.zimbra.graphql.repositories.impl
* @copyright Copyright © 2018
*/
public class ZXMLAuthRepository extends ZXMLRepository implements IRepository {
/**
* The auth document handler.
*/
protected final Auth authHandler;
/**
* Creates an instance with default document handlers.
*/
public ZXMLAuthRepository() {
this(new Auth());
}
/**
* Creates an instance with specified handlers.
*
* @param authHandler The auth handler
*/
public ZXMLAuthRepository(Auth authHandler) {
super();
this.authHandler = authHandler;
}
/**
* Performs an auth request with given properties.
*
* @param rctxt The request context
* @param authInput Auth properties
* @return The auth response
* @throws ServiceException If there are issues executing the document
*/
public AuthResponse authenticate(RequestContext rctxt, GQLAuthRequestInput authInput)
throws ServiceException {
final AuthRequest req = new AuthRequest();
req.setAccount(authInput.getAccount());
req.setPassword(authInput.getPassword());
req.setPreauth(authInput.getPreauthToken());
req.setAuthToken(authInput.getAuthToken());
req.setJwtToken(authInput.getJwtAuthToken());
req.setTrustedDeviceToken(authInput.getTrustedDeviceToken());
req.setTokenType(authInput.getTokenType());
req.setRecoveryCode(authInput.getReceoveryCode());
req.setTwoFactorCode(authInput.getTwoFactorCode());
req.setVirtualHost(authInput.getVirtualHost());
req.setDeviceId(authInput.getDeviceId());
req.setPersistAuthTokenCookie(authInput.getDoPersistCookie());
req.setCsrfSupported(authInput.getIsCsrfSupported());
req.setDeviceTrusted(authInput.getIsDeviceTrusted());
req.setGenerateDeviceId(authInput.getDoGenerateDeviceId());
req.setPrefs(authInput.getPrefs());
req.setAttrs(authInput.getAttrs());
// execute
final Element response = XMLDocumentUtilities.executeDocumentAsGuest(
authHandler,
XMLDocumentUtilities.toElement(req),
rctxt);
AuthResponse zAuthResponse = null;
if (response != null) {
zAuthResponse = XMLDocumentUtilities
.fromElement(response, AuthResponse.class);
}
return zAuthResponse;
}
}
| 37.421569 | 93 | 0.705266 |
3196b0490b58d0538064a9c5cc49f6b3f1c42863
| 14,950 |
// Copyright Keith D Gregory
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package net.sf.kdgcommons.util;
import java.io.UnsupportedEncodingException;
/**
* This class manages a variable-length array of bytes. It's primary use is as
* a replacement for <code>StringBuffer</code> for applications that need to
* deal with 8-bit character strings (eg, those that exchange data with legacy
* C programs).
*/
public class ByteArray
{
//----------------------------------------------------------------------------
// Instance data and constructors
//----------------------------------------------------------------------------
protected byte[] _data;
protected int _size; // current bytes in array
protected int _expandBy; // percent to expand when needed
/**
* Constructs a new <code>ByteArray</code>, with specified initial
* capacity and expansion factor. This is the basic constructor.
*
* @param capacity The initial size of the underlying array.
* @param factor The exansion factor. This is the percentage by
* which the array should be expanded, whenever
* additions run out of space.
*/
public ByteArray(int capacity, int factor)
{
_data = new byte[capacity];
_size = 0;
_expandBy = factor;
}
/**
* Constructs a new <code>ByteArray</code> from a <code>byte[]</code>.
* The source array is copied into the new object, with some room to
* grow, and it is given a default expansion factor.
*/
public ByteArray(byte[] src)
{
this((src.length * 5)/4, 25);
add(src);
}
/**
* Constructs a new <code>ByteArray</code> from a <code>String</code>, using
* ISO-8859-1 encoding. The array is given the default expansion factor. Null
* strings will be converted to a zero-length array.
*
* @throws IllegalArgumentException if the passed string contains characters
* outside the 8-bit range.
*/
public ByteArray(String src)
{
this(convertToISO8859(src));
}
/**
* Constructs a new <code>ByteArray</code> from a <code>String</code>, using
* the specified encoding. The array is given the default expansion factor.
* @throws UnsupportedEncodingException
*/
public ByteArray(String src, String encoding)
throws UnsupportedEncodingException
{
this(src.getBytes(encoding));
}
/**
* Creates a new, empty <code>ByteArray</code>, using a default capacity
* and expansion factor.
*/
public ByteArray()
{
this(64, 25);
}
//----------------------------------------------------------------------------
// Public methods
//----------------------------------------------------------------------------
/**
* Adds a single byte to the end of this array.
*/
public void add(byte val)
{
ensureCapacity(1);
_data[_size++] = val;
}
/**
* Adds a <code>byte[]</code> to the end of this array.
*/
public void add(byte[] src)
{
add(src, 0, src.length);
}
/**
* Adds a segment of a <code>byte[]</code> to the end of this array.
*/
public void add(byte[] src, int off, int len)
{
ensureCapacity(len);
for (int ii = 0 ; ii < len ; ii++)
_data[_size++] = src[off + ii];
}
/**
* Adds the low-order 8 bits of the passed character to this array.
* Only useful with ASCII or 8-bit character sets.
*/
public void add(char src)
{
add((byte)(src & 0xFF));
}
/**
* Adds a <code>String</code> to the end of this array, converting it
* with ISO-8859-1 encoding.
*/
public void add(String src)
{
add(convertToISO8859(src));
}
/**
* Adds a <code>String</code> to the end of this array, using the specified
* encoding. Note that this may result in multi-byte characters.
*/
public void add(String src, String encoding)
throws UnsupportedEncodingException
{
add(src.getBytes(encoding));
}
/**
* Adds another <code>ByteArray</code> to the end of this array.
*/
public void add(ByteArray src)
{
ensureCapacity(src.size());
for (int i = 0 ; i < src._size ; i++)
_data[_size++] = src._data[i];
}
/**
* Returns a single byte from the array.
*
* @param idx The index of the byte to be removed.
*
* @throws ArrayIndexOutOfBoundsException if <code>idx</code> is outside
* the current bounds of the array.
*/
public byte get(int idx)
{
if ((idx < 0) || (idx >= _size))
throw new ArrayIndexOutOfBoundsException(idx);
return _data[idx];
}
/**
* Returns the underlying array. This method exists for efficiency; most
* callers should use {@link #getBytes} instead.
* <p>
* Note that the returned array may be significantly larger than what is
* reported by {@link #size}.
*/
public byte[] getArray()
{
return _data;
}
/**
* Returns a specified sub-section of the array. The returned bytes are
* copied from the actual array, and will not reflect subsequent changes.
*
* @param off The starting byte of the subarray.
* @param len The length of the subarray.
*
* @throws IllegalArgumentException if <code>off</code> and/or <code>
* len</code> specify indexes that are outside the bounds of
* the array.
*/
public byte[] getBytes(int off, int len)
{
if ((off < 0) || (off > _size))
throw new IllegalArgumentException("invalid offset: " + off);
if (off + len > _size)
throw new IllegalArgumentException("invalid length: " + len);
byte[] result = new byte[len];
for (int i = 0 ; i < len ; i++)
result[i] = _data[off + i];
return result;
}
/**
* Returns a <code>byte[]</code> containing the bytes from a specified
* offset to the end of the array. The returned array is a copy of the
* managed array, and will not reflect subsequent changes.
*
* @param off The starting byte of the subarray.
* @throws ArrayIndexOutOfBoundsException if any of the bytes defined by
* <code>off</code> and <code>len</code> are outside the current
* bounds of the array.
*/
public byte[] getBytes(int off)
{
return getBytes(off, (_size - off));
}
/**
* Returns a <code>byte[]</code> containing all bytes in this array. The
* returned array is a copy of this object's data, and will not reflect
* subsequent changes.
*/
public byte[] getBytes()
{
return getBytes(0, _size);
}
/**
* Inserts the passed array at an arbitrary point in this array. All
* existing contents are moved up to make room.
*
* @param off The position where the passed array is inserted.
* @param src The array to insert.
*/
public void insert(int off, ByteArray src)
{
insert(off, src, 0, src.size());
}
/**
* Inserts a portion of the passed array at an arbitrary point in this
* array. All existing contents are moved up to make room.
*
* @param off The position where the passed array is inserted.
* @param src The array to insert.
* @param srcOff The offset within the source array where the inserted
* data begins.
* @param srcLen The number of bytes to transfer from the source array.
*
* @throws IllegalArgumentException if <code>off</code> is larger than the
* current size of the array, or if <code>srcOff</code> or <code>
* srcOff + srcLen</code> is outside the bounds of the source
* array. These are checked prior to performing any moves, so this
* array will not be corrupted.
*/
public void insert(int off, ByteArray src, int srcOff, int srcLen)
{
// have to check bounds before delegating, because offsets may be
// outside controlled bounds, while inside physical bounds
if ((srcOff < 0) || (srcOff > src.size()))
throw new IllegalArgumentException("invalid src offset: " + srcOff);
if (srcOff + srcLen > src.size())
throw new IllegalArgumentException("invalid src length: " + srcLen);
insert(off, src.getArray(), srcOff, srcLen);
}
/**
* Inserts the passed array at an arbitrary point in this array. All
* existing contents are moved up to make room.
*
* @param off The position where the passed array is inserted.
* @param src The array to insert.
*/
public void insert(int off, byte[] src)
{
insert(off, src, 0, src.length);
}
/**
* Inserts the passed array of bytes into the middle of this array.
*
* @param off The position where the passed array is inserted.
* @param src The array to insert.
* @param srcOff The offset within the source array where the inserted
* data begins.
* @param srcLen The number of bytes to transfer from the source array.
*
* @throws IllegalArgumentException if <code>off</code> is larger than the
* current size of the array, or if <code>srcOff</code> or <code>
* srcOff + srcLen</code> is outside the bounds of the source
* array. These are checked prior to performing any moves, so this
* array will not be corrupted.
*/
public void insert(int off, byte[] src, int srcOff, int srcLen)
{
if ((off < 0) || (off > _size))
throw new IllegalArgumentException("invalid dst offset: " + off);
if ((srcOff < 0) || (srcOff > src.length))
throw new IllegalArgumentException("invalid src offset: " + srcOff);
if (srcOff + srcLen > src.length)
throw new IllegalArgumentException("invalid src length: " + srcLen);
ensureCapacity(srcLen);
System.arraycopy(_data, off, _data, off + srcLen, _size - off);
System.arraycopy(src, srcOff, _data, off, srcLen);
_size += srcLen;
}
/**
* Removes a specified byte from this array, shifting subsequent bytes
* down and reducing the size of the array.
*
* @param idx The index of the byte to be removed.
*
* @throws ArrayIndexOutOfBoundsException if <code>idx</code> is outside
* the current bounds of the array.
*/
public void remove(int idx)
{
remove(idx, 1);
}
/**
* Removes a subset of the bytes in this array, shifting subsequent bytes
* down and reducing the size of the array.
*
* @param off The starting byte to be removed.
* @param len The number of bytes to be removed.
* @throws ArrayIndexOutOfBoundsException if any of the bytes defined by
* <code>off</code> and <code>len</code> are outside the current
* bounds of the array.
*/
public void remove(int off, int len)
{
if ((off < 0) || (off + len >= _size))
throw new IllegalArgumentException("invalid offset/length: " + off + "/" + len);
int srcPos = off + len;
int count = _size - srcPos;
System.arraycopy(_data, srcPos, _data, off, count);
_size -= len;
}
/**
* Removes the last byte in the array.
*/
public void removeLast()
{
if (_size > 0)
_size--;
}
/**
* Returns the current size of this array.
*/
public int size()
{
return _size;
}
/**
* Resizes the array. If the specified size is less than the current
* size, the array is truncated. If it is greater than the current size,
* the array is expanded and the new space is filled with zero-bytes.
*
* @param size The desired size of the array.
*/
public void setSize(int size)
{
setCapacity(size);
for (int ii = _size ; ii < size ; ii++)
_data[ii] = (byte)0;
_size = size;
}
//----------------------------------------------------------------------------
// Overrides of Object
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
// Internals
//----------------------------------------------------------------------------
/**
* Converts a string using ISO-8859-1 encoding, throwing if the string
* cannot be translated.
*/
private static byte[] convertToISO8859(String src)
{
// String.getBytes() doesn't throw if the encoding is invalid, so we'd
// have to check every character anyway; given that, there's no reason
// not to just copy manually
byte[] result = new byte[src.length()];
for (int ii = 0 ; ii < result.length ; ii++)
{
char c = src.charAt(ii);
if (c > 255)
throw new IllegalArgumentException("invalid character at position " + ii);
result[ii] = (byte)c;
}
return result;
}
/**
* Verifies that the array can accept an insert of the specified size,
* and expands it if it can't. This should be called before every add.
*/
private void ensureCapacity(int bytes)
{
if ((_size + bytes) < _data.length)
return;
int newSize = _data.length * _expandBy / 100;
setCapacity(Math.max(newSize, (_size + bytes)));
}
/**
* Expands or contracts the underlying array to a specified size. If
* the requested size is less than the current size of the array's
* data, this request is ignored.
*/
private void setCapacity(int size)
{
if (size < _size)
return;
byte[] newData = new byte[size];
for (int ii = 0 ; ii < _size ; ii++)
newData[ii] = _data[ii];
_data = newData;
}
}
| 31.081081 | 92 | 0.563344 |
62091521871e5e859e18b85cd7f2fc743a811b91
| 1,024 |
package org.point85.app.opc.ua;
import org.point85.app.designer.DataSourceConnectionController;
import org.point85.app.designer.DesignerLocalizer;
import org.point85.domain.opc.ua.OpcUaSource;
public abstract class OpcUaController extends DataSourceConnectionController {
// current source
private OpcUaSource dataSource;
public OpcUaSource getSource() {
if (dataSource == null) {
dataSource = new OpcUaSource();
}
return dataSource;
}
protected void setSource(OpcUaSource source) {
this.dataSource = source;
}
@Override
protected void terminateConnectionService() throws Exception {
// disconnect
if (getApp().getOpcUaClient() != null) {
getApp().getOpcUaClient().disconnect();
}
super.terminateConnectionService();
}
@Override
protected void connectToDataSource() throws Exception {
if (dataSource == null) {
throw new Exception(DesignerLocalizer.instance().getErrorString("no.ua.source"));
}
// connect to OPC server
getApp().getOpcUaClient().connect(dataSource);
}
}
| 24.380952 | 84 | 0.75 |
8f5809231ee80d4967b57015a6ffaedb06f6cb55
| 30,853 |
// This file is part of CPAchecker,
// a tool for configurable software verification:
// https://cpachecker.sosy-lab.org
//
// SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.sosy_lab.cpachecker.cpa.flowdep;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Multimap;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Level;
import java.util.stream.Collectors;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.sosy_lab.common.log.LogManager;
import org.sosy_lab.common.log.LogManagerWithoutDuplicates;
import org.sosy_lab.cpachecker.cfa.ast.c.CAddressOfLabelExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CArrayDesignator;
import org.sosy_lab.cpachecker.cfa.ast.c.CArrayRangeDesignator;
import org.sosy_lab.cpachecker.cfa.ast.c.CArraySubscriptExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CAssignment;
import org.sosy_lab.cpachecker.cfa.ast.c.CAstNode;
import org.sosy_lab.cpachecker.cfa.ast.c.CAstNodeVisitor;
import org.sosy_lab.cpachecker.cfa.ast.c.CBinaryExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CCastExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CCharLiteralExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CComplexCastExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CComplexTypeDeclaration;
import org.sosy_lab.cpachecker.cfa.ast.c.CDesignatedInitializer;
import org.sosy_lab.cpachecker.cfa.ast.c.CDesignator;
import org.sosy_lab.cpachecker.cfa.ast.c.CExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CExpressionAssignmentStatement;
import org.sosy_lab.cpachecker.cfa.ast.c.CExpressionStatement;
import org.sosy_lab.cpachecker.cfa.ast.c.CFieldDesignator;
import org.sosy_lab.cpachecker.cfa.ast.c.CFieldReference;
import org.sosy_lab.cpachecker.cfa.ast.c.CFloatLiteralExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CFunctionCall;
import org.sosy_lab.cpachecker.cfa.ast.c.CFunctionCallAssignmentStatement;
import org.sosy_lab.cpachecker.cfa.ast.c.CFunctionCallExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CFunctionCallStatement;
import org.sosy_lab.cpachecker.cfa.ast.c.CFunctionDeclaration;
import org.sosy_lab.cpachecker.cfa.ast.c.CIdExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CImaginaryLiteralExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CInitializer;
import org.sosy_lab.cpachecker.cfa.ast.c.CInitializerExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CInitializerList;
import org.sosy_lab.cpachecker.cfa.ast.c.CIntegerLiteralExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CLeftHandSide;
import org.sosy_lab.cpachecker.cfa.ast.c.CParameterDeclaration;
import org.sosy_lab.cpachecker.cfa.ast.c.CPointerExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CReturnStatement;
import org.sosy_lab.cpachecker.cfa.ast.c.CRightHandSide;
import org.sosy_lab.cpachecker.cfa.ast.c.CSimpleDeclaration;
import org.sosy_lab.cpachecker.cfa.ast.c.CStatement;
import org.sosy_lab.cpachecker.cfa.ast.c.CStringLiteralExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CTypeDefDeclaration;
import org.sosy_lab.cpachecker.cfa.ast.c.CTypeIdExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CUnaryExpression;
import org.sosy_lab.cpachecker.cfa.ast.c.CVariableDeclaration;
import org.sosy_lab.cpachecker.cfa.model.CFAEdge;
import org.sosy_lab.cpachecker.cfa.model.c.CAssumeEdge;
import org.sosy_lab.cpachecker.cfa.model.c.CDeclarationEdge;
import org.sosy_lab.cpachecker.cfa.model.c.CFunctionCallEdge;
import org.sosy_lab.cpachecker.cfa.model.c.CFunctionReturnEdge;
import org.sosy_lab.cpachecker.cfa.model.c.CFunctionSummaryEdge;
import org.sosy_lab.cpachecker.cfa.model.c.CReturnStatementEdge;
import org.sosy_lab.cpachecker.cfa.model.c.CStatementEdge;
import org.sosy_lab.cpachecker.cfa.types.c.CArrayType;
import org.sosy_lab.cpachecker.cfa.types.c.CEnumType.CEnumerator;
import org.sosy_lab.cpachecker.cfa.types.c.CType;
import org.sosy_lab.cpachecker.core.defaults.SingleEdgeTransferRelation;
import org.sosy_lab.cpachecker.core.interfaces.AbstractState;
import org.sosy_lab.cpachecker.core.interfaces.Precision;
import org.sosy_lab.cpachecker.core.interfaces.TransferRelation;
import org.sosy_lab.cpachecker.cpa.composite.CompositeState;
import org.sosy_lab.cpachecker.cpa.flowdep.FlowDependenceState.FlowDependence;
import org.sosy_lab.cpachecker.cpa.flowdep.FlowDependenceState.UnknownPointerDependence;
import org.sosy_lab.cpachecker.cpa.pointer2.PointerState;
import org.sosy_lab.cpachecker.cpa.reachdef.ReachingDefState;
import org.sosy_lab.cpachecker.cpa.reachdef.ReachingDefState.DefinitionPoint;
import org.sosy_lab.cpachecker.cpa.reachdef.ReachingDefState.ProgramDefinitionPoint;
import org.sosy_lab.cpachecker.exceptions.CPATransferException;
import org.sosy_lab.cpachecker.util.Pair;
import org.sosy_lab.cpachecker.util.reachingdef.ReachingDefUtils;
import org.sosy_lab.cpachecker.util.states.MemoryLocation;
import org.sosy_lab.cpachecker.util.variableclassification.VariableClassification;
/**
* Transfer relation of {@link FlowDependenceCPA}.
*/
class FlowDependenceTransferRelation
extends SingleEdgeTransferRelation {
private final TransferRelation delegate;
private final Optional<VariableClassification> varClassification;
private final LogManagerWithoutDuplicates logger;
FlowDependenceTransferRelation(
final TransferRelation pDelegate,
final Optional<VariableClassification> pVarClassification,
final LogManager pLogger) {
delegate = pDelegate;
varClassification = pVarClassification;
logger = new LogManagerWithoutDuplicates(pLogger);
}
private Multimap<MemoryLocation, ProgramDefinitionPoint> normalizeReachingDefinitions(
ReachingDefState pState) {
Multimap<MemoryLocation, ProgramDefinitionPoint> normalized = HashMultimap.create();
normalized.putAll(normalize(pState.getLocalReachingDefinitions()));
normalized.putAll(normalize(pState.getGlobalReachingDefinitions()));
return normalized;
}
private Multimap<MemoryLocation, ProgramDefinitionPoint> normalize(
Map<MemoryLocation, Set<DefinitionPoint>> pDefs) {
Multimap<MemoryLocation, ProgramDefinitionPoint> normalized = HashMultimap.create();
for (Map.Entry<MemoryLocation, Set<DefinitionPoint>> e : pDefs.entrySet()) {
MemoryLocation varName = e.getKey();
Set<DefinitionPoint> points = e.getValue();
Collection<ProgramDefinitionPoint> defPoints =
points
.stream()
.filter(x -> x instanceof ProgramDefinitionPoint)
.map(p -> (ProgramDefinitionPoint) p)
.collect(Collectors.toList());
normalized.putAll(varName, defPoints);
}
return normalized;
}
/**
* Returns a new FlowDependenceState for the declaration represented by the given {@link
* CVariableDeclaration} object. Since the wrapped {@link
* org.sosy_lab.cpachecker.cpa.reachdef.ReachingDefCPA ReachingDefCPA} tracks new definitions of
* variables, we only have to consider the use of variables in the initializer that may exist.
*/
private FlowDependenceState handleDeclarationEdge(
CDeclarationEdge pCfaEdge,
CVariableDeclaration pDecl,
FlowDependenceState pNextFlowState,
ReachingDefState pReachDefState,
PointerState pPointerState)
throws CPATransferException {
CInitializer maybeInitializer = pDecl.getInitializer();
if (maybeInitializer instanceof CInitializerExpression) {
// If the declaration contains an initializer, create the corresponding flow dependences
// for its variable uses
CExpression initializerExp = ((CInitializerExpression) maybeInitializer).getExpression();
MemoryLocation def = MemoryLocation.valueOf(pDecl.getQualifiedName());
return handleOperation(
pCfaEdge,
Optional.of(def),
getUsedVars(initializerExp, pPointerState),
pNextFlowState,
pReachDefState);
} else {
// If the declaration contains no initializer, there are no variable uses and ergo
// no new flow dependences.
return pNextFlowState;
}
}
/**
* Adds the flow dependences based on the given {@link CAstNode} and the {@link ReachingDefState}
* to the given {@link FlowDependenceState}.
*
* <p>If no reaching definition exists for a program variable used in the expression, a flow
* dependence to the declaration of the variable is added.
*/
private FlowDependenceState handleOperation(
CFAEdge pCfaEdge,
Optional<MemoryLocation> pNewDeclaration,
Set<MemoryLocation> pUses,
FlowDependenceState pNextState,
ReachingDefState pReachDefState) {
Multimap<MemoryLocation, ProgramDefinitionPoint> defs =
normalizeReachingDefinitions(pReachDefState);
FlowDependence dependences;
if (pUses == null) {
dependences = UnknownPointerDependence.getInstance();
} else {
// Keep only definitions of uses in the currently considered CFA edge
defs.keySet().retainAll(pUses);
if (defs.keySet().size() != pUses.size()) {
logger.log(
Level.WARNING,
"No definition point for at least one use in edge %s: %s",
pCfaEdge,
pReachDefState);
}
dependences = FlowDependence.create(defs);
}
if (dependences.isUnknownPointerDependence() || !dependences.isEmpty()) {
pNextState.addDependence(pCfaEdge, pNewDeclaration, dependences);
}
return pNextState;
}
private Set<MemoryLocation> getUsedVars(CAstNode pExpression, PointerState pPointerState)
throws CPATransferException {
UsesCollector usesCollector = new UsesCollector(pPointerState, varClassification);
return pExpression.accept(usesCollector);
}
private FlowDependenceState handleReturnStatementEdge(
CReturnStatementEdge pCfaEdge,
FlowDependenceState pNextState,
ReachingDefState pReachDefState,
PointerState pPointerState)
throws CPATransferException {
com.google.common.base.Optional<CAssignment> asAssignment = pCfaEdge.asAssignment();
if (asAssignment.isPresent()) {
CAssignment returnAssignment = asAssignment.get();
CRightHandSide rhs = returnAssignment.getRightHandSide();
Set<MemoryLocation> defs = getDef(returnAssignment.getLeftHandSide(), pPointerState);
FlowDependenceState nextState = pNextState;
for (MemoryLocation d : defs) {
nextState =
handleOperation(
pCfaEdge,
Optional.of(d),
getUsedVars(rhs, pPointerState),
nextState,
pReachDefState);
}
return nextState;
} else {
return pNextState;
}
}
private Set<MemoryLocation> getDef(CLeftHandSide pLeftHandSide, PointerState pPointerState)
throws CPATransferException {
Set<MemoryLocation> decls;
UsesCollector collector = new UsesCollector(pPointerState, varClassification);
if (pLeftHandSide instanceof CPointerExpression) {
return getPossibePointees(
(CPointerExpression) pLeftHandSide, pPointerState, varClassification);
} else if (pLeftHandSide instanceof CArraySubscriptExpression) {
decls = ((CArraySubscriptExpression) pLeftHandSide).getArrayExpression().accept(collector);
} else {
decls = pLeftHandSide.accept(collector);
}
return decls;
}
private static @Nullable Set<MemoryLocation> getPossibePointees(
CPointerExpression pExp,
PointerState pPointerState,
Optional<VariableClassification> pVarClassification) {
Set<MemoryLocation> pointees = ReachingDefUtils.possiblePointees(pExp, pPointerState);
if (pointees == null) {
pointees = new HashSet<>();
if (pVarClassification.isPresent()) {
Set<String> addressedVars = pVarClassification.orElseThrow().getAddressedVariables();
for (String v : addressedVars) {
MemoryLocation m = MemoryLocation.valueOf(v);
pointees.add(m);
}
} else {
// if pointees are unknown and we can't derive them through the variable classification,
// any variable could be used.
return null;
}
}
return pointees;
}
protected FlowDependenceState handleAssumption(
CAssumeEdge cfaEdge,
CExpression expression,
FlowDependenceState pNextState,
ReachingDefState pReachDefState,
PointerState pPointerState)
throws CPATransferException {
return handleOperation(
cfaEdge,
Optional.empty(),
getUsedVars(expression, pPointerState),
pNextState,
pReachDefState);
}
protected FlowDependenceState handleFunctionCallEdge(
CFunctionCallEdge pFunctionCallEdge,
List<CExpression> pArguments,
FlowDependenceState pNextState,
ReachingDefState pReachDefState,
PointerState pPointerState)
throws CPATransferException {
FlowDependenceState nextState = pNextState;
List<CParameterDeclaration> params = pFunctionCallEdge.getSuccessor().getFunctionParameters();
for (int i = 0; i < pArguments.size(); i++) {
MemoryLocation def;
if (i < params.size()) {
def = MemoryLocation.valueOf(params.get(i).getQualifiedName());
} else {
assert pFunctionCallEdge.getSuccessor().getFunctionDefinition().getType().takesVarArgs();
// TODO support var args
break;
}
CExpression argument = pArguments.get(i);
nextState =
handleOperation(
pFunctionCallEdge,
Optional.of(def),
getUsedVars(argument, pPointerState),
nextState,
pReachDefState);
}
return nextState;
}
protected FlowDependenceState handleStatementEdge(
CStatementEdge pCfaEdge,
CStatement pStatement,
FlowDependenceState pNextState,
ReachingDefState pReachDefState,
PointerState pPointerState)
throws CPATransferException {
FlowDependenceState nextState = pNextState;
Set<MemoryLocation> possibleDefs;
if (pStatement instanceof CAssignment) {
possibleDefs = getDef(((CAssignment) pStatement).getLeftHandSide(), pPointerState);
if (possibleDefs != null) {
for (MemoryLocation def : possibleDefs) {
nextState =
handleOperation(
pCfaEdge,
Optional.ofNullable(def),
getUsedVars(pStatement, pPointerState),
nextState,
pReachDefState);
}
} else {
nextState =
handleOperation(
pCfaEdge,
Optional.empty(),
getUsedVars(pStatement, pPointerState),
nextState,
pReachDefState);
}
}
return nextState;
}
@Override
public Collection<FlowDependenceState> getAbstractSuccessorsForEdge(
final AbstractState pState, final Precision pPrecision, final CFAEdge pCfaEdge)
throws CPATransferException {
assert pState instanceof FlowDependenceState
: "Expected state of type " + FlowDependenceState.class.getSimpleName();
FlowDependenceState oldState = (FlowDependenceState) pState;
CompositeState oldComposite = oldState.getReachDefState();
Optional<CompositeState> nextComposite =
computeReachDefState(oldComposite, pPrecision, pCfaEdge);
if (nextComposite.isPresent()) {
CompositeState newReachDefState = nextComposite.orElseThrow();
Pair<ReachingDefState, PointerState> oldReachDefAndPointerState = oldState.unwrap();
ReachingDefState oldReachDefState = oldReachDefAndPointerState.getFirst();
PointerState oldPointerState = oldReachDefAndPointerState.getSecond();
FlowDependenceState nextState = new FlowDependenceState(newReachDefState);
switch (pCfaEdge.getEdgeType()) {
case DeclarationEdge:
CDeclarationEdge declEdge = (CDeclarationEdge) pCfaEdge;
if (declEdge.getDeclaration() instanceof CVariableDeclaration) {
CVariableDeclaration declaration = (CVariableDeclaration) declEdge.getDeclaration();
nextState =
handleDeclarationEdge(
declEdge, declaration, nextState, oldReachDefState, oldPointerState);
} // else {
// Function declarations don't introduce any flow dependencies
// }
break;
case StatementEdge:
CStatementEdge stmtEdge = (CStatementEdge) pCfaEdge;
nextState =
handleStatementEdge(
stmtEdge, stmtEdge.getStatement(), nextState, oldReachDefState, oldPointerState);
break;
case AssumeEdge:
CAssumeEdge assumeEdge = (CAssumeEdge) pCfaEdge;
nextState =
handleAssumption(
assumeEdge,
assumeEdge.getExpression(),
nextState,
oldReachDefState,
oldPointerState);
break;
case ReturnStatementEdge:
CReturnStatementEdge returnStatementEdge = (CReturnStatementEdge) pCfaEdge;
nextState =
handleReturnStatementEdge(
returnStatementEdge, nextState, oldReachDefState, oldPointerState);
break;
case FunctionCallEdge:
CFunctionCallEdge callEdge = (CFunctionCallEdge) pCfaEdge;
nextState =
handleFunctionCallEdge(
callEdge, callEdge.getArguments(), nextState, oldReachDefState, oldPointerState);
break;
case FunctionReturnEdge:
CFunctionReturnEdge returnEdge = (CFunctionReturnEdge) pCfaEdge;
nextState =
handleFunctionReturnEdge(returnEdge, nextState, oldReachDefState, oldPointerState);
break;
default:
break;
}
assert nextState != null;
return ImmutableSet.of(nextState);
} else {
return ImmutableSet.of();
}
}
private FlowDependenceState handleFunctionReturnEdge(
final CFunctionReturnEdge pReturnEdge,
final FlowDependenceState pNewState,
final ReachingDefState pReachDefState,
final PointerState pPointerState)
throws CPATransferException {
FlowDependenceState nextState = pNewState;
CFunctionSummaryEdge summaryEdge = pReturnEdge.getSummaryEdge();
CFunctionCallExpression functionCall = summaryEdge.getExpression().getFunctionCallExpression();
List<CExpression> outFunctionParams = functionCall.getParameterExpressions();
List<CParameterDeclaration> inFunctionParams = functionCall.getDeclaration().getParameters();
// TODO support varargs
for (int i = 0; i < inFunctionParams.size(); i++) {
CParameterDeclaration inParam = inFunctionParams.get(i);
CType parameterType = inParam.getType();
if (parameterType instanceof CArrayType) {
CExpression outParam = outFunctionParams.get(i);
Set<MemoryLocation> possibleDefs;
if (outParam instanceof CLeftHandSide) {
possibleDefs = getDef((CLeftHandSide) outParam, pPointerState);
} else {
throw new AssertionError("Unhandled: " + outParam);
}
if (possibleDefs != null) {
for (MemoryLocation def : possibleDefs) {
nextState =
handleOperation(
pReturnEdge,
Optional.ofNullable(def),
ImmutableSet.of(MemoryLocation.valueOf(inParam.getQualifiedName())),
nextState,
pReachDefState);
}
} else {
nextState =
handleOperation(
pReturnEdge,
Optional.empty(),
ImmutableSet.of(MemoryLocation.valueOf(inParam.getQualifiedName())),
nextState,
pReachDefState);
}
}
}
com.google.common.base.Optional<CVariableDeclaration> maybeReturnVar =
summaryEdge.getFunctionEntry().getReturnVariable();
if (maybeReturnVar.isPresent()) {
Set<MemoryLocation> possibleDefs = null;
CFunctionCall call = summaryEdge.getExpression();
if (call instanceof CFunctionCallAssignmentStatement) {
possibleDefs =
getDef(((CFunctionCallAssignmentStatement) call).getLeftHandSide(), pPointerState);
}
if (possibleDefs != null) {
for (MemoryLocation def : possibleDefs) {
nextState =
handleOperation(
pReturnEdge,
Optional.ofNullable(def),
ImmutableSet.of(MemoryLocation.valueOf(maybeReturnVar.get().getQualifiedName())),
nextState,
pReachDefState);
}
} else {
nextState =
handleOperation(
pReturnEdge,
Optional.empty(),
ImmutableSet.of(MemoryLocation.valueOf(maybeReturnVar.get().getQualifiedName())),
nextState,
pReachDefState);
}
}
return nextState;
}
private Optional<CompositeState> computeReachDefState(
CompositeState pOldState, Precision pPrecision, CFAEdge pCfaEdge)
throws CPATransferException {
Collection<? extends AbstractState> computedReachDefStates;
try {
computedReachDefStates =
delegate.getAbstractSuccessorsForEdge(pOldState, pPrecision, pCfaEdge);
} catch (InterruptedException pE) {
throw new CPATransferException("Exception in reaching definitions transfer", pE);
}
if (computedReachDefStates.isEmpty()) {
return Optional.empty();
} else {
CompositeState composite = (CompositeState) Iterables.getOnlyElement(computedReachDefStates);
return Optional.of(composite);
}
}
/**
* Visitor that collects the variables used in a {@link CAstNode}. Variables are represented by
* their declaration.
*/
private static class UsesCollector
implements CAstNodeVisitor<Set<MemoryLocation>, CPATransferException> {
private final PointerState pointerState;
private final Optional<VariableClassification> varClassification;
public UsesCollector(
final PointerState pPointerState,
final Optional<VariableClassification> pVarClassification) {
pointerState = pPointerState;
varClassification = pVarClassification;
}
private Set<MemoryLocation> combine(
final Set<MemoryLocation> pLhs, final Set<MemoryLocation> pRhs) {
if (pLhs == null || pRhs == null) {
return null;
} else {
// FIXME: Change to immutable sets for performance
Set<MemoryLocation> combined = new HashSet<>(pLhs);
combined.addAll(pRhs);
return combined;
}
}
@Override
public Set<MemoryLocation> visit(CExpressionStatement pStmt) throws CPATransferException {
return pStmt.getExpression().accept(this);
}
@Override
public Set<MemoryLocation> visit(CExpressionAssignmentStatement pStmt)
throws CPATransferException {
Set<MemoryLocation> lhs = handleLeftHandSide(pStmt.getLeftHandSide());
Set<MemoryLocation> rhs = pStmt.getRightHandSide().accept(this);
return combine(lhs, rhs);
}
@Override
public Set<MemoryLocation> visit(CFunctionCallAssignmentStatement pStmt)
throws CPATransferException {
Set<MemoryLocation> lhs = handleLeftHandSide(pStmt.getLeftHandSide());
Set<MemoryLocation> rhs = pStmt.getRightHandSide().accept(this);
return combine(lhs, rhs);
}
private Set<MemoryLocation> handleLeftHandSide(final CLeftHandSide pLhs)
throws CPATransferException {
if (pLhs instanceof CPointerExpression) {
return ((CPointerExpression) pLhs).getOperand().accept(this);
} else if (pLhs instanceof CArraySubscriptExpression) {
return ((CArraySubscriptExpression) pLhs).getSubscriptExpression().accept(this);
} else {
return ImmutableSet.of();
}
}
@Override
public Set<MemoryLocation> visit(CFunctionCallStatement pStmt) throws CPATransferException {
Set<MemoryLocation> paramDecls = new HashSet<>();
for (CExpression p : pStmt.getFunctionCallExpression().getParameterExpressions()) {
paramDecls = combine(paramDecls, p.accept(this));
}
return paramDecls;
}
@Override
public Set<MemoryLocation> visit(CArrayDesignator pArrayDesignator)
throws CPATransferException {
return pArrayDesignator.getSubscriptExpression().accept(this);
}
@Override
public Set<MemoryLocation> visit(CArrayRangeDesignator pArrayRangeDesignator)
throws CPATransferException {
Set<MemoryLocation> fst = pArrayRangeDesignator.getCeilExpression().accept(this);
Set<MemoryLocation> snd = pArrayRangeDesignator.getFloorExpression().accept(this);
return combine(fst, snd);
}
@Override
public Set<MemoryLocation> visit(CFieldDesignator pFieldDesignator)
throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CArraySubscriptExpression pExp) throws CPATransferException {
Set<MemoryLocation> fst = pExp.getArrayExpression().accept(this);
Set<MemoryLocation> snd = pExp.getSubscriptExpression().accept(this);
return combine(fst, snd);
}
@Override
public Set<MemoryLocation> visit(CFieldReference pExp) throws CPATransferException {
return pExp.getFieldOwner().accept(this);
}
@Override
public Set<MemoryLocation> visit(CIdExpression pExp) throws CPATransferException {
CSimpleDeclaration idDeclaration = pExp.getDeclaration();
if (idDeclaration instanceof CVariableDeclaration || idDeclaration instanceof CParameterDeclaration) {
return Collections.singleton(MemoryLocation.valueOf(idDeclaration.getQualifiedName()));
} else {
return ImmutableSet.of();
}
}
@Override
public Set<MemoryLocation> visit(CPointerExpression pExp) throws CPATransferException {
Set<MemoryLocation> uses = pExp.getOperand().accept(this);
Set<MemoryLocation> pointees = getPossibePointees(pExp, pointerState, varClassification);
return combine(uses, pointees);
}
@Override
public Set<MemoryLocation> visit(CComplexCastExpression pExp) throws CPATransferException {
return pExp.getOperand().accept(this);
}
@Override
public Set<MemoryLocation> visit(CInitializerExpression pExp) throws CPATransferException {
return pExp.accept(this);
}
@Override
public Set<MemoryLocation> visit(CInitializerList pInitializerList)
throws CPATransferException {
Set<MemoryLocation> uses = new HashSet<>();
for (CInitializer i : pInitializerList.getInitializers()) {
uses = combine(uses, i.accept(this));
}
return uses;
}
@Override
public Set<MemoryLocation> visit(CDesignatedInitializer pExp) throws CPATransferException {
Set<MemoryLocation> used = pExp.getRightHandSide().accept(this);
for (CDesignator d : pExp.getDesignators()) {
used = combine(used, d.accept(this));
}
return used;
}
@Override
public Set<MemoryLocation> visit(CFunctionCallExpression pExp) throws CPATransferException {
Set<MemoryLocation> uses = pExp.getFunctionNameExpression().accept(this);
for (CExpression p : pExp.getParameterExpressions()) {
uses = combine(uses, p.accept(this));
}
return uses;
}
@Override
public Set<MemoryLocation> visit(CBinaryExpression pExp) throws CPATransferException {
return combine(
pExp.getOperand1().accept(this),
pExp.getOperand2().accept(this));
}
@Override
public Set<MemoryLocation> visit(CCastExpression pExp) throws CPATransferException {
return pExp.getOperand().accept(this);
}
@Override
public Set<MemoryLocation> visit(CCharLiteralExpression pExp) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CFloatLiteralExpression pExp) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CIntegerLiteralExpression pExp) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CStringLiteralExpression pExp) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CTypeIdExpression pExp) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CUnaryExpression pExp) throws CPATransferException {
return pExp.getOperand().accept(this);
}
@Override
public Set<MemoryLocation> visit(CImaginaryLiteralExpression pExp) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CAddressOfLabelExpression pExp) throws CPATransferException {
return pExp.accept(this);
}
@Override
public Set<MemoryLocation> visit(CFunctionDeclaration pDecl) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CComplexTypeDeclaration pDecl) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CTypeDefDeclaration pDecl) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CVariableDeclaration pDecl) throws CPATransferException {
CInitializer init = pDecl.getInitializer();
if (init != null) {
return init.accept(this);
} else {
return ImmutableSet.of();
}
}
@Override
public Set<MemoryLocation> visit(CParameterDeclaration pDecl) throws CPATransferException {
return pDecl.asVariableDeclaration().accept(this);
}
@Override
public Set<MemoryLocation> visit(CEnumerator pDecl) throws CPATransferException {
return ImmutableSet.of();
}
@Override
public Set<MemoryLocation> visit(CReturnStatement pNode) throws CPATransferException {
com.google.common.base.Optional<CExpression> ret = pNode.getReturnValue();
if (ret.isPresent()) {
return ret.get().accept(this);
} else {
return ImmutableSet.of();
}
}
}
}
| 37.307134 | 108 | 0.709429 |
331f0a5e9cc78f2ac205c55990e25399eab52ac5
| 1,710 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.flink.examples.java.graph.util;
import java.util.ArrayList;
import java.util.List;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.examples.java.graph.util.EnumTrianglesDataTypes.Edge;
/**
* Provides the default data sets used for the Triangle Enumeration example programs.
* The default data sets are used, if no parameters are given to the program.
*
*/
public class EnumTrianglesData {
public static final Object[][] EDGES = {
{1, 2},
{1, 3},
{1 ,4},
{1, 5},
{2, 3},
{2, 5},
{3, 4},
{3, 7},
{3, 8},
{5, 6},
{7, 8}
};
public static DataSet<Edge> getDefaultEdgeDataSet(ExecutionEnvironment env) {
List<Edge> edges = new ArrayList<Edge>();
for(Object[] e : EDGES) {
edges.add(new Edge((Integer)e[0], (Integer)e[1]));
}
return env.fromCollection(edges);
}
}
| 28.5 | 85 | 0.711696 |
e8aaf6d3d3b6a994f74cfab7f08160f8c28ac7ac
| 180 |
package iurii.job.interview.combinatorics;
/**
* C (k from n) = n! / ((n-k)! * k!) selecting k elements from n elements without order to matter.
*/
public class Combination {
}
| 22.5 | 98 | 0.672222 |
f85c89bce2d6961ade07a2ddb539b552ecb9fa45
| 1,305 |
package com.bdth.common.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.context.ServletContextAware;
import javax.servlet.ServletContext;
/**
* 启动解压zhengAdmin-x.x.x.jar到resources目录
* Created by shuzheng on 2016/12/18.
*/
public class ZhengAdminUtil implements InitializingBean, ServletContextAware {
private static Logger _log = LoggerFactory.getLogger(ZhengAdminUtil.class);
@Override
public void afterPropertiesSet() throws Exception {
}
@Override
public void setServletContext(ServletContext servletContext) {
_log.info("===== 开始解压zheng-admin =====");
String version = PropertiesFileUtil.getInstance("zheng-admin-client").get("zheng.admin.version");
_log.info("zheng-admin.jar 版本: {}", version);
String jarPath = servletContext.getRealPath("/WEB-INF/lib/zheng-admin-" + version + ".jar");
_log.info("zheng-admin.jar 包路径: {}", jarPath);
String resources = servletContext.getRealPath("/") + "/resources/zheng-admin";
_log.info("zheng-admin.jar 解压到: {}", resources);
JarUtil.decompress(jarPath, resources);
_log.info("===== 解压zheng-admin完成 =====");
}
}
| 35.27027 | 106 | 0.681992 |
eab89debf1bcfe5dc744ef08d166b016a44438c4
| 30,209 |
package nmj.util;
import java.lang.reflect.Array;
import java.lang.reflect.Method;
import java.text.Collator;
import java.util.*;
import java.util.function.*;
/**
* 非空设计|非线程安全|有序|单线程|非懒加载|的流式处理工具类
*
* @param <T>
* @author nmj
*/
public final class Table<T> implements Iterable<T> {
private static final Table EMPTY_TABLE = new Table<>(Collections.emptyList());
private static Method SPRING_COPY_METHOD = null;
static {
try {
Class<?> beanUtils = Class.forName("org.springframework.beans.BeanUtils");
SPRING_COPY_METHOD = beanUtils.getDeclaredMethod("copyProperties",
Object.class, Object.class, Class.class, String[].class);
SPRING_COPY_METHOD.setAccessible(true);
} catch (Throwable t) {
System.err.println("class org.springframework.beans.BeanUtils not found! nmj.Table.mapList(java.lang.Class<E>, java.lang.String...) not be working");
}
}
private final Iterable<T> data;
@Override
public Iterator<T> iterator() {
return new NonNullIterator<>(data.iterator());
}
@SafeVarargs
public static <T> Table<T> of(T... elements) {
if (elements == null || elements.length == 0) {
return EMPTY_TABLE;
}
return new Table<>(Arrays.asList(elements));
}
public static <T> Table<T> of(Iterable<T> elements) {
if (elements == null) {
return (Table<T>) EMPTY_TABLE;
}
return new Table<>(elements);
}
/**
* 使用StringTokenizer对字符串进行分割, 并去除空元素后构造成Table
*
* @param str
* @param delimiters
* @return
*/
public static Table<String> ofSplit(String str, String delimiters) {
if (str == null || str.isEmpty() || str.trim().isEmpty()) {
return EMPTY_TABLE;
}
if (delimiters == null || delimiters.isEmpty() || delimiters.trim().isEmpty()) {
throw new IllegalArgumentException("delimiters cannot be blank");
}
StringTokenizer st = new StringTokenizer(str, delimiters);
List<String> tokens = new ArrayList<>();
while (st.hasMoreTokens()) {
String token = st.nextToken().trim();
if (!token.isEmpty()) {
tokens.add(token);
}
}
return new Table<>(tokens);
}
/**
* 递归地将elements中类型为clazz或者其子类的所有元素找出来构造成Table
*
* @param clazz
* @param elements
* @param <T>
* @return
*/
public static <T> Table<T> ofClass(Class<T> clazz, Object... elements) {
if (clazz == null) {
throw new IllegalArgumentException("clazz cannot be null");
}
if (elements == null || elements.length == 0) {
return EMPTY_TABLE;
}
Set<Object> visitedElements = new HashSet<>();
List<T> data = new ArrayList<>();
for (Object element : elements) {
ofClass(data, clazz, element, visitedElements);
}
return new Table<>(data);
}
public Table<T> concat(Table<T> newTable) {
if (newTable == null || newTable.isEmpty()) {
return this;
}
List<T> list = new ArrayList<>(estimateSize() + newTable.estimateSize());
for (T t : this) {
list.add(t);
}
for (T t : newTable) {
list.add(t);
}
return of(list);
}
@SafeVarargs
public final Table<T> concat(T... elements) {
Table<T> newTable = of(elements);
return concat(newTable);
}
public Table<T> concat(Iterable<T> elements) {
Table<T> newTable = of(elements);
return concat(newTable);
}
public Table<T> concatOfClass(Class<T> clazz, Object... elements) {
Table<T> newTable = ofClass(clazz, elements);
return concat(newTable);
}
public boolean nonEmpty() {
return this.iterator().hasNext();
}
public boolean isEmpty() {
return !nonEmpty();
}
public boolean exists(Predicate<T> predicate) {
for (T t : this) {
if (predicate.test(t)) {
return true;
}
}
return false;
}
public boolean notExist(Predicate<T> predicate) {
for (T t : this) {
if (!predicate.test(t)) {
return true;
}
}
return false;
}
public int count() {
int index = 0;
for (T t : this) {
index++;
}
return index;
}
public int count(Predicate<T> predicate) {
int index = 0;
for (T t : this) {
if (predicate.test(t)) {
index++;
}
}
return index;
}
public Table<T> each(Consumer<T> consumer) {
for (T t : this) {
consumer.accept(t);
}
return this;
}
/**
* 带下标的遍历(下标从0开始)
*
* @param biConsumer
* @return
*/
public Table<T> each(BiConsumer<T, Integer> biConsumer) {
int index = 0;
for (T t : this) {
biConsumer.accept(t, index);
index++;
}
return this;
}
/**
* 分组遍历
*
* @param groupSize
* @param consumer
* @return
*/
public Table<T> each(int groupSize, Consumer<Table<T>> consumer) {
if (groupSize < 1) {
throw new IllegalArgumentException();
}
List<T> group = new ArrayList<>(groupSize);
for (T t : this) {
group.add(t);
if (group.size() >= groupSize) {
consumer.accept(of(group));
group.clear();
}
}
if (!group.isEmpty()) {
consumer.accept(of(group));
group.clear();
}
return this;
}
/**
* 二级遍历 注意biConsumer中两个元素均不会为null
*
* @param level2
* @param biConsumer
* @param <E>
* @return
*/
public <E> Table<T> each(Function<T, Iterable<E>> level2, BiConsumer<T, E> biConsumer) {
for (T t : this) {
Iterable<E> l2 = level2.apply(t);
if (l2 != null) {
for (E e : l2) {
if (e != null) {
biConsumer.accept(t, e);
}
}
}
}
return this;
}
public List<T> list() {
List<T> list = new ArrayList<>(estimateSize());
for (T t : this) {
list.add(t);
}
return list;
}
public Set<T> set() {
Set<T> set = new LinkedHashSet<>(estimateSize());
for (T t : this) {
set.add(t);
}
return set;
}
public Table<T[]> array() {
List<T> list = list();
if (list.isEmpty()) {
return EMPTY_TABLE;
}
T[] array = (T[]) Array.newInstance(list.get(0).getClass(), list.size());
list.toArray(array);
return of(Collections.singletonList(array));
}
public Table<T> distinct() {
return of(set());
}
public <E> Table<T> distinct(Function<T, E> function) {
Map<E, T> distinct = new LinkedHashMap<>(estimateSize() * 2);
for (T t : this) {
E e = function.apply(t);
distinct.putIfAbsent(e, t);
}
return of(distinct.values());
}
public Table<T> head() {
for (T t : this) {
return of(t);
}
return EMPTY_TABLE;
}
public T headOrElse(T orElse) {
for (T t : this) {
return t;
}
return orElse;
}
public T headOrNull() {
return headOrElse(null);
}
public Table<T> head(Predicate<T> predicate) {
for (T t : this) {
if (predicate.test(t)) {
return of(t);
}
}
return EMPTY_TABLE;
}
public T headOrElse(Predicate<T> predicate, T orElse) {
for (T t : this) {
if (predicate.test(t)) {
return t;
}
}
return orElse;
}
public <E> Table<E> head(Function<T, E> function) {
for (T t : this) {
E e = function.apply(t);
if (e != null) {
return of(e);
}
}
return EMPTY_TABLE;
}
public <E> E headOrElse(Function<T, E> function, E orElse) {
for (T t : this) {
E e = function.apply(t);
if (e != null) {
return e;
}
}
return orElse;
}
public T headOrNull(Predicate<T> predicate) {
return headOrElse(predicate, null);
}
public <E> E headOrNull(Function<T, E> function) {
for (T t : this) {
E e = function.apply(t);
if (e != null) {
return e;
}
}
return null;
}
public Table<T> first() {
return head();
}
public T firstOrNull() {
return headOrNull();
}
public Table<T> first(Predicate<T> predicate) {
return head(predicate);
}
public T firstOrNull(Predicate<T> predicate) {
return headOrElse(predicate, null);
}
public <E> E firstOrElse(Function<T, E> function) {
return headOrElse(function, null);
}
public <E> E firstOrNull(Function<T, E> function) {
return headOrNull(function);
}
public Table<T> last() {
T last = null;
for (T t : this) {
last = t;
}
return of(last);
}
public T lastOrElse(T orElse) {
T last = orElse;
for (T t : this) {
last = t;
}
return last;
}
public T lastOrNull() {
T last = null;
for (T t : this) {
last = t;
}
return last;
}
public Table<T> last(Predicate<T> predicate) {
T last = null;
for (T t : this) {
if (predicate.test(t)) {
last = t;
}
}
return of(last);
}
public <E> Table<E> last(Function<T, E> function) {
E last = null;
for (T t : this) {
E e = function.apply(t);
if (e != null) {
last = e;
}
}
return of(last);
}
public T lastOrElse(Predicate<T> predicate, T orElse) {
T last = orElse;
for (T t : this) {
if (predicate.test(t)) {
last = t;
}
}
return last;
}
public <E> E lastOrElse(Function<T, E> function, E orElse) {
E last = orElse;
for (T t : this) {
E e = function.apply(t);
if (e != null) {
last = e;
}
}
return last;
}
public T lastOrNull(Predicate<T> predicate) {
T last = null;
for (T t : this) {
if (predicate.test(t)) {
last = t;
}
}
return last;
}
public <E> E lastOrNull(Function<T, E> function) {
E last = null;
for (T t : this) {
E e = function.apply(t);
if (e != null) {
last = e;
}
}
return last;
}
public Table<T> filter(Predicate<T> predicate) {
return all(predicate);
}
public Table<T> all(Predicate<T> predicate) {
return of(list(predicate));
}
public Table<T> allNot(Predicate<T> predicate) {
return of(listNot(predicate));
}
public <E> Table<E> map(Function<T, E> function) {
return of(mapList(function));
}
/**
* 利用spring的beanUtils进行对象拷贝
* @param supplier
* @param ignoreProperties
* @param <E>
* @return
*/
public <E> Table<E> map(Supplier<E> supplier, String... ignoreProperties) {
return of(mapList(supplier, ignoreProperties));
}
public <E> Table<E> flatMap(Function<T, Iterable<E>> function) {
return of(flatMapList(function));
}
public <E> Table<E> flatMap(int groupSize, Function<Table<T>, Iterable<E>> function) {
return of(flatMapList(groupSize, function));
}
public List<T> list(Predicate<T> predicate) {
List<T> list = new ArrayList<>(estimateSize());
for (T t : this) {
if (predicate.test(t)) {
list.add(t);
}
}
return list;
}
public List<T> listNot(Predicate<T> predicate) {
List<T> list = new ArrayList<>(estimateSize());
for (T t : this) {
if (!predicate.test(t)) {
list.add(t);
}
}
return list;
}
public <E> List<E> mapList(Function<T, E> function) {
List<E> list = new ArrayList<>(estimateSize());
for (T t : this) {
E e = function.apply(t);
if (e != null) {
list.add(e);
}
}
return list;
}
/**
* 利用spring的beanUtils进行对象拷贝
* @param supplier
* @param ignoreProperties
* @param <E>
* @return
*/
public <E> List<E> mapList(Supplier<E> supplier, String... ignoreProperties) {
if (SPRING_COPY_METHOD == null) {
throw new IllegalStateException("class org.springframework.beans.BeanUtils not found!");
}
return mapList(t -> {
E e = supplier.get();
if (e == null) {
throw new IllegalArgumentException();
}
try {
SPRING_COPY_METHOD.invoke(null, t, e, null, ignoreProperties);
return e;
} catch (Exception ex) {
throw new RuntimeException(ex);
}
});
}
public <E> Set<E> mapSet(Function<T, E> function) {
Set<E> set = new LinkedHashSet<>(estimateSize());
for (T t : this) {
E e = function.apply(t);
if (e != null) {
set.add(e);
}
}
return set;
}
public <E> List<E> flatMapList(Function<T, Iterable<E>> function) {
List<E> list = new ArrayList<>(estimateSize() * 8);
for (T t : this) {
Iterable<E> ie = function.apply(t);
if (ie != null) {
for (E e : ie) {
if (e != null) {
list.add(e);
}
}
}
}
return list;
}
public <E> List<E> flatMapList(int groupSize, Function<Table<T>, Iterable<E>> function) {
if (groupSize < 1) {
throw new IllegalArgumentException();
}
List<E> list = new ArrayList<>(estimateSize() * 8);
List<T> group = new ArrayList<>(groupSize);
for (T t : this) {
group.add(t);
if (group.size() >= groupSize) {
Iterable<E> ie = function.apply(of(group));
group.clear();
for (E e : of(ie)) {
list.add(e);
}
}
}
if (!group.isEmpty()) {
Iterable<E> ie = function.apply(of(group));
group.clear();
for (E e : of(ie)) {
list.add(e);
}
}
return list;
}
public <E> Set<E> flatMapSet(Function<T, Iterable<E>> function) {
Set<E> set = new LinkedHashSet<>(estimateSize() * 8);
for (T t : this) {
Iterable<E> ie = function.apply(t);
if (ie != null) {
for (E e : ie) {
if (e != null) {
set.add(e);
}
}
}
}
return set;
}
/**
* 将元素(过滤掉空+trim后)拼接成一个字符串
*
* @param estimateLength 预估的总拼接长度
* @param open
* @param delimiters
* @param close
* @param function
* @return
*/
public String join(int estimateLength, String open, String delimiters, String close, Function<T, CharSequence> function) {
if (estimateLength <= 0) {
estimateLength = 128;
}
StringBuilder sb = new StringBuilder(estimateLength);
if (open != null) {
sb.append(open);
}
boolean firstAppendHasSuccess = false;
for (T t : this) {
CharSequence cs = function.apply(t);
boolean success = appendTextWithTrim(sb, cs, delimiters, firstAppendHasSuccess);
if (success) {
firstAppendHasSuccess = true;
}
}
if (close != null) {
sb.append(close);
}
return sb.toString();
}
public String join(String open, String delimiters, String close, Function<T, CharSequence> function) {
return join(128, open, delimiters, close, function);
}
public String join(String delimiters, Function<T, CharSequence> function) {
return join(128, null, delimiters, null, function);
}
public String join(String open, String delimiters, String close) {
return join(128, open, delimiters, close, Objects::toString);
}
public String join(String delimiters) {
return join(128, null, delimiters, null, Objects::toString);
}
public <E> Map<E, Table<T>> groupBy(boolean removeNullKey, Function<T, E> function) {
Map<E, List<T>> map = new LinkedHashMap<>(estimateSize() * 2);
for (T t : this) {
E e = function.apply(t);
if (e == null && removeNullKey) {
continue;
}
List<T> list = map.get(e);
if (list == null) {
list = new ArrayList<>();
map.put(e, list);
}
list.add(t);
}
Map<E, Table<T>> group = new LinkedHashMap<>(map.size() * 2);
for (Map.Entry<E, List<T>> entry : map.entrySet()) {
List<T> value = entry.getValue();
group.put(entry.getKey(), of(value));
}
return group;
}
public <E> Map<E, List<T>> groupByAsList(boolean removeNullKey, Function<T, E> function) {
Map<E, List<T>> map = new LinkedHashMap<>(estimateSize() * 2);
for (T t : this) {
E e = function.apply(t);
if (e == null && removeNullKey) {
continue;
}
List<T> list = map.get(e);
if (list == null) {
list = new ArrayList<>();
map.put(e, list);
}
list.add(t);
}
return map;
}
/**
* 将元素转换成map
* @param removeNullKey 移除null的key值
* @param removeNullValue 移除null的value值
* @param keyFunction
* @param valueFunction
* @param <K>
* @param <V>
* @return
*/
public <K, V> Map<K, V> map(
boolean removeNullKey, boolean removeNullValue,
Function<T, K> keyFunction, Function<T, V> valueFunction) {
Map<K, V> map = new LinkedHashMap<>(estimateSize() * 2);
for (T t : this) {
K key = keyFunction.apply(t);
V value = valueFunction.apply(t);
if (removeNullKey && key == null) {
continue;
}
if (removeNullValue && value == null) {
continue;
}
map.put(key, value);
}
return map;
}
public <K, V> Map<K, V> map(Function<T, K> keyFunction, Function<T, V> valueFunction) {
return map(true, true, keyFunction, valueFunction);
}
public <K> Map<K, T> mapKey(Function<T, K> keyFunction) {
return map(true, true, keyFunction, Function.identity());
}
public <V> Map<T, V> mapValue(Function<T, V> valueFunction) {
return map(true, true, Function.identity(), valueFunction);
}
public Table<T> orderBy(Comparator<T> comparator) {
if (comparator == null) {
throw new IllegalArgumentException();
}
List<T> list = list();
list.sort(comparator);
return of(list);
}
public Table<T> orderByDesc(Comparator<T> comparator) {
if (comparator == null) {
throw new IllegalArgumentException();
}
List<T> list = list();
list.sort(comparator.reversed());
return of(list);
}
/**
* 根据Long值排序
* @param nullAs 对于null值当做何值处理, 如果传入null, 则过滤null值的元素
* @param function
* @return
*/
public Table<T> orderByLong(Long nullAs, Function<T, Long> function) {
List<LongNode<T>> list = mapList(t -> {
Long value = function.apply(t);
if (value == null && nullAs == null) {
return null;
}
if (value == null) {
value = nullAs;
}
return new LongNode<>(t, value);
});
list.sort(Comparator.comparingLong(t -> t.value));
return Table.of(list).map(t -> t.data);
}
/**
* 根据Long值排序
* @param nullAs 对于null值当做何值处理, 如果传入null, 则过滤null值的元素
* @param function
* @return
*/
public Table<T> orderByLongDesc(Long nullAs, Function<T, Long> function) {
List<LongNode<T>> list = mapList(t -> {
Long value = function.apply(t);
if (value == null && nullAs == null) {
return null;
}
if (value == null) {
value = nullAs;
}
return new LongNode<>(t, value);
});
list.sort((c1, c2) -> - Long.compare(c1.value, c2.value));
return Table.of(list).map(t -> t.data);
}
public Table<T> orderByDate(Long nullAs, Function<T, Date> function) {
return orderByLong(nullAs, t -> {
Date date = function.apply(t);
return date == null ? null : date.getTime();
});
}
public Table<T> orderByDateDesc(Long nullAs, Function<T, Date> function) {
return orderByLongDesc(nullAs, t -> {
Date date = function.apply(t);
return date == null ? null : date.getTime();
});
}
/**
* 根据Int值排序
* @param nullAs 对于null值当做何值处理, 如果传入null, 则过滤null值的元素
* @param function
* @return
*/
public Table<T> orderByInt(Integer nullAs, Function<T, Integer> function) {
List<IntNode<T>> list = mapList(t -> {
Integer value = function.apply(t);
if (value == null && nullAs == null) {
return null;
}
if (value == null) {
value = nullAs;
}
return new IntNode<>(t, value);
});
list.sort(Comparator.comparingInt(c -> c.value));
return Table.of(list).map(t -> t.data);
}
/**
* 根据Int值排序
* @param nullAs 对于null值当做何值处理, 如果传入null, 则过滤null值的元素
* @param function
* @return
*/
public Table<T> orderByIntDesc(Integer nullAs, Function<T, Integer> function) {
List<IntNode<T>> list = mapList(t -> {
Integer value = function.apply(t);
if (value == null && nullAs == null) {
return null;
}
if (value == null) {
value = nullAs;
}
return new IntNode<>(t, value);
});
list.sort((c1, c2) -> - Integer.compare(c1.value, c2.value));
return Table.of(list).map(t -> t.data);
}
/**
* 根据Double值排序
* @param nullAs 对于null值当做何值处理, 如果传入null, 则过滤null值的元素
* @param function
* @return
*/
public Table<T> orderByDouble(Double nullAs, Function<T, Double> function) {
List<DoubleNode<T>> list = mapList(t -> {
Double value = function.apply(t);
if (value == null && nullAs == null) {
return null;
}
if (value == null) {
value = nullAs;
}
return new DoubleNode<>(t, value);
});
list.sort(Comparator.comparingDouble(c -> c.value));
return Table.of(list).map(t -> t.data);
}
/**
* 根据Double值排序
* @param nullAs 对于null值当做何值处理, 如果传入null, 则过滤null值的元素
* @param function
* @return
*/
public Table<T> orderByDoubleDesc(Double nullAs, Function<T, Double> function) {
List<DoubleNode<T>> list = mapList(t -> {
Double value = function.apply(t);
if (value == null && nullAs == null) {
return null;
}
if (value == null) {
value = nullAs;
}
return new DoubleNode<>(t, value);
});
list.sort((c1, c2) -> - Double.compare(c1.value, c2.value));
return Table.of(list).map(t -> t.data);
}
public Table<T> orderByString(String nullAs, final Locale locale, Function<T, String> function) {
List<StringNode<T>> list = mapList(t -> {
String value = function.apply(t);
if (value == null && nullAs == null) {
return null;
}
if (value == null) {
value = nullAs;
}
return new StringNode<>(t, value);
});
list.sort((c1, c2) -> {
final Collator instance = Collator.getInstance(
locale == null ? Locale.getDefault() : locale);
return instance.compare(c1.value, c2.value);
});
return Table.of(list).map(t -> t.data);
}
public Table<T> orderByStringDesc(String nullAs, final Locale locale, Function<T, String> function) {
List<StringNode<T>> list = mapList(t -> {
String value = function.apply(t);
if (value == null && nullAs == null) {
return null;
}
if (value == null) {
value = nullAs;
}
return new StringNode<>(t, value);
});
list.sort((c1, c2) -> {
final Collator instance = Collator.getInstance(
locale == null ? Locale.getDefault() : locale);
return - instance.compare(c1.value, c2.value);
});
return Table.of(list).map(t -> t.data);
}
/**
* 只返回非null元素的迭代器(过滤掉所有null元素)
*
* @param <T>
*/
private static final class NonNullIterator<T> implements Iterator<T> {
private final Iterator<T> iterator;
private T nextNonNullElement;
public NonNullIterator(Iterator<T> iterator) {
this.iterator = iterator;
this.nextNonNullElement = null;
}
@Override
public boolean hasNext() {
if (this.nextNonNullElement != null) {
return true;
}
while (iterator.hasNext()) {
T next = iterator.next();
if (next != null) {
this.nextNonNullElement = next;
return true;
}
}
return false;
}
@Override
public T next() {
if (this.nextNonNullElement != null) {
T next = this.nextNonNullElement;
this.nextNonNullElement = null;
return next;
}
throw new IllegalStateException("call after hasNext return true");
}
@Override
public void remove() {
throw new UnsupportedOperationException("table is immutable");
}
}
private static final class LongNode<T> {
final T data;
final long value;
public LongNode(T data, long value) {
this.data = data;
this.value = value;
}
}
private static final class IntNode<T> {
final T data;
final int value;
public IntNode(T data, int value) {
this.data = data;
this.value = value;
}
}
private static final class DoubleNode<T> {
final T data;
final double value;
public DoubleNode(T data, double value) {
this.data = data;
this.value = value;
}
}
private static final class StringNode<T> {
final T data;
final String value;
public StringNode(T data, String value) {
this.data = data;
this.value = value;
}
}
private static <T> void ofClass(List<T> data, Class<T> clazz, Object element, Set<Object> visitedElements) {
if (element == null || visitedElements.contains(element)) {
return;
}
visitedElements.add(element);
if (clazz.isAssignableFrom(element.getClass())) {
data.add((T) element);
}
if (element instanceof Iterable) {
for (Object e : ((Iterable) element)) {
ofClass(data, clazz, e, visitedElements);
}
}
}
private boolean appendTextWithTrim(StringBuilder sb, CharSequence cs, String delimiters, boolean firstAppendHasSuccess) {
if (cs == null) {
return false;
}
int length = cs.length();
if (length == 0) {
return false;
}
int first = -1;
for (int i = 0; i < length; i++) {
if (!Character.isWhitespace(cs.charAt(i))) {
first = i;
break;
}
}
// 全是whitespace
if (first == -1) {
return false;
}
int last = length - 1;
for (int i = last; i >= 0; i--) {
if (!Character.isWhitespace(cs.charAt(i))) {
last = i;
break;
}
}
if (firstAppendHasSuccess && delimiters != null) {
sb.append(delimiters);
}
sb.append(cs, first, last + 1);
return true;
}
private int estimateSize() {
if (data instanceof Collection) {
return ((Collection<T>) data).size();
}
return 16;
}
private Table(Iterable<T> data) {
if (data == null) {
this.data = (Table<T>) EMPTY_TABLE;
} else {
this.data = data;
}
}
}
| 27.562956 | 161 | 0.491013 |
bc81cc8b84256d34bfd0bc51c97b7af18b65ef2e
| 1,682 |
package com.technology.oracle.scheduler.schedule.client.ui.form.detail;
import static com.technology.oracle.scheduler.schedule.client.ScheduleClientConstant.scheduleText;
import static com.technology.oracle.scheduler.schedule.shared.field.ScheduleFieldNames.SCHEDULE_ID;
import static com.technology.oracle.scheduler.schedule.shared.field.ScheduleFieldNames.SCHEDULE_NAME;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.technology.jep.jepria.client.ui.form.detail.DetailFormViewImpl;
import com.technology.jep.jepria.client.widget.field.FieldManager;
import com.technology.jep.jepria.client.widget.field.multistate.JepNumberField;
import com.technology.jep.jepria.client.widget.field.multistate.JepTextField;
public class ScheduleDetailFormViewImpl extends DetailFormViewImpl {
public ScheduleDetailFormViewImpl() {
super(new FieldManager());
ScrollPanel scrollPanel = new ScrollPanel();
scrollPanel.setSize("100%", "100%");
VerticalPanel panel = new VerticalPanel();
panel.getElement().getStyle().setMarginTop(5, Unit.PX);
scrollPanel.add(panel);
JepNumberField scheduleIdNumberField = new JepNumberField(scheduleText.schedule_detail_schedule_id());
JepTextField scheduleNameTextField = new JepTextField(scheduleText.schedule_detail_schedule_name());
panel.add(scheduleIdNumberField);
panel.add(scheduleNameTextField);
setWidget(scrollPanel);
fields.put(SCHEDULE_ID, scheduleIdNumberField);
fields.put(SCHEDULE_NAME, scheduleNameTextField);
}
}
| 43.128205 | 107 | 0.781807 |
ddbd72a58ac9db8a984bf577b0bf3d41d7ce0ccb
| 1,970 |
/**
* Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.financial.analytics.model.irfutureoption;
import java.util.Collections;
import java.util.Set;
import com.opengamma.analytics.financial.interestrate.InstrumentDerivative;
import com.opengamma.analytics.financial.interestrate.PresentValueBlackVegaCalculator;
import com.opengamma.analytics.financial.model.option.definition.YieldCurveWithBlackCubeBundle;
import com.opengamma.core.position.Position;
import com.opengamma.engine.value.ComputedValue;
import com.opengamma.engine.value.ValueRequirement;
import com.opengamma.engine.value.ValueRequirementNames;
import com.opengamma.engine.value.ValueSpecification;
import com.opengamma.financial.analytics.model.black.BlackDiscountingPositionVegaIRFutureOptionFunction;
/**
* Function computes the {@link ValueRequirementNames#POSITION_VEGA}, first order derivative of {@link Position} price with respect to the Black Lognormal Implied Volatility,
* for interest rate future options in the Black world. <p>
* @deprecated Use {@link BlackDiscountingPositionVegaIRFutureOptionFunction}
*/
@Deprecated
public class InterestRateFutureOptionBlackPositionVegaFunction extends InterestRateFutureOptionBlackFunction {
/** The calculator to compute the vega value */
private static final PresentValueBlackVegaCalculator CALCULATOR = PresentValueBlackVegaCalculator.getInstance();
public InterestRateFutureOptionBlackPositionVegaFunction() {
super(ValueRequirementNames.POSITION_VEGA);
}
@Override
protected Set<ComputedValue> getResult(final InstrumentDerivative irFutureOption, final YieldCurveWithBlackCubeBundle curveBundle, final ValueSpecification spec, final Set<ValueRequirement> desiredValues) {
final double vega = irFutureOption.accept(CALCULATOR, curveBundle);
return Collections.singleton(new ComputedValue(spec, vega));
}
}
| 45.813953 | 208 | 0.83198 |
432099e8bd74a63c312a0f32b1f553d5926a9113
| 507 |
package com.clevertap.android.sdk.inapp;
import android.content.Context;
import android.os.Bundle;
import java.util.HashMap;
public interface InAppListener {
void inAppNotificationDidClick(CTInAppNotification inAppNotification, Bundle formData,
HashMap<String, String> keyValueMap);
void inAppNotificationDidDismiss(Context context, CTInAppNotification inAppNotification, Bundle formData);
void inAppNotificationDidShow(CTInAppNotification inAppNotification, Bundle formData);
}
| 33.8 | 110 | 0.814596 |
d2b4eaf5b7195a57df8535c0ff51140eaca73bb8
| 929 |
package org.globsframework.gui.splits.painters;
import org.globsframework.gui.splits.color.ColorService;
import org.globsframework.gui.splits.color.ColorChangeListener;
import org.globsframework.gui.splits.color.ColorLocator;
import java.awt.*;
public class FillPainter implements Painter, ColorChangeListener {
private Object colorKey;
private ColorService colorService;
private Color fillColor;
public FillPainter(Object colorKey, ColorService colorService) {
this.colorKey = colorKey;
this.colorService = colorService;
colorService.addListener(this);
}
public void colorsChanged(ColorLocator colorLocator) {
fillColor = colorLocator.get(colorKey);
}
public void paint(Graphics g, int width, int height) {
g.setColor(fillColor);
g.fillRect(0, 0, width, height);
}
protected void finalize() throws Throwable {
super.finalize();
colorService.removeListener(this);
}
}
| 27.323529 | 66 | 0.76211 |
b684bdea036f16cdab488ab93226b48b5ca37df7
| 371 |
package me.geek.tom.twitchlink.api.event;
import net.blay09.javatmi.GiftPaidUpgradeInfo;
import net.blay09.javatmi.TwitchUser;
public class GiftPaidUpdateEvent extends TwitchEvent<GiftPaidUpgradeInfo> {
public GiftPaidUpdateEvent(String channel, TwitchUser user, GiftPaidUpgradeInfo giftPaidUpgradeInfo) {
super(channel, user, giftPaidUpgradeInfo);
}
}
| 33.727273 | 106 | 0.80593 |
cb816477b4782671f20ca0f555c78e02c090c5c7
| 1,272 |
package com.zaloni.bedrock.sdar.hook;
import com.zaloni.bedrock.sdar.dto.DataAccessRequestInfo;
import com.zaloni.bedrock.sdar.dto.DataAccessRequestPostApprovalResponse;
import com.zaloni.bedrock.sdar.dto.PluginConfig;
/**
* This is a hook interface that can runs after the Approval System Approves or Rejects a request and sends the response back to Arena.
* Users are free to send any JSON response and the responsibility of handling the response lies with the implementation that the user writes.
* see ServiceNowPostApprovalHook for a sample ServiceNow implementation
*/
public interface DataAccessRequestPostApprovalHook {
/**
* This method is called by Arena with the dataAccessRequestInfo and postApprovalJson.
* See sample ServiceNow implementation ServiceNowPostApprovalHook for more information
*
* @param dataAccessRequestInfo Request information from Arena
* @param pluginConfig Configurations set in Arena for any Post Approval System (if any)
* @param postApprovalJson Response sent to Arena from the Approval System after the approval is done
* @return
*/
DataAccessRequestPostApprovalResponse execute(DataAccessRequestInfo dataAccessRequestInfo, PluginConfig pluginConfig, String postApprovalJson);
}
| 50.88 | 147 | 0.798742 |
9366bf829e163f5df87cc90000be9d25053034ae
| 696 |
package io.github.kavahub.learnjava.math;
import lombok.experimental.UtilityClass;
/**
* 两点之间的距离
*
* @author PinWei Wan
* @since 1.0.0
*/
@UtilityClass
public class DistanceBetweenPoints {
public double calculateDistanceBetweenPoints(
double x1,
double y1,
double x2,
double y2) {
return Math.sqrt((y2 - y1) * (y2 - y1) + (x2 - x1) * (x2 - x1));
}
public double calculateDistanceBetweenPointsWithHypot(
double x1,
double y1,
double x2,
double y2) {
double ac = Math.abs(y2 - y1);
double cb = Math.abs(x2 - x1);
return Math.hypot(ac, cb);
}
}
| 20.470588 | 72 | 0.558908 |
2af9ee8fe1d6a374f7c40c7abeef7f0894b7ac8e
| 241 |
package com.ebay.dss.zds.model;
public enum EbayRealm {
CORP("CORP.EBAY.COM"),
APD("APD.EBAY.COM"),
PROD("PROD.EBAY.COM"),
;
public final String value;
EbayRealm(String value) {
this.value = value;
}
}
| 16.066667 | 31 | 0.593361 |
52b13b28758c6577c1f9b8772795035f9af33834
| 1,476 |
/*
* Licensed to the Technische Universität Darmstadt under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The Technische Universität Darmstadt
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.tudarmstadt.ukp.clarin.webanno.support.wicket;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.link.ExternalLink;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.request.resource.ResourceReference;
public class ImageLink
extends Panel
{
private static final long serialVersionUID = 1384767661278796054L;
public ImageLink(String aId, ResourceReference aImageRes, IModel<String> aUrl)
{
super(aId, aUrl);
ExternalLink link = new ExternalLink("link", aUrl);
link.add(new Image("image", aImageRes));
add(link);
}
}
| 37.846154 | 82 | 0.753388 |
81270ca4134fb05b5c432946444e73bce9b188cc
| 6,334 |
/*
* Copyright 2019 GridGain Systems, Inc. and Contributors.
*
* Licensed under the GridGain Community Edition License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gridgain.com/products/software/community-edition/gridgain-community-edition-license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ignite.spi.discovery;
import java.util.Arrays;
import org.apache.ignite.cluster.ClusterNode;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.internal.managers.discovery.CustomEventListener;
import org.apache.ignite.internal.managers.discovery.DiscoCache;
import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
import org.apache.ignite.internal.managers.discovery.DiscoveryServerOnlyCustomMessage;
import org.apache.ignite.internal.managers.discovery.GridDiscoveryManager;
import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
import org.apache.ignite.lang.IgniteUuid;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.jetbrains.annotations.Nullable;
import org.junit.Test;
/**
*
*/
public class FilterDataForClientNodeDiscoveryTest extends GridCommonAbstractTest {
/** Join servers count. */
private int joinSrvCnt;
/** Join clients count. */
private int joinCliCnt;
/** {@inheritDoc} */
@Override protected void afterTest() throws Exception {
stopAllGrids();
super.afterTest();
}
/**
* @throws Exception If failed.
*/
@Test
public void testDataBag() throws Exception {
startGrid(configuration(0, false));
startGrid(configuration(1, false));
assertEquals(3, joinSrvCnt);
assertEquals(0, joinCliCnt);
startGrid(configuration(2, true));
startGrid(configuration(3, true));
assertEquals(5, joinSrvCnt);
assertEquals(4, joinCliCnt);
}
/**
* @throws Exception If failed.
*/
@Test
public void testDiscoveryServerOnlyCustomMessage() throws Exception {
startGrid(configuration(0, false));
startGrid(configuration(1, false));
startGrid(configuration(2, true));
startGrid(configuration(3, true));
final boolean [] recvMsg = new boolean[4];
for (int i = 0; i < 4; ++i) {
final int idx0 = i;
grid(i).context().discovery().setCustomEventListener(
MessageForServer.class, new CustomEventListener<MessageForServer>() {
@Override public void onCustomEvent(AffinityTopologyVersion topVer, ClusterNode snd,
MessageForServer msg) {
recvMsg[idx0] = true;
}
});
}
for (int i = 0; i < 4; ++i) {
Arrays.fill(recvMsg, false);
grid(i).context().discovery().sendCustomEvent(new MessageForServer());
Thread.sleep(500);
assertEquals(true, recvMsg[0]);
assertEquals(true, recvMsg[1]);
assertEquals(false, recvMsg[2]);
assertEquals(false, recvMsg[3]);
}
}
/**
* @param nodeIdx Node index.
* @param client Client flag.
* @return Ignite configuration.
* @throws Exception On error.
*/
private IgniteConfiguration configuration(int nodeIdx, boolean client) throws Exception {
IgniteConfiguration cfg = getConfiguration(getTestIgniteInstanceName(nodeIdx));
TcpDiscoverySpi testSpi = new TestDiscoverySpi();
testSpi.setIpFinder(sharedStaticIpFinder);
cfg.setDiscoverySpi(testSpi);
cfg.setClientMode(client);
return cfg;
}
/**
*
*/
private class TestDiscoverySpi extends TcpDiscoverySpi {
/** Test exchange. */
private TestDiscoveryDataExchange testEx = new TestDiscoveryDataExchange();
/**
*
*/
public TestDiscoverySpi() {
exchange = testEx;
}
/** {@inheritDoc} */
@Override public void setDataExchange(DiscoverySpiDataExchange exchange) {
testEx.setExchange(exchange);
}
}
/**
*
*/
private class TestDiscoveryDataExchange implements DiscoverySpiDataExchange {
/** Real exchange. */
private DiscoverySpiDataExchange ex;
/** {@inheritDoc} */
@Override public DiscoveryDataBag collect(DiscoveryDataBag dataBag) {
if (dataBag.isJoiningNodeClient())
joinCliCnt++;
else
joinSrvCnt++;
return ex.collect(dataBag);
}
/** {@inheritDoc} */
@Override public void onExchange(DiscoveryDataBag dataBag) {
ex.onExchange(dataBag);
}
/**
* @param ex Exchange.
*/
public void setExchange(DiscoverySpiDataExchange ex) {
this.ex = ex;
}
}
/**
*
*/
private static class MessageForServer implements DiscoveryServerOnlyCustomMessage {
/** */
private static final long serialVersionUID = 0L;
/** */
private final IgniteUuid id = IgniteUuid.randomUuid();
/** {@inheritDoc} */
@Override public IgniteUuid id() {
return id;
}
/** {@inheritDoc} */
@Nullable @Override public DiscoveryCustomMessage ackMessage() {
return null;
}
/** {@inheritDoc} */
@Override public boolean isMutable() {
return false;
}
/** {@inheritDoc} */
@Override public boolean stopProcess() {
return false;
}
/** {@inheritDoc} */
@Override public DiscoCache createDiscoCache(GridDiscoveryManager mgr, AffinityTopologyVersion topVer,
DiscoCache discoCache) {
return null;
}
}
}
| 29.18894 | 110 | 0.630407 |
fd7710aef670fed90adbc99a32fb35bd5e202f41
| 375 |
package com.google.sps.servlets.data;
public final class FeedBack {
private final String name;
private final String helpful;
public FeedBack(String name, String helpful) {
this.name = name;
this.helpful = helpful;
}
public String getName() {
return name;
}
public String getHelpful() {
return helpful;
}
}
| 17.857143 | 50 | 0.621333 |
dae560e84aa8a0319bcb9dfff0e700dbdfe17f28
| 911 |
class Main {
public static int[] twoNumberSum(int[] array, int targetSum) {
for (int i = 0; i < array.length; i++) {
for (int j = i + 1; j < array.length; j++) {
if (array[i] + array[j] == targetSum) {
if (array[i] > array[j]) {
return new int[] { array[j], array[i] };
} else {
return new int[] { array[i], array[j] };
}
}
}
}
return new int[] {};
}
public static void main(String args[]) {
int[] array = new int[] { 3, 5, -4, 8, 11, 1, -1, 6 };
int targetSum = 10;
int[] pair = twoNumberSum(array, targetSum);
assert pair[0] == -1 : "Wrong Answer";
assert pair[1] == 11 : "Wrong Answer";
System.out.println("Correct!!");
}
}
| 31.413793 | 67 | 0.406147 |
24b4591d03940890ee87c2c7c7a6bcd362eb79ca
| 5,270 |
package dev.riyenas.osam.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import dev.riyenas.osam.domain.auth.CryptoType;
import dev.riyenas.osam.domain.auth.TimeBasedOTP;
import dev.riyenas.osam.domain.device.Device;
import dev.riyenas.osam.domain.device.DeviceRepository;
import dev.riyenas.osam.web.dto.app.QRCodeRequestDto;
import dev.riyenas.osam.web.dto.app.TOTPQRCodeDto;
import dev.riyenas.osam.web.dto.iot.TOTPValidRequestDto;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.tomcat.util.codec.binary.Base64;
import org.springframework.stereotype.Service;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Calendar;
@Log4j2
@Service
@RequiredArgsConstructor
public class TimeBasedOTPService {
private final DeviceRepository deviceRepository;
public String generateByCurrentTime(String seed) {
Calendar time = Calendar.getInstance();
String steps = TimeBasedOTP.calcSteps(time.getTimeInMillis() / 1000, 0L, 10L);
return TimeBasedOTP.generateTOTP(seed, steps, "8", CryptoType.HmacSHA512);
}
public String generateByCurrentTime(Long deviceId) {
Device device = deviceRepository.findById(deviceId).orElseThrow(() ->
new IllegalArgumentException("모바일 기기를 조회 할수 없습니다.")
);
Calendar time = Calendar.getInstance();
String steps = TimeBasedOTP.calcSteps(time.getTimeInMillis() / 1000, 0L, 10L);
return TimeBasedOTP.generateTOTP(device.getUuid(), steps, "8", CryptoType.HmacSHA512);
}
public String generateBySeedAndTimeInMills(String seed, Long timeInMillis) {
String steps = TimeBasedOTP.calcSteps(timeInMillis / 1000, 0L, 10L);
return TimeBasedOTP.generateTOTP(seed, steps, "8", CryptoType.HmacSHA512);
}
public Boolean isValidTimeBasedOtp(TOTPValidRequestDto dto) {
Device device = deviceRepository.findById(dto.getDeviceId()).orElseThrow(() ->
new IllegalArgumentException("모바일 기기를 조회 할수 없습니다.")
);
String steps = TimeBasedOTP.calcSteps(dto.getTimeInMillis() / 1000, 0L, 10L);
String resultTOTP = TimeBasedOTP.generateTOTP(device.getUuid(), steps, "8", CryptoType.HmacSHA512);
String expectedTOTP = dto.getExpectedTOTP();
return resultTOTP.equals(expectedTOTP);
}
public TOTPQRCodeDto genrateQRCode(Long deviceId) throws IOException, WriterException {
Device device = deviceRepository.findById(deviceId).orElseThrow(() ->
new IllegalArgumentException("모바일 기기를 조회 할수 없습니다.")
);
Long adminId = device.getSoldier().getAdmin().getId();
Calendar time = Calendar.getInstance();
String steps = TimeBasedOTP.calcSteps(time.getTimeInMillis() / 1000, 0L, 10L);
String totp = TimeBasedOTP.generateTOTP(device.getUuid(), steps, "8", CryptoType.HmacSHA512);
QRCodeRequestDto dto = QRCodeRequestDto.builder()
.deviceId(deviceId)
.adminId(adminId)
.TOTP(totp)
.build();
ObjectMapper mapper = new ObjectMapper();
String jsonStr = mapper.writeValueAsString(dto);
QRCodeWriter qrCodeWriter = new QRCodeWriter();
BitMatrix bitMatrix = qrCodeWriter.encode(jsonStr, BarcodeFormat.QR_CODE, 300, 300);
ByteArrayOutputStream pngOutputStream = new ByteArrayOutputStream();
MatrixToImageWriter.writeToStream(bitMatrix, "PNG", pngOutputStream);
String qrcodeString = "data:image/png;base64," + Base64.encodeBase64String(pngOutputStream.toByteArray());
return TOTPQRCodeDto.builder()
.adminId(adminId)
.deviceId(deviceId)
.qrcode(qrcodeString)
.totp(totp)
.build();
}
public byte[] transferQRCode(Long deviceId) throws IOException, WriterException {
Device device = deviceRepository.findById(deviceId).orElseThrow(() ->
new IllegalArgumentException("모바일 기기를 조회 할수 없습니다.")
);
Long adminId = device.getSoldier().getAdmin().getId();
Calendar time = Calendar.getInstance();
String steps = TimeBasedOTP.calcSteps(time.getTimeInMillis() / 1000, 0L, 10L);
String totp = TimeBasedOTP.generateTOTP(device.getUuid(), steps, "8", CryptoType.HmacSHA512);
QRCodeRequestDto dto = QRCodeRequestDto.builder()
.deviceId(deviceId)
.adminId(adminId)
.TOTP(totp)
.build();
ObjectMapper mapper = new ObjectMapper();
String jsonStr = mapper.writeValueAsString(dto);
QRCodeWriter qrCodeWriter = new QRCodeWriter();
BitMatrix bitMatrix = qrCodeWriter.encode(jsonStr, BarcodeFormat.QR_CODE, 300, 300);
ByteArrayOutputStream pngOutputStream = new ByteArrayOutputStream();
MatrixToImageWriter.writeToStream(bitMatrix, "PNG", pngOutputStream);
return pngOutputStream.toByteArray();
}
}
| 37.112676 | 114 | 0.694118 |
e2d9b9ae487a85d2a4dc5dd9f3610864bc126c08
| 506 |
package com.github.shiraji.hidetoolwindowsex.action;
import com.github.shiraji.hidetoolwindowsex.config.HideToolWindowsExConfig;
public class HideRightToolWindowsToggleAction extends HideToolWindowsExToggleAction {
@Override
protected boolean isHideToolWindows(HideToolWindowsExConfig config) {
return config.isHideRightToolWindow();
}
@Override
protected void setHideToolWindows(HideToolWindowsExConfig config, boolean b) {
config.setHideRightToolWindow(b);
}
}
| 31.625 | 85 | 0.79249 |
417e72e40362b97d24139d44783e6cf4bd6b5d78
| 441 |
package com.ngdesk.repositories.modules;
import java.util.List;
import org.springframework.data.domain.Pageable;
import com.ngdesk.graphql.modules.dao.Module;
public interface CustomModulesRepository {
public List<Module> findAllModules(String collectionName);
public List<Module> findAllModulesWithPagination(Pageable pageable, String collectionName);
public Module findModuleWithName(String moduleName, String collectionName);
}
| 25.941176 | 92 | 0.8322 |
1a38f91bff1e1d362ada3f9a1ff14c81a008efc5
| 8,334 |
package cn.hutool.core.lang;
import java.io.File;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.net.URL;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.EnumerationIter;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IORuntimeException;
import cn.hutool.core.io.resource.ResourceUtil;
import cn.hutool.core.util.CharUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.ClassUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
/**
* 类扫描器
*
* @author looly
* @since 4.1.5
*
*/
public class ClassScaner {
/** 包名 */
private String packageName;
/** 包名,最后跟一个点,表示包名,避免在检查前缀时的歧义 */
private String packageNameWithDot;
/** 包路径,用于文件中对路径操作 */
private String packageDirName;
/** 包路径,用于jar中对路径操作,在Linux下与packageDirName一致 */
private String packagePath;
/** 过滤器 */
private Filter<Class<?>> classFilter;
/** 编码 */
private Charset charset;
/** 是否初始化类 */
private boolean initialize;
private Set<Class<?>> classes = new HashSet<Class<?>>();
/**
* 扫描指定包路径下所有包含指定注解的类
*
* @param packageName 包路径
* @param annotationClass 注解类
* @return 类集合
*/
public static Set<Class<?>> scanPackageByAnnotation(String packageName, final Class<? extends Annotation> annotationClass) {
return scanPackage(packageName, new Filter<Class<?>>() {
@Override
public boolean accept(Class<?> clazz) {
return clazz.isAnnotationPresent(annotationClass);
}
});
}
/**
* 扫描指定包路径下所有指定类或接口的子类或实现类
*
* @param packageName 包路径
* @param superClass 父类或接口
* @return 类集合
*/
public static Set<Class<?>> scanPackageBySuper(String packageName, final Class<?> superClass) {
return scanPackage(packageName, new Filter<Class<?>>() {
@Override
public boolean accept(Class<?> clazz) {
return superClass.isAssignableFrom(clazz) && !superClass.equals(clazz);
}
});
}
/**
* 扫面该包路径下所有class文件
*
* @return 类集合
*/
public static Set<Class<?>> scanPackage() {
return scanPackage(StrUtil.EMPTY, null);
}
/**
* 扫面该包路径下所有class文件
*
* @param packageName 包路径 com | com. | com.abs | com.abs.
* @return 类集合
*/
public static Set<Class<?>> scanPackage(String packageName) {
return scanPackage(packageName, null);
}
/**
* 扫面包路径下满足class过滤器条件的所有class文件,<br>
* 如果包路径为 com.abs + A.class 但是输入 abs会产生classNotFoundException<br>
* 因为className 应该为 com.abs.A 现在却成为abs.A,此工具类对该异常进行忽略处理<br>
*
* @param packageName 包路径 com | com. | com.abs | com.abs.
* @param classFilter class过滤器,过滤掉不需要的class
* @return 类集合
*/
public static Set<Class<?>> scanPackage(String packageName, Filter<Class<?>> classFilter) {
return new ClassScaner(packageName, classFilter).scan();
}
/**
* 构造,默认UTF-8编码
*/
public ClassScaner() {
this(null);
}
/**
* 构造,默认UTF-8编码
*
* @param packageName 包名,所有包传入""或者null
*/
public ClassScaner(String packageName) {
this(packageName, null);
}
/**
* 构造,默认UTF-8编码
*
* @param packageName 包名,所有包传入""或者null
* @param classFilter 过滤器,无需传入null
*/
public ClassScaner(String packageName, Filter<Class<?>> classFilter) {
this(packageName, classFilter, CharsetUtil.CHARSET_UTF_8);
}
/**
* 构造
*
* @param packageName 包名,所有包传入""或者null
* @param classFilter 过滤器,无需传入null
* @param charset 编码
*/
public ClassScaner(String packageName, Filter<Class<?>> classFilter, Charset charset) {
packageName = StrUtil.nullToEmpty(packageName);
this.packageName = packageName;
this.packageNameWithDot = StrUtil.addSuffixIfNot(packageName, StrUtil.DOT);
this.packageDirName = packageName.replace(CharUtil.DOT, File.separatorChar);
this.packagePath = packageName.replace(CharUtil.DOT, CharUtil.SLASH);
this.classFilter = classFilter;
this.charset = charset;
}
/**
* 扫面包路径下满足class过滤器条件的所有class文件
*
* @return 类集合
*/
public Set<Class<?>> scan() {
for (URL url : ResourceUtil.getResourceIter(this.packagePath)) {
switch (url.getProtocol()) {
case "file":
scanFile(new File(URLUtil.decode(url.getFile(), this.charset.name())), null);
break;
case "jar":
scanJar(URLUtil.getJarFile(url));
break;
}
}
if(CollUtil.isEmpty(this.classes)) {
scanJavaClassPaths();
}
return Collections.unmodifiableSet(this.classes);
}
/**
* 设置是否在扫描到类时初始化类
*
* @param initialize 是否初始化类
*/
public void setInitialize(boolean initialize) {
this.initialize = initialize;
}
// --------------------------------------------------------------------------------------------------- Private method start
/**
* 扫描Java指定的ClassPath路径
*
* @return 扫描到的类
*/
private void scanJavaClassPaths() {
final String[] javaClassPaths = ClassUtil.getJavaClassPaths();
for (String classPath : javaClassPaths) {
// bug修复,由于路径中空格和中文导致的Jar找不到
classPath = URLUtil.decode(classPath, CharsetUtil.systemCharsetName());
scanFile(new File(classPath), null);
}
}
/**
* 扫描文件或目录中的类
*
* @param file 文件或目录
* @param rootDir 包名对应classpath绝对路径
*/
private void scanFile(File file, String rootDir) {
if (file.isFile()) {
final String fileName = file.getAbsolutePath();
if (fileName.endsWith(FileUtil.CLASS_EXT)) {
final String className = fileName//
// 8为classes长度,fileName.length() - 6为".class"的长度
.substring(rootDir.length(), fileName.length() - 6)//
.replace(File.separatorChar, CharUtil.DOT);//
//加入满足条件的类
addIfAccept(className);
} else if (fileName.endsWith(FileUtil.JAR_FILE_EXT)) {
try {
scanJar(new JarFile(file));
} catch (IOException e) {
throw new IORuntimeException(e);
}
}
} else if (file.isDirectory()) {
for (File subFile : file.listFiles()) {
scanFile(subFile, (null == rootDir) ? subPathBeforePackage(file) : rootDir);
}
}
}
/**
* 扫描jar包
*
* @param jar jar包
*/
private void scanJar(JarFile jar) {
String name;
for (JarEntry entry : new EnumerationIter<>(jar.entries())) {
name = StrUtil.removePrefix(entry.getName(), StrUtil.SLASH);
if (name.startsWith(this.packagePath)) {
if (name.endsWith(FileUtil.CLASS_EXT) && false == entry.isDirectory()) {
final String className = name//
.substring(0, name.length() - 6)//
.replace(CharUtil.SLASH, CharUtil.DOT);//
addIfAccept(loadClass(className));
}
}
}
}
/**
* 加载类
*
* @param className 类名
* @return 加载的类
*/
private Class<?> loadClass(String className) {
Class<?> clazz = null;
try {
clazz = Class.forName(className, this.initialize, ClassUtil.getClassLoader());
} catch (NoClassDefFoundError e) {
// 由于依赖库导致的类无法加载,直接跳过此类
} catch (UnsupportedClassVersionError e) {
// 版本导致的不兼容的类,跳过
} catch (Exception e) {
throw new RuntimeException(e);
// Console.error(e);
}
return clazz;
}
/**
* 通过过滤器,是否满足接受此类的条件
*
* @param clazz 类
* @return 是否接受
*/
private void addIfAccept(String className) {
if(StrUtil.isBlank(className)) {
return;
}
int classLen = className.length();
int packageLen = this.packageName.length();
if(classLen == packageLen) {
//类名和包名长度一致,用户可能传入的包名是类名
if(className.equals(this.packageName)) {
addIfAccept(loadClass(className));
}
} else if(classLen > packageLen){
//检查类名是否以指定包名为前缀,包名后加.(避免类似于cn.hutool.A和cn.hutool.ATest这类类名引起的歧义)
if(className.startsWith(this.packageNameWithDot)) {
addIfAccept(loadClass(className));
}
}
}
/**
* 通过过滤器,是否满足接受此类的条件
*
* @param clazz 类
* @return 是否接受
*/
private void addIfAccept(Class<?> clazz) {
if (null != clazz) {
Filter<Class<?>> classFilter = this.classFilter;
if (classFilter == null || classFilter.accept(clazz)) {
this.classes.add(clazz);
}
}
}
/**
* 截取文件绝对路径中包名之前的部分
*
* @param file 文件
* @return 包名之前的部分
*/
private String subPathBeforePackage(File file) {
String filePath = file.getAbsolutePath();
if (StrUtil.isNotEmpty(this.packageDirName)) {
filePath = StrUtil.subBefore(filePath, this.packageDirName, true);
}
return StrUtil.addSuffixIfNot(filePath, File.separator);
}
// --------------------------------------------------------------------------------------------------- Private method end
}
| 25.027027 | 125 | 0.666667 |
d97df054c7ee53bdd4f11a6e60d49e3c41c78c6f
| 1,341 |
package com.faforever.gw.bpmn.message.calculate_promotions;
import com.faforever.gw.bpmn.accessors.CalculatePromotionsAccessor;
import com.faforever.gw.messaging.client.ClientMessagingService;
import com.faforever.gw.messaging.client.outbound.CharacterPromotionMessage;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.stereotype.Component;
import javax.inject.Inject;
@Slf4j
@Component
public class CharacterPromotionNotification implements JavaDelegate {
private final ClientMessagingService clientMessagingService;
@Inject
public CharacterPromotionNotification(ClientMessagingService clientMessagingService) {
this.clientMessagingService = clientMessagingService;
}
@Override
public void execute(DelegateExecution execution) throws Exception {
CalculatePromotionsAccessor accessor = CalculatePromotionsAccessor.of(execution);
val characterId = accessor.getCharacter_Local();
val newRank = accessor.getNewRank_Local();
log.debug("Sending CharacterPromotionMessage (characterId: {}, newRank: {})", characterId, newRank);
clientMessagingService.sendToPublic(new CharacterPromotionMessage(characterId, newRank));
}
}
| 38.314286 | 108 | 0.803132 |
f988a4fa6fbe87406d32d8889c7ef9667cf32a69
| 394 |
package com.benleadbeater.database.hello.mySpringDatabaseBootApp.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.benleadbeater.database.hello.mySpringDatabaseBootApp.model.mySpringBootDataModel;
@Repository
public interface MySpringBootRepository extends JpaRepository<mySpringBootDataModel,Long> {
}
| 30.307692 | 92 | 0.870558 |
be6c235e8be39c8ec3e6f16c8907683013251520
| 1,260 |
package br.com.salon.carine.lima.converters;
import br.com.salon.carine.lima.dto.EnderecoDTO;
import br.com.salon.carine.lima.dto.UsuarioAlterarPerfilDTO;
import br.com.salon.carine.lima.dto.UsuarioDTO;
import br.com.salon.carine.lima.models.Endereco;
import br.com.salon.carine.lima.models.Usuario;
public class ConvertersUsuario {
public static Usuario deUsuarioDTOParaUsuario(UsuarioDTO usuarioDTO) {
Usuario usuario = new Usuario();
usuario.setEmail(usuarioDTO.getEmail());
Endereco endereco = ConvertersEndereco.deEnderecoDTOParaEndereco(usuarioDTO.getEndereco());
usuario.setEndereco(endereco);
usuario.setNome(usuarioDTO.getNome());
usuario.setSenha(usuarioDTO.getPassword().getSenha());
usuario.setSalt(usuarioDTO.getSalt());
return usuario;
}
public static UsuarioAlterarPerfilDTO deUsuarioParaUsuarioAlterarPerfilDTO(Usuario usuario) {
UsuarioAlterarPerfilDTO usuarioAlterarPerfilDTO = new UsuarioAlterarPerfilDTO();
usuarioAlterarPerfilDTO.setNome(usuario.getNome());
usuarioAlterarPerfilDTO.setEmail(usuario.getEmail());
EnderecoDTO enderecoDTO = ConvertersEndereco.deEnderecoParaEnderecoDTO(usuario.getEndereco());
usuarioAlterarPerfilDTO.setEndereco(enderecoDTO);
return usuarioAlterarPerfilDTO;
}
}
| 30.731707 | 96 | 0.811905 |
e064d648f679b00c6851b3d4904f33a2e0642283
| 11,969 |
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jkiss.dbeaver.ext.generic.model;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.generic.GenericConstants;
import org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaObject;
import org.jkiss.dbeaver.model.DBPEvaluationContext;
import org.jkiss.dbeaver.model.DBPRefreshableObject;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet;
import org.jkiss.dbeaver.model.exec.jdbc.JDBCSession;
import org.jkiss.dbeaver.model.impl.jdbc.JDBCConstants;
import org.jkiss.dbeaver.model.impl.struct.AbstractProcedure;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.DBPUniqueObject;
import org.jkiss.dbeaver.model.struct.DBSObject;
import org.jkiss.dbeaver.model.struct.rdb.DBSProcedureParameterKind;
import org.jkiss.dbeaver.model.struct.rdb.DBSProcedureType;
import org.jkiss.utils.CommonUtils;
import java.sql.DatabaseMetaData;
import java.sql.SQLException;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* GenericProcedure
*/
public class GenericProcedure extends AbstractProcedure<GenericDataSource, GenericStructContainer> implements GenericScriptObject, DBPUniqueObject, DBPRefreshableObject
{
private static final Pattern PATTERN_COL_NAME_NUMERIC = Pattern.compile("\\$?([0-9]+)");
private String specificName;
private DBSProcedureType procedureType;
private List<GenericProcedureParameter> columns;
private String source;
private GenericFunctionResultType functionResultType;
public GenericProcedure(
GenericStructContainer container,
String procedureName,
String specificName,
String description,
DBSProcedureType procedureType,
GenericFunctionResultType functionResultType)
{
super(container, true, procedureName, description);
this.procedureType = procedureType;
this.functionResultType = functionResultType;
this.specificName = specificName;
}
@Property(viewable = true, order = 3)
public GenericCatalog getCatalog()
{
return getContainer().getCatalog();
}
@Property(viewable = true, order = 4)
public GenericSchema getSchema()
{
return getContainer().getSchema();
}
@Property(viewable = true, order = 5)
public GenericPackage getPackage()
{
return getContainer() instanceof GenericPackage ? (GenericPackage) getContainer() : null;
}
@Override
@Property(viewable = true, order = 6)
public DBSProcedureType getProcedureType()
{
return procedureType;
}
@Property(viewable = true, order = 7)
public GenericFunctionResultType getFunctionResultType() {
return functionResultType;
}
@Override
public Collection<GenericProcedureParameter> getParameters(DBRProgressMonitor monitor)
throws DBException
{
if (columns == null) {
loadProcedureColumns(monitor);
}
return columns;
}
private void loadProcedureColumns(DBRProgressMonitor monitor) throws DBException
{
Collection<? extends GenericProcedure> procedures = getContainer().getProcedures(monitor, getName());
if (procedures == null || !procedures.contains(this)) {
throw new DBException("Internal error - cannot read columns for procedure '" + getName() + "' because its not found in container");
}
Iterator<? extends GenericProcedure> procIter = procedures.iterator();
GenericProcedure procedure = null;
final GenericMetaObject pcObject = getDataSource().getMetaObject(GenericConstants.OBJECT_PROCEDURE_COLUMN);
try (JDBCSession session = DBUtils.openMetaSession(monitor, this, "Load procedure columns")) {
final JDBCResultSet dbResult;
if (functionResultType == null) {
dbResult = session.getMetaData().getProcedureColumns(
getCatalog() == null ?
this.getPackage() == null || !this.getPackage().isNameFromCatalog() ?
null :
this.getPackage().getName() :
getCatalog().getName(),
getSchema() == null ? null : getSchema().getName(),
getName(),
getDataSource().getAllObjectsPattern()
);
} else {
dbResult = session.getMetaData().getFunctionColumns(
getCatalog() == null ? null : getCatalog().getName(),
getSchema() == null ? null : getSchema().getName(),
getName(),
getDataSource().getAllObjectsPattern()
);
}
try {
int previousPosition = -1;
while (dbResult.next()) {
String columnName = GenericUtils.safeGetString(pcObject, dbResult, JDBCConstants.COLUMN_NAME);
int columnTypeNum = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.COLUMN_TYPE);
int valueType = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.DATA_TYPE);
String typeName = GenericUtils.safeGetString(pcObject, dbResult, JDBCConstants.TYPE_NAME);
int columnSize = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.LENGTH);
boolean notNull = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.NULLABLE) == DatabaseMetaData.procedureNoNulls;
int scale = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.SCALE);
int precision = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.PRECISION);
//int radix = GenericUtils.safeGetInt(dbResult, JDBCConstants.RADIX);
String remarks = GenericUtils.safeGetString(pcObject, dbResult, JDBCConstants.REMARKS);
int position = GenericUtils.safeGetInt(pcObject, dbResult, JDBCConstants.ORDINAL_POSITION);
DBSProcedureParameterKind parameterType;
if (functionResultType == null) {
switch (columnTypeNum) {
case DatabaseMetaData.procedureColumnIn:
parameterType = DBSProcedureParameterKind.IN;
break;
case DatabaseMetaData.procedureColumnInOut:
parameterType = DBSProcedureParameterKind.INOUT;
break;
case DatabaseMetaData.procedureColumnOut:
parameterType = DBSProcedureParameterKind.OUT;
break;
case DatabaseMetaData.procedureColumnReturn:
parameterType = DBSProcedureParameterKind.RETURN;
break;
case DatabaseMetaData.procedureColumnResult:
parameterType = DBSProcedureParameterKind.RESULTSET;
break;
default:
parameterType = DBSProcedureParameterKind.UNKNOWN;
break;
}
} else {
switch (columnTypeNum) {
case DatabaseMetaData.functionColumnIn:
parameterType = DBSProcedureParameterKind.IN;
break;
case DatabaseMetaData.functionColumnInOut:
parameterType = DBSProcedureParameterKind.INOUT;
break;
case DatabaseMetaData.functionColumnOut:
parameterType = DBSProcedureParameterKind.OUT;
break;
case DatabaseMetaData.functionReturn:
parameterType = DBSProcedureParameterKind.RETURN;
break;
case DatabaseMetaData.functionColumnResult:
parameterType = DBSProcedureParameterKind.RESULTSET;
break;
default:
parameterType = DBSProcedureParameterKind.UNKNOWN;
break;
}
}
if (CommonUtils.isEmpty(columnName) && parameterType == DBSProcedureParameterKind.RETURN) {
columnName = "RETURN";
}
if (position == 0) {
// Some drivers do not return ordinal position (PostgreSQL) but
// position is contained in column name
Matcher numberMatcher = PATTERN_COL_NAME_NUMERIC.matcher(columnName);
if (numberMatcher.matches()) {
position = Integer.parseInt(numberMatcher.group(1));
}
}
if (procedure == null || (previousPosition >= 0 && position <= previousPosition && procIter.hasNext())) {
procedure = procIter.next();
}
GenericProcedureParameter column = new GenericProcedureParameter(
procedure,
columnName,
typeName,
valueType,
position,
columnSize,
scale, precision, notNull,
remarks,
parameterType);
procedure.addColumn(column);
previousPosition = position;
}
} finally {
dbResult.close();
}
} catch (SQLException e) {
throw new DBException(e, getDataSource());
}
}
private void addColumn(GenericProcedureParameter column)
{
if (this.columns == null) {
this.columns = new ArrayList<>();
}
this.columns.add(column);
}
@NotNull
@Override
public String getFullyQualifiedName(DBPEvaluationContext context)
{
return DBUtils.getFullQualifiedName(getDataSource(),
getCatalog(),
getSchema(),
this);
}
@NotNull
@Override
public String getUniqueName()
{
return CommonUtils.isEmpty(specificName) ? getName() : specificName;
}
@Override
public String getObjectDefinitionText(DBRProgressMonitor monitor, Map<String, Object> options) throws DBException {
if (source == null) {
source = getDataSource().getMetaModel().getProcedureDDL(monitor, this);
}
return source;
}
@Override
public DBSObject refreshObject(@NotNull DBRProgressMonitor monitor) throws DBException {
source = null;
return this;
}
}
| 43.053957 | 168 | 0.588353 |
9ef9a17114262c8f4a262bdaba53c3e47f14fe78
| 496 |
package com.bestxty.sault;
/**
* @author xty
* Created by xty on 2016/12/8.
*/
@SuppressWarnings({"WeakerAccess", "unused"})
public class SaultException extends RuntimeException {
public SaultException() {
super();
}
public SaultException(String message) {
super(message);
}
public SaultException(String message, Throwable cause) {
super(message, cause);
}
public SaultException(Throwable cause) {
super(cause);
}
}
| 19.076923 | 60 | 0.629032 |
aa4f842fa88c63199ac8bd2284d5d927300ba8fb
| 48,771 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.sis.parameter;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Locale;
import java.util.TimeZone;
import java.io.Console;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.text.Format;
import java.text.NumberFormat;
import java.text.FieldPosition;
import java.text.ParsePosition;
import java.text.ParseException;
import java.util.concurrent.atomic.AtomicReference;
import javax.measure.Unit;
import org.opengis.parameter.*;
import org.opengis.util.ScopedName;
import org.opengis.util.GenericName;
import org.opengis.metadata.Identifier;
import org.opengis.referencing.IdentifiedObject;
import org.opengis.referencing.ReferenceIdentifier;
import org.opengis.referencing.operation.OperationMethod;
import org.apache.sis.measure.Range;
import org.apache.sis.io.wkt.Colors;
import org.apache.sis.io.TableAppender;
import org.apache.sis.io.TabularFormat;
import org.apache.sis.util.CharSequences;
import org.apache.sis.util.ArgumentChecks;
import org.apache.sis.util.resources.Errors;
import org.apache.sis.util.resources.Vocabulary;
import org.apache.sis.referencing.IdentifiedObjects;
import org.apache.sis.internal.metadata.NameToIdentifier;
import org.apache.sis.internal.util.CollectionsExt;
import org.apache.sis.internal.util.X364;
import static org.apache.sis.util.collection.Containers.hashMapCapacity;
/**
* Formats {@linkplain DefaultParameterDescriptorGroup parameter descriptors} or
* {@linkplain DefaultParameterValueGroup parameter values} in a tabular format.
* This format assumes a monospaced font and an encoding supporting drawing box
* characters (e.g. UTF-8).
*
* <p>This class can format parameters with different levels of verbosity, specified by the {@link ContentLevel}
* property. The content level controls whether the formatter should write all names and aliases (at the cost of
* multi-line rows), or to pickup one name per parameter for a more compact table. See {@link ContentLevel}
* javadoc for output examples.</p>
*
* <div class="note"><b>Example:</b>
* The <cite>Mercator (variant A)</cite> example given in {@link DefaultParameterDescriptorGroup} javadoc
* will be formatted by default as below:
*
* {@preformat text
* EPSG: Mercator (variant A)
* ┌────────────────────────────────┬────────┬────────────┬───────────────┬───────────────┐
* │ Name (EPSG) │ Type │ Obligation │ Value domain │ Default value │
* ├────────────────────────────────┼────────┼────────────┼───────────────┼───────────────┤
* │ Latitude of natural origin │ Double │ Mandatory │ [-80 … 84]° │ 0.0° │
* │ Longitude of natural origin │ Double │ Mandatory │ [-180 … 180]° │ 0.0° │
* │ Scale factor at natural origin │ Double │ Mandatory │ (0 … ∞) │ 1.0 │
* │ False easting │ Double │ Mandatory │ (−∞ … ∞) m │ 0.0 m │
* │ False northing │ Double │ Mandatory │ (−∞ … ∞) m │ 0.0 m │
* └────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘
* }
* </div>
*
* The kinds of objects accepted by this formatter are:
* <table class="sis">
* <caption>Formattable object types</caption>
* <tr><th>Class</th> <th>Remarks</th></tr>
* <tr><td>{@link ParameterValueGroup}</td><td><cite>Default values</cite> column is replaced by a column of the actual values.</td></tr>
* <tr><td>{@link ParameterDescriptorGroup}</td><td>Table caption is the parameter group name.</td></tr>
* <tr><td>{@link OperationMethod}</td><td>Table caption is the method name (not necessarily the same than parameter group name).</td></tr>
* <tr><td><code>{@linkplain IdentifiedObject}[]</code></td><td>Accepted only for {@link ContentLevel#NAME_SUMMARY}.</td></tr>
* </table>
*
* <h2>Limitations</h2>
* <ul>
* <li>The current implementation can only format features — parsing is not yet implemented.</li>
* <li>{@code ParameterFormat}, like most {@code java.text.Format} subclasses, is not thread-safe.</li>
* </ul>
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @version 0.6
* @since 0.4
* @module
*/
public class ParameterFormat extends TabularFormat<Object> {
/**
* For cross-version compatibility.
*/
private static final long serialVersionUID = -1345231739800152411L;
/**
* An instance created when first needed and potentially shared.
*/
private static final AtomicReference<ParameterFormat> INSTANCE = new AtomicReference<>();
/**
* The default column separator. User can change the separator
* by a call to {@link #setColumnSeparatorPattern(String)}.
*/
private static final String SEPARATOR = " │ ";
/**
* The amount of information to include in the table formatted by {@link ParameterFormat}.
* The content level controls whether the formatter should write all names and aliases
* (at the cost of multi-line rows), or to pickup one name per parameter for a more compact table.
*
* <p>The enumeration value javadoc provide examples of formatting output.</p>
*
* @version 0.4
* @since 0.4
* @module
*/
public enum ContentLevel {
/**
* The most detailed content, which includes
* {@linkplain org.apache.sis.referencing.AbstractIdentifiedObject#getName() name} and
* {@linkplain org.apache.sis.referencing.AbstractIdentifiedObject#getAlias() aliases}.
* Each parameter may be formatted on many lines if they have aliases.
*
* <div class="note"><b>Example:</b>
* The <cite>Mercator (variant A)</cite> example given in {@link DefaultParameterDescriptorGroup} javadoc,
* (augmented with parameter aliases) formatted at this level produces a text like below:
*
* {@preformat text
* EPSG: Mercator (variant A) (9804)
* EPSG: Mercator (1SP)
* OGC: Mercator_1SP
* ╔══════════════════════════════════════╤════════╤════════════╤═══════════════╤═══════════════╗
* ║ Name │ Type │ Obligation │ Value domain │ Default value ║
* ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
* ║ EPSG: Latitude of natural origin │ Double │ Mandatory │ [-80 … 84]° │ 0.0° ║
* ║ OGC: latitude_of_origin │ │ │ │ ║
* ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
* ║ EPSG: Longitude of natural origin │ Double │ Mandatory │ [-180 … 180]° │ 0.0° ║
* ║ OGC: central_meridian │ │ │ │ ║
* ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
* ║ EPSG: Scale factor at natural origin │ Double │ Mandatory │ (0 … ∞) │ 1.0 ║
* ║ OGC: scale_factor │ │ │ │ ║
* ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
* ║ EPSG: False easting │ Double │ Mandatory │ (−∞ … ∞) m │ 0.0 m ║
* ║ OGC: false_easting │ │ │ │ ║
* ╟──────────────────────────────────────┼────────┼────────────┼───────────────┼───────────────╢
* ║ EPSG: False northing │ Double │ Mandatory │ (−∞ … ∞) m │ 0.0 m ║
* ║ OGC: false_northing │ │ │ │ ║
* ╚══════════════════════════════════════╧════════╧════════════╧═══════════════╧═══════════════╝
* }
* </div>
*/
DETAILED,
/**
* A medium level of content which formats each parameter on a single line. For each parameter only the
* {@linkplain org.apache.sis.referencing.AbstractIdentifiedObject#getName() name} is formatted —
* {@linkplain org.apache.sis.referencing.AbstractIdentifiedObject#getAlias() aliases} and
* {@linkplain org.apache.sis.referencing.AbstractIdentifiedObject#getIdentifiers() identifiers} are omitted.
*
* <div class="note"><b>Example:</b>
* The <cite>Mercator (variant A)</cite> example given in {@link DefaultParameterDescriptorGroup} javadoc
* formatted at this level produces a text like below:
*
* {@preformat text
* EPSG: Mercator (variant A)
* ┌────────────────────────────────┬────────┬────────────┬───────────────┬───────────────┐
* │ Name (EPSG) │ Type │ Obligation │ Value domain │ Default value │
* ├────────────────────────────────┼────────┼────────────┼───────────────┼───────────────┤
* │ Latitude of natural origin │ Double │ Mandatory │ [-80 … 84]° │ 0.0° │
* │ Longitude of natural origin │ Double │ Mandatory │ [-180 … 180]° │ 0.0° │
* │ Scale factor at natural origin │ Double │ Mandatory │ (0 … ∞) │ 1.0 │
* │ False easting │ Double │ Mandatory │ (−∞ … ∞) m │ 0.0 m │
* │ False northing │ Double │ Mandatory │ (−∞ … ∞) m │ 0.0 m │
* └────────────────────────────────┴────────┴────────────┴───────────────┴───────────────┘
* }
* </div>
*/
BRIEF,
/**
* Limits the content to names and aliases in a tabular format. In addition to parameters,
* this level can also format array of operation method, coordinate reference system, <i>etc.</i>
* The summary contains the identifier names and aliases aligned in a table.
*
* <div class="note"><b>Example:</b>
* The <cite>Mercator (variant A)</cite> example given in {@link ParameterBuilder} javadoc
* formatted at this level produces a text like below:
*
* {@preformat text
* EPSG: Mercator (variant A)
* ┌────────────────────────────────┬────────────────────┐
* │ EPSG │ OGC │
* ├────────────────────────────────┼────────────────────┤
* │ Latitude of natural origin │ latitude_of_origin │
* │ Longitude of natural origin │ central_meridian │
* │ Scale factor at natural origin │ scale_factor │
* │ False easting │ false_easting │
* │ False northing │ false_northing │
* └────────────────────────────────┴────────────────────┘
* }
* </div>
*
* <p><b>Tip:</b> the table formatted by default may be quite large. It is recommended to invoke
* {@link ParameterFormat#setPreferredCodespaces(String[])} before to format in order to reduce the
* amount of columns to display.</p>
*/
NAME_SUMMARY
}
/**
* The locale for international strings.
*/
private final Locale displayLocale;
/**
* The amount of information to put in the table.
*
* @see #getContentLevel()
*/
private ContentLevel contentLevel = ContentLevel.BRIEF;
/**
* If the identifier should be written only for some code spaces, those code spaces.
* Otherwise {@code null}. This set should not be modified; new set are created if needed.
*
* @see #getPreferredCodespaces()
*/
private Set<String> preferredCodespaces;
/**
* The colors for an output on X3.64 compatible terminal, or {@code null} if none.
*
* @see #getColors()
*/
private Colors colors;
/**
* Creates a new formatter for the default locale and timezone.
*/
public ParameterFormat() {
super(Locale.getDefault(Locale.Category.FORMAT), TimeZone.getDefault());
displayLocale = Locale.getDefault(Locale.Category.DISPLAY);
columnSeparator = SEPARATOR;
}
/**
* Creates a new formatter for the given locale and timezone.
*
* @param locale the locale, or {@code null} for {@code Locale.ROOT}.
* @param timezone the timezone, or {@code null} for UTC.
*/
public ParameterFormat(final Locale locale, final TimeZone timezone) {
super(locale, timezone);
displayLocale = (locale != null) ? locale : Locale.ROOT;
columnSeparator = SEPARATOR;
}
/**
* Returns the type of objects formatted by this class. This method has to return {@code Object.class}
* since it is the only common parent to all object types accepted by this formatter.
*
* @return {@code Object.class}
*/
@Override
public final Class<Object> getValueType() {
return Object.class;
}
/**
* Returns the locale for the given category.
*
* <ul>
* <li>{@link java.util.Locale.Category#FORMAT} specifies the locale to use for values.</li>
* <li>{@link java.util.Locale.Category#DISPLAY} specifies the locale to use for labels.</li>
* </ul>
*
* @param category the category for which a locale is desired.
* @return the locale for the given category (never {@code null}).
*/
@Override
public Locale getLocale(final Locale.Category category) {
return (category == Locale.Category.DISPLAY) ? displayLocale : super.getLocale(category);
}
/**
* Returns the amount of information to put in the table.
* The default value is {@link ContentLevel#BRIEF}.
*
* @return the table content.
*/
public ContentLevel getContentLevel() {
return contentLevel;
}
/**
* Sets the amount of information to put in the table.
*
* @param level the amount of information to put in the table.
*/
public void setContentLevel(final ContentLevel level) {
ArgumentChecks.ensureNonNull("level", level);
this.contentLevel = level;
}
/**
* Returns the code spaces of names, aliases and identifiers to show, or {@code null} if there is no restriction.
* This method returns the sequence specified by the last call to {@link #setPreferredCodespaces(String[])},
* without duplicated values.
*
* <p>The default value is {@code null}.</p>
*
* @return the code spaces of names and identifiers to show, or {@code null} if no restriction.
*/
public String[] getPreferredCodespaces() {
final Set<String> p = preferredCodespaces;
return (p != null) ? p.toArray(new String[p.size()]) : null;
}
/**
* Filters names, aliases and identifiers by their code spaces. If the given array is non-null, then the only names,
* aliases and identifiers to be formatted are those having a {@link ReferenceIdentifier#getCodeSpace()},
* {@link ScopedName#head()} or {@link GenericName#scope()} value in the given list, unless no name or alias
* matches this criterion.
*
* @param codespaces the preferred code spaces of names, aliases and identifiers to format, or {@code null}
* for accepting all of them. Some typical values are {@code "EPSG"}, {@code "OGC"} or {@code "GeoTIFF"}.
*/
public void setPreferredCodespaces(final String... codespaces) {
Set<String> copy = null;
if (codespaces != null) {
copy = CollectionsExt.immutableSet(true, codespaces);
}
this.preferredCodespaces = copy;
}
/**
* Returns {@code true} if a name, alias or identifier in the given codespace should be formatted.
*/
private boolean isPreferredCodespace(final String codespace) {
final Set<String> p = preferredCodespaces;
return (p == null) || p.contains(codespace);
}
/**
* Returns the colors for an output on X3.64 compatible terminal, or {@code null} if none.
* The default value is {@code null}.
*
* @return the colors for an output on X3.64 compatible terminal, or {@code null} if none.
*/
public Colors getColors() {
return colors;
}
/**
* Sets the colors for an output on X3.64 compatible terminal.
*
* @param colors the colors for an output on X3.64 compatible terminal, or {@code null} if none.
*/
public void setColors(final Colors colors) {
this.colors = colors;
}
/**
* Invoked when the formatter needs to move to the next column.
*/
private void nextColumn(final TableAppender table) {
table.append(beforeFill);
table.nextColumn(fillCharacter);
}
/**
* Formats the given object to the given stream of buffer.
* The object may be an instance of any of the following types:
*
* <ul>
* <li>{@link ParameterValueGroup}</li>
* <li>{@link ParameterDescriptorGroup}</li>
* <li>{@link OperationMethod}</li>
* <li><code>{@linkplain IdentifiedObject}[]</code> — accepted only for {@link ContentLevel#NAME_SUMMARY}.</li>
* </ul>
*
* @throws IOException if an error occurred while writing to the given appendable.
*/
@Override
public void format(final Object object, final Appendable toAppendTo) throws IOException {
ArgumentChecks.ensureNonNull("object", object);
ArgumentChecks.ensureNonNull("toAppendTo", toAppendTo);
final boolean isSummary = contentLevel == ContentLevel.NAME_SUMMARY;
final ParameterDescriptorGroup descriptor;
final ParameterValueGroup values;
final Identifier name;
if (object instanceof ParameterValueGroup) {
values = (ParameterValueGroup) object;
descriptor = values.getDescriptor();
name = descriptor.getName();
} else if (object instanceof ParameterDescriptorGroup) {
descriptor = (ParameterDescriptorGroup) object;
values = null;
name = descriptor.getName();
} else if (object instanceof OperationMethod) {
final OperationMethod operation = (OperationMethod) object;
descriptor = operation.getParameters();
values = null;
name = operation.getName();
} else if (isSummary && object instanceof IdentifiedObject[]) {
formatSummary((IdentifiedObject[]) object, toAppendTo);
return;
} else {
throw new IllegalArgumentException(Errors.getResources(displayLocale)
.getString(Errors.Keys.UnsupportedType_1, object.getClass()));
}
if (isSummary) {
final List<GeneralParameterDescriptor> parameters = descriptor.descriptors();
formatSummary(parameters.toArray(new IdentifiedObject[parameters.size()]), toAppendTo);
} else {
format(name.getCode(), descriptor, values, toAppendTo);
}
}
/**
* Implementation of public {@code format(…)} methods for all content levels except {@code NAME_SUMMARY}.
*
* @param name the group name, usually {@code descriptor.getName().getCode()}.
* @param group the parameter descriptor, usually {@code values.getDescriptor()}.
* @param values the parameter values, or {@code null} if none.
* @throws IOException if an error occurred while writing to the given appendable.
*/
private void format(final String name, final ParameterDescriptorGroup group,
final ParameterValueGroup values, final Appendable out) throws IOException
{
final boolean isBrief = (contentLevel == ContentLevel.BRIEF);
final boolean showObligation = !isBrief || (values == null);
final boolean hasColors = (colors != null);
final String lineSeparator = this.lineSeparator;
final Map<String,Integer> remarks = new LinkedHashMap<>();
final ParameterTableRow header = new ParameterTableRow(group, displayLocale, preferredCodespaces, remarks, isBrief);
final String groupCodespace = header.getCodeSpace();
/*
* Prepares the information to be printed later as table rows. We scan all rows before to print them
* in order to compute the width of codespaces. During this process, we split the objects to be printed
* later in two collections: simple parameters are stored as (descriptor,value) pairs, while groups are
* stored in an other collection for deferred formatting after the simple parameters.
*/
int codespaceWidth = 0;
final Collection<?> elements = (values != null) ? values.values() : group.descriptors();
final Map<GeneralParameterDescriptor, ParameterTableRow> descriptorValues =
new LinkedHashMap<>(hashMapCapacity(elements.size()));
List<Object> deferredGroups = null; // To be created only if needed (it is usually not).
for (final Object element : elements) {
final GeneralParameterValue parameter;
final GeneralParameterDescriptor descriptor;
if (values != null) {
parameter = (GeneralParameterValue) element;
descriptor = parameter.getDescriptor();
} else {
parameter = null;
descriptor = (GeneralParameterDescriptor) element;
}
if (descriptor instanceof ParameterDescriptorGroup) {
if (deferredGroups == null) {
deferredGroups = new ArrayList<>(4);
}
deferredGroups.add(element);
continue;
}
/*
* In the vast majority of cases, there is only one value for each parameter. However
* if we find more than one value, we will append all extra occurrences in a "multiple
* values" list to be formatted in the same row.
*/
Object value = null;
Unit<?> unit = null;
if (parameter instanceof ParameterValue<?>) {
final ParameterValue<?> p = (ParameterValue<?>) parameter;
value = p.getValue();
unit = p.getUnit();
} else if (descriptor instanceof ParameterDescriptor<?>) {
final ParameterDescriptor<?> p = (ParameterDescriptor<?>) descriptor;
value = p.getDefaultValue();
unit = p.getUnit();
}
ParameterTableRow row = descriptorValues.get(descriptor);
if (row == null) {
row = new ParameterTableRow(descriptor, displayLocale, preferredCodespaces, remarks, isBrief);
descriptorValues.put(descriptor, row);
if (row.codespaceWidth > codespaceWidth) {
codespaceWidth = row.codespaceWidth;
}
}
row.addValue(value, unit);
}
/*
* Finished to collect the values. Now transform the values:
*
* - Singleton value of array types (either primitive or not) are wrapped into a list.
* - Values are formatted.
* - Value domains are formatted.
* - Position of the character on which to do the alignment are remembered.
*/
int unitWidth = 0;
int valueDomainAlignment = 0;
boolean writeCodespaces = (groupCodespace == null);
final StringBuffer buffer = new StringBuffer();
final FieldPosition dummyFP = new FieldPosition(-1);
for (final Map.Entry<GeneralParameterDescriptor,ParameterTableRow> entry : descriptorValues.entrySet()) {
final GeneralParameterDescriptor descriptor = entry.getKey();
if (descriptor instanceof ParameterDescriptor<?>) {
final ParameterTableRow row = entry.getValue();
/*
* Verify if all rows use the same codespace than the header, in which case we can omit
* row codespace formatting.
*/
if (!writeCodespaces && !groupCodespace.equals(entry.getValue().getCodeSpace())) {
writeCodespaces = true;
}
/*
* Format the value domain, so we can compute the character position on which to perform alignment.
*/
final Range<?> valueDomain = Parameters.getValueDomain((ParameterDescriptor<?>) descriptor);
if (valueDomain != null) {
final int p = row.setValueDomain(valueDomain, getFormat(Range.class), buffer);
if (p > valueDomainAlignment) {
valueDomainAlignment = p;
}
}
/*
* Singleton array conversion. Because it may be an array of primitive types, we can not just
* cast to Object[]. Then formats the units, with a space before the unit if the symbol is a
* letter or digit (i.e. we do not put a space in front of ° symbol for instance).
*/
row.expandSingleton();
final int length = row.units.size();
for (int i=0; i<length; i++) {
final Object unit = row.units.get(i);
if (unit != null) {
if (getFormat(Unit.class).format(unit, buffer, dummyFP).length() != 0) {
if (Character.isLetterOrDigit(buffer.codePointAt(0))) {
buffer.insert(0, ' ');
}
}
final String symbol = buffer.toString();
row.units.set(i, symbol);
buffer.setLength(0);
final int p = symbol.length();
if (p > unitWidth) {
unitWidth = p;
}
}
}
}
}
/*
* Finished to prepare information. Now begin the actual writing.
* First, formats the table header (i.e. the column names).
*/
final Vocabulary resources = Vocabulary.getResources(displayLocale);
header.writeIdentifiers(out, true, colors, false, lineSeparator);
out.append(lineSeparator);
final char horizontalBorder = isBrief ? '─' : '═';
final TableAppender table = (isBrief || !columnSeparator.equals(SEPARATOR)) ?
new TableAppender(out, columnSeparator) : new TableAppender(out);
table.setMultiLinesCells(true);
table.nextLine(horizontalBorder);
int numColumnsBeforeValue = 0;
for (int i=0; ; i++) {
boolean end = false;
final short key;
switch (i) {
case 0: {
key = Vocabulary.Keys.Name;
break;
}
case 1: {
key = Vocabulary.Keys.Type;
break;
}
case 2: {
if (!showObligation) {
continue;
}
key = Vocabulary.Keys.Obligation;
break;
}
case 3: {
key = Vocabulary.Keys.ValueDomain;
break;
}
case 4: {
key = (values == null) ? Vocabulary.Keys.DefaultValue : Vocabulary.Keys.Value;
end = true;
break;
}
default: throw new AssertionError(i);
}
if (hasColors) table.append(X364.BOLD.sequence());
table.append(resources.getString(key));
if (hasColors) table.append(X364.NORMAL.sequence());
if (!writeCodespaces && i == 0) {
table.append(" (").append(groupCodespace).append(')');
}
if (end) break;
nextColumn(table);
numColumnsBeforeValue++;
}
table.nextLine();
/*
* Now process to the formatting of (descriptor,value) pairs. Each descriptor's alias
* will be formatted on its own line in a table row. If there is more than one value,
* then each value will be formatted on its own line as well. Note that the values may
* be null if there is none.
*/
char horizontalLine = horizontalBorder;
for (final Map.Entry<GeneralParameterDescriptor,ParameterTableRow> entry : descriptorValues.entrySet()) {
if (horizontalLine != 0) {
table.nextLine('─');
}
horizontalLine = isBrief ? 0 : '─';
final ParameterTableRow row = entry.getValue();
row.codespaceWidth = codespaceWidth;
row.writeIdentifiers(table, writeCodespaces, null, hasColors, lineSeparator);
nextColumn(table);
final GeneralParameterDescriptor generalDescriptor = entry.getKey();
if (generalDescriptor instanceof ParameterDescriptor<?>) {
/*
* Writes value type.
*/
final ParameterDescriptor<?> descriptor = (ParameterDescriptor<?>) generalDescriptor;
final Class<?> valueClass = descriptor.getValueClass();
if (valueClass != null) { // Should never be null, but let be safe.
table.append(getFormat(Class.class).format(valueClass, buffer, dummyFP).toString());
}
nextColumn(table);
buffer.setLength(0);
/*
* Writes the obligation (mandatory or optional).
*/
if (showObligation) {
final int minimumOccurs = descriptor.getMinimumOccurs();
final int maximumOccurs = descriptor.getMaximumOccurs();
if (maximumOccurs == 1) {
table.append(resources.getString(minimumOccurs == 0 ?
Vocabulary.Keys.Optional : Vocabulary.Keys.Mandatory));
} else {
final Format f = getFormat(Integer.class);
table.append(f.format(minimumOccurs, buffer, dummyFP).toString()).append(" … ");
buffer.setLength(0);
if (maximumOccurs == Integer.MAX_VALUE) {
table.append('∞');
} else {
table.append(f.format(maximumOccurs, buffer, dummyFP).toString());
buffer.setLength(0);
}
}
nextColumn(table);
}
/*
* Writes minimum and maximum values, together with the unit of measurement (if any).
*/
final String valueDomain = row.valueDomain;
if (valueDomain != null) {
table.append(CharSequences.spaces(valueDomainAlignment - row.valueDomainAlignment)).append(valueDomain);
}
nextColumn(table);
/*
* Writes the values, each on its own line, together with their unit of measurement.
*/
final byte alignment = Number.class.isAssignableFrom(valueClass) ? TableAppender.ALIGN_RIGHT : TableAppender.ALIGN_LEFT;
table.setCellAlignment(alignment);
final int length = row.values.size();
for (int i=0; i<length; i++) {
Object value = row.values.get(i);
if (value != null) {
if (i != 0) {
/*
* If the same parameter is repeated more than once (not allowed by ISO 19111,
* but this extra flexibility is allowed by Apache SIS), write the ditto mark
* in all previous columns (name, type, etc.) on a new row.
*/
final String ditto = resources.getString(Vocabulary.Keys.DittoMark);
table.nextLine();
table.setCellAlignment(TableAppender.ALIGN_CENTER);
for (int j=0; j<numColumnsBeforeValue; j++) {
table.append(ditto);
nextColumn(table);
}
table.setCellAlignment(alignment);
}
/*
* Format the value followed by the unit of measure, or followed by spaces if there is no unit
* for this value. The intent is the right align the numerical value rather than the numerical
* + unit tuple.
*/
final Format format = getFormat(value.getClass());
if (format != null) {
if (format instanceof NumberFormat && value instanceof Number) {
configure((NumberFormat) format, Math.abs(((Number) value).doubleValue()));
}
value = format.format(value, buffer, dummyFP);
}
table.append(value.toString());
buffer.setLength(0);
int pad = unitWidth;
final String unit = (String) row.units.get(i);
if (unit != null) {
table.append(unit);
pad -= unit.length();
}
table.append(CharSequences.spaces(pad));
}
}
}
table.nextLine();
table.setCellAlignment(TableAppender.ALIGN_LEFT);
}
table.nextLine(horizontalBorder);
table.flush();
/*
* Write remarks, if any.
*/
for (final Map.Entry<String,Integer> remark : remarks.entrySet()) {
ParameterTableRow.writeFootnoteNumber(out, remark.getValue());
out.append(' ').append(remark.getKey()).append(lineSeparator);
}
/*
* Now formats all groups deferred to the end of this table, with recursive calls to
* this method (recursive calls use their own TableWriter instance, so they may result
* in a different cell layout). Most of the time, there is no such additional group.
*/
if (deferredGroups != null) {
for (final Object element : deferredGroups) {
final ParameterValueGroup value;
final ParameterDescriptorGroup descriptor;
if (element instanceof ParameterValueGroup) {
value = (ParameterValueGroup) element;
descriptor = value.getDescriptor();
} else {
value = null;
descriptor = (ParameterDescriptorGroup) element;
}
out.append(lineSeparator);
format(name + '/' + descriptor.getName().getCode(), descriptor, value, out);
}
}
}
/**
* Configures the number pattern to use for the given value. The main intent of this method is to ensure that
* the map projection scale factor (a value close to 1) is formatted with a sufficient number of fraction digits.
* A common default NumberFormat precision is 3 digits, which is not sufficient. For example the scale factor of
* Transverse Mercator projections is 0.9996 (4 digits), and the scale factor of "NTF (Paris) / Lambert zone II"
* projection is 0.99987742 (8 digits).
*
* @param format the format to configure.
* @param m the absolute value (magnitude) of the value to write.
*/
private static void configure(final NumberFormat format, final double m) {
if (format.getMaximumFractionDigits() <= 9) {
/*
* If the maximum fraction digits is higher than 9, then that value has not been set by this class.
* Maybe the user overrides the createFormat(Class<?>) method in his own subclass, in which case we
* will respect his wish and not set a lower value here.
*/
final int n;
if (m < 10) {
n = 9;
} else if (m < 1000) { // No real use case for this threshold yet, but added for more progressive behavior.
n = 6;
} else {
n = 3;
}
/*
* The minimum fraction digits is usually 0. But if we find a higher value (for example because the
* user overrides the createFormat(Class<?>) method), then we will respect user's wish and not set
* a lower value.
*/
if (n >= format.getMinimumFractionDigits()) {
format.setMaximumFractionDigits(n);
}
}
}
/**
* Implementation of public {@code format(…)} methods for {@code NAME_SUMMARY} content level.
*
* @param objects the collection of objects to format.
* @param out the stream or buffer where to write the summary.
* @throws IOException if an error occurred will writing to the given appendable.
*/
private void formatSummary(final IdentifiedObject[] objects, final Appendable out) throws IOException {
final Vocabulary resources = Vocabulary.getResources(displayLocale);
/*
* Prepares all rows before we write them to the output stream, because not all
* identified objects may have names with the same scopes in the same order. We
* also need to iterate over all rows in order to know the number of columns.
*
* The first column is reserved for the identifier. We put null as a sentinel key for
* that column name, to be replaced later by "Identifier" in user locale. We can not
* put the localized strings in the map right now because they could conflict with
* the scope of some alias to be processed below.
*/
boolean hasIdentifiers = false;
final List<String[]> rows = new ArrayList<>();
final Map<String,Integer> columnIndices = new LinkedHashMap<>();
columnIndices.put(null, 0); // See above comment for the meaning of "null" here.
if (preferredCodespaces != null) {
for (final String codespace : preferredCodespaces) {
columnIndices.put(codespace, columnIndices.size());
}
}
for (final IdentifiedObject object : objects) {
String[] row = new String[columnIndices.size()]; // Will growth later if needed.
/*
* Put the first identifier in the first column. If no identifier has a codespace in the list
* supplied by the user, then we will use the first identifier (any codespace) as a fallback.
*/
final Set<ReferenceIdentifier> identifiers = object.getIdentifiers();
if (identifiers != null) { // Paranoiac check.
Identifier identifier = null;
for (final ReferenceIdentifier candidate : identifiers) {
if (candidate != null) { // Paranoiac check.
if (isPreferredCodespace(candidate.getCodeSpace())) {
identifier = candidate;
break; // Format now.
}
if (identifier == null) {
identifier = candidate; // To be used as a fallback if we find nothing better.
}
}
}
if (identifier != null) {
row[0] = IdentifiedObjects.toString(identifier);
hasIdentifiers = true;
}
}
/*
* If the name's codespace is in the list of codespaces asked by the user, add that name
* in the current row and clear the 'name' locale variable. Otherwise, keep the 'name'
* locale variable in case we found no alias to format.
*/
ReferenceIdentifier name = object.getName();
if (name != null) { // Paranoiac check.
final String codespace = name.getCodeSpace();
if (isPreferredCodespace(codespace)) {
row = putIfAbsent(resources, row, columnIndices, codespace, name.getCode());
name = null;
}
}
/*
* Put all aliases having a codespace in the list asked by the user.
*/
final Collection<GenericName> aliases = object.getAlias();
if (aliases != null) { // Paranoiac check.
for (final GenericName alias : aliases) {
if (alias != null) { // Paranoiac check.
final String codespace = NameToIdentifier.getCodeSpace(alias, displayLocale);
if (isPreferredCodespace(codespace)) {
row = putIfAbsent(resources, row, columnIndices, codespace,
alias.tip().toInternationalString().toString(displayLocale));
name = null;
}
}
}
}
/*
* If no name and no alias have a codespace in the list of codespaces asked by the user,
* force the addition of primary name regardless its codespace.
*/
if (name != null) {
row = putIfAbsent(resources, row, columnIndices, name.getCodeSpace(), name.getCode());
}
rows.add(row);
}
/*
* Writes the table. The header will contain one column for each codespace in the order declared
* by the user. If the user did not specified any codespace, or if we had to write codespace not
* on the user list, then those codespaces will be written in the order we found them.
*/
final boolean hasColors = (colors != null);
final TableAppender table = new TableAppender(out, columnSeparator);
table.setMultiLinesCells(true);
table.appendHorizontalSeparator();
for (String codespace : columnIndices.keySet()) {
if (codespace == null) {
if (!hasIdentifiers) continue; // Skip empty column.
codespace = resources.getString(Vocabulary.Keys.Identifier);
}
if (hasColors) {
codespace = X364.BOLD.sequence() + codespace + X364.NORMAL.sequence();
}
table.append(codespace);
nextColumn(table);
}
table.appendHorizontalSeparator();
/*
* Writes row content.
*/
final int numColumns = columnIndices.size();
for (final String[] row : rows) {
for (int i=hasIdentifiers ? 0 : 1; i<numColumns; i++) {
if (i < row.length) {
final String name = row[i];
if (name != null) {
table.append(name);
}
}
nextColumn(table);
}
table.nextLine();
}
table.appendHorizontalSeparator();
table.flush();
}
/**
* Stores a value in the given position of the given row, expanding the array if needed.
* This operation is performed only if no value already exists in the cell.
*
* @param row all columns in a single row.
* @param columnIndices indices of columns for each codespace.
* @param codespace the codespace of the name or alias to add.
* @param name the code of the name or alias to add.
* @return {@code row}, or a new array if it was necessary to expand the row.
*/
private static String[] putIfAbsent(final Vocabulary resources, String[] row,
final Map<String,Integer> columnIndices, String codespace, final String name)
{
if (codespace == null) {
codespace = resources.getString(Vocabulary.Keys.Unnamed);
}
final Integer columnIndex = columnIndices.get(codespace);
final int i;
if (columnIndex != null) {
i = columnIndex;
} else {
i = columnIndices.size();
columnIndices.put(codespace, i);
}
if (i >= row.length) {
row = Arrays.copyOf(row, i + 1);
}
if (row[i] == null) {
row[i] = name;
}
return row;
}
/**
* Returns a shared instance of {@code ParameterFormat} if possible, or a new one otherwise.
*/
private static ParameterFormat getSharedInstance(final Colors colors) {
ParameterFormat f = INSTANCE.getAndSet(null);
if (f == null) {
f = new ParameterFormat();
}
f.setColors(colors);
return f;
}
/**
* Formats the given object using a shared instance of {@code ParameterFormat}.
* This is used for {@link DefaultParameterDescriptorGroup#toString()} implementation.
*/
static String sharedFormat(final Object object) {
final ParameterFormat f = getSharedInstance(null);
final String s = f.format(object);
INSTANCE.set(f);
return s;
}
/**
* Writes the given object to the console using a shared instance of {@code ParameterFormat}.
*/
@SuppressWarnings("UseOfSystemOutOrSystemErr")
static void print(final Object object) {
final Console console = System.console();
final Appendable out = (console != null) ? console.writer() : System.out;
final ParameterFormat f = getSharedInstance(Colors.NAMING);
try {
f.format(object, out);
} catch (IOException e) {
throw new UncheckedIOException(e); // Should never happen since we are writing to stdout.
}
INSTANCE.set(f);
}
/**
* Not yet supported.
*
* @return currently never return.
* @throws ParseException currently always thrown.
*/
@Override
public Object parse(final CharSequence text, final ParsePosition pos) throws ParseException {
throw new ParseException(Errors.getResources(displayLocale)
.getString(Errors.Keys.UnsupportedOperation_1, "parse"), pos.getIndex());
}
/**
* Returns a clone of this format.
*
* @return a clone of this format.
*/
@Override
public ParameterFormat clone() {
final ParameterFormat clone = (ParameterFormat) super.clone();
// No need to clone 'preferredCodespaces'.
clone.colors = clone.colors.clone();
return clone;
}
}
| 47.076255 | 141 | 0.548523 |
b03dbdddbcdedd7cdd82d31d06fc50bf4c90f399
| 1,311 |
/**
* Neociclo Accord, Open Source B2B Integration Suite
* Copyright (C) 2005-2010 Neociclo, http://www.neociclo.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.neociclo.odetteftp.camel;
import java.text.SimpleDateFormat;
import org.neociclo.odetteftp.protocol.VirtualFile;
public class FileRenameBean {
private static final SimpleDateFormat TIMESTAMP = new SimpleDateFormat("yyyyMMddHHmmss");
private static final char SEP = '$';
public String renameFile(VirtualFile vf) {
StringBuilder filename = new StringBuilder();
filename.append(TIMESTAMP.format(vf.getDateTime()));
filename.append(SEP).append(vf.getDestination());
filename.append(SEP).append(vf.getOriginator());
filename.append(SEP).append(vf.getDatasetName());
return filename.toString();
}
}
| 31.97561 | 90 | 0.753623 |
7bad2182b01850fe6ff1abee2cb139d5678d46f0
| 759 |
package org.oyasunadev.minecraft;
import javax.swing.*;
/**
* Created with IntelliJ IDEA.
* User: Oliver Yasuna
* Date: 9/23/12
* Time: 4:04 PM
*/
public class Start
{
public static void main(String[] args)
{
new Start();
}
public Start()
{
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
SPFrame spFrame = new SPFrame();
spFrame.setVisible(true);
spFrame.startMinecraft();
spFrame.finish();
}
}
| 18.975 | 72 | 0.652174 |
074b340aaf753f86b368a921c11145e628e0a1c9
| 1,381 |
/**
*/
package org.eclipse.epf.uma.tests;
import junit.textui.TestRunner;
import org.eclipse.epf.uma.Reference;
import org.eclipse.epf.uma.UmaFactory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Reference</b></em>'.
* <!-- end-user-doc -->
* @generated
*/
public class ReferenceTest extends DiagramElementTest {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(ReferenceTest.class);
}
/**
* Constructs a new Reference test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ReferenceTest(String name) {
super(name);
}
/**
* Returns the fixture for this Reference test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected Reference getFixture() {
return (Reference)fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(UmaFactory.eINSTANCE.createReference());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@Override
protected void tearDown() throws Exception {
setFixture(null);
}
} //ReferenceTest
| 19.450704 | 64 | 0.621289 |
b3bce794c0fbc0cd4728f180176e8ace9fcc3777
| 9,251 |
package tr.metu.ceng.construction.server.service;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import tr.metu.ceng.construction.server.DTO.TableStateDTO;
import tr.metu.ceng.construction.server.enums.EventType;
import tr.metu.ceng.construction.server.exception.CouldNotPickACardException;
import tr.metu.ceng.construction.server.exception.GameNotFoundException;
import tr.metu.ceng.construction.server.model.Card;
import tr.metu.ceng.construction.server.model.Game;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static tr.metu.ceng.construction.server.common.CommonConstants.DOUBLE_PISTI_POINT;
import static tr.metu.ceng.construction.server.common.CommonConstants.PISTI_POINT;
import static tr.metu.ceng.construction.server.common.Messages.COULD_NOT_PICK_CARD;
import static tr.metu.ceng.construction.server.common.Messages.GAME_NOT_EXIST;
import static tr.metu.ceng.construction.server.enums.Rank.JACK;
import static tr.metu.ceng.construction.server.utils.GameUtilities.calculatePointToAdd;
@Service
@RequiredArgsConstructor
public class ComputerMoveService {
private final CardService cardService;
/**
* Makes computer move for the three difficulty levels respectively.
* For easy level, picks a random card and plays it.
* For normal level, tries to throw the card with the same rank
* as the top one in the face-up cards. If it does not have one ,and has JACK,
* it will throw it. Otherwise, throws a random card.
* For hard level, checks how many cards the pile consists of and applies different
* strategies accordingly.
*
* @param game this is the game being played
* @param tableState this is the current table state
* @throws GameNotFoundException if the passed game parameter is null
* @throws CouldNotPickACardException if the computer could not pick a card
*/
public void makeComputerMove(Game game, TableStateDTO tableState) throws GameNotFoundException, CouldNotPickACardException {
if (game != null) {
Card pickedCard = null;
Set<Card> computerCards = tableState.getComputerCards();
List<Card> faceUpCards = tableState.getFaceUpCards();
int level = game.getLevel();
if (level == 1) {
/* easy level: computer picks a random card and plays it */
pickedCard = cardService.getRandomCard(computerCards);
} else if (level == 2) {
/* normal level: computer tries to throw the card with the same rank as the top one in the face-up cards.
If it does not have one ,and has JACK, it will throw it. Otherwise, it will throw a random card */
if (faceUpCards.size() > 0) {
Card lastCardOnMiddle = faceUpCards.get(faceUpCards.size() - 1);
pickedCard = pickMatchingCardOrJack(lastCardOnMiddle, computerCards);
}
if (pickedCard == null) {
pickedCard = cardService.getRandomCard(computerCards);
}
} else if (level == 3) {
/* hard level: check whether the pile consists of exactly one card, zero card or more than one card
and apply different strategies accordingly*/
pickedCard = playHardLevel(tableState);
}
if (pickedCard == null) {
// in case there is a problem in picking a card
throw new CouldNotPickACardException(COULD_NOT_PICK_CARD);
}
computerCards.remove(pickedCard);
// calculate computer score and set how many cards captured by computer
executeComputerMove(pickedCard, tableState);
}
else {
throw new GameNotFoundException(GAME_NOT_EXIST);
}
}
/* checks if computer captures the play pile with its move, if so, update computer score and
total number of cards captured by computer */
private void executeComputerMove(Card playedCard, TableStateDTO tableState) {
List<Card> faceUpCards = tableState.getFaceUpCards();
if (faceUpCards.size() != 0) {
Card lastCardOnMiddle = faceUpCards.get(faceUpCards.size() - 1);
if (playedCard.canCapture(lastCardOnMiddle)) {
//capture all the cards in the play pile
tableState.setEventType(EventType.COMPUTER_CAPTURED);
Set<Card> computerCapturedCards = new HashSet<>(faceUpCards);
computerCapturedCards.add(playedCard);
// update computer level score
if (faceUpCards.size() == 1 && lastCardOnMiddle.getRank().equals(JACK)){
tableState.setComputerLevelScore(tableState.getComputerLevelScore() + DOUBLE_PISTI_POINT);
} else if (faceUpCards.size() == 1) {
tableState.setComputerLevelScore(tableState.getComputerLevelScore() + PISTI_POINT);
}
tableState.setComputerLevelScore(tableState.getComputerLevelScore() + calculatePointToAdd(faceUpCards, playedCard));
int updatedCapturedCardsNumberByComputer = tableState.getCapturedCardsNumberByComputer() + computerCapturedCards.size();
tableState.setCapturedCardsNumberByComputer(updatedCapturedCardsNumberByComputer);
//make face-up cards empty
tableState.setFaceUpCards(new ArrayList<>());
}
else {
// cannot capture
faceUpCards.add(playedCard);
}
}
else {
faceUpCards.add(playedCard);
}
}
private Card pickMatchingCardOrJack(Card lastCardOnMiddle, Set<Card> computerCards) {
Card pickedCard = null;
Card matchingCard = computerCards.stream()
.filter(card-> card.compareRank(lastCardOnMiddle))
.findFirst()
.orElse(null);
if(matchingCard != null){
pickedCard = matchingCard;
} else {
Card jack = computerCards.stream()
.filter(card-> card.getRank().equals(JACK))
.findFirst().orElse(null);
if (jack != null) {
pickedCard = jack;
}
}
return pickedCard;
}
private Card findMatchingCardWithHighestPoint(Card lastCardOnMiddle, Set<Card> computerCards) {
Card pickedCard = null;
Set<Card> matchingCards = computerCards.stream()
.filter(card-> card.compareRank(lastCardOnMiddle))
.collect(Collectors.toSet());
if (matchingCards.size() > 1) {
//there are more than one matching card, find the highest scored one if any
pickedCard = cardService.findHighestScoredCard(matchingCards);
}
else if (matchingCards.size() == 1) {
pickedCard = matchingCards.iterator().next();
}
return pickedCard;
}
private Card playHardLevel(TableStateDTO tableState) {
Card pickedCard = null;
Set<Card> computerCards = tableState.getComputerCards();
List<Card> faceUpCards = tableState.getFaceUpCards();
// check if computer has a card with rank JACK
Card jack = computerCards.stream()
.filter(card-> card.getRank().equals(JACK))
.findFirst().orElse(null);
if (faceUpCards.size() == 0) {
// do not pick a card whose rank is JACK
if (jack != null) {
Set<Card> cardSet = new HashSet<>(computerCards);
cardSet.remove(jack);
if (!cardSet.isEmpty()) {
pickedCard = cardService.getRandomCard(cardSet);
} else {
// computer has just one card, then throw it anyway
pickedCard = jack;
}
}
} else {
// there are cards in the center of table
Card lastCardOnMiddle = faceUpCards.get(faceUpCards.size() - 1);
// choose the card whose rank is JACK if computer has one
if (faceUpCards.size() == 1) {
if (jack != null && lastCardOnMiddle.getRank().equals(JACK)) {
// choose the card whose rank is JACK if computer has one
pickedCard = jack;
} else {
// find the matching card with highest point yield if any
pickedCard = findMatchingCardWithHighestPoint(lastCardOnMiddle, computerCards);
}
} else {
//there are more than one cards at center
// try to find the matching card with highest point yield if any
pickedCard = findMatchingCardWithHighestPoint(lastCardOnMiddle, computerCards);
}
}
if (pickedCard == null && jack != null) {
pickedCard = jack;
}
if (pickedCard == null ) {
pickedCard = cardService.getRandomCard(computerCards);
}
return pickedCard;
}
}
| 41.299107 | 136 | 0.621879 |
203455e2116dd970386836d3bee5ff7b0c4860e9
| 2,184 |
/**
* Amazon Kinesis Aggregators
*
* Copyright 2014, Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Amazon Software License (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/asl/
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.kinesis.aggregators;
import java.util.HashSet;
import java.util.Set;
public class TableKeyStructure {
private String labelAttributeName, labelAttributeValue, dateAttributeName;
private Set<String> dateValues;
public TableKeyStructure() {
}
public TableKeyStructure(String labelAttributeName, String labelAttributeValue,
String dateAttributeName) {
this.labelAttributeName = labelAttributeName;
this.labelAttributeValue = labelAttributeValue;
this.dateAttributeName = dateAttributeName;
}
public TableKeyStructure(String labelAttributeName, String labelAttributeValue,
String dateAttributeName, String dateAttributeValue) {
this.labelAttributeName = labelAttributeName;
this.labelAttributeValue = labelAttributeValue;
this.dateAttributeName = dateAttributeName;
this.dateValues = new HashSet<>();
this.dateValues.add(dateAttributeValue);
}
public TableKeyStructure withDateValue(String dateValue) {
if (this.dateValues == null) {
this.dateValues = new HashSet<>();
}
this.dateValues.add(dateValue);
return this;
}
public String getLabelAttributeName() {
return this.labelAttributeName;
}
public String getLabelAttributeValue() {
return this.labelAttributeValue;
}
public String getDateAttributeName() {
return this.dateAttributeName;
}
public Set<String> getDateValues() {
return this.dateValues;
}
}
| 31.2 | 83 | 0.707418 |
1a9ba0591bd24a9ade437c53a5fc010155684b22
| 6,303 |
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.lang.ant.config.impl;
import com.intellij.ide.macro.MacroManager;
import com.intellij.lang.ant.AntBundle;
import com.intellij.lang.ant.config.AntBuildFile;
import com.intellij.lang.ant.config.AntBuildTarget;
import com.intellij.lang.ant.config.AntConfiguration;
import com.intellij.openapi.application.PathManager;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.projectRoots.ProjectJdkTable;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.util.config.*;
import com.intellij.util.containers.ContainerUtil;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.util.ArrayList;
import java.util.Map;
@State(name = "GlobalAntConfiguration", storages = @Storage("other.xml"))
public class GlobalAntConfiguration implements PersistentStateComponent<Element> {
private static final Logger LOG = Logger.getInstance(GlobalAntConfiguration.class);
public static final StorageProperty FILTERS_TABLE_LAYOUT = new StorageProperty("filtersTableLayout");
public static final StorageProperty PROPERTIES_TABLE_LAYOUT = new StorageProperty("propertiesTableLayout");
static final ListProperty<AntInstallation> ANTS = ListProperty.create("registeredAnts");
private final ExternalizablePropertyContainer myProperties = new ExternalizablePropertyContainer();
private final AntInstallation myBundledAnt;
public final Condition<AntInstallation> IS_USER_ANT = new Condition<AntInstallation>() {
@Override
public boolean value(AntInstallation antInstallation) {
return antInstallation != myBundledAnt;
}
};
public static final AbstractProperty<GlobalAntConfiguration> INSTANCE = new ValueProperty<>(
"$GlobalAntConfiguration.INSTANCE", null);
@NonNls public static final String ANT_FILE = "ant";
@NonNls public static final String LIB_DIR = "lib";
@NonNls public static final String ANT_JAR_FILE_NAME = "ant.jar";
public GlobalAntConfiguration() {
myProperties.registerProperty(FILTERS_TABLE_LAYOUT);
myProperties.registerProperty(PROPERTIES_TABLE_LAYOUT);
myProperties.registerProperty(ANTS, ANT_FILE, AntInstallation.EXTERNALIZER);
INSTANCE.set(myProperties, this);
myProperties.rememberKey(INSTANCE);
myBundledAnt = createBundledAnt();
}
public static AntInstallation createBundledAnt() {
AntInstallation bundledAnt = new AntInstallation() {
@Override
public AntReference getReference() {
return AntReference.BUNDLED_ANT;
}
};
AntInstallation.NAME.set(bundledAnt.getProperties(), getBundledAntName());
final File antHome = PathManager.findFileInLibDirectory(ANT_FILE);
AntInstallation.HOME_DIR.set(bundledAnt.getProperties(), antHome.getAbsolutePath());
ArrayList<AntClasspathEntry> classpath = AntInstallation.CLASS_PATH.getModifiableList(bundledAnt.getProperties());
File antLibDir = new File(antHome, LIB_DIR);
classpath.add(new AllJarsUnderDirEntry(antLibDir));
bundledAnt.updateVersion(new File(antLibDir, ANT_JAR_FILE_NAME));
return bundledAnt;
}
@Nullable
@Override
public Element getState() {
Element element = new Element("state");
myProperties.writeExternal(element);
return element;
}
@Override
public void loadState(@NotNull Element state) {
myProperties.readExternal(state);
}
public static GlobalAntConfiguration getInstance() {
return ServiceManager.getService(GlobalAntConfiguration.class);
}
public Map<AntReference, AntInstallation> getConfiguredAnts() {
Map<AntReference, AntInstallation> map = ContainerUtil.newMapFromValues(ANTS.getIterator(getProperties()),
AntInstallation.REFERENCE_TO_ANT);
map.put(AntReference.BUNDLED_ANT, myBundledAnt);
return map;
}
public AntInstallation getBundledAnt() {
return myBundledAnt;
}
public AbstractProperty.AbstractPropertyContainer getProperties() {
return myProperties;
}
public void addConfiguration(final AntInstallation ant) {
if (getConfiguredAnts().containsKey(ant.getReference())) {
LOG.error("Duplicate name: " + ant.getName());
}
ANTS.getModifiableList(getProperties()).add(ant);
}
public void removeConfiguration(final AntInstallation ant) {
ANTS.getModifiableList(getProperties()).remove(ant);
}
public static Sdk findJdk(final String jdkName) {
return ProjectJdkTable.getInstance().findJdk(jdkName);
}
public static MacroManager getMacroManager() {
return MacroManager.getInstance();
}
public AntBuildTarget findTarget(Project project, String fileUrl, String targetName) {
if (fileUrl == null || targetName == null || project == null) {
return null;
}
final VirtualFile vFile = VirtualFileManager.getInstance().findFileByUrl(fileUrl);
if (vFile == null) {
return null;
}
final AntConfigurationImpl antConfiguration = (AntConfigurationImpl)AntConfiguration.getInstance(project);
for (AntBuildFile buildFile : antConfiguration.getBuildFileList()) {
if (vFile.equals(buildFile.getVirtualFile())) {
final AntBuildTarget target = buildFile.getModel().findTarget(targetName);
if (target != null) {
return target;
}
for (AntBuildTarget metaTarget : antConfiguration.getMetaTargets(buildFile)) {
if (targetName.equals(metaTarget.getName())) {
return metaTarget;
}
}
return null;
}
}
return null;
}
public static String getBundledAntName() {
return AntBundle.message("ant.reference.bundled.ant.name");
}
}
| 38.907407 | 140 | 0.752499 |
52e271ddbb731275cecc5c421e46d3fd1b9720a7
| 916 |
package es.upm.miw.apaw_practice.adapters.rest.FurnitureFactory;
import es.upm.miw.apaw_practice.domain.models.FurnitureFactory.WarehouseAreaUpdating;
import es.upm.miw.apaw_practice.domain.services.FurnitureFactory.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping(WarehouseResource.WAREHOUSES)
public class WarehouseResource {
static final String WAREHOUSES = "/FurnitureFactory/warehouses";
private WarehouseService warehouseService;
@Autowired
public WarehouseResource(WarehouseService warehoueService) {
this.warehouseService = warehoueService;
}
@PatchMapping
public void updateArea(@RequestBody List<WarehouseAreaUpdating> warehouseAreaUpdatingList) {
this.warehouseService.updateArea(warehouseAreaUpdatingList);
}
}
| 31.586207 | 96 | 0.80786 |
f7adcf3dd4823014cc43e1f84763e744fddb8847
| 1,302 |
package com.prd.action;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import com.opensymphony.xwork2.ActionSupport;
/**
* 文件上传的action类
*
* @作者: 李富
* @邮箱:lifuzz@163.com
* @时间:2016年2月24日
*/
public class UploadAction extends ActionSupport {
private static final long serialVersionUID = -7389578813708898036L;
private File ppt;
private String pptContentType;
private String pptFileName;
public File getPpt() {
return ppt;
}
public void setPpt(File ppt) {
this.ppt = ppt;
}
public String getPptContentType() {
return pptContentType;
}
public void setPptContentType(String pptContentType) {
this.pptContentType = pptContentType;
}
public String getPptFileName() {
return pptFileName;
}
public void setPptFileName(String pptFileName) {
this.pptFileName = pptFileName;
}
@Override
public String execute() throws Exception {
String path = "D:\\var/mcc/image/" + pptFileName;
FileOutputStream out = new FileOutputStream(path);
FileInputStream in = new FileInputStream(ppt);
byte[] buf = new byte[1024];
int len = 0;
while((len = in.read(buf)) != -1){
out.write(buf, 0, len);
}
out.close();
in.close();
return SUCCESS;
}
}
| 20.34375 | 69 | 0.672043 |
5d33f1b0c732aea2e766533da356eb7a058e3af1
| 4,260 |
package lib.ui;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.TouchAction;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import lib.Platform;
import java.util.List;
import java.util.regex.Pattern;
public class MainPageObject {
protected AppiumDriver driver;
public MainPageObject(AppiumDriver driver) {
this.driver = driver;
}
public WebElement waitForElementPresent(String locator, String error_message, long timeoutInSeconds) {
By by = this.getLocatorByString(locator);
WebDriverWait wait = new WebDriverWait(driver, timeoutInSeconds);
wait.withMessage(error_message + "\n");
return wait.until(ExpectedConditions.presenceOfElementLocated(by));
}
public WebElement waitForElementAndClick(String locator, String error_message, long timeoutInSeconds) {
WebElement element = waitForElementPresent(locator, error_message, timeoutInSeconds);
element.click();
return element;
}
public WebElement waitForElementAndSendKeys(String locator, String value, String error_message, long timeoutInSeconds) {
WebElement element = waitForElementPresent(locator, error_message, timeoutInSeconds);
element.sendKeys(value);
return element;
}
public boolean waitForElementNotPresent(String locator, String error_message, long timeoutInSeconds) {
By by = this.getLocatorByString(locator);
WebDriverWait wait = new WebDriverWait(driver, timeoutInSeconds);
wait.withMessage(error_message + "\n");
return wait.until(ExpectedConditions.invisibilityOfElementLocated(by));
}
public WebElement waitForElementAndClear(String locator, String error_message, long timeoutInSeconds) {
WebElement element = waitForElementPresent(locator, error_message, timeoutInSeconds);
element.clear();
return element;
}
public void clickElementToTheRightUpperCorner(String locator, String error_message){
WebElement element = this.waitForElementPresent(locator + "/..", error_message, 5);
int right_x = element.getLocation().getX();
int upper_y = element.getLocation().getY();
int lower_y = upper_y + element.getSize().getHeight();
int middle_y = (upper_y + lower_y) / 2;
int width = element.getSize().width;
int point_to_click_x = (right_x + width) -3;
int point_to_click_y = middle_y;
TouchAction action = new TouchAction(driver);
action.tap(point_to_click_x, point_to_click_y).perform();
}
public void swipeElementToLeft(String locator, String error_message){
WebElement element = waitForElementPresent(locator, error_message, 10);
int left_x = element.getLocation().getX();
int right_x = left_x + element.getSize().getWidth();
int upper_y = element.getLocation().getY();
int lower_y = upper_y + element.getSize().getHeight();
int middle_y = (upper_y + lower_y) / 2;
TouchAction action = new TouchAction(driver);
action.press(right_x, middle_y);
action.waitAction(450);
if(Platform.getInstance().isAndroid()){
action.moveTo(left_x, middle_y);
} else{
int offset_x = (-1*element.getSize().getWidth());
action.moveTo(offset_x, 0);
}
action.release();
action.perform();
}
public int getAmountsOfElements(String locator){
By by = this.getLocatorByString(locator);
List elements = driver.findElements(by);
return elements.size();
}
private By getLocatorByString(String locator_with_type){
String[] explore_locator = locator_with_type.split(Pattern.quote(":"), 2);
String by_type = explore_locator[0];
String locator = explore_locator[1];
if (by_type.equals("xpath")){
return By.xpath(locator);
}
else if (by_type.equals("id")){
return By.id(locator);
}
else throw new IllegalArgumentException("Cannot get type of locator. Locator " + locator_with_type);
}
}
| 37.368421 | 124 | 0.686854 |
e11a17888b67128ef86f8f4710484d96bca56e4d
| 1,316 |
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.text.style;
public abstract class ReplacementSpan
extends android.text.style.MetricAffectingSpan
{
public ReplacementSpan() { throw new RuntimeException("Stub!"); }
public abstract int getSize(android.graphics.Paint paint, java.lang.CharSequence text, int start, int end, android.graphics.Paint.FontMetricsInt fm);
public abstract void draw(android.graphics.Canvas canvas, java.lang.CharSequence text, int start, int end, float x, int top, int y, int bottom, android.graphics.Paint paint);
public void updateMeasureState(android.text.TextPaint p) { throw new RuntimeException("Stub!"); }
public void updateDrawState(android.text.TextPaint ds) { throw new RuntimeException("Stub!"); }
}
| 48.740741 | 175 | 0.772796 |
135f0840cece27b815661e40a9d201a984da61c1
| 443,877 |
package python3;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.testng.Assert;
import org.testng.annotations.Test;
public class TestPyTorch extends TestASTConversion {
@Test
public void file1() {
String content = readFile("CPatMinerTest/PyTorch/tools/clang_format_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file2(){
// String content = readFile("CPatMinerTest/PyTorch/tools/clang_format_all.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file3(){
String content = readFile("CPatMinerTest/PyTorch/tools/clang_tidy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file4(){
String content = readFile("CPatMinerTest/PyTorch/tools/fast_nvcc/fast_nvcc.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file5(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/load_derivatives.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file6(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/gen_autograd.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file7(){
// String content = readFile("CPatMinerTest/PyTorch/tools/autograd/gen_python_functions.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file8(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/gen_autograd_functions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file9(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/gen_variable_factories.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file10(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file11(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/gen_variable_type.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file12(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file13(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/templates/annotated_fn_args.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file14(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/gen_trace_type.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file15(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/gen_annotated_fn_args.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file16(){
String content = readFile("CPatMinerTest/PyTorch/tools/autograd/nested_dict.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file17(){
String content = readFile("CPatMinerTest/PyTorch/tools/amd_build/build_amd.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file18(){
String content = readFile("CPatMinerTest/PyTorch/tools/setup_helpers/generate_code.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file19(){
String content = readFile("CPatMinerTest/PyTorch/tools/setup_helpers/env.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file20(){
String content = readFile("CPatMinerTest/PyTorch/tools/setup_helpers/gen.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file21(){
String content = readFile("CPatMinerTest/PyTorch/tools/setup_helpers/cmake.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file22(){
String content = readFile("CPatMinerTest/PyTorch/tools/setup_helpers/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file23(){
String content = readFile("CPatMinerTest/PyTorch/tools/setup_helpers/numpy_.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file24(){
String content = readFile("CPatMinerTest/PyTorch/tools/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file25(){
String content = readFile("CPatMinerTest/PyTorch/tools/shared/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file26(){
String content = readFile("CPatMinerTest/PyTorch/tools/shared/cwrap_common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file27(){
String content = readFile("CPatMinerTest/PyTorch/tools/shared/module_loader.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file28(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/selective_build/selector.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file29(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/selective_build/operator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file30(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/selective_build/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file31(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/gen.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file32(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/local.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file33(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/code_template.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file34(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file35(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/model.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file36(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file37(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/dispatcher.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file38(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/translate.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file39(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file40(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/native.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file41(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/types.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file42(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/cpp.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file43(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/autograd.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file44(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/python.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file45(){
String content = readFile("CPatMinerTest/PyTorch/tools/codegen/api/meta.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file46(){
String content = readFile("CPatMinerTest/PyTorch/tools/build_libtorch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file47(){
String content = readFile("CPatMinerTest/PyTorch/tools/jit/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file48(){
String content = readFile("CPatMinerTest/PyTorch/tools/jit/gen_unboxing_wrappers.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file49(){
String content = readFile("CPatMinerTest/PyTorch/tools/pyi/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file50(){
String content = readFile("CPatMinerTest/PyTorch/tools/pyi/gen_pyi.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file51(){
String content = readFile("CPatMinerTest/PyTorch/tools/generate_torch_version.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file52(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_analyzer/op_deps_processor.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file53(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_analyzer/gen_op_registration_allowlist.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file54(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/oss_coverage.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file55(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/util/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file56(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/util/setting.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file57(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/util/utils_init.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file58(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/util/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file59(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file60(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/oss/run.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file61(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/oss/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file62(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/oss/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file63(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/oss/cov_json.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file64(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/oss/init.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file65(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/summarize_jsons.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file66(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file67(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/parser/llvm_coverage_segment.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file68(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/parser/llvm_coverage_parser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file69(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/parser/gcov_coverage_parser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file70(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/parser/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file71(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/parser/coverage_record.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file72(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/gcc_coverage.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file73(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/clang_coverage.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file74(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file75(){
String content = readFile("CPatMinerTest/PyTorch/tools/code_coverage/package/tool/print_report.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file76(){
String content = readFile("CPatMinerTest/PyTorch/tools/download_mnist.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file77(){
String content = readFile("CPatMinerTest/PyTorch/tools/flake8_hook.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file78(){
String content = readFile("CPatMinerTest/PyTorch/tools/build_pytorch_libs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file79(){
String content = readFile("CPatMinerTest/PyTorch/tools/nightly.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file80(){
String content = readFile("CPatMinerTest/PyTorch/test/test_determination.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file81(){
String content = readFile("CPatMinerTest/PyTorch/test/test_dispatch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file82(){
String content = readFile("CPatMinerTest/PyTorch/test/test_linalg.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file83(){
String content = readFile("CPatMinerTest/PyTorch/test/module_a.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file84(){
String content = readFile("CPatMinerTest/PyTorch/test/test_mkldnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file85(){
String content = readFile("CPatMinerTest/PyTorch/test/test_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file86(){
String content = readFile("CPatMinerTest/PyTorch/test/test_sort_and_select.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file87(){
String content = readFile("CPatMinerTest/PyTorch/test/test_dataloader.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file88(){
String content = readFile("CPatMinerTest/PyTorch/test/test_static_runtime.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file89(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_extensions/setup.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file90(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_extensions/no_python_abi_suffix_test/setup.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file91(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_extensions/torch_test_cpp_extension/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file92(){
String content = readFile("CPatMinerTest/PyTorch/test/test_reductions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file93(){
String content = readFile("CPatMinerTest/PyTorch/test/test_pruning_op.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file94(){
String content = readFile("CPatMinerTest/PyTorch/test/test_package.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file95(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_legacy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file96(){
String content = readFile("CPatMinerTest/PyTorch/test/test_logging.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file97(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_disabled.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file98(){
String content = readFile("CPatMinerTest/PyTorch/test/test_tensorexpr.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file99(){
String content = readFile("CPatMinerTest/PyTorch/test/test_type_promotion.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file100(){
String content = readFile("CPatMinerTest/PyTorch/test/test_sparse.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file101(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_pytorch_onnx_caffe2.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file102(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/export_onnx_tests_filter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file103(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/emb_seq.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file104(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/super_resolution.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file105(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/word_language_model.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file106(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/squeezenet.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file107(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/lstm_flattening_result.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file108(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file109(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/dcgan.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file110(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/srresnet.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file111(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file112(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/mnist.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file113(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/model_defs/rnn_model_with_packed_sequence.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file114(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_pytorch_onnx_caffe2_quantized.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file115(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/debug_embed_params.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file116(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/pytorch_helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file117(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_verify.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file118(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_utility_funs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file119(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_operators.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file120(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_custom_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file121(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_pytorch_onnx_shape_inference.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file122(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/export_onnx_tests_generator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file123(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_models_onnxruntime.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file124(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_models.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file125(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_pytorch_onnx_onnxruntime.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file126(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/verify.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file127(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_onnx_opset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file128(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_pytorch_common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file129(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_onnx_common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file130(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_pytorch_helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file131(){
String content = readFile("CPatMinerTest/PyTorch/test/onnx/test_caffe2_common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file132(){
String content = readFile("CPatMinerTest/PyTorch/test/custom_operator/model.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file133(){
String content = readFile("CPatMinerTest/PyTorch/test/custom_operator/test_custom_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file134(){
String content = readFile("CPatMinerTest/PyTorch/test/custom_operator/test_custom_classes.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file135(){
String content = readFile("CPatMinerTest/PyTorch/test/test_namedtensor.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file136(){
String content = readFile("CPatMinerTest/PyTorch/test/test_mobile_optimizer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file137(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_api_parity/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file138(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_api_parity/parity_table_parser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file139(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_api_parity/functional_impl_check.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file140(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_api_parity/sample_functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file141(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_api_parity/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file142(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_api_parity/module_impl_check.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file143(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp_api_parity/sample_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file144(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/conftest.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file145(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_transparency.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file146(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_inplace.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file147(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_copy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file148(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file149(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_dependency.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file150(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_microbatch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file151(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file152(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/test_stash_pop.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file153(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/test_tracker.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file154(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/test_verify_skippables.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file155(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/test_portal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file156(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/test_leak.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file157(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/test_api.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file158(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/test_inspect_skip_layout.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file159(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/skip/test_gpipe.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file160(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_deferred_batch_norm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file161(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_worker.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file162(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_phony.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file163(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_bugs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file164(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_balance.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file165(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_pipe.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file166(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_pipeline.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file167(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_checkpoint.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file168(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/pipeline/sync/test_stream.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file169(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/test_distributed_spawn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file170(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/nn/jit/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file171(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/nn/jit/test_instantiator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file172(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/test_distributed_fork.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file173(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/test_jit_c10d.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file174(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/algorithms/ddp_comm_hooks/test_ddp_hooks.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file175(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/test_nccl.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file176(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/test_data_parallel.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file177(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/test_c10d_spawn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file178(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/test_c10d.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file179(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/rpc/test_tensorpipe_agent.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file180(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/rpc/test_process_group_agent.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file181(){
String content = readFile("CPatMinerTest/PyTorch/test/distributed/rpc/test_faulty_agent.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file182(){
String content = readFile("CPatMinerTest/PyTorch/test/type_hint_tests/tensor_copy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file183(){
String content = readFile("CPatMinerTest/PyTorch/test/type_hint_tests/size.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file184(){
String content = readFile("CPatMinerTest/PyTorch/test/type_hint_tests/namedtuple.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file185(){
String content = readFile("CPatMinerTest/PyTorch/test/type_hint_tests/torch_cuda_random.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file186(){
String content = readFile("CPatMinerTest/PyTorch/test/type_hint_tests/torch_optim.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file187(){
String content = readFile("CPatMinerTest/PyTorch/test/type_hint_tests/module_list.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file188(){
String content = readFile("CPatMinerTest/PyTorch/test/test_metal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file189(){
String content = readFile("CPatMinerTest/PyTorch/test/fx/quantization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file190(){
String content = readFile("CPatMinerTest/PyTorch/test/fx/named_tup.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file191(){
String content = readFile("CPatMinerTest/PyTorch/test/fx/test_fx_const_fold.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file192(){
String content = readFile("CPatMinerTest/PyTorch/test/test_namedtuple_return_api.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file193(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_cuda_fuser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file194(){
String content = readFile("CPatMinerTest/PyTorch/test/test_numba_integration.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file195(){
String content = readFile("CPatMinerTest/PyTorch/test/test_cpp_api_parity.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file196(){
String content = readFile("CPatMinerTest/PyTorch/test/elias.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file197(){
String content = readFile("CPatMinerTest/PyTorch/test/test_multiprocessing_spawn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file198(){
String content = readFile("CPatMinerTest/PyTorch/test/print_test_stats.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file199(){
String content = readFile("CPatMinerTest/PyTorch/test/test_multiprocessing.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file200(){
String content = readFile("CPatMinerTest/PyTorch/test/test_xnnpack_integration.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file201(){
String content = readFile("CPatMinerTest/PyTorch/test/test_bundled_inputs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file202(){
String content = readFile("CPatMinerTest/PyTorch/test/test_torch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file203(){
String content = readFile("CPatMinerTest/PyTorch/test/test_unary_ufuncs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file204(){
String content = readFile("CPatMinerTest/PyTorch/test/test_futures.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file205(){
String content = readFile("CPatMinerTest/PyTorch/test/benchmark_utils/test_benchmark_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file206(){
String content = readFile("CPatMinerTest/PyTorch/test/test_tensor_creation_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file207(){
String content = readFile("CPatMinerTest/PyTorch/test/test_bundled_images.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file208(){
String content = readFile("CPatMinerTest/PyTorch/test/optim/test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file209(){
String content = readFile("CPatMinerTest/PyTorch/test/test_optim.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file210(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_fuser_te.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file211(){
String content = readFile("CPatMinerTest/PyTorch/test/test_nn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file212(){
String content = readFile("CPatMinerTest/PyTorch/test/test_show_pickle.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file213(){
String content = readFile("CPatMinerTest/PyTorch/test/test_kernel_launch_checks.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file214(){
String content = readFile("CPatMinerTest/PyTorch/test/test_shape_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file215(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file216(){
String content = readFile("CPatMinerTest/PyTorch/test/custom_backend/test_custom_backend.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file217(){
String content = readFile("CPatMinerTest/PyTorch/test/custom_backend/backend.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file218(){
String content = readFile("CPatMinerTest/PyTorch/test/test_pytree.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file219(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_backward_compatibility.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file220(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_bias_correction.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file221(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_quantized_tensor.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file222(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_equalize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file223(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_fusion_passes.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file224(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_quantized_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file225(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_quantize_jit.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file226(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file227(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_qat_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file228(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_numeric_suite_fx.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file229(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_quantize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file230(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_quantize_fx.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file231(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_quantized_op.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file232(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_quantized_functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file233(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_numeric_suite.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file234(){
String content = readFile("CPatMinerTest/PyTorch/test/quantization/test_workflow_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file235(){
String content = readFile("CPatMinerTest/PyTorch/test/error_messages/storage.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file236(){
String content = readFile("CPatMinerTest/PyTorch/test/test_view_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file237(){
String content = readFile("CPatMinerTest/PyTorch/test/test_indexing.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file238(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_fuser_legacy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file239(){
String content = readFile("CPatMinerTest/PyTorch/test/test_cuda_primary_ctx.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file240(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_py3.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file241(){
String content = readFile("CPatMinerTest/PyTorch/test/test_quantization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file242(){
String content = readFile("CPatMinerTest/PyTorch/test/test_profiler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file243(){
String content = readFile("CPatMinerTest/PyTorch/test/test_type_info.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file244(){
String content = readFile("CPatMinerTest/PyTorch/test/simulate_nccl_errors.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file245(){
String content = readFile("CPatMinerTest/PyTorch/test/test_dataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file246(){
String content = readFile("CPatMinerTest/PyTorch/test/backward_compatibility/check_backward_compatibility.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file247(){
String content = readFile("CPatMinerTest/PyTorch/test/backward_compatibility/dump_all_function_schemas.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file248(){
String content = readFile("CPatMinerTest/PyTorch/test/mobile/custom_build/prepare_model.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file249(){
String content = readFile("CPatMinerTest/PyTorch/test/mobile/test_lite_script_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file250(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file251(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp/jit/tests_setup.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file252(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp/jit/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file253(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp/api/init_baseline.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file254(){
String content = readFile("CPatMinerTest/PyTorch/test/cpp/api/optim_baseline.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file255(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_builtins.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file256(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_onnx_export.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file257(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/_imported_class_test/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file258(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/_imported_class_test/very/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file259(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/_imported_class_test/very/very/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file260(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/_imported_class_test/very/very/nested.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file261(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/_imported_class_test/bar.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file262(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/_imported_class_test/foo.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file263(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_type_sharing.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file264(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_export_modes.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file265(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_logging.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file266(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_with.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file267(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_async.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file268(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_warn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file269(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_string_formatting.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file270(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file271(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_custom_operators.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file272(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_autodiff_subgraph_slicing.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file273(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_tracer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file274(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_data_parallel.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file275(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_recursive_script.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file276(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_unsupported_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file277(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_module_interface.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file278(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_complexity.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file279(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_profiler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file280(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_save_load.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file281(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_remove_mutation.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file282(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_hash.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file283(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_module_containers.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file284(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_models.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file285(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_freezing.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file286(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_slice.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file287(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_backends.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file288(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_torchbind.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file289(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_list_dict.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file290(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_python_ir.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file291(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_functional_blocks.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file292(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_isinstance.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file293(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_class_type.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file294(){
String content = readFile("CPatMinerTest/PyTorch/test/jit/test_enum.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file295(){
String content = readFile("CPatMinerTest/PyTorch/test/test_foreach.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file296(){
String content = readFile("CPatMinerTest/PyTorch/test/test_native_functions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file297(){
String content = readFile("CPatMinerTest/PyTorch/test/test_tensorboard.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file298(){
String content = readFile("CPatMinerTest/PyTorch/test/test_cuda.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file299(){
String content = readFile("CPatMinerTest/PyTorch/test/test_expecttest.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file300(){
String content = readFile("CPatMinerTest/PyTorch/test/scripts/cuda_memcheck_common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file301(){
String content = readFile("CPatMinerTest/PyTorch/test/scripts/run_cuda_memcheck.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file302(){
String content = readFile("CPatMinerTest/PyTorch/test/package_a/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file303(){
String content = readFile("CPatMinerTest/PyTorch/test/package_a/subpackage.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file304(){
// String content = readFile("CPatMinerTest/PyTorch/test/run_test.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file305(){
String content = readFile("CPatMinerTest/PyTorch/test/test_cpp_extensions_aot.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file306(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_string.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file307(){
String content = readFile("CPatMinerTest/PyTorch/test/test_vulkan.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file308(){
String content = readFile("CPatMinerTest/PyTorch/test/test_function_schema.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file309(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_fuser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file310(){
String content = readFile("CPatMinerTest/PyTorch/test/test_complex.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file311(){
String content = readFile("CPatMinerTest/PyTorch/test/test_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file312(){
String content = readFile("CPatMinerTest/PyTorch/test/test_fx_experimental.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file313(){
String content = readFile("CPatMinerTest/PyTorch/test/namespace_b/subpackage.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file314(){
String content = readFile("CPatMinerTest/PyTorch/test/test_binary_ufuncs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file315(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_simple.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file316(){
String content = readFile("CPatMinerTest/PyTorch/test/test_autograd.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file317(){
String content = readFile("CPatMinerTest/PyTorch/test/test_op_aliases.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file318(){
String content = readFile("CPatMinerTest/PyTorch/test/test_openmp.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file319(){
String content = readFile("CPatMinerTest/PyTorch/test/test_overrides.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file320(){
String content = readFile("CPatMinerTest/PyTorch/test/test_serialization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file321(){
String content = readFile("CPatMinerTest/PyTorch/test/test_jit_profiling.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file322(){
String content = readFile("CPatMinerTest/PyTorch/test/bottleneck_test/test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file323(){
String content = readFile("CPatMinerTest/PyTorch/test/bottleneck_test/test_args.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file324(){
String content = readFile("CPatMinerTest/PyTorch/test/bottleneck_test/test_cuda.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file325(){
String content = readFile("CPatMinerTest/PyTorch/test/test_cpp_extensions_jit.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file326(){
String content = readFile("CPatMinerTest/PyTorch/test/test_type_hints.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file327(){
String content = readFile("CPatMinerTest/PyTorch/test/test_spectral_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file328(){
String content = readFile("CPatMinerTest/PyTorch/test/test_functional_autograd_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file329(){
String content = readFile("CPatMinerTest/PyTorch/test/distributions/test_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file330(){
String content = readFile("CPatMinerTest/PyTorch/test/distributions/test_constraints.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file331(){
String content = readFile("CPatMinerTest/PyTorch/test/distributions/test_distributions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file332(){
String content = readFile("CPatMinerTest/PyTorch/test/distributions/test_transforms.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file333(){
String content = readFile("CPatMinerTest/PyTorch/test/test_throughput_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file334(){
String content = readFile("CPatMinerTest/PyTorch/test/test_vmap.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file335(){
String content = readFile("CPatMinerTest/PyTorch/test/test_fx.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file336(){
String content = readFile("CPatMinerTest/PyTorch/test/test_numpy_interop.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file337(){
String content = readFile("CPatMinerTest/PyTorch/test/expect/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file338(){
String content = readFile("CPatMinerTest/PyTorch/test/test_testing.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file339(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/core/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file340(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/core/nomnigraph/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file341(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/core/nomnigraph/op_gen.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file342(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/proto/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file343(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/filler_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file344(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/serialized_test/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file345(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/serialized_test/coverage.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file346(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/serialized_test/serialized_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file347(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/optimizer_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file348(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/muji.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file349(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/build.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file350(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/data_parallel_model_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file351(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/transformations_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file352(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/numa_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file353(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file354(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/benchmark_generator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file355(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/gradient_check_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file356(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/attention.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file357(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/task.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file358(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/convnet_benchmarks_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file359(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/compatibility.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file360(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/optimizer_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file361(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/fakefp16_transform_lib.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file362(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/optimizer_context.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file363(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/scope_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file364(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/python_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file365(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/hsm_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file366(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/pipeline_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file367(){
// String content = readFile("CPatMinerTest/PyTorch/caffe2/python/memonger.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file368(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/regularizer_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file369(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/parallel_workers_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file370(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/brew_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file371(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layer_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file372(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/pool_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file373(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/reshape_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file374(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/adam_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file375(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/copy_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file376(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/transform_ideep_net.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file377(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/expanddims_squeeze_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file378(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/spatial_bn_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file379(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/order_switch_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file380(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/dropout_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file381(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/test_ideep_net.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file382(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/channel_shuffle_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file383(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/blobs_queue_db_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file384(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/LRN_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file385(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/elementwise_sum_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file386(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/convfusion_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file387(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/softmax_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file388(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file389(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/transpose_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file390(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/fc_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file391(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/weightedsum_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file392(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/leaky_relu_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file393(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/concat_split_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file394(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/relu_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file395(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/conv_transpose_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file396(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/sigmoid_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file397(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/operator_fallback_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file398(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/moment_sgd_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file399(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/shape_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file400(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/conv_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file401(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep/pre_convert_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file402(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/model_device_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file403(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/net_printer_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file404(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/crf_predict.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file405(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/dataio.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file406(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mint/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file407(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mint/app.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file408(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/utils_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file409(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/schema_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file410(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/checkpoint.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file411(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/adaptive_weight.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file412(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/sampling_train.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file413(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/tags.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file414(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/build_index.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file415(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/bucket_weighted.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file416(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/batch_normalization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file417(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/merge_id_lists.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file418(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/homotopy_weight.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file419(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/sampling_trainable_mixin.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file420(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/last_n_window_collector.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file421(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/random_fourier_features.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file422(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/fc.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file423(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/concat.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file424(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/position_weighted.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file425(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/layer_normalization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file426(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/margin_rank_loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file427(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/batch_softmax_loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file428(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/add_bias.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file429(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/fc_without_bias.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file430(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/arc_cosine_feature_map.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file431(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/bpr_loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file432(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file433(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/batch_huber_loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file434(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/sparse_lookup.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file435(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/batch_sigmoid_cross_entropy_loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file436(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/semi_random_features.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file437(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/pairwise_similarity.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file438(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/blob_weighted_sum.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file439(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/batch_lr_loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file440(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/gather_record.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file441(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/feature_sparse_to_dense.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file442(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file443(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/select_record_by_context.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file444(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/split.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file445(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/label_smooth.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file446(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/reservoir_sampling.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file447(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/sparse_feature_hash.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file448(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/fc_with_bootstrap.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file449(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/dropout.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file450(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/conv.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file451(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/layers.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file452(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/sparse_dropout_with_replacement.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file453(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/batch_mse_loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file454(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/constant_weight.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file455(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layers/uniform_sampling.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file456(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/do_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file457(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/executor_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file458(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/gpu_context_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file459(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/executor_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file460(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/inference_lstm_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file461(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/blob_deallocation_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file462(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file463(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/fakefp16_transform_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file464(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test/python_protobuf_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file465(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/memonger_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file466(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/backend_cpp_rep.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file467(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/backend.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file468(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/error.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file469(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/bin/conversion.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file470(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/bin/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file471(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/tests/onnx_backend_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file472(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/tests/test_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file473(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/tests/helper_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file474(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/tests/ssa_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file475(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/tests/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file476(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/tests/conversion_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file477(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/tests/c2_ref_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file478(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/frontend.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file479(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file480(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file481(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/workspace.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file482(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/backend_rep.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file483(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/onnxifi.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file484(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/onnx/test_onnxifi.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file485(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/trt/test_pt_onnx_trt.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file486(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/trt/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file487(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/trt/transform.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file488(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/trt/test_trt.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file489(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/transformations.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file490(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/parallel_workers.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file491(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/hypothesis_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file492(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/sparse_to_dense_mask_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file493(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/crf.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file494(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_fp_exceptions_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file495(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/control_ops_grad_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file496(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/recurrent.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file497(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/sparse_to_dense_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file498(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/lazy_dyndep_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file499(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/regularizer_context.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file500(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/functional_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file501(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/lazy_dyndep.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file502(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/convert.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file503(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/control_ops_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file504(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/control.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file505(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/allcompare_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file506(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/timeout_guard.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file507(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modifier_context.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file508(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/workspace_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file509(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/lengths_reducer_fused_8bit_rowwise_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file510(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/storm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file511(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/matmul_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file512(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/rebatching_queue_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file513(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/moments_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file514(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/basic_rnn_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file515(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/listwise_l2r_operator_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file516(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/clip_tensor_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file517(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/merge_id_lists_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file518(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/softplus_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file519(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/flatten_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file520(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/reduction_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file521(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/ctc_greedy_decoder_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file522(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/bucketize_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file523(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/clip_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file524(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/spatial_bn_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file525(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/deform_conv_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file526(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/locally_connected_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file527(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sparse_gradient_checker_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file528(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/math_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file529(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/trigonometric_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file530(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/instance_norm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file531(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/emptysample_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file532(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/assert_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file533(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/hsm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file534(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/reduce_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file535(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/conftest.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file536(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/momentum_sgd_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file537(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/ensure_cpu_output_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file538(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/percentile_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file539(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/rms_norm_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file540(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/conditional_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file541(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/python_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file542(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/map_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file543(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/one_hot_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file544(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sinusoid_position_encoding_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file545(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/histogram_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file546(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/group_norm_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file547(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/pack_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file548(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/fc_operator_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file549(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/dropout_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file550(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/data_couple_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file551(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/top_k_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file552(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/wngrad_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file553(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/copy_rows_to_tensor_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file554(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/text_file_reader_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file555(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/floor_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file556(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/im2col_col2im_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file557(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/scale_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file558(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/stats_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file559(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/blobs_queue_db_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file560(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/load_save_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file561(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/learning_rate_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file562(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/elementwise_op_broadcast_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file563(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/recurrent_network_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file564(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/atomic_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file565(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/rmac_regions_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file566(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/pack_rnn_sequence_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file567(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/lengths_top_k_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file568(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/selu_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file569(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/depthwise_3x3_conv_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file570(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/expand_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file571(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/index_hash_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file572(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/lengths_reducer_fused_nbit_rowwise_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file573(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/hyperbolic_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file574(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/box_with_nms_limit_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file575(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sparse_lengths_sum_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file576(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/adagrad_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file577(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/pad_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file578(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/gru_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file579(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sparse_normalize_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file580(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/arg_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file581(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/learning_rate_adaption_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file582(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/gather_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file583(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/conv_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file584(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/elementwise_logical_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file585(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/quantile_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file586(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/segment_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file587(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/mkl_packed_fc_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file588(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/crf_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file589(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/adagrad_test_helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file590(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/adam_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file591(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/weight_scale_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file592(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/rnn_cell_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file593(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/recurrent_net_executor_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file594(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/copy_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file595(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file596(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/record_queue_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file597(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/index_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file598(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/elementwise_linear_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file599(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/mean_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file600(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/specialized_segment_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file601(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/transpose_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file602(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/weighted_multi_sample_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file603(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/self_binning_histogram_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file604(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/dense_vector_to_id_list_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file605(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/given_tensor_fill_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file606(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/checkpoint_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file607(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/batch_bucketize_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file608(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/batch_moments_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file609(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sparse_to_dense_mask_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file610(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/mkl_conv_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file611(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/pooling_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file612(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/piecewise_linear_transform_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file613(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/unique_uniform_fill_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file614(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/unsafe_coalesce_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file615(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/given_tensor_byte_string_to_uint8_fill_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file616(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/flexible_top_k_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file617(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/order_switch_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file618(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/mul_gradient_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file619(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/mpi_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file620(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sparse_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file621(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/weighted_sum_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file622(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/resize_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file623(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/negate_gradient_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file624(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/jsd_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file625(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/gather_ranges_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file626(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/concat_split_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file627(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/weighted_sample_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file628(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/filler_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file629(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/alias_with_name_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file630(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/find_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file631(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/fused_nbit_rowwise_test_helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file632(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/distance_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file633(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/batch_box_cox_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file634(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/activation_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file635(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sequence_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file636(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/square_root_divide_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file637(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/string_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file638(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/numpy_tile_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file639(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/cross_entropy_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file640(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/boolean_unmask_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file641(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/prepend_dim_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file642(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/upsample_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file643(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/ensure_clipped_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file644(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/length_split_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file645(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/thresholded_relu_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file646(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/lars_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file647(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/erf_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file648(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/channel_backprop_stats_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file649(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/conv_transpose_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file650(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/adadelta_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file651(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/reshape_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file652(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/video_input_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file653(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/mod_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file654(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/stats_put_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file655(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/boolean_mask_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file656(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/batch_sparse_to_dense_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file657(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/affine_channel_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file658(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/channel_shuffle_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file659(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/rank_loss_operator_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file660(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/detectron_keypoints.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file661(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/unique_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file662(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/image_input_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file663(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/partition_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file664(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/bbox_transform_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file665(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/lpnorm_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file666(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/rand_quantization_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file667(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/heatmap_max_keypoint_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file668(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sparse_lp_regularizer_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file669(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/leaky_relu_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file670(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/channel_stats_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file671(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/cosine_embedding_criterion_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file672(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/apmeter_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file673(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/lengths_tile_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file674(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/group_conv_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file675(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/sparse_dropout_with_replacement_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file676(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/fused_nbit_rowwise_conversion_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file677(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/ctc_beam_search_decoder_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file678(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/loss_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file679(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/counter_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file680(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/cast_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file681(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/cudnn_recurrent_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file682(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/lengths_pad_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file683(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/tile_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file684(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/utility_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file685(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/duplicate_operands_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file686(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/dataset_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file687(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/ngram_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file688(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/shape_inference_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file689(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/softmax_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file690(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/roi_align_rotated_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file691(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/glu_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file692(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/torch_integration_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file693(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/bisect_percentile_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file694(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/elementwise_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file695(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/rowwise_counter_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file696(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/enforce_finite_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file697(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/layer_norm_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file698(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/onnx_while_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file699(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/collect_and_distribute_fpn_rpn_proposals_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file700(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/rand_quantization_op_speed_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file701(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/async_net_barrier_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file702(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/integral_image_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file703(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/key_split_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file704(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/normalize_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file705(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/margin_ranking_criterion_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file706(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/feature_maps_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file707(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/operator_test/ceil_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file708(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/experiment_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file709(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/session.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file710(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/record_queue.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file711(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layer_model_instantiator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file712(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/rnn_cell.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file713(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/_import_c_extension.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file714(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file715(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/parallelize_bmuf_distributed_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file716(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/gru_cell.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file717(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/binarysize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file718(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/normalizer_context.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file719(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/core.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file720(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/fused_8bit_rowwise_conversion_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file721(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/queue_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file722(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor_constants.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file723(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/convnet_benchmarks.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file724(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/gradient_checker.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file725(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/shufflenet_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file726(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/imagenet_trainer_test_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file727(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/download.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file728(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file729(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/shufflenet.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file730(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/resnet.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file731(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/seq2seq/translate.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file732(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/seq2seq/seq2seq_beam_search_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file733(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/seq2seq/seq2seq_model_helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file734(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/seq2seq/seq2seq_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file735(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/seq2seq/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file736(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/seq2seq/seq2seq_model_helper_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file737(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/seq2seq/beam_search.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file738(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/seq2seq/train.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file739(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/__sym_init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file740(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/models/resnet_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file741(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/hypothesis_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file742(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/visualize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file743(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/docs/formatter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file744(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/docs/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file745(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/docs/parser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file746(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/docs/generator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file747(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/docs/github.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file748(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/checkpoint_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file749(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/cnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file750(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file751(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/control_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file752(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/embedding_generation_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file753(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/normalizer_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file754(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/db_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file755(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/core_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file756(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/fakelowp/init_shared_libs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file757(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/fakelowp/test_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file758(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/fakelowp/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file759(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/compute_norm_for_blobs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file760(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/gradient_clipping_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file761(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/initializers_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file762(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file763(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/compute_histogram_for_blobs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file764(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/get_entry_from_blobs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file765(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/parameter_sharing_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file766(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/compute_statistics_for_blobs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file767(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/initializers.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file768(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/gradient_clipping.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file769(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/get_entry_from_blobs_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file770(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/net_modifier.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file771(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/compute_statistics_for_blobs_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file772(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/compute_histogram_for_blobs_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file773(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/parameter_sharing.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file774(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/parameter_info.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file775(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/modeling/compute_norm_for_blobs_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file776(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/nomnigraph_transformations.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file777(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/dataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file778(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/text_file_reader.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file779(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/data_workers_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file780(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file781(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/db_file_reader.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file782(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/nomnigraph_transformations_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file783(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file784(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/net_builder.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file785(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/device_checker.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file786(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/rewrite_graph.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file787(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_concat_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file788(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_relu_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file789(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/rewrite_graph_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file790(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file791(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_conv_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file792(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_elementwise_add_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file793(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_elementwise_sum_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file794(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_speed_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file795(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_sbn_speed_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file796(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_copy_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file797(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_LRN_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file798(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_pool_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file799(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_fc_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file800(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_sigmoid_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file801(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_LRN_speed_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file802(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_pool_speed_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file803(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_sbn_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file804(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_fc_speed_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file805(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_fill_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file806(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/mkl/mkl_squeeze_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file807(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/context.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file808(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/caffe_translator_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file809(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/caffe_translator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file810(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file811(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/pipeline.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file812(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/task_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file813(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/muji_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file814(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/examples/lmdb_create_example.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file815(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/examples/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file816(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/examples/resnet50_trainer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file817(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/examples/imagenet_trainer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file818(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/examples/char_rnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file819(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/benchmarks/fused_rowwise_nbit_conversion_bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file820(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/benchmarks/sparse_lengths_sum_nbit_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file821(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/benchmarks/concat_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file822(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/benchmarks/sparse_normalize_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file823(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/cached_reader.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file824(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/net_builder_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file825(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/core_gradients_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file826(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/model_helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file827(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/optimizer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file828(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/model_helper_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file829(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/regularizer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file830(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/ideep_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file831(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/context_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file832(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layer_model_helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file833(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/numa_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file834(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/crf_viterbi_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file835(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/observer_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file836(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/tt_core_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file837(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/lstm_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file838(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/tt_core.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file839(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/nomnigraph_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file840(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/layer_parameter_sharing_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file841(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/workspace.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file842(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/net_drawer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file843(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/normalizer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file844(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/control_ops_grad.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file845(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/lengths_reducer_rowwise_8bit_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file846(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/extension_loader.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file847(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/lazy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file848(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/dataio_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file849(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/dyndep.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file850(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor/predictor_py_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file851(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor/predictor_exporter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file852(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor/serde.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file853(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor/mobile_exporter_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file854(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file855(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor/predictor_exporter_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file856(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor/predictor_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file857(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/predictor/mobile_exporter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file858(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/convert_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file859(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/toy_regression_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file860(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/elementwise_linear.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file861(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/fc.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file862(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/quantization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file863(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/algebra.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file864(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/tools.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file865(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/pooling.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file866(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file867(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/array_helpers.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file868(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/nonlinearity.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file869(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/train.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file870(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/control_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file871(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/dropout.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file872(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/conv.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file873(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/arg_scope.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file874(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/normalization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file875(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/helpers/db_input.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file876(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/data_workers.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file877(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/data_parallel_model.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file878(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/scope.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file879(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/hip_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file880(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/brew.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file881(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/net_printer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file882(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/rnn/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file883(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/rnn/rnn_cell_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file884(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/rnn/lstm_comparison.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file885(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/schema.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file886(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/nomnigraph.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file887(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/python/session_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file888(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/distributed/redis_store_handler_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file889(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/distributed/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file890(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/distributed/store_ops_test_util.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file891(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/distributed/file_store_handler_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file892(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/perfkernels/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file893(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/perfkernels/hp_emblookup_codegen.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file894(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/sparse_funhash_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file895(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/tt_pad_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file896(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/funhash_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file897(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/sparse_reshape_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file898(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file899(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/convnet_benchmarks.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file900(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/device_reduce_sum_bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file901(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/tt_contraction_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file902(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/SparseTransformer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file903(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/python/net_construct_bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file904(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/experiments/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file905(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file906(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/nnpack/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file907(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/nnpack/nnpack_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file908(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/warpctc/ctc_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file909(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/warpctc/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file910(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/nccl/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file911(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/nccl/nccl_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file912(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/checkpoint.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file913(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/meter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file914(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/compute_topk_accuracy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file915(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file916(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/caffe2_resnet50_default_param_update.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file917(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/explicit_resnet_forward.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file918(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/IN1k_resnet.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file919(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/IN1k_resnet_no_test_model.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file920(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/caffe2_resnet50_default_forward.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file921(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/gfs_IN1k.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file922(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file923(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/override_no_test_model_no_checkpoint.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file924(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/rendezvous_filestore.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file925(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/resnetdemo/explicit_resnet_param_update.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file926(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/AnyExp.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file927(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/module_map.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file928(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/output_generator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file929(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/AnyExpOnTerm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file930(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/ModuleRegister.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file931(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/playground/compute_loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file932(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/gloo/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file933(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/gloo/gloo_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file934(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file935(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_batchnorm_nnpi_fp16.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file936(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_batchmatmul_nnpi_fp16.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file937(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_sls_4bit_nnpi_fp16.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file938(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_layernorm_nnpi_fp16.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file939(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_int8_ops_nnpi.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file940(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_deq_swish_quant_nnpi.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file941(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_fc_nnpi_fp16.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file942(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_sls_8bit_nnpi_fp32.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file943(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_op_nnpi_fp16.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file944(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_sls_8bit_nnpi_fp16.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file945(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_int8_quant.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file946(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/fakelowp/test/test_fusions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file947(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/script/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file948(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/script/examples/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file949(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/prof/cuda_profile_ops_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file950(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/prof/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file951(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/tensorboard/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file952(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/tensorboard/tensorboard_exporter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file953(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/tensorboard/tensorboard_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file954(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/tensorboard/tensorboard.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file955(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/tensorboard/tensorboard_exporter_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file956(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/aten/gen_op.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file957(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/aten/aten_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file958(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/aten/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file959(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/aten/docs/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file960(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/contrib/aten/docs/sample.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file961(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file962(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/relu_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file963(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/compute_equalization_scale_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file964(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/batch_permutation_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file965(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/elementwise_add_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file966(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/fully_connected_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file967(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/pool_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file968(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/group_norm_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file969(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/dequantize_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file970(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/conv_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file971(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/fully_connected_fp16_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file972(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/resize_nearest_3d_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file973(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/conv_groupwise_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file974(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file975(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/resize_nearest_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file976(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/gather_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file977(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/channel_shuffle_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file978(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/batch_matmul_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file979(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/elementwise_sum_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file980(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/dnnlowp_test_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file981(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/fully_connected_dnnlowp_acc16_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file982(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/int8_gen_quant_params_min_max_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file983(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file984(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/tanh_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file985(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/elementwise_mul_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file986(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/conv_depthwise_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file987(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/int8_quant_scheme_blob_fill_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file988(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/observer_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file989(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/quantize_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file990(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/int8_gen_quant_params_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file991(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/fully_connected_rowwise_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file992(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/spatial_batch_norm_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file993(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/concat_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file994(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/conv_dnnlowp_acc16_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file995(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/lstm_unit_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file996(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/conv_groupwise_dnnlowp_acc16_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file997(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/sigmoid_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file998(){
String content = readFile("CPatMinerTest/PyTorch/caffe2/quantization/server/elementwise_linear_dnnlowp_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file999(){
String content = readFile("CPatMinerTest/PyTorch/torch/_storage_docs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1000(){
String content = readFile("CPatMinerTest/PyTorch/torch/csrc/jit/codegen/cuda/tools/stringify_file.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1001(){
String content = readFile("CPatMinerTest/PyTorch/torch/futures/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1002(){
String content = readFile("CPatMinerTest/PyTorch/torch/linalg/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1003(){
// String content = readFile("CPatMinerTest/PyTorch/torch/_jit_internal.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1004(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/parallel/parallel_apply.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1005(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/parallel/comm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1006(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/parallel/scatter_gather.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1007(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/parallel/replicate.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1008(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/parallel/_functions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1009(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/parallel/data_parallel.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1010(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/parallel/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1011(){
// String content = readFile("CPatMinerTest/PyTorch/torch/nn/parallel/distributed.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1012(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/qat/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1013(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/qat/modules/linear.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1014(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/qat/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1015(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/qat/modules/conv.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1016(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/common_types.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1017(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/_reference/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1018(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/_reference/modules/linear.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1019(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/_reference/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1020(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/dynamic/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1021(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/dynamic/modules/linear.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1022(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/dynamic/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1023(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/dynamic/modules/rnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1024(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1025(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1026(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/batchnorm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1027(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/functional_modules.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1028(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/linear.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1029(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1030(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/activation.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1031(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1032(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/conv.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1033(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/normalization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1034(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/quantized/modules/embedding_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1035(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/backends/thnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1036(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/backends/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1037(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1038(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/_reduction.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1039(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/spectral_norm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1040(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/convert_parameters.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1041(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/memory_format.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1042(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1043(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/weight_norm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1044(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/fusion.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1045(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/prune.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1046(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/rnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1047(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/utils/clip_grad.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1048(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/cpp.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1049(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/qat/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1050(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/qat/modules/conv_fused.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1051(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/qat/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1052(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/qat/modules/linear_relu.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1053(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/quantized/_reference/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1054(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/quantized/_reference/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1055(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/quantized/_reference/modules/linear_relu.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1056(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/quantized/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1057(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/quantized/modules/bn_relu.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1058(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/quantized/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1059(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/quantized/modules/conv_relu.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1060(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/quantized/modules/linear_relu.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1061(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1062(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/modules/fused.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1063(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/intrinsic/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1064(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1065(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/init.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1066(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/grad.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1067(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/upsampling.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1068(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/channelshuffle.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1069(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/instancenorm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1070(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/flatten.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1071(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/batchnorm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1072(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/linear.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1073(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/_functions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1074(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/pooling.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1075(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1076(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/distance.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1077(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/container.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1078(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/pixelshuffle.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1079(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/adaptive.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1080(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/loss.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1081(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/activation.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1082(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1083(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/transformer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1084(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/sparse.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1085(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1086(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/dropout.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1087(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/conv.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1088(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/lazy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1089(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/normalization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1090(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/rnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1091(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/padding.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1092(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/modules/fold.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1093(){
String content = readFile("CPatMinerTest/PyTorch/torch/nn/parameter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1094(){
String content = readFile("CPatMinerTest/PyTorch/torch/_autograd_functions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1095(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_opset7.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1096(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_caffe2.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1097(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_opset11.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1098(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_opset10.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1099(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_helper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1100(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_opset9.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1101(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1102(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_opset8.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1103(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1104(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_registry.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1105(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/operators.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1106(){
String content = readFile("CPatMinerTest/PyTorch/torch/onnx/symbolic_opset12.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1107(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1108(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/worker.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1109(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/phony.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1110(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/checkpoint.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1111(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/batchnorm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1112(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1113(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/copy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1114(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/stream.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1115(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/skip/portal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1116(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/skip/layout.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1117(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/skip/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1118(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/skip/tracker.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1119(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/skip/namespace.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1120(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/skip/skippable.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1121(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/_balance/profile.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1122(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/_balance/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1123(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/_balance/blockpartition.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1124(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/pipeline.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1125(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/microbatch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1126(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/dependency.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1127(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/pipeline/sync/pipe.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1128(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rendezvous.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1129(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/nn/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1130(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/nn/jit/instantiator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1131(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/nn/jit/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1132(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/nn/jit/templates/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1133(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/nn/jit/templates/remote_module_template.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1134(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/nn/api/remote_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1135(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/nn/api/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1136(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/autograd/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1137(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/distributed_c10d.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1138(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/constants.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1139(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/algorithms/ddp_comm_hooks/quantization_hooks.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1140(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/algorithms/ddp_comm_hooks/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1141(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/algorithms/ddp_comm_hooks/default_hooks.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1142(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/algorithms/ddp_comm_hooks/powerSGD_hook.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1143(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/algorithms/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1144(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/optim/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1145(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/optim/functional_adagrad.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1146(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/optim/optimizer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1147(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1148(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/launch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1149(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/benchmarks/benchmark_ddp_rpc.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1150(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/functions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1151(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/options.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1152(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/internal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1153(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/constants.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1154(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1155(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/_testing/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1156(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/_testing/faulty_agent_backend_registry.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1157(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/api.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1158(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/rref_proxy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1159(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1160(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/server_process_global_profiler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1161(){
// String content = readFile("CPatMinerTest/PyTorch/torch/distributed/rpc/backend_registry.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1162(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/anomaly_mode.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1163(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/_functions/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1164(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/_functions/tensor.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1165(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/_functions/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1166(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/forward_ad.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1167(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1168(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/variable.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1169(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1170(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/grad_mode.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1171(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/gradcheck.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1172(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/profiler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1173(){
String content = readFile("CPatMinerTest/PyTorch/torch/autograd/function.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1174(){
String content = readFile("CPatMinerTest/PyTorch/torch/_torch_docs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1175(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/graph_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1176(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/param_fetch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1177(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/fuser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1178(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/partitioner_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1179(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/shape_prop.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1180(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/rewriter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1181(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/const_fold.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1182(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/accelerator_partitioner.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1183(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1184(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/subgraph_creation_example.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1185(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/experimental/graph_manipulation.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1186(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/proxy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1187(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/graph.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1188(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1189(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/immutable_collections.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1190(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/symbolic_trace.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1191(){
String content = readFile("CPatMinerTest/PyTorch/torch/fx/node.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1192(){
String content = readFile("CPatMinerTest/PyTorch/torch/_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1193(){
String content = readFile("CPatMinerTest/PyTorch/torch/_utils_internal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1194(){
String content = readFile("CPatMinerTest/PyTorch/torch/quasirandom.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1195(){
String content = readFile("CPatMinerTest/PyTorch/torch/multiprocessing/queue.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1196(){
String content = readFile("CPatMinerTest/PyTorch/torch/multiprocessing/_atfork.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1197(){
String content = readFile("CPatMinerTest/PyTorch/torch/multiprocessing/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1198(){
String content = readFile("CPatMinerTest/PyTorch/torch/multiprocessing/spawn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1199(){
String content = readFile("CPatMinerTest/PyTorch/torch/multiprocessing/reductions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1200(){
String content = readFile("CPatMinerTest/PyTorch/torch/multiprocessing/pool.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1201(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/streams.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1202(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/error.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1203(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/comm.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1204(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/memory.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1205(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/nccl.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1206(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1207(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/random.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1208(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/amp/autocast_mode.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1209(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/amp/grad_scaler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1210(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/amp/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1211(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/sparse.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1212(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/nvtx.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1213(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/profiler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1214(){
String content = readFile("CPatMinerTest/PyTorch/torch/cuda/_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1215(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/cuda/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1216(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/quantized/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1217(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1218(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/mkl/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1219(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/xnnpack/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1220(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/mkldnn/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1221(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/_nnapi/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1222(){
// String content = readFile("CPatMinerTest/PyTorch/torch/backends/_nnapi/serializer.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1223(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/_nnapi/prepare.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1224(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/openmp/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1225(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/cudnn/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1226(){
String content = readFile("CPatMinerTest/PyTorch/torch/backends/cudnn/rnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1227(){
String content = readFile("CPatMinerTest/PyTorch/torch/_VF.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1228(){
String content = readFile("CPatMinerTest/PyTorch/torch/_tensor_docs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1229(){
String content = readFile("CPatMinerTest/PyTorch/torch/_six.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1230(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/lr_scheduler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1231(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/rmsprop.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1232(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/sparse_adam.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1233(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/rprop.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1234(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/sgd.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1235(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1236(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/adamax.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1237(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/adagrad.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1238(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/rmsprop.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1239(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/rprop.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1240(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/sgd.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1241(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1242(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/adamax.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1243(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/adamw.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1244(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/adam.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1245(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/asgd.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1246(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/_multi_tensor/adadelta.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1247(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/adamw.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1248(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/swa_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1249(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1250(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/lbfgs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1251(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/adam.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1252(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/optimizer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1253(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/asgd.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1254(){
String content = readFile("CPatMinerTest/PyTorch/torch/optim/adadelta.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1255(){
String content = readFile("CPatMinerTest/PyTorch/torch/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1256(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/_pytree.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1257(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1258(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/op_fuzzers/binary.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1259(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/op_fuzzers/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1260(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/op_fuzzers/spectral.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1261(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/op_fuzzers/unary.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1262(){
// String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/timer.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1263(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1264(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1265(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/fuzzer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1266(){
// String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/valgrind_wrapper/timer_interface.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1267(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/valgrind_wrapper/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1268(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/cpp_jit.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1269(){
// String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/compare.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1270(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/utils/_stubs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1271(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/op_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1272(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1273(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/simple_timeit.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1274(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/fuzzer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1275(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/end_to_end.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1276(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/blas_compare.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1277(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/blas_compare_setup.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1278(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/spectral_ops_fuzz_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1279(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/benchmark/examples/compare.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1280(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/hooks.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1281(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/_cpp_extension_versioner.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1282(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/checkpoint.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1283(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/show_pickle.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1284(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/file_baton.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1285(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/model_zoo.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1286(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/collect_env.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1287(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/throughput_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1288(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/dlpack.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1289(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/backcompat/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1290(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1291(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/hipify/version.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1292(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/hipify/cuda_to_hip_mappings.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1293(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/hipify/constants.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1294(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/hipify/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1295(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/hipify/hipify_python.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1296(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/bundled_inputs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1297(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/bottleneck/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1298(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/bottleneck/__main__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1299(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/mkldnn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1300(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/ffi/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1301(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/_pytorch_graph.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1302(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/_proto_graph.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1303(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1304(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/_embedding.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1305(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/_onnx_graph.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1306(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/summary.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1307(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/_convert_np.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1308(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/writer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1309(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/_caffe2_graph.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1310(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/tensorboard/_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1311(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/cpp_extension.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1312(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/_utils/fetch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1313(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/_utils/worker.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1314(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/_utils/collate.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1315(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/_utils/pin_memory.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1316(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/_utils/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1317(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/_utils/signal_handling.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1318(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/datasets/collatedataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1319(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/datasets/listdirfilesdataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1320(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/datasets/batchdataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1321(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/datasets/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1322(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/datasets/common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1323(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/datasets/loadfilesfromdiskdataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1324(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/datasets/samplerdataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1325(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1326(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/dataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1327(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/distributed.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1328(){
// String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/dataloader.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1329(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/data/sampler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1330(){
String content = readFile("CPatMinerTest/PyTorch/torch/utils/mobile_optimizer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1331(){
String content = readFile("CPatMinerTest/PyTorch/torch/overrides.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1332(){
String content = readFile("CPatMinerTest/PyTorch/torch/_namedtensor_internals.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1333(){
String content = readFile("CPatMinerTest/PyTorch/torch/types.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1334(){
String content = readFile("CPatMinerTest/PyTorch/torch/_linalg_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1335(){
String content = readFile("CPatMinerTest/PyTorch/torch/__config__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1336(){
String content = readFile("CPatMinerTest/PyTorch/torch/contrib/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1337(){
String content = readFile("CPatMinerTest/PyTorch/torch/contrib/_tensorboard_vis.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1338(){
String content = readFile("CPatMinerTest/PyTorch/torch/random.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1339(){
String content = readFile("CPatMinerTest/PyTorch/torch/hub.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1340(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/observer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1341(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fuse_modules.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1342(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/_learnable_fake_quantize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1343(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/quantization_mappings.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1344(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/_correct_bias.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1345(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/quantize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1346(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/fusion_patterns.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1347(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/qconfig_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1348(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/observed_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1349(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/quantize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1350(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/quantization_types.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1351(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1352(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1353(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/pattern_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1354(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/fuse.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1355(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fx/quantization_patterns.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1356(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/_numeric_suite.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1357(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/_equalize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1358(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fake_quantize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1359(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/qconfig.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1360(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1361(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/stubs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1362(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1363(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/fuser_method_mappings.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1364(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/quantize_jit.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1365(){
// String content = readFile("CPatMinerTest/PyTorch/torch/quantization/quant_type.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1366(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/quantize_fx.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1367(){
String content = readFile("CPatMinerTest/PyTorch/torch/quantization/_numeric_suite_fx.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1368(){
String content = readFile("CPatMinerTest/PyTorch/torch/_tensor_str.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1369(){
String content = readFile("CPatMinerTest/PyTorch/torch/tensor.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1370(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/generated/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1371(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/test_module/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1372(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/test_module/future_div.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1373(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/test_module/no_future_div.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1374(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_nn.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1375(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/autocast_test_lists.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1376(){
// String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/ddp_under_dist_autograd_test.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1377(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/pipeline/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1378(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/pipeline/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1379(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/nn/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1380(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/nn/api/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1381(){
// String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/nn/api/remote_module_test.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1382(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1383(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/pipe_with_ddp_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1384(){
// String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/faulty_rpc_agent_test_fixture.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1385(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1386(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/dist_autograd_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1387(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/rpc_agent_test_fixture.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1388(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/tensorpipe_rpc_agent_test_fixture.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1389(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/jit/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1390(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/jit/dist_autograd_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1391(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/jit/rpc_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1392(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/jit/rpc_test_faulty.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1393(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/examples/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1394(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/examples/parameter_server_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1395(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/process_group_agent_test_fixture.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1396(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/rpc_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1397(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc/dist_optimizer_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1398(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/distributed_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1399(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/distributed/rpc_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1400(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_device_type.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1401(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/te_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1402(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_distributed.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1403(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1404(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_methods_invocations.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1405(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/expecttest.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1406(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/codegen/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1407(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/codegen/random_topo_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1408(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/hypothesis_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1409(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_cuda.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1410(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_quantization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1411(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_jit.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1412(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/jit_metaprogramming_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1413(){
// String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_utils.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1414(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/data/network1.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1415(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/data/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1416(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/data/network2.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1417(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/common_quantized.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1418(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/dist_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1419(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/_internal/jit_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1420(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1421(){
String content = readFile("CPatMinerTest/PyTorch/torch/testing/check_kernel_launches.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1422(){
// String content = readFile("CPatMinerTest/PyTorch/torch/_vmap_internals.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1423(){
String content = readFile("CPatMinerTest/PyTorch/torch/functional.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1424(){
String content = readFile("CPatMinerTest/PyTorch/torch/_lowrank.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1425(){
String content = readFile("CPatMinerTest/PyTorch/torch/_appdirs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1426(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_recursive.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1427(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_logging.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1428(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_serialization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1429(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/quantized.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1430(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_script.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1431(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_freeze.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1432(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_pickle.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1433(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/unsupported_tensor_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1434(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/frontend.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1435(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/supported_ops.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1436(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1437(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_fuser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1438(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_builtins.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1439(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_trace.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1440(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_state.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1441(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/mobile/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1442(){
String content = readFile("CPatMinerTest/PyTorch/torch/jit/_async.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1443(){
// String content = readFile("CPatMinerTest/PyTorch/torch/jit/annotations.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1444(){
String content = readFile("CPatMinerTest/PyTorch/torch/storage.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1445(){
String content = readFile("CPatMinerTest/PyTorch/torch/_lobpcg.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1446(){
String content = readFile("CPatMinerTest/PyTorch/torch/fft/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1447(){
String content = readFile("CPatMinerTest/PyTorch/torch/__future__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1448(){
String content = readFile("CPatMinerTest/PyTorch/torch/profiler/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1449(){
String content = readFile("CPatMinerTest/PyTorch/torch/profiler/profiler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1450(){
String content = readFile("CPatMinerTest/PyTorch/torch/sparse/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1451(){
String content = readFile("CPatMinerTest/PyTorch/torch/for_onnx/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1452(){
String content = readFile("CPatMinerTest/PyTorch/torch/_classes.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1453(){
String content = readFile("CPatMinerTest/PyTorch/torch/serialization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1454(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/laplace.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1455(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/relaxed_bernoulli.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1456(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/categorical.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1457(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/transforms.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1458(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/dirichlet.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1459(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/log_normal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1460(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/transformed_distribution.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1461(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/geometric.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1462(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/weibull.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1463(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/studentT.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1464(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/multivariate_normal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1465(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/normal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1466(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/poisson.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1467(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/beta.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1468(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/kumaraswamy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1469(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/half_normal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1470(){
// String content = readFile("CPatMinerTest/PyTorch/torch/distributions/relaxed_categorical.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1471(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/lowrank_multivariate_normal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1472(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/half_cauchy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1473(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1474(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/lkj_cholesky.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1475(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/independent.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1476(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/multinomial.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1477(){
// String content = readFile("CPatMinerTest/PyTorch/torch/distributions/exponential.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1478(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/pareto.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1479(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/negative_binomial.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1480(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/cauchy.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1481(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/von_mises.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1482(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/distribution.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1483(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/gumbel.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1484(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/constraint_registry.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1485(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1486(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/kl.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1487(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/mixture_same_family.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1488(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/continuous_bernoulli.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1489(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/fishersnedecor.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1490(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/constraints.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1491(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/uniform.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1492(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/bernoulli.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1493(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/exp_family.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1494(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/logistic_normal.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1495(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/one_hot_categorical.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1496(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/gamma.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1497(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/chi2.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1498(){
String content = readFile("CPatMinerTest/PyTorch/torch/distributions/binomial.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1499(){
String content = readFile("CPatMinerTest/PyTorch/torch/package/_mock_zipreader.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1500(){
String content = readFile("CPatMinerTest/PyTorch/torch/package/_mock.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1501(){
String content = readFile("CPatMinerTest/PyTorch/torch/package/importer.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1502(){
String content = readFile("CPatMinerTest/PyTorch/torch/package/exporter.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1503(){
String content = readFile("CPatMinerTest/PyTorch/torch/package/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1504(){
String content = readFile("CPatMinerTest/PyTorch/torch/package/find_file_dependencies.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1505(){
String content = readFile("CPatMinerTest/PyTorch/torch/package/_importlib.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1506(){
String content = readFile("CPatMinerTest/PyTorch/torch/package/_custom_import_pickler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1507(){
String content = readFile("CPatMinerTest/PyTorch/torch/_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1508(){
String content = readFile("CPatMinerTest/PyTorch/docs/caffe2/process.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1509(){
String content = readFile("CPatMinerTest/PyTorch/docs/source/conf.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1510(){
String content = readFile("CPatMinerTest/PyTorch/docs/source/scripts/build_activation_images.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1511(){
String content = readFile("CPatMinerTest/PyTorch/docs/cpp/source/conf.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1512(){
String content = readFile("CPatMinerTest/PyTorch/ios/TestApp/benchmark/trace_model.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1513(){
String content = readFile("CPatMinerTest/PyTorch/ios/TestApp/custom_build/custom_build.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1514(){
String content = readFile("CPatMinerTest/PyTorch/setup.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1515(){
String content = readFile("CPatMinerTest/PyTorch/binaries/bench_gen/bench_gen.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1516(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/upload_scribe.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1517(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/overrides_benchmark/pyspybench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1518(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/overrides_benchmark/bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1519(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/overrides_benchmark/common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1520(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/framework_overhead_benchmark/C2Module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1521(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/framework_overhead_benchmark/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1522(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/framework_overhead_benchmark/SimpleAddModule.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1523(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/framework_overhead_benchmark/framework_overhead_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1524(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/framework_overhead_benchmark/pt_wrapper_module.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1525(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/test_bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1526(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/conftest.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1527(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/runner.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1528(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/fuser.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1529(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/custom_lstms.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1530(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/profile.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1531(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1532(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1533(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/scratch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1534(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/factory.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1535(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1536(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/fastrnns/cells.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1537(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/distributed/pipeline/benchmark_dataset.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1538(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/distributed/pipeline/pipe.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1539(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/distributed/ddp/benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1540(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/distributed/ddp/diff.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1541(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/matmul.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1542(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/attention.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1543(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1544(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/rnn_eltwise.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1545(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/reduction.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1546(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/tensor_engine.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1547(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/pooling.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1548(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/elementwise.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1549(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/pt_engine.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1550(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/swish.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1551(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/conv.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1552(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/normalization.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1553(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/broadcast.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1554(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/softmax.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1555(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/tensorexpr/__main__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1556(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/serialization/simple_measurement.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1557(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/compare-fastrnn-results.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1558(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/functional_autograd_benchmark/torchaudio_models.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1559(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/functional_autograd_benchmark/vision_models.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1560(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/functional_autograd_benchmark/functional_autograd_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1561(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/functional_autograd_benchmark/torchvision_models.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1562(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/functional_autograd_benchmark/utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1563(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/functional_autograd_benchmark/ppl_models.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1564(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/functional_autograd_benchmark/audio_text_models.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1565(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/functional_autograd_benchmark/compare.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1566(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_test_generator.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1567(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt_extension/setup.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1568(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt_extension/cpp_extension_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1569(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_caffe2.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1570(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_pytorch.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1571(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_all_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1572(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/operator_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1573(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1574(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/tests/jit_forward_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1575(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/tests/pt_configs_list_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1576(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/tests/random_sample_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1577(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/tests/pt_cpu_gpu_forward_backward_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1578(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/tests/c2_cpu_gpu_forward_backward_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1579(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/tests/add_ops_list_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1580(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/tests/pt_backward_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1581(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1582(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/common/repeat_benchmark.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1583(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qlayernorm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1584(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/diag_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1585(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/embeddingbag_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1586(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qgroupnorm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1587(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qcat_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1588(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/quantization_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1589(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/as_strided_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1590(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/remainder_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1591(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/configs.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1592(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qbatchnorm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1593(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/add_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1594(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/unary_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1595(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qobserver_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1596(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/instancenorm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1597(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/fill_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1598(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qconv_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1599(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qunary_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1600(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/linear_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1601(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qactivation_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1602(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/conv_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1603(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/split_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1604(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1605(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/binary_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1606(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/cat_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1607(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/groupnorm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1608(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/layernorm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1609(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/hardsigmoid_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1610(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qtensor_method_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1611(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/chunk_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1612(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/sum_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1613(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/softmax_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1614(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/hardswish_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1615(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/batchnorm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1616(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/channel_shuffle_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1617(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/nan_to_num_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1618(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qinstancenorm_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1619(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qinterpolate_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1620(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qarithmetic_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1621(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qrnn_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1622(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/tensor_to_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1623(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qlinear_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1624(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qembedding_pack_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1625(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/clip_ranges_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1626(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/index_select_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1627(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qembedding_bag_lookups_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1628(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/matmul_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1629(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qcomparators_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1630(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qpool_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1631(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/gather_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1632(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/qembeddingbag_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1633(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/pt/pool_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1634(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_all_other_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1635(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_runner.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1636(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_utils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1637(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/c2/batch_gather_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1638(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/c2/add_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1639(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/c2/quantile_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1640(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/c2/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1641(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/c2/replace_nan_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1642(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/c2/batch_box_cox_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1643(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/c2/clip_ranges_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1644(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/c2/matmul_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1645(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_core.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1646(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/operator_benchmark/benchmark_all_quantized_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1647(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/record_function_benchmark/record_function_bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1648(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/sparse/matmul_dlmc_bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1649(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/profiler_benchmark/profiler_bench.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1650(){
String content = readFile("CPatMinerTest/PyTorch/benchmarks/profiler_benchmark/resnet_memory_profiler.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1651(){
String content = readFile("CPatMinerTest/PyTorch/android/test_app/make_assets_custom.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1652(){
String content = readFile("CPatMinerTest/PyTorch/android/test_app/make_assets.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1653(){
String content = readFile("CPatMinerTest/PyTorch/android/pytorch_android/generate_test_torchscripts.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1654(){
String content = readFile("CPatMinerTest/PyTorch/scripts/release_notes/test_release_notes.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1655(){
String content = readFile("CPatMinerTest/PyTorch/scripts/release_notes/common.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1656(){
String content = readFile("CPatMinerTest/PyTorch/scripts/release_notes/categorize.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1657(){
String content = readFile("CPatMinerTest/PyTorch/scripts/release_notes/commitlist.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1658(){
String content = readFile("CPatMinerTest/PyTorch/scripts/diagnose_protobuf.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1659(){
String content = readFile("CPatMinerTest/PyTorch/scripts/model_zoo/update-models-from-caffe2.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1660(){
String content = readFile("CPatMinerTest/PyTorch/scripts/model_zoo/update-caffe2-models.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1661(){
String content = readFile("CPatMinerTest/PyTorch/scripts/get_python_cmake_flags.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1662(){
String content = readFile("CPatMinerTest/PyTorch/aten/src/ATen/native/quantized/cpu/qnnpack/configure.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1663(){
String content = readFile("CPatMinerTest/PyTorch/aten/src/ATen/native/quantized/cpu/qnnpack/generate-wrapper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1664(){
String content = readFile("CPatMinerTest/PyTorch/aten/src/ATen/native/quantized/cpu/qnnpack/deps/clog/configure.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1665(){
String content = readFile("CPatMinerTest/PyTorch/aten/src/ATen/gen_vulkan_spv.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1666(){
String content = readFile("CPatMinerTest/PyTorch/aten/src/ATen/function_wrapper.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1667(){
String content = readFile("CPatMinerTest/PyTorch/aten/src/ATen/nnapi/codegen.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1668(){
String content = readFile("CPatMinerTest/PyTorch/aten/src/ATen/gen_vulkan_glsl.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1669(){
String content = readFile("CPatMinerTest/PyTorch/modules/detectron/upsample_nearest_op_test.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1670(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/ensure-consistency.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1671(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1672(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/lib/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1673(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/lib/conf_tree.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1674(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/lib/miniutils.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1675(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/lib/miniyaml.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1676(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/pytorch_build_data.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1677(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/binary_build_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1678(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/dimensions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1679(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1680(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/util/docker_constants.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1681(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/util/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1682(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/util/branch_filters.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1683(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/util/versions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1684(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/__init__.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1685(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/android_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1686(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/ge_config_tests.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1687(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/bazel_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1688(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/ios_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1689(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/macos_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1690(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/nightly_android.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1691(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/binary_smoketest.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1692(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/anaconda_prune_defintions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1693(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/mobile_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1694(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/nightly_ios.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1695(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/simple/docker_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1696(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/windows_build_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1697(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/pytorch_build_definitions.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1698(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/cimodel/data/binary_build_data.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
// @Test
// public void file1699(){
// String content = readFile("CPatMinerTest/PyTorch/.circleci/ecr_gc_docker/gc.py");
// CompilationUnit converted = convert(content);
// Assert.assertEquals(converted.getProblems().length,0);
// }
@Test
public void file1700(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/ecr_gc_docker/docker_hub.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1701(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/scripts/upload_binary_size_to_scuba.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1702(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/generate_config_yml.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1703(){
String content = readFile("CPatMinerTest/PyTorch/.circleci/codegen_validation/normalize_yaml_fragment.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1704(){
String content = readFile("CPatMinerTest/PyTorch/.jenkins/pytorch/perf_test/get_stats.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1705(){
String content = readFile("CPatMinerTest/PyTorch/.jenkins/pytorch/perf_test/compare_with_baseline.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1706(){
String content = readFile("CPatMinerTest/PyTorch/.jenkins/pytorch/perf_test/update_commit_hash.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1707(){
String content = readFile("CPatMinerTest/PyTorch/.jenkins/pytorch/win-test-helpers/run_python_nn_smoketests.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void file1708(){
String content = readFile("CPatMinerTest/PyTorch/.jenkins/pytorch/print_sccache_log.py");
CompilationUnit converted = convert(content);
Assert.assertEquals(converted.getProblems().length,0);
}
@Test
public void runAllTest(){}
}
| 43.2713 | 139 | 0.692455 |
94d53fb63fbdeba45ab0a4da46c1793a425b97d0
| 2,642 |
package com.epam.brest.summer.courses2019.dao;
import com.epam.brest.summer.courses2019.model.Rental;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import static org.junit.Assert.*;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:test-db.xml", "classpath*:test-dao.xml"})
@Transactional
@Rollback
public class RentalDaoJdbcImplTest {
@Autowired
RentalDao rentalDao;
@Test
public void findAll() {
List<Rental> rentals = rentalDao.findAll();
assertNotNull(rentalDao);
assertTrue(rentals.size() > 0);
}
@Test
public void findByCarId() {
List<Rental> rentals = rentalDao.findByCarId(1);
assertNotNull(rentalDao);
assertTrue(rentals.size() > 0);
}
@Test
public void findById() {
assertNotNull(rentalDao);
Rental rental = rentalDao.findById(1).get();
assertTrue(rental.getRentalId().equals(1));
assertTrue(rental.getRentalRate().equals("DAILY"));
}
@Test
public void add() {
List<Rental> rentals = rentalDao.findAll();
int sizeBefore = rentals.size();
Rental rental = new Rental("NEW", 1);
Rental newRental = rentalDao.add(rental);
assertNotNull(newRental.getRentalId());
assertTrue(newRental.getRentalRate().equals(rental.getRentalRate()));
assertTrue(newRental.getCarId().equals(rental.getCarId()));
assertTrue((sizeBefore + 1) == rentalDao.findAll().size());
}
@Test
public void update() {
Rental rental = rentalDao.findById(1).get();
rental.setRentalRate("MAIN");
rentalDao.update(rental);
Rental updatedRental = rentalDao.findById(rental.getRentalId()).get();
assertTrue(updatedRental.getRentalId().equals(rental.getRentalId()));
assertTrue(updatedRental.getRentalRate().equals(rental.getRentalRate()));
}
@Test
public void delete() {
Rental rental = new Rental("MAIN", 1);
rental.setRentalId(10);
rentalDao.add(rental);
List<Rental> rentals = rentalDao.findAll();
int sizeBefore = rentals.size();
rentalDao.delete(rental.getRentalId());
assertTrue((sizeBefore - 1) == rentalDao.findAll().size());
}
}
| 27.810526 | 88 | 0.674868 |
4ab0f12330f8f651ae8dfec0819c8989403f2076
| 303 |
package boosti.web.model;
import java.util.Collection;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder(setterPrefix = "with")
@NoArgsConstructor
@AllArgsConstructor
public class IdsData {
private Collection<Long> ids;
}
| 16.833333 | 33 | 0.80198 |
fcd53d61b71bbcff64314e0ddb60c36e80e1a7ae
| 119 |
class Test {
String foo() {
return new Wrapper("").getMyField();
}
void bar() {
String s = foo();
}
}
| 11.9 | 40 | 0.512605 |
25659f4f2aa34fa00479af298a03ce44ebd16f44
| 81 |
/**
* @author Ruben Zorgman
*
*/
package nl.tweeenveertig.seagull.exception;
| 11.571429 | 43 | 0.691358 |
bff87316b4f07bdd92e912cbfe3524c7c5da849f
| 5,234 |
/*******************************************************************************
* Copyright (c) 2014 Johannes Lerch.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* Contributors:
* Johannes Lerch - initial API and implementation
******************************************************************************/
package heros.fieldsens;
import heros.fieldsens.AccessPath.Delta;
import heros.fieldsens.AccessPath.PrefixTestResult;
import heros.fieldsens.structs.DeltaConstraint;
import heros.fieldsens.structs.WrappedFact;
import heros.fieldsens.structs.WrappedFactAtStatement;
public class CallEdge<Field, Fact, Stmt, Method> {
private WrappedFact<Field, Fact, Stmt, Method> calleeSourceFact;
private PerAccessPathMethodAnalyzer<Field, Fact, Stmt, Method> callerAnalyzer;
private WrappedFactAtStatement<Field, Fact, Stmt, Method> factAtCallSite;
public CallEdge(PerAccessPathMethodAnalyzer<Field, Fact, Stmt, Method> callerAnalyzer,
WrappedFactAtStatement<Field, Fact, Stmt, Method> factAtCallSite,
WrappedFact<Field, Fact, Stmt, Method> calleeSourceFact) {
this.callerAnalyzer = callerAnalyzer;
this.factAtCallSite = factAtCallSite;
this.calleeSourceFact = calleeSourceFact;
}
public WrappedFact<Field, Fact, Stmt, Method> getCalleeSourceFact() {
return calleeSourceFact;
}
public WrappedFact<Field, Fact, Stmt, Method> getCallerCallSiteFact() {
return factAtCallSite.getWrappedFact();
}
public WrappedFact<Field, Fact, Stmt, Method> getCallerSourceFact() {
return callerAnalyzer.wrappedSource();
}
public Stmt getCallSite() {
return factAtCallSite.getStatement();
}
public PerAccessPathMethodAnalyzer<Field, Fact, Stmt, Method> getCallerAnalyzer() {
return callerAnalyzer;
}
public void registerInterestCallback(final PerAccessPathMethodAnalyzer<Field, Fact, Stmt, Method> interestedAnalyzer) {
final Delta<Field> delta = calleeSourceFact.getAccessPath().getDeltaTo(interestedAnalyzer.getAccessPath());
if(!factAtCallSite.canDeltaBeApplied(delta))
return;
factAtCallSite.getWrappedFact().getResolver().resolve(new DeltaConstraint<Field>(delta), new InterestCallback<Field, Fact, Stmt, Method>() {
@Override
public void interest(PerAccessPathMethodAnalyzer<Field, Fact, Stmt, Method> analyzer, Resolver<Field, Fact, Stmt, Method> resolver) {
WrappedFact<Field, Fact, Stmt, Method> calleeSourceFactWithDelta = new WrappedFact<Field, Fact, Stmt, Method>(calleeSourceFact.getFact(), delta.applyTo(calleeSourceFact.getAccessPath()), resolver);
assert interestedAnalyzer.getAccessPath().isPrefixOf(calleeSourceFactWithDelta.getAccessPath()) == PrefixTestResult.GUARANTEED_PREFIX;
CallEdge<Field, Fact, Stmt, Method> newCallEdge = new CallEdge<Field, Fact, Stmt, Method>(analyzer,
new WrappedFactAtStatement<Field, Fact, Stmt, Method>(factAtCallSite.getStatement(),
new WrappedFact<Field, Fact, Stmt, Method>(factAtCallSite.getWrappedFact().getFact(),
delta.applyTo(factAtCallSite.getWrappedFact().getAccessPath()),
resolver)),
calleeSourceFactWithDelta);
if (resolver instanceof ZeroCallEdgeResolver) {
interestedAnalyzer.getCallEdgeResolver().incomingEdges.add(newCallEdge);
interestedAnalyzer.getCallEdgeResolver().interest(((ZeroCallEdgeResolver<Field, Fact, Stmt, Method>) resolver).copyWithAnalyzer(interestedAnalyzer));
interestedAnalyzer.getCallEdgeResolver().processIncomingGuaranteedPrefix(newCallEdge);
}
else
interestedAnalyzer.addIncomingEdge(newCallEdge);
}
@Override
public void canBeResolvedEmpty() {
callerAnalyzer.getCallEdgeResolver().resolve(new DeltaConstraint<Field>(delta), this);
}
});
}
@Override
public String toString() {
return "[IncEdge CSite:"+getCallSite()+", Caller-Edge: "+getCallerSourceFact()+"->"+getCallerCallSiteFact()+", CalleeFact: "+calleeSourceFact+"]";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((calleeSourceFact == null) ? 0 : calleeSourceFact.hashCode());
result = prime * result + ((callerAnalyzer == null) ? 0 : callerAnalyzer.hashCode());
result = prime * result + ((factAtCallSite == null) ? 0 : factAtCallSite.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CallEdge other = (CallEdge) obj;
if (calleeSourceFact == null) {
if (other.calleeSourceFact != null)
return false;
} else if (!calleeSourceFact.equals(other.calleeSourceFact))
return false;
if (callerAnalyzer == null) {
if (other.callerAnalyzer != null)
return false;
} else if (!callerAnalyzer.equals(other.callerAnalyzer))
return false;
if (factAtCallSite == null) {
if (other.factAtCallSite != null)
return false;
} else if (!factAtCallSite.equals(other.factAtCallSite))
return false;
return true;
}
}
| 39.353383 | 201 | 0.720481 |
e35da741199ae4bf881230adcd54eb60c2f7d6e5
| 1,933 |
package io.itch.activities;
import io.itch.ItchApp;
import io.itch.R;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import com.google.android.gms.analytics.HitBuilders;
import com.google.android.gms.analytics.Tracker;
abstract class BaseActivity extends Activity {
public View getEmptyView() {
View result = LayoutInflater.from(this).inflate(R.layout.activity_empty, null);
TextView message = (TextView) result.findViewById(R.id.textViewEmptyMessage);
if (message != null) {
message.setText(getEmptyViewMessageId());
}
return result;
}
public int getEmptyViewMessageId() {
return R.string.activity_empty_default;
}
@Override
protected void onStart() {
super.onStart();
Tracker t = ((ItchApp) this.getApplication()).getTracker();
t.setScreenName(getScreenPath());
t.send(new HitBuilders.AppViewBuilder().build());
}
protected ScrollPosition preserveScroll(ListView list) {
int index = list.getFirstVisiblePosition();
View v = list.getChildAt(0);
int top = (v == null) ? 0 : v.getTop();
return new ScrollPosition(index, top);
}
protected void restoreScroll(ListView list, ScrollPosition position) {
list.setSelectionFromTop(position.getIndex(), position.getTop());
}
protected abstract String getScreenPath();
protected static final class ScrollPosition {
private final Integer index;
private final Integer top;
private ScrollPosition(Integer index, Integer top) {
super();
this.index = index;
this.top = top;
}
public Integer getIndex() {
return index;
}
public Integer getTop() {
return top;
}
}
}
| 27.614286 | 87 | 0.648733 |
21250712d3acf7a9aa312463a7d8cb768c9de4fb
| 2,391 |
/*
* Copyright 2016 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.apps.forscience.whistlepunk.metadata;
import com.google.android.apps.forscience.whistlepunk.data.GoosciSensor;
import com.google.android.apps.forscience.whistlepunk.data.GoosciSensorLayout;
import java.util.ArrayList;
import java.util.List;
public class Run {
private final String mRunId;
private final int mRunIndex;
private String mTitle = "";
private boolean mArchived = false;
private List<GoosciSensorLayout.SensorLayout> mSensorLayouts;
private boolean mAutoZoomEnabled;
public Run(String runId, int runIndex, List<GoosciSensorLayout.SensorLayout> sensorLayouts,
boolean autoZoomEnabled) {
mRunId = runId;
mRunIndex = runIndex;
mSensorLayouts = sensorLayouts;
mAutoZoomEnabled = autoZoomEnabled;
}
public String getId() {
return mRunId;
}
public int getRunIndex() {
return mRunIndex;
}
public List<String> getSensorIds() {
List<String> result = new ArrayList<>();
for (GoosciSensorLayout.SensorLayout layout : mSensorLayouts) {
result.add(layout.sensorId);
}
return result;
}
public String getTitle() {
return mTitle;
}
public void setTitle(String title) {
mTitle = title;
}
public boolean isArchived() {
return mArchived;
}
public void setArchived(boolean archived) {
mArchived = archived;
}
public List<GoosciSensorLayout.SensorLayout> getSensorLayouts() {
return mSensorLayouts;
}
public boolean getAutoZoomEnabled() {
return mAutoZoomEnabled;
}
public void setAutoZoomEnabled(boolean enableAutoZoom) {
mAutoZoomEnabled = enableAutoZoom;
}
}
| 28.129412 | 95 | 0.68716 |
b0de5a808d993c7cca98e7eeb0c592bdab797688
| 1,693 |
package com.trading212.demo.samples;
import android.os.Bundle;
import android.widget.Toast;
import com.trading212.demo.BaseActivity;
import com.trading212.demo.item.DraggableRecyclerItem;
import com.trading212.diverserecycleradapter.DiverseRecyclerAdapter;
import com.trading212.diverserecycleradapter.drag.DragItemTouchHelperCallback;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Locale;
import androidx.recyclerview.widget.ItemTouchHelper;
/**
* Created by svetlin on 29.01.18.
*/
public class DragToReorderActivity extends BaseActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DragItemTouchHelperCallback dragHelperCallback = new DragItemTouchHelperCallback(getAdapter());
dragHelperCallback.setOnItemMoveListener(new DragItemTouchHelperCallback.OnItemMoveListener() {
@Override
public void onItemMoved(int fromPosition, int toPosition) {
String message = String.format(Locale.US, "Item moved from position %d to position %d", fromPosition, toPosition);
Toast.makeText(DragToReorderActivity.this, message, Toast.LENGTH_SHORT).show();
}
});
ItemTouchHelper dragHelper = new ItemTouchHelper(dragHelperCallback);
dragHelper.attachToRecyclerView(getRecyclerView());
}
@Override
public void fillElements(@NotNull DiverseRecyclerAdapter adapter) {
for (int i = 0; i < 50; i++) {
adapter.addItem(new DraggableRecyclerItem("Item " + i), false);
}
adapter.notifyDataSetChanged();
}
}
| 35.270833 | 130 | 0.7342 |
43b8c10895b8586e17fad5d839934eca8088430b
| 6,398 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.anywide.dawdler.server.thread.processor;
import java.nio.ByteBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.anywide.dawdler.core.bean.AuthRequestBean;
import com.anywide.dawdler.core.bean.AuthResponseBean;
import com.anywide.dawdler.core.bean.RequestBean;
import com.anywide.dawdler.core.bean.ResponseBean;
import com.anywide.dawdler.core.compression.strategy.CompressionWrapper;
import com.anywide.dawdler.core.compression.strategy.ThresholdCompressionStrategy;
import com.anywide.dawdler.core.exception.AuthFailedException;
import com.anywide.dawdler.core.handler.IoHandlerFactory;
import com.anywide.dawdler.core.net.buffer.PoolBuffer;
import com.anywide.dawdler.core.serializer.Serializer;
import com.anywide.dawdler.server.bean.ServicesBean;
import com.anywide.dawdler.server.bootstarp.ServerConnectionManager;
import com.anywide.dawdler.server.conf.ServerConfig;
import com.anywide.dawdler.server.context.DawdlerContext;
import com.anywide.dawdler.server.deploys.Service;
import com.anywide.dawdler.server.deploys.ServiceRoot;
import com.anywide.dawdler.server.filter.FilterProvider;
import com.anywide.dawdler.server.filter.RequestWrapper;
import com.anywide.dawdler.server.net.aio.session.SocketSession;
import com.anywide.dawdler.util.InvokeFuture;
/**
*
* @Title: DataProcessor.java
* @Description: 服务器端经过readhandler读取粘包数据的处理类
* @author: jackson.song
* @date: 2015年03月12日
* @version V1.0
* @email: suxuan696@gmail.com
*/
public class DataProcessor implements Runnable {
private SocketSession socketSession;
private boolean compress;
private Serializer serializer;
private byte[] datas;
private byte headData;
private static Logger logger = LoggerFactory.getLogger(DataProcessor.class);
public DataProcessor(SocketSession socketSession,byte headData,boolean compress,Serializer serializer,byte[] datas) {
this.socketSession=socketSession;
this.compress=compress;
this.serializer=serializer;
this.datas=datas;
this.headData=headData;
}
@Override
public void run() {
try {
process();
} catch (Exception e) {
socketSession.close();
logger.error("", e);
}
}
/* // in the future will dispatch for user operator
static AtomicInteger id = new AtomicInteger();*/
public void process() throws Exception{
String path = socketSession.getPath();
Service service = ServiceRoot.getService(path);
if (compress)
datas = ThresholdCompressionStrategy.staticSingle().decompress(datas);
Object obj = serializer.deserialize(datas);
IoHandlerFactory.getInstance().messageReceived(socketSession,obj);
if(obj instanceof RequestBean){
if(!socketSession.isAuthored()) throw new IllegalAccessException("unauthorized access !");
RequestBean requestBean = (RequestBean) obj;
String serviceName = requestBean.getServiceName();
ServicesBean servicesBean = null;
if(service!=null) {
servicesBean = service.getServiesBean(serviceName);
}
ResponseBean responseBean = new ResponseBean();
responseBean.setSeq(requestBean.getSeq());
InvokeFuture<?> invoke = new InvokeFuture<>();
socketSession.getFutures().put(requestBean.getSeq(),invoke);
try {
if(servicesBean!=null){
ServiceExecutor serviceExecutor = service.getServiceExecutor();
RequestWrapper requestWrapper = new RequestWrapper(requestBean, servicesBean,serviceExecutor);
service.getFilterProvider().doFilter(requestWrapper, responseBean);
}else{
responseBean.setCause(new ClassNotFoundException(serviceName+" in path :( "+path+" )"));
}
}finally {
DawdlerContext.remove();
socketSession.getFutures().remove(requestBean.getSeq());
}
datas = serializer.serialize(responseBean);
write();
}else if(obj instanceof AuthRequestBean) {
AuthRequestBean authRequest = (AuthRequestBean) obj;
AuthResponseBean authResponse = new AuthResponseBean();
ServerConfig serverConfig = socketSession.getDawdlerServerContext().getServerConfig();
boolean success = serverConfig.auth(authRequest.getPath(), authRequest.getUser(), authRequest.getPassword());
if(success) {
authResponse.setSuccess(true);
socketSession.setAuthored(true);
IoHandlerFactory.getInstance().channelOpen(socketSession);
ServerConnectionManager.getInstance().addSession(socketSession);
}else
// authResponse.setSuccess(false);
throw new AuthFailedException(socketSession.getRemoteAddress()+" auth failed!");
datas = serializer.serialize(authResponse);
write();
}
else throw new IllegalAccessException("Invalid request!"+obj.getClass().getName());
datas=null;
}
public void write() throws Exception {
CompressionWrapper cr = ThresholdCompressionStrategy.staticSingle().compress(datas);
datas = cr.getBuffer();
synchronized (socketSession) {
ByteBuffer bf = socketSession.getWriteBuffer();
int size = datas.length + 1;
int capacity = size+4;
PoolBuffer pb = null;
try {
if(capacity > SocketSession.CAPACITY) {
pb = PoolBuffer.selectPool(capacity);
if(pb==null) {
bf = ByteBuffer.allocate(capacity);
logger.warn("The serialized object is too large.\t size :"+capacity);
}else
bf = pb.getByteBuffer();
}
bf.putInt(size);
bf.put((byte)(cr.isCompressed()?headData|1:headData|0));
bf.put(datas);
bf.flip();
socketSession.write(bf);
}finally {
bf.clear();
if(pb != null) {
pb.release(bf);
}
}
}
}
}
| 39.012195 | 119 | 0.736324 |
d7352a0cb0eb1c06590f0eb1c1ecee52c583f010
| 2,450 |
/*
* Copyright © 2019 Mark Raynsford <code@io7m.com> https://www.io7m.com
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR
* BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
package com.io7m.smfj.tests;
import com.io7m.junreachable.UnreachableCodeException;
import com.io7m.smfj.core.SMFAttributeNames;
import com.io7m.smfj.core.SMFSchemaNames;
import com.io7m.smfj.core.SMFSupportedSizes;
import com.io7m.smfj.format.binary2.internal.SMFB2Alignment;
import com.io7m.smfj.format.text.SMFBase64Lines;
import java.lang.reflect.InvocationTargetException;
import java.util.stream.Stream;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DynamicTest;
import org.junit.jupiter.api.TestFactory;
public final class UnreachableTest
{
@TestFactory
public Stream<DynamicTest> testUnreachableConstructors()
{
return Stream.of(
SMFAttributeNames.class,
SMFSchemaNames.class,
SMFSupportedSizes.class,
SMFB2Alignment.class,
SMFBase64Lines.class
).map((Class<?> clazz) -> {
final String name = "test" + clazz.getCanonicalName();
return DynamicTest.dynamicTest(
name,
() -> callPrivateConstructor(clazz)
);
});
}
private static void callPrivateConstructor(final Class<?> clazz)
throws NoSuchMethodException, InstantiationException, IllegalAccessException
{
try {
final var constructor = clazz.getDeclaredConstructor();
constructor.setAccessible(true);
constructor.newInstance();
} catch (final NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException e) {
throw e;
} catch (final InvocationTargetException e) {
Assertions.assertEquals(UnreachableCodeException.class, e.getCause().getClass());
}
}
}
| 36.567164 | 142 | 0.751837 |
ecdc64fcd0c333a933dc96b567c437c536934d9d
| 7,815 |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package co.edu.uniandes.csw.incidentes.resources;
import co.edu.uniandes.csw.incidentes.dtos.IncidenteDTO;
import co.edu.uniandes.csw.incidentes.dtos.IncidenteDetailDTO;
import co.edu.uniandes.csw.incidentes.ejb.IncidenteLogic;
import co.edu.uniandes.csw.incidentes.ejb.TecnicoIncidenteLogic;
import co.edu.uniandes.csw.incidentes.entities.IncidenteEntity;
import co.edu.uniandes.csw.incidentes.exceptions.BusinessLogicException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
/**
*
* @author da.silvaa
*/
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class TecnicoIncidenteResource {
private static final Logger LOGGER = Logger.getLogger(TecnicoIncidenteResource.class.getName());
private static final String NOEXISTE="no existe";
@Inject
private IncidenteLogic incidenteLogic;
@Inject
private TecnicoIncidenteLogic tecnicoIncidenteLogic;
/**
* Guarda un incidente dentro de un coordinador con la informacion que recibe el
* la URL. Se devuelve el incidente que se guarda en el coordinador.
*
* @param coordinadorId Identificador del coordinador que se esta
* actualizando. Este debe ser una cadena de dígitos.
* @param incidenteId Identificador del incidente que se desea guardar. Este debe
* ser una cadena de dígitos.
* @return JSON {@link BookDTO} - El incidente guardado en el coordinador.
* @throws WebApplicationException {@link WebApplicationExceptionMapper} -
* Error de lógica que se genera cuando no se encuentra el incidente.
*/
@POST
@Path("{incidenteId: \\d+}")
public IncidenteDTO addIncidente(@PathParam("tecnicoId") Long tecnicoId, @PathParam("incidenteId") Long incidenteId) {
LOGGER.log(Level.INFO, "tecnicoIncidenteResource addIncidente: input: tecnicoId: {0} , incidenteId: {1}", new Object[]{tecnicoId, incidenteId});
if (incidenteLogic.getIncidente(incidenteId) == null) {
throw new WebApplicationException("El recurso /incidente/" + incidenteId + NOEXISTE, 404);
}
IncidenteDTO incidenteDTO = new IncidenteDTO(tecnicoIncidenteLogic.addIncidente(incidenteId, tecnicoId));
LOGGER.log(Level.INFO, "TecnicoIncidenteResource addIncidente: output: {0}", incidenteDTO);
return incidenteDTO;
}
/**
* Busca y devuelve todos los incidentes que existen en el coordinador.
*
* @param coordinadorId Identificador del coordinador que se esta buscando.
* Este debe ser una cadena de dígitos.
* @return JSONArray {@link IncidenteDetailDTO} - Los incidentes encontrados en el
* coordinador. Si no hay ninguno retorna una lista vacía.
*/
@GET
public List<IncidenteDetailDTO> getIncidentes(@PathParam("tecnicoId") Long tecnicoId) {
LOGGER.log(Level.INFO, "TecnicoIncidenteResource getIncidentes: input: {0}", tecnicoId);
List<IncidenteDetailDTO> listaDetailDTOs = incidentesListEntity2DTO(tecnicoIncidenteLogic.getIncidentes(tecnicoId));
LOGGER.log(Level.INFO, "TecnicoIncidenteResource getIncidentes: output: {0}", listaDetailDTOs);
return listaDetailDTOs;
}
/**
* Convierte una lista de IncidenteEntity a una lista de IncidenteDetailDTO.
*
* @param incidentes Lista de IncidenteEntity a convertir.
* @return Lista de IncidenteDTO convertida.
*/
private List<IncidenteDetailDTO> incidentesListEntity2DTO(List<IncidenteEntity> incidentes) {
List<IncidenteDetailDTO> list = new ArrayList();
for (IncidenteEntity entity : incidentes) {
list.add(new IncidenteDetailDTO(entity));
}
return list;
}
/**
* Busca el incidente con el id asociado dentro del coordinador con id asociado.
*
* @param coordinadorId Identificador del coordinador que se esta buscando.
* Este debe ser una cadena de dígitos.
* @param incidenteId Identificador del incidente que se esta buscando. Este debe
* ser una cadena de dígitos.
* @return JSON {@link IncidenteDetailDTO} - El incidente buscado
* @throws WebApplicationException {@link WebApplicationExceptionMapper} -
* Error de lógica que se genera cuando no se encuentra el incidente.
* @throws BusinessLogicException {@link BusinessLogicExceptionMapper} -
* Error de lógica que se genera cuando no se encuentra el incidente en el
* coordinador.
*/
@GET
@Path("{incidenteId: \\d+}")
public IncidenteDetailDTO getIncidente(@PathParam("tecnicoId") Long tecnicoId, @PathParam("incidenteId") Long incidenteId) throws BusinessLogicException {
LOGGER.log(Level.INFO, "TecnicoIncidenteResource getIncidente: input: editorialsID: {0} , booksId: {1}", new Object[]{tecnicoId, incidenteId});
if (incidenteLogic.getIncidente(incidenteId) == null) {
throw new WebApplicationException("El recurso /tecnico/" + tecnicoId + "/incidente/" + incidenteId + NOEXISTE, 404);
}
IncidenteDetailDTO incidenteDetailDTO = new IncidenteDetailDTO(tecnicoIncidenteLogic.getIncidente(tecnicoId, incidenteId));
LOGGER.log(Level.INFO, "TecnicoIncidenteResource getIncidente: output: {0}", incidenteDetailDTO);
return incidenteDetailDTO;
}
/**
* Remplaza las instancias de Incidente asociadas a una instancia de Coordinador
*
* @param coordinadorId Identificador del coordinador que se esta
* remplazando. Este debe ser una cadena de dígitos.
* @param incidentes JSONArray {@link IncidenteDetailDTO} El arreglo de incidentes nuevo para el
* coordinador.
* @return JSON {@link IncidenteDetailDTO} - El arreglo de incidentes guardado en el
* coordinador.
* @throws WebApplicationException {@link WebApplicationExceptionMapper} -
* Error de lógica que se genera cuando no se encuentra el incidente.
*/
@PUT
public List<IncidenteDetailDTO> replaceIncidentes(@PathParam("tecnicoId") Long tecnicoId, List<IncidenteDetailDTO> incidentes) {
LOGGER.log(Level.INFO, "tecnicoIncidenteResource replaceIncidentes: input: tecnicoId: {0} , incidentes: {1}", new Object[]{tecnicoId, incidentes});
for (IncidenteDetailDTO incidente : incidentes) {
if (incidenteLogic.getIncidente(incidente.getId()) == null) {
throw new WebApplicationException("El recurso /incidente/" + incidente.getId() + NOEXISTE, 404);
}
}
List<IncidenteDetailDTO> listaDetailDTOs = incidentesListEntity2DTO(tecnicoIncidenteLogic.replaceIncidentes(tecnicoId, incidentesListDTO2Entity(incidentes)));
LOGGER.log(Level.INFO, "TecnicoIncidenteResource replaceIncidentes: output: {0}", listaDetailDTOs);
return listaDetailDTOs;
}
/**
* Convierte una lista de IncidenteDetailDTO a una lista de IncidenteEntity.
*
* @param dtos Lista de IncidenteDetailDTO a convertir.
* @return Lista de IncidenteEntity convertida.
*/
private List<IncidenteEntity> incidentesListDTO2Entity(List<IncidenteDetailDTO> dtos) {
List<IncidenteEntity> list = new ArrayList<>();
for (IncidenteDetailDTO dto : dtos) {
list.add(dto.toEntity());
}
return list;
}
}
| 46.517857 | 166 | 0.71977 |
a1f76dfb6a6b84c68aa732b2288a07750cf9431b
| 1,175 |
package ru.spoddubnyak.models;
/**
* Class Cell describes the cell on the board.
*
* @author Sergei Poddubnyak (forvvard09@gmail.com)
* @version 1.0
* @since 14.03.2017
*/
public class Cell {
/**
* property - fugure.
*/
private Figure figure;
/**
* property - name position Cell.
*/
private String position;
/**
* Constructor it creates a new object with the specified values.
*
* @param position - name position Cell
*/
public Cell(String position) {
this.position = position;
}
/**
* Constructor it creates a new object with the specified values.
*/
public Cell() {
}
/**
* Geter get position.
*
* @return position
*/
public String getPosition() {
return this.position;
}
/**
* Geter get figure.
*
* @return figure
*/
public Figure getFigure() {
return figure;
}
/**
* Seter get figure.
*
* @param figure - figure
*/
public void setFigure(Figure figure) {
this.figure = figure;
}
}
| 19.262295 | 70 | 0.52 |
648e7a107933d7c9aa520c3e328e5307eb3301e1
| 208 |
package com.eventflit.android.notifications.interests;
/**
* Created by jamiepatel on 15/07/2016.
*/
// Interest subscription states.
public enum InterestSubscriptionChange {
SUBSCRIBE, UNSUBSCRIBE
}
| 18.909091 | 54 | 0.764423 |
5560de8739a01570b611939a197dc3f037dc1a8c
| 10,149 |
package com.pranavakp.parrotcraftcore.client.model;
import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import com.pranavakp.parrotcraftcore.util.entities.InfernoParrotEntity;
import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.entity.model.ParrotModel;
import net.minecraft.client.renderer.entity.model.SegmentedModel;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.ParrotEntity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
public class InfernoParrotModel<T extends InfernoParrotEntity> extends SegmentedModel<T> {
private final ModelRenderer head;
private final ModelRenderer feather;
private final ModelRenderer body;
private final ModelRenderer left_wing;
private final ModelRenderer left_wing_rotation;
private final ModelRenderer right_wing;
private final ModelRenderer right_wing_rotation;
private final ModelRenderer left_leg;
private final ModelRenderer right_leg;
private final ModelRenderer tail;
public InfernoParrotModel() {
textureWidth = 32;
textureHeight = 32;
head = new ModelRenderer(this);
head.setRotationPoint(0.0F, 16.0F, -0.5F);
head.setTextureOffset(2, 2).addBox(-1.0F, -1.5F, -1.0F, 2.0F, 3.0F, 2.0F, 0.0F, false);
head.setTextureOffset(10, 0).addBox(-1.0F, -2.5F, -3.0F, 2.0F, 1.0F, 4.0F, 0.0F, false);
head.setTextureOffset(11, 7).addBox(-0.5F, -1.5F, -2.0F, 1.0F, 2.0F, 1.0F, 0.0F, false);
head.setTextureOffset(16, 7).addBox(-0.5F, -1.75F, -2.95F, 1.0F, 2.0F, 1.0F, -0.01F, false);
feather = new ModelRenderer(this);
feather.setRotationPoint(0.0F, -1.5F, -2.0F);
head.addChild(feather);
setRotationAngle(feather, -0.2618F, 0.0F, 0.0F);
feather.setTextureOffset(2, 18).addBox(0.0F, -5.0F, 0.0F, 0.0F, 5.0F, 4.0F, 0.0F, false);
body = new ModelRenderer(this);
body.setRotationPoint(0.0F, 16.5F, -1.0F);
body.setTextureOffset(2, 8).addBox(-1.5F, 0.0F, -1.5F, 3.0F, 6.0F, 3.0F, 0.0F, false);
left_wing = new ModelRenderer(this);
left_wing.setRotationPoint(-1.5F, 16.9F, -0.8F);
left_wing_rotation = new ModelRenderer(this);
left_wing_rotation.setRotationPoint(3.0F, 2.5F, 0.0F);
left_wing.addChild(left_wing_rotation);
setRotationAngle(left_wing_rotation, 0.0F, 3.1416F, 0.0F);
left_wing_rotation.setTextureOffset(19, 8).addBox(-0.5F, -2.5F, -1.5F, 1.0F, 5.0F, 3.0F, 0.0F, false);
right_wing = new ModelRenderer(this);
right_wing.setRotationPoint(1.5F, 16.9F, -0.8F);
right_wing_rotation = new ModelRenderer(this);
right_wing_rotation.setRotationPoint(-3.0F, 2.5F, 0.0F);
right_wing.addChild(right_wing_rotation);
setRotationAngle(right_wing_rotation, 0.0F, 3.1416F, 0.0F);
right_wing_rotation.setTextureOffset(19, 8).addBox(-0.5F, -2.5F, -1.5F, 1.0F, 5.0F, 3.0F, 0.0F, false);
left_leg = new ModelRenderer(this);
left_leg.setRotationPoint(-1.0F, 22.0F, -1.0F);
left_leg.setTextureOffset(14, 18).addBox(-0.5F, 0.0F, -0.5F, 1.0F, 2.0F, 1.0F, 0.0F, false);
right_leg = new ModelRenderer(this);
right_leg.setRotationPoint(1.0F, 22.0F, -1.0F);
right_leg.setTextureOffset(14, 18).addBox(-0.5F, 0.0F, -0.5F, 1.0F, 2.0F, 1.0F, 0.0F, false);
tail = new ModelRenderer(this);
tail.setRotationPoint(0.0F, 21.1F, 1.2F);
tail.setTextureOffset(22, 1).addBox(-1.5F, -1.0F, -1.0F, 3.0F, 4.0F, 1.0F, 0.0F, false);
}
@Override
public void setRotationAngles(T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) {
this.setRotationAngles(getParrotState(entityIn), entityIn.ticksExisted, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
}
public Iterable<ModelRenderer> getParts() {
return ImmutableList.of(this.body, this.left_wing, this.right_wing, this.tail, this.head, this.left_leg, this.right_leg);
}
public void setLivingAnimations(ParrotEntity entityIn, float limbSwing, float limbSwingAmount, float partialTick) {
this.setLivingAnimations(getParrotState(entityIn));
}
public void renderOnShoulder(MatrixStack matrixStackIn, IVertexBuilder bufferIn, int packedLightIn, int packedOverlayIn, float p_228284_5_, float p_228284_6_, float p_228284_7_, float p_228284_8_, int p_228284_9_) {
this.setLivingAnimations(ParrotModel.State.ON_SHOULDER);
this.setRotationAngles(ParrotModel.State.ON_SHOULDER, p_228284_9_, p_228284_5_, p_228284_6_, 0.0F, p_228284_7_, p_228284_8_);
this.getParts().forEach((p_228285_4_) -> {
p_228285_4_.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn);
});
}
private void setRotationAngles(ParrotModel.State p_217162_1_, int p_217162_2_, float p_217162_3_, float p_217162_4_, float p_217162_5_, float p_217162_6_, float p_217162_7_) {
this.head.rotateAngleX = p_217162_7_ * ((float)Math.PI / 180F);
this.head.rotateAngleY = p_217162_6_ * ((float)Math.PI / 180F);
this.head.rotateAngleZ = 0.0F;
this.head.rotationPointX = 0.0F;
this.body.rotationPointX = 0.0F;
this.tail.rotationPointX = 0.0F;
this.right_wing.rotationPointX = -1.5F;
this.left_wing.rotationPointX = 1.5F;
switch(p_217162_1_) {
case SITTING:
break;
case PARTY:
float f = MathHelper.cos((float)p_217162_2_);
float f1 = MathHelper.sin((float)p_217162_2_);
this.head.rotationPointX = f;
this.head.rotationPointY = 15.69F + f1;
this.head.rotateAngleX = 0.0F;
this.head.rotateAngleY = 0.0F;
this.head.rotateAngleZ = MathHelper.sin((float)p_217162_2_) * 0.4F;
this.body.rotationPointX = f;
this.body.rotationPointY = 16.5F + f1;
this.left_wing.rotateAngleZ = -0.0873F - p_217162_5_;
this.left_wing.rotationPointX = 1.5F + f;
this.left_wing.rotationPointY = 16.94F + f1;
this.right_wing.rotateAngleZ = 0.0873F + p_217162_5_;
this.right_wing.rotationPointX = -1.5F + f;
this.right_wing.rotationPointY = 16.94F + f1;
this.tail.rotationPointX = f;
this.tail.rotationPointY = 21.07F + f1;
break;
case STANDING:
this.left_leg.rotateAngleX += MathHelper.cos(p_217162_3_ * 0.6662F) * 1.4F * p_217162_4_;
this.right_leg.rotateAngleX += MathHelper.cos(p_217162_3_ * 0.6662F + (float)Math.PI) * 1.4F * p_217162_4_;
case FLYING:
case ON_SHOULDER:
default:
float f2 = p_217162_5_ * 0.3F;
this.head.rotationPointY = 15.69F + f2;
this.tail.rotateAngleX = 1.015F + MathHelper.cos(p_217162_3_ * 0.6662F) * 0.3F * p_217162_4_;
this.tail.rotationPointY = 21.07F + f2;
this.body.rotationPointY = 16.5F + f2;
this.left_wing.rotateAngleZ = -0.0873F - p_217162_5_;
this.left_wing.rotationPointY = 16.94F + f2;
this.right_wing.rotateAngleZ = 0.0873F + p_217162_5_;
this.right_wing.rotationPointY = 16.94F + f2;
this.left_leg.rotationPointY = 22.0F + f2;
this.right_leg.rotationPointY = 22.0F + f2;
}
}
private void setLivingAnimations(ParrotModel.State p_217160_1_) {
this.feather.rotateAngleX = -0.2214F;
this.body.rotateAngleX = 0.4937F;
this.left_wing.rotateAngleX = -0.6981F;
this.left_wing.rotateAngleY = -(float)Math.PI;
this.right_wing.rotateAngleX = -0.6981F;
this.right_wing.rotateAngleY = -(float)Math.PI;
this.left_leg.rotateAngleX = -0.0299F;
this.right_leg.rotateAngleX = -0.0299F;
this.left_leg.rotationPointY = 22.0F;
this.right_leg.rotationPointY = 22.0F;
this.left_leg.rotateAngleZ = 0.0F;
this.right_leg.rotateAngleZ = 0.0F;
switch(p_217160_1_) {
case SITTING:
float f = 1.9F;
this.head.rotationPointY = 17.59F;
this.tail.rotateAngleX = 1.5388988F;
this.tail.rotationPointY = 22.97F;
this.body.rotationPointY = 18.4F;
this.left_wing.rotateAngleZ = -0.0873F;
this.left_wing.rotationPointY = 18.84F;
this.right_wing.rotateAngleZ = 0.0873F;
this.right_wing.rotationPointY = 18.84F;
++this.left_leg.rotationPointY;
++this.right_leg.rotationPointY;
++this.left_leg.rotateAngleX;
++this.right_leg.rotateAngleX;
break;
case PARTY:
this.left_leg.rotateAngleZ = -0.34906584F;
this.right_leg.rotateAngleZ = 0.34906584F;
case STANDING:
case ON_SHOULDER:
default:
break;
case FLYING:
this.left_leg.rotateAngleX += 0.6981317F;
this.right_leg.rotateAngleX += 0.6981317F;
}
}
private static ParrotModel.State getParrotState(ParrotEntity p_217158_0_) {
if (p_217158_0_.isPartying()) {
return ParrotModel.State.PARTY;
} else if (p_217158_0_.isEntitySleeping()) {
return ParrotModel.State.SITTING;
} else {
return p_217158_0_.isFlying() ? ParrotModel.State.FLYING : ParrotModel.State.STANDING;
}
}
@OnlyIn(Dist.CLIENT)
public static enum State {
FLYING,
STANDING,
SITTING,
PARTY,
ON_SHOULDER;
}
}
| 46.131818 | 219 | 0.6376 |
fcfb28ccb015c197dfceee6000d7b959716195c6
| 2,191 |
package com.example.velickomarija.diploma;
import android.content.Context;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.CountDownTimer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class TestingEnterSoundActivity extends AppCompatActivity {
MediaPlayer mPlayer;
Button startButton;
Intent intent;
PreferencesLocal preferencesLocal = new PreferencesLocal();
TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_testing_enter);
textView = (TextView) findViewById(R.id.start_text);
if (preferencesLocal.getProperty("PREF_NUM_SOUND").equals("2") ||
preferencesLocal.getProperty("PREF_NUM_SOUND").equals("3")) {
textView.setText(R.string.enter_testing_manifest23);
} else {
textView.setText(R.string.enter_testing_manifest);
}
intent = new Intent(this, TestingSoundActivity.class);
}
@Override
public void onBackPressed() {
// do nothing
}
public void sound(int sound, long time) {
mPlayer = MediaPlayer.create(this, sound);
mPlayer.start();
CountDownTimer start = new CountDownTimer(time, 500) {
public void onTick(long milliesUntilFinished) {
//do nothing
}
public void onFinish() {
startActivity(intent);
}
}.start();
}
public void onClickToGoTesting(View view) {
startButton = (Button) findViewById(R.id.button_next);
startButton.setEnabled(false);
startButton.setVisibility(View.INVISIBLE);
if (preferencesLocal.getProperty("PREF_NUM_SOUND").equals("2") ||
preferencesLocal.getProperty("PREF_NUM_SOUND").equals("3")) {
sound(R.raw.test_15sec, 15500);
} else {
sound(R.raw.test_20sec, 20500);
}
}
}
| 31.3 | 77 | 0.662711 |
2dbbd4ee8ea3d22ba787161193cfc87184ee9132
| 7,814 |
package com.ab.worldcup.team;
import com.ab.worldcup.match.KnockoutMatchCode;
import com.ab.worldcup.match.Stage;
import org.apache.commons.lang3.tuple.Pair;
import java.util.Optional;
public enum KnockoutTeamCode {
WINNER_GROUP_A(Stage.ROUND_OF_16),
WINNER_GROUP_B(Stage.ROUND_OF_16),
WINNER_GROUP_C(Stage.ROUND_OF_16),
WINNER_GROUP_D(Stage.ROUND_OF_16),
WINNER_GROUP_E(Stage.ROUND_OF_16),
WINNER_GROUP_F(Stage.ROUND_OF_16),
WINNER_GROUP_G(Stage.ROUND_OF_16),
WINNER_GROUP_H(Stage.ROUND_OF_16),
RUNNER_UP_GROUP_A(Stage.ROUND_OF_16),
RUNNER_UP_GROUP_B(Stage.ROUND_OF_16),
RUNNER_UP_GROUP_C(Stage.ROUND_OF_16),
RUNNER_UP_GROUP_D(Stage.ROUND_OF_16),
RUNNER_UP_GROUP_E(Stage.ROUND_OF_16),
RUNNER_UP_GROUP_F(Stage.ROUND_OF_16),
RUNNER_UP_GROUP_G(Stage.ROUND_OF_16),
RUNNER_UP_GROUP_H(Stage.ROUND_OF_16),
WINNER_ROS1(Stage.QUARTER_FINAL),
WINNER_ROS2(Stage.QUARTER_FINAL),
WINNER_ROS3(Stage.QUARTER_FINAL),
WINNER_ROS4(Stage.QUARTER_FINAL),
WINNER_ROS5(Stage.QUARTER_FINAL),
WINNER_ROS6(Stage.QUARTER_FINAL),
WINNER_ROS7(Stage.QUARTER_FINAL),
WINNER_ROS8(Stage.QUARTER_FINAL),
WINNER_QF1(Stage.SEMI_FINAL),
WINNER_QF2(Stage.SEMI_FINAL),
WINNER_QF3(Stage.SEMI_FINAL),
WINNER_QF4(Stage.SEMI_FINAL),
WINNER_SF1(Stage.FINAL),
WINNER_SF2(Stage.FINAL),
LOSER_SF1(Stage.THIRD_PLACE),
LOSER_SF2(Stage.THIRD_PLACE),
WINNER_THIRD_PLACE(Stage.THIRD_PLACE_WINNER),
WINNER_FINAL(Stage.WINNER);
private final Stage stageId;
KnockoutTeamCode(Stage stageId) {
this.stageId = stageId;
}
public Stage getStageId() {
return stageId;
}
public KnockoutTeamCodeType getType() {
switch (this) {
case WINNER_GROUP_A:
case WINNER_GROUP_B:
case WINNER_GROUP_C:
case WINNER_GROUP_D:
case WINNER_GROUP_E:
case WINNER_GROUP_F:
case WINNER_GROUP_G:
case WINNER_GROUP_H:
case RUNNER_UP_GROUP_A:
case RUNNER_UP_GROUP_B:
case RUNNER_UP_GROUP_C:
case RUNNER_UP_GROUP_D:
case RUNNER_UP_GROUP_E:
case RUNNER_UP_GROUP_F:
case RUNNER_UP_GROUP_G:
case RUNNER_UP_GROUP_H:
return KnockoutTeamCodeType.GROUP_QUALIFIER;
default:
return KnockoutTeamCodeType.KNOCKOUT_MATCH_QUALIFIER;
}
}
public Optional<KnockoutMatchCode> getKnockoutMatchCode() {
switch (this) {
case WINNER_ROS1:
return Optional.of(KnockoutMatchCode.ROS1);
case WINNER_ROS2:
return Optional.of(KnockoutMatchCode.ROS2);
case WINNER_ROS3:
return Optional.of(KnockoutMatchCode.ROS3);
case WINNER_ROS4:
return Optional.of(KnockoutMatchCode.ROS4);
case WINNER_ROS5:
return Optional.of(KnockoutMatchCode.ROS5);
case WINNER_ROS6:
return Optional.of(KnockoutMatchCode.ROS6);
case WINNER_ROS7:
return Optional.of(KnockoutMatchCode.ROS7);
case WINNER_ROS8:
return Optional.of(KnockoutMatchCode.ROS8);
case WINNER_QF1:
return Optional.of(KnockoutMatchCode.QF1);
case WINNER_QF2:
return Optional.of(KnockoutMatchCode.QF2);
case WINNER_QF3:
return Optional.of(KnockoutMatchCode.QF3);
case WINNER_QF4:
return Optional.of(KnockoutMatchCode.QF4);
case WINNER_SF1:
case LOSER_SF1:
return Optional.of(KnockoutMatchCode.SF1);
case WINNER_SF2:
case LOSER_SF2:
return Optional.of(KnockoutMatchCode.SF2);
case WINNER_THIRD_PLACE:
return Optional.of(KnockoutMatchCode.TP);
case WINNER_FINAL:
return Optional.of(KnockoutMatchCode.F);
default:
return Optional.empty();
}
}
public Optional<Pair<KnockoutTeamCode, KnockoutTeamCode>> getPrevStageTeams() {
switch (this) {
case WINNER_ROS1:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_GROUP_C, RUNNER_UP_GROUP_D));
case WINNER_ROS2:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_GROUP_A, RUNNER_UP_GROUP_B));
case WINNER_ROS3:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_GROUP_B, RUNNER_UP_GROUP_A));
case WINNER_ROS4:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_GROUP_D, RUNNER_UP_GROUP_C));
case WINNER_ROS5:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_GROUP_E, RUNNER_UP_GROUP_F));
case WINNER_ROS6:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_GROUP_G, RUNNER_UP_GROUP_H));
case WINNER_ROS7:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_GROUP_F, RUNNER_UP_GROUP_E));
case WINNER_ROS8:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_GROUP_H, RUNNER_UP_GROUP_G));
case WINNER_QF1:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_ROS1, WINNER_ROS2));
case WINNER_QF2:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_ROS5, WINNER_ROS6));
case WINNER_QF3:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_ROS3, WINNER_ROS4));
case WINNER_QF4:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_ROS7, WINNER_ROS8));
case WINNER_SF1:
case LOSER_SF1:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_QF1, WINNER_QF2));
case WINNER_SF2:
case LOSER_SF2:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_QF3, WINNER_QF4));
case WINNER_THIRD_PLACE:
return Optional.of(Pair.of(KnockoutTeamCode.LOSER_SF1, LOSER_SF2));
case WINNER_FINAL:
return Optional.of(Pair.of(KnockoutTeamCode.WINNER_SF1, WINNER_SF2));
default:
return Optional.empty();
}
}
public Optional<Group> getRelevantGroup() {
switch (this) {
case WINNER_GROUP_A:
case RUNNER_UP_GROUP_A:
return Optional.of(Group.A);
case WINNER_GROUP_B:
case RUNNER_UP_GROUP_B:
return Optional.of(Group.B);
case WINNER_GROUP_C:
case RUNNER_UP_GROUP_C:
return Optional.of(Group.C);
case WINNER_GROUP_D:
case RUNNER_UP_GROUP_D:
return Optional.of(Group.D);
case WINNER_GROUP_E:
case RUNNER_UP_GROUP_E:
return Optional.of(Group.E);
case WINNER_GROUP_F:
case RUNNER_UP_GROUP_F:
return Optional.of(Group.F);
case WINNER_GROUP_G:
case RUNNER_UP_GROUP_G:
return Optional.of(Group.G);
case WINNER_GROUP_H:
case RUNNER_UP_GROUP_H:
return Optional.of(Group.H);
default:
return Optional.empty();
}
}
public boolean isGroupWinner() {
switch (this) {
case WINNER_GROUP_A:
case WINNER_GROUP_B:
case WINNER_GROUP_C:
case WINNER_GROUP_D:
case WINNER_GROUP_E:
case WINNER_GROUP_F:
case WINNER_GROUP_G:
case WINNER_GROUP_H:
return true;
default:
return false;
}
}
}
| 37.567308 | 96 | 0.61697 |
4d58f51ca7f50d17250407a6e1e1a4eb050fd378
| 28,818 |
package org.twinone.locker.lock;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.ActivityManager.RunningServiceInfo;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.Notification;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.net.wifi.WifiManager;
import android.os.Binder;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.SystemClock;
import android.provider.Settings;
import android.support.v4.app.NotificationCompat;
import android.util.Log;
import android.view.WindowManager;
import android.widget.RatingBar;
import android.widget.Toast;
import com.twinone.locker.R;
import org.twinone.ads.DefaultAdInterface;
import org.twinone.locker.Constants;
import org.twinone.locker.ui.LocationData;
import org.twinone.locker.ui.MainActivity;
import org.twinone.locker.util.LaunchInterstitialActivity;
import org.twinone.locker.util.PrefUtils;
import org.twinone.locker.version.VersionManager;
import org.twinone.locker.version.VersionUtils;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class AppLockService extends Service {
private HashMap<String,Integer> wifiTable;
private HashMap<Integer,Integer> gpsTable;
private HashMap<String,Integer> test_appTable;
private HashMap<String,Integer> cateTable;
private HashMap<String,String> appTable;
public static HashSet<String> appSet;
/**
* Recieve pickup recognition result
*/
private PickupResult pickup_result = PickupResult.OTHER;
private enum PickupResult {
OWER, OTHER
}
public class PickupReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
String result = intent.getStringExtra("pickup");
if (result.equals("owner")) {
pickup_result = PickupResult.OWER;
}
else {
pickup_result = PickupResult.OTHER;
}
}
};
//private List<String> l = new ArrayList<String>();
private void readFile(HashMap<String,String> map) throws IOException{
if( List_CAtegoriy.UPDATING = true )
Log.d(TAG, "updating");
FileInputStream fis = null;
try {
Log.d("test", "entererd");
fis = openFileInput("category.txt");
ObjectInputStream is = new ObjectInputStream(fis);
CategoryTable simpleClass = (CategoryTable) is.readObject();
// String s = "";
for (Map.Entry entry : simpleClass.table.entrySet()) {
map.put((String) entry.getKey(), (String) entry.getValue());
Log.d("----read from file----", "package:" + entry.getKey() + "Category:" + entry.getValue());
//s = "package name:" + entry.getKey() + "value name:" + entry.getValue() + "\n";
}
is.close();
fis.close();
}
catch(ClassNotFoundException e){
Log.d("class not found ","class not found exception");
}
}
private void updateCate(){
try{
readFile(appTable);
}catch(IOException e){
Log.d("test", "read error");
}
}
private void initHashMap(){
wifiTable = new HashMap<String,Integer>();
gpsTable = new HashMap<Integer,Integer>();
test_appTable = new HashMap<String,Integer>();
appTable = new HashMap<String,String>();
cateTable = new HashMap<String,Integer>();
appSet = new HashSet<String>();
try{
readFile(appTable);
}catch(IOException e){
Log.d("test", "read error");
}
//values_of_list=l.toArray(new String[l.size()]);
Log.d("test", "" + appTable.size());
String[] parts = readFromFile("wifiTable").split(",");
String work =parts[0];
String home = parts[1];
wifiTable.put(work,40);
wifiTable.put(home,50);
gpsTable.put(0,9);
gpsTable.put(1,6);
gpsTable.put(2,3);
test_appTable.put("com.android.chrome", 9);
test_appTable.put("com.android.mms", 20);
test_appTable.put("com.google.android.gm", 35);
test_appTable.put("com.android.dialer", 20);
cateTable.put("Finance", 60);
cateTable.put("Medical", 55);
cateTable.put("Communication", 50);
cateTable.put("Social", 45);
cateTable.put("Productivity", 40);
cateTable.put("Business", 35);
cateTable.put("Shopping", 30);
cateTable.put("Photography", 30);
cateTable.put("Transportation", 30);
cateTable.put("Photography", 30);
cateTable.put("Health & Fitness", 30);
cateTable.put("Music & Audio", 25);
cateTable.put("Libraries & Demo", 25);
cateTable.put("News & Magazines", 25);
cateTable.put("Not Ready", 45);
cateTable.put("Started", 45);
}
/**
* Sent to {@link MainActivity} when the service has been completely started
* and is running
*/
public static final String BROADCAST_SERVICE_STARTED = "com.twinone.locker.intent.action.service_started";
/**
* Sent to {@link MainActivity} when the service has been stopped
*/
public static final String BROADCAST_SERVICE_STOPPED = "com.twinone.locker.intent.action.service_stopped";
/**
* This category allows the receiver to receive actions relating to the
* state of the service, such as when it is started or stopped
*/
public static final String CATEGORY_STATE_EVENTS = "com.twinone.locker.intent.category.service_start_stop_event";
private static final int REQUEST_CODE = 0x1234AF;
public static final int NOTIFICATION_ID = 0xABCD32;
private static final String TAG = "AppLockService";
/**
* Use this action to stop the intent
*/
private static final String ACTION_STOP = "com.twinone.locker.intent.action.stop_lock_service";
/**
* Starts the alarm
*/
private static final String ACTION_START = "com.twinone.locker.intent.action.start_lock_service";
/**
* When specifying this action, the service will initialize everything
* again.<br>
* This has only effect if the service was explicitly started using
* {@link #getRunIntent(Context)}
*/
private static final String ACTION_RESTART = "com.twinone.locker.intent.action.restart_lock_service";
private static final String EXTRA_FORCE_RESTART = "com.twinone.locker.intent.extra.force_restart";
private ActivityManager mActivityManager;
// private AdMobInterstitialHelper mInterstitialHelper;
/**
* 0 for disabled
*/
private long mShortExitMillis;
private boolean mRelockScreenOff;
private boolean mShowNotification;
private boolean mExplicitStarted;
private boolean mAllowDestroy;
private boolean mAllowRestart;
private Handler mHandler;
private BroadcastReceiver mScreenReceiver;
/**
* This map contains locked apps in the form<br>
* <PackageName, ShortExitEndTime>
*/
private Map<String, Boolean> mLockedPackages;
private Map<String, Runnable> mUnlockMap;
private boolean mBound = false;
BluetoothService mService;
private ServiceConnection mConnection = new ServiceConnection() {
// Called when the connection with the service is established
public void onServiceConnected(ComponentName className, IBinder service) {
// Because we have bound to an explicit
// service that is running in our own process, we can
// cast its IBinder to a concrete class and directly access it.
BluetoothService.BluetoothBinder binder = (BluetoothService.BluetoothBinder) service;
mService = binder.getService();
mBound = true;
Log.d(TAG, "onServiceConnected");
}
// Called when the connection with the service disconnects unexpectedly
public void onServiceDisconnected(ComponentName className) {
Log.d(TAG, "onServiceDisconnected");
mBound = false;
}
};
private String readFromFile(String filename) {
String ret = "";
try {
InputStream inputStream = openFileInput(filename);
if ( inputStream != null ) {
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String receiveString = "";
StringBuilder stringBuilder = new StringBuilder();
while ( (receiveString = bufferedReader.readLine()) != null ) {
stringBuilder.append(receiveString);
}
inputStream.close();
ret = stringBuilder.toString();
}
}
catch (FileNotFoundException e) {
Log.e("login activity", "File not found: " + e.toString());
} catch (IOException e) {
Log.e("login activity", "Can not read file: " + e.toString());
}
return ret;
}
@Override
public IBinder onBind(Intent i) {
return new LocalBinder();
}
public class LocalBinder extends Binder {
public AppLockService getInstance() {
return AppLockService.this;
}
}
private final class ScreenReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_SCREEN_ON)) {
Log.i(TAG, "Screen ON");
// Trigger package again
mLastPackageName = "";
startAlarm(AppLockService.this);
}
if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
Log.i(TAG, "Screen OFF");
stopAlarm(AppLockService.this);
if (mRelockScreenOff) {
lockAll();
}
}
}
}
;
@Override
public void onCreate() {
Log.d(TAG, "onCreateHaha"+mBound);
// Intent i =new Intent(this,List_CAtegoriy.class);
// i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// this.startActivity(i);
initHashMap();
Intent intent = new Intent(this, BluetoothService.class);
if (!mBound) bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
super.onCreate();
}
/**
* Starts everything, including notification and repeating alarm
*
* @return True if all OK, false if the service is not allowed to start (the
* caller should stop the service)
*/
private boolean init() {
Log.d(TAG, "init");
if (new PrefUtils(this).isCurrentPasswordEmpty()) {
Log.w(TAG, "Not starting service, current password empty");
return false;
}
if (new VersionManager(this).isDeprecated()) {
Log.i(TAG, "Not starting AlarmService for deprecated version");
new VersionUtils(this).showDeprecatedNotification();
return false;
}
mHandler = new Handler();
mActivityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
mUnlockMap = new HashMap<>();
mLockedPackages = new HashMap<>();
mScreenReceiver = new ScreenReceiver();
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_ON);
filter.addAction(Intent.ACTION_SCREEN_OFF);
registerReceiver(mScreenReceiver, filter);
final Set<String> apps = PrefUtils.getLockedApps(this);
for (String s : apps) {
mLockedPackages.put(s, true);
}
PrefUtils prefs = new PrefUtils(this);
boolean delay = prefs.getBoolean(R.string.pref_key_delay_status,
R.bool.pref_def_delay_status);
if (delay) {
int secs = prefs.parseInt(R.string.pref_key_delay_time,
R.string.pref_def_delay_time);
mShortExitMillis = secs * 1000;
}
mRelockScreenOff = prefs.getBoolean(
R.string.pref_key_relock_after_screenoff,
R.bool.pref_def_relock_after_screenoff);
startNotification();
startAlarm(this);
// Tell MainActivity we're done
Intent i = new Intent(BROADCAST_SERVICE_STARTED);
i.addCategory(CATEGORY_STATE_EVENTS);
sendBroadcast(i);
return true;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
// Log.d(TAG, "test");
if (intent == null || ACTION_START.equals(intent.getAction())) {
if (!mExplicitStarted) {
Log.d(TAG, "explicitStarted = false");
if (init() == false) {
doStopSelf();
return START_NOT_STICKY;
}
mExplicitStarted = true;
}
checkPackageChanged();
} else if (ACTION_RESTART.equals(intent.getAction())) {
if (mExplicitStarted
|| intent.getBooleanExtra(EXTRA_FORCE_RESTART, false)) {
Log.d(TAG,
"ACTION_RESTART (force="
+ intent.getBooleanExtra(EXTRA_FORCE_RESTART,
false));
// init();
doRestartSelf(); // not allowed, so service will restart
} else {
doStopSelf();
}
} else if (ACTION_STOP.equals(intent.getAction())) {
Log.d(TAG, "ACTION_STOP");
doStopSelf();
}
return START_STICKY;
}
private String mLastPackageName;
// private String mLastCompleteName;
private void checkPackageChanged() {
final String packageName = getTopPackageName();
// final String completeName = packageName + "/"
// + top.topActivity.getShortClassName();
if (!packageName.equals(mLastPackageName)) {
Log.d(TAG, "appchanged " + " (" + mLastPackageName + ">"
+ packageName + ")");
onAppClose(mLastPackageName, packageName);
onAppOpen(packageName, mLastPackageName);
}
// prepare for next call
mLastPackageName = packageName;
// mLastCompleteName = completeName;
}
private void onAppOpen(final String open, final String close) {
if (mLockedPackages.containsKey(open)) {
onLockedAppOpen(open);
}
}
private void onLockedAppOpen(final String open) {
//list_category.validate();
//if package.size = file.map.size do nothing
//else start t to undate file( size is not right and no file is there
// when finish set UPDATING to false
try{
readFile(appTable);
}catch(IOException e){
Log.d("test", "read error");
}
ListCategory l=new ListCategory(this);
l.validate();
onbody b=new onbody(this);
boolean bt = mService.hasTrustedDevices();
int xFactor = 1;
String onBodyStatus = "" + b.onBody;
int body_score = b.onBody? 0 : 0;
String wifiStatus = readFromFile("wifiTable");
int wifi_score = 30;
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
String curWifi = wifi.getConnectionInfo().getSSID();
if (wifiTable.containsKey(curWifi)) wifi_score = wifiTable.get(curWifi);
int intGps=LocationData.getInstance().getStatus();
String locationStatus = ""+intGps;
int gps_score = 0;
if (gpsTable.containsKey(intGps)) gps_score = gpsTable.get(intGps);
Log.v("Abhishek Score",Integer.toString(gps_score));
String blueToothStatus = ""+bt;
int bt_score = bt? 28:0;
String app_cate = "N/A";
int app_score=30;
if (appTable.containsKey(open)) {
app_cate = appTable.get(open);
if ( cateTable.containsKey(app_cate)) app_score = cateTable.get(app_cate);
else app_score = 20;
}
// pickup result
int pickup_score = pickup_result == PickupResult.OWER ? 20 : 0;
xFactor = body_score + wifi_score + bt_score + gps_score + pickup_score;
for (String s : wifiTable.keySet()) {
}
//String cate = readFromFile("category.txt");
//Log.v ("cate+", l.get);
if( List_CAtegoriy.UPDATING = true )
Log.d("factors", List_CAtegoriy.UPDATEINFO);
Log.v("factors", "app: " + open + "\n" + "wifi: " + curWifi + wifiTable.keySet() + " " + wifi_score + "\n"
+ "location: " + locationStatus + "\n"
+ "bluetooth: " + blueToothStatus + "\n"
+ "onbody: " + onBodyStatus + "\n"
+ "XFacor: " + xFactor + "\n"
+ "appScore: " + app_cate + " " + app_score);
//data collection
DataCollection d=new DataCollection(this);
String androidId = Settings.Secure.getString(getContentResolver(),Settings.Secure.ANDROID_ID);
d.collectData(curWifi,wifi_score,intGps,blueToothStatus,onBodyStatus,xFactor,app_cate,app_score,androidId,getTopPackageName(),WifiService.confirmWifi);
// //fetch wifi
//boolean locked = !readFromFile("wifiTable").split(",")[0].equals(curWifi) ;
//WifiService. .updateList();
//Toast.makeText(this, "curWIFI IS : "+curWifi+" antd workWIFI is: "+readFromFile("wifiTable").split(",")[0]+" bol: "+ locked+" app: "+open, Toast.LENGTH_SHORT).show();
// Toast.makeText(this, "Location is : "+LocationData.getInstance().getStatus(), Toast.LENGTH_SHORT).show();
//final boolean locked = mLockedPackages.get(open);
// Log.d(TAG, "onLockedAppOpen (locked=" + locked + ")");
if (xFactor<app_score) {
showLocker(open);
}
removeRelockTimer(open);
}
private void showInterstitial() {
if (!new DefaultAdInterface().adsEnabled()) return;
mAdCount++;
if (mAdCount % Constants.APPS_PER_INTERSTITIAL == 0)
mHandler.post(new Runnable() {
@Override
public void run() {
// mInterstitialHelper.load();
Intent i = new Intent(AppLockService.this, LaunchInterstitialActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);
}
});
}
private void showLocker(String packageName) {
Intent intent = LockService.getLockIntent(this, packageName);
intent.setAction(LockService.ACTION_COMPARE);
intent.putExtra(LockService.EXTRA_PACKAGENAME, packageName);
startService(intent);
}
private void onAppClose(String close, String open) {
if (mLockedPackages.containsKey(close)) {
onLockedAppClose(close, open);
}
}
private void onLockedAppClose(String close, String open) {
showInterstitial();
setRelockTimer(close);
if (getPackageName().equals(close) || getPackageName().equals(open)) {
// Don't interact with own app
return;
}
if (mLockedPackages.containsKey(open)) {
// The newly opened app needs a lock screen, so don't hide previous
return;
}
LockService.hide(this);
}
private int mAdCount = 0;
private void setRelockTimer(String packageName) {
boolean locked = mLockedPackages.get(packageName);
if (!locked) {
if (mShortExitMillis != 0) {
Runnable r = new RelockRunnable(packageName);
mHandler.postDelayed(r, mShortExitMillis);
mUnlockMap.put(packageName, r);
} else {
lockApp(packageName);
}
}
}
private void removeRelockTimer(String packageName) {
// boolean locked = mLockedPackages.get(packageName);
// if (!locked) {
if (mUnlockMap.containsKey(packageName)) {
mHandler.removeCallbacks(mUnlockMap.get(packageName));
mUnlockMap.remove(packageName);
}
}
/**
* This class will re-lock an app
*/
private class RelockRunnable implements Runnable {
private final String mPackageName;
public RelockRunnable(String packageName) {
mPackageName = packageName;
}
@Override
public void run() {
lockApp(mPackageName);
}
}
List<RunningTaskInfo> mTestList = new ArrayList<>();
private String getTopPackageName() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
return mActivityManager.getRunningTasks(1).get(0).topActivity.getPackageName();
} else {
// Hack, see
// http://stackoverflow.com/questions/24625936/getrunningtasks-doesnt-work-in-android-l/27140347#27140347
final List<ActivityManager.RunningAppProcessInfo> pis = mActivityManager.getRunningAppProcesses();
for (ActivityManager.RunningAppProcessInfo pi : pis) {
if (pi.pkgList.length == 1) return pi.pkgList[0];
}
}
return "";
}
public void unlockApp(String packageName) {
Log.d(TAG, "unlocking app (packageName=" + packageName + ")");
if (mLockedPackages.containsKey(packageName)) {
mLockedPackages.put(packageName, false);
}
}
private void lockAll() {
for (Map.Entry<String, Boolean> entry : mLockedPackages.entrySet()) {
entry.setValue(true);
}
}
void lockApp(String packageName) {
if (mLockedPackages.containsKey(packageName)) {
mLockedPackages.put(packageName, true);
}
}
private void startNotification() {
// Start foreground anyway
startForegroundWithNotification();
mShowNotification = new PrefUtils(this).getBoolean(
R.string.pref_key_show_notification,
R.bool.pref_def_show_notification);
// If the user doesn't want a notification (default), remove it
if (!mShowNotification) {
// Retain foreground state
HelperService.removeNotification(this);
// Remove foreground
// stopForeground(true);
}
}
@SuppressLint("InlinedApi")
private void startForegroundWithNotification() {
Log.d(TAG, "showNotification");
boolean hide = new PrefUtils(this).getBoolean(
R.string.pref_key_hide_notification_icon,
R.bool.pref_def_hide_notification_icon);
int priority = hide ? Notification.PRIORITY_MIN
: Notification.PRIORITY_DEFAULT;
Intent i = new Intent(this, MainActivity.class);
PendingIntent pi = PendingIntent.getActivity(this, 0, i, 0);
String title = getString(R.string.notification_title);
String content = getString(R.string.notification_state_locked);
NotificationCompat.Builder nb = new NotificationCompat.Builder(this);
nb.setSmallIcon(R.drawable.ic_launcher);
nb.setContentTitle(title);
nb.setContentText(content);
nb.setWhen(System.currentTimeMillis());
nb.setContentIntent(pi);
nb.setOngoing(true);
nb.setPriority(priority);
startForeground(NOTIFICATION_ID, nb.build());
}
public static void start(Context c) {
startAlarm(c);
}
/**
* @param c
* @return The new state for the service, true for running, false for not
* running
*/
public static boolean toggle(Context c) {
if (isRunning(c)) {
stop(c);
return false;
} else {
start(c);
return true;
}
}
public static boolean isRunning(Context c) {
ActivityManager manager = (ActivityManager) c
.getSystemService(Context.ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager
.getRunningServices(Integer.MAX_VALUE)) {
if (AppLockService.class.getName().equals(
service.service.getClassName())) {
return true;
}
}
return false;
}
/**
* Starts the service
*/
private static void startAlarm(Context c) {
AlarmManager am = (AlarmManager) c.getSystemService(ALARM_SERVICE);
PendingIntent pi = getRunIntent(c);
SharedPreferences sp = PrefUtils.prefs(c);
String defaultPerformance = c.getString(R.string.pref_val_perf_normal);
String s = sp.getString(c.getString(R.string.pref_key_performance),
defaultPerformance);
if (s.length() == 0)
s = "0";
long interval = Long.parseLong(s);
Log.d(TAG, "Scheduling alarm (interval=" + interval + ")");
long startTime = SystemClock.elapsedRealtime();
am.setRepeating(AlarmManager.ELAPSED_REALTIME, startTime, interval, pi);
}
private static PendingIntent running_intent;
private static PendingIntent getRunIntent(Context c) {
if (running_intent == null) {
Intent i = new Intent(c, AppLockService.class);
i.setAction(ACTION_START);
running_intent = PendingIntent.getService(c, REQUEST_CODE, i, 0);
}
return running_intent;
}
private static void stopAlarm(Context c) {
AlarmManager am = (AlarmManager) c.getSystemService(ALARM_SERVICE);
am.cancel(getRunIntent(c));
}
/**
* Stop this service, also stopping the alarm
*/
public static void stop(Context c) {
stopAlarm(c);
Intent i = new Intent(c, AppLockService.class);
i.setAction(ACTION_STOP);
c.startService(i);
}
/**
* Re-initialize everything.<br>
* This has only effect if the service was explicitly started using
* {@link #start(Context)}
*/
public static void restart(Context c) {
Intent i = new Intent(c, AppLockService.class);
i.setAction(ACTION_RESTART);
c.startService(i);
}
/**
* Forces the service to stop and then start again. This means that if the
* service was already stopped, it will just start
*/
public static void forceRestart(Context c) {
Intent i = new Intent(c, AppLockService.class);
i.setAction(ACTION_RESTART);
i.putExtra(EXTRA_FORCE_RESTART, true);
c.startService(i);
}
@Override
public void onDestroy() {
super.onDestroy();
Log.d(TAG, "onDestroy: (mAllowRestart=" + mAllowRestart + ")" + "mbound: " + mBound);
if (mBound){ this.unbindService( mConnection);
}
if (mScreenReceiver != null)
unregisterReceiver(mScreenReceiver);
if (mShowNotification)
stopForeground(true);
if (mAllowRestart) {
start(this);
mAllowRestart = false;
return;
}
Log.i(TAG, "onDestroy (mAllowDestroy=" + mAllowDestroy + ")");
if (!mAllowDestroy) {
Log.d(TAG, "Destroy not allowed, restarting service");
start(this);
} else {
// Tell MainActivity we're stopping
Intent i = new Intent(BROADCAST_SERVICE_STOPPED);
i.addCategory(CATEGORY_STATE_EVENTS);
sendBroadcast(i);
}
mAllowDestroy = false;
}
private void doStopSelf() {
stopAlarm(this);
mAllowDestroy = true;
stopForeground(true);
stopSelf();
}
private void doRestartSelf() {
Log.d(TAG, "Setting allowrestart to true");
mAllowRestart = true;
stopSelf();
}
}
| 31.984462 | 176 | 0.60955 |
81492eb959f990bcafb18c88ce20ee79c73c0878
| 6,680 |
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.benchmark.percolator;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.action.percolate.PercolateResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.StopWatch;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.node.Node;
import org.elasticsearch.percolator.PercolatorService;
import java.io.IOException;
import static org.elasticsearch.client.Requests.createIndexRequest;
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_REPLICAS;
import static org.elasticsearch.cluster.metadata.IndexMetaData.SETTING_NUMBER_OF_SHARDS;
import static org.elasticsearch.common.settings.Settings.settingsBuilder;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.index.query.QueryBuilders.rangeQuery;
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
/**
*
*/
public class PercolatorStressBenchmark {
public static void main(String[] args) throws Exception {
Settings settings = settingsBuilder()
.put(SETTING_NUMBER_OF_SHARDS, 4)
.put(SETTING_NUMBER_OF_REPLICAS, 0)
.build();
Node[] nodes = new Node[1];
for (int i = 0; i < nodes.length; i++) {
nodes[i] = nodeBuilder().settings(settingsBuilder().put(settings).put("name", "node" + i)).node();
}
Node clientNode = nodeBuilder().settings(settingsBuilder().put(settings).put("name", "client")).client(true).node();
Client client = clientNode.client();
client.admin().indices().create(createIndexRequest("test")).actionGet();
ClusterHealthResponse healthResponse = client.admin().cluster().prepareHealth("test")
.setWaitForGreenStatus()
.execute().actionGet();
if (healthResponse.isTimedOut()) {
System.err.println("Quiting, because cluster health requested timed out...");
return;
} else if (healthResponse.getStatus() != ClusterHealthStatus.GREEN) {
System.err.println("Quiting, because cluster state isn't green...");
return;
}
int COUNT = 200000;
int QUERIES = 100;
int TERM_QUERIES = QUERIES / 2;
int RANGE_QUERIES = QUERIES - TERM_QUERIES;
client.prepareIndex("test", "type1", "1").setSource(jsonBuilder().startObject().field("numeric1", 1).endObject()).execute().actionGet();
// register queries
int i = 0;
for (; i < TERM_QUERIES; i++) {
client.prepareIndex("test", PercolatorService.TYPE_NAME, Integer.toString(i))
.setSource(jsonBuilder().startObject()
.field("query", termQuery("name", "value"))
.endObject())
.execute().actionGet();
}
int[] numbers = new int[RANGE_QUERIES];
for (; i < QUERIES; i++) {
client.prepareIndex("test", PercolatorService.TYPE_NAME, Integer.toString(i))
.setSource(jsonBuilder().startObject()
.field("query", rangeQuery("numeric1").from(i).to(i))
.endObject())
.execute().actionGet();
numbers[i - TERM_QUERIES] = i;
}
StopWatch stopWatch = new StopWatch().start();
System.out.println("Percolating [" + COUNT + "] ...");
for (i = 1; i <= COUNT; i++) {
XContentBuilder source;
int expectedMatches;
if (i % 2 == 0) {
source = source(Integer.toString(i), "value");
expectedMatches = TERM_QUERIES;
} else {
int number = numbers[i % RANGE_QUERIES];
source = source(Integer.toString(i), number);
expectedMatches = 1;
}
PercolateResponse percolate = client.preparePercolate()
.setIndices("test").setDocumentType("type1")
.setSource(source)
.execute().actionGet();
if (percolate.getMatches().length != expectedMatches) {
System.err.println("No matching number of queries");
}
if ((i % 10000) == 0) {
System.out.println("Percolated " + i + " took " + stopWatch.stop().lastTaskTime());
stopWatch.start();
}
}
System.out.println("Percolation took " + stopWatch.totalTime() + ", TPS " + (((double) COUNT) / stopWatch.totalTime().secondsFrac()));
clientNode.close();
for (Node node : nodes) {
node.close();
}
}
private static XContentBuilder source(String id, String nameValue) throws IOException {
return jsonBuilder().startObject().startObject("doc")
.field("id", id)
.field("name", nameValue)
.endObject().endObject();
}
private static XContentBuilder source(String id, int number) throws IOException {
return jsonBuilder().startObject().startObject("doc")
.field("id", id)
.field("numeric1", number)
.field("numeric2", number)
.field("numeric3", number)
.field("numeric4", number)
.field("numeric5", number)
.field("numeric6", number)
.field("numeric7", number)
.field("numeric8", number)
.field("numeric9", number)
.field("numeric10", number)
.endObject().endObject();
}
}
| 42.547771 | 144 | 0.616617 |
7410cc63e165bd7de63a977ecd709a6aee9626ce
| 33,145 |
//
// This file is auto-generated. Please don't modify it!
//
package org.opencv.features2d;
import java.util.ArrayList;
import java.util.List;
import org.opencv.core.Algorithm;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDMatch;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.utils.Converters;
// C++: class DescriptorMatcher
/**
* Abstract base class for matching keypoint descriptors.
*
* <p>It has two groups of match methods: for matching descriptors of an image with another image or
* with an image set.
*/
public class DescriptorMatcher extends Algorithm {
protected DescriptorMatcher(long addr) {
super(addr);
}
// internal usage only
public static DescriptorMatcher __fromPtr__(long addr) {
return new DescriptorMatcher(addr);
}
// C++: enum MatcherType
public static final int FLANNBASED = 1,
BRUTEFORCE = 2,
BRUTEFORCE_L1 = 3,
BRUTEFORCE_HAMMING = 4,
BRUTEFORCE_HAMMINGLUT = 5,
BRUTEFORCE_SL2 = 6;
//
// C++: Ptr_DescriptorMatcher cv::DescriptorMatcher::clone(bool emptyTrainData = false)
//
/**
* Clones the matcher.
*
* @param emptyTrainData If emptyTrainData is false, the method creates a deep copy of the object,
* that is, copies both parameters and train data. If emptyTrainData is true, the method
* creates an object copy with the current parameters but with empty train data.
* @return automatically generated
*/
public DescriptorMatcher clone(boolean emptyTrainData) {
return DescriptorMatcher.__fromPtr__(clone_0(nativeObj, emptyTrainData));
}
/**
* Clones the matcher.
*
* <p>that is, copies both parameters and train data. If emptyTrainData is true, the method
* creates an object copy with the current parameters but with empty train data.
*
* @return automatically generated
*/
public DescriptorMatcher clone() {
return DescriptorMatcher.__fromPtr__(clone_1(nativeObj));
}
//
// C++: static Ptr_DescriptorMatcher cv::DescriptorMatcher::create(DescriptorMatcher_MatcherType
// matcherType)
//
public static DescriptorMatcher create(int matcherType) {
return DescriptorMatcher.__fromPtr__(create_0(matcherType));
}
//
// C++: static Ptr_DescriptorMatcher cv::DescriptorMatcher::create(String descriptorMatcherType)
//
/**
* Creates a descriptor matcher of a given type with the default parameters (using default
* constructor).
*
* @param descriptorMatcherType Descriptor matcher type. Now the following matcher types are
* supported:
* <ul>
* <li>{@code BruteForce} (it uses L2 )
* <li>{@code BruteForce-L1}
* <li>{@code BruteForce-Hamming}
* <li>{@code BruteForce-Hamming(2)}
* <li>{@code FlannBased}
* </ul>
*
* @return automatically generated
*/
public static DescriptorMatcher create(String descriptorMatcherType) {
return DescriptorMatcher.__fromPtr__(create_1(descriptorMatcherType));
}
//
// C++: bool cv::DescriptorMatcher::empty()
//
/**
* Returns true if there are no train descriptors in the both collections.
*
* @return automatically generated
*/
public boolean empty() {
return empty_0(nativeObj);
}
//
// C++: bool cv::DescriptorMatcher::isMaskSupported()
//
/**
* Returns true if the descriptor matcher supports masking permissible matches.
*
* @return automatically generated
*/
public boolean isMaskSupported() {
return isMaskSupported_0(nativeObj);
}
//
// C++: vector_Mat cv::DescriptorMatcher::getTrainDescriptors()
//
/**
* Returns a constant link to the train descriptor collection trainDescCollection .
*
* @return automatically generated
*/
public List<Mat> getTrainDescriptors() {
List<Mat> retVal = new ArrayList<Mat>();
Mat retValMat = new Mat(getTrainDescriptors_0(nativeObj));
Converters.Mat_to_vector_Mat(retValMat, retVal);
return retVal;
}
//
// C++: void cv::DescriptorMatcher::add(vector_Mat descriptors)
//
/**
* Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis)
* descriptor collection.
*
* <p>If the collection is not empty, the new descriptors are added to existing train descriptors.
*
* @param descriptors Descriptors to add. Each descriptors[i] is a set of descriptors from the
* same train image.
*/
public void add(List<Mat> descriptors) {
Mat descriptors_mat = Converters.vector_Mat_to_Mat(descriptors);
add_0(nativeObj, descriptors_mat.nativeObj);
}
//
// C++: void cv::DescriptorMatcher::clear()
//
/** Clears the train descriptor collections. */
public void clear() {
clear_0(nativeObj);
}
//
// C++: void cv::DescriptorMatcher::knnMatch(Mat queryDescriptors, Mat trainDescriptors,
// vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false)
//
/**
* Finds the k best matches for each descriptor from a query set.
*
* @param queryDescriptors Query set of descriptors.
* @param trainDescriptors Train set of descriptors. This set is not added to the train
* descriptors collection stored in the class object.
* @param mask Mask specifying permissible matches between an input query and train matrices of
* descriptors.
* @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
* @param k Count of best matches found per each query descriptor or less if a query descriptor
* has less than k possible matches in total.
* @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
* false, the matches vector has the same size as queryDescriptors rows. If compactResult is
* true, the matches vector does not contain matches for fully masked-out query descriptors.
* <p>These extended variants of DescriptorMatcher::match methods find several best matches
* for each query descriptor. The matches are returned in the distance increasing order. See
* DescriptorMatcher::match for the details about query and train descriptors.
*/
public void knnMatch(
Mat queryDescriptors,
Mat trainDescriptors,
List<MatOfDMatch> matches,
int k,
Mat mask,
boolean compactResult) {
Mat matches_mat = new Mat();
knnMatch_0(
nativeObj,
queryDescriptors.nativeObj,
trainDescriptors.nativeObj,
matches_mat.nativeObj,
k,
mask.nativeObj,
compactResult);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
/**
* Finds the k best matches for each descriptor from a query set.
*
* @param queryDescriptors Query set of descriptors.
* @param trainDescriptors Train set of descriptors. This set is not added to the train
* descriptors collection stored in the class object.
* @param mask Mask specifying permissible matches between an input query and train matrices of
* descriptors.
* @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
* @param k Count of best matches found per each query descriptor or less if a query descriptor
* has less than k possible matches in total. false, the matches vector has the same size as
* queryDescriptors rows. If compactResult is true, the matches vector does not contain
* matches for fully masked-out query descriptors.
* <p>These extended variants of DescriptorMatcher::match methods find several best matches
* for each query descriptor. The matches are returned in the distance increasing order. See
* DescriptorMatcher::match for the details about query and train descriptors.
*/
public void knnMatch(
Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k, Mat mask) {
Mat matches_mat = new Mat();
knnMatch_1(
nativeObj,
queryDescriptors.nativeObj,
trainDescriptors.nativeObj,
matches_mat.nativeObj,
k,
mask.nativeObj);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
/**
* Finds the k best matches for each descriptor from a query set.
*
* @param queryDescriptors Query set of descriptors.
* @param trainDescriptors Train set of descriptors. This set is not added to the train
* descriptors collection stored in the class object. descriptors.
* @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
* @param k Count of best matches found per each query descriptor or less if a query descriptor
* has less than k possible matches in total. false, the matches vector has the same size as
* queryDescriptors rows. If compactResult is true, the matches vector does not contain
* matches for fully masked-out query descriptors.
* <p>These extended variants of DescriptorMatcher::match methods find several best matches
* for each query descriptor. The matches are returned in the distance increasing order. See
* DescriptorMatcher::match for the details about query and train descriptors.
*/
public void knnMatch(
Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, int k) {
Mat matches_mat = new Mat();
knnMatch_2(
nativeObj,
queryDescriptors.nativeObj,
trainDescriptors.nativeObj,
matches_mat.nativeObj,
k);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
//
// C++: void cv::DescriptorMatcher::knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches,
// int k, vector_Mat masks = vector_Mat(), bool compactResult = false)
//
/**
* @param queryDescriptors Query set of descriptors.
* @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
* @param k Count of best matches found per each query descriptor or less if a query descriptor
* has less than k possible matches in total.
* @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
* descriptors and stored train descriptors from the i-th image trainDescCollection[i].
* @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
* false, the matches vector has the same size as queryDescriptors rows. If compactResult is
* true, the matches vector does not contain matches for fully masked-out query descriptors.
*/
public void knnMatch(
Mat queryDescriptors,
List<MatOfDMatch> matches,
int k,
List<Mat> masks,
boolean compactResult) {
Mat matches_mat = new Mat();
Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
knnMatch_3(
nativeObj,
queryDescriptors.nativeObj,
matches_mat.nativeObj,
k,
masks_mat.nativeObj,
compactResult);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
/**
* @param queryDescriptors Query set of descriptors.
* @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
* @param k Count of best matches found per each query descriptor or less if a query descriptor
* has less than k possible matches in total.
* @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
* descriptors and stored train descriptors from the i-th image trainDescCollection[i]. false,
* the matches vector has the same size as queryDescriptors rows. If compactResult is true,
* the matches vector does not contain matches for fully masked-out query descriptors.
*/
public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k, List<Mat> masks) {
Mat matches_mat = new Mat();
Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
knnMatch_4(
nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k, masks_mat.nativeObj);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
/**
* @param queryDescriptors Query set of descriptors.
* @param matches Matches. Each matches[i] is k or less matches for the same query descriptor.
* @param k Count of best matches found per each query descriptor or less if a query descriptor
* has less than k possible matches in total. descriptors and stored train descriptors from
* the i-th image trainDescCollection[i]. false, the matches vector has the same size as
* queryDescriptors rows. If compactResult is true, the matches vector does not contain
* matches for fully masked-out query descriptors.
*/
public void knnMatch(Mat queryDescriptors, List<MatOfDMatch> matches, int k) {
Mat matches_mat = new Mat();
knnMatch_5(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, k);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
//
// C++: void cv::DescriptorMatcher::match(Mat queryDescriptors, Mat trainDescriptors,
// vector_DMatch& matches, Mat mask = Mat())
//
/**
* Finds the best match for each descriptor from a query set.
*
* @param queryDescriptors Query set of descriptors.
* @param trainDescriptors Train set of descriptors. This set is not added to the train
* descriptors collection stored in the class object.
* @param matches Matches. If a query descriptor is masked out in mask , no match is added for
* this descriptor. So, matches size may be smaller than the query descriptors count.
* @param mask Mask specifying permissible matches between an input query and train matrices of
* descriptors.
* <p>In the first variant of this method, the train descriptors are passed as an input
* argument. In the second variant of the method, train descriptors collection that was set by
* DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which
* query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched
* with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.
*/
public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches, Mat mask) {
Mat matches_mat = matches;
match_0(
nativeObj,
queryDescriptors.nativeObj,
trainDescriptors.nativeObj,
matches_mat.nativeObj,
mask.nativeObj);
}
/**
* Finds the best match for each descriptor from a query set.
*
* @param queryDescriptors Query set of descriptors.
* @param trainDescriptors Train set of descriptors. This set is not added to the train
* descriptors collection stored in the class object.
* @param matches Matches. If a query descriptor is masked out in mask , no match is added for
* this descriptor. So, matches size may be smaller than the query descriptors count.
* descriptors.
* <p>In the first variant of this method, the train descriptors are passed as an input
* argument. In the second variant of the method, train descriptors collection that was set by
* DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which
* query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched
* with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.
*/
public void match(Mat queryDescriptors, Mat trainDescriptors, MatOfDMatch matches) {
Mat matches_mat = matches;
match_1(
nativeObj, queryDescriptors.nativeObj, trainDescriptors.nativeObj, matches_mat.nativeObj);
}
//
// C++: void cv::DescriptorMatcher::match(Mat queryDescriptors, vector_DMatch& matches,
// vector_Mat masks = vector_Mat())
//
/**
* @param queryDescriptors Query set of descriptors.
* @param matches Matches. If a query descriptor is masked out in mask , no match is added for
* this descriptor. So, matches size may be smaller than the query descriptors count.
* @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
* descriptors and stored train descriptors from the i-th image trainDescCollection[i].
*/
public void match(Mat queryDescriptors, MatOfDMatch matches, List<Mat> masks) {
Mat matches_mat = matches;
Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
match_2(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, masks_mat.nativeObj);
}
/**
* @param queryDescriptors Query set of descriptors.
* @param matches Matches. If a query descriptor is masked out in mask , no match is added for
* this descriptor. So, matches size may be smaller than the query descriptors count.
* descriptors and stored train descriptors from the i-th image trainDescCollection[i].
*/
public void match(Mat queryDescriptors, MatOfDMatch matches) {
Mat matches_mat = matches;
match_3(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj);
}
//
// C++: void cv::DescriptorMatcher::radiusMatch(Mat queryDescriptors, Mat trainDescriptors,
// vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false)
//
/**
* For each query descriptor, finds the training descriptors not farther than the specified
* distance.
*
* @param queryDescriptors Query set of descriptors.
* @param trainDescriptors Train set of descriptors. This set is not added to the train
* descriptors collection stored in the class object.
* @param matches Found matches.
* @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
* false, the matches vector has the same size as queryDescriptors rows. If compactResult is
* true, the matches vector does not contain matches for fully masked-out query descriptors.
* @param maxDistance Threshold for the distance between matched descriptors. Distance means here
* metric distance (e.g. Hamming distance), not the distance between coordinates (which is
* measured in Pixels)!
* @param mask Mask specifying permissible matches between an input query and train matrices of
* descriptors.
* <p>For each query descriptor, the methods find such training descriptors that the distance
* between the query descriptor and the training descriptor is equal or smaller than
* maxDistance. Found matches are returned in the distance increasing order.
*/
public void radiusMatch(
Mat queryDescriptors,
Mat trainDescriptors,
List<MatOfDMatch> matches,
float maxDistance,
Mat mask,
boolean compactResult) {
Mat matches_mat = new Mat();
radiusMatch_0(
nativeObj,
queryDescriptors.nativeObj,
trainDescriptors.nativeObj,
matches_mat.nativeObj,
maxDistance,
mask.nativeObj,
compactResult);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
/**
* For each query descriptor, finds the training descriptors not farther than the specified
* distance.
*
* @param queryDescriptors Query set of descriptors.
* @param trainDescriptors Train set of descriptors. This set is not added to the train
* descriptors collection stored in the class object.
* @param matches Found matches. false, the matches vector has the same size as queryDescriptors
* rows. If compactResult is true, the matches vector does not contain matches for fully
* masked-out query descriptors.
* @param maxDistance Threshold for the distance between matched descriptors. Distance means here
* metric distance (e.g. Hamming distance), not the distance between coordinates (which is
* measured in Pixels)!
* @param mask Mask specifying permissible matches between an input query and train matrices of
* descriptors.
* <p>For each query descriptor, the methods find such training descriptors that the distance
* between the query descriptor and the training descriptor is equal or smaller than
* maxDistance. Found matches are returned in the distance increasing order.
*/
public void radiusMatch(
Mat queryDescriptors,
Mat trainDescriptors,
List<MatOfDMatch> matches,
float maxDistance,
Mat mask) {
Mat matches_mat = new Mat();
radiusMatch_1(
nativeObj,
queryDescriptors.nativeObj,
trainDescriptors.nativeObj,
matches_mat.nativeObj,
maxDistance,
mask.nativeObj);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
/**
* For each query descriptor, finds the training descriptors not farther than the specified
* distance.
*
* @param queryDescriptors Query set of descriptors.
* @param trainDescriptors Train set of descriptors. This set is not added to the train
* descriptors collection stored in the class object.
* @param matches Found matches. false, the matches vector has the same size as queryDescriptors
* rows. If compactResult is true, the matches vector does not contain matches for fully
* masked-out query descriptors.
* @param maxDistance Threshold for the distance between matched descriptors. Distance means here
* metric distance (e.g. Hamming distance), not the distance between coordinates (which is
* measured in Pixels)! descriptors.
* <p>For each query descriptor, the methods find such training descriptors that the distance
* between the query descriptor and the training descriptor is equal or smaller than
* maxDistance. Found matches are returned in the distance increasing order.
*/
public void radiusMatch(
Mat queryDescriptors, Mat trainDescriptors, List<MatOfDMatch> matches, float maxDistance) {
Mat matches_mat = new Mat();
radiusMatch_2(
nativeObj,
queryDescriptors.nativeObj,
trainDescriptors.nativeObj,
matches_mat.nativeObj,
maxDistance);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
//
// C++: void cv::DescriptorMatcher::radiusMatch(Mat queryDescriptors, vector_vector_DMatch&
// matches, float maxDistance, vector_Mat masks = vector_Mat(), bool compactResult = false)
//
/**
* @param queryDescriptors Query set of descriptors.
* @param matches Found matches.
* @param maxDistance Threshold for the distance between matched descriptors. Distance means here
* metric distance (e.g. Hamming distance), not the distance between coordinates (which is
* measured in Pixels)!
* @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
* descriptors and stored train descriptors from the i-th image trainDescCollection[i].
* @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is
* false, the matches vector has the same size as queryDescriptors rows. If compactResult is
* true, the matches vector does not contain matches for fully masked-out query descriptors.
*/
public void radiusMatch(
Mat queryDescriptors,
List<MatOfDMatch> matches,
float maxDistance,
List<Mat> masks,
boolean compactResult) {
Mat matches_mat = new Mat();
Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
radiusMatch_3(
nativeObj,
queryDescriptors.nativeObj,
matches_mat.nativeObj,
maxDistance,
masks_mat.nativeObj,
compactResult);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
/**
* @param queryDescriptors Query set of descriptors.
* @param matches Found matches.
* @param maxDistance Threshold for the distance between matched descriptors. Distance means here
* metric distance (e.g. Hamming distance), not the distance between coordinates (which is
* measured in Pixels)!
* @param masks Set of masks. Each masks[i] specifies permissible matches between the input query
* descriptors and stored train descriptors from the i-th image trainDescCollection[i]. false,
* the matches vector has the same size as queryDescriptors rows. If compactResult is true,
* the matches vector does not contain matches for fully masked-out query descriptors.
*/
public void radiusMatch(
Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance, List<Mat> masks) {
Mat matches_mat = new Mat();
Mat masks_mat = Converters.vector_Mat_to_Mat(masks);
radiusMatch_4(
nativeObj,
queryDescriptors.nativeObj,
matches_mat.nativeObj,
maxDistance,
masks_mat.nativeObj);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
/**
* @param queryDescriptors Query set of descriptors.
* @param matches Found matches.
* @param maxDistance Threshold for the distance between matched descriptors. Distance means here
* metric distance (e.g. Hamming distance), not the distance between coordinates (which is
* measured in Pixels)! descriptors and stored train descriptors from the i-th image
* trainDescCollection[i]. false, the matches vector has the same size as queryDescriptors
* rows. If compactResult is true, the matches vector does not contain matches for fully
* masked-out query descriptors.
*/
public void radiusMatch(Mat queryDescriptors, List<MatOfDMatch> matches, float maxDistance) {
Mat matches_mat = new Mat();
radiusMatch_5(nativeObj, queryDescriptors.nativeObj, matches_mat.nativeObj, maxDistance);
Converters.Mat_to_vector_vector_DMatch(matches_mat, matches);
matches_mat.release();
}
//
// C++: void cv::DescriptorMatcher::read(FileNode arg1)
//
// Unknown type 'FileNode' (I), skipping the function
//
// C++: void cv::DescriptorMatcher::read(String fileName)
//
public void read(String fileName) {
read_0(nativeObj, fileName);
}
//
// C++: void cv::DescriptorMatcher::train()
//
/**
* Trains a descriptor matcher
*
* <p>Trains a descriptor matcher (for example, the flann index). In all methods to match, the
* method train() is run every time before matching. Some descriptor matchers (for example,
* BruteForceMatcher) have an empty implementation of this method. Other matchers really train
* their inner structures (for example, FlannBasedMatcher trains flann::Index ).
*/
public void train() {
train_0(nativeObj);
}
//
// C++: void cv::DescriptorMatcher::write(Ptr_FileStorage fs, String name = String())
//
// Unknown type 'Ptr_FileStorage' (I), skipping the function
//
// C++: void cv::DescriptorMatcher::write(String fileName)
//
public void write(String fileName) {
write_0(nativeObj, fileName);
}
@Override
protected void finalize() throws Throwable {
delete(nativeObj);
}
// C++: Ptr_DescriptorMatcher cv::DescriptorMatcher::clone(bool emptyTrainData = false)
private static native long clone_0(long nativeObj, boolean emptyTrainData);
private static native long clone_1(long nativeObj);
// C++: static Ptr_DescriptorMatcher cv::DescriptorMatcher::create(DescriptorMatcher_MatcherType
// matcherType)
private static native long create_0(int matcherType);
// C++: static Ptr_DescriptorMatcher cv::DescriptorMatcher::create(String descriptorMatcherType)
private static native long create_1(String descriptorMatcherType);
// C++: bool cv::DescriptorMatcher::empty()
private static native boolean empty_0(long nativeObj);
// C++: bool cv::DescriptorMatcher::isMaskSupported()
private static native boolean isMaskSupported_0(long nativeObj);
// C++: vector_Mat cv::DescriptorMatcher::getTrainDescriptors()
private static native long getTrainDescriptors_0(long nativeObj);
// C++: void cv::DescriptorMatcher::add(vector_Mat descriptors)
private static native void add_0(long nativeObj, long descriptors_mat_nativeObj);
// C++: void cv::DescriptorMatcher::clear()
private static native void clear_0(long nativeObj);
// C++: void cv::DescriptorMatcher::knnMatch(Mat queryDescriptors, Mat trainDescriptors,
// vector_vector_DMatch& matches, int k, Mat mask = Mat(), bool compactResult = false)
private static native void knnMatch_0(
long nativeObj,
long queryDescriptors_nativeObj,
long trainDescriptors_nativeObj,
long matches_mat_nativeObj,
int k,
long mask_nativeObj,
boolean compactResult);
private static native void knnMatch_1(
long nativeObj,
long queryDescriptors_nativeObj,
long trainDescriptors_nativeObj,
long matches_mat_nativeObj,
int k,
long mask_nativeObj);
private static native void knnMatch_2(
long nativeObj,
long queryDescriptors_nativeObj,
long trainDescriptors_nativeObj,
long matches_mat_nativeObj,
int k);
// C++: void cv::DescriptorMatcher::knnMatch(Mat queryDescriptors, vector_vector_DMatch& matches,
// int k, vector_Mat masks = vector_Mat(), bool compactResult = false)
private static native void knnMatch_3(
long nativeObj,
long queryDescriptors_nativeObj,
long matches_mat_nativeObj,
int k,
long masks_mat_nativeObj,
boolean compactResult);
private static native void knnMatch_4(
long nativeObj,
long queryDescriptors_nativeObj,
long matches_mat_nativeObj,
int k,
long masks_mat_nativeObj);
private static native void knnMatch_5(
long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj, int k);
// C++: void cv::DescriptorMatcher::match(Mat queryDescriptors, Mat trainDescriptors,
// vector_DMatch& matches, Mat mask = Mat())
private static native void match_0(
long nativeObj,
long queryDescriptors_nativeObj,
long trainDescriptors_nativeObj,
long matches_mat_nativeObj,
long mask_nativeObj);
private static native void match_1(
long nativeObj,
long queryDescriptors_nativeObj,
long trainDescriptors_nativeObj,
long matches_mat_nativeObj);
// C++: void cv::DescriptorMatcher::match(Mat queryDescriptors, vector_DMatch& matches,
// vector_Mat masks = vector_Mat())
private static native void match_2(
long nativeObj,
long queryDescriptors_nativeObj,
long matches_mat_nativeObj,
long masks_mat_nativeObj);
private static native void match_3(
long nativeObj, long queryDescriptors_nativeObj, long matches_mat_nativeObj);
// C++: void cv::DescriptorMatcher::radiusMatch(Mat queryDescriptors, Mat trainDescriptors,
// vector_vector_DMatch& matches, float maxDistance, Mat mask = Mat(), bool compactResult = false)
private static native void radiusMatch_0(
long nativeObj,
long queryDescriptors_nativeObj,
long trainDescriptors_nativeObj,
long matches_mat_nativeObj,
float maxDistance,
long mask_nativeObj,
boolean compactResult);
private static native void radiusMatch_1(
long nativeObj,
long queryDescriptors_nativeObj,
long trainDescriptors_nativeObj,
long matches_mat_nativeObj,
float maxDistance,
long mask_nativeObj);
private static native void radiusMatch_2(
long nativeObj,
long queryDescriptors_nativeObj,
long trainDescriptors_nativeObj,
long matches_mat_nativeObj,
float maxDistance);
// C++: void cv::DescriptorMatcher::radiusMatch(Mat queryDescriptors, vector_vector_DMatch&
// matches, float maxDistance, vector_Mat masks = vector_Mat(), bool compactResult = false)
private static native void radiusMatch_3(
long nativeObj,
long queryDescriptors_nativeObj,
long matches_mat_nativeObj,
float maxDistance,
long masks_mat_nativeObj,
boolean compactResult);
private static native void radiusMatch_4(
long nativeObj,
long queryDescriptors_nativeObj,
long matches_mat_nativeObj,
float maxDistance,
long masks_mat_nativeObj);
private static native void radiusMatch_5(
long nativeObj,
long queryDescriptors_nativeObj,
long matches_mat_nativeObj,
float maxDistance);
// C++: void cv::DescriptorMatcher::read(String fileName)
private static native void read_0(long nativeObj, String fileName);
// C++: void cv::DescriptorMatcher::train()
private static native void train_0(long nativeObj);
// C++: void cv::DescriptorMatcher::write(String fileName)
private static native void write_0(long nativeObj, String fileName);
// native support for java finalize()
private static native void delete(long nativeObj);
}
| 40.322384 | 100 | 0.715975 |
ad7db6b211f27f583fc2080dd618a56cdb30ee8d
| 212 |
package wcsdata.xmen.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import wcsdata.xmen.entity.Message;
public interface MessageRepository extends JpaRepository<Message, Integer> {
}
| 26.5 | 76 | 0.839623 |
c96a72dbd5bf91b9c05191574b208674dff72c31
| 14,401 |
/*
* ============LICENSE_START==========================================
* ONAP Portal SDK
* ===================================================================
* Copyright © 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
* you may not use this software except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Unless otherwise specified, all documentation contained herein is licensed
* under the Creative Commons License, Attribution 4.0 Intl. (the "License");
* you may not use this documentation except in compliance with the License.
* You may obtain a copy of the License at
*
* https://creativecommons.org/licenses/by/4.0/
*
* Unless required by applicable law or agreed to in writing, documentation
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* ============LICENSE_END============================================
*
* ECOMP is a trademark and service mark of AT&T Intellectual Property.
*/
package org.onap.portalsdk.analytics.gmap.map;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashSet;
import javax.servlet.http.HttpServletRequest;
import org.onap.portalsdk.analytics.gmap.line.Line;
import org.onap.portalsdk.analytics.gmap.line.LineInfo;
import org.onap.portalsdk.analytics.gmap.map.layer.SwingLayer;
import org.onap.portalsdk.analytics.gmap.node.Node;
import org.onap.portalsdk.analytics.gmap.node.NodeInfo;
import org.onap.portalsdk.analytics.system.fusion.adapter.FusionAdapter;
import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
public class NovaMap {
private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(NovaMap.class);
private static int[] shapeWidth;
public static final Font TEXT_FONT = new Font("sans-serif", Font.BOLD, 12);
public static final Font HEADER_FONT = new Font("sans-serif", Font.ITALIC + Font.BOLD, 12);
private HashSet<String> showList;
private ArrayList<SwingLayer> swingLayers;
private AffineTransform transform;
private Node node;
private Line line;
private ColorProperties colorProperties;
private Rectangle2D defaultBoundary;
private int zoomLevel;
private String currentYearMonth;
private String dataLoaded = "";
/**
* size in screen pixel
*/
private Rectangle boundingBox;
/**
* size in pixel web mercator projection
*/
private Rectangle2D mapArea;
/**
* size in longitude latitude
*/
private Rectangle2D geoArea;
public static double[] meter2pixel;
private boolean showLegend = false;
static {
initShapeWidth();
initMeter2Pixel();
}
private static void initMeter2Pixel() {
meter2pixel = new double[MapConstant.ZOOM_MAX - MapConstant.ZOOM_MIN + 1];
meter2pixel[0] = 156543.04 / 2;
for (int i = 1; i < meter2pixel.length; ++i)
meter2pixel[i] = meter2pixel[i - 1] / 2;
}
private static void initShapeWidth() {
// ZOOM_MAX+1 is added to below line because of ArrayIndexOutOfException. This
// is Suggested by Hendra Tuty. - Sundar
shapeWidth = new int[MapConstant.ZOOM_MAX];
int width = 0;
for (int i = 0; i < shapeWidth.length; i++) {
if (i < 5) {
} else if (i == 5) {
width = 4;
} else if (i > 4 && i < 10) {
width += 2;
} else {
width++;
}
shapeWidth[i] = width;
}
}
public NovaMap() {
boundingBox = new Rectangle();
mapArea = new Rectangle2D.Double();
geoArea = new Rectangle2D.Double();
showList = new HashSet<String>();
swingLayers = new ArrayList<SwingLayer>();
}
public int getBestZoomLevel(double Latitude1, double Longitude1, double Latitude2, double Longitude2, double height,
double width) {
if (height == 0)
height = 700;
if (width == 0)
width = 1200;
double lat1 = Math.min(Latitude1, Latitude1);
double CosLat = Math.cos(Math.toRadians(lat1));
double Wmeter = getDistance(lat1, Longitude1, lat1, Longitude2) / CosLat;
double Hmeter = getDistance(Latitude1, Longitude1, Latitude2, Longitude1) / CosLat;
int zoom = 0;
if (Latitude1 == Latitude2 && Longitude1 == Longitude2)
zoom = 15;
if (zoom <= 0) {
for (; zoom < meter2pixel.length && (width * meter2pixel[zoom]) > Wmeter
&& (height * meter2pixel[zoom]) > Hmeter; ++zoom)
;
}
// && (1200*meter2pixel[zoom]) > Wmeter
// && (700*meter2pixel[zoom]) > Hmeter;
return zoom + MapConstant.ZOOM_MIN - 1;
}
public static double getDistance(double Latitude1, double Longitude1, double Latitude2, double Longitude2) {
Latitude1 = Math.toRadians(Latitude1);
Longitude1 = Math.toRadians(Longitude1);
Latitude2 = Math.toRadians(Latitude2);
Longitude2 = Math.toRadians(Longitude2);
final double R = 6371.0; // earth's mean radius in km
double dSinLat05 = Math.sin((Latitude2 - Latitude1) / 2);
double dSinLong05 = Math.sin((Longitude2 - Longitude1) / 2);
double a = dSinLat05 * dSinLat05 + Math.cos(Latitude1) * Math.cos(Latitude2) * dSinLong05 * dSinLong05;
double c = (0 == a || 1 == a) ? 0 : 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1.0 - a));
return R * c * 1000.0; // in meters
}
public Rectangle getBoundingBox() {
return boundingBox;
}
public void setBoundingBox(int width, int height) {
boundingBox.setSize(width, height);
}
public void setNode(Node node) {
this.node = node;
}
public Node getNode() {
return node;
}
public void setLine(Line line) {
this.line = line;
}
public Line getLine() {
return line;
}
public void setColorProperties(ColorProperties colorProperties) {
this.colorProperties = colorProperties;
}
public ColorProperties getColorProperties() {
return colorProperties;
}
public void setZoomLevel(int zoomLevel) {
this.zoomLevel = zoomLevel;
}
public int getZoomLevel() {
return zoomLevel;
}
public void addShowList(String type) {
showList.add(type.toUpperCase());
}
public void addShowList(String type, int number) {
showList.add(type.toUpperCase() + ":" + number);
}
public void removeShowList(String type) {
showList.remove(type.toUpperCase());
}
public void removeShowList(String type, int number) {
showList.remove(type.toUpperCase() + ":" + number);
}
public void clearShowList() {
showList.clear();
}
public HashSet getShowList() {
return showList;
}
public boolean containsShowList(String type) {
return showList.contains(type.toUpperCase());
}
public boolean containsShowList(String type, int number) {
return showList.contains(type.toUpperCase() + ":" + number);
}
public int getShowListSize() {
return showList.size();
}
public void addSwingLayer(SwingLayer swingLayer) {
swingLayers.add(swingLayer);
}
public void removeSwingLayer(SwingLayer swingLayer) {
swingLayers.remove(swingLayer);
}
public void clearSwingLayers() {
swingLayers.clear();
}
public ArrayList<SwingLayer> getSwingLayers() {
return swingLayers;
}
public int getShapeWidth() {
return shapeWidth[getZoomLevel() >= 22 ? 21 : (getZoomLevel() <= 8 ? 8 : getZoomLevel())];
}
public Point2D getPixelPos(double latitude, double longitude) {
double sinLatitude = Math.sin(Math.toRadians(latitude));
return new Point2D.Double(((longitude + 180.0) / 360.0) * 256.0 * (1 << zoomLevel),
(0.5 - Math.log((1.0 + sinLatitude) / (1.0 - sinLatitude)) / (4.0 * Math.PI)) * 256.0
* (1 << zoomLevel));
}
private boolean checkTransform(Rectangle2D geoArea) {
System.out.println("%%%%%%map.checkTransform start");
if (!this.geoArea.equals(geoArea)) {
Point2D point1 = getPixelPos(geoArea.getMinY(), geoArea.getMinX());
Point2D point2 = getPixelPos(geoArea.getMaxY(), geoArea.getMaxX());
mapArea.setRect(point1.getX(), point2.getY(), boundingBox.getWidth(), boundingBox.getHeight());
this.geoArea.setRect(geoArea);
resetTransform(boundingBox, mapArea);
System.out.println("%%%%%%map.checkTransform end 1");
return true;
}
System.out.println("%%%%%%map.checkTransform end 2");
return false;
}
private void resetTransform(Rectangle boundingBox, Rectangle2D mapArea) {
System.out.println("%%%%%%map.resetTransform start");
if (mapArea == null || boundingBox.getWidth() == 0 || boundingBox.getHeight() == 0) {
System.out.println("%%%%%%map.resetTransform end 1");
return;
}
transform = new AffineTransform(mapArea.getWidth() / boundingBox.getWidth(), 0.0, 0.0,
mapArea.getHeight() / boundingBox.getHeight(), mapArea.getMinX(), mapArea.getMinY());
System.out.println("%%%%%%map.resetTransform end 2");
}
protected AffineTransform getTransform() {
if (transform != null) {
return new AffineTransform(transform);
}
return null;
}
public Point2D getScreenPointFromPixel(double xPixel, double yPixel) {
try {
return getTransform().inverseTransform(new Point2D.Double(xPixel, yPixel), null);
} catch (NoninvertibleTransformException ex) {
logger.error(EELFLoggerDelegate.errorLogger, "getScreenPointFromPixel () failed ", ex);
}
return null;
}
public Point2D getScreenPointFromLonLat(double longitude, double latitude) {
Point2D point = getPixelPos(latitude, longitude);
return getScreenPointFromPixel(point.getX(), point.getY());
}
public Point2D getLonLatFromPixel(int x1, int y1) {
double x = (double) x1 / 256;
double y = (double) y1 / 256;
double lon = -180; // x
double lonWidth = 360; // width 360
// double lat = -90; // y
// double latHeight = 180; // height 180
double lat = -1;
double latHeight = 2;
int tilesAtThisZoom = 1 << getZoomLevel();
lonWidth = 360.0 / tilesAtThisZoom;
lon = -180 + (x * lonWidth);
latHeight = -2.0 / tilesAtThisZoom;
lat = 1 + (y * latHeight);
// convert lat and latHeight to degrees in a transverse mercator projection
// note that in fact the coordinates go from about -85 to +85 not -90 to 90!
latHeight += lat;
latHeight = (2 * Math.atan(Math.exp(Math.PI * latHeight))) - (Math.PI / 2);
latHeight *= (180 / Math.PI);
lat = (2 * Math.atan(Math.exp(Math.PI * lat))) - (Math.PI / 2);
lat *= (180 / Math.PI);
latHeight -= lat;
if (lonWidth < 0) {
lon = lon + lonWidth;
lonWidth = -lonWidth;
}
if (latHeight < 0) {
lat = lat + latHeight;
latHeight = -latHeight;
}
return new Point2D.Double(lon, lat + latHeight);
}
public ArrayList getImage(final HttpServletRequest request, Rectangle2D geoArea) {
Object showListArr[] = ((HashSet) getShowList()).toArray();
BufferedImage image = new BufferedImage(boundingBox.width, boundingBox.height, BufferedImage.TYPE_INT_ARGB);
final Graphics2D g2d = image.createGraphics();
// LEGEND INFO
BufferedImage legendImage = null;
Graphics2D g2Legend = null;
if (showLegend) {
legendImage = new BufferedImage(boundingBox.width, (int) (20 * showListArr.length) + 20,
BufferedImage.TYPE_INT_ARGB);
g2Legend = legendImage.createGraphics();
g2Legend.setBackground(Color.WHITE);
}
checkTransform(geoArea);
boolean swingLayerPainted = false;
Object object = request.getAttribute("server_process_interrupted");
if (object != null && ((Boolean) object)) {
System.out.println("interrupted");
g2d.dispose();
return null;
}
for (SwingLayer layer : swingLayers) {
swingLayerPainted = swingLayerPainted || layer.paintLayer(request, g2d, boundingBox, mapArea, g2Legend);
}
ArrayList imageArr = new ArrayList();
// if(showLegend) layer.paintLegend(g2Legend);
g2d.dispose();
if (showLegend && g2Legend != null)
g2Legend.dispose();
object = request.getAttribute("server_process_interrupted");
if (object != null && ((Boolean) object)) {
System.out.println("interrupted");
return imageArr;
} else if (!swingLayerPainted) {
System.out.println("not painted");
return imageArr;
}
imageArr.add(image);
if (g2Legend != null) {
imageArr.add(legendImage);
}
return imageArr;
}
public Object singleLeftClick(double longitude, double latitude, Rectangle2D geoArea) {
System.out.println("%%%%%%map.singleLeftClick start");
System.out.println("%%%%%%map.singleLeftClick check transform start");
checkTransform(geoArea);
System.out.println("%%%%%%map.singleLeftClick check transform end");
Point2D screenPoint = getScreenPointFromLonLat(longitude, latitude);
System.out.println("%%%%%%map.singleLeftClick getting nodeExist array ");
ArrayList<NodeInfo> existNodeInfo = node.nodeExist(screenPoint);
if (existNodeInfo == null) {
ArrayList<LineInfo> existLineInfo = line.lineExist(screenPoint);
if (existLineInfo == null) {
} else {
System.out.println("%%%%%%map.singleLeftClick end 1");
return existLineInfo;
}
} else {
System.out.println("%%%%%%map.singleLeftClick end 2");
return existNodeInfo;
}
System.out.println("%%%%%%map.singleLeftClick end 3");
return null;
}
public String getCurrentYearMonth() {
return currentYearMonth;
}
public void setCurrentYearMonth(String currentYearMonth) {
this.currentYearMonth = currentYearMonth;
}
public Rectangle2D getDefaultBoundary() {
return defaultBoundary;
}
public void setDefaultBoundary(Rectangle2D defaultBoundary) {
this.defaultBoundary = defaultBoundary;
}
public boolean isShowLegend() {
return showLegend;
}
public void setShowLegend(boolean showLegend) {
this.showLegend = showLegend;
}
public String getDataLoaded() {
return dataLoaded;
}
public void setDataLoaded(String dataLoaded) {
this.dataLoaded = dataLoaded;
}
}
| 29.092929 | 117 | 0.696271 |
0bd3b26e6858534ee6054dbac1eebf02b1d89957
| 2,347 |
package com.nxus.measurement.tracking;
import java.io.IOException;
import com.google.android.gms.ads.identifier.AdvertisingIdClient;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.nxus.measurement.dto.DataContainer;
import com.nxus.measurement.dto.DataKeys;
import com.nxus.measurement.logging.Logger;
import android.content.Context;
import android.os.AsyncTask;
/**
* Reading GoogleAdvertiserId from AdvertisingIdClient. Only when Play Store is installed on device - Google Play services available.
* @author TechMpire Ltd.
*/
public class GetAsyncGoogleAdvertiserId extends AsyncTask<Void, Void, String> {
public static final Logger log = Logger.getLog(GetAsyncGoogleAdvertiserId.class);
final Context ctx;
private GoogleAdvertisingTaskPlayReferrerDelegate delegate;
public GetAsyncGoogleAdvertiserId(GoogleAdvertisingTaskPlayReferrerDelegate taskDelegate, Context context) {
super();
ctx = context;
delegate = taskDelegate;
}
protected String doInBackground(Void... params) {
AdvertisingIdClient.Info idInfo = null;
try {
idInfo = AdvertisingIdClient.getAdvertisingIdInfo(ctx);
} catch (GooglePlayServicesNotAvailableException e) {
log.error(e.getMessage(), e);
} catch (GooglePlayServicesRepairableException e) {
log.error(e.getMessage(), e);
} catch (IOException e) {
log.error(e.getMessage(), e);
}
String advertId = "";
try {
advertId = idInfo.getId();
} catch (NullPointerException e){
log.error(e.getMessage(), e);
}
return advertId;
}
/**
* Calling onTaskCompletionResult method on GoogleAdvertisingTaskPlayReferrerDelegate (i.e. TrackingWorker) to continue with sending event after ID is resolved.
* @param advert
*/
@Override
protected void onPostExecute (String advert) {
log.debug("onPostExecute: " + advert);
DataContainer.getInstance().storeValueString(DataKeys.GOOGLE_ADVERTISER_ID, advert, ctx);
DataContainer.getInstance().storeValueBoolean(DataKeys.GOOGLE_AAID_FETCHED, true, ctx);
delegate.onTaskCompletionResult();
}
}
| 36.107692 | 164 | 0.711973 |
e3daa642318cb98e69e6dde4328ab8ac41f4181d
| 1,600 |
// Copyright Eagle Legacy Modernization LLC, 2010-date
// Original author: Steven A. O'Hara, Sep 25, 2011
package com.eagle.programmar.RPG.Specifications;
import com.eagle.programmar.RPG.Terminals.RPG_Blanks;
import com.eagle.programmar.RPG.Terminals.RPG_Keyword;
import com.eagle.programmar.RPG.Terminals.RPG_KeywordChoice;
import com.eagle.programmar.RPG.Terminals.RPG_Literal;
import com.eagle.programmar.RPG.Terminals.RPG_Number;
import com.eagle.tokens.TokenSequence;
public class RPG_E_Extension_Specification extends TokenSequence
{
public RPG_Keyword E = new RPG_Keyword(6, 6, "E");
public RPG_Blanks blank1 = new RPG_Blanks(7, 10);
public @OPT RPG_Literal fromFileName = new RPG_Literal(11, 18);
public @OPT RPG_Literal toFileName = new RPG_Literal(19, 26);
public RPG_Literal arrayTable1 = new RPG_Literal(27, 32);
public RPG_Number entries = new RPG_Number(36, 39);
public RPG_Number length1 = new RPG_Number(40, 42);
public @OPT RPG_KeywordChoice dataFormat1 = new RPG_KeywordChoice(43, 43, "P", "B", "L", "R");
public @OPT RPG_Number positions1 = new RPG_Number(44, 44);
public @OPT RPG_KeywordChoice sequence1 = new RPG_KeywordChoice(45, 45, "A", "D");
public RPG_Literal arrayTable2 = new RPG_Literal(46, 51);
public RPG_Number length2 = new RPG_Number(52, 54);
public @OPT RPG_KeywordChoice dataFormat2 = new RPG_KeywordChoice(55, 55, "P", "B", "L", "R");
public @OPT RPG_Number positions2 = new RPG_Number(56, 56);
public @OPT RPG_KeywordChoice sequence2 = new RPG_KeywordChoice(57, 57, "A", "D");
public @OPT RPG_Literal comments = new RPG_Literal(58, 74);
}
| 45.714286 | 95 | 0.76625 |
03f8580e4976ef4714f06676d45184c4378c840e
| 4,623 |
/*
* MIT License
*
* Copyright (c) 2016 Eric
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.EricSun.EricWidget.Widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import java.util.List;
/**
* 自定义的View,实现ListView A~Z快速索引效果
*
* @author Folyd
*
*/
public class SlideBar extends View {
private Paint paint = new Paint();
private OnTouchLetterChangeListenner listenner;
// 是否画出背景
private boolean showBg = false;
// 选中的项
private int choose = -1;
// 准备好的A~Z的字母数组
public List<String> letters;
/*
* public static String[] letters = { "#", "A", "B", "C", "D", "E", "F",
* "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T",
* "U", "V", "W", "X", "Y", "Z" };
*/
// 构造方法
public SlideBar(Context context) {
super(context);
}
public SlideBar(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// 获取宽和高
int width = getWidth();
int height = getHeight();
if (showBg) {
// 画出背景
canvas.drawColor(Color.parseColor("#55000000"));
}
if (letters == null)
return;
// 每个字母的高度
int singleHeight = height / letters.size();
// 画字母
for (int i = 0; i < letters.size(); i++) {
paint.setColor(Color.BLACK);
// 设置字体格式
paint.setTypeface(Typeface.DEFAULT_BOLD);
paint.setAntiAlias(true);
paint.setTextSize(20f);
// 如果这一项被选中,则换一种颜色画
if (i == choose) {
paint.setColor(Color.parseColor("#F88701"));
paint.setFakeBoldText(true);
}
// 要画的字母的x,y坐标
float posX = width / 2 - paint.measureText(letters.get(i)) / 2;
float posY = i * singleHeight + singleHeight;
// 画出字母
canvas.drawText(letters.get(i), posX, posY, paint);
// 重新设置画笔
paint.reset();
}
}
/**
* 处理SlideBar的状态
*/
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
final float y = event.getY();
// 算出点击的字母的索引
final int index = (int) (y / getHeight() * letters.size());
// 保存上次点击的字母的索引到oldChoose
final int oldChoose = choose;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
showBg = true;
if (oldChoose != index && listenner != null && index > 0
&& index < letters.size()) {
choose = index;
listenner.onTouchLetterChange(showBg, letters.get(index));
invalidate();
}
break;
case MotionEvent.ACTION_MOVE:
if (oldChoose != index && listenner != null && index > 0
&& index < letters.size()) {
choose = index;
listenner.onTouchLetterChange(showBg, letters.get(index));
invalidate();
}
break;
case MotionEvent.ACTION_UP:
showBg = false;
choose = -1;
if (listenner != null) {
if (index <= 0) {
listenner.onTouchLetterChange(showBg, letters.get(0));
} else if (index > 0 && index < letters.size()) {
listenner.onTouchLetterChange(showBg, letters.get(index));
} else if (index >= letters.size()) {
listenner.onTouchLetterChange(showBg,
letters.get(letters.size() - 1));
}
}
invalidate();
break;
}
return true;
}
/**
* 回调方法,注册监听器
*
* @param listenner
*/
public void setOnTouchLetterChangeListenner(
OnTouchLetterChangeListenner listenner) {
this.listenner = listenner;
}
/**
* SlideBar 的监听器接口
*
* @author Folyd
*
*/
public interface OnTouchLetterChangeListenner {
void onTouchLetterChange(boolean isTouched, String s);
}
}
| 26.118644 | 81 | 0.669911 |
f386c7612c1c1f3524abbbc2be79fd61ab3ffeb0
| 353 |
package com.splashbase.api;
import com.google.gson.annotations.SerializedName;
public class PictureSet {
@SerializedName("images")
public Picture[] images;
public PictureSet() {
}
public Picture[] getImages() {
return images;
}
public void setImages(Picture[] images) {
this.images = images;
}
}
| 14.708333 | 50 | 0.637394 |
5c1372ad76e9b9878fd04ed27d0e1360f14dceb0
| 9,002 |
/*
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.bigtable.data.v2.models;
import com.google.api.core.BetaApi;
import com.google.api.core.InternalApi;
import com.google.bigtable.v2.Mutation.DeleteFromColumn;
import com.google.bigtable.v2.Mutation.DeleteFromFamily;
import com.google.bigtable.v2.Mutation.DeleteFromRow;
import com.google.bigtable.v2.Mutation.SetCell;
import com.google.cloud.bigtable.data.v2.models.Range.TimestampRange;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.protobuf.ByteString;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.List;
import javax.annotation.Nonnull;
/**
* The concrete implementation of {@link MutationApi} that can be used to create and represent a
* list of mutations. It used by {@link RowMutation} and {@link ConditionalRowMutation} to
* encapsulate a list of mutations that will to be applied to a single row.
*/
public final class Mutation implements MutationApi<Mutation>, Serializable {
private static final long serialVersionUID = 5893216644683374340L;
@InternalApi("Visible for testing")
static final int MAX_MUTATIONS = 100_000;
@InternalApi("Visible for testing")
static final int MAX_BYTE_SIZE = 200 * 1024 * 1024;
@InternalApi("Visible for testing")
static final long SERVER_SIDE_TIMESTAMP = -1;
private final boolean allowServersideTimestamp;
private transient ImmutableList.Builder<com.google.bigtable.v2.Mutation> mutations =
ImmutableList.builder();
private int numMutations;
private long byteSize;
/** Creates new instance of Mutation object. */
public static Mutation create() {
return new Mutation(false);
}
/**
* Creates new instance of Mutation object which allows setCell operation to use server side
* timestamp. This is dangerous because mutations will no longer be idempotent, which might cause
* multiple duplicate values to be stored in Bigtable. This option should only be used for
* advanced usecases with extreme care.
*/
@BetaApi
public static Mutation createUnsafe() {
return new Mutation(true);
}
/**
* Wraps the List of protobuf {@link com.google.bigtable.v2.Mutation}. This methods, like {@link
* #createUnsafe()}, allows setCell operation to use server side timestamp. This is dangerous
* because mutations will no longer be idempotent, which might cause multiple duplicate values to
* be stored in Bigtable. This option should only be used for advanced usecases with extreme care.
*/
@BetaApi
public static Mutation fromProtoUnsafe(List<com.google.bigtable.v2.Mutation> protos) {
Mutation mutation = new Mutation(true);
mutation.mutations.addAll(protos);
return mutation;
}
private Mutation(boolean allowServersideTimestamp) {
this.allowServersideTimestamp = allowServersideTimestamp;
}
private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException {
input.defaultReadObject();
@SuppressWarnings("unchecked")
ImmutableList<com.google.bigtable.v2.Mutation> deserialized =
(ImmutableList<com.google.bigtable.v2.Mutation>) input.readObject();
this.mutations = ImmutableList.<com.google.bigtable.v2.Mutation>builder().addAll(deserialized);
}
private void writeObject(ObjectOutputStream output) throws IOException {
output.defaultWriteObject();
output.writeObject(mutations.build());
}
@Override
public Mutation setCell(
@Nonnull String familyName, @Nonnull String qualifier, @Nonnull String value) {
return setCell(familyName, wrapByteString(qualifier), wrapByteString(value));
}
@Override
public Mutation setCell(
@Nonnull String familyName,
@Nonnull String qualifier,
long timestamp,
@Nonnull String value) {
return setCell(familyName, wrapByteString(qualifier), timestamp, wrapByteString(value));
}
@Override
public Mutation setCell(
@Nonnull String familyName, @Nonnull ByteString qualifier, @Nonnull ByteString value) {
long timestamp = System.currentTimeMillis() * 1_000;
return setCell(familyName, qualifier, timestamp, value);
}
@Override
public Mutation setCell(
@Nonnull String familyName,
@Nonnull ByteString qualifier,
long timestamp,
@Nonnull ByteString value) {
Validations.validateFamily(familyName);
Preconditions.checkNotNull(qualifier, "qualifier can't be null.");
Preconditions.checkNotNull(value, "value can't be null.");
if (!allowServersideTimestamp) {
Preconditions.checkArgument(
timestamp != SERVER_SIDE_TIMESTAMP, "Serverside timestamps are not supported");
}
addMutation(
com.google.bigtable.v2.Mutation.newBuilder()
.setSetCell(
SetCell.newBuilder()
.setFamilyName(familyName)
.setColumnQualifier(qualifier)
.setTimestampMicros(timestamp)
.setValue(value)
.build())
.build());
return this;
}
@Override
public Mutation deleteCells(@Nonnull String familyName, @Nonnull String qualifier) {
return deleteCells(familyName, wrapByteString(qualifier));
}
@Override
public Mutation deleteCells(@Nonnull String familyName, @Nonnull ByteString qualifier) {
Validations.validateFamily(familyName);
Preconditions.checkNotNull(qualifier, "qualifier can't be null.");
return deleteCells(familyName, qualifier, TimestampRange.unbounded());
}
@Override
public Mutation deleteCells(
@Nonnull String familyName,
@Nonnull ByteString qualifier,
@Nonnull TimestampRange timestampRange) {
Validations.validateFamily(familyName);
Preconditions.checkNotNull(qualifier, "qualifier can't be null.");
Preconditions.checkNotNull(timestampRange, "timestampRange can't be null.");
DeleteFromColumn.Builder builder =
DeleteFromColumn.newBuilder().setFamilyName(familyName).setColumnQualifier(qualifier);
switch (timestampRange.getStartBound()) {
case CLOSED:
builder.getTimeRangeBuilder().setStartTimestampMicros(timestampRange.getStart());
break;
case OPEN:
builder.getTimeRangeBuilder().setStartTimestampMicros(timestampRange.getStart() + 1);
break;
case UNBOUNDED:
break;
default:
throw new IllegalArgumentException(
"Unknown start bound: " + timestampRange.getStartBound());
}
switch (timestampRange.getEndBound()) {
case CLOSED:
builder.getTimeRangeBuilder().setEndTimestampMicros(timestampRange.getEnd() + 1);
break;
case OPEN:
builder.getTimeRangeBuilder().setEndTimestampMicros(timestampRange.getEnd());
break;
case UNBOUNDED:
break;
default:
throw new IllegalArgumentException("Unknown end bound: " + timestampRange.getEndBound());
}
addMutation(
com.google.bigtable.v2.Mutation.newBuilder().setDeleteFromColumn(builder.build()).build());
return this;
}
@Override
public Mutation deleteFamily(@Nonnull String familyName) {
Validations.validateFamily(familyName);
addMutation(
com.google.bigtable.v2.Mutation.newBuilder()
.setDeleteFromFamily(DeleteFromFamily.newBuilder().setFamilyName(familyName).build())
.build());
return this;
}
@Override
public Mutation deleteRow() {
addMutation(
com.google.bigtable.v2.Mutation.newBuilder()
.setDeleteFromRow(DeleteFromRow.getDefaultInstance())
.build());
return this;
}
private void addMutation(com.google.bigtable.v2.Mutation mutation) {
Preconditions.checkState(numMutations + 1 <= MAX_MUTATIONS, "Too many mutations per row");
Preconditions.checkState(
byteSize + mutation.getSerializedSize() <= MAX_BYTE_SIZE,
"Byte size of mutations is too large");
numMutations++;
byteSize += mutation.getSerializedSize();
mutations.add(mutation);
}
private static ByteString wrapByteString(String str) {
if (str == null) {
return null;
} else {
return ByteString.copyFromUtf8(str);
}
}
/** Returns the mutation protos. */
List<com.google.bigtable.v2.Mutation> getMutations() {
return mutations.build();
}
}
| 34.358779 | 100 | 0.718618 |
fcc70a7463640509e457afeb6ad05b3cf737e608
| 1,075 |
package com.library.repository.models;
import java.util.List;
/**
* @author yedeman
* @date 2020/6/18.
* email:ydmmocoo@gmail.com
* description:
*/
public class CheckGoodsBean {
private List<ErrorsBean> errors;
public List<ErrorsBean> getErrors() {
return errors;
}
public void setErrors(List<ErrorsBean> errors) {
this.errors = errors;
}
public static class ErrorsBean {
/**
* gId : 29
* tip : 该规格库存不足,剩余-1件
* gName : 树莓慕斯蛋糕
*/
private String gId;
private String tip;
private String gName;
public String getGId() {
return gId;
}
public void setGId(String gId) {
this.gId = gId;
}
public String getTip() {
return tip;
}
public void setTip(String tip) {
this.tip = tip;
}
public String getGName() {
return gName;
}
public void setGName(String gName) {
this.gName = gName;
}
}
}
| 18.220339 | 52 | 0.52093 |
cb3a4a988cdedca6b6743802f90bc6489e0a05e9
| 7,090 |
package org.mjd.nativesocket.internal.sockets.posix;
import java.net.Socket;
import java.nio.channels.SocketChannel;
import com.google.common.primitives.Ints;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.IntByReference;
import org.mjd.nativesocket.NativeSocket;
import org.mjd.nativesocket.TimeDuration;
import org.mjd.nativesocket.internal.fd.FileDescriptorAccessor;
import org.mjd.nativesocket.internal.fd.FileDescriptorAccessor.FileDescriptorException;
import org.mjd.nativesocket.internal.jna.CBool;
import org.mjd.nativesocket.internal.jna.StandardLib;
import org.mjd.nativesocket.staticfactories.NativeSocketStaticFactory;
/**
* {@link NativeSocket} implementation for POSIX compliant socket.
*
* Uses JNA and the standard C library to provide functionality for an OS agnostic POSIX compliant socket.
*/
public final class PosixSocket implements NativeSocket
{
private static final int SOL_SOCKET = 1;
private static final int SOL_TCP = 6;
private static final int TCP_KEEPIDLE = 4;
private static final int TCP_KEEPINTVL = 5;
private static final int TCP_KEEPCNT = 6;
private static final int SO_KEEPALIVE = 9;
private static final int SET_OPT_ERROR = -1;
private final int fd;
private final StandardLib stdLib;
private final FileDescriptorAccessor fdAccessor;
private final PosixSocketLibrary sockLib;
/**
* Do not use this directly, instead use the {@link NativeSocketStaticFactory}
*
* Constructs a {@link NativeSocket} for a Linux system, fully initialised and ready to use.
*
* <p>
* Requires the standard C library and sys/socket.h
*
* @param socket
* the socket to wrap by this {@link NativeSocket}
* @param standardLib
* strategy used to load the OS specific standard library.
* @param fileDescriptorAccessor
* strategy used to extract file descriptor.
*
* @see NativeSocket
*/
public PosixSocket(final Socket socket, StandardLib standardLib, FileDescriptorAccessor fileDescriptorAccessor)
{
this.stdLib = standardLib;
this.fdAccessor = fileDescriptorAccessor;
try
{
sockLib = stdLib.loadStandardLibrary(PosixSocketLibrary.class);
fd = Ints.checkedCast(fdAccessor.extractFileDescriptor(socket));
}
catch (FileDescriptorException e)
{
throw new IllegalStateException("The file descriptor cannot be determined for the given socket", e);
}
}
/**
* Do not use this directly, instead use the {@link NativeSocketStaticFactory}
*
* Constructs a {@link NativeSocket} for a Linux system, fully initialised and ready to use.
*
* <p>
* Requires the standard C library and sys/socket.h
*
* @param socketChannel
* the socketChannel to wrap by this {@link NativeSocket}
* @param standardLib
* strategy used to load the OS specific standard library.
* @param fileDescriptorAccessor
* strategy used to extract file descriptor.
*
* @see NativeSocket
*/
public PosixSocket(final SocketChannel socketChannel, StandardLib standardLib, FileDescriptorAccessor fileDescriptorAccessor)
{
this.stdLib = standardLib;
this.fdAccessor = fileDescriptorAccessor;
try
{
sockLib = stdLib.loadStandardLibrary(PosixSocketLibrary.class);
fd = Ints.checkedCast(fdAccessor.extractFileDescriptor(socketChannel));
}
catch (FileDescriptorException e)
{
throw new IllegalStateException("The file descriptor cannot be determined for the given socket", e);
}
}
@Override
public void setKeepAliveInterval(TimeDuration interval) {
IntByReference newInterval = new IntByReference(Ints.checkedCast(interval.getStandardSeconds()));
enableKeepAlive();
socketCall(sockLib.setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, newInterval.getPointer(), Ints.BYTES));
}
@Override
public void setKeepAliveIdleTime(TimeDuration idleTime) {
IntByReference newIdleTime = new IntByReference(Ints.checkedCast(idleTime.getStandardSeconds()));
enableKeepAlive();
socketCall(sockLib.setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, newIdleTime.getPointer(), Ints.BYTES));
}
@Override
public void setKeepAliveProbes(long probes) {
IntByReference newProbes = new IntByReference(Ints.checkedCast(probes));
enableKeepAlive();
socketCall(sockLib.setsockopt(fd, SOL_TCP, TCP_KEEPCNT, newProbes.getPointer(), Ints.BYTES));
}
@Override
public void setKeepAlive(TimeDuration idleTime, TimeDuration interval, long probes) {
IntByReference newIdleTime = new IntByReference(Ints.checkedCast(idleTime.getStandardSeconds()));
IntByReference newInterval = new IntByReference(Ints.checkedCast(interval.getStandardSeconds()));
IntByReference newProbes = new IntByReference(Ints.checkedCast(probes));
enableKeepAlive();
socketCall(sockLib.setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, newIdleTime.getPointer(), Ints.BYTES));
socketCall(sockLib.setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, newInterval.getPointer(), Ints.BYTES));
socketCall(sockLib.setsockopt(fd, SOL_TCP, TCP_KEEPCNT, newProbes.getPointer(), Ints.BYTES));
}
@Override
public KeepAliveData getKeepAliveData()
{
IntByReference enabled = new IntByReference();
IntByReference interval = new IntByReference();
IntByReference idle = new IntByReference();
IntByReference probes = new IntByReference();
Pointer optionLen = new IntByReference(Ints.BYTES).getPointer();
socketCall(sockLib.getsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, enabled.getPointer(), optionLen));
socketCall(sockLib.getsockopt(fd, SOL_TCP, TCP_KEEPINTVL, interval.getPointer(), optionLen));
socketCall(sockLib.getsockopt(fd, SOL_TCP, TCP_KEEPIDLE, idle.getPointer(), optionLen));
socketCall(sockLib.getsockopt(fd, SOL_TCP, TCP_KEEPCNT, probes.getPointer(), optionLen));
return new KeepAliveData(CBool.fromInt(enabled.getValue()).toBoolean(), probes.getValue(), interval.getValue(),
idle.getValue());
}
private void enableKeepAlive()
{
socketCall(sockLib.setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, CBool.TRUE_PTR, CBool.SIZE));
}
/**
* Processes the last OS error and throw an {@link IllegalStateException} when there is an error on a
* native socket library call. Used to handle return codes from C calls to socket related functions.
*
* @param result
* the return code.
*/
public static void socketCall(int result)
{
if (result == SET_OPT_ERROR)
{
throw new IllegalStateException("Setting socket option failed; the last OS error = " +
Native.getLastError());
}
}
}
| 39.831461 | 129 | 0.692948 |
2653bce17e25a18eab0b23440a3504da6f3fb06f
| 1,326 |
package com.dadoutek.dev.springboot;
/**
* Spring Boot allows exposing RSocket over WebSocket from a WebFlux server,
* or standing up an independent RSocket server. This depends on the type of application and its configuration.
*
* For WebFlux application (i.e. of type WebApplicationType.REACTIVE),
* the RSocket server will be plugged into the Web Server only if the following properties match:
* 1.spring.rsocket.server.mapping-path=/rsocket # a mapping path is defined (websocket endpoint?)
* 2.spring.rsocket.server.transport=websocket # websocket is chosen as a transport
* 3.#spring.rsocket.server.port= # no port is defined. (use server.port http config?)
* Pay attention! Plugging RSocket into a web server is only supported with Reactor Netty, as RSocket itself is built with that library.
*
* Alternatively, an RSocket TCP or websocket server is started as an independent, embedded server.
* Besides the dependency requirements, the only required configuration is to define a port for that server:
* 1.spring.rsocket.server.port=9898 # the only required configuration
* 2.spring.rsocket.server.transport=tcp # you're free to configure other properties
*
* @see org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration
*
*/
public class RSocketServerAutoConfigurationDemo {
}
| 55.25 | 136 | 0.785068 |
23c8a74bdeb67ada44d09a8e89694b798f194b30
| 827 |
package com.hjq.base;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
/**
* author : HJQ
* github : https://github.com/getActivity/AndroidProject
* time : 2018/11/24
* desc : DialogFragment 基类
*/
public abstract class BaseDialogFragment extends DialogFragment {
/**
* 父类同名方法简化
*/
public void show(FragmentActivity activity) {
show(activity.getSupportFragmentManager(), getClass().getName());
}
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
// 不使用 Dialog,替换成 BaseDialog 对象
return new BaseDialog(getActivity());
}
}
| 26.677419 | 73 | 0.706167 |
00ca22d0c4d3b4cd4ad4eafabc20519fe6865416
| 664 |
package com.weirdo.security.model;
/**
* <p>
* 消息模型
* </p>
*
* @author ML.Zhang
* @since 2019-04-12
*/
public class MsgModel {
/**
* 消息数据模型
*/
private Object data;
/**
* 消息原始数据
*/
private String originaldata;
/**
* 消息类型
*/
private String msgType;
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public String getOriginaldata() {
return originaldata;
}
public void setOriginaldata(String originaldata) {
this.originaldata = originaldata;
}
public String getMsgType() {
return msgType;
}
public void setMsgType(String msgType) {
this.msgType = msgType;
}
}
| 12.528302 | 51 | 0.644578 |
2a6783c61874e88fa535936e4fd4848b33149f55
| 2,200 |
package app.controllers;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import app.controllers.beans.DeckBean;
import app.controllers.mappers.DeckMapper;
import app.model.entities.Deck;
import app.repositories.DeckRepository;
@Controller
@RequestMapping("/deck")
public class DeckController
{
@Autowired
private DeckRepository deckRepository;
@Autowired
private DeckMapper deckMapper;
@GetMapping(path = {
"/",
"/{id}"
})
public String getDeck(
@PathVariable(required = false) Integer id,
Model model)
{
Deck deck = null;
if (id != null && id != 0)
{
Optional<Deck> deckOpt = deckRepository.findById(id);
if (deckOpt.isPresent())
{
deck = deckOpt.get();
}
else
{
return "redirect:/decks";
}
}
if (deck == null)
{
deck = new Deck("");
deck = deckRepository.save(deck);
}
DeckBean deckBean = deckMapper.deckToDeckBean(deck);
model.addAttribute("PageBean", deckBean);
return "deck";
}
@PostMapping
@ResponseStatus(value = HttpStatus.OK)
public void saveDeck(@ModelAttribute DeckBean deckBean)
{
if (deckBean.getDeckId() == 0)
{
return;
}
Optional<Deck> deckOpt = deckRepository.findById(deckBean.getDeckId());
if (!deckOpt.isPresent())
{
return;
}
Deck deck = deckOpt.get();
deckMapper.updateDeckFromDeckBean(
deckBean,
deck);
deckRepository.save(deck);
}
@DeleteMapping("/{id}")
@ResponseStatus(value = HttpStatus.OK)
public void deleteDeck(@PathVariable Integer id)
{
if (id != null && id != 0)
{
deckRepository.deleteById(id);
}
}
}
| 21.782178 | 73 | 0.722727 |
61886c6c89925ec191aa037e69101a708985e6a7
| 3,125 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.mnemonic;
import org.flowcomputing.commons.resgc.ReclaimContext;
/**
* this interface defines the interactive functionalities with Mnenomic core
* part.
*
*/
public interface Durable {
/**
* this function will be invoked after this non-volatile object is created
* brandly new
*
*/
void initializeAfterCreate();
/**
* this function will be invoked after this non-volatile object is restored
* from its allocator
*
*/
void initializeAfterRestore();
/**
* this function will be invoked by its factory to setup generic related info
* to avoid expensive operations from reflection
*
* @param efproxies
* specify a array of factory to proxy the restoring of its generic
* field objects
*
* @param gftypes
* specify a array of types corresponding to efproxies
*/
void setupGenericInfo(EntityFactoryProxy[] efproxies, DurableType[] gftypes);
/**
* this function could be called by user code to disable auto-reclaim for this
* non-volatile object
*
*/
void cancelAutoReclaim();
/**
* this function could be called by user code to register this object for
* auto-reclaim
*
*/
void registerAutoReclaim();
/**
* this function could be called by user code to register this object
* with reclaim context for auto-reclaim
*
*/
void registerAutoReclaim(ReclaimContext rctx);
/**
* this function returns its bound handler for this object
*
* @return the handler of this object
*/
long getHandler();
/**
* return the setting for auto-reclaim
*
* @return the status of the auto-reclaim setting
*/
boolean autoReclaim();
/**
* sync. this object
*/
void syncToVolatileMemory();
/**
* Make any cached changes to this object persistent.
*/
void syncToNonVolatileMemory();
/**
* flush processors cache for this object
*/
void syncToLocal();
/**
* manually destroy this object and release its memory resource
*
*/
void destroy() throws RetrieveDurableEntityError;
/**
* return the native field map info for native processing.
*
* @return the native field map info
*
*/
long[][] getNativeFieldInfo();
/**
* break all marked live references
*/
void refbreak();
}
| 24.606299 | 80 | 0.688 |
703c40a5275c0584aed52971e6f9851e2b41d93f
| 681 |
//package QuickSort;
import java.util.Scanner;
public class QuikSort2{
public static void quick_sort(char v[],int ini,int fim, int []x1){
int meio;
if(ini < fim) {
meio = partition(v, ini, fim,x1);
quick_sort(v, ini, meio,x1);
quick_sort(v, meio + 1, fim,x1);
}
}
public static int partition(char v[], int ini,int fim, int x1[]) {
int topo, i;
char pivo = v[ini];
int pivoInt = x1[ini];
topo = ini;
for(i = ini + 1; i <= fim; i++) {
if((int)v[i] > (int)pivo) {
v[topo] = v[i];
x1[topo] = x1[i];
v[i] = v[topo + 1];
x1[i] = x1[topo + 1];
topo++;
}
}
v[topo] = pivo;
x1[topo] = pivoInt;
return topo;
}
}
| 18.405405 | 67 | 0.540382 |
122dae441fcdb3d34fa56a9fdb923589dc75e9fc
| 33,579 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.uima.ducc.cli.aio;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import org.apache.uima.ducc.cli.CliBase;
import org.apache.uima.ducc.cli.DuccJobSubmit;
import org.apache.uima.ducc.cli.DuccManagedReservationSubmit;
import org.apache.uima.ducc.cli.IDuccCallback;
import org.apache.uima.ducc.cli.aio.IMessageHandler.Level;
import org.apache.uima.ducc.cli.aio.IMessageHandler.Toggle;
import org.apache.uima.ducc.common.utils.DuccSchedulerClasses;
import org.apache.uima.ducc.common.utils.IllegalConfigurationException;
import org.apache.uima.ducc.transport.event.cli.JobRequestProperties;
import org.apache.uima.ducc.user.common.QuotedOptions;
public class AllInOneLauncher extends CliBase {
private static String cid = AllInOneLauncher.class.getSimpleName();
private static String remote = "remote";
private static String local = "local";
private static String enter = "enter";
private static String exit = "exit";
private String allInOneType = null;
private String jvm = null;
private String log_directory = null;
private String working_directory = null;
private String classpath = null;
private String environment = null;
private String process_jvm_args = null;
private String debug_jvm_args = null;
private String driver_descriptor_CR = null;
private String driver_descriptor_CR_overrides = null;
private String process_descriptor_CM = null;
private String process_descriptor_CM_overrides = null;
private String process_descriptor_AE = null;
private String process_descriptor_AE_overrides = null;
private String process_descriptor_CC = null;
private String process_descriptor_CC_overrides = null;
private String process_DD = null;
private String process_memory_size = null;
private String description = null;
private String scheduling_class = null;
private String specification = null;
private String signature = null;
private String user = null;
private boolean wait_for_completion = false;
private boolean cancel_on_interrupt = false;
private IMessageHandler mh = new MessageHandler();
private JobRequestProperties jobRequestProperties = new JobRequestProperties();
private UiOption[] opts = DuccJobSubmit.opts;
private HashMap<String,String> optionsMap = new HashMap<String,String>();
private long duccId = -1;
/*
* Called with the already cleaned-up properties parsed by DuccSubmit to
* avoid duplicate fix-up messages produced by a full re-parse.
*/
public AllInOneLauncher(Properties props, IDuccCallback consoleCb) throws Exception {
if (consoleCb != null) {
mh = new MessageHandler(consoleCb);
}
init (this.getClass().getName(), opts, props, jobRequestProperties, consoleCb);
}
private boolean isLocal() {
return allInOneType.equalsIgnoreCase(local);
}
private void ignored() {
String mid = "ignored";
mh.frameworkTrace(cid, mid, enter);
Enumeration<Object> keys = jobRequestProperties.keys();
while(keys.hasMoreElements()) {
Object key = keys.nextElement();
boolean examined = optionsMap.containsKey(key);
if(!examined) {
String message = "ignoring "+key;
mh.warn(cid, mid, message);
}
}
mh.frameworkTrace(cid, mid, exit);
}
private void used(String opt) {
String mid = "used";
mh.frameworkTrace(cid, mid, enter);
optionsMap.put(opt,opt);
String message = opt;
mh.frameworkDebug(cid, mid, message);
mh.frameworkTrace(cid, mid, exit);
}
private void enableDebugFlags() {
String mid = "enableDebugFlags";
mh.frameworkTrace(cid, mid, enter);
mh.setLevel(Level.FrameworkInfo, Toggle.On);
mh.setLevel(Level.FrameworkDebug, Toggle.On);
mh.setLevel(Level.FrameworkError, Toggle.On);
mh.setLevel(Level.FrameworkWarn, Toggle.On);
mh.frameworkTrace(cid, mid, exit);
}
// debug
private void examine_debug() {
String mid = "examine_debug";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.Debug.pname();
debug = jobRequestProperties.containsKey(pname);
if(debug) {
enableDebugFlags();
String message = "true";
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_debug() {
String mid = "examine_process_debug";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessDebug.pname();
if (jobRequestProperties.containsKey(pname)) {
int port = Integer.parseInt(jobRequestProperties.getProperty(pname));
debug_jvm_args = "-Xdebug -Xrunjdwp:transport=dt_socket,address=" + host_address + ":" + port;
mh.frameworkDebug(cid, mid, debug_jvm_args);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_driver_debug() {
String mid = "examine_driver_debug";
mh.frameworkTrace(cid, mid, enter);
mh.frameworkTrace(cid, mid, exit);
}
// timestamp
private void examine_timestamp() {
String mid = "examine_timestamp";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.Timestamp.pname();
boolean timestamp = jobRequestProperties.containsKey(pname);
if(timestamp) {
mh.setTimestamping(Toggle.On);
String message = "true";
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
// all-in-one
private void examine_allInOne() throws IllegalArgumentException {
String mid = "examine_allInOne";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.AllInOne.pname();
allInOneType = jobRequestProperties.getProperty(pname);
if(allInOneType == null) {
throw new IllegalArgumentException("Illegal argument for all_in_one: " + pname);
}
if(allInOneType.equalsIgnoreCase(local)) {
String message = allInOneType;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
else if(allInOneType.equalsIgnoreCase(remote)) {
String message = allInOneType;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
else {
throw new IllegalArgumentException(pname+": "+allInOneType);
}
mh.frameworkTrace(cid, mid, exit);
}
// attach-console
private void examine_process_attach_console() {
String mid = "examine_process_attach_console";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.AttachConsole.pname();
if(jobRequestProperties.containsKey(pname)) {
String message = "attach_console";
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
// jvm
private void examine_jvm() {
String mid = "examine_jvm";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.Jvm.pname();
if(jobRequestProperties.containsKey(pname)) {
jvm = jobRequestProperties.getProperty(pname);
String message = jvm;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
else {
jvm = System.getProperty("java.home")+File.separator+"bin"+File.separator+"java";
String message = jvm;
mh.frameworkDebug(cid, mid, message);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_log_directory() {
String mid = "examine_log_directory";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.LogDirectory.pname();
if(jobRequestProperties.containsKey(pname)) {
log_directory = jobRequestProperties.getProperty(pname);
String message = log_directory;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_working_directory() {
String mid = "examine_working_directory";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.WorkingDirectory.pname();
if(jobRequestProperties.containsKey(pname)) {
working_directory = jobRequestProperties.getProperty(pname);
String message = working_directory;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
else {
working_directory = System.getProperty("user.dir");
String message = working_directory;
mh.frameworkDebug(cid, mid, message);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_jvm_args() {
String mid = "examine_process_jvm_args";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessJvmArgs.pname();
if(jobRequestProperties.containsKey(pname)) {
process_jvm_args = jobRequestProperties.getProperty(pname);
if (debug_jvm_args != null) {
process_jvm_args += " "+debug_jvm_args;
}
String message = process_jvm_args;
mh.frameworkDebug(cid, mid, message);
used(pname);
} else {
process_jvm_args = debug_jvm_args;
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_classpath() {
String mid = "examine_classpath";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.Classpath.pname();
classpath = jobRequestProperties.getProperty(pname);
if (classpath == null) {
classpath = System.getProperty("java.class.path");
}
used(pname);
String message = classpath;
mh.frameworkDebug(cid, mid, message);
// Don't need all the DUCC jars as user's classpath must have all the UIMA jars it needs.
// For simplicity add only the jar that has the AllInOne class --- it will pull in other
// jars that have dependencies such as the flow controller.
classpath = classpath + File.pathSeparatorChar + ducc_home + "/lib/uima-ducc-cli.jar";
mh.frameworkTrace(cid, mid, exit);
}
private void examine_environment() {
String mid = "examine_environment";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.Environment.pname();
environment = jobRequestProperties.getProperty(pname);
if (environment != null) {
String message = environment;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_description() {
String mid = "examine_description";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.Description.pname();
if(jobRequestProperties.containsKey(pname)) {
description = jobRequestProperties.getProperty(pname);
String message = pname+"="+description;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_scheduling_class() throws Exception {
String mid = "examine_scheduling_class";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.SchedulingClass.pname();
// If omitted let DUCC choose the default for an AP
// If a preemptable one change to a fixed one if possible
if (jobRequestProperties.containsKey(pname)) {
try {
DuccSchedulerClasses duccSchedulerClasses = DuccSchedulerClasses.getInstance();
scheduling_class = jobRequestProperties.getProperty(pname);
String message = pname + "=" + scheduling_class + " [original]";
if (isLocal()) {
message = pname + "=" + scheduling_class + " not considered";
mh.debug(cid, mid, message);
} else if (duccSchedulerClasses.isPreemptable(scheduling_class)) {
String specific_scheduling_class = duccSchedulerClasses.getDebugClassSpecificName(scheduling_class);
if (specific_scheduling_class != null) {
scheduling_class = specific_scheduling_class;
jobRequestProperties.put(pname, scheduling_class);
message = pname + "=" + scheduling_class + " [replacement, specific]";
mh.info(cid, mid, message);
}
}
used(pname);
} catch (Exception e) {
throw new IllegalConfigurationException("Error in DUCC configuration files - see administrator", e);
}
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_signature() {
String mid = "examine_signature";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.Signature.pname();
if(isLocal()) {
used(pname);
}
if(jobRequestProperties.containsKey(pname)) {
signature = jobRequestProperties.getProperty(pname);
String message = pname+"="+signature;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_user() {
String mid = "examine_user";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.User.pname();
if(isLocal()) {
used(pname);
}
if(jobRequestProperties.containsKey(pname)) {
user = jobRequestProperties.getProperty(pname);
String message = pname+"="+user;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_driver_descriptor_CR() {
String mid = "examine_driver_descriptor_CR";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.DriverDescriptorCR.pname();
if(jobRequestProperties.containsKey(pname)) {
driver_descriptor_CR = jobRequestProperties.getProperty(pname);
String message = pname+"="+driver_descriptor_CR;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_driver_descriptor_CR_overrides() {
String mid = "examine_driver_descriptor_CR_overrides";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.DriverDescriptorCROverrides.pname();
if(jobRequestProperties.containsKey(pname)) {
driver_descriptor_CR_overrides = jobRequestProperties.getProperty(pname);
String message = pname+"="+driver_descriptor_CR_overrides;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_memory_size() {
String mid = "examine_process_memory_size";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessMemorySize.pname();
if(jobRequestProperties.containsKey(pname)) {
if(isLocal()) {
//ignored
}
else {
process_memory_size = jobRequestProperties.getProperty(pname);
String message = pname+"="+process_memory_size;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_DD() {
String mid = "examine_process_DD";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessDD.pname();
if(jobRequestProperties.containsKey(pname)) {
process_DD = jobRequestProperties.getProperty(pname);
String message = pname+"="+process_DD;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_descriptor_CM() {
String mid = "examine_process_descriptor_CM";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessDescriptorCM.pname();
if(jobRequestProperties.containsKey(pname)) {
process_descriptor_CM = jobRequestProperties.getProperty(pname);
String message = pname+"="+process_descriptor_CM;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_descriptor_CM_overrides() {
String mid = "examine_process_descriptor_CMOverrides";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessDescriptorCMOverrides.pname();
if(jobRequestProperties.containsKey(pname)) {
process_descriptor_CM_overrides = jobRequestProperties.getProperty(pname);
String message = pname+"="+process_descriptor_CM_overrides;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_descriptor_AE() {
String mid = "examine_process_descriptor_AE";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessDescriptorAE.pname();
if(jobRequestProperties.containsKey(pname)) {
process_descriptor_AE = jobRequestProperties.getProperty(pname);
String message = pname+"="+process_descriptor_AE;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_descriptor_AE_overrides() {
String mid = "examine_process_descriptor_AE_overrides";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessDescriptorAEOverrides.pname();
if(jobRequestProperties.containsKey(pname)) {
process_descriptor_AE_overrides = jobRequestProperties.getProperty(pname);
String message = pname+"="+process_descriptor_AE_overrides;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_descriptor_CC() {
String mid = "examine_process_descriptor_CC";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessDescriptorCC.pname();
if(jobRequestProperties.containsKey(pname)) {
process_descriptor_CC = jobRequestProperties.getProperty(pname);
String message = pname+"="+process_descriptor_CC;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_process_descriptor_CC_overrides() {
String mid = "examine_process_descriptor_CC_overrides";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.ProcessDescriptorCCOverrides.pname();
if(jobRequestProperties.containsKey(pname)) {
process_descriptor_CC_overrides = jobRequestProperties.getProperty(pname);
String message = pname+"="+process_descriptor_CC_overrides;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_specification() {
String mid = "examine_specification";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.Specification.pname();
if(jobRequestProperties.containsKey(pname)) {
specification = jobRequestProperties.getProperty(pname);
String message = pname+"="+specification;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_wait_for_completion() {
String mid = "examine_wait_for_completion";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.WaitForCompletion.pname();
if(jobRequestProperties.containsKey(pname)) {
wait_for_completion = true;
String message = pname+"="+wait_for_completion;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_cancel_on_interrupt() {
String mid = "examine_cancel_on_interrupt";
mh.frameworkTrace(cid, mid, enter);
String pname = UiOption.CancelOnInterrupt.pname();
if(jobRequestProperties.containsKey(pname)) {
cancel_on_interrupt = true;
wait_for_completion = true;
String message = pname+"="+cancel_on_interrupt;
mh.frameworkDebug(cid, mid, message);
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
private void examine_submitter_pid_at_host() {
String mid = "examine_submitter_pid_at_host";
mh.frameworkTrace(cid, mid, enter);
String pname = "submitter_pid_at_host";
if(jobRequestProperties.containsKey(pname)) {
used(pname);
}
mh.frameworkTrace(cid, mid, exit);
}
/////
private void examine() throws Exception {
String mid = "examine";
mh.frameworkTrace(cid, mid, "enter");
// debug
examine_debug();
examine_process_debug();
examine_driver_debug();
// console
examine_process_attach_console();
// timestamp
examine_timestamp();
// all_in_one
examine_allInOne();
// jvm
examine_jvm();
// log_directory
examine_log_directory();
// working_directory
examine_working_directory();
// jvm_args
examine_process_jvm_args();
// classpath
examine_classpath();
// environment
examine_environment();
// uima
examine_driver_descriptor_CR();
examine_driver_descriptor_CR_overrides();
examine_process_descriptor_CM();
examine_process_descriptor_CM_overrides();
examine_process_descriptor_AE();
examine_process_descriptor_AE_overrides();
examine_process_descriptor_CC();
examine_process_descriptor_CC_overrides();
examine_process_DD();
// DuccJobSubmit does not check for an invalid set
// Perhaps should be done in CliBase validation
// reconcile_descriptors();
// memory
examine_process_memory_size();
// description
examine_description();
// scheduling_class
examine_scheduling_class();
// wait_for_completion & cancel
examine_wait_for_completion();
examine_cancel_on_interrupt();
// specification - handled by super()
examine_specification();
// signature - handled by super()
examine_signature();
// user - handled by super()
examine_user();
// submitter_pid_at_host
examine_submitter_pid_at_host();
// ignored
ignored();
mh.frameworkTrace(cid, mid, "exit");
}
private void launch_local() throws IOException {
String mid = "launch_local";
mh.frameworkTrace(cid, mid, "enter");
String message = "local";
mh.frameworkDebug(cid, mid, message);
ArrayList<String> commandArray = new ArrayList<String>();
commandArray.add(jvm);
commandArray.add("-classpath");
commandArray.add(classpath);
if(process_jvm_args != null) {
// Tokenize and strip quotes
ArrayList<String> jvmargs = QuotedOptions.tokenizeList(process_jvm_args, true);
for(String jvmarg : jvmargs) {
commandArray.add(jvmarg);
}
}
// Now the AllInOne class and all its legal options
commandArray.add(AllInOne.class.getCanonicalName());
for (UiOption opt : allInOneOpts) {
String val = jobRequestProperties.getProperty(opt.pname());
if (val != null) {
commandArray.add("--" + opt.pname());
if (opt.argname() != null ) {
commandArray.add(val);
}
}
}
String[] command = commandArray.toArray(new String[0]);
ProcessBuilder pb = new ProcessBuilder( command );
if(working_directory != null) {
message = "working directory: "+working_directory;
mh.frameworkDebug(cid, mid, message);
File wd = new File(working_directory);
pb.directory(wd);
}
// Put environment settings in the process's environment
// Don't inherit any settings
Map<String,String> env = pb.environment();
env.clear();
if(environment != null) {
ArrayList<String> envList = QuotedOptions.tokenizeList(environment, true); // Strip quotes
Map<String,String> envMap = QuotedOptions.parseAssignments(envList, +1); // Expand any FOO & FOO* entries
env.putAll(envMap);
}
// Log the environment and arguments in the same way ducc_ling does
System.out.println("Changed to working directory " + working_directory);
int n = 0;
for (Entry<String, String> entry : env.entrySet()) {
System.out.println("Environ[" + (n++) + "] = " + entry.getKey() + "=" + entry.getValue());
}
System.out.println("Command to exec: " + command[0]);
for (int i = 1; i < command.length; ++i) {
System.out.println(" arg[" + i + "]: " + command[i]);
}
System.out.println("Command launching...");
// Run!
pb.redirectErrorStream(true);
Process process = pb.start();
String line;
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader ibr = new BufferedReader(isr);
// Pass all process output through the console callback to stdout
while ((line = ibr.readLine()) != null) {
consoleCb.console(0, line);
}
ibr.close();
try {
returnCode = process.waitFor();
} catch (InterruptedException e) {
}
mh.frameworkTrace(cid, mid, "exit");
}
// private void addArg(ArrayList<String> cmdLine, String arg) {
// String mid = "addArg";
// mh.frameworkTrace(cid, mid, "enter");
// cmdLine.add(arg);
// mh.frameworkDebug(cid, mid, arg);
// mh.frameworkTrace(cid, mid, "exit");
// }
/*
* Options that AllInOne needs
*/
UiOption[] allInOneOpts = {
UiOption.Debug,
UiOption.Timestamp,
UiOption.DriverDescriptorCR,
UiOption.DriverDescriptorCROverrides,
UiOption.ProcessDD,
UiOption.ProcessDescriptorCM,
UiOption.ProcessDescriptorCMOverrides,
UiOption.ProcessDescriptorAE,
UiOption.ProcessDescriptorAEOverrides,
UiOption.ProcessDescriptorCC,
UiOption.ProcessDescriptorCCOverrides };
/*
* Create a string hold the args for the java command.
* If any values contain blanks they would have to be quoted, instead restrict the args
* to just those needed to run the pipeline.
*/
private String getProcessExecutableArgs() {
String mid = "getProcessExecutableArgs";
mh.frameworkTrace(cid, mid, "enter");
StringBuffer sb = new StringBuffer();
if(process_jvm_args != null) {
sb.append(process_jvm_args);
}
sb.append(" -classpath");
sb.append(" ");
sb.append(classpath);
sb.append(" ");
sb.append(AllInOne.class.getCanonicalName());
sb.append(" ");
for (UiOption opt : allInOneOpts) {
String val = jobRequestProperties.getProperty(opt.pname());
if (val != null) {
sb.append(" --" + opt.pname());
if (opt.argname() != null ) {
if (val.indexOf(' ') >= 0) {
sb.append(" \"" + val + "\"");
} else {
sb.append(" " + val);
}
}
}
}
mh.frameworkTrace(cid, mid, "exit");
return sb.toString();
}
private void launch_remote() throws Exception {
String mid = "launch_remote";
mh.frameworkTrace(cid, mid, "enter");
Properties props = new Properties();
props.put(UiOption.ProcessExecutable.pname(), jvm);
props.put(UiOption.ProcessExecutableArgs.pname(), getProcessExecutableArgs());
if(scheduling_class != null) {
props.put(UiOption.SchedulingClass.pname(), scheduling_class);
}
// NOTE - revert to user-provided environment so it is not modified twice
environment = userSpecifiedProperties.getProperty(UiOption.Environment.pname());
if(environment != null) {
props.put(UiOption.Environment.pname(), environment);
}
if(process_memory_size != null) {
props.put(UiOption.ProcessMemorySize.pname(), process_memory_size);
}
if(log_directory != null) {
props.put(UiOption.LogDirectory.pname(), log_directory);
}
if(working_directory != null) {
props.put(UiOption.WorkingDirectory.pname(), working_directory);
}
if(description != null) {
props.put(UiOption.Description.pname(), description);
}
if(wait_for_completion) {
props.put(UiOption.WaitForCompletion.pname(), "true");
}
if(cancel_on_interrupt) {
props.put(UiOption.CancelOnInterrupt.pname(), "true");
}
props.put(UiOption.AttachConsole.pname(), "true");
DuccManagedReservationSubmit mr = new DuccManagedReservationSubmit(props, consoleCb);
boolean rc = mr.execute();
String dt = "Managed Reservation";
if (rc) {
String line = dt + " " + mr.getDuccId() + " submitted.";
consoleCb.status(line);
returnCode = mr.getReturnCode();
duccId = mr.getDuccId();
}
else {
String line = "Could not submit " + dt;
consoleCb.status(line);
}
mh.frameworkDebug(cid, mid, "rc="+rc);
mh.frameworkTrace(cid, mid, "exit");
}
private void launch() throws Exception {
String mid = "launch";
mh.frameworkTrace(cid, mid, "enter");
if(allInOneType.equalsIgnoreCase(local)) {
launch_local();
}
else if(allInOneType.equalsIgnoreCase(remote)) {
launch_remote();
}
else {
String message = "type "+allInOneType+" not supported";
mh.error(cid, mid, message);
}
mh.frameworkTrace(cid, mid, "exit");
}
public boolean execute() throws Exception {
String mid = "execute";
mh.frameworkTrace(cid, mid, "enter");
examine();
returnCode = -1; // Some "failure" value in case the local/remote launch doesn't complete
launch();
mh.frameworkTrace(cid, mid, "exit");
return true;
}
public int getReturnCode() {
return returnCode;
}
public long getDuccId() {
return duccId;
}
}
| 36.459283 | 117 | 0.605497 |
9da4dfcdec6683e3283976d4af481359d0e242ec
| 612 |
public class symbolpattern31 {
public static void main(String []args){
int n = 5, x = 1;
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= n; j++) {
if((i % 2 == 1 && j <= x) || (i % 2 == 0 && j >= n - x + 1)) {
System.out.print("* ");
}
else {
System.out.print("# ");
}
}
System.out.println();
if(i == n/2 + 1) {
x = 1;
}
else {
x++;
}
}
}
}
| 25.5 | 78 | 0.261438 |
808ec667efd3507340302e53c881a7a936aa5ad6
| 11,047 |
package fr.uga.iut2.genconf.vue.gui;
import fr.uga.iut2.genconf.controleur.Controleur;
import fr.uga.iut2.genconf.modele.Conference;
import fr.uga.iut2.genconf.modele.Session;
import fr.uga.iut2.genconf.vue.gui.shared.Layout;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import java.util.stream.Collectors;
public class VueAffichageConference extends Layout<Conference> {
private final Object[] entetesSession = {"Nom", "Début", "Fin", "Type"};
private Object[][] tablevalues;
private ArrayList<Session> sessions;
public VueAffichageConference(Controleur controleur, GUI gui) {
super(gui, controleur);
}
@Override
public void initComponents() {
this.sessions = new ArrayList<>(model.getSessions().values());
jLabel4 = new javax.swing.JLabel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton1 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel4.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel4.setForeground(new java.awt.Color(0, 0, 0));
jLabel4.setText("Du : ");
setBackground(new java.awt.Color(204, 204, 204));
jTable1.setBackground(new java.awt.Color(255, 255, 255));
jTable1.setForeground(new java.awt.Color(0, 0, 0));
tablevalues = new Object[model.getSessions().size()][4];
Object[][] tablevalues = model.getSessions().values().stream().map(VueAffichageConference::sessionToStringArray).toArray(Object[][]::new);
this.jTable1 = new JTable(tablevalues, entetesSession) {
public boolean isCellEditable(int row, int col) {
return false;
}
};
jTable1.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent mouseEvent) {
if (mouseEvent.getClickCount() == 2) {
Session session = sessions.get(jTable1.getSelectedRow());
controleur.consulterSession(model.getNom(), session.getNom());
}
}
@Override
public void mousePressed(MouseEvent mouseEvent) {
}
@Override
public void mouseReleased(MouseEvent mouseEvent) {
}
@Override
public void mouseEntered(MouseEvent mouseEvent) {
}
@Override
public void mouseExited(MouseEvent mouseEvent) {
}
});
jTable1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
jTable1.setRowHeight(20);
jTable1.setShowGrid(false);
jScrollPane1.setViewportView(jTable1);
jButton1.setBackground(new java.awt.Color(153, 153, 153));
jButton1.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jButton1.setForeground(new java.awt.Color(0, 0, 0));
jButton1.setText("Ajouter une session");
jButton1.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent actionEvent) {
gui.saisirNouvelleSession(model.getSessions().keySet(), model);
}
});
jLabel2.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel2.setForeground(new java.awt.Color(0, 0, 0));
jLabel2.setText(model.getNom());
jLabel7.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel7.setForeground(new java.awt.Color(0, 0, 0));
jLabel7.setText("Conférences > ");
jLabel7.addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent mouseEvent) {
controleur.consulterConferences();
}
@Override
public void mousePressed(MouseEvent mouseEvent) {
}
@Override
public void mouseReleased(MouseEvent mouseEvent) {
}
@Override
public void mouseEntered(MouseEvent mouseEvent) {
}
@Override
public void mouseExited(MouseEvent mouseEvent) {
}
});
jLabel9.setBackground(new java.awt.Color(0, 0, 0));
jLabel9.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel9.setForeground(new java.awt.Color(0, 0, 0));
jLabel9.setText("Du : " + model.getDateDebut().toString());
jLabel1.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel1.setForeground(new java.awt.Color(0, 0, 0));
jLabel1.setText("Au : " + model.getDateFin().toString());
jLabel3.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel3.setForeground(new java.awt.Color(0, 0, 0));
jLabel3.setText("Type : " + model.getStatus().toString());
jLabel5.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel5.setForeground(new java.awt.Color(0, 0, 0));
jLabel5.setText("Administrée par : " + model.getAdministrateurs().values().stream().map(a -> a.getPrenom() + " " + a.getNom()).collect(Collectors.joining(", ")));
jLabel6.setFont(new java.awt.Font("Calibri", 1, 14)); // NOI18N
jLabel6.setForeground(new java.awt.Color(0, 0, 0));
jLabel6.setText("Sessions");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 676, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addGap(48, 48, 48)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jLabel6)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jLabel9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 364, Short.MAX_VALUE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jLabel9)
.addGap(18, 18, 18)
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addGap(27, 27, 27)
.addComponent(jLabel5)
.addGap(18, 18, 18)
.addComponent(jLabel6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jButton1)
.addContainerGap(41, Short.MAX_VALUE))
);
}
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel9;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
private static Object[] sessionToStringArray(Session session) {
Object[] ligne = {session.getNom(), session.getDateDebut().toString(),session.getDateFin().toString(),session.getType().toString()};
return ligne;
}
}
| 46.415966 | 206 | 0.581968 |
06e92db4aaa23b4e9578539fe3da85a61ac4f24e
| 3,585 |
// ============================================================================
//
// Copyright (C) 2006-2018 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.designer.webservice.ui;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.MatchResult;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.PatternMatcherInput;
import org.apache.oro.text.regex.Perl5Compiler;
import org.apache.oro.text.regex.Perl5Matcher;
/**
* DOC Administrator class global comment. Detailled comment
*/
public class WebServiceExpressionParser {
private Perl5Matcher matcher = new Perl5Matcher();
private Perl5Compiler compiler = new Perl5Compiler();
private Pattern pattern;
private String locationPattern;
private PatternMatcherInput patternMatcherInput;
private Set<Map<String, String>> resultSet = new HashSet<Map<String, String>>();
public WebServiceExpressionParser(String locationPattern) {
this.locationPattern = locationPattern;
}
public void setLocationPattern(String locationPattern) {
this.locationPattern = locationPattern;
}
public Map<String, String> parseInTableEntryLocations(String expression) {
// resultSet.clear();
Map<String, String> map = new HashMap<String, String>();
if (expression != null) {
matcher.setMultiline(true);
if (patternMatcherInput == null) {
patternMatcherInput = new PatternMatcherInput(expression);
} else {
patternMatcherInput.setInput(expression);
}
recompilePatternIfNecessary(locationPattern);
while (matcher.contains(patternMatcherInput, pattern)) {
MatchResult matchResult = matcher.getMatch();
map.put(matchResult.group(2), matchResult.group(1));
// resultSet.add(map);
}
}
return map;// .toArray(new TableEntryLocation[0]);
}
public Set<String> parseOutTableEntryLocations(String expression) {
Set<String> set = new HashSet<String>();
if (expression != null) {
matcher.setMultiline(true);
if (patternMatcherInput == null) {
patternMatcherInput = new PatternMatcherInput(expression);
} else {
patternMatcherInput.setInput(expression);
}
recompilePatternIfNecessary(locationPattern);
while (matcher.contains(patternMatcherInput, pattern)) {
MatchResult matchResult = matcher.getMatch();
String columnName = matchResult.group(0);
set.add(columnName);
}
}
return set;
}
private void recompilePatternIfNecessary(String regexpPattern) {
if (pattern == null || !regexpPattern.equals(pattern.getPattern())) {
try {
pattern = compiler.compile(regexpPattern);
} catch (MalformedPatternException e) {
throw new RuntimeException(e);
}
}
}
}
| 34.142857 | 87 | 0.624547 |
ef76dd4d73a4e9480c6cc0d619c3fad20568cd69
| 1,036 |
package io.jenkins.blueocean.service.embedded.util;
import org.apache.oro.text.GlobCompiler;
import org.apache.oro.text.regex.MalformedPatternException;
import org.apache.oro.text.regex.Pattern;
import org.apache.oro.text.regex.Perl5Matcher;
/**
* Matches glob string patters
* See https://en.wikipedia.org/wiki/Glob_(programming)
*/
public final class GlobMatcher {
private static final GlobCompiler GLOB_COMPILER = new GlobCompiler();
private static final Perl5Matcher MATCHER = new Perl5Matcher();
private final Pattern pattern;
public GlobMatcher(String patternStr) {
try {
this.pattern = GLOB_COMPILER.compile(patternStr, GlobCompiler.CASE_INSENSITIVE_MASK);
} catch (Throwable e) {
throw new IllegalArgumentException(String.format("bad pattern '%s'", patternStr), e);
}
}
/**
* @param input to check
* @return matches pattern or not
*/
public boolean matches(String input) {
return MATCHER.matches(input, pattern);
}
}
| 30.470588 | 97 | 0.702703 |
1ab7bcf0ea8dff406f30bc0052b00195cfdbf825
| 1,716 |
//Chapter 26 - Project 26.1
import java.util.ArrayList;
import java.util.StringTokenizer;
/**
An appointment calendar.
*/
public class AppointmentCalendar
{
private ArrayList appointments;
public AppointmentCalendar()
{
appointments = new ArrayList();
}
/**
Adds an appointment to the calendar.
@param a the appointment to add
*/
public void add(Appointment a)
{
appointments.add(a);
}
/**
Cancels an appointment from the calendar.
@param a the appointment to cancel
*/
public void cancel(Appointment a)
{
for (int i = 0; i < appointments.size(); i++)
{
Appointment appt = (Appointment)appointments.get(i);
if (appt.equals(a))
{
appointments.remove(i);
return;
}
}
System.out.println("No matching appointment.");
}
/**
Prints an appointment for a certain date.
@param d the appointment to print
*/
public void printForDay(AppointmentDate d)
{
for (int i = 0; i < appointments.size(); i++)
{
Appointment appt = (Appointment)appointments.get(i);
if (appt.fallsOn(d))
System.out.println(appt.print());
}
}
/**
Prints all appointments in the calendar.
*/
public void printCalendar()
{
for (int i = 0; i < appointments.size(); i++)
{
Appointment appt = (Appointment)appointments.get(i);
System.out.println(appt.print());
}
}
/**
Returns all the appointments.
@return all the appointments
*/
public ArrayList getAppointments()
{
return appointments;
}
}
| 21.45 | 61 | 0.571678 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.