-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
543 lines (416 loc) · 12.8 KB
/
__init__.py
File metadata and controls
543 lines (416 loc) · 12.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
from __future__ import print_function
__all__ = [
"AttributedCharacterIterator",
"CharacterIterator",
"DateFormat",
"DateFormatSymbols",
"FieldPosition",
"Format",
"NumberFormat",
"ParsePosition",
"SimpleDateFormat",
]
from typing import Any, Dict, List, Optional, Set, Union
from java.lang import Number, Object, StringBuffer
from java.math import RoundingMode
from java.util import Calendar, Currency, Date, Locale, TimeZone
class CharacterIterator(object):
DONE = None # type: str
def clone(self):
# type: () -> str
raise NotImplementedError
def current(self):
# type: () -> str
raise NotImplementedError
def first(self):
# type: () -> str
raise NotImplementedError
def getBeginIndex(self):
# type: () -> int
raise NotImplementedError
def getEndIndex(self):
# type: () -> int
raise NotImplementedError
def getIndex(self):
# type: () -> int
raise NotImplementedError
def last(self):
# type: () -> str
raise NotImplementedError
def next(self):
# type: () -> str
raise NotImplementedError
def previous(self):
# type: () -> str
raise NotImplementedError
def setIndex(self, position):
# type: (int) -> str
raise NotImplementedError
class AttributedCharacterIterator(CharacterIterator):
class Attribute(Object):
INPUT_METHOD_SEGMENT = None # type: AttributedCharacterIterator.Attribute
LANGUAGE = None # type: AttributedCharacterIterator.Attribute
READING = None # type: AttributedCharacterIterator.Attribute
def clone(self):
# type: () -> str
raise NotImplementedError
def current(self):
# type: () -> str
raise NotImplementedError
def first(self):
# type: () -> str
raise NotImplementedError
def getAllAttributeKeys(self):
# type: () -> Set[AttributedCharacterIterator.Attribute]
raise NotImplementedError
def getAttribute(self, attribute):
# type: (AttributedCharacterIterator.Attribute) -> Object
raise NotImplementedError
def getAttributes(self):
# type: () -> Dict[AttributedCharacterIterator.Attribute, Object] # noqa: W505
raise NotImplementedError
def getBeginIndex(self):
# type: () -> int
raise NotImplementedError
def getEndIndex(self):
# type: () -> int
raise NotImplementedError
def getIndex(self):
# type: () -> int
raise NotImplementedError
def last(self):
# type: () -> str
raise NotImplementedError
def next(self):
# type: () -> str
raise NotImplementedError
def previous(self):
# type: () -> str
raise NotImplementedError
def setIndex(self, position):
# type: (int) -> str
raise NotImplementedError
class FieldPosition(Object):
def __init__(self, *args):
# type: (*Any) -> None
super(FieldPosition, self).__init__()
print(args)
def getBeginIndex(self):
# type: () -> int
pass
def getEndIndex(self):
# type: () -> int
pass
def getField(self):
# type: () -> Any
pass
def getFieldAttribute(self):
# type: () -> Format.Field
pass
def setBeginIndex(self, bi):
# type: (int) -> None
pass
def setEndIndex(self, ei):
# type: (int) -> None
pass
class Format(Object):
class Field(AttributedCharacterIterator.Attribute):
pass
def clone(self):
# type: () -> Object
pass
def formatToCharacterIterator(self, obj):
# type: (Object) -> AttributedCharacterIterator
pass
def parseObject(self, source, pos=None):
# type: (Union[str, unicode], Optional[ParsePosition]) -> Object
pass
class DateFormat(Format):
AM_PM_FIELD = None # type: int
DATE_FIELD = None # type: int
DAY_OF_WEEK_FIELD = None # type: int
DAY_OF_WEEK_IN_MONTH_FIELD = None # type: int
DAY_OF_YEAR_FIELD = None # type: int
DEFAULT = None # type: int
ERA_FIELD = None # type: int
FULL = None # type: int
HOUR_OF_DAY0_FIELD = None # type: int
HOUR_OF_DAY1_FIELD = None # type: int
HOUR0_FIELD = None # type: int
HOUR1_FIELD = None # type: int
LONG = None # type: int
MEDIUM = None # type: int
MILLISECOND_FIELD = None # type: int
MONTH_FIELD = None # type: int
SECOND_FIELD = None # type: int
SHORT = None # type: int
TIMEZONE_FIELD = None # type: int
WEEK_OF_MONTH_FIELD = None # type: int
WEEK_OF_YEAR_FIELD = None # type: int
YEAR_FIELD = None # type: int
def format(
self,
date, # type: Union[Date, Object]
toAppendTo=None, # type: Optional[StringBuffer]
pos=None, # type: Optional[FieldPosition]
): # type: (...) -> Union[str, unicode, StringBuffer]
pass
@staticmethod
def getAvailableLocales():
# type: () -> List[Locale]
pass
def getCalendar(self):
# type: () -> Calendar
pass
@staticmethod
def getDateInstance(style=None, aLocale=None):
# type: (Optional[int], Optional[Locale]) -> DateFormat
pass
@staticmethod
def getDateTimeInstance():
# type: () -> DateFormat
pass
@staticmethod
def getInstance():
# type: () -> DateFormat
pass
def getNumberFormat(self):
# type: () -> NumberFormat
pass
@staticmethod
def getTimeInstance(style, aLocale=None):
# type: (int, Optional[Locale]) -> DateFormat
pass
def getTimeZone(self):
# type: () -> TimeZone
pass
def isLenient(self):
# type: () -> bool
return True
def parse(self, source):
# type: (Union[str, unicode]) -> Date
pass
def setCalendar(self, newCalendar):
# type: (Calendar) -> None
pass
def setLenient(self, lenient):
# type: (bool) -> None
pass
def setNumberFormat(self, newNumberFormat):
# type: (NumberFormat) -> None
pass
def setTimeZone(self, zone):
# type: (TimeZone) -> None
pass
class DateFormatSymbols(Object):
def __init__(self, locale=None):
# type: (Optional[Locale]) -> None
super(DateFormatSymbols, self).__init__()
print(locale)
def clone(self):
# type: () -> Object
pass
def getAmPmStrings(self):
# type: () -> List[Union[str, unicode]]
pass
@staticmethod
def getAvailableLocales():
# type: () -> List[Locale]
pass
def getEras(self):
# type: () -> List[Union[str, unicode]]
pass
@staticmethod
def getInstance(locale=None):
# type: (Optional[Locale]) -> DateFormatSymbols
pass
def getLocalPatternChars(self):
# type: () -> Union[str, unicode]
pass
def getMonths(self):
# type: () -> List[Union[str, unicode]]
pass
def getShortMonths(self):
# type: () -> List[Union[str, unicode]]
pass
def getShortWeekdays(self):
# type: () -> List[Union[str, unicode]]
pass
def getWeekdays(self):
# type: () -> List[Union[str, unicode]]
pass
def getZoneStrings(self):
# type: () -> List[List[Union[str, unicode]]]
pass
def setAmPmStrings(self, newAmpms):
# type: (List[Union[str, unicode]]) -> None
pass
def setEras(self, newEras):
# type: (List[Union[str, unicode]]) -> None
pass
def setLocalPatternChars(self, newLocalPatternChars):
# type: (Union[str, unicode]) -> None
pass
def setMonths(self, newMonths):
# type: (List[Union[str, unicode]]) -> None
pass
def setShortMonths(self, newShortMonths):
# type: (List[Union[str, unicode]]) -> None
pass
def setShortWeekdays(self, newShortWeekdays):
# type: (List[Union[str, unicode]]) -> None
pass
def setWeekdays(self, newWeekdays):
# type: (List[Union[str, unicode]]) -> None
pass
def setZoneStrings(self, newZoneStrings):
# type: (List[List[Union[str, unicode]]]) -> None
pass
class NumberFormat(Format):
class Field(Format.Field):
CURRENCY = None # type: NumberFormat.Field
DECIMAL_SEPARATOR = None # type: NumberFormat.Field
EXPONENT = None # type: NumberFormat.Field
EXPONENT_SIGN = None # type: NumberFormat.Field
EXPONENT_SYMBOL = None # type: NumberFormat.Field
FRACTION = None # type: NumberFormat.Field
GROUPING_SEPARATOR = None # type: NumberFormat.Field
INTEGER = None # type: NumberFormat.Field
PERCENT = None # type: NumberFormat.Field
PERMILLE = None # type: NumberFormat.Field
SIGN = None # type: NumberFormat.Field
FRACTION_FIELD = None # type: int
INTEGER_FIELD = None # type: int
def format(
self,
number, # type: Union[float, long, Object]
toAppendTo=None, # type: Optional[StringBuffer]
pos=None, # type: Optional[FieldPosition]
):
# type: (...) -> Union[str, unicode, StringBuffer]
raise NotImplementedError
@staticmethod
def getAvailableLocales():
# type: () -> List[Locale]
pass
def getCurrency(self):
# type: () -> Currency
pass
@staticmethod
def getCurrencyInstance(inLocale=None):
# type: (Optional[Locale]) -> NumberFormat
pass
@staticmethod
def getInstance(inLocale=None):
# type: (Optional[Locale]) -> NumberFormat
pass
@staticmethod
def getIntegerInstance(inLocale=None):
# type: (Optional[Locale]) -> NumberFormat
pass
def getMaximumFractionDigits(self):
# type: () -> int
pass
def getMaximumIntegerDigits(self):
# type: () -> int
pass
def getMinimumFractionDigits(self):
# type: () -> int
pass
def getMinimumIntegerDigits(self):
# type: () -> int
pass
@staticmethod
def getNumberInstance(inLocale=None):
# type: (Optional[Locale]) -> NumberFormat
pass
@staticmethod
def getPercentInstance(inLocale=None):
# type: (Optional[Locale]) -> NumberFormat
pass
def getRoundingMode(self):
# type: () -> RoundingMode
pass
def isGroupingUsed(self):
# type: () -> bool
return True
def isParseIntegerOnly(self):
# type: () -> bool
return True
def parse(self, source):
# type: (Union[str, unicode]) -> Number
pass
def setCurrency(self, currency):
# type: (Currency) -> None
pass
def setGroupingUsed(self, newValue):
# type: (bool) -> None
pass
def setMaximumFractionDigits(self, newValue):
# type: (int) -> None
pass
def setMaximumIntegerDigits(self, newValue):
# type: (int) -> None
pass
def setMinimumFractionDigits(self, newValue):
# type: (int) -> None
pass
def setMinimumIntegerDigits(self, newValue):
# type: (int) -> None
pass
def setParseIntegerOnly(self, value):
# type: (bool) -> None
pass
def setRoundingMode(self, roundingMode):
# type: (RoundingMode) -> None
pass
class ParsePosition(Object):
def __init__(self, index):
# type: (int) -> None
super(ParsePosition, self).__init__()
print(index)
def getErrorIndex(self):
# type: () -> int
pass
def getIndex(self):
# type: () -> int
pass
def setErrorIndex(self, ei):
# type: (int) -> None
pass
def setIndex(self, index):
# type: (int) -> None
pass
class SimpleDateFormat(DateFormat):
def __init__(
self,
pattern=None, # type: Union[str, unicode, None]
arg=None, # type: Union[DateFormatSymbols, Locale, None]
):
# type: (...) -> None
super(SimpleDateFormat, self).__init__()
print(pattern, arg)
def applyLocalizedPattern(self, pattern):
# type: (Union[str, unicode]) -> None
pass
def applyPattern(self, pattern):
# type: (Union[str, unicode]) -> None
pass
def get2DigitYearStart(self):
# type: () -> Date
pass
def getDateFormatSymbols(self):
# type: () -> DateFormatSymbols
pass
def set2DigitYearStart(self, startDate):
# type: (Date) -> None
pass
def setDateFormatSymbols(self, newFormatSymbols):
# type: (DateFormatSymbols) -> None
pass
def toLocalizedPattern(self):
# type: () -> Union[str, unicode]
pass
def toPattern(self):
# type: () -> Union[str, unicode]
pass