<commit_before># http://docs.python.org/library/stdtypes.html#string-methods
class String extends Sequence
  __contains__: (operand) ->
    if isSubInstance(operand, @)
      return @value.indexOf(operand) > -1
    else
      super operand

  __add__: (operand) ->
    if isSubInstance(operand, @)
      return @value + operand
    else
      super operand
  
  capitalize: ->
    if @__len__ is 0
      return @value
    else
      return @value[0].toUpperCase() + @.lower().slice(1)

  center: (width, fillchar = " ") ->
    if width <= @__len__()
      return @value
    delta = width - @__len__()
    pad = ''
    pad = for i in Math.floor(delta, 2)
            pad += fillchar
    if delta % 2 == 0
      return pad + @value + pad
    else
      return pad + @value + pad + fillchar

  count: (sub, start = 0, end = @__len__()) ->
    count = 0
    curIndex = start
    while curIndex < end
      substringIndex = @value.indexOf(sub, curIndex)
      if substringIndex < 0
        break
      else
        curIndex = substringIndex + sub.__len__()
        count++
    return count
  
  decode: -> return
  encode: -> return
  endswith: -> return
  expandtabs: -> return
  
  find: (sub, start = 0, end = @__len__()) ->
    substr = @value.slice(start, end)
    return substr.indexOf(sub)

  format: -> return
  
  index: (sub, start = 0, end = @__len__()) ->
    substr = @value.slice(start, end)
    index = substr.indexOf(sub)
    if index == -1
      (new ValueError "substring not found").raise()
    else
      return index

  isalnum: ->
    alnums = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in alnums
          return false
      return true

  isalpha: ->
    alphas = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in alphas
          return false
      return true
  
  isdigit: ->
    digits = '0123456789'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in digits
          return false
      return true

  islower: ->
    lowers = 'abcdefghijklmnopqrstuvwxyz'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in lowers
          return false
      return true
  
  isspace: ->
    spaces = '\t\n\x0b\x0c\r '
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in spaces
          return false
      return true

  istitle: ->
    words = @value.split ' '
    for word in words
      if not String(word[0]).isupper()
        return false
      if word.length == 1
        continue
      if not String(word[0]).islower()
        return false
    return true
  
  isupper: ->
    uppers = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in uppers
          return false
      return true

  join: (iterable) -> return
  ljust: (width, fillchar = ' ') -> return
  
  lower: ->
    return @value.toLowerCase()

  lstrip: (chars) -> return

  partition: (sep) -> return #if using regex in split, need to be careful to escape chars

  upper: ->
    return @value.toUpperCase()
  
  zfill: (width) ->
    if width <= @__len__()
      return @value
    if @value.__len__() == 0
      return String('0').__mul__(width)
    zeroCount = width - @__len__()
    if @value[0] == '-'<commit_msg>Fixed center and added ljust by using __mul__<commit_after># http://docs.python.org/library/stdtypes.html#string-methods
class String extends Sequence
  __contains__: (operand) ->
    if isSubInstance(operand, @)
      return @value.indexOf(operand) > -1
    else
      super operand
  
  capitalize: ->
    if @__len__ is 0
      return @value
    else
      return @value[0].toUpperCase() + @.lower().slice(1)

  center: (width, fillchar = " ") ->
    if width <= @__len__()
      return @value
    delta = width - @__len__()
    pad = String('').__mul__(Math.floor(delta, 2))
    if delta % 2 == 0
      return pad + @value + pad
    else
      return pad + @value + pad + fillchar

  count: (sub, start = 0, end = @__len__()) ->
    count = 0
    curIndex = start
    while curIndex < end
      substringIndex = @value.indexOf(sub, curIndex)
      if substringIndex < 0
        break
      else
        curIndex = substringIndex + String(sub).__len__()
        count++
    return count
  
  decode: -> return
  encode: -> return
  endswith: (suffix, start, end) ->
    return @value.slice(start, end).lastIndexOf(suffix) > -1

  expandtabs: -> return
  
  find: (sub, start = 0, end = @__len__()) ->
    substr = @value.slice(start, end)
    return substr.indexOf(sub)

  format: -> return
  
  index: (sub, start = 0, end = @__len__()) ->
    substr = @value.slice(start, end)
    index = substr.indexOf(sub)
    if index == -1
      (new ValueError "substring not found").raise()
    else
      return index

  isalnum: ->
    alnums = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in alnums
          return false
      return true

  isalpha: ->
    alphas = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in alphas
          return false
      return true
  
  isdigit: ->
    digits = '0123456789'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in digits
          return false
      return true

  islower: ->
    lowers = 'abcdefghijklmnopqrstuvwxyz'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in lowers
          return false
      return true
  
  isspace: ->
    spaces = '\t\n\x0b\x0c\r '
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in spaces
          return false
      return true

  istitle: ->
    words = @value.split ' '
    for word in words
      if not String(word[0]).isupper()
        return false
      if word.length == 1
        continue
      if not String(word[0]).islower()
        return false
    return true
  
  isupper: ->
    uppers = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    if @__len__() == 0
      return false
    else
      for char in @value
        if not char in uppers
          return false
      return true

  join: (iterable) -> return

  ljust: (width, fillchar = ' ') ->
    if width <= @__len__()
      return @value
    delta = width - @__len__()
    pad = String('').__mul__(delta)
    return @value + pad    
  
  lower: ->
    return @value.toLowerCase()

  lstrip: (chars) -> return

  partition: (sep) -> return #if using regex in split, need to be careful to escape chars

  upper: ->
    return @value.toUpperCase()
  
  zfill: (width) ->
    if width <= @__len__()
      return @value
    if @value.__len__() == 0
      return String('0').__mul__(width)
    zeroCount = width - @__len__()
    if @value[0] == '-'
{'fraction_non_alphanumeric': 0.1083716395041092, 'fraction_numerical': 0.013233040813483771, 'mean_word_length': 2.0449533502968618, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 57, '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': '1749095', 'n_tokens_mistral': 2446, 'n_tokens_neox': 2338, 'n_words': 697}