<commit_before>package com.hubspot.jinjava.lib.filter;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

import com.hubspot.jinjava.doc.annotations.JinjavaDoc;
import com.hubspot.jinjava.doc.annotations.JinjavaParam;
import com.hubspot.jinjava.doc.annotations.JinjavaSnippet;
import com.hubspot.jinjava.interpret.JinjavaInterpreter;
import com.hubspot.jinjava.lib.fn.Functions;
import com.hubspot.jinjava.objects.date.StrftimeFormatter;

@JinjavaDoc(
    value = "Formats a date object",
    input = @JinjavaParam(value = "value", defaultValue = "current time", desc = "The date variable or UNIX timestamp to format", required = true),
    params = {
        @JinjavaParam(value = "format", defaultValue = StrftimeFormatter.DEFAULT_DATE_FORMAT, desc = "The format of the date determined by the directives added to this parameter"),
        @JinjavaParam(value = "timezone", defaultValue = "utc", desc = "Time zone of output date")
    },
    snippets = {
        @JinjavaSnippet(code = "{% content.updated|datetimeformat('%B %e, %Y') %}"),
        @JinjavaSnippet(code = "{% content.updated|datetimeformat('%a %A %w %d %e %b %B %m %y %Y %H %I %k %l %p %M %S %f %z %Z %j %U %W %c %x %X %%') %}")
    })
public class DateTimeFormatFilter implements Filter {

  @Override
  public String getName() {
    return "datetimeformat";
  }

  @Override
  public Object filter(Object var, JinjavaInterpreter interpreter,
      Object... args) {

    List<String> stringArgs = new ArrayList<>();
    for (Object arg: args) {
        stringArgs.add(Objects.toString(arg));
    }
    String[] filterArgs = new String[stringArgs.size()];
    for (int i = 0; i < filterArgs.length; i++) {
        filterArgs[i] = stringArgs.get(i);
    }

    if (args.length > 0) {
      return Functions.dateTimeFormat(var, filterArgs);
    } else {
      return Functions.dateTimeFormat(var);
    }<commit_msg>Removes stringArgs from DateTimeFormatFilter<commit_after>package com.hubspot.jinjava.lib.filter;

import java.util.Objects;

import com.hubspot.jinjava.doc.annotations.JinjavaDoc;
import com.hubspot.jinjava.doc.annotations.JinjavaParam;
import com.hubspot.jinjava.doc.annotations.JinjavaSnippet;
import com.hubspot.jinjava.interpret.JinjavaInterpreter;
import com.hubspot.jinjava.lib.fn.Functions;
import com.hubspot.jinjava.objects.date.StrftimeFormatter;

@JinjavaDoc(
    value = "Formats a date object",
    input = @JinjavaParam(value = "value", defaultValue = "current time", desc = "The date variable or UNIX timestamp to format", required = true),
    params = {
        @JinjavaParam(value = "format", defaultValue = StrftimeFormatter.DEFAULT_DATE_FORMAT, desc = "The format of the date determined by the directives added to this parameter"),
        @JinjavaParam(value = "timezone", defaultValue = "utc", desc = "Time zone of output date")
    },
    snippets = {
        @JinjavaSnippet(code = "{% content.updated|datetimeformat('%B %e, %Y') %}"),
        @JinjavaSnippet(code = "{% content.updated|datetimeformat('%a %A %w %d %e %b %B %m %y %Y %H %I %k %l %p %M %S %f %z %Z %j %U %W %c %x %X %%') %}")
    })
public class DateTimeFormatFilter implements Filter {

  @Override
  public String getName() {
    return "datetimeformat";
  }

  @Override
  public Object filter(Object var, JinjavaInterpreter interpreter,
      Object... args) {

    String[] filterArgs = new String[args.length];
    for (int i = 0; i < filterArgs.length; i++) {
        filterArgs[i] = Objects.toString(args[i]);
    }

    if (args.length > 0) {
      return Functions.dateTimeFormat(var, filterArgs);
    } else {
      return Functions.dateTimeFormat(var);
    }
{'fraction_non_alphanumeric': 0.13409648405560098, 'fraction_numerical': 0.0010902153175252113, 'mean_word_length': 3.8544973544973544, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1919734', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1161, 'n_words': 300}