Generates the date-time classes into the given output directory.
13532
public Map<LocaleID, ClassName> generate(Path outputDir, DataReader reader)
      throws IOException {

    Map<LocaleID, ClassName> dateClasses = new TreeMap<>();
    List<DateTimeData> dateTimeDataList = new ArrayList<>();

    for (Map.Entry<LocaleID, DateTimeData> entry : reader.calendars().entrySet()) {
      DateTimeData dateTimeData = entry.getValue();

      LocaleID localeId = entry.getKey();
      String className = "_CalendarFormatter_" + localeId.safe;

      TimeZoneData timeZoneData = reader.timezones().get(localeId);
      
      TypeSpec type = createFormatter(dateTimeData, timeZoneData, className);
      CodeGenerator.saveClass(outputDir, Types.PACKAGE_CLDR_DATES, className, type);

      ClassName cls = ClassName.get(Types.PACKAGE_CLDR_DATES, className);
      dateClasses.put(localeId, cls);
      dateTimeDataList.add(dateTimeData);
    }

    String className = "_CalendarUtils";
    TypeSpec.Builder utilsType = TypeSpec.classBuilder(className)
        .addModifiers(PUBLIC);
    
    addSkeletonClassifierMethod(utilsType, dateTimeDataList);
    addMetaZones(utilsType, reader.metazones());
    buildTimeZoneAliases(utilsType, reader.timezoneAliases());

    CodeGenerator.saveClass(outputDir, Types.PACKAGE_CLDR_DATES, "_CalendarUtils", utilsType.build());

    return dateClasses;
  }
758486
public static Generator<DateTime> futureDates(@Nonnull DateTime to) {
        return new RandomJodaDateTimeGenerator(new DurationFromNow(ZERO_DURAION), ofInstance(checkNotNull(to)));
    }
372184
private void addDirectoryClasses(final Path location, final Path subPath) {
        for (final File file : location.toFile().listFiles()) {
            if (file.isDirectory())
                addDirectoryClasses(location.resolve(file.getName()), subPath.resolve(file.getName()));
            else if (file.isFile() && file.getName().endsWith(".class")) {
                final String classFileName = subPath.resolve(file.getName()).toString();
                classes.add(toQualifiedClassName(classFileName));
            }
        }
    }
55408
public void setOutputDirectory( String outputDirectory ) {

		// Update the configuration
		this.logger.fine( "Output directory is now... " + outputDirectory );
		this.outputDIR = Utils.isEmptyOrWhitespaces( outputDirectory ) ? null : new File( outputDirectory );

		// Generate the files
		if( this.outputDIR != null && this.dm != null ) {
			for( ManagedApplication ma : this.dm.applicationMngr().getManagedApplications())
				application( ma.getApplication(), EventType.CHANGED );
		}
	}


	/**
	 * Binds the DM.
	 * @param dm
	 */
	public void bindManager( Manager dm ) {

		synchronized( this.generationLock ) {
			this.logger.fine( "The DM is now available in the templating manager." );
			this.dm = dm;
		}
	}


	/**
	 * Unbinds the DM.
	 * @param dm
	 */
	public void unbindManager( Manager dm ) {

		synchronized( this.generationLock ) {
			this.logger.fine( "The DM is NOT available anymore in the templating manager." );
			this.dm = null;
		}
	}


	// iPojo life cycle


	/**
	 * Starts the templating manager (invoked by iPojo).
	 */
	public void start() {

		synchronized( this.watcherLock ) {
			this.logger.config( "The templating manager is starting..." );
			resetWatcher();
		}
	}


	/**
	 * Stops the templating manager (invoked by iPojo).
	 */
	public void stop() {

		synchronized( this.watcherLock ) {
			this.logger.config( "The templating manager is stopping..." );
			stopWatcher();
		}
	}


	// Inherited methods


	/*
	 * (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener#getId()
	 */
	@Override
	public String getId() {
		return ID;
	}


	/* (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #application(net.roboconf.core.model.beans.Application, net.roboconf.dm.management.events.EventType)
	 */
	@Override
	public void application( Application application, EventType eventType ) {

		if( this.outputDIR == null ) {
			this.logger.warning( "Generation from templates is skipped. Invalid output directory." );

		} else if( eventType == EventType.DELETED ) {
			synchronized( this.generationLock ) {
				TemplateUtils.deleteGeneratedFiles( application, this.outputDIR );
			}

		} else {
			generate( application );
		}
	}


	/* (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #applicationTemplate(net.roboconf.core.model.beans.ApplicationTemplate, net.roboconf.dm.management.events.EventType)
	 */
	@Override
	public void applicationTemplate( ApplicationTemplate tpl, EventType eventType ) {
		// nothing
	}


	/*
	 * (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #instance(net.roboconf.core.model.beans.Instance, net.roboconf.core.model.beans.Application, net.roboconf.dm.management.events.EventType)
	 */
	@Override
	public void instance( Instance instance, Application application, EventType eventType ) {
		application( application, EventType.CHANGED );
	}


	/* (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #raw(java.lang.String, java.lang.Object[])
	 */
	@Override
	public void raw( String message, Object... data ) {
		// nothing
	}


	/*
	 * (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #enableNotifications()
	 */
	@Override
	public void enableNotifications() {
		// nothing
	}


	/*
	 * (non-Javadoc)
	 * @see net.roboconf.dm.management.events.IDmListener
	 * #disableNotifications()
	 */
	@Override
	public void disableNotifications() {
		// nothing
	}
1141125
def prepare_to_generate(self, data_dir, tmp_dir):
    """"""
    self.get_or_create_vocab(data_dir, tmp_dir)
    self.train_text_filepaths(tmp_dir)
    self.dev_text_filepaths(tmp_dir)
635711
def generate_labels_from_classifications(classifications, timestamps):
        
        window_length = timestamps[1] - timestamps[0]
        combo_list = [(classifications[k], timestamps[k]) for k in range(0, len(classifications))]
        labels = []
        for k, g in itertools.groupby(combo_list, lambda x: x[0]):
            items = list(g)
            start_time = items[0][1]
            end_time = items[-1][1] + window_length
            label_class = items[0][0]
            labels.append(AudacityLabel(start_time, end_time, label_class))
        return labels
764059
protected function generateClasses()
    {
        $this->display(' * Generate classes files for Data & Mapper ' . PHP_EOL);

        $this->display('  > generate [  0%]: Data File      ' . "\r");
        $this->generateDataFiles();

        $this->display('  > generate [ 50%]: Data File      ' . "\r");
        $this->generateMapperFiles();

        $this->display('  > generate [100%]: done !    ' . "\r");
        $this->display(PHP_EOL . PHP_EOL);
    }
725219
public void generateClasses() throws IOException {
		for (PrefsEntity item : model.getEntities()) {
			BindSharedPreferencesBuilder.generate(elementUtils, filer, item);
		}
	}
293645
public function generateClass(array $config, $outputDirectory, $mode = false)
    {
        if (true === $mode) {
            $mode = self::MODE_WRITE|self::MODE_OVERRIDE;
        } elseif (false === $mode) {
            $mode = self::MODE_WRITE;
        }

        $className = $this->generateClassName($config);
        $path = $outputDirectory . '/' . $className . '.php';

        if (!($mode & self::MODE_MAPPING_ONLY)) {
            $this->clearInternalUseStatements();
            $code = $this->processTemplatePlaceHoldersReplacements('TypeSystem', $config, static::$deferredPlaceHolders);
            $code = $this->processPlaceHoldersReplacements(static::$deferredPlaceHolders, $code, $config) . "\n";

            if ($mode & self::MODE_WRITE) {
                $dir = dirname($path);
                if (!is_dir($dir)) {
                    mkdir($dir, $this->cacheDirMask, true);
                }
                if (($mode & self::MODE_OVERRIDE) || !file_exists($path)) {
                    file_put_contents($path, $code);
                }
            }
        }

        return [$this->getClassNamespace().'\\'.$className => $path];
    }
432166
def _form_datetimes(days, msecs):
    """"""

    all_datetimes = []
    for i in range(days.size):
        day = int(days[i])
        msec = msecs[i]
        scanline_datetimes = []
        for j in range(int(VALUES_PER_SCAN_LINE / 4)):
            usec = 1000 * (j * VIEW_TIME_ADJUSTMENT + msec)
            delta = (dt.timedelta(days=day, microseconds=usec))
            for k in range(4):
                scanline_datetimes.append(delta.total_seconds())
        all_datetimes.append(scanline_datetimes)

    return np.array(all_datetimes, dtype=np.float64)
651450
def gen_time_intervals(start, end, delta):
    
    curr = start
    while curr < end:
        yield curr
        curr += delta
493651
def GetDisabledOutputClasses(cls):
    
    for _, output_class in iter(cls._disabled_output_classes.items()):
      yield output_class.NAME, output_class
23215
private static ImmutableList<DateTimeFormatter> buildDefaultDateTimeFormatter() {

        return ImmutableList.<DateTimeFormatter>builder()
                    .add(DateTimeFormatter.ISO_LOCAL_DATE_TIME) // ISO with 'T'
                    .add(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss[[.SSSSSSSSS][.SSSSSSS][.SSSSSS][.SSS][.SS][.S][XXXXX][XXXX][x]")) // ISO without 'T'
//               new DateTimeFormatterBuilder().parseLenient().appendPattern("yyyy-MM-dd HH:mm:ss[XXXXX][XXXX][x]").appendFraction(ChronoField.MICRO_OF_SECOND, 0, 9, true)
                    .add(DateTimeFormatter.ISO_DATE) // ISO with or without time
                    .add(new DateTimeFormatterBuilder().parseCaseInsensitive().appendPattern("dd-MMM-yy[ HH:mm:ss]").toFormatter()) // another common case
                    .build();
    }
288861
public function createOutputDir()
    {
        $outputDir = $this->configuration->get('output');

        if (!is_writable($outputDir)) {
            @mkdir($outputDir, 0777, true);

            if (!is_writable($outputDir)) {
                throw new \RuntimeException("Output directory {$outputDir} is not writable.");
            }
        }
    }
372920
def copy_files(files_type, class_dir, output):
    
    # get the last part within the file
    class_name = path.split(class_dir)[1]
    for (files, folder_type) in files_type:
        full_path = path.join(output, folder_type, class_name)

        pathlib.Path(full_path).mkdir(
            parents=True, exist_ok=True)
        for f in files:
            shutil.copy2(f, full_path)
466397
def generate_output(listing, title, date):
    
    listing_string = '{0}\n{1}\n\n'.format(title, date)
    for entry in listing:
        listing_string += '\n'.join(entry) + '\n***\n'
    return listing_string
528107
private DecompilerSettings getDefaultSettings(File outputDir)
    {
        DecompilerSettings settings = new DecompilerSettings();
        procyonConf.setDecompilerSettings(settings);
        settings.setOutputDirectory(outputDir.getPath());
        settings.setShowSyntheticMembers(false);
        settings.setForceExplicitImports(true);

        if (settings.getTypeLoader() == null)
            settings.setTypeLoader(new ClasspathTypeLoader());
        return settings;
    }